-
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
Aborting publish should not change version number #662
Comments
I think I just figured out what the current behaviour actually is: When you abort after changing the version but before publish, the version is changed. Then when you publish again you are asked for the new version. When you enter a new version the cli runs a simple check, and if you enter the same version a gain exits with an error "New version is the same as the current version". But if you don't enter a number it continues with the version currently set in package.json. If the version is already published it fails in the next step. As far as I can tell this is the exact same behaviour of the npm cli (npm version [current-version-in-package.json] exits with error), so I'm not sure if and how this should be changed. I guess it would be possible to add another step of user interaction ("publish with same version? yes/no", something like that), or it might be possible to check against the registry if the new version is valid. Just some ideas, also thank you for the great work. |
We'll focus on a better publish experience soon |
This issue may seem easy to fix but it is harder than it seems. In case somebody tries to tackle it here are some things to consider:
The fix in question is going to be very limited or otherwise require quite a bit of change. Note that "limited" may make sense for your use case but could confuse people with even slightly more complex setups. I suspect this will be a wontfix for now. I'm closing my PR, which was flawed anyways. |
@qfox, yeah this is a complex problem, publish is not an atomic operation with side effects around multiple systems. |
Do you want to request a feature or report a bug?
bug
What is the current behavior?
When using yarn publish and aborting after entering a version number, the version number is not reset. As a consequence it seems impossible to publish the same version number "again" without reverting the change manually.
If the current behavior is a bug, please provide the steps to reproduce.
after this the version number is already changed:
This makes it impossible to publish version 1.4.2 in this example:
What is the expected behavior?
When I abort a publish the version number in package.json should not have changed.
Please mention your node.js, yarn and operating system version.
node: v6.2.1, yarn: 0.15.1, OSX 10.12
The text was updated successfully, but these errors were encountered: