mirror of
https://github.com/semver/semver.git
synced 2026-07-11 05:12:48 -05:00
Are you allowed to publish an older minor version after a major version? #373
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rgwilton on GitHub (Mar 12, 2019).
Say the following versions have been chronologically released: 1.0.0 -> 1.1.0 -> 2.0.0.
Does the scheme allow software to subsequently release a version 1.2.0 after 2.0.0 has been released? 1.2.0 would obviously be based on 1.1.0 with backwards compatible changes.
My working assumption is that because the scheme does not disallow this, then this is in fact allowed.
@lirantal commented on GitHub (Mar 12, 2019):
Makes sense to allow it. One important requirement for this is back-porting of security fixes to previous versions.
@ljharb commented on GitHub (Mar 12, 2019):
It’s absolutely critical, yes. For backporting of anything, including features.
@segiddins commented on GitHub (Mar 12, 2019):
SemVer doesn't say anything about when you publish which versions, only about how those versions relate to each other. You're free to publish a "lower" version at any time, so long as it's the appropriate version for the changes it contains relative to the newest version less than that version.
@haacked commented on GitHub (Mar 30, 2019):
I agree with @segiddins.
The one thing to be careful about is to make sure the package registry doesn't mark this as the latest version. I assume most hosts will do the right thing and mark the highest version number as the latest, but I've written software before and I know how it can sometimes not do what it should. 😛
@ljharb commented on GitHub (Mar 30, 2019):
To protect myself against that with npm, I made and use https://npmjs.com/safe-publish-latest :-)
@jwdonahue commented on GitHub (Mar 31, 2019):
See my reply to #484.
@isaacs commented on GitHub (Apr 30, 2019):
Yes, SemVer is 100% time agnostic.
In npm, you can publish an older version and avoid marking it as
latestby using the--tagcommand line option. I usually donpm publish --tag=legacyfor updates to previous versions, andnpm publish --tag=nextfor release candidates that are not yet ready for being the default distribution.