feat(cli): support bun.lock text-based lockfile from Bun 1.2#1283
Open
feat(cli): support bun.lock text-based lockfile from Bun 1.2#1283
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.representativeLockfile: string | undefinedtorepresentativeLockfiles: string[]across thePackageManagerinterface,PackageManagerDetectorabstract class, and all detector implementationsBunDetectornow returns['bun.lock', 'bun.lockb'], preferring the newer text-based formatdetectLockfilefrom per-detector implementations to a shared default inPackageManagerDetectorthat iterates the lockfile list in orderfixture-sandbox.tsto usedetectNearestLockfilescoped to the sandbox rootTest plan
npm run prepare --workspace packages/clibuilds successfullynpm run test --workspace packages/clipasses (860 tests)npm run lintpassesbun.lock(Bun >= 1.2)bun.lockb(Bun < 1.2)