-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): reduce tsconfig paths precedence below pnpm workspace proje…
…ct deps (#7060) An issue found at a client when upgrading from an ancient cli version to more recent. This changes the order of how dependencies can be resolved, reducing the precedence of tsconfig paths to be one of the lowest priorities instead of being on-par with relative file imports. The client use case and the test case added is when a tsconfig file has `paths` essentially just for the IDE dev experience or maybe for legacy non-bazel (or non-pnpm-workspace) reasons. Imports of local workspace projects should use `:node_modules/@wksp/project-a` via package.json instead of `//projects/a` vis tsconfig.json. --- ### Changes are visible to end-users: yes - Searched for relevant documentation and updated as needed: yes - Breaking change (forces users to change their own code or config): no - Suggested release notes appear below: yes Pnpm workspace project dependencies resolved with `aspect configure` are now higher priority then resolving dependencies via tsconfig paths. ### Test plan - Covered by existing test cases - New test cases added GitOrigin-RevId: 7cf0f95489f5600001351d36a7f13500bc465b62
- Loading branch information
Showing
4 changed files
with
84 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// This tsconfig also maps paths but is only for IDEs! | ||
{ | ||
"compilerOptions": { | ||
"paths": { | ||
// The BUILD dependencies should prioritize the `workspace:*` packages | ||
// instead of mapping to the `ts_project` targets that this tsconfig maps to. | ||
"@lib/*": ["lib/*"] | ||
} | ||
} | ||
} |