fix(js): do not report non-composite projects as missing root references - #36559
Draft
FrozenPandaz wants to merge 2 commits into
Draft
fix(js): do not report non-composite projects as missing root references#36559FrozenPandaz wants to merge 2 commits into
FrozenPandaz wants to merge 2 commits into
Conversation
The root tsconfig's project references are filtered by `composite` only when deciding what to write, but `changedFiles` — which drives both the out-of-sync verdict and the user-facing message — is populated before that filter runs. A non-composite project could therefore be named as a missing reference that sync would never actually add, leaving no way to satisfy the message. Moving the check into the first pass keeps `changedFiles` limited to references that can really be written.
✅ Deploy Preview for nx-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
View your CI Pipeline Execution ↗ for commit 10e1cb0
☁️ Nx Cloud last updated this comment at |
Contributor
There was a problem hiding this comment.
Nx Cloud has identified a flaky task in your failed CI:
🔂 Since the failure was identified as flaky, we triggered a CI rerun by adding an empty commit to this branch.
🔔 Heads up, your workspace has pending recommendations ↗ to auto-apply fixes for similar failures.
🎓 Learn more about Self-Healing CI on nx.dev
…ces [Self-Healing CI Rerun]
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current Behavior
The root
tsconfig.json's project references are filtered bycompositeonly when the generator decides what to write:But
changedFiles— which drives both the out-of-sync verdict and the user-facing message — is populated in an earlier pass with no composite filter:A non-composite project can therefore be named as a missing root reference that sync would never actually add. The message asks for something it will not do, and there is no way to satisfy it.
This is visible in this repo. Adding
"composite": truetoexamples/react/basic/tsconfig.base.jsonand runningsync:checkreports 13 missing references, but onlyexamples/react/basicwas ever a real candidate — the other 12 areangular-rspackexamples that are not composite and would have been dropped before writing.Expected Behavior
The composite check runs in the first pass, so
changedFilesonly ever contains references that could really be written. A non-composite project is no longer named as a reason the workspace is out of sync.Pre-existing references still skip that pass, so the filter at write time stays.
Verification
One new test, which fails on
masterand passes here:nx run-many -t test,lint -p jspasses (830 tests).Related Issue(s)
Split out of NXC-4734. This half is independent of the approach discussion on that ticket and stands on its own.