Comments (7)
I came here because I have the same problem from the other side.
If I'm on 0.1.2-rc.2
then the next non-prerelease bump should be to 0.1.2
.
from node-semver.
Right, so inc()
should always go up, and never down. This gets hairy around the cases where you have a patch and a prerelease.
I'd argue that the correct approach would be: inc("1.2.3", "prerelease") === "1.2.4-0"
and inc("1.2.3-0", "patch") === "1.2.3"
from node-semver.
I think inc("1.2.3", "prerelease") === "1.2.4-0"
is usually correct, but there are cases where you'd want the pre-release to bump the major or minor instead. What about inc("1.2.3", "preminor") === "1.3.0-0"
? and a premajor
to bump to 2.0.0-0
?
#65 should address the 2nd issue, but the first seemed more complex, so I wasn't sure how to fix it.
from node-semver.
I think it's simpler to just that a bump to the prerelease will also bump the patch if there isn't already a prerelease.
from node-semver.
I'm not totally sure if I'm following. That should be what this PR is doing. I created a quick chart showing in red how semver is working now and in blue how this PR works.
Maybe your objection is to including preminor
and premajor
? While they might be used less often I think they're needed. Using only semver's inc()
it's impossible to reach 1.7.0-0
from 1.6.0
: minor goes to 1.7.0
then prerelease
goes to 1.7.1-0
.
I think "Using only semver's inc()
" is important because it gets used by other tools like grunt-release which will bump, commit, push. It defeats the purpose of such tools if I have to manually manipulate the version when generating a prerelease of a minor version.
from node-semver.
I believe this is now fixed with the introduction of prepatch, preminor, and premajor.
from node-semver.
Fixed on master.
from node-semver.
Related Issues (20)
- Circular dependency HOT 1
- [BUG] semver.satisfied false positive
- `coerce` drops build and prerelease information HOT 6
- [BUG] <npm audit High> 5.7.2 and 6.3.1 HOT 6
- [BUG] <npm audit High> 5.7.2 and 6.3.1
- [BUG] pre-release versions not matched when using `||` HOT 20
- [bug] diff("1.7.2-1", "1.8.1") returns patch, not minor HOT 1
- [BUG] diff prerelease changed between 7.3.8 and 7.5.4 HOT 9
- Semver veracode Vulnerability CVE-2022-25883 | CWE-1333 HOT 4
- Satisfying functions don't provide an option to also compare build meta HOT 2
- Semver veracode Vulnerability CVE-2022-25883 HOT 1
- [BUG] Why does not satisfy 1.7.0-rc.0 with range ^1? HOT 1
- [BUG] Сompare major/minor versions starts with 0 HOT 2
- .commitlintrc.js
- Getting Semver Veracode vulnerability on angular project HOT 1
- Vulnerabilities in semver package HOT 1
- [BUG] Inc function give incorrect version when bumping subsequent pre versions HOT 4
- me
- [ENHANCEMENT] minimum versions or minimum version in relation to HOT 12
- [BUG] BNF does not match the implementation HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-semver.