Skip to content

Commit

Permalink
Merge pull request #30160 from Arctomachine/next
Browse files Browse the repository at this point in the history
Bun: Add support for text lock file
  • Loading branch information
valentinpalkovic authored Jan 23, 2025
2 parents 3d390e2 + 467b82c commit 4e3194f
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import { Yarn2Proxy } from './Yarn2Proxy';
const NPM_LOCKFILE = 'package-lock.json';
const PNPM_LOCKFILE = 'pnpm-lock.yaml';
const YARN_LOCKFILE = 'yarn.lock';
const BUN_LOCKFILE = 'bun.lockb';
const BUN_LOCKFILE = 'bun.lock';
const BUN_LOCKFILE_BINARY = 'bun.lockb';

type PackageManagerProxy =
| typeof NPMProxy
Expand All @@ -37,6 +38,7 @@ export class JsPackageManagerFactory {
findUpSync(PNPM_LOCKFILE, { cwd }),
findUpSync(NPM_LOCKFILE, { cwd }),
findUpSync(BUN_LOCKFILE, { cwd }),
findUpSync(BUN_LOCKFILE_BINARY, { cwd }),
]
.filter(Boolean)
.sort((a, b) => {
Expand Down Expand Up @@ -78,7 +80,10 @@ export class JsPackageManagerFactory {
return new NPMProxy({ cwd });
}

if (hasBunCommand && closestLockfile === BUN_LOCKFILE) {
if (
hasBunCommand &&
(closestLockfile === BUN_LOCKFILE || closestLockfile === BUN_LOCKFILE_BINARY)
) {
return new BUNProxy({ cwd });
}

Expand Down

0 comments on commit 4e3194f

Please sign in to comment.