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

1.0.2 • Public • Published

Manual Git Changelog

Build status Coverage Status Mutation testing badge npm version

A simple tool for appending to a changelog based on git commits and tags.

This is an alternative to tools such as conventional-changelog for projects that don't follow a specific commit convention, but wanting to automate your CHANGELOG.md generation upon each release.

This tool does this by automating the creation of CHANGELOG.md as much as possible, but allowing you to manually polish the file before committing.

This tool assumes that you use semantic versioned git tags (like v1.2.3 and v2.0.1).

Some examples of changelogs that were generated with this tool:

Installation

It is advised to install this tool as a dev dependency:

$ yarn add --dev manual-git-changelog

Usage

After installing, the manual-git-changelog script will become available. It can be used to do three things:

  1. Initialize a new CHANGELOG.md file
  2. Add the changelog for an update while npm version is running.
  3. Manually add the changelog for a particular version to CHANGELOG.md.

These usages will be explained hereafter.

Initialize

By running manual-git-changelog init, you can create a new CHANGELOG.md file based on your current version and git commits.

This command will fail when CHANGELOG.md already exists.

Automatic version appending

If you like more automation in your release process, then you can hook this tool into npm version.

You can do this by adding the following script to your package.json file:

{
  "scripts": {
    "version": "manual-git-changelog onversion"
  }
}

This will make it so that each time you call npm version, the changelog will automatically be updated to the new version.

Note that this will temporarily pause the process to allow you to manually polish the changelog file, to allow you to categorize the commits. This pausing happens when the following is printed to the console

Manually edit CHANGELOG.md, press any key to finalize...

Once you have edited CHANGELOG.md, and are satisfied with its structure, go back to your console, press any key to continue. The tool will automatically stage CHANGELOG.md so that it becomes part of the version bump commit as done by npm version.

Manual version appending

As an alternative to automatic changelog updates during npm version, you can manually trigger a version log to be added to be added to your changelog. You can call the command, with a certain version to set as new version (ex: v1.2.3) as follows:

$ manual-git-changelog v1.2.3

The previous available version (for example v1.2.2) will be automatically detected from the git tags. As such, this script assumes that v1.2.3 has not been tagged yet.

If this version would already be tagged, then this script also allows you to define a custom version range that does not try to infer the previous version from the git tags:

$ manual-git-changelog v1.2.2 v1.2.3

License

This software is written by Ruben Taelman.

This code is released under the MIT license.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    293
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    293
  • 1.0.1
    88
  • 1.0.0
    0

Package Sidebar

Install

npm i manual-git-changelog

Weekly Downloads

381

Version

1.0.2

License

MIT

Unpacked Size

26.8 kB

Total Files

14

Last publish

Collaborators

  • rubensworks