Lerna: Allow customization of CHANGELOG header

Created on 17 Sep 2019  路  3Comments  路  Source: lerna/lerna

Expected Behavior

It should be possible to customize the header of the generated changelog (or omit it completely).

Current Behavior

The changelog header is hardcoded in https://github.com/lerna/lerna/blob/master/core/conventional-commits/lib/constants.js

Possible Solution

A command.publish.changelogHeader could be added to lerna.json.

Steps to Reproduce (for bugs)


  1. Generate a new changelog for any lerna project with conventional commits
  2. Observe the header

lerna.json


{
  "packages": [
    "components/*",
    "tools/*"
  ],
  "version": "independent",
  "npmClient": "yarn",
  "useWorkspaces": true,
  "command": {
    "publish": {
      "conventionalCommits": true,
      "changelogPreset": "spectrum"
    },
    "version": {
      "message": "chore(release): release"
    }
  }
}

Context

Content strategy advises us that we need to be consistent in how we refer to changelogs. We consider it to be one word, and the lerna template uses title case Change Log and includes text we're rather substitute with something else.

Your Environment

| Executable | Version |
| ---: | :--- |
| lerna --version | 3.16.4 |
| npm --version | 6.10.2 |
| yarn --version | 1.12.3 |
| node --version | 12.6.0 |

| OS | Version |
| --- | --- |
| NAME | VERSION |
| macOS Mojave | 10.14.6 |

good first issue help wanted

Most helpful comment

I've been using standard-version to generate changelogs recently. And I used lerna to do this for my mono repos, but I found it confusing that with the same preset(angular), they produced changelogs with different headers, which is kinda annoying. I think these tools should produce the same results with same presets, or at least a way to customize this.

All 3 comments

Sure, that's reasonable.

I've been using standard-version to generate changelogs recently. And I used lerna to do this for my mono repos, but I found it confusing that with the same preset(angular), they produced changelogs with different headers, which is kinda annoying. I think these tools should produce the same results with same presets, or at least a way to customize this.

Opened a PR for adding support for custom change log header here https://github.com/lerna/lerna/pull/2535

Was this page helpful?
0 / 5 - 0 ratings