SBoudrias/Inquirer.js

Wrong version released as latest

myndco opened this issue · 5 comments

@SBoudrias We should publish a new version 9.2.10 to cover up the 8.2.6.

The latest-version-cli is helpful for checking the version:

npm i -g latest-version-cli

latest-version inquirer --range=latest
#=> 8.2.6

latest-version inquirer --range=9
#=> 9.2.9

latest-version inquirer --range=8
#=> 8.2.6

latest-version inquirer --range=7
#=> 7.3.3

There is no way to publish a version without a tag. It will be latest by default.

We could publish the legacy versions with a legacy tag as a workaround:

# To publish an 8.x version:
npm publish --tag=legacy

Of course, we can pick another name if there is a better one other than legacy.

Do you know of a good way to enforce this?

I make new v8 releases so rarely it's very likely the next one would end up tagged as latest anyway. I checked, but don't think we can enforce this through .npmrc 🤔

npm does not support this. I wonder if https://github.com/sindresorhus/np has a feature that gives a warning message when publishing a legacy major version. I can contribute code if they don't have this feature.

Or we can add a prepublishOnly script to validate the package version.

Or we can add a prepublishOnly script to validate the package version.

That sounds like a good idea to me. The problem with np is that it's not compatible with monorepo; so it wouldn't help here. Are you willing to work on a script?

Are you willing to work on a script?

Sure. I will create a PR for that.