1 stable release
new 1.2.0 | Apr 2, 2025 |
---|
#91 in Development tools
40KB
831 lines
changenog
Zero-config changelog generator with monorepo support.
Parses Git tags and commits since last entry, restricts them by current working directory, and adds any missing entries to the changelog.
See this repo's changelog for example output.
Usage
Rust
https://crates.io/crates/changenog
cargo install changenog
changenog
JS
https://www.npmjs.com/package/changenog
pnpm i -D changenog
{
"scripts": {
"changenog": "changenog"
}
}
Manual
Binaries are available on the releases page.
Supported Platforms
Platform | Architecture | Notes |
---|---|---|
Linux | x86_64 | Tested on Ubuntu latest |
Linux | aarch64 | Tested on Ubuntu 22.04 |
MacOS | x86_64 | Tested on MacOS 13.0 |
MacOS | aarch64 | Tested on MacOS latest |
Windows | x86_64 | Tested on Windows 11 |
Windows | aarch64 | Untested ⚠️ |
Options
Option | Type | Description |
---|---|---|
--overwrite | boolean | overwrite existing changelog |
--root | string | root dir relative to the current working directory. default: current working directory |
--output | string | output of the generated changelog. one of ['file', 'stdout']. default: 'file' |
--no-links | boolean | disable links |
--remote-url | string | remote URL to use for links. default: origin |
--max-entries | number | maximum number of entries to process. default: '100' |
--tag-filter-regex | regex | regex pattern(s) that each tag must match to be included |
--commit-filter-regex | regex | regex pattern(s) that each commit must match to be included |
--commit-filter-preset | string | filter preset(s) to use. one of ['angular', 'angular-readme-only-docs', 'no-changelog', 'no-semver'] |
Filters
Multiple --tag-filter-regex
, --commit-filter-preset
and --commit-filter-regex
options can be passed. A tag/commit must match all filters to be included.
For example:
changenog --commit-filter-preset=angular --commit-filter-regex='^(?!.*changelog).*$'
Would filter:
✅
docs(readme): update usage
feat: add new feature
fix: fix bug
perf: improve performance
❌
chore: update dependencies
ci(release): release version
docs(changelog): v0.1.0
my commit message
Presets
angular
- include onlyfeat
,fix
,perf
, anddocs
commits that match the Angular commit message conventionangular-readme-only-docs
- exclude Angulardocs
commits unless they have a scope ofreadme
no-changelog
- exclude all commits withchangelog
in the subjectno-semver
- exclude all commits that match the semver format, specifically, this regex
Entry Strategy
This is the general strategy for building and filtering entries:
- All entries are processed, restricted by
--max-entries
- Commits are filtered to only include those with changes in
--root
- If
<tag a>..<tag b>
have no commits, the tags are made part of the same entry - Commit filters are applied
- If an entry has no commits, the entry is excluded
- Tag filters are applied
- If an entry has no tags, all commits are merged into the next entry
Monorepo Support
If the git root is in a parent directory, changenog
will filter commits to only include those that have changes within the subdirectory.
To include only the tags that apply to that subdirectory, you can provide a --tag-filter-regex
option, e.g. --tag-filter-regex='my-package/.*'
. This is assuming you have a convention for tagging that scopes to that subdirectory.
Dependencies
~3.5–4.5MB
~78K SLoC