lerna-clean-changelogs-cli1.4.14
§ Idea
This CLI removes the frivolous changelog file entries generated by commitizen :

§ Use it
Once installed, call it one of two ways:
lcc
lernacleanchangelog
§ Purpose
This application performs the following cleaning steps on all encountered changelog.md
's:
It removes bump-only changelog entries that
conventional-changelog
generates. For example:**Note:** Version bump only for package ranges-apply
These will be deleted along with their headings.
It removes diff links from headings. Change the following:
## [2.9.1](https://gitlab.com/codsen/codsen/tree/master/packages/ranges-apply/compare/ranges-apply@2.9.0...ranges-apply@2.9.1) (2018-12-27)
into:
## 2.9.1 (2018-12-27)
The diff links are not universal (across Sourcehut, GitLab, GitHub and BitBucket to name few) so it's more future-proof to remove them.
Remove
h1
headings and turn them intoh2
, with the exception of the first, main heading of the changelog.For exampe, change the following:
# [2.0.0](https://gitlab.com/codsen/codsen/tree/master/packages/ranges-apply/compare/ranges-apply@2.0.0...ranges-apply@1.9.1) (2018-12-27)
into:
## 2.0.0 (2018-12-27)
(notice how a second
#
character is added, beside link being removed)
§ The proof of the pudding is in the eating
Here's how we use it ourselves.
In short, sourcehut CI calls package.json script and it cleanses the changelogs before npm package is published to npm and all builds are comitted from CI to git.
Have a look at our CI yml config :
{ { ciConfig | safe } }
There's a line:
- npm run pub:vers
That's how CI calls npm script. By the way, "lerna-clean-changelogs-cli" can be called at all because our monorepo root package.json has it as a dev-dependency:
"devDependencies": {
...
"lerna-clean-changelogs-cli": "^1.4.14",
...
}
In the package.json, pub:vers
looks like this:
"pub:vers": "lerna version --conventional-commits --no-commit-hooks --yes && lernacleanchangelog '**'",
We call lerna version
and then we call lernacleanchangelog
— the call name for lerna-clean-changelogs-cli
. We could also call lcc
instead but it's more descriptive, considering you come back after months and wonder what is such and such command...
§ Changelog
See it in the monorepo , on GitHub.
§ Contributing
To report bugs or request features or assistance, raise an issue on GitHub .
Any code contributions welcome! All Pull Requests will be dealt promptly.
§ Licence
Copyright © 2010–2021 Roy Revelt and other contributors
Related packages:
commitizen
generated changelogsnpm-check-updates
but supports Lerna monorepos and enforces strict semver values