Skip to content

feat(cli): support bun.lock text-based lockfile from Bun 1.2#1283

Merged
sorccu merged 2 commits intomainfrom
simo/sim-219-support-text-based-bunlock-lockfile-in-the-bun-detector
Apr 13, 2026
Merged

feat(cli): support bun.lock text-based lockfile from Bun 1.2#1283
sorccu merged 2 commits intomainfrom
simo/sim-219-support-text-based-bunlock-lockfile-in-the-bun-detector

Conversation

@sorccu
Copy link
Copy Markdown
Member

@sorccu sorccu commented Apr 8, 2026

Summary

Bun 1.2 changed from a binary lockfile (bun.lockb) to a text-based lockfile (bun.lock). This PR updates package manager detection to support both formats.

  • Rename representativeLockfile: string | undefined to representativeLockfiles: string[] across the PackageManager interface, PackageManagerDetector abstract class, and all detector implementations
  • BunDetector now returns ['bun.lock', 'bun.lockb'], preferring the newer text-based format
  • Move detectLockfile from per-detector implementations to a shared default in PackageManagerDetector that iterates the lockfile list in order
  • Update fixture-sandbox.ts to use detectNearestLockfile scoped to the sandbox root

Test plan

  • npm run prepare --workspace packages/cli builds successfully
  • npm run test --workspace packages/cli passes (860 tests)
  • npm run lint passes
  • Manual: verify detection works with a project using bun.lock (Bun >= 1.2)
  • Manual: verify detection still works with a project using bun.lockb (Bun < 1.2)

@sorccu sorccu force-pushed the simo/sim-219-support-text-based-bunlock-lockfile-in-the-bun-detector branch from 3056f67 to ed53bfd Compare April 10, 2026 16:27
sorccu and others added 2 commits April 13, 2026 16:02
Bun 1.2 changed from a binary lockfile (bun.lockb) to a text-based
lockfile (bun.lock). Change representativeLockfile to
representativeLockfiles (string[]) so package managers can declare
multiple lockfile names. Earlier entries in the list are preferred.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sorccu sorccu force-pushed the simo/sim-219-support-text-based-bunlock-lockfile-in-the-bun-detector branch from ed53bfd to 02f7a3b Compare April 13, 2026 07:02
@sorccu sorccu merged commit bb99ed9 into main Apr 13, 2026
6 checks passed
@sorccu sorccu deleted the simo/sim-219-support-text-based-bunlock-lockfile-in-the-bun-detector branch April 13, 2026 07:36
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