Skip to content

Commit 00015c4

Browse files
committed
fix: address PR review feedback
- Use startsWith("bun.") instead of includes("bun") in inferLockFileType to avoid false positives (e.g. ubuntu.lock) - Add bun.lockb to CI test matrix alongside bun.lock
1 parent 1f91730 commit 00015c4

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

.github/workflows/test.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,25 +156,26 @@ jobs:
156156
fail-fast: false
157157
matrix:
158158
version: [latest, alpha]
159+
lockfile: [bun.lock, bun.lockb]
159160
runs-on: ubuntu-latest
160161
steps:
161162
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
162163

163-
- name: Create test project with bun.lock
164+
- name: Create test project with ${{ matrix.lockfile }}
164165
run: |
165166
mkdir -p test-project
166167
cd test-project
167168
echo '{"name":"test-project","private":true}' > package.json
168-
touch bun.lock
169+
touch ${{ matrix.lockfile }}
169170
170-
- name: Setup Vite+ (${{ matrix.version }}) with bun cache
171+
- name: Setup Vite+ (${{ matrix.version }}) with bun cache (${{ matrix.lockfile }})
171172
uses: ./
172173
id: setup
173174
with:
174175
version: ${{ matrix.version }}
175176
run-install: false
176177
cache: true
177-
cache-dependency-path: test-project/bun.lock
178+
cache-dependency-path: test-project/${{ matrix.lockfile }}
178179

179180
- name: Verify installation
180181
run: |

dist/index.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function inferLockFileType(fullPath: string, filename: string): LockFileInfo {
110110
if (filename.includes("yarn")) {
111111
return { type: LockFileType.Yarn, path: fullPath, filename };
112112
}
113-
if (filename.includes("bun")) {
113+
if (filename.startsWith("bun.")) {
114114
return { type: LockFileType.Bun, path: fullPath, filename };
115115
}
116116
// Default to npm

0 commit comments

Comments
 (0)