feat(semver)!: support Nx 23 and drop support for Nx < 22#1094
Draft
tuffz wants to merge 3 commits into
Draft
Conversation
Nx 23 removed the flat `releaseTagPattern` property from `NxReleaseConfiguration` and rejects it at runtime, so the `nx.json` written by the `migrate-nx-release` generator broke `nx release`. Emit the nested `releaseTag.pattern` shape that Nx 22 introduced instead. That shape is only understood by Nx >= 22, so `@nx/devkit` v18-v21 can no longer be supported. Narrow the peer range to `^22.0.0 || ^23.0.0`. BREAKING CHANGE: `@nx/devkit` `^22.0.0 || ^23.0.0` is now required; support for Nx 18, 19, 20 and 21 has been dropped.
The mock targeted `@nx/workspace/src/core/project-graph`, a path the version executor no longer imports (it calls `createProjectGraphAsync` from `@nx/devkit`). The deep path is also unreachable under Nx 23's tightened package `exports` map, which broke the test suite.
Add a v7.0.0 row for the `@nx/devkit ^22.0.0 || ^23.0.0` peer range, reflecting the addition of Nx 23 and the drop of Nx 18-21.
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.
Implements Option A from #1093. Opening as a draft for discussion, since the direction (Option A vs. Option B) is still open there.
Adds Nx 23 support. Unlike the earlier Nx 21 and Nx 22 updates, this is not a peer-range-only bump: Nx 23 removed the flat
releaseTagPatternproperty fromNxReleaseConfiguration(moved to the nestedreleaseTag.patternin Nx 22) and now rejects it at runtime, so thenx.jsonwritten by themigrate-nx-releasegenerator brokenx release. The generator now emits the nested shape.Warning
This drops backward compatibility. The nested
releaseTag.patternshape only exists in Nx >= 22, so the peer range is narrowed to^22.0.0 || ^23.0.0and support for Nx 18-21 is dropped. This is a breaking change (major bump).If you'd prefer to keep backward compatibility instead (Option B in #1093: a version-aware generator that emits the flat shape for Nx < 22 and the nested shape for Nx >= 22), I'm happy to implement that and close this in favor of it.
Changes
migrate-nx-releasegenerator emits the nestedreleaseTag: { pattern }shape.@nx/devkit ^22.0.0 || ^23.0.0.@nx/workspace/src/core/project-graph, which is unreachable under Nx 23's tightenedexportsmap (the executor source only uses public@nx/devkitentrypoints).Verification
Migrated the dev workspace to Nx 23 and ran the build and full test suite; both green. Re-verified green on Nx 22 as well, so the change works across the whole
^22.0.0 || ^23.0.0range.Related