Skip to content

Commit 4fda39c

Browse files
authored
support bun.lock as package manager lockfile (vercel#74056)
1 parent 53bb90c commit 4fda39c

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

packages/next-codemod/lib/handle-package.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ export type PackageManager = 'npm' | 'pnpm' | 'yarn' | 'bun'
77
export function getPkgManager(baseDir: string): PackageManager {
88
try {
99
const lockFile = findUp.sync(
10-
['package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'bun.lockb'],
10+
[
11+
'package-lock.json',
12+
'yarn.lock',
13+
'pnpm-lock.yaml',
14+
'bun.lock',
15+
'bun.lockb',
16+
],
1117
{ cwd: baseDir }
1218
)
1319
if (lockFile) {
@@ -18,6 +24,7 @@ export function getPkgManager(baseDir: string): PackageManager {
1824
return 'yarn'
1925
case 'pnpm-lock.yaml':
2026
return 'pnpm'
27+
case 'bun.lock':
2128
case 'bun.lockb':
2229
return 'bun'
2330
default:

packages/next/src/lib/find-root.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ import findUp from 'next/dist/compiled/find-up'
33

44
export function findRootLockFile(cwd: string) {
55
return findUp.sync(
6-
['pnpm-lock.yaml', 'package-lock.json', 'yarn.lock', 'bun.lockb'],
6+
[
7+
'pnpm-lock.yaml',
8+
'package-lock.json',
9+
'yarn.lock',
10+
'bun.lock',
11+
'bun.lockb',
12+
],
713
{
814
cwd,
915
}

0 commit comments

Comments
 (0)