feat(release): ignore project scope for version bump #33999
+107
−3
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.
Current Behavior
Since Nx 22, when using conventional commits with independent project relationships, commits affecting a project require the scope to match the project name to apply the full semver bump.
For example:
feat(my-lib): new feature→ minor bump formy-lib✅feat: new feature→ minor bump for affected projects ✅feat(random-scope): new feature→ patch bump (downgraded) ❌This behavior forces teams to use project names as scopes, which may not align with their preferred commit conventions (e.g., feature-based or functional scopes like
feat(auth): ...,feat(ui): ...).The changelog generation correctly identifies breaking changes regardless of scope matching, but the versioning logic downgrades non-matching scoped commits to patch bumps.
Expected Behavior
With the new
ignoreProjectScopeForVersionBumpconfiguration option, teams can opt-in to use commit scopes freely without being constrained to match project names.When
ignoreProjectScopeForVersionBump: trueis set in the conventional commits configuration:feat(random-scope): new feature→ minor bump ✅fix(whatever): bug fix→ patch bump ✅feat(auth)!: breaking change→ major bump ✅The versioning will be based solely on the commit type (feat, fix, etc.) and breaking change indicators, not on scope matching.
Configuration Example
{ "release": { "version": { "conventionalCommits": true }, "conventionalCommits": { "ignoreProjectScopeForVersionBump": true } } }Related Issue(s)
Fixes #33686
Implementation Details
ignoreProjectScopeForVersionBumpboolean option toNxReleaseConventionalCommitsConfigurationdetermineSemverChange()to respect this configuration when determining version bumps