stop using
npm version
, usestandard-version
it rocks!
Automatic release and CHANGELOG management, using GitHub's new squash button and the workflow outlined in conventional-changelog-standard.
how it works:
- when you land commits on your
master
branch, select the Squash and Merge option. - add a title and body that follows the conventional-changelog-standard conventions.
- when you're ready to release to npm:
- checkout
master
. - run
standard-version
. git push --tags; git push origin master; npm publish
.
standard-version
does the following:
- bumps the version in package.json (based on your commit history).
- uses conventional-changelog to update CHANGELOG.md.
- commits package.json and CHANGELOG.md.
- tags a new release.
When you're generating your changelog for the first time, simply do:
standard-version --first-release
npm i standard-version -g
Or, add it as a development dependency like so:
npm i standard-version --save-dev
_And add this to your package.json:
{
"scripts": {
"release": "standard-version"
}
}
patches:
-m "fix(parsing): fixed a bug in our parser"
features:
git commit -a -m "feat(parser): we now have a parser \o/"
breaking changes:
git commit -a -m "feat(new-parser): introduces a new parsing library
BREAKING CHANGE: new library does not support foo-construct"
other changes:
You decide, e.g., docs, chore, etc.
git commit -a -m "docs: fixed up the docs a bit"
but wait, there's more!
Github usernames (@bcoe
) and issue references (#133) will be swapped out for the
appropriate URLs in your CHANGELOG.
Tell your users that you adhere to the standard-version
commit guidelines:
[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version)
ISC