Skip to content

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

Merged
sheetalkamat merged 2 commits intomasterfrom
projectReferenceInputDetection
Sep 18, 2018
Merged

Detect the input file of referenced project with fileNames from parsed command line#27195
sheetalkamat merged 2 commits intomasterfrom
projectReferenceInputDetection

Conversation

@sheetalkamat
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants