Changelog and Version Recommendation
@neosjs/release ships with a built-in changelog plugin built on conventional-changelog and conventional-recommended-bump. Out of the box, it automatically:
- Recommends the semantic version increment for the next release
- Generates a structured changelog and writes it to
CHANGELOG.md - Injects the changelog into the context so that GitHub / GitLab Releases or Release-via-PR can use it directly as release notes
Version Recommendation
The changelog plugin analyzes the commits made after the current latest tag (following configuration such as git.tagMatch / git.tagExclude). By default, only releasable commit types trigger a version bump (this can be changed with preset.types[].release):
- Contains
BREAKING CHANGEor a commit type with!(such asfeat!:,chore!:) → recommendsmajor - Contains
feat(release: 'minor') → recommendsminor - Contains
fix,perf, orrevert(release: 'patch') → recommendspatch - Contains only non-releasable types such as
docs,chore,ci,refactor,style,test, orbuild→ no recommendation - No new commits at all → no recommendation
Behavior in each running mode:
- Interactive mode: you still choose the final version. The recommended option is marked with
← recommendedon its right in the option list and selected by default, so pressing Enter accepts it. If there are only non-releasable changes, no option is marked as recommended and an informational message is printed. - CI mode (--ci):
- When there are releasable commits and no increment type is passed explicitly, the recommended increment type is used directly.
- When there are new commits after the latest tag but no releasable changes, it prints a notice and skips the release with exit code
0by default (not treated as a failure). Setchangelog.requireReleasableCommitstofalseto restore the fallback to apatchrelease. - First releases (the repository has no tags yet), an explicitly specified version or increment,
--canary,--only-changelog, and the case of no new commits at all (still controlled bygit.requireCommits) are not affected by this skip rule.
- Explicitly specified increment type (such as
release patch): the specified value wins. If it differs from the type recommended by the commit history, a warning is printed.
Recommendation Rules for Pre-releases
- Default behavior (
strictSemVer: false): continues the current pre-release series.- For example, when the current version is
1.1.0-beta.1and the new commits contain onlyfix, the recommendation isprerelease(→1.1.0-beta.2). - If the commits since the latest stable version reach a higher level (for example, a
BREAKING CHANGEappears), it moves up to the higher pre-release series (for example →2.0.0-beta.0).
- For example, when the current version is
- Strict mode (
strictSemVer: true): does not continue the current pre-release series. It recommendsprepatch/preminor/premajorstrictly from the commits since the latest tag.
Disabling or Customizing the Recommendation Logic
export default {
changelog: {
// Option 1: disable the automatic recommendation entirely (CI mode falls back to patch)
ignoreRecommendedBump: true
// Option 2: customize the whatBump function of conventional-recommended-bump (or set it to false)
// whatBump(commits) {
// return { level: 2, reason: 'custom rule' }
// }
}
}Default Sections, Entry Format, and Custom Presets
The default preset is conventionalcommits, which contains 11 sections. The 4 types of changes that matter to users (feat, fix, perf, revert) are shown by default and carry a release level. The other 7 types of internal engineering commits are marked hidden: true by default and do not trigger a version bump:
| Commit Type | Changelog Section | Triggers Bump (release) | Shown by Default |
|---|---|---|---|
feat | ✨ Features | minor | Yes |
fix | 🐛 Bug Fixes | patch | Yes |
perf | 🔥 Performance Improvements | patch | Yes |
revert | 🔙 Reverts | patch | Yes |
docs | 📚 Documentation | No | No (hidden: true) |
refactor | 💅 Code Refactoring | No | No (hidden: true) |
style | 🎨 Code Style Changes | No | No (hidden: true) |
test | ✅ Tests | No | No (hidden: true) |
build | 🏗️ Build Changes | No | No (hidden: true) |
ci | 🤖 Continuous Integration | No | No (hidden: true) |
chore | 🏡 Chores | No | No (hidden: true) |
Entry rendering conventions:
- Breaking changes: the preset automatically outputs a dedicated
### ⚠ BREAKING CHANGESsection at the very top of each version's changelog. The corresponding commits also appear, with links, in their own sections. - Single-link PR entries: in GitHub repositories, squash-merge commits (whose subject ends with
(#20)) automatically have the preset-generated([#20](…/issues/20)) ([sha](…))collapsed into a single([#20](…/pull/20))link pointing to the PR. Commits without(#N)keep their commit hash link, and references such as, closes #12are left unchanged. Other platforms are not affected.
To show only the types you care about (note: preset.types is an array, and configuring it replaces the default list as a whole while keeping preset.name: 'conventionalcommits'; release can be 'major' | 'minor' | 'patch' | false):
export default {
changelog: {
header: '# Changelog\n\nAll notable changes to this project will be documented in this file.\n',
preset: {
types: [
{ type: 'feat', section: '✨ Features', release: 'minor' },
{ type: 'fix', section: '🐛 Bug Fixes', release: 'patch' },
{ type: 'perf', section: '⚡ Performance', release: 'patch' },
{ type: 'docs', section: '📝 Documentation', release: 'patch' }
]
}
}
}Contributors Section
By default, a ❤️ Contributors section is appended to the end of each new version's changelog:
- Scope: the Conventional Commits in
git log <latestTag>..HEAD --no-mergesthat belong topreset.types. Commit authors andCo-authored-by:co-authors from the commit messages are extracted automatically, accounts whose name or email contains[bot]are excluded, entries are deduplicated by email, and they are sorted by commit count in descending order. - Not appended on the first full generation: when
CHANGELOG.mddoes not exist and the full history is generated for the first time withreleaseCount: 0, no contributors section is appended. It is also omitted when the current version has no contributors. - GitHub username resolution order:
- Offline parsing of GitHub noreply emails (such as
12345+user@users.noreply.github.com→user). - When a token is available (
GITHUB_TOKEN/github.tokenRef, or aghCLI logged in locally), the GitHub API is called to look up the author account by commit SHA. This works for private repositories. Thecommitsendpoint, which returns commit metadata only, is preferred (small response, fast). When there are more than 80 commits in the release and a previous tag exists, thecompareendpoint is used to fetch everything at once, falling back tocommitswhencompareis unavailable. A token from an environment variable is only sent togithub.com, the host specified bygithub.host, or theGITHUB_SERVER_URLof Actions: when the repository is on GitHub Enterprise,github.hostmust be configured, otherwise the request is sent without a token (see GitHub Releases). - When there is no token and the repository is on
github.com,ungh.cc/repos/{owner}/{repo}is queried first to confirm that the repository is public, and then each email is looked up onungh.cc. If the repository is private (404), the per-email lookups are skipped, a one-line hint is printed (recommending a token or logging in with theghCLI), and only names are shown. - On other platforms such as GitHub Enterprise / GitLab, or when the network lookup times out (5 seconds in total) or fails, only names are shown. A release is never affected.
- Offline parsing of GitHub noreply emails (such as
- Disabling network lookups or the section:
changelog.contributors: false: does not output the contributors section.changelog.contributorsLookup: falseor the environment variableNEOS_RELEASE_OFFLINE=1: disables all network lookups.changelog.contributorsEmail: true: appends<email>after the name when no GitHub username can be resolved.
- Integration with GitHub Releases: in
CHANGELOG.md, contributors are rendered as- Name ([@user](https://github.com/user)). When publishing to a GitHub Release (or running--sync-releases), the body is converted automatically to- Name (@user)so that GitHub renders the native Contributors avatar bar. - Does not slow down the release: network lookups run in the background and never block you:
- In interactive mode, lookups start in the background as soon as the version selection list appears. The requests are already running during the seconds you spend choosing a version, so there is usually nothing left to wait for afterwards.
- If the lookups take longer than 150 milliseconds, the terminal shows a spinning "Generating changelog..." indicator, which is cleared automatically when they finish. Nothing is shown if they finish within 150 milliseconds.
- The indicator is not shown in modes such as
--ci,--dry-run, and-V.
Writing to CHANGELOG.md
- By default, during the
beforeReleasestage, the changelog for this release is inserted after theheaderat the top ofchangelog.infile(CHANGELOG.mdby default). In interactive mode, confirmation is requested before it is written. - First generation: if
infiledoes not exist yet, the complete changelog history is generated automatically withreleaseCount: 0, andgit add <infile>is run automatically so that the newly created changelog file is committed together with this release. - Release notes only, without writing the file: set
changelog.generate: false(orchangelog.infile: null). The changelog is still computed and provided to GitHub / GitLab Releases or the PR body, but it is not written to a local file. - Non-incrementing release (
--no-increment): skips writing toCHANGELOG.md(to avoid duplicating an entry for a version that already exists).
Command-Line Preview and Script Extraction
# Preview the changelog that will be generated when an interactive release starts
release --show-changelog
# Print only the changelog for this release to stdout (other logs go to stderr), for reuse in scripts and CI
release --only-changelog > release-notes.mdWhen the changelog plugin is disabled or produces no content, git.logCommand is run automatically as a fallback to generate the commit list.
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
changelog.generate | boolean | true | Whether to write the generated changelog to the file specified by infile |
changelog.infile | string | null | 'CHANGELOG.md' | Output file path of the changelog (no file is written when set to null or an empty string) |
changelog.header | string | '# Changelog\n' | Title content at the top of the changelog file |
changelog.preset | object | string | conventionalcommits (with 11 type sections) | Preset configuration passed to conventional-changelog and conventional-recommended-bump |
changelog.ignoreRecommendedBump | boolean | false | Set to true to disable version recommendation from the commit history |
changelog.whatBump | false | Function | undefined | Custom version recommendation function (set to false to disable recommendation) |
changelog.requireReleasableCommits | boolean | true | Skip the release with exit code 0 in CI mode when there are new commits but no releasable changes |
changelog.strictSemVer | boolean | false | Recommend strictly from the commit history for pre-releases instead of continuing the current pre-release series |
changelog.contributors | boolean | true | Whether to append a ### ❤️ Contributors section to the end of this version's changelog |
changelog.contributorsLookup | boolean | true | Whether to resolve contributors' GitHub usernames over the network (NEOS_RELEASE_OFFLINE=1 also disables it) |
changelog.contributorsEmail | boolean | false | Whether to show the email after the name when no GitHub username can be resolved |
changelog.writerOpts | object | undefined | Custom writer options passed to the conventional-changelog renderer |
In addition, pass-through fields such as
context,gitRawCommitsOpts, andparserOptsset on thechangelogconfiguration object are handed toconventional-changelogas well.
Complete Default Configuration
{
changelog: {
generate: true,
header: '# Changelog\n',
infile: 'CHANGELOG.md',
ignoreRecommendedBump: false,
requireReleasableCommits: true,
contributors: true,
contributorsLookup: true,
contributorsEmail: false,
preset: {
name: 'conventionalcommits',
types: [
{ section: '✨ Features', type: 'feat', release: 'minor' },
{ section: '🐛 Bug Fixes', type: 'fix', release: 'patch' },
{ section: '🔥 Performance Improvements', type: 'perf', release: 'patch' },
{ section: '🔙 Reverts', type: 'revert', release: 'patch' },
{ section: '📚 Documentation', type: 'docs', hidden: true },
{ section: '💅 Code Refactoring', type: 'refactor', hidden: true },
{ section: '🎨 Code Style Changes', type: 'style', hidden: true },
{ section: '✅ Tests', type: 'test', hidden: true },
{ section: '🏗️ Build Changes', type: 'build', hidden: true },
{ section: '🤖 Continuous Integration', type: 'ci', hidden: true },
{ section: '🏡 Chores', type: 'chore', hidden: true }
]
}
}
}