changelog-machine
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published


logo

Changelog Machine

Generate a changelog based on Git commit messages and tags.

Getting started

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.

Configuration

The generation of the changelog can be configured via a config file.

npx changelog-machine --config changelog.config.json

Command overview

COMMAND ALIAS DESCRIPTION
--config -c Path to the configuration file
--version -v Print version
--help -h Print command instructions

Configuration file

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

Example output

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

Programmatic use

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',
});

Readme

Keywords

Package Sidebar

Install

npm i changelog-machine

Weekly Downloads

33

Version

1.1.0

License

MIT

Unpacked Size

28.2 kB

Total Files

36

Last publish

Collaborators

  • pkief