You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Increase pre* with pre-release identifiers without build #441
the semver package should be able to execute a increment premajor, preminor and prepatch for versioning schemes without a build number.
It for sure affects the standard maven versioning system (which is semver compliant).
Currently this package always sets a dot-separated build. I t would be desirable if the behavior could be chosen, or if it would at least respect the current versioning scheme.
Fair enough, but whether I adhere to that rule should not be a problem when reasoning about the semver version. If we have semver version number 1.2.3-anything, and we order node-semver to increment the minor component, there's no reason to fiddle with the pre-release identifier. It should return 1.3.3-anything.
the standard maven versioning system (which is semver compliant).
still worth establishing that it is not compliant, because snapshot contents change - and that by appending a .0, and relying on that instead, it would be, and this bug wouldn't apply.
The semver 2.0.0 spec mentions "increment" 16 times, but only for the major, minor, and patch versions. In it, I didn't see instructions on adding significant figures to any of the elements.
Activity
ljharb commentedon Mar 24, 2022
Wouldn’t that mean you can only ever have one snapshot per version? That seems a bit short-sighted.
pellmont commentedon Mar 24, 2022
This is correct, for MAVEN repositories the SNAPSHOT versions are allowed to be updated. (internal it uses a timestamp for the different versions)
ljharb commentedon Mar 24, 2022
sounds like a build number. Why isn’t it part of the version number?
astellingwerf commentedon Mar 24, 2022
The whole idea of the snapshot version is that you don't need to update references to it with every new build. See also What is a SNAPSHOT version?.
ljharb commentedon Mar 24, 2022
Wouldn’t a semver range like
1.2.3-SNAPSHOT.0do that?ljharb commentedon Mar 24, 2022
Versions in semver are designed to be immutable - in other words, it’s not semver if it’s changing over time.
astellingwerf commentedon Mar 25, 2022
1.2.3-SNAPSHOT is a perfectly valid semver. See this overview of the spec, where I marked the choices for the different options using
>>>in front.ljharb commentedon Mar 25, 2022
Absolutely that string is valid semver. But its contents must never change - versions are immutable.
astellingwerf commentedon Mar 25, 2022
Fair enough, but whether I adhere to that rule should not be a problem when reasoning about the semver version. If we have semver version number
1.2.3-anything, and we order node-semver to increment the minor component, there's no reason to fiddle with the pre-release identifier. It should return1.3.3-anything.ljharb commentedon Mar 25, 2022
Fair enough.
still worth establishing that it is not compliant, because snapshot contents change - and that by appending a
.0, and relying on that instead, it would be, and this bug wouldn't apply.astellingwerf commentedon Oct 20, 2022
The semver 2.0.0 spec mentions "increment" 16 times, but only for the major, minor, and patch versions. In it, I didn't see instructions on adding significant figures to any of the elements.