Skip to content

chore(release): stamp the changelog heading during the release - #71

Merged
ronickg merged 1 commit into
mainfrom
chore/release-stamps-changelog
Oct 13, 2026
Merged

ronickg merged 1 commit into
mainfrom
chore/release-stamps-changelog

Conversation

@ronickg

@ronickg ronickg commented Oct 13, 2026

Copy link
Copy Markdown
Owner

bun run release now does everything; the only question it asks is the version bump, as in your other libraries.

Before, it stopped at the GitHub release step unless CHANGELOG.md already had a ## <version> heading. That heading had to be renamed from ## Unreleased by hand, and by the time it failed, npm was already published and the tag pushed.

Now, via release-it hooks:

  • before:init: stamp-changelog.mjs --check stops the release before anything happens if ## Unreleased is missing or empty.
  • after:bump: stamp-changelog.mjs <version> renames ## Unreleased to the new version. In release-it 21 this runs before the package is staged for the release commit and before changelog-section.mjs reads the notes. So the rename ships in "chore: release nitro-input v…", and the GitHub release gets that section.

Why the changelog stays hand-written: the other libraries generate theirs from commits with @release-it/conventional-changelog. Here the entries carry the reasons and measurements, and in this monorepo the commit log would also pick up example-app and CI commits.

Tested on a copy of the current changelog:

  • The check passes.
  • Stamping produces ## 0.4.0, and changelog-section.mjs 0.4.0 returns that section.
  • A missing or empty Unreleased section stops the release with a message.

🤖 Generated with Claude Code

`bun run release` stopped at the GitHub release unless CHANGELOG.md
already had a `## <version>` heading, which had to be renamed from
`## Unreleased` by hand first - and by then npm was published and the
tag pushed. Now release-it does it, as the other libraries' release
commands do everything but ask for the bump:

- before:init: stamp-changelog.mjs --check stops the release before
  anything happens when `## Unreleased` is missing or empty.
- after:bump: stamp-changelog.mjs <version> renames it to the new
  version. It runs before release-it stages the package for the release
  commit and before changelog-section.mjs reads the notes, so the rename
  goes out with "chore: release nitro-input v<version>".

The changelog stays hand-written (the other libraries generate theirs
from commits with @release-it/conventional-changelog; here the entries
carry the why and the measurements, and in this monorepo the commits
include the example app's and CI's).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ronickg
ronickg merged commit a5b6f1c into main Oct 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant