summaryrefslogtreecommitdiff
path: root/node_modules/update-browserslist-db/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/update-browserslist-db/index.js')
-rw-r--r--node_modules/update-browserslist-db/index.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/node_modules/update-browserslist-db/index.js b/node_modules/update-browserslist-db/index.js
index 9235d1fe..f13c6e66 100644
--- a/node_modules/update-browserslist-db/index.js
+++ b/node_modules/update-browserslist-db/index.js
@@ -42,9 +42,12 @@ function detectLockfile() {
let lockfileShrinkwrap = join(packageDir, 'npm-shrinkwrap.json')
let lockfileYarn = join(packageDir, 'yarn.lock')
let lockfilePnpm = join(packageDir, 'pnpm-lock.yaml')
+ let lockfileBun = join(packageDir, 'bun.lockb')
if (existsSync(lockfilePnpm)) {
return { file: lockfilePnpm, mode: 'pnpm' }
+ } else if (existsSync(lockfileBun)) {
+ return { file: lockfileBun, mode: 'bun' }
} else if (existsSync(lockfileNpm)) {
return { file: lockfileNpm, mode: 'npm' }
} else if (existsSync(lockfileYarn)) {
@@ -75,6 +78,11 @@ function getLatestInfo(lock) {
if (lock.mode === 'pnpm') {
return JSON.parse(execSync('pnpm info caniuse-lite --json').toString())
}
+ if (lock.mode === 'bun') {
+ // TO-DO: No 'bun info' yet. Created issue: https://github.com/oven-sh/bun/issues/12280
+ return JSON.parse(execSync(' npm info caniuse-lite --json').toString())
+ }
+
return JSON.parse(execSync('npm show caniuse-lite --json').toString())
}
@@ -287,6 +295,8 @@ module.exports = function updateDB(print = defaultPrint) {
updateWith(print, yarnCommand + ' up -R caniuse-lite')
} else if (lock.mode === 'pnpm') {
updateWith(print, 'pnpm up caniuse-lite')
+ } else if (lock.mode === 'bun') {
+ updateWith(print, 'bun update caniuse-lite')
} else {
updatePackageManually(print, lock, latest)
}