update-browserslist-db 1.1.4 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/index.js +14 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,6 +16,10 @@ Or if using `pnpm`:
|
|
|
16
16
|
```sh
|
|
17
17
|
pnpm exec update-browserslist-db latest
|
|
18
18
|
```
|
|
19
|
+
Or if using `yarn`:
|
|
20
|
+
```sh
|
|
21
|
+
yarn dlx update-browserslist-db@latest
|
|
22
|
+
```
|
|
19
23
|
|
|
20
24
|
<a href="https://evilmartians.com/?utm_source=update-browserslist-db">
|
|
21
25
|
<img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg"
|
package/index.js
CHANGED
|
@@ -227,11 +227,11 @@ function updatePackageManually(print, lock, latest) {
|
|
|
227
227
|
lock.mode === 'yarn' ? yarnCommand + ' add -W' : lock.mode + ' install'
|
|
228
228
|
print(
|
|
229
229
|
'Installing new caniuse-lite version\n' +
|
|
230
|
-
pico.yellow('$ ' + install + ' caniuse-lite') +
|
|
230
|
+
pico.yellow('$ ' + install + ' caniuse-lite baseline-browser-mapping') +
|
|
231
231
|
'\n'
|
|
232
232
|
)
|
|
233
233
|
try {
|
|
234
|
-
execSync(install + ' caniuse-lite')
|
|
234
|
+
execSync(install + ' caniuse-lite baseline-browser-mapping')
|
|
235
235
|
} catch (e) /* c8 ignore start */ {
|
|
236
236
|
print(
|
|
237
237
|
pico.red(
|
|
@@ -251,10 +251,10 @@ function updatePackageManually(print, lock, latest) {
|
|
|
251
251
|
lock.mode === 'yarn' ? yarnCommand + ' remove -W' : lock.mode + ' uninstall'
|
|
252
252
|
print(
|
|
253
253
|
'Cleaning package.json dependencies from caniuse-lite\n' +
|
|
254
|
-
pico.yellow('$ ' + del + ' caniuse-lite') +
|
|
254
|
+
pico.yellow('$ ' + del + ' caniuse-lite baseline-browser-mapping') +
|
|
255
255
|
'\n'
|
|
256
256
|
)
|
|
257
|
-
execSync(del + ' caniuse-lite')
|
|
257
|
+
execSync(del + ' caniuse-lite baseline-browser-mapping')
|
|
258
258
|
}
|
|
259
259
|
|
|
260
260
|
function updateWith(print, cmd) {
|
|
@@ -293,11 +293,18 @@ module.exports = function updateDB(print = defaultPrint) {
|
|
|
293
293
|
print('Latest version: ' + pico.bold(pico.green(latest.version)) + '\n')
|
|
294
294
|
|
|
295
295
|
if (lock.mode === 'yarn' && lock.version !== 1) {
|
|
296
|
-
updateWith(
|
|
296
|
+
updateWith(
|
|
297
|
+
print,
|
|
298
|
+
yarnCommand + ' up -R caniuse-lite baseline-browser-mapping'
|
|
299
|
+
)
|
|
297
300
|
} else if (lock.mode === 'pnpm') {
|
|
298
|
-
|
|
301
|
+
let lockContent = readFileSync(lock.file).toString()
|
|
302
|
+
let packages = lockContent.includes('baseline-browser-mapping')
|
|
303
|
+
? 'caniuse-lite baseline-browser-mapping'
|
|
304
|
+
: 'caniuse-lite'
|
|
305
|
+
updateWith(print, 'pnpm up --no-save ' + packages)
|
|
299
306
|
} else if (lock.mode === 'bun') {
|
|
300
|
-
updateWith(print, 'bun update caniuse-lite')
|
|
307
|
+
updateWith(print, 'bun update caniuse-lite baseline-browser-mapping')
|
|
301
308
|
} else {
|
|
302
309
|
updatePackageManually(print, lock, latest)
|
|
303
310
|
}
|