Port rootDir default to configFile directory and some module resoluton fixes#2521
Port rootDir default to configFile directory and some module resoluton fixes#2521sheetalkamat merged 2 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR ports TypeScript PR #62418, which changes the default behavior for rootDir to be the directory containing the config file when rootDir is not explicitly specified. Previously, this defaulting only occurred for composite projects. The change also includes related module resolution fixes to properly handle package self-references with outDir and declarationDir.
Changes:
- Modified
rootDirdefault to use config file directory for all projects, not just composite projects - Updated module resolution logic to correctly handle input file lookups for package self-names
- Fixed missing packageId assignment in export/import resolution
- Updated all test baselines to reflect the new output path structure
Reviewed changes
Copilot reviewed 39 out of 40 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
internal/outputpaths/commonsourcedirectory.go |
Removed composite check, now defaults rootDir to config file directory for all projects |
internal/module/resolver.go |
Updated tryLoadInputFileForPath to use config directory for all projects and added missing packageId assignment |
internal/compiler/emitter.go |
Updated comment and condition to check for config file path instead of composite flag |
internal/execute/tsctests/tscbuild_test.go |
Updated test expectation for output path |
| Multiple baseline files | Updated to reflect new output paths with src/ subdirectory structure and corrected module resolution behavior |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Should we get microsoft/TypeScript#62418 in the porting branch of the submodule first so the diffs are clean? |
|
Sheetal asked me about this, and I think actually we should start targeting TS 6.0 in the porting branch, which I wanted to start doing next week, it's just annoying due to some patches that had been applied. In the meantime I think a few diffs is probably okay? |
Port of microsoft/TypeScript#62418