-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Do not test new version with pkg.version #3103
Conversation
hey @binarykitchen thanks for your pr, could you please write two tests for both cases instead of leaving a comment? |
not sure how this can be tested when it's up to the npm registry to validate version numbers ... |
@voxsim ok, have code to cover the first test case but there are no tests at all for the |
@binarykitchen maybe for now it is sufficient. Let @arcanis and @bestander decide if we need to do other stuff ;) |
src/cli/commands/version.js
Outdated
// because of two reasons (see issue #3011): | ||
// - npm registry will complain anway when it already exist (leave it to them to validate that) | ||
// - some open source libraries/projects increment version just before deployment where | ||
// the new version already has been bumped in package.json |
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.
Not sure this comment is needed.
However, shouldn't we just return early when the package version is the same as the version currently registered? Instead of running lifecycle hooks etc. Not doing this could cause issues if, for example, a version
lifecycle script was registering a mercurial tag.
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.
true that @arcanis
... just have updated PR. now it's returning early and comment is much shorter
👍 Would you mind also adding a |
@arcanis i think that would raise scope and should got in a separate issue. my commit here only touches the version command. or am i missing something here? |
@arcanis ping? |
I'm ok with merging this! Just a nit: can you remove the comments? Such a small change is relatively self-explanatory, so no need to write in english what's already written in js :) |
See issue 3011 for details. Leave it to npm registry to validate the version number.
@arcanis ok, all comments are removed - good now? |
Great job, everyone! |
thanks - is there an eta when and in which version this will come out @bestander? |
0.24 next week |
See issue 3011 for details. Leave it to npm registry to validate the version number.
Motivation is to make it work with the way how I deploy my videomail-client library at
https://github.com/binarykitchen/videomail-client/blob/develop/bin/release.sh
There I am already bumping to the new version in package.json before publishing it with yarn to npm.
Test plan
yarn publish --new-version with that new version