-
Notifications
You must be signed in to change notification settings - Fork 492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect Increment for versions < 1.0 #177
Comments
I don't agree. it's your code that should take responsibility of handling the special 0.x case as the first number is always the identifier of major and the fact that semver allos you to use, in version 0.x, bump in minor to handle breaking changes is irrelevant. if (semver.major(myVersion) === 0) {
myNewVersion = semver.inc(myCurrentVersion, isBreakingChange(commit) ? 'minor' : 'patch');
} else {
if(isBreakingChange(commit)) {
myNewVersion = semver.inc('major');
} else if (isNewFeature(commit)) {
myNewVersion = semver.inc('minor');
} else {
myNewVersion = semver.inc('patch');
}
} |
This is working as designed. The technical term for the first number in the tuple is "major". If you want to increment the minor version for a breaking change, then that's your call, and the semver specification is ambivalent about doing so in a 0.x version. But the terms are still "major, minor, patch", regardless of whether the major version is 0. |
Given a version x.y.z, when x is 0, y should be incremented for a major version, and z for minor and patch. But the current version of semver treats a 0.x.y the same way as 1.x.y.
gives 1.0.0 instead of 0.2.0
The text was updated successfully, but these errors were encountered: