Add Robot_JoyIt driver
This commit is contained in:
10
node_modules/update-browserslist-db/README.md
generated
vendored
10
node_modules/update-browserslist-db/README.md
generated
vendored
@@ -6,12 +6,20 @@
|
||||
CLI tool to update `caniuse-lite` with browsers DB
|
||||
from [Browserslist](https://github.com/browserslist/browserslist/) config.
|
||||
|
||||
Some queries like `last 2 version` or `>1%` depends on actual data
|
||||
Some queries like `last 2 versions` or `>1%` depend on actual data
|
||||
from `caniuse-lite`.
|
||||
|
||||
```sh
|
||||
npx update-browserslist-db@latest
|
||||
```
|
||||
Or if using `pnpm`:
|
||||
```sh
|
||||
pnpm exec update-browserslist-db latest
|
||||
```
|
||||
Or if using `yarn`:
|
||||
```sh
|
||||
yarn dlx update-browserslist-db@latest
|
||||
```
|
||||
|
||||
<a href="https://evilmartians.com/?utm_source=update-browserslist-db">
|
||||
<img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg"
|
||||
|
||||
3
node_modules/update-browserslist-db/check-npm-version.js
generated
vendored
3
node_modules/update-browserslist-db/check-npm-version.js
generated
vendored
@@ -7,10 +7,11 @@ try {
|
||||
process.stderr.write(
|
||||
pico.red(
|
||||
'Update npm or call ' +
|
||||
pico.yellow('npx update-browserslist-db@latest') +
|
||||
pico.yellow('npx browserslist@latest --update-db') +
|
||||
'\n'
|
||||
)
|
||||
)
|
||||
process.exit(1)
|
||||
}
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
} catch (e) {}
|
||||
|
||||
0
node_modules/update-browserslist-db/cli.js
generated
vendored
Normal file → Executable file
0
node_modules/update-browserslist-db/cli.js
generated
vendored
Normal file → Executable file
2
node_modules/update-browserslist-db/index.d.ts
generated
vendored
2
node_modules/update-browserslist-db/index.d.ts
generated
vendored
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Run update and print output to terminal.
|
||||
*/
|
||||
declare function updateDb(print?: (str: string) => void): Promise<void>
|
||||
declare function updateDb(print?: (str: string) => void): void
|
||||
|
||||
export = updateDb
|
||||
|
||||
77
node_modules/update-browserslist-db/index.js
generated
vendored
77
node_modules/update-browserslist-db/index.js
generated
vendored
@@ -1,7 +1,7 @@
|
||||
let { existsSync, readFileSync, writeFileSync } = require('fs')
|
||||
let { execSync } = require('child_process')
|
||||
let { join } = require('path')
|
||||
let escalade = require('escalade/sync')
|
||||
let { existsSync, readFileSync, writeFileSync } = require('fs')
|
||||
let { join } = require('path')
|
||||
let pico = require('picocolors')
|
||||
|
||||
const { detectEOL, detectIndent } = require('./utils')
|
||||
@@ -17,6 +17,10 @@ function BrowserslistUpdateError(message) {
|
||||
|
||||
BrowserslistUpdateError.prototype = Error.prototype
|
||||
|
||||
// Check if HADOOP_HOME is set to determine if this is running in a Hadoop environment
|
||||
const IsHadoopExists = !!process.env.HADOOP_HOME
|
||||
const yarnCommand = IsHadoopExists ? 'yarnpkg' : 'yarn'
|
||||
|
||||
/* c8 ignore next 3 */
|
||||
function defaultPrint(str) {
|
||||
process.stdout.write(str)
|
||||
@@ -38,9 +42,13 @@ 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.lock')
|
||||
let lockfileBunBinary = join(packageDir, 'bun.lockb')
|
||||
|
||||
if (existsSync(lockfilePnpm)) {
|
||||
return { file: lockfilePnpm, mode: 'pnpm' }
|
||||
} else if (existsSync(lockfileBun) || existsSync(lockfileBunBinary)) {
|
||||
return { file: lockfileBun, mode: 'bun' }
|
||||
} else if (existsSync(lockfileNpm)) {
|
||||
return { file: lockfileNpm, mode: 'npm' }
|
||||
} else if (existsSync(lockfileYarn)) {
|
||||
@@ -59,17 +67,22 @@ function detectLockfile() {
|
||||
function getLatestInfo(lock) {
|
||||
if (lock.mode === 'yarn') {
|
||||
if (lock.version === 1) {
|
||||
return JSON.parse(execSync('yarnpkg info caniuse-lite --json').toString())
|
||||
.data
|
||||
return JSON.parse(
|
||||
execSync(yarnCommand + ' info caniuse-lite --json').toString()
|
||||
).data
|
||||
} else {
|
||||
return JSON.parse(
|
||||
execSync('yarnpkg npm info caniuse-lite --json').toString()
|
||||
execSync(yarnCommand + ' npm info caniuse-lite --json').toString()
|
||||
)
|
||||
}
|
||||
}
|
||||
if (lock.mode === 'pnpm') {
|
||||
return JSON.parse(execSync('pnpm info caniuse-lite --json').toString())
|
||||
}
|
||||
if (lock.mode === 'bun') {
|
||||
return JSON.parse(execSync(' bun info caniuse-lite --json').toString())
|
||||
}
|
||||
|
||||
return JSON.parse(execSync('npm show caniuse-lite --json').toString())
|
||||
}
|
||||
|
||||
@@ -209,14 +222,15 @@ function updatePackageManually(print, lock, latest) {
|
||||
)
|
||||
writeFileSync(lock.file, lockfileData.content)
|
||||
|
||||
let install = lock.mode === 'yarn' ? 'yarnpkg add -W' : lock.mode + ' install'
|
||||
let install =
|
||||
lock.mode === 'yarn' ? yarnCommand + ' add -W' : lock.mode + ' install'
|
||||
print(
|
||||
'Installing new caniuse-lite version\n' +
|
||||
pico.yellow('$ ' + install.replace('yarnpkg', 'yarn') + ' caniuse-lite') +
|
||||
pico.yellow('$ ' + install + ' caniuse-lite baseline-browser-mapping') +
|
||||
'\n'
|
||||
)
|
||||
try {
|
||||
execSync(install + ' caniuse-lite')
|
||||
execSync(install + ' caniuse-lite baseline-browser-mapping')
|
||||
} catch (e) /* c8 ignore start */ {
|
||||
print(
|
||||
pico.red(
|
||||
@@ -233,21 +247,17 @@ function updatePackageManually(print, lock, latest) {
|
||||
} /* c8 ignore end */
|
||||
|
||||
let del =
|
||||
lock.mode === 'yarn' ? 'yarnpkg remove -W' : lock.mode + ' uninstall'
|
||||
lock.mode === 'yarn' ? yarnCommand + ' remove -W' : lock.mode + ' uninstall'
|
||||
print(
|
||||
'Cleaning package.json dependencies from caniuse-lite\n' +
|
||||
pico.yellow('$ ' + del.replace('yarnpkg', 'yarn') + ' caniuse-lite') +
|
||||
pico.yellow('$ ' + del + ' caniuse-lite baseline-browser-mapping') +
|
||||
'\n'
|
||||
)
|
||||
execSync(del + ' caniuse-lite')
|
||||
execSync(del + ' caniuse-lite baseline-browser-mapping')
|
||||
}
|
||||
|
||||
function updateWith(print, cmd) {
|
||||
print(
|
||||
'Updating caniuse-lite version\n' +
|
||||
pico.yellow('$ ' + cmd.replace('yarnpkg', 'yarn')) +
|
||||
'\n'
|
||||
)
|
||||
print('Updating caniuse-lite version\n' + pico.yellow('$ ' + cmd) + '\n')
|
||||
try {
|
||||
execSync(cmd)
|
||||
} catch (e) /* c8 ignore start */ {
|
||||
@@ -282,9 +292,18 @@ module.exports = function updateDB(print = defaultPrint) {
|
||||
print('Latest version: ' + pico.bold(pico.green(latest.version)) + '\n')
|
||||
|
||||
if (lock.mode === 'yarn' && lock.version !== 1) {
|
||||
updateWith(print, 'yarnpkg up -R caniuse-lite')
|
||||
updateWith(
|
||||
print,
|
||||
yarnCommand + ' up -R caniuse-lite baseline-browser-mapping'
|
||||
)
|
||||
} else if (lock.mode === 'pnpm') {
|
||||
updateWith(print, 'pnpm up caniuse-lite')
|
||||
let lockContent = readFileSync(lock.file).toString()
|
||||
let packages = lockContent.includes('baseline-browser-mapping')
|
||||
? 'caniuse-lite baseline-browser-mapping'
|
||||
: 'caniuse-lite'
|
||||
updateWith(print, 'pnpm up --depth=Infinity --no-save ' + packages)
|
||||
} else if (lock.mode === 'bun') {
|
||||
updateWith(print, 'bun update caniuse-lite baseline-browser-mapping')
|
||||
} else {
|
||||
updatePackageManually(print, lock, latest)
|
||||
}
|
||||
@@ -301,15 +320,21 @@ module.exports = function updateDB(print = defaultPrint) {
|
||||
}
|
||||
|
||||
if (listError) {
|
||||
print(
|
||||
pico.red(
|
||||
'\n' +
|
||||
listError.stack +
|
||||
'\n\n' +
|
||||
'Problem with browser list retrieval.\n' +
|
||||
'Target browser changes won’t be shown.\n'
|
||||
if (listError.message.includes("Cannot find module 'browserslist'")) {
|
||||
print(
|
||||
pico.gray(
|
||||
'Install `browserslist` to your direct dependencies ' +
|
||||
'to see target browser changes\n'
|
||||
)
|
||||
)
|
||||
)
|
||||
} else {
|
||||
print(
|
||||
pico.gray(
|
||||
'Problem with browser list retrieval.\n' +
|
||||
'Target browser changes won’t be shown.\n'
|
||||
)
|
||||
)
|
||||
}
|
||||
} else {
|
||||
let changes = diffBrowsers(oldList, newList)
|
||||
if (changes) {
|
||||
|
||||
6
node_modules/update-browserslist-db/package.json
generated
vendored
6
node_modules/update-browserslist-db/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "update-browserslist-db",
|
||||
"version": "1.0.13",
|
||||
"version": "1.2.3",
|
||||
"description": "CLI tool to update caniuse-lite to refresh target browsers from Browserslist config",
|
||||
"keywords": [
|
||||
"caniuse",
|
||||
@@ -30,8 +30,8 @@
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"escalade": "^3.1.1",
|
||||
"picocolors": "^1.0.0"
|
||||
"escalade": "^3.2.0",
|
||||
"picocolors": "^1.1.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"browserslist": ">= 4.21.0"
|
||||
|
||||
7
node_modules/update-browserslist-db/utils.js
generated
vendored
7
node_modules/update-browserslist-db/utils.js
generated
vendored
@@ -3,8 +3,11 @@ const { EOL } = require('os')
|
||||
const getFirstRegexpMatchOrDefault = (text, regexp, defaultValue) => {
|
||||
regexp.lastIndex = 0 // https://stackoverflow.com/a/11477448/4536543
|
||||
let match = regexp.exec(text)
|
||||
if (match !== null) return match[1]
|
||||
return defaultValue
|
||||
if (match !== null) {
|
||||
return match[1]
|
||||
} else {
|
||||
return defaultValue
|
||||
}
|
||||
}
|
||||
|
||||
const DEFAULT_INDENT = ' '
|
||||
|
||||
Reference in New Issue
Block a user