-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
fix: consider equality in publish dist tag check error message #7993
base: latest
Are you sure you want to change the base?
Conversation
It seems like this entire message shouldn't be triggering if the version is equal - isn't there pre-existing logic for "you can't publish a version that's already published" that should be hit? |
I was thinking of this as a layer over the registry logic, the same that the front end and back end would implement overlapping validation. I think having this error thrown in the cli here is acceptable rather than intentionally letting them slip through and having the registry handle it, helps with debugging with |
In that case I'd expect a totally separate error - not about "latest" but about re-publishing an already-published version. |
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.
LGTM!
Until npm 11 the cli did not have this information on publish. It send the new packument to the registry and all errors happened there. |
If anyone else is curious, the fetch of the existing packument was added in e2f4455 (and then updated in this PR) |
Currently the message for if it's the same version is wrong: