A long time has passed since we created this program. Our workflow has evolved since and we don't use it any more. Our npm packages live in a monorepo on GitLab, deployment is via GitLab CI and
commitizen automates all the versioning and changelog updates.
We're saying this because normally we use our programs, following the "eat what you cook" principle of Indieweb
§ How it works
This is a CLI app. Once installed, call it in the root folder where your
On a default setting,
chlu just silently does the job — checks and fixes your changelog. If you want some output, call it with
--loud flag. It will say "OK" each time it writes successfully.
Chlu works on both GitLab, Bitbucket and GitHub repositories.
chlu stands for CHangeLog Update. We should note that all changelogs should follow the rules given by http://keepachangelog.com. Now, the tedious part is diff links. Chlu takes care of them. Also, changelog should have all dates in ISO format, should have diff links between changelog entries and use a consistent title format, for example,
## [1.11.0] - 2018-07-24. These are main things, and
chlu-cli automates updating all that.
§ What it does
7 main features (see above):
- Wraps the version with a link (brackets) and creates the diff URL in the footer.
- Adds missing diff links in the footer. It's intelligent-enough to detect existing links and their order.
- If the
.gitrepo data is successfully read, it will create/convert diff links either in Bitbucket- or GitHub-based repository changelogs.
- User account name in diff link is set correctly as per
- Project's name in diff link is set correctly as per
- "from" version is chosen wisely. If there is no
gitdata available, a previous entry in the changelog will be used. But if there is, the real, previous version will be used. In practice, often there are many patch releases between changelog entries (hence the word used in the title — "notable changes"). If we merely calculated the diff between changelog entries (usually minor/major releases), all patch releases would get caught in between and skew the picture of what was released for real.
- If dates are not in ISO format (year-month-date), we try to convert them. Couple well-known projects with messed-up changelogs are used as guinea pigs in our unit tests.
§ A nifty setup idea
It would be tedious and unnecessary to run
chlu manually. Not to mention, you might even forget to run it.
What we suggest is, add
chlu to one of your aliases, for example,
git add .. That's what we do.
For example, edit your
.zshrc (or Bash config, or whatever-you-are-using-shell's config) file to contain:
# create a function which runs commands if certain files exist, and skips if they don't:
[ -e readme.md ] && doctoc readme.md
[ -e changelog.md ] && chlu
git add .
# create alias for your command, call the function:
The example above runs:
- doctoc on
readme.mdif it exists,
- then it runs chlu on
changelog.mdif it exists,
- then it runs npm-check and lastly,
- it runs the
git add ..
It means, you always get your readme, changelog committed in a correct, updated state and all dependencies checked.
See it in the monorepo , on Sourcehut.
Copyright © 2010–2020 Roy Revelt and other contributors