feat(release): revamped nx release version implementation#30418
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
View your CI Pipeline Execution ↗ for commit 15a27dc.
☁️ 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.
nit: not a fan of this method name. Is postVersioning callback a better name?
There was a problem hiding this comment.
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.
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 [email protected] my-workspaceOr 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 [email protected] my-workspaceOr 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 |
|
hello.
The above error can be solved with force push, but there is no push option provided.
nx/packages/nx/src/command-line/release/utils/git.ts Lines 424 to 432 in 6e50a01 Scripted, it would look like this import { releaseVersion } from 'nx/release';
const version = await releaseVersion({
verbose: true,
gitTag: true,
gitTagArgs: [],
gitCommit: true,
gitCommitArgs: [],
gitPush: true,
gitPushArgs: ['-f'], // or gitPushForce: true
gitRemote: 'origin',
firstRelease: true,
}); |
🐳 We have a release for that!This PR has a release associated with it. You can try it out using this command: npx [email protected] my-workspaceOr just copy this version and use it in your own command: 0.0.0-pr-30418-d6cd6b6
To request a new release for this pull request, mention someone from the Nx team or the |
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |

This PR provides a new implementation for the versioning stage of
nx releasewhich brings a ton of benefits.Previously unsupported/impossible features now available:
updateDependentswill 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.jsonfor a project.Massively improved extensibility for non-JS languages/ecosystems:
ReleaseVersionGeneratorabstraction 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.VersionActionsclass, 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.tomletc) if applicable, reading from a remote registry etc.VersionActionsimplementation.Other benefits:
generatorOptionsgoing away, and most options moving to the top level ofrelease.versionconfig 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.0preserveLocalDependencyProtocolsis nowtrueby default and can be omitted from end user configs.Notes on rollout
"useLegacyVersioning": falseinrelease.versioninnx.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