Changelog Keeper
Don’t let your friends dump git logs into changelogs.
This tool helps you write changelogs that adhere to https://keepachangelog.com.
The main features are:
- Lets you author your changes manually.
- Lets you structure your changes consistently by providing interactive input and validation.
- Lets you manually edit generated JSON as well as CHANGELOG.md and TESTINGNOTES.md files if needed.
- Avoids merge conflicts in CHANGELOG.md and TESTINGNOTES.md files.
- Doesn't depend on git, GitHub, or any CI.
How it works
There are 2 main commands - add
and release
. Adding a changelog will generate a JSON file that contains all provided information per change. Releasing will compile all generated JSON files into markdown, insert them into CHANGELOG.md and TESTINGNOTES.md, then delete JSON files. After that, you can decide to commit the changes and/or adjust generated markdown files.
Install
npm i changelog-keeper2
or
yarn add changelog-keeper2
Add
To add a change, run changelog-keeper add
. It lets you create a change interactively or via flags and generates a JSON file with the information you provided. That file contains information for a single change and should be checked into the version control so that your Pull Requests always come along with the change files.
Release
To release a new version, run changelog-keeper release
. After you specify a version you want to release, it generates markdown text for changelog and testing notes and inserts them into CHANGELOG.md and TESTINGNOTES.md files. After that, it removes the original JSON files it used.
Config
By default, the root
directory is the directory you run the changelog-keeper from (current working directory). JSON files with changes are saved into {root}/.changelog-keeper
directory. The root directory is also expected to have {root}/TESTINGNOTES.md
and {root}/CHANGELOG.md
files, but you can configure all that by creating a .changelog-keeperrc.json
file in the root of your project.
{
"changesPath": "{pathToChangesDirectory}",
"changelogPath": "{changelogPath}",
"testingNotesPath": "{testingNotesPath}",
"changeTemplatePath": "{pathToTemplate}",
"unreleasedMarker": "## Unreleased",
"tags": []
}
External Editor
You can use any external editor of your choice by defining the EDITOR
environment variable. The same variable is used by git
.
If you want to use vscode
, make sure to pass --wait
option.
When CLI asks you to edit text and you selected "External Editor" - it will open your editor and once you entered and saved the changes, you need to close the editor tab to proceed with the CLI input.
Contributing
-
Please create an issue before submitting a PR to ensure maintainers agree upon the change, unless its a very minor change.
-
Make sure tests pass and your change is relflected by the new test (test has to fail without the source changes)
yarn test
- run the tests with jest
yarn test --watch
- run the tests and watch changes
-
Provide a changelog entry by running yarn changelog:add
with each PR.
-
Run yarn checks
for all static checks