Skip to content

Commit edcb735

Browse files
committed
Fix pnpm 12 support
1 parent 8bb8938 commit edcb735

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

index.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ function getLatestInfo(lock) {
8787
}
8888
if (lock.mode === 'deno') {
8989
let result = JSON.parse(
90-
execSync('deno run -A npm:npm show caniuse-lite version --json').toString()
90+
execSync(
91+
'deno run -A npm:npm show caniuse-lite version --json'
92+
).toString()
9193
)
9294
return { version: Array.isArray(result) ? result[0] : result }
9395
}
@@ -96,7 +98,11 @@ function getLatestInfo(lock) {
9698
} catch (e) {
9799
if (e.code === 'ENOENT' || e.status === 127) {
98100
throw new BrowserslistUpdateError(
99-
'Cannot find ' + lock.mode + ' binary in PATH. Please install ' + lock.mode + ' or run updates manually.'
101+
'Cannot find ' +
102+
lock.mode +
103+
' binary in PATH. Please install ' +
104+
lock.mode +
105+
' or run updates manually.'
100106
)
101107
}
102108
throw e
@@ -364,7 +370,7 @@ module.exports = function updateDB(print = defaultPrint) {
364370
let packages = lockContent.includes('baseline-browser-mapping')
365371
? 'caniuse-lite baseline-browser-mapping'
366372
: 'caniuse-lite'
367-
updateWith(print, 'pnpm up --depth=Infinity --no-save ' + packages)
373+
updateWith(print, 'pnpm up --depth=9999 --no-save ' + packages)
368374
} else if (lock.mode === 'bun') {
369375
updateBun(print, lock, latest)
370376
} else if (lock.mode === 'deno') {

test/index.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,8 @@ test('updates caniuse-lite for pnpm', async () => {
298298
runUpdate(),
299299
`Latest version: ${caniuse.version}\n` +
300300
'Updating caniuse-lite version\n' +
301-
'$ pnpm up --depth=Infinity --no-save caniuse-lite\n' +
301+
'$ pnpm up --depth=9999 --no-save ' +
302+
'caniuse-lite baseline-browser-mapping\n' +
302303
'caniuse-lite has been successfully updated\n'
303304
)
304305

0 commit comments

Comments
 (0)