Skip to content

Commit

Permalink
fix: detect bun.lock files in addition to bun.lockb files (#5918)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrstork authored Dec 10, 2024
1 parent 7366761 commit 689a8dd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions packages/build-info/src/runtime/bun.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ test('detects node when bunfig.toml is present', async ({ fs }) => {
expect(detected[0].name).toBe('Bun')
})

test('detects node when bun.lock is present', async ({ fs }) => {
const cwd = mockFileSystem({
'bun.lock': '',
})

const detected = await new Project(fs, cwd).detectRuntime()
expect(detected[0].name).toBe('Bun')
})

test('detects node when bun.lockb is present', async ({ fs }) => {
const cwd = mockFileSystem({
'bun.lockb': '',
Expand Down
2 changes: 1 addition & 1 deletion packages/build-info/src/runtime/bun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import { LangRuntime } from './runtime.js'
export class Bun extends LangRuntime {
id = 'bun'
name = 'Bun'
configFiles = ['bun.lockb', 'bunfig.toml']
configFiles = ['bun.lock', 'bun.lockb', 'bunfig.toml']
}

0 comments on commit 689a8dd

Please sign in to comment.