The tool can be executed with this command:
npx changelog-machine
It will generate a file called CHANGELOG.md in the root directory of the project.
The generation of the changelog can be configured via a config file.
npx changelog-machine --config changelog.config.json
COMMAND | ALIAS | DESCRIPTION |
---|---|---|
--config |
-c |
Path to the configuration file |
--version |
-v |
Print version |
--help |
-h |
Print command instructions |
The configuration file can be configured like this:
{
"title": "Changelog",
"description": "Some description text",
"repositoryUrl": "https://github.com/PKief/vscode-material-icon-theme",
"blacklistPattern": "Release|^\\d+\\.\\d+\\.\\d+$",
"filePath": "CHANGELOG.md"
}
More detailed description of the config:
CONFIG | DESCRIPTION | DEFAULT |
---|---|---|
title |
Title of the changelog | "Changelog" |
description |
Description under the title | "All notable changes to this project will be documented in this file. Dates are displayed in UTC." |
filePath |
Path of the output file | "CHANGELOG.md" |
repositoryUrl |
Links to the repository for further information | |
blacklistPattern |
Regex to remove commit messages |
The following commit summary is printed into the CHANGELOG.md file and can look like this:
February 5, 2022
- Update release commit message
3167316
- Update release workflow
7f2520d
- Adjust preview script for folder icons
6a00111
- Fix compare link
fa45abf
- Filter out release commits
e3468ca
The tool can be imported as module into existing JavaScript or TypeScript code. Therefor it is necessary to install it via npm or yarn:
NPM:
npm install --save-dev changelog-machine
Yarn:
yarn add --dev changelog-machine
The module can be imported like this:
import { printMarkdown } from 'changelog-machine';
// usage with default config
printMarkdown();
// usage with customizations
printMarkdown({
filePath: './changelog/CHANGES.md',
description: 'List of changes',
title: 'All releases',
blacklistPattern: '^Release', // excludes all commits that start with "Release"
repositoryUrl: 'https://github.com/PKief/vscode-material-icon-theme',
});