Skip to content
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

Detect the input file of referenced project with fileNames from parsed command line #27195

Merged
merged 2 commits into from
Sep 18, 2018

Conversation

sheetalkamat
Copy link
Member

Fixes #25864 and #26054

@sheetalkamat sheetalkamat changed the base branch from moduleResolutionWithOutDir to master September 18, 2018 18:52
@sheetalkamat sheetalkamat changed the base branch from master to moduleResolutionWithOutDir September 18, 2018 18:53
Copy link
Contributor

@ajafff ajafff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work for transitive projectReferenes? I'm asking because I struggled with that too.

// @filename: tsconfig.a.json
{"compilerOptions": {"composite"}, "files": ["a.ts"]}

// @filename: a.ts
export class A {}

// @filename: tsconfig.b.json
{"compilerOptions": {"composite"}, "files": ["b.ts"], "references": [{"path": "tsconfig.a.json"}]}

// @filename: b.ts
import {A} from './a';
export const b = new A();

// @filename: tsconfig.c.json
{"files": ["c.ts"], "references": [{"path": "tsconfig.b.json"}]}

// @filename: c.ts
import {b} from './b';
console.log(b);

Compiling tsconfig.c.json should resolve imports as b.d.ts and a.d.ts. I guess the current implementation resolves imports to b.d.ts and a.ts.

Copy link
Member

@RyanCavanaugh RyanCavanaugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to add the testcase proposed by ajafff

@RyanCavanaugh RyanCavanaugh added this to the TypeScript 3.1 milestone Sep 18, 2018
@sheetalkamat
Copy link
Member Author

Created #27200 for the transitive issue which wont be part of this PR.

@sheetalkamat sheetalkamat merged commit 089b86a into master Sep 18, 2018
@sheetalkamat sheetalkamat deleted the projectReferenceInputDetection branch September 18, 2018 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants