Skip to content

bump-version: also update the member's version in bun.lock - #39

Merged
firsttris merged 1 commit into
mainfrom
bump-bun-lock
Nov 4, 2026
Merged

firsttris merged 1 commit into
mainfrom
bump-bun-lock

Conversation

@firsttris

Copy link
Copy Markdown
Owner

In a Bun workspace, bun.lock at the workspace root records each member's version under "workspaces" → "<member path>". The bump changed e.g. apps/web/package.json but left bun.lock at the old version: --frozen-lockfile still accepts it, but the next bun install rewrites the line. Found by the TDD review of firsttris/snapraid-ui#82.

  • For a package.json version file, the bump finds bun.lock in its folder or the nearest one above it (up to the repository root) and replaces the version in exactly that member's entry, in place (no reformatting). It also does this when the entry still has an older version from an earlier bump.
  • Root package: Bun records no version for it, so the lock is left alone.
  • package-lock.json and Cargo.lock work as before.
  • New tests/bump-version/test.sh runs the step's Python, taken from the YAML, on fixtures, and the Lint workflow runs it (new bump-version job, Bun 1.4.4). Cases: workspace member (lock updated, bun install --frozen-lockfile and bun install leave it unchanged), stale lock, root package (lock untouched), package-lock.json, Cargo.lock.

Red on the old workflow: 5 failures in the two Bun member cases. Green with the fix. Also checked by hand on a copy of snapraid-ui's manifests: bump apps/web/package.json 1.3.3 → 1.3.4, then bun install --lockfile-only leaves bun.lock unchanged.

After merging, run Move major tag so callers on @v1 get the fix.


Generated by Claude Code

…un.lock

In a Bun workspace bun.lock lives at the workspace root and records each member's version under
"workspaces" → "<member path>". The bump changed apps/web/package.json but left bun.lock at the old
version: --frozen-lockfile still accepts it, but the next bun install rewrites the line (found by
the TDD review of firsttris/snapraid-ui#82).

For a package.json version file the bump now finds bun.lock in its folder or the nearest one above
it up to the repository root and replaces the version in exactly that member's entry, in place, so
the rest of the file stays as Bun wrote it. Also when the entry is still at an older version from an
earlier bump. The root package has no version in bun.lock; there the lock is left alone. The
package-lock.json and Cargo.lock handling is unchanged.

tests/bump-version/test.sh runs the step's Python on fixtures (member, stale lock, root package,
package-lock.json, Cargo.lock) and checks that bun install --frozen-lockfile and bun install leave
the bumped lock unchanged; the Lint workflow runs it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y3rdfbWb1xDUdPRng7TX9Z
@firsttris
firsttris merged commit 35a6249 into main Nov 4, 2026
8 checks passed
@firsttris
firsttris deleted the bump-bun-lock branch November 4, 2026 04:09
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.

2 participants