feat(ci): refactor updateProjectReferences#17317
Merged
Conversation
…ig.lib consistently
Nodonisko
approved these changes
Feb 28, 2025
Contributor
Nodonisko
left a comment
There was a problem hiding this comment.
LGTM! Thanks for fixing it 👍 🚀
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.
Description
As discovered in #17234, the
updateProjectReferences.tsscript does not treat tsconfig.ts & tsconfig.lib.ts consistently.Currently you can push incomplete
tsconfig.lib.jsonto master; it will pass CI, becauseyarn verify-project-referencesthrows only ontsconfig.json. Butyarn update-project-referencesmodifies alsotsconfig.lib.json.This is inconsistent,
yarn verify-project-referencesshould throw if there are any changes that would be modified byyarn update-project-references.➡️ fixed it, and reorganized the code while doing that; I hope it will be easier to read now 🙂
QA
I tried:
yarn verify-project-referencespasses ✔️yarn refspasses with no change ✔️tsconfig.ts,tsconfig.lib.tsor both), by either (adding line, removing line, swapping lines or removing references altogether) and then first running:yarn verify-project-referencesto make sure it throws ✔️yarn refsto make sure it corrects to original state (no git diff) ✔️tsconfig.ts:yarn verify-project-referencesthrows ✔️yarn refsrecreates it, but not necessarily to the same state (the defaultConfig has some different fields) 🤷tsconfig.lib.ts: both scripts pass, no change ✔️