fix(core): avoid tsconfig path false positives for sibling project roots#35796
fix(core): avoid tsconfig path false positives for sibling project roots#35796cw-alexcroteau wants to merge 2 commits into
Conversation
👷 Deploy request for nx-docs pending review.Visit the deploys page to approve it
|
👷 Deploy request for nx-dev pending review.Visit the deploys page to approve it
|
|
View your CI Pipeline Execution ↗ for commit 8e92584
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Nx Cloud is proposing a fix for your failed CI:
We ran nx format to fix the format:check failure caused by the newly added regression test in tsconfig-json-changes.spec.ts. The long path strings inside the paths object exceeded prettier's print width, requiring the array values to be wrapped onto separate lines. This formatting change brings the file into compliance with the workspace's code style rules.
Tip
✅ We verified this fix by re-running nx-cloud record -- nx format:check.
Suggested Fix changes
diff --git a/packages/nx/src/plugins/js/project-graph/affected/tsconfig-json-changes.spec.ts b/packages/nx/src/plugins/js/project-graph/affected/tsconfig-json-changes.spec.ts
index a7f893c8..1f665881 100644
--- a/packages/nx/src/plugins/js/project-graph/affected/tsconfig-json-changes.spec.ts
+++ b/packages/nx/src/plugins/js/project-graph/affected/tsconfig-json-changes.spec.ts
@@ -335,14 +335,18 @@ describe('getTouchedProjectsFromTsConfig', () => {
{
compilerOptions: {
paths: {
- '@proj/cdk-utils': ['libs/typescript/cdk-utils/index.ts'],
+ '@proj/cdk-utils': [
+ 'libs/typescript/cdk-utils/index.ts',
+ ],
},
},
},
{
compilerOptions: {
paths: {
- '@proj/cdk-utils': ['libs/typescript/cdk-utils/utils.ts'],
+ '@proj/cdk-utils': [
+ 'libs/typescript/cdk-utils/utils.ts',
+ ],
},
},
}
Because this branch comes from a fork, it is not possible for us to apply fixes directly, but you can apply the changes locally using the available options below.
Apply changes locally with:
npx nx-cloud apply-locally 1lo6-u1jw
Apply fix locally with your editor ↗ View interactive diff ↗
🎓 Learn more about Self-Healing CI on nx.dev
Current Behavior
Root
tsconfigpath changes can mark sibling project roots as touched when they only share a string prefix.Expected Behavior
Only the project whose root contains the changed path, or exactly matches it, should be marked as touched.
Related Issue(s)
Fixes #35795
Summary
getTouchedProjectsFromTsConfigfor sibling roots with shared prefixeslibs/typescript/cdkvslibs/typescript/cdk-utilsSupersedes closed PR #35786.