Uh oh!
There was an error while loading. Please reload this page.
Assume rootDir is the current configuration directory - #62418
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR changes the TypeScript compiler's behavior to assume the configuration file directory as the root directory when rootDir is not explicitly specified. Instead of requiring composite: true to enable this behavior, the change makes it apply whenever a configuration file (configFilePath) is present.
- Removes the requirement for
composite: trueto use the configuration directory as the root - Updates the common source directory resolution logic to use
configFilePathexistence instead ofcomposite && configFilePath - Affects output path generation, module resolution, and emit behavior
Reviewed Changes
Copilot reviewed 57 out of 59 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/compiler/utilities.ts | Updates condition to use configFilePath instead of composite && configFilePath for root directory determination |
| src/compiler/moduleNameResolver.ts | Changes module resolution to assume config directory as root when configFilePath exists |
| src/compiler/emitter.ts | Updates emit logic to use config directory as common source directory when configFilePath is present |
| src/testRunner/unittests/tsbuild/outputPaths.ts | Updates test expectations and adds test name differentiation |
| src/testRunner/unittests/helpers/monorepoSymlinkedSiblingPackages.ts | Adds explicit rootDir to test configurations to maintain expected behavior |
| tests/baselines/reference/* | Multiple baseline file updates reflecting the new output path behavior |
Files not reviewed (1)
- tests/baselines/reference/commonSourceDirectory_dts.js.map: Language not supported
Jake Bailey (jakebailey)
commented
Sep 8, 2025
TypeScript Bot (@typescript-bot) test it |
TypeScript Bot (typescript-bot)
commented
Sep 8, 2025
Hey Jake Bailey (@jakebailey), the results of running the DT tests are ready. Everything looks the same! |
TypeScript Bot (typescript-bot)
commented
Sep 8, 2025
Jake Bailey (@jakebailey) Here are the results of running the user tests with tsc comparing There were infrastructure failures potentially unrelated to your change:
Otherwise... Something interesting changed - please have a look. Details
|
TypeScript Bot (typescript-bot)
commented
Sep 8, 2025
Jake Bailey (@jakebailey) Here they are:tscComparison Report - baseline..pr
System info unknown Hosts
Scenarios
Developer Information: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Jake Bailey (jakebailey)
commented
Sep 8, 2025
Ouch, looking bad for pyright and mui-docs. |
TypeScript Bot (typescript-bot)
commented
Sep 8, 2025
Jake Bailey (@jakebailey) Here are the results of running the top 400 repos with tsc comparing Something interesting changed - please have a look. Details
|
TypeScript Bot (typescript-bot)
commented
Sep 8, 2025
Jake Bailey (@jakebailey) Here are some more interesting changes from running the top 400 repos suite Details
|
TypeScript Bot (typescript-bot)
commented
Sep 8, 2025
Jake Bailey (@jakebailey) Here are some more interesting changes from running the top 400 repos suite Details
|
TypeScript Bot (typescript-bot)
commented
Sep 8, 2025
Jake Bailey (@jakebailey) Here are some more interesting changes from running the top 400 repos suite Details
|
Ryan Cavanaugh (RyanCavanaugh)
commented
Sep 9, 2025
This seems correct but the fallout in resolution in these projects seems like a non sequitur. This is because |
Jake Bailey (jakebailey)
commented
Sep 9, 2025
For pyright, both baseUrl and rootDir are unset (hence them changing): https://github.com/microsoft/pyright/blob/main/packages/pyright/tsconfig.json Perhaps this just means they could explicitly define rootDir to be a parent dir? IIRC the layout should really have used project references, but instead has every project emit each other's files into their own dist (for better or for worse.... mainly the latter). |
Sheetal Nandi (sheetalkamat)
commented
Sep 9, 2025
I think its "tryLoadInputFileForPath" where it tries to guess the input path where there is change in behavior of what we do if "rootDir" is known vs computed |
Uh oh!
There was an error while loading. Please reload this page.
TypeScript Bot (typescript-bot)
commented
Nov 24, 2025
Daniel Rosenwasser (@DanielRosenwasser) Here are the results of running the user tests with tsc comparing There were infrastructure failures potentially unrelated to your change:
Otherwise... Something interesting changed - please have a look. Details
|
TypeScript Bot (typescript-bot)
commented
Nov 24, 2025
Daniel Rosenwasser (@DanielRosenwasser) Here are some more interesting changes from running the user tests suite Details
|
I just tried it out with no issues. |
TypeScript Bot (typescript-bot)
commented
Nov 24, 2025
Daniel Rosenwasser (@DanielRosenwasser) Here they are:tscComparison Report - baseline..pr
System info unknown Hosts
Scenarios
Developer Information: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
TypeScript Bot (typescript-bot)
commented
Nov 24, 2025
Daniel Rosenwasser (@DanielRosenwasser) Here are the results of running the top 400 repos with tsc comparing Something interesting changed - please have a look. Details
|
TypeScript Bot (typescript-bot)
commented
Nov 24, 2025
Daniel Rosenwasser (@DanielRosenwasser) Here are some more interesting changes from running the top 400 repos suite Details
|
TypeScript Bot (typescript-bot)
commented
Nov 24, 2025
Daniel Rosenwasser (@DanielRosenwasser) Here are some more interesting changes from running the top 400 repos suite Details
|
TypeScript Bot (typescript-bot)
commented
Nov 24, 2025
Daniel Rosenwasser (@DanielRosenwasser) Here are some more interesting changes from running the top 400 repos suite Details
|
TypeScript Bot (typescript-bot)
commented
Nov 24, 2025
Daniel Rosenwasser (@DanielRosenwasser) Here are some more interesting changes from running the top 400 repos suite Details
|
Feedback seemed wrong, don't want to block.
Uh oh!
There was an error while loading. Please reload this page.
Fixes#62194