Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@firefoxic/update-changelog

firefoxic874MIT1.0.0

CLI utility for automatic update of CHANGELOG.md

changelog, cli, javascript, node.js, prepare, update

readme

@firefoxic/update-changelog

License: MIT Changelog NPM version Test Status

CLI utility for automatic update of CHANGELOG.md.

Purpose

Increasing the version of a package usually requires creating a commit (extra for history) with a message something like Prepare release. This commit should manually add a header to CHANGELOG.md with the new version and the release date, and change the links to the comparison at the bottom of the file.

The update-changelog utility gets rid of this chore, random typos, and an unnecessary commit.

Installation

pnpm add -D @firefoxic/update-changelog

Configuration

In the scripts section of your package.json, add a version hook that will run when pnpm version patch (or minor, or major) is executed after updating the version in package.json, but before creating the commit.

{
    "scripts": {
        "version": "update-changelog"
    },
}

Optionally, other hooks can be added to conveniently automate package publishing (see package.json of this project for an example).

Some restrictions

The update-changelog expects the following:

  • The name of the changelog file is CHANGELOG.md.
  • The format of the changelog is consistent with Keep a changelog.
  • Descriptions of all user-important changes are already in the changelog under the heading [Unreleased]. Ideally, you should commit them along with the changes themselves.
  • If this is the first release of a package, there should be only one reference for [Unreleased] at the end of the changelog in the following format for correct reference updating:

      [Unreleased]: https://github.com/<user-name>/<project-name>/compare/v0.0.1...HEAD

    Example: the state of this project's changelog before the first release.

Usage

When publishing a new version, simply do not create the Prepare release commit.

Running pnpm version patch (or minor, or major) will now do everything for you 🥳

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased

1.0.0 — 2024–10–30

Changed

  • The minimum required node.js version has been increased to 20.12.0, except for version 21.

0.2.1 — 2024–09–25

Fixed

  • The space before the dash in the version heading is now non-breaking. This hardly affects anything, but for consistency of typography it should be like this everywhere.

0.2.0 — 2024–07–30

Added

  • The update-changelog utility now automatically stages CHANGELOG.md in git. You can remove && git add CHANGELOG.md from your version hook and leave only update-changelog in it.

0.1.0 — 2024–05–09

Added

  • The basic functionality of the update-changelog CLI utility.