Skip to content

Improve TS 1.5 support. #323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MicahZoltu opened this issue May 2, 2015 · 5 comments
Closed

Improve TS 1.5 support. #323

MicahZoltu opened this issue May 2, 2015 · 5 comments
Assignees

Comments

@MicahZoltu
Copy link

https://github.com/TypeStrong/atom-typescript/blob/master/lib/main/tsconfig/tsconfig.ts#L9

TS 1.5 is now available via npm install typescript. Since this plugin now uses that, I believe it is safe to follow-through with that TODO.

@MicahZoltu
Copy link
Author

Personal Note:
My interest lies primarily in support for rootDir. I am trying to slowly migrate an ES6 project over to TypeScript and that means some of the first things migrated will be files nested inside of folders. Currently, I cannot get this plugin to work correctly because it throws my build output in the wrong location.

@basarat basarat self-assigned this May 4, 2015
@basarat
Copy link
Member

basarat commented May 4, 2015

Note: I think using rootDir is a bad idea : microsoft/TypeScript#2034 (comment) but YMMV.

@basarat basarat closed this as completed in 84726f8 May 4, 2015
@basarat
Copy link
Member

basarat commented May 4, 2015

We cannot use ts.parse because of the validation stuff we do. Please raise an issue if there are any other compiler flags you need supported 🌹

@MicahZoltu
Copy link
Author

Thanks! As to why rootDir:

My project structure usually looks something like:

  • project
    • tsconfig.json
    • package.json
    • config.js
    • gulpfile.js
    • source
      • index.ts
      • index.html
      • styles.css
      • subdirectory
        • index.html
        • styles.css
        • index.ts
    • output
      • <same as source, but transpiled/copied>
    • npm_modules
    • jspm_modules

As you can see, my source tree is not rooted at my tsconfig.json. This is intentional because I want my source tree to be just source, not a bunch of tool config files, dependency managed files, etc. Because of this structure, I need a way to tell TypeScript that when it builds source/subdirectory/index.ts and has an outDir of output it needs to retain the subdirectory in the path, but not the source in the path.

One of the advantages of this structure is that it allows my tooling to glob on source. If you were to glob on the root directory, you would have to be sure to ignore all of the dependency managed folders as well as all of the various config files. I find it easier (and cleaner) to just keep all of my source code separate from the project metadata which sits in the root folder.

@basarat
Copy link
Member

basarat commented May 5, 2015

I find it easier (and cleaner) to just keep all of my source code separate from the project metadata which sits in the root folder.

Cool. Previously I would just move tsconfig.json into the source folder and then outDir to ../output. But I see the benefit of tsconfig.json being where you have put it. Thanks for taking the time to share 🌹

@TypeStrong TypeStrong locked and limited conversation to collaborators Jan 20, 2019
angelestelar5z added a commit to angelestelar5z/atom-typescript that referenced this issue Aug 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants