Repository navigation
Release a prerelease of X.Y.0 as X.Y.0 on a Minor or Major bump - #228
Merged
Merged
Conversation
A repository with no tags starts from v{initialVersion}-pre.0, and a Minor
or Major bump always incremented, so a new library's first release was
1.1.0 or 2.0.0 instead of 1.0.0. Minor on X.Y.0-pre.N now gives X.Y.0 and
Major on X.0.0-pre.N gives X.0.0, as semver inc does. Other versions
increment as before.
Fixes #168
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WyG38ppCkkDDCmkSnea826
|
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.



Fixes #168
What changed
VersionCalculator.CalculateNewVersionnow followssemver inc/ npm semantics for Minor and Major bumps from a prerelease, as decided on the issue:X.Y.0-pre.NgivesX.Y.0. Every other version increments Minor as before.X.0.0-pre.NgivesX.0.0. Every other version increments Major as before.A repository with no tags starts from
v{initialVersion}-pre.0, so its first release is nowinitialVersion(1.0.0by default) when the first bump is Minor or Major. Before this change it was1.1.0or2.0.0.Tests
GetVersionInfoAsync_NoTags_FirstReleaseIsInitialVersion: no tags with Minor →1.0.0, no tags with Major →1.0.0, andinitialVersion: "0.1.0"with Minor →0.1.0.GetVersionInfoAsync_BumpFromPrerelease:1.3.0-pre.2with Minor →1.3.0(the case the maintainer decision asked for) and2.0.0-pre.1with Major →2.0.0. Two cases that should not change:1.2.4-pre.3with Minor →1.3.0, and1.3.0-pre.2with Major →2.0.0.With the fix reverted, the 5 new cases that cover the changed behaviour fail and the 2 unchanged cases pass. With the fix in place the full suite passes (771/771). The Sonar analyzers report nothing new for
VersionCalculator.csin a local build withsonar-local.props.🤖 Generated with Claude Code
https://claude.ai/code/session_01WyG38ppCkkDDCmkSnea826
Generated by Claude Code