node-autochglog
v1.1.9
Published
Git changelog generator, to be used as a CLI utility in pre-commit hooks.
Downloads
36
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
node-autochglog can be launched through npx, so no installation is required. If you still want to install it, this section explains how to do that.
For making it available within a project:
npm install save-dev node-autochglogFor making it available globally:
npm install -g node-autochglogUsage
In order to use node-autochglog, just run the following command in the root of the project you want to generate a changelog for:
npx node-autochglogConfiguration
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 }[];
stripPRNumbers: boolean;
}