Add Robot_JoyIt driver

This commit is contained in:
2026-01-17 16:50:07 +01:00
parent e9e50acf5f
commit 0cfb4d5a95
15848 changed files with 570836 additions and 268976 deletions

View File

@@ -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"

View File

@@ -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
View File

View File

@@ -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

View File

@@ -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 wont 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 wont be shown.\n'
)
)
}
} else {
let changes = diffBrowsers(oldList, newList)
if (changes) {

View File

@@ -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"

View File

@@ -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 = ' '