node-autochglog
v1.1.8
Published
Git changelog generator, to be used as a CLI utility in pre-commit hooks.
Readme
Node Auto-Changelog
node-autochglogis a CLI tool that generates a changelog based on commit messages, assuming that they're written using the Conventional Commits syntax. It is meant to be used in CI/CD pipelines, or in pre-commit hooks.
Data model
Here are some concepts to better understand the logic behind the tool:
- to the purpose of this tool, a
Changelogis a list ofReleaseitems; - each
Releaseitem contains a list ofCategoryitems; - each
Categoryitem contains a list ofCommit items.
In other words, a changelog is a list of releases, each release contains a number of commits, that are arranged in categories within the release they belong to.
Releases are defined by git tags, categories are defined by Conventional Commit prefixes of commit messages.
Installation
For making it available within a project:
npm install save-dev node-autochglogFor making it available globally:
npm install -g node-autochglogUsage
Currently, node-autochglog is in its earliest version and doesn't really accept any configuration. As a consequence, it is also very easy to use.
Just run the following command in the root of the project you want to generate a changelog for:
node-autochglog...that's it.
Configuration
The tool accepts configuration from a node-autochglog.config.json, expected to be found in the directory where the node-autochglog command is executed; the file is expected to contain a single JSON object adhering to the NodeAutoChglogConfig interface:
export interface NodeAutoChglogConfig {
tagFilter: string;
initialTag: string;
templateLocation: string;
targetBranch: string;
outputFilepath: string;
allowedCategories: { key: string; label?: string }[];
}