-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat(release): revamped nx release version implementation #30418
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
View your CI Pipeline Execution ↗ for commit 6fbe6c1.
☁️ Nx Cloud last updated this comment at |
4e2b721
to
0e58904
Compare
ade2b66
to
0eba509
Compare
35f507b
to
4f79396
Compare
45698b3
to
dcb8ea4
Compare
dcb8ea4
to
2630702
Compare
2630702
to
e91f47d
Compare
export default class JsVersionActions extends VersionActions { | ||
manifestFilename = 'package.json'; | ||
|
||
static createAfterAllProjectsVersionedCallback( |
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.
nit: not a fan of this method name. Is postVersioning
callback a better name?
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.
It is now an exported function as discussed. I couldn't help feeling like afterAllProjectsVersioned
is a clearer name because it's not after all of the version logic runs (it's before git for example), so postVersion
felt a little ambiguous
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.
But I have indeed been able to flatten it now too and avoid the higher order function
🐳 We have a release for that!This PR has a release associated with it. You can try it out using this command: npx create-nx-workspace@0.0.0-pr-30418-80f02f7 my-workspace Or just copy this version and use it in your own command: 0.0.0-pr-30418-80f02f7
To request a new release for this pull request, mention someone from the Nx team or the |
🐳 We have a release for that!This PR has a release associated with it. You can try it out using this command: npx create-nx-workspace@0.0.0-pr-30418-6fbe6c1 my-workspace Or just copy this version and use it in your own command: 0.0.0-pr-30418-6fbe6c1
To request a new release for this pull request, mention someone from the Nx team or the |
This PR provides a new implementation for the versioning stage of
nx release
which brings a ton of benefits.Previously unsupported/impossible features now available:
updateDependents
will work across group boundaries as well.package.json
) for a single versioning execution. For example, updating the version and dependencies in both your source and distpackage.json
for a project.Massively improved extensibility for non-JS languages/ecosystems:
ReleaseVersionGenerator
abstraction was distinctly suboptimal because it required each plugin to reimplement a bunch of core business logic related to resolving tags from git, combining current versions and specifiers to produce new semver values, deleting version plans after use etc.VersionActions
class, which exclusively deals with the aspects that make that language/ecosystem unique, such as reading and writing from a manifest file (such aspackage.json
/Cargo.toml
etc) if applicable, reading from a remote registry etc.VersionActions
implementation.Other benefits:
generatorOptions
going away, and most options moving to the top level ofrelease.version
config innx.json
.Resolved the specifier as "minor" using version plans.
Applied semver relative bump "minor", read from version plan .nx/version-plans/bump-mixed1.md, to get new version 0.2.0
preserveLocalDependencyProtocols
is nowtrue
by default and can be omitted from end user configs.Notes on rollout
"useLegacyVersioning": false
inrelease.version
innx.json
.true
.You can see how straightforward it was to manually apply using the PR release from this branch on a real world project here: angular-eslint/angular-eslint#2329
Fixes #21458
Fixes #21466
Fixes #26444
Fixes #27823
Fixes #28049
Fixes #28695
Fixes #30363