-
Notifications
You must be signed in to change notification settings - Fork 954
chore: prefer nx over lerna where possible #5965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: prefer nx over lerna where possible #5965
Conversation
218903d to
cd575d0
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5965 +/- ##
=======================================
Coverage 95.17% 95.17%
=======================================
Files 316 316
Lines 8521 8521
Branches 1763 1763
=======================================
Hits 8110 8110
Misses 411 411 🚀 New features to boost your workflow:
|
e14008e to
e36bb56
Compare
e36bb56 to
71d60f2
Compare
| "peerDependencies": { | ||
| "@opentelemetry/api": "^1.9.0" | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: this was failing on the peer-api-check - I'm not sure why we did not include it for experimental packages, it should also apply to these.
| - name: Install script dependencies | ||
| run: npm ci --ignore-scripts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I did this here as a drive-by. Will do this where possible in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in #5971
| "prepare_release:semconv:patch": "npm run _check:no_changes && npm run _backup:package-json && npm run _lerna:remove_everything_except_semconv && npm run _lerna:version_patch && npm run _restore:package-json && npm run _changelog:prepare_semconv", | ||
| "prepare_release:semconv:minor": "npm run _check:no_changes && npm run _backup:package-json && npm run _lerna:remove_everything_except_semconv && npm run _lerna:version_minor && npm run _restore:package-json && npm run _changelog:prepare_semconv", | ||
| "prepare_release:all:minor": "npm run _check:no_changes && npm run _backup:package-json && npm run _lerna:remove_api && npm run _lerna:remove_semconv && npm run _lerna:version_minor && cd api/ && npm version minor && cd .. && lerna run align-api-deps && npm run _restore:package-json && npm run _changelog:prepare_all", | ||
| "prepare_release:experimental": "npm run _check:no_changes && npm run _backup:package-json && npm run _workspace:remove_api && npm run _workspace:remove_semconv && npm run _workspace:remove_stable && npm run _workspace:bump_version && npm run _restore:package-json && npm run _changelog:prepare_experimental", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: lerna was not really necessary for these and I opted to use a custom script instead. Since we need to bump all packages in unison we were mostly working around lerna. The new script scripts/bump-versions.mjs gives us more control and allows us to simplify these scripts further in the future.
I did not go all the way as this is the minimal thing we needed to get it working without lerna :)
david-luna
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a nit and a question
Which problem is this PR solving?
Drops
lernafornxwherever possible. This is necessary aslerna@9for publishing with OIDC, and it might not work with Node.js <20.19 - also it pulls in a newernxversion that drops support for this Node.js version.nx@20andlerna@9we can use the oldernxversion for dev and testing, and the newerlernaversion for publishing. Once we drop support for older Node.js versions, we can start using the same versions again.The setup on the
nxscripts is heavliy based on the migration work that @david-luna did in the contrib repo 🙂 A nice side-effect of this PR is that we will be closer aligned with contrib tooling.Full disclosure: I did ✨vibe-code✨ the
bump-versions.mjsscript. I think it turned out alright.