From b1e2c8fd5cb5dfa46bc440a12eafaf56cd844b1c Mon Sep 17 00:00:00 2001 From: Philipp Tanlak Date: Mon, 24 Nov 2025 20:54:57 +0100 Subject: Docs --- node_modules/.bin/autoprefixer | 22 ++ node_modules/.bin/browserslist | 156 ++++++++++++++ node_modules/.bin/cssesc | 116 ++++++++++ node_modules/.bin/jiti | 16 ++ node_modules/.bin/nanoid | 55 +++++ node_modules/.bin/postcss | 354 +++++++++++++++++++++++++++++++ node_modules/.bin/resolve | 50 +++++ node_modules/.bin/sucrase | 3 + node_modules/.bin/sucrase-node | 18 ++ node_modules/.bin/tailwind | 7 + node_modules/.bin/tailwindcss | 7 + node_modules/.bin/update-browserslist-db | 42 ++++ 12 files changed, 846 insertions(+) create mode 100755 node_modules/.bin/autoprefixer create mode 100755 node_modules/.bin/browserslist create mode 100755 node_modules/.bin/cssesc create mode 100755 node_modules/.bin/jiti create mode 100755 node_modules/.bin/nanoid create mode 100755 node_modules/.bin/postcss create mode 100755 node_modules/.bin/resolve create mode 100755 node_modules/.bin/sucrase create mode 100755 node_modules/.bin/sucrase-node create mode 100755 node_modules/.bin/tailwind create mode 100755 node_modules/.bin/tailwindcss create mode 100755 node_modules/.bin/update-browserslist-db (limited to 'node_modules/.bin') diff --git a/node_modules/.bin/autoprefixer b/node_modules/.bin/autoprefixer new file mode 100755 index 0000000..785830e --- /dev/null +++ b/node_modules/.bin/autoprefixer @@ -0,0 +1,22 @@ +#!/usr/bin/env node + +let mode = process.argv[2] +if (mode === '--info') { + process.stdout.write(require('../')().info() + '\n') +} else if (mode === '--version') { + process.stdout.write( + 'autoprefixer ' + require('../package.json').version + '\n' + ) +} else { + process.stdout.write( + 'autoprefix\n' + + '\n' + + 'Options:\n' + + ' --info Show target browsers and used prefixes\n' + + ' --version Show version number\n' + + ' --help Show help\n' + + '\n' + + 'Usage:\n' + + ' autoprefixer --info\n' + ) +} diff --git a/node_modules/.bin/browserslist b/node_modules/.bin/browserslist new file mode 100755 index 0000000..7b5236d --- /dev/null +++ b/node_modules/.bin/browserslist @@ -0,0 +1,156 @@ +#!/usr/bin/env node + +var updateDb = require('update-browserslist-db') +var fs = require('fs') + +var browserslist = require('./') +var pkg = require('./package.json') + +var args = process.argv.slice(2) + +var USAGE = + 'Usage:\n' + + ' npx browserslist\n' + + ' npx browserslist "QUERIES"\n' + + ' npx browserslist --json "QUERIES"\n' + + ' npx browserslist --config="path/to/browserlist/file"\n' + + ' npx browserslist --coverage "QUERIES"\n' + + ' npx browserslist --coverage=US "QUERIES"\n' + + ' npx browserslist --coverage=US,RU,global "QUERIES"\n' + + ' npx browserslist --env="environment name defined in config"\n' + + ' npx browserslist --stats="path/to/browserlist/stats/file"\n' + + ' npx browserslist --mobile-to-desktop\n' + + ' npx browserslist --ignore-unknown-versions\n' + +function isArg(arg) { + return args.some(function (str) { + return str === arg || str.indexOf(arg + '=') === 0 + }) +} + +function error(msg) { + process.stderr.write('browserslist: ' + msg + '\n') + process.exit(1) +} + +if (isArg('--help') || isArg('-h')) { + process.stdout.write(pkg.description + '.\n\n' + USAGE + '\n') +} else if (isArg('--version') || isArg('-v')) { + process.stdout.write('browserslist ' + pkg.version + '\n') +} else if (isArg('--update-db')) { + /* c8 ignore next 8 */ + process.stdout.write( + 'The --update-db command is deprecated.\n' + + 'Please use npx update-browserslist-db@latest instead.\n' + ) + process.stdout.write('Browserslist DB update will still be made.\n') + updateDb(function (str) { + process.stdout.write(str) + }) +} else { + var mode = 'browsers' + var opts = {} + var queries + var areas + + for (var i = 0; i < args.length; i++) { + if (args[i][0] !== '-') { + queries = args[i].replace(/^["']|["']$/g, '') + continue + } + + var arg = args[i].split('=') + var name = arg[0] + var value = arg[1] + + if (value) value = value.replace(/^["']|["']$/g, '') + + if (name === '--config' || name === '-b') { + opts.config = value + } else if (name === '--env' || name === '-e') { + opts.env = value + } else if (name === '--stats' || name === '-s') { + opts.stats = value + } else if (name === '--coverage' || name === '-c') { + if (mode !== 'json') mode = 'coverage' + if (value) { + areas = value.split(',') + } else { + areas = ['global'] + } + } else if (name === '--json') { + mode = 'json' + } else if (name === '--mobile-to-desktop') { + /* c8 ignore next */ + opts.mobileToDesktop = true + } else if (name === '--ignore-unknown-versions') { + /* c8 ignore next */ + opts.ignoreUnknownVersions = true + } else { + error('Unknown arguments ' + args[i] + '.\n\n' + USAGE) + } + } + + var browsers + try { + browsers = browserslist(queries, opts) + } catch (e) { + if (e.name === 'BrowserslistError') { + error(e.message) + } /* c8 ignore start */ else { + throw e + } /* c8 ignore end */ + } + + var coverage + if (mode === 'browsers') { + browsers.forEach(function (browser) { + process.stdout.write(browser + '\n') + }) + } else if (areas) { + coverage = areas.map(function (area) { + var stats + if (area !== 'global') { + stats = area + } else if (opts.stats) { + stats = JSON.parse(fs.readFileSync(opts.stats)) + } + var result = browserslist.coverage(browsers, stats) + var round = Math.round(result * 100) / 100.0 + + return [area, round] + }) + + if (mode === 'coverage') { + var prefix = 'These browsers account for ' + process.stdout.write(prefix) + coverage.forEach(function (data, index) { + var area = data[0] + var round = data[1] + var end = 'globally' + if (area && area !== 'global') { + end = 'in the ' + area.toUpperCase() + } else if (opts.stats) { + end = 'in custom statistics' + } + + if (index !== 0) { + process.stdout.write(prefix.replace(/./g, ' ')) + } + + process.stdout.write(round + '% of all users ' + end + '\n') + }) + } + } + + if (mode === 'json') { + var data = { browsers: browsers } + if (coverage) { + data.coverage = coverage.reduce(function (object, j) { + object[j[0]] = j[1] + return object + }, {}) + } + process.stdout.write(JSON.stringify(data, null, ' ') + '\n') + } +} diff --git a/node_modules/.bin/cssesc b/node_modules/.bin/cssesc new file mode 100755 index 0000000..188c034 --- /dev/null +++ b/node_modules/.bin/cssesc @@ -0,0 +1,116 @@ +#!/usr/bin/env node +const fs = require('fs'); +const cssesc = require('../cssesc.js'); +const strings = process.argv.splice(2); +const stdin = process.stdin; +const options = {}; +const log = console.log; + +const main = function() { + const option = strings[0]; + + if (/^(?:-h|--help|undefined)$/.test(option)) { + log( + 'cssesc v%s - https://mths.be/cssesc', + cssesc.version + ); + log([ + '\nUsage:\n', + '\tcssesc [string]', + '\tcssesc [-i | --identifier] [string]', + '\tcssesc [-s | --single-quotes] [string]', + '\tcssesc [-d | --double-quotes] [string]', + '\tcssesc [-w | --wrap] [string]', + '\tcssesc [-e | --escape-everything] [string]', + '\tcssesc [-v | --version]', + '\tcssesc [-h | --help]', + '\nExamples:\n', + '\tcssesc \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'', + '\tcssesc --identifier \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'', + '\tcssesc --escape-everything \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'', + '\tcssesc --double-quotes --wrap \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'', + '\techo \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\' | cssesc' + ].join('\n')); + return process.exit(1); + } + + if (/^(?:-v|--version)$/.test(option)) { + log('v%s', cssesc.version); + return process.exit(1); + } + + strings.forEach(function(string) { + // Process options + if (/^(?:-i|--identifier)$/.test(string)) { + options.isIdentifier = true; + return; + } + if (/^(?:-s|--single-quotes)$/.test(string)) { + options.quotes = 'single'; + return; + } + if (/^(?:-d|--double-quotes)$/.test(string)) { + options.quotes = 'double'; + return; + } + if (/^(?:-w|--wrap)$/.test(string)) { + options.wrap = true; + return; + } + if (/^(?:-e|--escape-everything)$/.test(string)) { + options.escapeEverything = true; + return; + } + + // Process string(s) + let result; + try { + result = cssesc(string, options); + log(result); + } catch (exception) { + log(exception.message + '\n'); + log('Error: failed to escape.'); + log('If you think this is a bug in cssesc, please report it:'); + log('https://github.com/mathiasbynens/cssesc/issues/new'); + log( + '\nStack trace using cssesc@%s:\n', + cssesc.version + ); + log(exception.stack); + return process.exit(1); + } + }); + // Return with exit status 0 outside of the `forEach` loop, in case + // multiple strings were passed in. + return process.exit(0); + +}; + +if (stdin.isTTY) { + // handle shell arguments + main(); +} else { + let timeout; + // Either the script is called from within a non-TTY context, or `stdin` + // content is being piped in. + if (!process.stdout.isTTY) { + // The script was called from a non-TTY context. This is a rather uncommon + // use case we don’t actively support. However, we don’t want the script + // to wait forever in such cases, so… + timeout = setTimeout(function() { + // …if no piped data arrived after a whole minute, handle shell + // arguments instead. + main(); + }, 60000); + } + let data = ''; + stdin.on('data', function(chunk) { + clearTimeout(timeout); + data += chunk; + }); + stdin.on('end', function() { + strings.push(data.trim()); + main(); + }); + stdin.resume(); +} diff --git a/node_modules/.bin/jiti b/node_modules/.bin/jiti new file mode 100755 index 0000000..af44c47 --- /dev/null +++ b/node_modules/.bin/jiti @@ -0,0 +1,16 @@ +#!/usr/bin/env node + +const { resolve } = require("path"); + +const script = process.argv.splice(2, 1)[0]; + +if (!script) { + // eslint-disable-next-line no-console + console.error("Usage: jiti [...arguments]"); + process.exit(1); +} + +const pwd = process.cwd(); +const jiti = require("..")(pwd); +const resolved = (process.argv[1] = jiti.resolve(resolve(pwd, script))); +jiti(resolved); diff --git a/node_modules/.bin/nanoid b/node_modules/.bin/nanoid new file mode 100755 index 0000000..c76db0f --- /dev/null +++ b/node_modules/.bin/nanoid @@ -0,0 +1,55 @@ +#!/usr/bin/env node + +let { nanoid, customAlphabet } = require('..') + +function print(msg) { + process.stdout.write(msg + '\n') +} + +function error(msg) { + process.stderr.write(msg + '\n') + process.exit(1) +} + +if (process.argv.includes('--help') || process.argv.includes('-h')) { + print(` + Usage + $ nanoid [options] + + Options + -s, --size Generated ID size + -a, --alphabet Alphabet to use + -h, --help Show this help + + Examples + $ nanoid --s 15 + S9sBF77U6sDB8Yg + + $ nanoid --size 10 --alphabet abc + bcabababca`) + process.exit() +} + +let alphabet, size +for (let i = 2; i < process.argv.length; i++) { + let arg = process.argv[i] + if (arg === '--size' || arg === '-s') { + size = Number(process.argv[i + 1]) + i += 1 + if (Number.isNaN(size) || size <= 0) { + error('Size must be positive integer') + } + } else if (arg === '--alphabet' || arg === '-a') { + alphabet = process.argv[i + 1] + i += 1 + } else { + error('Unknown argument ' + arg) + } +} + +if (alphabet) { + let customNanoid = customAlphabet(alphabet, size) + print(customNanoid()) +} else { + print(nanoid(size)) +} diff --git a/node_modules/.bin/postcss b/node_modules/.bin/postcss new file mode 100755 index 0000000..da052ce --- /dev/null +++ b/node_modules/.bin/postcss @@ -0,0 +1,354 @@ +#!/usr/bin/env node + +import fs from 'fs-extra' +import path from 'path' + +import prettyHrtime from 'pretty-hrtime' +import stdin from 'get-stdin' +import read from 'read-cache' +import pc from 'picocolors' +import { globby } from 'globby' +import slash from 'slash' +import chokidar from 'chokidar' + +import postcss from 'postcss' +import postcssrc from 'postcss-load-config' +import postcssReporter from 'postcss-reporter/lib/formatter.js' + +import argv from './lib/args.js' +import createDependencyGraph from './lib/DependencyGraph.js' +import getMapfile from './lib/getMapfile.js' + +const reporter = postcssReporter() +const depGraph = createDependencyGraph() + +let input = argv._ +const { dir, output } = argv + +if (argv.map) argv.map = { inline: false } + +let cliConfig + +async function buildCliConfig() { + cliConfig = { + options: { + map: argv.map !== undefined ? argv.map : { inline: true }, + parser: argv.parser ? await import(argv.parser) : undefined, + syntax: argv.syntax ? await import(argv.syntax) : undefined, + stringifier: argv.stringifier + ? await import(argv.stringifier) + : undefined, + }, + plugins: argv.use + ? await Promise.all( + argv.use.map(async (plugin) => { + try { + return (await import(plugin)).default() + } catch (e) { + const msg = e.message || `Cannot find module '${plugin}'` + let prefix = msg.includes(plugin) ? '' : ` (${plugin})` + if (e.name && e.name !== 'Error') prefix += `: ${e.name}` + return error(`Plugin Error${prefix}: ${msg}'`) + } + }) + ) + : [], + } +} + +let configFile + +if (argv.env) process.env.NODE_ENV = argv.env +if (argv.config) argv.config = path.resolve(argv.config) + +let { isTTY } = process.stdin + +if (process.env.FORCE_IS_TTY === 'true') { + isTTY = true +} + +if (argv.watch && isTTY) { + process.stdin.on('end', () => process.exit(0)) + process.stdin.resume() +} + +/* istanbul ignore next */ +if (parseInt(postcss().version) < 8) { + error('Please install PostCSS 8 or above') +} + +buildCliConfig() + .then(() => { + if (argv.watch && !(argv.output || argv.replace || argv.dir)) { + error('Cannot write to stdout in watch mode') + // Need to explicitly exit here, since error() doesn't exit in watch mode + process.exit(1) + } + + if (input && input.length) { + return globby( + input.map((i) => slash(String(i))), + { dot: argv.includeDotfiles } + ) + } + + if (argv.replace || argv.dir) { + error( + 'Input Error: Cannot use --dir or --replace when reading from stdin' + ) + } + + if (argv.watch) { + error('Input Error: Cannot run in watch mode when reading from stdin') + } + + return ['stdin'] + }) + .then((i) => { + if (!i || !i.length) { + error('Input Error: You must pass a valid list of files to parse') + } + + if (i.length > 1 && !argv.dir && !argv.replace) { + error( + 'Input Error: Must use --dir or --replace with multiple input files' + ) + } + + if (i[0] !== 'stdin') i = i.map((i) => path.resolve(i)) + + input = i + + return files(input) + }) + .then((results) => { + if (argv.watch) { + const printMessage = () => + printVerbose(pc.dim('\nWaiting for file changes...')) + const watcher = chokidar.watch(input.concat(dependencies(results)), { + usePolling: argv.poll, + interval: argv.poll && typeof argv.poll === 'number' ? argv.poll : 100, + awaitWriteFinish: { + stabilityThreshold: 50, + pollInterval: 10, + }, + }) + + if (configFile) watcher.add(configFile) + + watcher.on('ready', printMessage).on('change', (file) => { + let recompile = [] + + if (input.includes(file)) recompile.push(file) + + const dependants = depGraph + .dependantsOf(file) + .concat(getAncestorDirs(file).flatMap(depGraph.dependantsOf)) + + recompile = recompile.concat( + dependants.filter((file) => input.includes(file)) + ) + + if (!recompile.length) recompile = input + + return files([...new Set(recompile)]) + .then((results) => watcher.add(dependencies(results))) + .then(printMessage) + .catch(error) + }) + } + }) + .catch((err) => { + error(err) + + process.exit(1) + }) + +function rc(ctx, path) { + if (argv.use) return Promise.resolve(cliConfig) + + return postcssrc(ctx, path) + .then((rc) => { + if (rc.options.from || rc.options.to) { + error( + 'Config Error: Can not set from or to options in config file, use CLI arguments instead' + ) + } + configFile = rc.file + return rc + }) + .catch((err) => { + if (!err.message.includes('No PostCSS Config found')) throw err + }) +} + +function files(files) { + if (typeof files === 'string') files = [files] + + return Promise.all( + files.map((file) => { + if (file === 'stdin') { + return stdin().then((content) => { + if (!content) return error('Input Error: Did not receive any STDIN') + return css(content, 'stdin') + }) + } + + return read(file).then((content) => css(content, file)) + }) + ) +} + +function css(css, file) { + const ctx = { options: cliConfig.options } + + if (file !== 'stdin') { + ctx.file = { + dirname: path.dirname(file), + basename: path.basename(file), + extname: path.extname(file), + } + + if (!argv.config) argv.config = path.dirname(file) + } + + const relativePath = + file !== 'stdin' ? path.relative(path.resolve(), file) : file + + if (!argv.config) argv.config = process.cwd() + + const time = process.hrtime() + + printVerbose(pc.cyan(`Processing ${pc.bold(relativePath)}...`)) + + return rc(ctx, argv.config) + .then((config) => { + config = config || cliConfig + const options = { ...config.options } + + if (file === 'stdin' && output) file = output + + // TODO: Unit test this + options.from = file === 'stdin' ? path.join(process.cwd(), 'stdin') : file + + if (output || dir || argv.replace) { + const base = argv.base + ? file.replace(path.resolve(argv.base), '') + : path.basename(file) + options.to = output || (argv.replace ? file : path.join(dir, base)) + + if (argv.ext) { + options.to = options.to.replace(path.extname(options.to), argv.ext) + } + + options.to = path.resolve(options.to) + } + + if (!options.to && config.options.map && !config.options.map.inline) { + error( + 'Output Error: Cannot output external sourcemaps when writing to STDOUT' + ) + } + + return postcss(config.plugins) + .process(css, options) + .then((result) => { + const tasks = [] + + if (options.to) { + tasks.push(outputFile(options.to, result.css)) + + if (result.map) { + const mapfile = getMapfile(options) + tasks.push(outputFile(mapfile, result.map.toString())) + } + } else process.stdout.write(result.css, 'utf8') + + return Promise.all(tasks).then(() => { + const prettyTime = prettyHrtime(process.hrtime(time)) + printVerbose( + pc.green( + `Finished ${pc.bold(relativePath)} in ${pc.bold(prettyTime)}` + ) + ) + + const messages = result.warnings() + if (messages.length) { + console.warn(reporter({ ...result, messages })) + } + + return result + }) + }) + }) + .catch((err) => { + throw err + }) + + async function outputFile(file, string) { + const fileExists = await fs.pathExists(file) + const currentValue = fileExists ? await fs.readFile(file, 'utf8') : null + if (currentValue === string) return + return fs.outputFile(file, string) + } +} + +function dependencies(results) { + if (!Array.isArray(results)) results = [results] + + const messages = [] + + results.forEach((result) => { + if (result.messages <= 0) return + + result.messages + .filter((msg) => + msg.type === 'dependency' || msg.type === 'dir-dependency' ? msg : '' + ) + .map(depGraph.add) + .forEach((dependency) => { + if (dependency.type === 'dir-dependency') { + messages.push( + dependency.glob + ? path.join(dependency.dir, dependency.glob) + : dependency.dir + ) + } else { + messages.push(dependency.file) + } + }) + }) + + return messages +} + +function printVerbose(message) { + if (argv.verbose) console.warn(message) +} + +function error(err) { + // Seperate error from logging output + if (argv.verbose) console.error() + + if (typeof err === 'string') { + console.error(pc.red(err)) + } else if (err.name === 'CssSyntaxError') { + console.error(err.toString()) + } else { + console.error(err) + } + // Watch mode shouldn't exit on error + if (argv.watch) return + process.exit(1) +} + +// Input: '/imports/components/button.css' +// Output: ['/imports/components', '/imports', '/'] +function getAncestorDirs(fileOrDir) { + const { root } = path.parse(fileOrDir) + if (fileOrDir === root) { + return [] + } + const parentDir = path.dirname(fileOrDir) + return [parentDir, ...getAncestorDirs(parentDir)] +} diff --git a/node_modules/.bin/resolve b/node_modules/.bin/resolve new file mode 100755 index 0000000..21d1a87 --- /dev/null +++ b/node_modules/.bin/resolve @@ -0,0 +1,50 @@ +#!/usr/bin/env node + +'use strict'; + +var path = require('path'); +var fs = require('fs'); + +if ( + String(process.env.npm_lifecycle_script).slice(0, 8) !== 'resolve ' + && ( + !process.argv + || process.argv.length < 2 + || (process.argv[1] !== __filename && fs.statSync(process.argv[1]).ino !== fs.statSync(__filename).ino) + || (process.env.npm_lifecycle_event !== 'npx' && process.env._ && fs.realpathSync(path.resolve(process.env._)) !== __filename) + ) +) { + console.error('Error: `resolve` must be run directly as an executable'); + process.exit(1); +} + +var supportsPreserveSymlinkFlag = require('supports-preserve-symlinks-flag'); + +var preserveSymlinks = false; +for (var i = 2; i < process.argv.length; i += 1) { + if (process.argv[i].slice(0, 2) === '--') { + if (supportsPreserveSymlinkFlag && process.argv[i] === '--preserve-symlinks') { + preserveSymlinks = true; + } else if (process.argv[i].length > 2) { + console.error('Unknown argument ' + process.argv[i].replace(/[=].*$/, '')); + process.exit(2); + } + process.argv.splice(i, 1); + i -= 1; + if (process.argv[i] === '--') { break; } // eslint-disable-line no-restricted-syntax + } +} + +if (process.argv.length < 3) { + console.error('Error: `resolve` expects a specifier'); + process.exit(2); +} + +var resolve = require('../'); + +var result = resolve.sync(process.argv[2], { + basedir: process.cwd(), + preserveSymlinks: preserveSymlinks +}); + +console.log(result); diff --git a/node_modules/.bin/sucrase b/node_modules/.bin/sucrase new file mode 100755 index 0000000..b85b9db --- /dev/null +++ b/node_modules/.bin/sucrase @@ -0,0 +1,3 @@ +#!/usr/bin/env node + +require("../dist/cli").default(); diff --git a/node_modules/.bin/sucrase-node b/node_modules/.bin/sucrase-node new file mode 100755 index 0000000..8dbdcb3 --- /dev/null +++ b/node_modules/.bin/sucrase-node @@ -0,0 +1,18 @@ +#!/usr/bin/env node +const Module = require("module"); +const {resolve} = require("path"); + +/* + * Simple wrapper around node that first registers Sucrase with default settings. + * + * This is meant for simple use cases, and doesn't support custom Node/V8 args, + * executing a code snippet, a REPL, or other things that you might find in + * node, babel-node, or ts-node. For more advanced use cases, you can use + * `node -r sucrase/register` or register a require hook programmatically from + * your own code. + */ +require("../register"); + +process.argv.splice(1, 1); +process.argv[1] = resolve(process.argv[1]); +Module.runMain(); diff --git a/node_modules/.bin/tailwind b/node_modules/.bin/tailwind new file mode 100755 index 0000000..c7043a3 --- /dev/null +++ b/node_modules/.bin/tailwind @@ -0,0 +1,7 @@ +#!/usr/bin/env node +"use strict"; +if (false) { + module.exports = require("./oxide/cli"); +} else { + module.exports = require("./cli/index"); +} diff --git a/node_modules/.bin/tailwindcss b/node_modules/.bin/tailwindcss new file mode 100755 index 0000000..c7043a3 --- /dev/null +++ b/node_modules/.bin/tailwindcss @@ -0,0 +1,7 @@ +#!/usr/bin/env node +"use strict"; +if (false) { + module.exports = require("./oxide/cli"); +} else { + module.exports = require("./cli/index"); +} diff --git a/node_modules/.bin/update-browserslist-db b/node_modules/.bin/update-browserslist-db new file mode 100755 index 0000000..1388e94 --- /dev/null +++ b/node_modules/.bin/update-browserslist-db @@ -0,0 +1,42 @@ +#!/usr/bin/env node + +let { readFileSync } = require('fs') +let { join } = require('path') + +require('./check-npm-version') +let updateDb = require('./') + +const ROOT = __dirname + +function getPackage() { + return JSON.parse(readFileSync(join(ROOT, 'package.json'))) +} + +let args = process.argv.slice(2) + +let USAGE = 'Usage:\n npx update-browserslist-db\n' + +function isArg(arg) { + return args.some(i => i === arg) +} + +function error(msg) { + process.stderr.write('update-browserslist-db: ' + msg + '\n') + process.exit(1) +} + +if (isArg('--help') || isArg('-h')) { + process.stdout.write(getPackage().description + '.\n\n' + USAGE + '\n') +} else if (isArg('--version') || isArg('-v')) { + process.stdout.write('browserslist-lint ' + getPackage().version + '\n') +} else { + try { + updateDb() + } catch (e) { + if (e.name === 'BrowserslistUpdateError') { + error(e.message) + } else { + throw e + } + } +} -- cgit v1.2.3