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
allow baseUrl, paths, rootDirs in tsconfig files #849
Conversation
Add the above as valid tsconfig.json properties. Note: this change does not necessarily make these properties functional, it simply allows them to be passed to the transpiler. `baseUrl` and `paths` seem to work. `rootDirs` has not been verified and might not be functioning (at least on cur. typescript@next). TODO: this does not yet deeply validate the paths and rootDirs properties.
Add the above as valid tsconfig.json properties. Note: this does not yet deeply validate the paths and rootDirs properties. Closes TypeStrong#833
+1 |
@laurelnaiad I've added you as an owner. Please do whatever you want with this package. Merge then publish https://github.com/TypeStrong/atom-typescript/blob/master/CONTRIBUTING.md#publishing then write notes at https://github.com/TypeStrong/atom-typescript/releases Feel free to @ mention me if you need any help. |
@basarat !? :( Yikes. I'll do what I can.... does this mean that you're really backing off on atom-typescript? I can't carry your load.... more hands, sharper tacks needed..... I will have questions for you when I have some breathing room from project work. |
Don't worry you are just one of the many people. Just means that I trust your code explicitly and don't feel the need to review it
I'm trying to limit my OSS work, sticking to StackOverflow + alm.tools + typescript book. Focus for this year is revising Algorithms and Data Structures |
Ok... I'll look at the rootDirs situation tomorrow and see if I can finish this off with the accoutrements that an owner would provide.... :) |
I'm developing a theory that this PR leaves behind an issue relating to LanguageServiceHost(2) losing track of files. I'm wondering whether it's receiving partial paths where it clearly wants absolute ones. All I know for sure so far is that my instances of "The file '/Users/dmaddox/.../somewhere/suchAndSuch.ts' is not included in the Typescript compilation context. If this is not intended..." have gone way up. Hopefully I'll have some time soon to dig into this. |
I locally had implemented this same concept slightly differently than in your PR, and I saw the same problem. If I have time on Monday, I'll try to dig into resolving those issues with you. Michael Owens
|
Strong circumstantial evidence that non-rooted paths are sneaking their way into places they shouldn't be: This is an exerpt from having done the following logging in the source:
from project.ts
Those non-rooted paths just happen to be some of the ones that are being reported as "not in a compilation context". |
I find it slightly odd, I guess, that in the presence of tsconfig files that have files arrays, that we'd be asking tsc for a list of files in the project... but I guess there are reasons. In any case, I guess the fix is to resolve to rooted-paths... wherever that lands is probably also a reasonable place/time to address rootDirs, I suppose. |
|
Me, too! :) I tried hacking at the I am going to try to carve out a little time this weekend to find an alternative function to hack. :) |
@@ -234,6 +240,9 @@ export var defaults: ts.CompilerOptions = { | |||
target: ts.ScriptTarget.ES5, | |||
module: ts.ModuleKind.CommonJS, | |||
moduleResolution: ts.ModuleResolutionKind.NodeJs, | |||
baseUrl: undefined, | |||
paths: undefined, | |||
rootDirs: undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to provide defaults if they are not activated (basically let the TS compiler do its own default thing). Also explicit undefined initialization not needed (it undefined
on read anyways)
I just added the support to http://alm.tools : alm-tools/alm#73 The only thing missing from this PR I think is that |
rootDirs would just work too if the path resolution is done up front. See alm-tools/alm#74 for commit |
Hello guys, any news when this will come out? |
+1 |
Superceeded by (now merged) #996 |
Re: #833, Add the above as valid tsconfig.json properties.
Note: this change does not necessarily make these properties functional, it
simply allows them to be passed to the transpiler.
baseUrl
andpaths
seem to work.rootDirs
has not been verified andmight not be functioning (at least on cur. typescript@next).
TODO: this does not yet deeply validate the paths and rootDirs properties.
I plan to mark this as closing the issue if I can figure out what's up with rootDirs as time permits, but this might be merge-able now as a starting point.