Skip to content

fix(release): stamp and check bun.lock workspace versions in the release bump #2247 - #2248

Merged
nc9 merged 1 commit into
mainfrom
boat/bunlock-version-2247
Nov 22, 2026
Merged

nc9 merged 1 commit into
mainfrom
boat/bunlock-version-2247

Conversation

@nc9

@nc9 nc9 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Release bumps moved apps/cli/package.json and npm/package.json but left the apps/cli workspace entry in bun.lock behind (0.0.190-beta.1 while package.json says 0.0.190). bun install --frozen-lockfile does not compare workspace versions, so the drift surfaced as a stray hunk in an unrelated PR.

  • New scripts/lockfile-versions.ts: reads bun.lock workspace versions (Bun.JSONC), reports every workspace whose package.json version disagrees (package plus both versions), and stamps a workspace's version with a one-line text edit that keeps bun's format.
  • scripts/sync-plugin-manifests.ts (which make release already runs in the bump PR, and which CI and release.yml run with --check) now stamps drifted bun.lock workspace versions in write mode and fails --check on drift. An entry that gains or loses a version line is not text-stamped: it fails with "Run: bun install".
  • scripts/release.ts: after the sync it asserts that the lock matches (fails the bump, naming each package and both versions) and stages bun.lock in the same commit as the manifests.
  • bun.lock: apps/cli corrected to 0.0.190, so the new CI check passes on main.

Closes #2247

Acceptance criteria

  • The bump tooling updates the bun.lock workspace version in the same commit as the package.json changes: release.ts runs sync-plugin-manifests.ts, which stamps the lock, then runs git add apps/cli/package.json npm/package.json bun.lock before the single git commit -s. Ran bun run scripts/sync-plugin-manifests.ts on main: Synced to version 0.0.190: apps/cli: package.json 0.0.190, bun.lock 0.0.190-beta.1, with a one-line bun.lock diff.
  • A check fails on disagreement, naming the package and both versions: sync-plugin-manifests.ts --check on main before the fix prints apps/cli: package.json 0.0.190, bun.lock 0.0.190-beta.1 and exits 1; assertLockMatches in release.ts does the same during the bump. Tests in scripts/lockfile-versions.test.ts: "a disagreeing pair is reported with the package and both versions" and "an agreeing pair reports no drift", plus a guard on the real tree ("this repo's bun.lock agrees with every workspace package.json"), which fails when the old bun.lock is restored.
  • After the next release bump, bun.lock on main lists apps/cli at the released version: this can only be ticked after the next bump. For now, this PR corrects the lock to 0.0.190, and a plain bun install on this branch leaves bun.lock unchanged (cmp against a copy taken before the install: identical, "no changes").

Gates

  • bun test scripts/lockfile-versions.test.ts scripts/release-version.test.ts: 26 pass, 0 fail
  • All 19 scripts/*.test.ts files, run by explicit path in batches of 5 with --timeout 30000: 417 pass, 0 fail
  • bun run scripts/sync-plugin-manifests.ts --check: in sync
  • bun run scripts/test-suites.ts --check: covered (the new test lands in rest); bash scripts/test-ci-classify.sh: 42 cases pass
  • oxlint (apps/cli config) on the 4 touched scripts: clean. tsgo strict on the touched scripts: no new errors (the 6 existing ones in release.ts also show up on base)
  • bun scripts/changelog.ts check: OK. No changelog entry because this only changes contributor release tooling.

Agent skill: no change needed.

Hold-list (release tooling): draft for Opus review.

@nc9
nc9 marked this pull request as ready for review November 22, 2026 11:08
@nc9
nc9 merged commit 8055974 into main Nov 22, 2026
10 checks passed
@nc9
nc9 deleted the boat/bunlock-version-2247 branch November 22, 2026 11:40
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.

Release bumps leave bun.lock's workspace version behind package.json

1 participant