Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bun: Add support for text lock file #30160

Merged
merged 3 commits into from
Jan 23, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,7 @@ 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
Loading