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

Package detail

changelog-maker

nodejs11.9kMIT4.4.0

A git log to CHANGELOG.md tool

readme

changelog-maker Build Status

A git log to CHANGELOG.md tool

npm npm

Eh?

changelog-maker is a formalisation of the Node.js CHANGELOG.md entry process but flexible enough to be used on other repositories.

changelog-maker will look at the git log of the current directory, pulling entries since the last tag. Commits with just a version number in the summary are removed, as are commits prior to, and including summaries that say working on <version> (this is an io.js / Node ism).

After collecting the list of commits, any that have PR-URL: <url> in them are looked up on GitHub and the labels of the pull request are collected, specifically looking for labels that start with semver (the assumption is that semver-minor, semver-major labels are used to indicate non-patch version bumps).

Finally, the list is formatted as Markdown and printed to stdout.

Each commit will come out something like this (on one line):

* [[`20f8e7f17a`](https://github.com/nodejs/io.js/commit/20f8e7f17a)] -
  **test**: remove flaky test functionality (Rod Vagg)
  [#812](https://github.com/nodejs/io.js/pull/812)

Note:

  • When running changelog-maker on the command-line, the default GitHub repo is computed from the package.json that exists on cwd, otherwise fallback to nodejs/node, you can change this by supplying the user/org as the first argument and project as the second. e.g changelog-maker joyent node.
  • Commit links will go to the assumed repo (default: nodejs/node)
  • If a commit summary starts with a word, followed by a :, this is treated as a special label and rendered in bold
  • Commits that have semver* labels on the pull request referred to in their PR-URL have those labels printed out at the start of the summary, in bold, upper cased.
  • Pull request URLs come from the PR-URL data, if it matches the assumed repo (default: nodejs/node) then just a # followed by the number, if another repo then a full user/project#number.

When printing to a console some special behaviours are invoked:

  • Commits with a summary that starts with doc: are rendered in grey
  • Commits that have a semver* label on the pull request referred to in their PR-URL are rendered in bold green

Install

npm i changelog-maker -g

Usage

changelog-maker [--plaintext|p] [--markdown|md] [--sha] [--group|-g] [--reverse] [--find-matching-prs] [--commit-url=<url/with/{ref}>] [--start-ref=<ref>] [--end-ref=<ref>] [github-user[, github-project]]

github-user and github-project should point to the GitHub repository that can be used to find the PR-URL data if just an issue number is provided and will also impact how the PR-URL issue numbers are displayed

  • --format: dictates what formatting the output will have. Possible options are: simple, markdown, plaintext, messageonly and sha. The default is to print a simple output suitable for stdout.
    • simple: don't print full markdown output, good for console printing without the additional fluff.
    • sha: print only the 10-character truncated commit hashes.
    • plaintext: a very simple form, without commit details, implies --group.
    • markdown: a Markdown formatted from, with links and proper escaping.
    • messageonly: displays the commit message only, implies --group
  • --sha: same as --format=sha.
  • --plaintext: same as --format=plaintext.
  • --markdown: same as --format=markdown.
  • --messageonly: same as --format=messageonly.
  • --group: reorder commits so that they are listed in groups where the xyz: prefix of the commit message defines the group. Commits are listed in original order within group.
  • --reverse: reverse the order of commits when printed, does not work with --reverse
  • --commit-url: pass in a url template which will be used to generate commit URLs for a repository not hosted in Github. {ref} is the placeholder that will be replaced with the commit, i.e. --commit-url=https://gitlab.com/myUser/myRepo/commit/{ref}
  • --start-ref=<ref>: use the given git <ref> as a starting point rather than the last tag. The <ref> can be anything commit-ish including a commit sha, tag, branch name. If you specify a --start-ref argument the commit log will not be pruned so that version commits and working on <version> commits are left in the list.
  • --end-ref=<ref>: use the given git <ref> as a end-point rather than the now. The <ref> can be anything commit-ish including a commit sha, tag, branch name.
  • --filter-release: exclude Node-style release commits from the list. e.g. "Working on v1.0.0" or "2015-10-21 Version 2.0.0" and also "npm version X" style commits containing only an x.y.z semver designator.
  • --find-matching-prs: use the GitHub API to find the pull requests that match commits that don't have the PR-URL metadata in their message text. Without metadata, it may be necessary to also pass the org/user and repo name on the commandline (as the github-user and github-project arguments as demonstrated above, it may also be necessary to use --find-matching-prs=true in this case).
  • --quiet or -q: do not print to process.stdout
  • --all or -a: process all commits since beginning, instead of last tag.
  • --help or -h: show usage and help.

Development

Tests require GitHub authentication in order to fetch pull request metadata. ghauth will generate, store and load a personal access token in your local user configuration when changelog-maker is run during normal operation. To run the tests, you will need to ensure that you have a token in place. There are two ways to do this:

  1. Run node ./changelog-maker.js -a to cause changelog-maker to fetch metadata on a commit with a PR-URL.

  2. Manually generate a personal access token with public_repo scope. Then create a config.json file:

     {
       "user": "MY_GITHUB_USERNAME",
       "token": "MY_SECRET_TOKEN"
     }

    user is your username, and token is the token you generated above. The location of config.json depends on the OS, please see https://github.com/LinusU/node-application-config#config-location

License

changelog-maker is Copyright (c) 2015 Rod Vagg @rvagg and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.

changelog

4.4.0 (2025-02-19)

Features

  • split commit-to-list to its own file (#178) (6d9fb9a)

4.3.3 (2025-01-27)

Trivial Changes

  • deps: bump actions/setup-node from 4.1.0 to 4.2.0 (#175) (04df5de)

4.3.2 (2025-01-16)

Bug Fixes

4.3.1 (2024-12-02)

Trivial Changes

  • deps-dev: bump tap from 19.2.5 to 21.0.1 (2a91332)

4.3.0 (2024-12-02)

Features

  • conventionalcommits: make group matching regexp cover CC style (6d6ef98)

Trivial Changes

  • cc: make work (1914a85)
  • deps: bump actions/setup-node from 4.0.2 to 4.1.0 (f3b5e33)

Tests

  • cc,yay: add test case for conventional commits (375e0b7)

4.2.1 (2024-11-29)

Trivial Changes

  • deps-dev: bump tap from 18.8.0 to 19.0.0 (#165) (fce4380)

4.2.0 (2024-11-28)

Features

  • add cveId support to commmit output (43d428b)

Tests

4.1.1 (2024-02-07)

Trivial Changes

  • deps: bump actions/setup-node from 4.0.1 to 4.0.2 (#160) (766aa1e)

4.1.0 (2024-01-10)

Features

  • allow commit message ONLY with --messageonly (#156) (e069500)

4.0.1 (2024-01-01)

Trivial Changes

  • deps: bump actions/setup-node from 4.0.0 to 4.0.1 (b1603c8)

4.0.0 (2023-12-12)

⚠ BREAKING CHANGES

  • deps: bump ghauth from 5.0.2 to 6.0.0 (#157)

Trivial Changes

  • deps: bump ghauth from 5.0.2 to 6.0.0 (#157) (d75c5d2)

3.2.7 (2023-12-12)

Trivial Changes

  • drop 16.x and add 20.x to CI (cc0ecb8)

3.2.6 (2023-10-25)

Trivial Changes

  • deps: bump actions/setup-node from 3.8.1 to 4.0.0 (184e2bb)

3.2.5 (2023-09-27)

Bug Fixes

Trivial Changes

  • deps: bump @octokit/graphql from 5.0.6 to 7.0.1 (e0385f1)
  • deps: bump actions/checkout from 3 to 4 (006c2d0)
  • deps: bump actions/setup-node from 3.6.0 to 3.8.0 (2e8bce3)
  • deps: bump actions/setup-node from 3.8.0 to 3.8.1 (46deecf)
  • update dependencies (7881e1b)

3.2.4 (2023-05-15)

Trivial Changes

  • deps: bump remark-preset-lint-node from 3.4.0 to 4.0.0 (7eae6ff)

3.2.3 (2023-04-10)

Bug Fixes

3.2.2 (2023-04-06)

Trivial Changes

  • deps: bump commit-stream from 1.1.0 to 2.0.1 (8821209)

3.2.1 (2022-07-12)

Trivial Changes

  • deps: bump @octokit/graphql from 4.8.0 to 5.0.0 (#132) (a44c88e)

3.2.0 (2022-06-16)

Features

  • --find-matching-prs for commits without PR-URL (#130) (0aa7a2e)

Trivial Changes

  • update node versions in Actions matrix (& enable macos) (#131) (2a87620)

3.1.0 (2022-05-05)

Features

  • add collect-commit-labels to exports (#127) (ad41ebf)

Trivial Changes

  • no-release: bump actions/checkout from 2 to 3 (#125) (dfcda56)
  • no-release: bump actions/setup-node from 2 to 3 (#124) (89a19e0)
  • no-release: bump standard from 16.0.4 to 17.0.0 (#129) (387fff4)
  • no-release: bump tap from 15.2.3 to 16.0.0 (#126) (6665653)

3.0.0 (2022-01-17)

⚠ BREAKING CHANGES

  • switch to ESM, fix output colourising, dedupe more code w/ branch-diff

Features

  • switch to ESM, fix output colourising, dedupe more code w/ branch-diff (cf51a0f)

Bug Fixes

  • add back --format=x arg option (1462378)

Trivial Changes

  • remove Node.js v12 support (fcf0d85)

2.8.0 (2022-01-17)

Features

  • escape markdown characters in user provided strings (#122) (aa0234f)

2.7.4 (2021-11-23)

Trivial Changes

  • deps: remove package-lock.json (#118) (a059bc7)
  • no-release: bump tap from 15.0.10 to 15.1.1 (#113) (fcfc5c8)

2.7.3 (2021-10-28)

Trivial Changes

  • deps: bump async from 3.2.1 to 3.2.2 (790bb0a)

2.7.2 (2021-10-25)

Trivial Changes

  • deps: bump split2 from 4.0.0 to 4.1.0 (f9676c0)

2.7.1 (2021-10-15)

Trivial Changes

  • deps: bump split2 from 3.2.2 to 4.0.0 (#109) (365916f)

2.7.0 (2021-10-14)

Features

  • run Node.js markdown formatter on markdown output (#98) (26afb81)

Bug Fixes

  • main instead of master (c6aac22)
  • remove build step from release process (ec2b9c0)

Trivial Changes