feat(version): add optional fixed versioning mode - #1056
Draft
spydon wants to merge 3 commits into
Draft
Conversation
Adds a new command/version/lockstep configuration option. When enabled, every versioning run bumps all packages in the workspace to the same new version, similar to the fixed release mode of tools like Nx and Lerna. The lockstep version is the highest current version in the workspace, incremented by the most significant change across all packages. Packages without changes of their own are bumped too, with a changelog entry noting that the bump keeps the workspace in lockstep. Manually specified versions are applied to all packages, and conflicting or downgrading manual versions are rejected.
|
To preview the documentation for this pull request, visit the following URL:
|
- Do not version packages that depend on an ignored package with pending changes, mirroring the skip logic of independent mode. - Apply relative manual version changes (patch/minor/major/build) to the highest current version in the workspace instead of the named package's own version. - Leave packages that are already at the lockstep version untouched instead of rewriting pubspecs and duplicating changelog entries. - Warn that disabling dependent versioning has no effect in lockstep. - Disable commit signing in the lockstep test git helper.
Aligns the configuration with the fixed/independent terminology used by Nx and Lerna, and leaves room for future modes. The shared-version behavior is still described as lockstep in changelogs and docs prose. Also renames LockstepVersionException to FixedVersioningException and exports the new VersioningMode enum.
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.
Description
Adds an optional fixed versioning mode (lockstep) to
melos version, matching the "fixed" release mode of Nx and Lerna in the JavaScript ecosystem.When
mode: fixedis enabled, every versioning run bumps all packages in the workspace to the same new version:melos version <package> <version>) is applied to all packages. Relative manual bumps (patch/minor/major/build) are applied to the highest current version in the workspace, regardless of which package was named. Conflicting manual versions for different packages, or a manual version below a current package version, fail with aFixedVersioningException.--allis passed, and dependency constraints on workspace packages are updated as usual.--no-dependent-versionshas no effect in fixed mode and logs a warning.independent, so existing workspaces are unaffected.Implementation notes
PackageUpdateReason.lockstepcovers packages bumped only to stay in sync; it renders a dedicated changelog line and its own workspace changelog section.VersioningModeenum (independent|fixed) is exported from the public API and leaves room for future modes (e.g. grouped/linked versioning).foo-v1.2.3) are still created so change detection for future runs keeps working.Type of Change
docs/commands/version.mdx,docs/configuration/overview.mdx,docs/guides/automated-releases.mdx,melos.yaml.schema.json)