Skip to content

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:

  1. Recommends the semantic version increment for the next release
  2. Generates a structured changelog and writes it to CHANGELOG.md
  3. 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 CHANGE or a commit type with ! (such as feat!:, chore!:) → recommends major
  • Contains feat (release: 'minor') → recommends minor
  • Contains fix, perf, or revert (release: 'patch') → recommends patch
  • Contains only non-releasable types such as docs, chore, ci, refactor, style, test, or build → 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 ← recommended on 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 0 by default (not treated as a failure). Set changelog.requireReleasableCommits to false to restore the fallback to a patch release.
    • 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 by git.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.1 and the new commits contain only fix, the recommendation is prerelease (→ 1.1.0-beta.2).
    • If the commits since the latest stable version reach a higher level (for example, a BREAKING CHANGE appears), it moves up to the higher pre-release series (for example → 2.0.0-beta.0).
  • Strict mode (strictSemVer: true): does not continue the current pre-release series. It recommends prepatch / preminor / premajor strictly from the commits since the latest tag.

Disabling or Customizing the Recommendation Logic ​

ts
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 TypeChangelog SectionTriggers Bump (release)Shown by Default
feat✨ FeaturesminorYes
fix🐛 Bug FixespatchYes
perf🔥 Performance ImprovementspatchYes
revert🔙 RevertspatchYes
docs📚 DocumentationNoNo (hidden: true)
refactor💅 Code RefactoringNoNo (hidden: true)
style🎨 Code Style ChangesNoNo (hidden: true)
test✅ TestsNoNo (hidden: true)
build🏗️ Build ChangesNoNo (hidden: true)
ci🤖 Continuous IntegrationNoNo (hidden: true)
chore🏡 ChoresNoNo (hidden: true)

Entry rendering conventions:

  • Breaking changes: the preset automatically outputs a dedicated ### ⚠ BREAKING CHANGES section 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 #12 are 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):

ts
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-merges that belong to preset.types. Commit authors and Co-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.md does not exist and the full history is generated for the first time with releaseCount: 0, no contributors section is appended. It is also omitted when the current version has no contributors.
  • GitHub username resolution order:
    1. Offline parsing of GitHub noreply emails (such as 12345+user@users.noreply.github.com → user).
    2. When a token is available (GITHUB_TOKEN / github.tokenRef, or a gh CLI logged in locally), the GitHub API is called to look up the author account by commit SHA. This works for private repositories. The commits endpoint, 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, the compare endpoint is used to fetch everything at once, falling back to commits when compare is unavailable. A token from an environment variable is only sent to github.com, the host specified by github.host, or the GITHUB_SERVER_URL of Actions: when the repository is on GitHub Enterprise, github.host must be configured, otherwise the request is sent without a token (see GitHub Releases).
    3. 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 on ungh.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 the gh CLI), and only names are shown.
    4. 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.
  • Disabling network lookups or the section:
    • changelog.contributors: false: does not output the contributors section.
    • changelog.contributorsLookup: false or the environment variable NEOS_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 beforeRelease stage, the changelog for this release is inserted after the header at the top of changelog.infile (CHANGELOG.md by default). In interactive mode, confirmation is requested before it is written.
  • First generation: if infile does not exist yet, the complete changelog history is generated automatically with releaseCount: 0, and git 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 (or changelog.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 to CHANGELOG.md (to avoid duplicating an entry for a version that already exists).

Command-Line Preview and Script Extraction ​

bash
# 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.md

When the changelog plugin is disabled or produces no content, git.logCommand is run automatically as a fallback to generate the commit list.

Configuration Options ​

OptionTypeDefaultDescription
changelog.generatebooleantrueWhether to write the generated changelog to the file specified by infile
changelog.infilestring | null'CHANGELOG.md'Output file path of the changelog (no file is written when set to null or an empty string)
changelog.headerstring'# Changelog\n'Title content at the top of the changelog file
changelog.presetobject | stringconventionalcommits (with 11 type sections)Preset configuration passed to conventional-changelog and conventional-recommended-bump
changelog.ignoreRecommendedBumpbooleanfalseSet to true to disable version recommendation from the commit history
changelog.whatBumpfalse | FunctionundefinedCustom version recommendation function (set to false to disable recommendation)
changelog.requireReleasableCommitsbooleantrueSkip the release with exit code 0 in CI mode when there are new commits but no releasable changes
changelog.strictSemVerbooleanfalseRecommend strictly from the commit history for pre-releases instead of continuing the current pre-release series
changelog.contributorsbooleantrueWhether to append a ### ❤️ Contributors section to the end of this version's changelog
changelog.contributorsLookupbooleantrueWhether to resolve contributors' GitHub usernames over the network (NEOS_RELEASE_OFFLINE=1 also disables it)
changelog.contributorsEmailbooleanfalseWhether to show the email after the name when no GitHub username can be resolved
changelog.writerOptsobjectundefinedCustom writer options passed to the conventional-changelog renderer

In addition, pass-through fields such as context, gitRawCommitsOpts, and parserOpts set on the changelog configuration object are handed to conventional-changelog as well.

Complete Default Configuration ​

ts
{
  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 }
      ]
    }
  }
}