📦 Generate a changelog as part of the npm version command
📦 Generate a changelog as part of the npm version command
npm version [patch|minor|major]
to create a releaseCHANGES.md
file
❯ npm install @studio/changes --save-dev
❯ npx changes --init
This will add the following to your package.json
:
{
"scripts": {
"preversion": "npm test",
"version": "changes",
"postversion": "git push --follow-tags && npm publish"
}
}
--help
, -h
: Display a help message.--commits
, -c
: Generate links to commits using the given URL as base. If${homepage}/commit
using the homepagepackage.json
.--footer
: Generate a footer with the git author and release date. The$GIT_AUTHOR_NAME
and $GIT_AUTHOR_EMAIL
is used--file
, -f
: Specify the name of the changelog file. Defaults toCHANGES.md
.--init
: Add version lifecycle scripts to package.json
. Can be combined--file
and --commits
to configure the changes
invocation.--tag
: Use a custom git tag, supports simple replacement of package.json
v${version}
.--dir
: Passes the given dir to git log -- <dir>
to filter the commit--workspace
: Is a convenience flag which sets --dir
to the current--tag
to ${dir}/v${version}
.Configure your preferred editor with the $EDITOR
environment variable.
Preview the release notes for the next release by running:
❯ npx changes
MIT
Made with ❤️ on 🌍