Skip to content

Commit

Permalink
fix: do not specify --frozen-lockfile
Browse files Browse the repository at this point in the history
  • Loading branch information
blimmer committed Jan 14, 2025
1 parent 31af1bc commit 770a081
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ export class PackageManager {
case LockFile.BUN:
return new PackageManager({
lockFile: LockFile.BUN,
installCommand: logLevel && logLevel !== LogLevel.INFO ? ['bun', 'install', '--frozen-lockfile', '--backend', 'copyfile', '--silent'] : ['bun', 'install', '--frozen-lockfile', '--backend', 'copyfile'],
// Bun's default is to not force `--frozen-lockfile`, so it's not specified here. If they ever add a
// flag to explicitly disable it, we should add it here. https://github.com/oven-sh/bun/issues/16387
installCommand: logLevel && logLevel !== LogLevel.INFO ? ['bun', 'install', '--backend', 'copyfile', '--silent'] : ['bun', 'install', '--backend', 'copyfile'],
runCommand: ['bun', 'run'],
});
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ test('Detects bun.lockb', () => {
assetHashType: AssetHashType.OUTPUT,
bundling: expect.objectContaining({
command: expect.arrayContaining([
expect.stringMatching(/bun\.lockb.+bun install --frozen-lockfile/),
expect.stringMatching(/bun\.lockb.+bun install/),
]),
}),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ test('from a bun.lockb', () => {
const packageManager = PackageManager.fromLockFile('/path/to/bun.lockb');
expect(packageManager.lockFile).toEqual(LockFile.BUN);
expect(packageManager.argsSeparator).toBeUndefined();
expect(packageManager.installCommand).toEqual(['bun', 'install', '--frozen-lockfile', '--backend', 'copyfile']);
expect(packageManager.installCommand).toEqual(['bun', 'install', '--backend', 'copyfile']);
expect(packageManager.runCommand).toEqual(['bun', 'run']);

expect(packageManager.runBinCommand('my-bin')).toBe('bun run my-bin');
});

test('from a bun.lockb with LogLevel.ERROR', () => {
const packageManager = PackageManager.fromLockFile('/path/to/bun.lockb', LogLevel.ERROR);
expect(packageManager.installCommand).toEqual(['bun', 'install', '--frozen-lockfile', '--backend', 'copyfile', '--silent']);
expect(packageManager.installCommand).toEqual(['bun', 'install', '--backend', 'copyfile', '--silent']);
});

test('defaults to NPM', () => {
Expand Down

0 comments on commit 770a081

Please sign in to comment.