-
Notifications
You must be signed in to change notification settings - Fork 798
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
feat: Create --zero-mode flag to prevent bumping to 1.0.0. #310
feat: Create --zero-mode flag to prevent bumping to 1.0.0. #310
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome! I've wanted this for so long!
npm handles versions below Because of that it's my assumption the norm below
and this PR should reflect that. |
I disagree about features. If you specify
|
While I can certainly understand the angle you're coming from and the spec kinda does too
The fact that the API is deemed unstable (aka 0.x) does not remove the specified increment.
Regardless of what version you're on. https://semver.org/#spec-item-7
I guess it's a POV thing |
I'm looking at item 4:
This indicates to me that 0.y.z do not necessarily follow strict semver rules. Specs aside the goal of this PR is to "do the right thing" for npm dependents. From https://github.com/npm/node-semver/#caret-ranges-123-025-004:
If I have a component at 0.1.0 and make a feature release followed by a bug fix release, another module which depends on |
@coreyfarrell I need this functionality to, but I think the right place to implement it is here: conventional-changelog/conventional-changelog#421 ☝️ this provides the ability to provide configuration to the conventional bump logic, such that we'd treat a bump prior to the |
@@ -141,7 +141,16 @@ function bumpVersion (releaseAs, args) { | |||
path: args.path | |||
}, function (err, release) { | |||
if (err) return reject(err) | |||
else return resolve(release) | |||
else if (args.zeroMode) { | |||
switch (release.releaseType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is technically not correct :) v0 is a bit complicated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I'm not clear what you are saying is wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EG: there could be a breaking change from 0.0.1 to 0.0.2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh true. I hadn't considered 0.0.x
at all, I always just start projects at 0.1.0
as the way npm handles 0.0.x
is annoying to me (the caret in ^0.0.1
is useless).
@coreyfarrell having dug into things a bit more, I think it might be easier to change the bumping logic in Alternatively we could refactor https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-recommended-bump to accept context about the old version we're attempting to bump from; which do you think is a better approach? either way, I'd like the default behavior for pre-1.x.x to be bumping the minor for BREAKING CHANGES rather than the major. |
I'm not familiar enough with the conventional-changelog ecosystem to say if the refactor you mention is better or not. Modifying I can modify this patch to remove the What about 0.0.x, should this be handled differently as @stevemao pointed out? Technically if the current version is 0.0.1 then 0.0.2, 0.1.0 or 1.0.0 could be used for breaking changes. As is my patch will cause a bump to 0.1.0 instead of 1.0.0. |
@coreyfarrell I still think this might be better fixed in |
Fixes #308