1.0.0 • Published 7 years ago
@jody-zeitler/version-it v1.0.0
version-it
Query NPM for the latest version of the package in the current working directory at the current minor version. Set the patch version to the next available value.
Local script
package.json
{
"devDependencies": {
"@jody-zeitler/version-it": "^1.0.0"
},
"scripts": {
"bump": "version-it"
}
}publish script
$ npm run bump && npm publish
incrementing version
v1.0.1
+ sweet-package@1.0.1Global script
publish script
$ npm install -g @jody-zeitler/version-it
$ version-it && npm publish
incrementing version
v1.0.2
+ sweet-package@1.0.2Usage with release tags
If you need to increment on a particular tag, use version-it tag to guess which tag to use based on the version in package.json, e.g. "7.0.0-next.0" will return "next". If there is no tag found in the version, "latest" will be returned, which is the default tag. Pass this value into npm publish.
$ version-it && npm publish --tag "$(version-it tag)"
incrementing version
v7.0.0-next.1
+ beta-module@7.0.0-next.1Read-only command
Use version-it peek to print the next available version without actually writing it to the package.json file.
$ version-it peek
2.3.21.0.0
7 years ago