Skip to content

Wire the version-sync hook into the changesets action (main is red without it) - #102

Merged
brentrager merged 1 commit into
mainfrom
fix/wire-version-hook
Aug 20, 2026
Merged

Wire the version-sync hook into the changesets action (main is red without it)#102
brentrager merged 1 commit into
mainfrom
fix/wire-version-hook

Conversation

@brentrager

Copy link
Copy Markdown
Contributor

main is red

#99 added scripts/sync-versions.mjs and the package.json version script — but not the one input that makes the action run it.

changesets/action@v1 runs changeset version itself unless you hand it a version: command, and npm lifecycle hooks fire on npm version, never on changeset version. So the script sat there unexecuted.

The next two releases proved it: #100 and #101 bumped packages/core/package.json to 0.19.2 while the other eleven version-bearing files stayed at 0.19.0. That is precisely what the new versions lane exists to catch, and it has been red on main since #101 — the guard working as designed, on the first real opportunity.

Fix

  • version: pnpm run version on the changesets action, so the hook runs and the action commits the synced files into the release commit — the whole reason for syncing in version rather than after publish. Note pnpm run version, not pnpm version: the latter is pnpm's own builtin and would not run the script.
  • Sync all eleven files to 0.19.2, catching main back up.

No changeset, on purpose

Adding one would bump to 0.19.3 and re-open the drift this commit closes. The sync is mechanical catch-up to a behavior change #99 already described in the changelog. From here the hook keeps them in step without anyone having to remember.

🤖 Generated with Claude Code

https://claude.ai/code/session_0152bbE1veqfG1SVJdyLCBxC

…thout it)

#99 added `scripts/sync-versions.mjs` and the package.json `version` script, but
not the one input that makes the action run it. `changesets/action@v1` runs
`changeset version` ITSELF unless given a `version:` command — and npm lifecycle
hooks fire on `npm version`, never on `changeset version`. So the script sat
there unexecuted.

The next two releases proved it: #100 and #101 bumped
`packages/core/package.json` to 0.19.2 while the other eleven version-bearing
files stayed at 0.19.0, which is exactly what the new `versions` lane is for —
it has been red on `main` since #101.

Two changes:

- `version: pnpm run version` on the changesets action, so the hook actually
  runs and the action commits the synced files into the release commit. `pnpm
  run version`, not `pnpm version` — the latter is pnpm's own builtin and would
  not run the script.
- Sync all eleven files up to 0.19.2, catching main back up.

No changeset on purpose. Adding one would bump to 0.19.3 and re-open the drift
this commit is closing; the sync is mechanical catch-up, not a behavior change
beyond the one #99 already described. From here the hook keeps them in step
without anyone remembering to.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0152bbE1veqfG1SVJdyLCBxC
@changeset-bot

changeset-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 15b7b88

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@brentrager
brentrager merged commit 60335d1 into main Aug 20, 2026
8 checks passed
@brentrager
brentrager deleted the fix/wire-version-hook branch August 20, 2026 18:53
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