It appears you have a well-structured Git repository with various files, including SVG icons and HTML documents. Here's a brief overview:
This commit is contained in:
21
backend/node_modules/postcss-cli/LICENSE
generated
vendored
Normal file
21
backend/node_modules/postcss-cli/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
License (MIT)
|
||||
|
||||
Copyright (c) 2016 Michael Ciniawsky
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
151
backend/node_modules/postcss-cli/README.md
generated
vendored
Normal file
151
backend/node_modules/postcss-cli/README.md
generated
vendored
Normal file
@@ -0,0 +1,151 @@
|
||||
[![npm][npm]][npm-url]
|
||||
[![node][node]][node-url]
|
||||
[![tests][tests]][tests-url]
|
||||
[![cover][cover]][cover-url]
|
||||
[![chat][chat]][chat-url]
|
||||
|
||||
<div align="center">
|
||||
<img width="100" height="100" title="CLI" src="https://raw.githubusercontent.com/postcss/postcss-cli/HEAD/logo.svg">
|
||||
<a href="https://github.com/postcss/postcss">
|
||||
<img width="110" height="110" title="PostCSS" src="http://postcss.github.io/postcss/logo.svg" hspace="10">
|
||||
</a>
|
||||
<h1>PostCSS CLI</h1>
|
||||
</div>
|
||||
|
||||
PostCSS CLI is a command line interface for [PostCSS](https://postcss.org/)
|
||||
|
||||
<h2 align="center">Install</h2>
|
||||
|
||||
```bash
|
||||
npm i -D postcss postcss-cli
|
||||
```
|
||||
|
||||
<h2 align="center">Usage</h2>
|
||||
|
||||
```
|
||||
Usage:
|
||||
postcss [input.css] [OPTIONS] [-o|--output output.css] [--watch|-w]
|
||||
postcss <input.css>... [OPTIONS] --dir <output-directory> [--watch|-w]
|
||||
postcss <input-directory> [OPTIONS] --dir <output-directory> [--watch|-w]
|
||||
postcss <input-glob-pattern> [OPTIONS] --dir <output-directory> [--watch|-w]
|
||||
postcss <input.css>... [OPTIONS] --replace
|
||||
|
||||
Basic options:
|
||||
-o, --output Output file [string]
|
||||
-d, --dir Output directory [string]
|
||||
-r, --replace Replace (overwrite) the input file [boolean]
|
||||
-m, --map Create an external sourcemap
|
||||
--no-map Disable the default inline sourcemaps
|
||||
-w, --watch Watch files for changes and recompile as needed [boolean]
|
||||
--verbose Be verbose [boolean]
|
||||
--env A shortcut for setting NODE_ENV [string]
|
||||
|
||||
Options for use without a config file:
|
||||
-u, --use List of postcss plugins to use [array]
|
||||
--parser Custom postcss parser [string]
|
||||
--stringifier Custom postcss stringifier [string]
|
||||
--syntax Custom postcss syntax [string]
|
||||
|
||||
Options for use with --dir:
|
||||
--ext Override the output file extension; for use with --dir [string]
|
||||
--base Mirror the directory structure relative to this path in the output
|
||||
directory, for use with --dir [string]
|
||||
|
||||
Advanced options:
|
||||
--include-dotfiles Enable glob to match files/dirs that begin with "."
|
||||
[boolean]
|
||||
--poll Use polling for file watching. Can optionally pass polling
|
||||
interval; default 100 ms
|
||||
--config Set a custom directory to look for a config file [string]
|
||||
|
||||
Options:
|
||||
--version Show version number [boolean]
|
||||
-h, --help Show help [boolean]
|
||||
|
||||
Examples:
|
||||
postcss input.css -o output.css Basic usage
|
||||
postcss src/**/*.css --base src --dir build Glob Pattern & output
|
||||
cat input.css | postcss -u autoprefixer > output.css Piping input & output
|
||||
|
||||
If no input files are passed, it reads from stdin. If neither -o, --dir, or
|
||||
--replace is passed, it writes to stdout.
|
||||
|
||||
If there are multiple input files, the --dir or --replace option must be passed.
|
||||
|
||||
Input files may contain globs (e.g. src/**/*.css). If you pass an input
|
||||
directory, it will process all files in the directory and any subdirectories,
|
||||
respecting the glob pattern.
|
||||
```
|
||||
|
||||
> ℹ️ More details on custom parsers, stringifiers and syntaxes, can be found [here](https://github.com/postcss/postcss#syntaxes).
|
||||
|
||||
### [Config](https://github.com/michael-ciniawsky/postcss-load-config)
|
||||
|
||||
If you need to pass options to your plugins, or have a long plugin chain, you'll want to use a configuration file.
|
||||
|
||||
**postcss.config.js**
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
parser: 'sugarss',
|
||||
plugins: [
|
||||
require('postcss-import')({ ...options }),
|
||||
require('postcss-url')({ url: 'copy', useHash: true }),
|
||||
],
|
||||
}
|
||||
```
|
||||
|
||||
Note that you **can not** set the `from` or `to` options for postcss in the config file. They are set automatically based on the CLI arguments.
|
||||
|
||||
### Context
|
||||
|
||||
For more advanced usage, it's recommended to use a function in `postcss.config.js`; this gives you access to the CLI context to dynamically apply options and plugins **per file**
|
||||
|
||||
| Name | Type | Default | Description |
|
||||
| :-------: | :--------: | :--------------------------------: | :------------------- |
|
||||
| `env` | `{String}` | `'development'` | process.env.NODE_ENV |
|
||||
| `file` | `{Object}` | `dirname, basename, extname` | File |
|
||||
| `options` | `{Object}` | `map, parser, syntax, stringifier` | PostCSS Options |
|
||||
|
||||
**postcss.config.js**
|
||||
|
||||
```js
|
||||
module.exports = (ctx) => ({
|
||||
map: ctx.options.map,
|
||||
parser: ctx.file.extname === '.sss' ? 'sugarss' : false,
|
||||
plugins: {
|
||||
'postcss-import': { root: ctx.file.dirname },
|
||||
cssnano: ctx.env === 'production' ? {} : false,
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
> ⚠️ If you want to set options via CLI, it's mandatory to reference `ctx.options` in `postcss.config.js`
|
||||
|
||||
```bash
|
||||
postcss input.sss -p sugarss -o output.css -m
|
||||
```
|
||||
|
||||
**postcss.config.js**
|
||||
|
||||
```js
|
||||
module.exports = (ctx) => ({
|
||||
map: ctx.options.map,
|
||||
parser: ctx.options.parser,
|
||||
plugins: {
|
||||
'postcss-import': { root: ctx.file.dirname },
|
||||
cssnano: ctx.env === 'production' ? {} : false,
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
[npm]: https://img.shields.io/npm/v/postcss-cli.svg
|
||||
[npm-url]: https://npmjs.com/package/postcss-cli
|
||||
[node]: https://img.shields.io/node/v/postcss-cli.svg
|
||||
[node-url]: https://nodejs.org/
|
||||
[tests]: https://img.shields.io/github/workflow/status/postcss/postcss-cli/Node.js%20CI/master
|
||||
[tests-url]: https://github.com/postcss/postcss-cli/actions?query=branch%3Amaster
|
||||
[cover]: https://img.shields.io/coveralls/postcss/postcss-cli/master.svg
|
||||
[cover-url]: https://coveralls.io/github/postcss/postcss-cli
|
||||
[chat]: https://img.shields.io/gitter/room/postcss/postcss.svg
|
||||
[chat-url]: https://gitter.im/postcss/postcss
|
354
backend/node_modules/postcss-cli/index.js
generated
vendored
Normal file
354
backend/node_modules/postcss-cli/index.js
generated
vendored
Normal file
@@ -0,0 +1,354 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import fs from 'fs-extra'
|
||||
import path from 'path'
|
||||
|
||||
import prettyHrtime from 'pretty-hrtime'
|
||||
import { text } from 'stream/consumers'
|
||||
import read from 'read-cache'
|
||||
import pc from 'picocolors'
|
||||
import { glob } from 'tinyglobby'
|
||||
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 glob(
|
||||
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 text(process.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)]
|
||||
}
|
30
backend/node_modules/postcss-cli/lib/DependencyGraph.js
generated
vendored
Normal file
30
backend/node_modules/postcss-cli/lib/DependencyGraph.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
import path from 'path'
|
||||
import { DepGraph } from 'dependency-graph'
|
||||
|
||||
export default function createDependencyGraph() {
|
||||
const graph = new DepGraph()
|
||||
return {
|
||||
add(message) {
|
||||
message.parent = path.resolve(message.parent)
|
||||
graph.addNode(message.parent)
|
||||
|
||||
if (message.type === 'dir-dependency') {
|
||||
message.dir = path.resolve(message.dir)
|
||||
graph.addNode(message.dir)
|
||||
graph.addDependency(message.parent, message.dir)
|
||||
} else {
|
||||
message.file = path.resolve(message.file)
|
||||
graph.addNode(message.file)
|
||||
graph.addDependency(message.parent, message.file)
|
||||
}
|
||||
|
||||
return message
|
||||
},
|
||||
dependantsOf(node) {
|
||||
node = path.resolve(node)
|
||||
|
||||
if (graph.hasNode(node)) return graph.dependantsOf(node)
|
||||
return []
|
||||
},
|
||||
}
|
||||
}
|
115
backend/node_modules/postcss-cli/lib/args.js
generated
vendored
Normal file
115
backend/node_modules/postcss-cli/lib/args.js
generated
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
import yargs from 'yargs'
|
||||
|
||||
const { argv } = yargs(process.argv.slice(2))
|
||||
.usage(
|
||||
`Usage:
|
||||
$0 [input.css] [OPTIONS] [-o|--output output.css] [--watch|-w]
|
||||
$0 <input.css>... [OPTIONS] --dir <output-directory> [--watch|-w]
|
||||
$0 <input-directory> [OPTIONS] --dir <output-directory> [--watch|-w]
|
||||
$0 <input-glob-pattern> [OPTIONS] --dir <output-directory> [--watch|-w]
|
||||
$0 <input.css>... [OPTIONS] --replace`,
|
||||
)
|
||||
.group(
|
||||
['o', 'd', 'r', 'map', 'no-map', 'watch', 'verbose', 'env'],
|
||||
'Basic options:',
|
||||
)
|
||||
.option('o', {
|
||||
alias: 'output',
|
||||
desc: 'Output file',
|
||||
type: 'string',
|
||||
conflicts: ['dir', 'replace'],
|
||||
})
|
||||
.option('d', {
|
||||
alias: 'dir',
|
||||
desc: 'Output directory',
|
||||
type: 'string',
|
||||
conflicts: ['output', 'replace'],
|
||||
})
|
||||
.option('r', {
|
||||
alias: 'replace',
|
||||
desc: 'Replace (overwrite) the input file',
|
||||
type: 'boolean',
|
||||
conflicts: ['output', 'dir'],
|
||||
})
|
||||
.alias('m', 'map')
|
||||
.describe('map', 'Create an external sourcemap')
|
||||
.describe('no-map', 'Disable the default inline sourcemaps')
|
||||
.option('w', {
|
||||
alias: 'watch',
|
||||
desc: 'Watch files for changes and recompile as needed',
|
||||
type: 'boolean',
|
||||
conflicts: 'replace',
|
||||
})
|
||||
.option('verbose', {
|
||||
desc: 'Be verbose',
|
||||
type: 'boolean',
|
||||
})
|
||||
.option('env', {
|
||||
desc: 'A shortcut for setting NODE_ENV',
|
||||
type: 'string',
|
||||
})
|
||||
.group(
|
||||
['u', 'parser', 'stringifier', 'syntax'],
|
||||
'Options for use without a config file:',
|
||||
)
|
||||
.option('u', {
|
||||
alias: 'use',
|
||||
desc: 'List of postcss plugins to use',
|
||||
type: 'array',
|
||||
})
|
||||
.option('parser', {
|
||||
desc: 'Custom postcss parser',
|
||||
type: 'string',
|
||||
})
|
||||
.option('stringifier', {
|
||||
desc: 'Custom postcss stringifier',
|
||||
type: 'string',
|
||||
})
|
||||
.option('syntax', {
|
||||
desc: 'Custom postcss syntax',
|
||||
type: 'string',
|
||||
})
|
||||
.group(['ext', 'base'], 'Options for use with --dir:')
|
||||
.option('ext', {
|
||||
desc: 'Override the output file extension; for use with --dir',
|
||||
type: 'string',
|
||||
implies: 'dir',
|
||||
})
|
||||
.option('base', {
|
||||
desc: 'Mirror the directory structure relative to this path in the output directory, for use with --dir',
|
||||
type: 'string',
|
||||
implies: 'dir',
|
||||
})
|
||||
.group(['include-dotfiles', 'poll', 'config'], 'Advanced options:')
|
||||
.option('include-dotfiles', {
|
||||
desc: 'Enable glob to match files/dirs that begin with "."',
|
||||
type: 'boolean',
|
||||
})
|
||||
.option('poll', {
|
||||
desc: 'Use polling for file watching. Can optionally pass polling interval; default 100 ms',
|
||||
implies: 'watch',
|
||||
})
|
||||
.option('config', {
|
||||
desc: 'Set a custom directory to look for a config file',
|
||||
type: 'string',
|
||||
})
|
||||
.alias('h', 'help')
|
||||
.example('$0 input.css -o output.css', 'Basic usage')
|
||||
.example('$0 src/**/*.css --base src --dir build', 'Glob Pattern & output')
|
||||
.example(
|
||||
'cat input.css | $0 -u autoprefixer > output.css',
|
||||
'Piping input & output',
|
||||
)
|
||||
.epilog(
|
||||
`If no input files are passed, it reads from stdin. If neither -o, --dir, or --replace is passed, it writes to stdout.
|
||||
|
||||
If there are multiple input files, the --dir or --replace option must be passed.
|
||||
|
||||
Input files may contain globs (e.g. src/**/*.css). If you pass an input directory, it will process all files in the directory and any subdirectories, respecting the glob pattern.
|
||||
|
||||
For more details, please see https://github.com/postcss/postcss-cli`,
|
||||
)
|
||||
|
||||
if (argv.ext && argv.ext.indexOf('.') !== 0) argv.ext = `.${argv.ext}`
|
||||
|
||||
export default argv
|
7
backend/node_modules/postcss-cli/lib/getMapfile.js
generated
vendored
Normal file
7
backend/node_modules/postcss-cli/lib/getMapfile.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import path from 'path'
|
||||
export default function getMapfile(options) {
|
||||
if (options.map && typeof options.map.annotation === 'string') {
|
||||
return `${path.dirname(options.to)}/${options.map.annotation}`
|
||||
}
|
||||
return `${options.to}.map`
|
||||
}
|
37
backend/node_modules/postcss-cli/node_modules/ansi-regex/index.d.ts
generated
vendored
Normal file
37
backend/node_modules/postcss-cli/node_modules/ansi-regex/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
declare namespace ansiRegex {
|
||||
interface Options {
|
||||
/**
|
||||
Match only the first ANSI escape.
|
||||
|
||||
@default false
|
||||
*/
|
||||
onlyFirst: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Regular expression for matching ANSI escape codes.
|
||||
|
||||
@example
|
||||
```
|
||||
import ansiRegex = require('ansi-regex');
|
||||
|
||||
ansiRegex().test('\u001B[4mcake\u001B[0m');
|
||||
//=> true
|
||||
|
||||
ansiRegex().test('cake');
|
||||
//=> false
|
||||
|
||||
'\u001B[4mcake\u001B[0m'.match(ansiRegex());
|
||||
//=> ['\u001B[4m', '\u001B[0m']
|
||||
|
||||
'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true}));
|
||||
//=> ['\u001B[4m']
|
||||
|
||||
'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex());
|
||||
//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007']
|
||||
```
|
||||
*/
|
||||
declare function ansiRegex(options?: ansiRegex.Options): RegExp;
|
||||
|
||||
export = ansiRegex;
|
10
backend/node_modules/postcss-cli/node_modules/ansi-regex/index.js
generated
vendored
Normal file
10
backend/node_modules/postcss-cli/node_modules/ansi-regex/index.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = ({onlyFirst = false} = {}) => {
|
||||
const pattern = [
|
||||
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
|
||||
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'
|
||||
].join('|');
|
||||
|
||||
return new RegExp(pattern, onlyFirst ? undefined : 'g');
|
||||
};
|
9
backend/node_modules/postcss-cli/node_modules/ansi-regex/license
generated
vendored
Normal file
9
backend/node_modules/postcss-cli/node_modules/ansi-regex/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
55
backend/node_modules/postcss-cli/node_modules/ansi-regex/package.json
generated
vendored
Normal file
55
backend/node_modules/postcss-cli/node_modules/ansi-regex/package.json
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"name": "ansi-regex",
|
||||
"version": "5.0.1",
|
||||
"description": "Regular expression for matching ANSI escape codes",
|
||||
"license": "MIT",
|
||||
"repository": "chalk/ansi-regex",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd",
|
||||
"view-supported": "node fixtures/view-codes.js"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"ansi",
|
||||
"styles",
|
||||
"color",
|
||||
"colour",
|
||||
"colors",
|
||||
"terminal",
|
||||
"console",
|
||||
"cli",
|
||||
"string",
|
||||
"tty",
|
||||
"escape",
|
||||
"formatting",
|
||||
"rgb",
|
||||
"256",
|
||||
"shell",
|
||||
"xterm",
|
||||
"command-line",
|
||||
"text",
|
||||
"regex",
|
||||
"regexp",
|
||||
"re",
|
||||
"match",
|
||||
"test",
|
||||
"find",
|
||||
"pattern"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "^2.4.0",
|
||||
"tsd": "^0.9.0",
|
||||
"xo": "^0.25.3"
|
||||
}
|
||||
}
|
78
backend/node_modules/postcss-cli/node_modules/ansi-regex/readme.md
generated
vendored
Normal file
78
backend/node_modules/postcss-cli/node_modules/ansi-regex/readme.md
generated
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
# ansi-regex
|
||||
|
||||
> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install ansi-regex
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const ansiRegex = require('ansi-regex');
|
||||
|
||||
ansiRegex().test('\u001B[4mcake\u001B[0m');
|
||||
//=> true
|
||||
|
||||
ansiRegex().test('cake');
|
||||
//=> false
|
||||
|
||||
'\u001B[4mcake\u001B[0m'.match(ansiRegex());
|
||||
//=> ['\u001B[4m', '\u001B[0m']
|
||||
|
||||
'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true}));
|
||||
//=> ['\u001B[4m']
|
||||
|
||||
'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex());
|
||||
//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007']
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### ansiRegex(options?)
|
||||
|
||||
Returns a regex for matching ANSI escape codes.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
##### onlyFirst
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `false` *(Matches any ANSI escape codes in a string)*
|
||||
|
||||
Match only the first ANSI escape.
|
||||
|
||||
|
||||
## FAQ
|
||||
|
||||
### Why do you test for codes not in the ECMA 48 standard?
|
||||
|
||||
Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them.
|
||||
|
||||
On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out.
|
||||
|
||||
|
||||
## Maintainers
|
||||
|
||||
- [Sindre Sorhus](https://github.com/sindresorhus)
|
||||
- [Josh Junon](https://github.com/qix-)
|
||||
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-ansi-regex?utm_source=npm-ansi-regex&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
139
backend/node_modules/postcss-cli/node_modules/cliui/CHANGELOG.md
generated
vendored
Normal file
139
backend/node_modules/postcss-cli/node_modules/cliui/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
# Change Log
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
## [8.0.1](https://github.com/yargs/cliui/compare/v8.0.0...v8.0.1) (2022-10-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deps:** move rollup-plugin-ts to dev deps ([#124](https://github.com/yargs/cliui/issues/124)) ([7c8bd6b](https://github.com/yargs/cliui/commit/7c8bd6ba024d61e4eeae310c7959ab8ab6829081))
|
||||
|
||||
## [8.0.0](https://github.com/yargs/cliui/compare/v7.0.4...v8.0.0) (2022-09-30)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* **deps:** drop Node 10 to release CVE-2021-3807 patch (#122)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deps:** drop Node 10 to release CVE-2021-3807 patch ([#122](https://github.com/yargs/cliui/issues/122)) ([f156571](https://github.com/yargs/cliui/commit/f156571ce4f2ebf313335e3a53ad905589da5a30))
|
||||
|
||||
### [7.0.4](https://www.github.com/yargs/cliui/compare/v7.0.3...v7.0.4) (2020-11-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deno:** import UIOptions from definitions ([#97](https://www.github.com/yargs/cliui/issues/97)) ([f04f343](https://www.github.com/yargs/cliui/commit/f04f3439bc78114c7e90f82ff56f5acf16268ea8))
|
||||
|
||||
### [7.0.3](https://www.github.com/yargs/cliui/compare/v7.0.2...v7.0.3) (2020-10-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **exports:** node 13.0 and 13.1 require the dotted object form _with_ a string fallback ([#93](https://www.github.com/yargs/cliui/issues/93)) ([eca16fc](https://www.github.com/yargs/cliui/commit/eca16fc05d26255df3280906c36d7f0e5b05c6e9))
|
||||
|
||||
### [7.0.2](https://www.github.com/yargs/cliui/compare/v7.0.1...v7.0.2) (2020-10-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **exports:** node 13.0-13.6 require a string fallback ([#91](https://www.github.com/yargs/cliui/issues/91)) ([b529d7e](https://www.github.com/yargs/cliui/commit/b529d7e432901af1af7848b23ed6cf634497d961))
|
||||
|
||||
### [7.0.1](https://www.github.com/yargs/cliui/compare/v7.0.0...v7.0.1) (2020-08-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **build:** main should be build/index.cjs ([dc29a3c](https://www.github.com/yargs/cliui/commit/dc29a3cc617a410aa850e06337b5954b04f2cb4d))
|
||||
|
||||
## [7.0.0](https://www.github.com/yargs/cliui/compare/v6.0.0...v7.0.0) (2020-08-16)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* tsc/ESM/Deno support (#82)
|
||||
* modernize deps and build (#80)
|
||||
|
||||
### Build System
|
||||
|
||||
* modernize deps and build ([#80](https://www.github.com/yargs/cliui/issues/80)) ([339d08d](https://www.github.com/yargs/cliui/commit/339d08dc71b15a3928aeab09042af94db2f43743))
|
||||
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
* tsc/ESM/Deno support ([#82](https://www.github.com/yargs/cliui/issues/82)) ([4b777a5](https://www.github.com/yargs/cliui/commit/4b777a5fe01c5d8958c6708695d6aab7dbe5706c))
|
||||
|
||||
## [6.0.0](https://www.github.com/yargs/cliui/compare/v5.0.0...v6.0.0) (2019-11-10)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* update deps, drop Node 6
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
* update deps, drop Node 6 ([62056df](https://www.github.com/yargs/cliui/commit/62056df))
|
||||
|
||||
## [5.0.0](https://github.com/yargs/cliui/compare/v4.1.0...v5.0.0) (2019-04-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Update wrap-ansi to fix compatibility with latest versions of chalk. ([#60](https://github.com/yargs/cliui/issues/60)) ([7bf79ae](https://github.com/yargs/cliui/commit/7bf79ae))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* Drop support for node < 6.
|
||||
|
||||
|
||||
|
||||
<a name="4.1.0"></a>
|
||||
## [4.1.0](https://github.com/yargs/cliui/compare/v4.0.0...v4.1.0) (2018-04-23)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add resetOutput method ([#57](https://github.com/yargs/cliui/issues/57)) ([7246902](https://github.com/yargs/cliui/commit/7246902))
|
||||
|
||||
|
||||
|
||||
<a name="4.0.0"></a>
|
||||
## [4.0.0](https://github.com/yargs/cliui/compare/v3.2.0...v4.0.0) (2017-12-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* downgrades strip-ansi to version 3.0.1 ([#54](https://github.com/yargs/cliui/issues/54)) ([5764c46](https://github.com/yargs/cliui/commit/5764c46))
|
||||
* set env variable FORCE_COLOR. ([#56](https://github.com/yargs/cliui/issues/56)) ([7350e36](https://github.com/yargs/cliui/commit/7350e36))
|
||||
|
||||
|
||||
### Chores
|
||||
|
||||
* drop support for node < 4 ([#53](https://github.com/yargs/cliui/issues/53)) ([b105376](https://github.com/yargs/cliui/commit/b105376))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add fallback for window width ([#45](https://github.com/yargs/cliui/issues/45)) ([d064922](https://github.com/yargs/cliui/commit/d064922))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* officially drop support for Node < 4
|
||||
|
||||
|
||||
|
||||
<a name="3.2.0"></a>
|
||||
## [3.2.0](https://github.com/yargs/cliui/compare/v3.1.2...v3.2.0) (2016-04-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* reduces tarball size ([acc6c33](https://github.com/yargs/cliui/commit/acc6c33))
|
||||
|
||||
### Features
|
||||
|
||||
* adds standard-version for release management ([ff84e32](https://github.com/yargs/cliui/commit/ff84e32))
|
14
backend/node_modules/postcss-cli/node_modules/cliui/LICENSE.txt
generated
vendored
Normal file
14
backend/node_modules/postcss-cli/node_modules/cliui/LICENSE.txt
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
Copyright (c) 2015, Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software
|
||||
for any purpose with or without fee is hereby granted, provided
|
||||
that the above copyright notice and this permission notice
|
||||
appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
|
||||
LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
|
||||
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
141
backend/node_modules/postcss-cli/node_modules/cliui/README.md
generated
vendored
Normal file
141
backend/node_modules/postcss-cli/node_modules/cliui/README.md
generated
vendored
Normal file
@@ -0,0 +1,141 @@
|
||||
# cliui
|
||||
|
||||

|
||||
[](https://www.npmjs.com/package/cliui)
|
||||
[](https://conventionalcommits.org)
|
||||

|
||||
|
||||
easily create complex multi-column command-line-interfaces.
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
const ui = require('cliui')()
|
||||
|
||||
ui.div('Usage: $0 [command] [options]')
|
||||
|
||||
ui.div({
|
||||
text: 'Options:',
|
||||
padding: [2, 0, 1, 0]
|
||||
})
|
||||
|
||||
ui.div(
|
||||
{
|
||||
text: "-f, --file",
|
||||
width: 20,
|
||||
padding: [0, 4, 0, 4]
|
||||
},
|
||||
{
|
||||
text: "the file to load." +
|
||||
chalk.green("(if this description is long it wraps).")
|
||||
,
|
||||
width: 20
|
||||
},
|
||||
{
|
||||
text: chalk.red("[required]"),
|
||||
align: 'right'
|
||||
}
|
||||
)
|
||||
|
||||
console.log(ui.toString())
|
||||
```
|
||||
|
||||
## Deno/ESM Support
|
||||
|
||||
As of `v7` `cliui` supports [Deno](https://github.com/denoland/deno) and
|
||||
[ESM](https://nodejs.org/api/esm.html#esm_ecmascript_modules):
|
||||
|
||||
```typescript
|
||||
import cliui from "https://deno.land/x/cliui/deno.ts";
|
||||
|
||||
const ui = cliui({})
|
||||
|
||||
ui.div('Usage: $0 [command] [options]')
|
||||
|
||||
ui.div({
|
||||
text: 'Options:',
|
||||
padding: [2, 0, 1, 0]
|
||||
})
|
||||
|
||||
ui.div({
|
||||
text: "-f, --file",
|
||||
width: 20,
|
||||
padding: [0, 4, 0, 4]
|
||||
})
|
||||
|
||||
console.log(ui.toString())
|
||||
```
|
||||
|
||||
<img width="500" src="screenshot.png">
|
||||
|
||||
## Layout DSL
|
||||
|
||||
cliui exposes a simple layout DSL:
|
||||
|
||||
If you create a single `ui.div`, passing a string rather than an
|
||||
object:
|
||||
|
||||
* `\n`: characters will be interpreted as new rows.
|
||||
* `\t`: characters will be interpreted as new columns.
|
||||
* `\s`: characters will be interpreted as padding.
|
||||
|
||||
**as an example...**
|
||||
|
||||
```js
|
||||
var ui = require('./')({
|
||||
width: 60
|
||||
})
|
||||
|
||||
ui.div(
|
||||
'Usage: node ./bin/foo.js\n' +
|
||||
' <regex>\t provide a regex\n' +
|
||||
' <glob>\t provide a glob\t [required]'
|
||||
)
|
||||
|
||||
console.log(ui.toString())
|
||||
```
|
||||
|
||||
**will output:**
|
||||
|
||||
```shell
|
||||
Usage: node ./bin/foo.js
|
||||
<regex> provide a regex
|
||||
<glob> provide a glob [required]
|
||||
```
|
||||
|
||||
## Methods
|
||||
|
||||
```js
|
||||
cliui = require('cliui')
|
||||
```
|
||||
|
||||
### cliui({width: integer})
|
||||
|
||||
Specify the maximum width of the UI being generated.
|
||||
If no width is provided, cliui will try to get the current window's width and use it, and if that doesn't work, width will be set to `80`.
|
||||
|
||||
### cliui({wrap: boolean})
|
||||
|
||||
Enable or disable the wrapping of text in a column.
|
||||
|
||||
### cliui.div(column, column, column)
|
||||
|
||||
Create a row with any number of columns, a column
|
||||
can either be a string, or an object with the following
|
||||
options:
|
||||
|
||||
* **text:** some text to place in the column.
|
||||
* **width:** the width of a column.
|
||||
* **align:** alignment, `right` or `center`.
|
||||
* **padding:** `[top, right, bottom, left]`.
|
||||
* **border:** should a border be placed around the div?
|
||||
|
||||
### cliui.span(column, column, column)
|
||||
|
||||
Similar to `div`, except the next row will be appended without
|
||||
a new line being created.
|
||||
|
||||
### cliui.resetOutput()
|
||||
|
||||
Resets the UI elements of the current cliui instance, maintaining the values
|
||||
set for `width` and `wrap`.
|
302
backend/node_modules/postcss-cli/node_modules/cliui/build/index.cjs
generated
vendored
Normal file
302
backend/node_modules/postcss-cli/node_modules/cliui/build/index.cjs
generated
vendored
Normal file
@@ -0,0 +1,302 @@
|
||||
'use strict';
|
||||
|
||||
const align = {
|
||||
right: alignRight,
|
||||
center: alignCenter
|
||||
};
|
||||
const top = 0;
|
||||
const right = 1;
|
||||
const bottom = 2;
|
||||
const left = 3;
|
||||
class UI {
|
||||
constructor(opts) {
|
||||
var _a;
|
||||
this.width = opts.width;
|
||||
this.wrap = (_a = opts.wrap) !== null && _a !== void 0 ? _a : true;
|
||||
this.rows = [];
|
||||
}
|
||||
span(...args) {
|
||||
const cols = this.div(...args);
|
||||
cols.span = true;
|
||||
}
|
||||
resetOutput() {
|
||||
this.rows = [];
|
||||
}
|
||||
div(...args) {
|
||||
if (args.length === 0) {
|
||||
this.div('');
|
||||
}
|
||||
if (this.wrap && this.shouldApplyLayoutDSL(...args) && typeof args[0] === 'string') {
|
||||
return this.applyLayoutDSL(args[0]);
|
||||
}
|
||||
const cols = args.map(arg => {
|
||||
if (typeof arg === 'string') {
|
||||
return this.colFromString(arg);
|
||||
}
|
||||
return arg;
|
||||
});
|
||||
this.rows.push(cols);
|
||||
return cols;
|
||||
}
|
||||
shouldApplyLayoutDSL(...args) {
|
||||
return args.length === 1 && typeof args[0] === 'string' &&
|
||||
/[\t\n]/.test(args[0]);
|
||||
}
|
||||
applyLayoutDSL(str) {
|
||||
const rows = str.split('\n').map(row => row.split('\t'));
|
||||
let leftColumnWidth = 0;
|
||||
// simple heuristic for layout, make sure the
|
||||
// second column lines up along the left-hand.
|
||||
// don't allow the first column to take up more
|
||||
// than 50% of the screen.
|
||||
rows.forEach(columns => {
|
||||
if (columns.length > 1 && mixin.stringWidth(columns[0]) > leftColumnWidth) {
|
||||
leftColumnWidth = Math.min(Math.floor(this.width * 0.5), mixin.stringWidth(columns[0]));
|
||||
}
|
||||
});
|
||||
// generate a table:
|
||||
// replacing ' ' with padding calculations.
|
||||
// using the algorithmically generated width.
|
||||
rows.forEach(columns => {
|
||||
this.div(...columns.map((r, i) => {
|
||||
return {
|
||||
text: r.trim(),
|
||||
padding: this.measurePadding(r),
|
||||
width: (i === 0 && columns.length > 1) ? leftColumnWidth : undefined
|
||||
};
|
||||
}));
|
||||
});
|
||||
return this.rows[this.rows.length - 1];
|
||||
}
|
||||
colFromString(text) {
|
||||
return {
|
||||
text,
|
||||
padding: this.measurePadding(text)
|
||||
};
|
||||
}
|
||||
measurePadding(str) {
|
||||
// measure padding without ansi escape codes
|
||||
const noAnsi = mixin.stripAnsi(str);
|
||||
return [0, noAnsi.match(/\s*$/)[0].length, 0, noAnsi.match(/^\s*/)[0].length];
|
||||
}
|
||||
toString() {
|
||||
const lines = [];
|
||||
this.rows.forEach(row => {
|
||||
this.rowToString(row, lines);
|
||||
});
|
||||
// don't display any lines with the
|
||||
// hidden flag set.
|
||||
return lines
|
||||
.filter(line => !line.hidden)
|
||||
.map(line => line.text)
|
||||
.join('\n');
|
||||
}
|
||||
rowToString(row, lines) {
|
||||
this.rasterize(row).forEach((rrow, r) => {
|
||||
let str = '';
|
||||
rrow.forEach((col, c) => {
|
||||
const { width } = row[c]; // the width with padding.
|
||||
const wrapWidth = this.negatePadding(row[c]); // the width without padding.
|
||||
let ts = col; // temporary string used during alignment/padding.
|
||||
if (wrapWidth > mixin.stringWidth(col)) {
|
||||
ts += ' '.repeat(wrapWidth - mixin.stringWidth(col));
|
||||
}
|
||||
// align the string within its column.
|
||||
if (row[c].align && row[c].align !== 'left' && this.wrap) {
|
||||
const fn = align[row[c].align];
|
||||
ts = fn(ts, wrapWidth);
|
||||
if (mixin.stringWidth(ts) < wrapWidth) {
|
||||
ts += ' '.repeat((width || 0) - mixin.stringWidth(ts) - 1);
|
||||
}
|
||||
}
|
||||
// apply border and padding to string.
|
||||
const padding = row[c].padding || [0, 0, 0, 0];
|
||||
if (padding[left]) {
|
||||
str += ' '.repeat(padding[left]);
|
||||
}
|
||||
str += addBorder(row[c], ts, '| ');
|
||||
str += ts;
|
||||
str += addBorder(row[c], ts, ' |');
|
||||
if (padding[right]) {
|
||||
str += ' '.repeat(padding[right]);
|
||||
}
|
||||
// if prior row is span, try to render the
|
||||
// current row on the prior line.
|
||||
if (r === 0 && lines.length > 0) {
|
||||
str = this.renderInline(str, lines[lines.length - 1]);
|
||||
}
|
||||
});
|
||||
// remove trailing whitespace.
|
||||
lines.push({
|
||||
text: str.replace(/ +$/, ''),
|
||||
span: row.span
|
||||
});
|
||||
});
|
||||
return lines;
|
||||
}
|
||||
// if the full 'source' can render in
|
||||
// the target line, do so.
|
||||
renderInline(source, previousLine) {
|
||||
const match = source.match(/^ */);
|
||||
const leadingWhitespace = match ? match[0].length : 0;
|
||||
const target = previousLine.text;
|
||||
const targetTextWidth = mixin.stringWidth(target.trimRight());
|
||||
if (!previousLine.span) {
|
||||
return source;
|
||||
}
|
||||
// if we're not applying wrapping logic,
|
||||
// just always append to the span.
|
||||
if (!this.wrap) {
|
||||
previousLine.hidden = true;
|
||||
return target + source;
|
||||
}
|
||||
if (leadingWhitespace < targetTextWidth) {
|
||||
return source;
|
||||
}
|
||||
previousLine.hidden = true;
|
||||
return target.trimRight() + ' '.repeat(leadingWhitespace - targetTextWidth) + source.trimLeft();
|
||||
}
|
||||
rasterize(row) {
|
||||
const rrows = [];
|
||||
const widths = this.columnWidths(row);
|
||||
let wrapped;
|
||||
// word wrap all columns, and create
|
||||
// a data-structure that is easy to rasterize.
|
||||
row.forEach((col, c) => {
|
||||
// leave room for left and right padding.
|
||||
col.width = widths[c];
|
||||
if (this.wrap) {
|
||||
wrapped = mixin.wrap(col.text, this.negatePadding(col), { hard: true }).split('\n');
|
||||
}
|
||||
else {
|
||||
wrapped = col.text.split('\n');
|
||||
}
|
||||
if (col.border) {
|
||||
wrapped.unshift('.' + '-'.repeat(this.negatePadding(col) + 2) + '.');
|
||||
wrapped.push("'" + '-'.repeat(this.negatePadding(col) + 2) + "'");
|
||||
}
|
||||
// add top and bottom padding.
|
||||
if (col.padding) {
|
||||
wrapped.unshift(...new Array(col.padding[top] || 0).fill(''));
|
||||
wrapped.push(...new Array(col.padding[bottom] || 0).fill(''));
|
||||
}
|
||||
wrapped.forEach((str, r) => {
|
||||
if (!rrows[r]) {
|
||||
rrows.push([]);
|
||||
}
|
||||
const rrow = rrows[r];
|
||||
for (let i = 0; i < c; i++) {
|
||||
if (rrow[i] === undefined) {
|
||||
rrow.push('');
|
||||
}
|
||||
}
|
||||
rrow.push(str);
|
||||
});
|
||||
});
|
||||
return rrows;
|
||||
}
|
||||
negatePadding(col) {
|
||||
let wrapWidth = col.width || 0;
|
||||
if (col.padding) {
|
||||
wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0);
|
||||
}
|
||||
if (col.border) {
|
||||
wrapWidth -= 4;
|
||||
}
|
||||
return wrapWidth;
|
||||
}
|
||||
columnWidths(row) {
|
||||
if (!this.wrap) {
|
||||
return row.map(col => {
|
||||
return col.width || mixin.stringWidth(col.text);
|
||||
});
|
||||
}
|
||||
let unset = row.length;
|
||||
let remainingWidth = this.width;
|
||||
// column widths can be set in config.
|
||||
const widths = row.map(col => {
|
||||
if (col.width) {
|
||||
unset--;
|
||||
remainingWidth -= col.width;
|
||||
return col.width;
|
||||
}
|
||||
return undefined;
|
||||
});
|
||||
// any unset widths should be calculated.
|
||||
const unsetWidth = unset ? Math.floor(remainingWidth / unset) : 0;
|
||||
return widths.map((w, i) => {
|
||||
if (w === undefined) {
|
||||
return Math.max(unsetWidth, _minWidth(row[i]));
|
||||
}
|
||||
return w;
|
||||
});
|
||||
}
|
||||
}
|
||||
function addBorder(col, ts, style) {
|
||||
if (col.border) {
|
||||
if (/[.']-+[.']/.test(ts)) {
|
||||
return '';
|
||||
}
|
||||
if (ts.trim().length !== 0) {
|
||||
return style;
|
||||
}
|
||||
return ' ';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
// calculates the minimum width of
|
||||
// a column, based on padding preferences.
|
||||
function _minWidth(col) {
|
||||
const padding = col.padding || [];
|
||||
const minWidth = 1 + (padding[left] || 0) + (padding[right] || 0);
|
||||
if (col.border) {
|
||||
return minWidth + 4;
|
||||
}
|
||||
return minWidth;
|
||||
}
|
||||
function getWindowWidth() {
|
||||
/* istanbul ignore next: depends on terminal */
|
||||
if (typeof process === 'object' && process.stdout && process.stdout.columns) {
|
||||
return process.stdout.columns;
|
||||
}
|
||||
return 80;
|
||||
}
|
||||
function alignRight(str, width) {
|
||||
str = str.trim();
|
||||
const strWidth = mixin.stringWidth(str);
|
||||
if (strWidth < width) {
|
||||
return ' '.repeat(width - strWidth) + str;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
function alignCenter(str, width) {
|
||||
str = str.trim();
|
||||
const strWidth = mixin.stringWidth(str);
|
||||
/* istanbul ignore next */
|
||||
if (strWidth >= width) {
|
||||
return str;
|
||||
}
|
||||
return ' '.repeat((width - strWidth) >> 1) + str;
|
||||
}
|
||||
let mixin;
|
||||
function cliui(opts, _mixin) {
|
||||
mixin = _mixin;
|
||||
return new UI({
|
||||
width: (opts === null || opts === void 0 ? void 0 : opts.width) || getWindowWidth(),
|
||||
wrap: opts === null || opts === void 0 ? void 0 : opts.wrap
|
||||
});
|
||||
}
|
||||
|
||||
// Bootstrap cliui with CommonJS dependencies:
|
||||
const stringWidth = require('string-width');
|
||||
const stripAnsi = require('strip-ansi');
|
||||
const wrap = require('wrap-ansi');
|
||||
function ui(opts) {
|
||||
return cliui(opts, {
|
||||
stringWidth,
|
||||
stripAnsi,
|
||||
wrap
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = ui;
|
43
backend/node_modules/postcss-cli/node_modules/cliui/build/index.d.cts
generated
vendored
Normal file
43
backend/node_modules/postcss-cli/node_modules/cliui/build/index.d.cts
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
interface UIOptions {
|
||||
width: number;
|
||||
wrap?: boolean;
|
||||
rows?: string[];
|
||||
}
|
||||
interface Column {
|
||||
text: string;
|
||||
width?: number;
|
||||
align?: "right" | "left" | "center";
|
||||
padding: number[];
|
||||
border?: boolean;
|
||||
}
|
||||
interface ColumnArray extends Array<Column> {
|
||||
span: boolean;
|
||||
}
|
||||
interface Line {
|
||||
hidden?: boolean;
|
||||
text: string;
|
||||
span?: boolean;
|
||||
}
|
||||
declare class UI {
|
||||
width: number;
|
||||
wrap: boolean;
|
||||
rows: ColumnArray[];
|
||||
constructor(opts: UIOptions);
|
||||
span(...args: ColumnArray): void;
|
||||
resetOutput(): void;
|
||||
div(...args: (Column | string)[]): ColumnArray;
|
||||
private shouldApplyLayoutDSL;
|
||||
private applyLayoutDSL;
|
||||
private colFromString;
|
||||
private measurePadding;
|
||||
toString(): string;
|
||||
rowToString(row: ColumnArray, lines: Line[]): Line[];
|
||||
// if the full 'source' can render in
|
||||
// the target line, do so.
|
||||
private renderInline;
|
||||
private rasterize;
|
||||
private negatePadding;
|
||||
private columnWidths;
|
||||
}
|
||||
declare function ui(opts: UIOptions): UI;
|
||||
export { ui as default };
|
287
backend/node_modules/postcss-cli/node_modules/cliui/build/lib/index.js
generated
vendored
Normal file
287
backend/node_modules/postcss-cli/node_modules/cliui/build/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,287 @@
|
||||
'use strict';
|
||||
const align = {
|
||||
right: alignRight,
|
||||
center: alignCenter
|
||||
};
|
||||
const top = 0;
|
||||
const right = 1;
|
||||
const bottom = 2;
|
||||
const left = 3;
|
||||
export class UI {
|
||||
constructor(opts) {
|
||||
var _a;
|
||||
this.width = opts.width;
|
||||
this.wrap = (_a = opts.wrap) !== null && _a !== void 0 ? _a : true;
|
||||
this.rows = [];
|
||||
}
|
||||
span(...args) {
|
||||
const cols = this.div(...args);
|
||||
cols.span = true;
|
||||
}
|
||||
resetOutput() {
|
||||
this.rows = [];
|
||||
}
|
||||
div(...args) {
|
||||
if (args.length === 0) {
|
||||
this.div('');
|
||||
}
|
||||
if (this.wrap && this.shouldApplyLayoutDSL(...args) && typeof args[0] === 'string') {
|
||||
return this.applyLayoutDSL(args[0]);
|
||||
}
|
||||
const cols = args.map(arg => {
|
||||
if (typeof arg === 'string') {
|
||||
return this.colFromString(arg);
|
||||
}
|
||||
return arg;
|
||||
});
|
||||
this.rows.push(cols);
|
||||
return cols;
|
||||
}
|
||||
shouldApplyLayoutDSL(...args) {
|
||||
return args.length === 1 && typeof args[0] === 'string' &&
|
||||
/[\t\n]/.test(args[0]);
|
||||
}
|
||||
applyLayoutDSL(str) {
|
||||
const rows = str.split('\n').map(row => row.split('\t'));
|
||||
let leftColumnWidth = 0;
|
||||
// simple heuristic for layout, make sure the
|
||||
// second column lines up along the left-hand.
|
||||
// don't allow the first column to take up more
|
||||
// than 50% of the screen.
|
||||
rows.forEach(columns => {
|
||||
if (columns.length > 1 && mixin.stringWidth(columns[0]) > leftColumnWidth) {
|
||||
leftColumnWidth = Math.min(Math.floor(this.width * 0.5), mixin.stringWidth(columns[0]));
|
||||
}
|
||||
});
|
||||
// generate a table:
|
||||
// replacing ' ' with padding calculations.
|
||||
// using the algorithmically generated width.
|
||||
rows.forEach(columns => {
|
||||
this.div(...columns.map((r, i) => {
|
||||
return {
|
||||
text: r.trim(),
|
||||
padding: this.measurePadding(r),
|
||||
width: (i === 0 && columns.length > 1) ? leftColumnWidth : undefined
|
||||
};
|
||||
}));
|
||||
});
|
||||
return this.rows[this.rows.length - 1];
|
||||
}
|
||||
colFromString(text) {
|
||||
return {
|
||||
text,
|
||||
padding: this.measurePadding(text)
|
||||
};
|
||||
}
|
||||
measurePadding(str) {
|
||||
// measure padding without ansi escape codes
|
||||
const noAnsi = mixin.stripAnsi(str);
|
||||
return [0, noAnsi.match(/\s*$/)[0].length, 0, noAnsi.match(/^\s*/)[0].length];
|
||||
}
|
||||
toString() {
|
||||
const lines = [];
|
||||
this.rows.forEach(row => {
|
||||
this.rowToString(row, lines);
|
||||
});
|
||||
// don't display any lines with the
|
||||
// hidden flag set.
|
||||
return lines
|
||||
.filter(line => !line.hidden)
|
||||
.map(line => line.text)
|
||||
.join('\n');
|
||||
}
|
||||
rowToString(row, lines) {
|
||||
this.rasterize(row).forEach((rrow, r) => {
|
||||
let str = '';
|
||||
rrow.forEach((col, c) => {
|
||||
const { width } = row[c]; // the width with padding.
|
||||
const wrapWidth = this.negatePadding(row[c]); // the width without padding.
|
||||
let ts = col; // temporary string used during alignment/padding.
|
||||
if (wrapWidth > mixin.stringWidth(col)) {
|
||||
ts += ' '.repeat(wrapWidth - mixin.stringWidth(col));
|
||||
}
|
||||
// align the string within its column.
|
||||
if (row[c].align && row[c].align !== 'left' && this.wrap) {
|
||||
const fn = align[row[c].align];
|
||||
ts = fn(ts, wrapWidth);
|
||||
if (mixin.stringWidth(ts) < wrapWidth) {
|
||||
ts += ' '.repeat((width || 0) - mixin.stringWidth(ts) - 1);
|
||||
}
|
||||
}
|
||||
// apply border and padding to string.
|
||||
const padding = row[c].padding || [0, 0, 0, 0];
|
||||
if (padding[left]) {
|
||||
str += ' '.repeat(padding[left]);
|
||||
}
|
||||
str += addBorder(row[c], ts, '| ');
|
||||
str += ts;
|
||||
str += addBorder(row[c], ts, ' |');
|
||||
if (padding[right]) {
|
||||
str += ' '.repeat(padding[right]);
|
||||
}
|
||||
// if prior row is span, try to render the
|
||||
// current row on the prior line.
|
||||
if (r === 0 && lines.length > 0) {
|
||||
str = this.renderInline(str, lines[lines.length - 1]);
|
||||
}
|
||||
});
|
||||
// remove trailing whitespace.
|
||||
lines.push({
|
||||
text: str.replace(/ +$/, ''),
|
||||
span: row.span
|
||||
});
|
||||
});
|
||||
return lines;
|
||||
}
|
||||
// if the full 'source' can render in
|
||||
// the target line, do so.
|
||||
renderInline(source, previousLine) {
|
||||
const match = source.match(/^ */);
|
||||
const leadingWhitespace = match ? match[0].length : 0;
|
||||
const target = previousLine.text;
|
||||
const targetTextWidth = mixin.stringWidth(target.trimRight());
|
||||
if (!previousLine.span) {
|
||||
return source;
|
||||
}
|
||||
// if we're not applying wrapping logic,
|
||||
// just always append to the span.
|
||||
if (!this.wrap) {
|
||||
previousLine.hidden = true;
|
||||
return target + source;
|
||||
}
|
||||
if (leadingWhitespace < targetTextWidth) {
|
||||
return source;
|
||||
}
|
||||
previousLine.hidden = true;
|
||||
return target.trimRight() + ' '.repeat(leadingWhitespace - targetTextWidth) + source.trimLeft();
|
||||
}
|
||||
rasterize(row) {
|
||||
const rrows = [];
|
||||
const widths = this.columnWidths(row);
|
||||
let wrapped;
|
||||
// word wrap all columns, and create
|
||||
// a data-structure that is easy to rasterize.
|
||||
row.forEach((col, c) => {
|
||||
// leave room for left and right padding.
|
||||
col.width = widths[c];
|
||||
if (this.wrap) {
|
||||
wrapped = mixin.wrap(col.text, this.negatePadding(col), { hard: true }).split('\n');
|
||||
}
|
||||
else {
|
||||
wrapped = col.text.split('\n');
|
||||
}
|
||||
if (col.border) {
|
||||
wrapped.unshift('.' + '-'.repeat(this.negatePadding(col) + 2) + '.');
|
||||
wrapped.push("'" + '-'.repeat(this.negatePadding(col) + 2) + "'");
|
||||
}
|
||||
// add top and bottom padding.
|
||||
if (col.padding) {
|
||||
wrapped.unshift(...new Array(col.padding[top] || 0).fill(''));
|
||||
wrapped.push(...new Array(col.padding[bottom] || 0).fill(''));
|
||||
}
|
||||
wrapped.forEach((str, r) => {
|
||||
if (!rrows[r]) {
|
||||
rrows.push([]);
|
||||
}
|
||||
const rrow = rrows[r];
|
||||
for (let i = 0; i < c; i++) {
|
||||
if (rrow[i] === undefined) {
|
||||
rrow.push('');
|
||||
}
|
||||
}
|
||||
rrow.push(str);
|
||||
});
|
||||
});
|
||||
return rrows;
|
||||
}
|
||||
negatePadding(col) {
|
||||
let wrapWidth = col.width || 0;
|
||||
if (col.padding) {
|
||||
wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0);
|
||||
}
|
||||
if (col.border) {
|
||||
wrapWidth -= 4;
|
||||
}
|
||||
return wrapWidth;
|
||||
}
|
||||
columnWidths(row) {
|
||||
if (!this.wrap) {
|
||||
return row.map(col => {
|
||||
return col.width || mixin.stringWidth(col.text);
|
||||
});
|
||||
}
|
||||
let unset = row.length;
|
||||
let remainingWidth = this.width;
|
||||
// column widths can be set in config.
|
||||
const widths = row.map(col => {
|
||||
if (col.width) {
|
||||
unset--;
|
||||
remainingWidth -= col.width;
|
||||
return col.width;
|
||||
}
|
||||
return undefined;
|
||||
});
|
||||
// any unset widths should be calculated.
|
||||
const unsetWidth = unset ? Math.floor(remainingWidth / unset) : 0;
|
||||
return widths.map((w, i) => {
|
||||
if (w === undefined) {
|
||||
return Math.max(unsetWidth, _minWidth(row[i]));
|
||||
}
|
||||
return w;
|
||||
});
|
||||
}
|
||||
}
|
||||
function addBorder(col, ts, style) {
|
||||
if (col.border) {
|
||||
if (/[.']-+[.']/.test(ts)) {
|
||||
return '';
|
||||
}
|
||||
if (ts.trim().length !== 0) {
|
||||
return style;
|
||||
}
|
||||
return ' ';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
// calculates the minimum width of
|
||||
// a column, based on padding preferences.
|
||||
function _minWidth(col) {
|
||||
const padding = col.padding || [];
|
||||
const minWidth = 1 + (padding[left] || 0) + (padding[right] || 0);
|
||||
if (col.border) {
|
||||
return minWidth + 4;
|
||||
}
|
||||
return minWidth;
|
||||
}
|
||||
function getWindowWidth() {
|
||||
/* istanbul ignore next: depends on terminal */
|
||||
if (typeof process === 'object' && process.stdout && process.stdout.columns) {
|
||||
return process.stdout.columns;
|
||||
}
|
||||
return 80;
|
||||
}
|
||||
function alignRight(str, width) {
|
||||
str = str.trim();
|
||||
const strWidth = mixin.stringWidth(str);
|
||||
if (strWidth < width) {
|
||||
return ' '.repeat(width - strWidth) + str;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
function alignCenter(str, width) {
|
||||
str = str.trim();
|
||||
const strWidth = mixin.stringWidth(str);
|
||||
/* istanbul ignore next */
|
||||
if (strWidth >= width) {
|
||||
return str;
|
||||
}
|
||||
return ' '.repeat((width - strWidth) >> 1) + str;
|
||||
}
|
||||
let mixin;
|
||||
export function cliui(opts, _mixin) {
|
||||
mixin = _mixin;
|
||||
return new UI({
|
||||
width: (opts === null || opts === void 0 ? void 0 : opts.width) || getWindowWidth(),
|
||||
wrap: opts === null || opts === void 0 ? void 0 : opts.wrap
|
||||
});
|
||||
}
|
27
backend/node_modules/postcss-cli/node_modules/cliui/build/lib/string-utils.js
generated
vendored
Normal file
27
backend/node_modules/postcss-cli/node_modules/cliui/build/lib/string-utils.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
// Minimal replacement for ansi string helpers "wrap-ansi" and "strip-ansi".
|
||||
// to facilitate ESM and Deno modules.
|
||||
// TODO: look at porting https://www.npmjs.com/package/wrap-ansi to ESM.
|
||||
// The npm application
|
||||
// Copyright (c) npm, Inc. and Contributors
|
||||
// Licensed on the terms of The Artistic License 2.0
|
||||
// See: https://github.com/npm/cli/blob/4c65cd952bc8627811735bea76b9b110cc4fc80e/lib/utils/ansi-trim.js
|
||||
const ansi = new RegExp('\x1b(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|' +
|
||||
'\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)', 'g');
|
||||
export function stripAnsi(str) {
|
||||
return str.replace(ansi, '');
|
||||
}
|
||||
export function wrap(str, width) {
|
||||
const [start, end] = str.match(ansi) || ['', ''];
|
||||
str = stripAnsi(str);
|
||||
let wrapped = '';
|
||||
for (let i = 0; i < str.length; i++) {
|
||||
if (i !== 0 && (i % width) === 0) {
|
||||
wrapped += '\n';
|
||||
}
|
||||
wrapped += str.charAt(i);
|
||||
}
|
||||
if (start && end) {
|
||||
wrapped = `${start}${wrapped}${end}`;
|
||||
}
|
||||
return wrapped;
|
||||
}
|
13
backend/node_modules/postcss-cli/node_modules/cliui/index.mjs
generated
vendored
Normal file
13
backend/node_modules/postcss-cli/node_modules/cliui/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
// Bootstrap cliui with CommonJS dependencies:
|
||||
import { cliui } from './build/lib/index.js'
|
||||
import { wrap, stripAnsi } from './build/lib/string-utils.js'
|
||||
|
||||
export default function ui (opts) {
|
||||
return cliui(opts, {
|
||||
stringWidth: (str) => {
|
||||
return [...str].length
|
||||
},
|
||||
stripAnsi,
|
||||
wrap
|
||||
})
|
||||
}
|
83
backend/node_modules/postcss-cli/node_modules/cliui/package.json
generated
vendored
Normal file
83
backend/node_modules/postcss-cli/node_modules/cliui/package.json
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
{
|
||||
"name": "cliui",
|
||||
"version": "8.0.1",
|
||||
"description": "easily create complex multi-column command-line-interfaces",
|
||||
"main": "build/index.cjs",
|
||||
"exports": {
|
||||
".": [
|
||||
{
|
||||
"import": "./index.mjs",
|
||||
"require": "./build/index.cjs"
|
||||
},
|
||||
"./build/index.cjs"
|
||||
]
|
||||
},
|
||||
"type": "module",
|
||||
"module": "./index.mjs",
|
||||
"scripts": {
|
||||
"check": "standardx '**/*.ts' && standardx '**/*.js' && standardx '**/*.cjs'",
|
||||
"fix": "standardx --fix '**/*.ts' && standardx --fix '**/*.js' && standardx --fix '**/*.cjs'",
|
||||
"pretest": "rimraf build && tsc -p tsconfig.test.json && cross-env NODE_ENV=test npm run build:cjs",
|
||||
"test": "c8 mocha ./test/*.cjs",
|
||||
"test:esm": "c8 mocha ./test/esm/cliui-test.mjs",
|
||||
"postest": "check",
|
||||
"coverage": "c8 report --check-coverage",
|
||||
"precompile": "rimraf build",
|
||||
"compile": "tsc",
|
||||
"postcompile": "npm run build:cjs",
|
||||
"build:cjs": "rollup -c",
|
||||
"prepare": "npm run compile"
|
||||
},
|
||||
"repository": "yargs/cliui",
|
||||
"standard": {
|
||||
"ignore": [
|
||||
"**/example/**"
|
||||
],
|
||||
"globals": [
|
||||
"it"
|
||||
]
|
||||
},
|
||||
"keywords": [
|
||||
"cli",
|
||||
"command-line",
|
||||
"layout",
|
||||
"design",
|
||||
"console",
|
||||
"wrap",
|
||||
"table"
|
||||
],
|
||||
"author": "Ben Coe <ben@npmjs.com>",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"string-width": "^4.2.0",
|
||||
"strip-ansi": "^6.0.1",
|
||||
"wrap-ansi": "^7.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.0.27",
|
||||
"@typescript-eslint/eslint-plugin": "^4.0.0",
|
||||
"@typescript-eslint/parser": "^4.0.0",
|
||||
"c8": "^7.3.0",
|
||||
"chai": "^4.2.0",
|
||||
"chalk": "^4.1.0",
|
||||
"cross-env": "^7.0.2",
|
||||
"eslint": "^7.6.0",
|
||||
"eslint-plugin-import": "^2.22.0",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"gts": "^3.0.0",
|
||||
"mocha": "^10.0.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"rollup": "^2.23.1",
|
||||
"rollup-plugin-ts": "^3.0.2",
|
||||
"standardx": "^7.0.0",
|
||||
"typescript": "^4.0.0"
|
||||
},
|
||||
"files": [
|
||||
"build",
|
||||
"index.mjs",
|
||||
"!*.d.ts"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
}
|
20
backend/node_modules/postcss-cli/node_modules/emoji-regex/LICENSE-MIT.txt
generated
vendored
Normal file
20
backend/node_modules/postcss-cli/node_modules/emoji-regex/LICENSE-MIT.txt
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
Copyright Mathias Bynens <https://mathiasbynens.be/>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
73
backend/node_modules/postcss-cli/node_modules/emoji-regex/README.md
generated
vendored
Normal file
73
backend/node_modules/postcss-cli/node_modules/emoji-regex/README.md
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
# emoji-regex [](https://travis-ci.org/mathiasbynens/emoji-regex)
|
||||
|
||||
_emoji-regex_ offers a regular expression to match all emoji symbols (including textual representations of emoji) as per the Unicode Standard.
|
||||
|
||||
This repository contains a script that generates this regular expression based on [the data from Unicode v12](https://github.com/mathiasbynens/unicode-12.0.0). Because of this, the regular expression can easily be updated whenever new emoji are added to the Unicode standard.
|
||||
|
||||
## Installation
|
||||
|
||||
Via [npm](https://www.npmjs.com/):
|
||||
|
||||
```bash
|
||||
npm install emoji-regex
|
||||
```
|
||||
|
||||
In [Node.js](https://nodejs.org/):
|
||||
|
||||
```js
|
||||
const emojiRegex = require('emoji-regex');
|
||||
// Note: because the regular expression has the global flag set, this module
|
||||
// exports a function that returns the regex rather than exporting the regular
|
||||
// expression itself, to make it impossible to (accidentally) mutate the
|
||||
// original regular expression.
|
||||
|
||||
const text = `
|
||||
\u{231A}: ⌚ default emoji presentation character (Emoji_Presentation)
|
||||
\u{2194}\u{FE0F}: ↔️ default text presentation character rendered as emoji
|
||||
\u{1F469}: 👩 emoji modifier base (Emoji_Modifier_Base)
|
||||
\u{1F469}\u{1F3FF}: 👩🏿 emoji modifier base followed by a modifier
|
||||
`;
|
||||
|
||||
const regex = emojiRegex();
|
||||
let match;
|
||||
while (match = regex.exec(text)) {
|
||||
const emoji = match[0];
|
||||
console.log(`Matched sequence ${ emoji } — code points: ${ [...emoji].length }`);
|
||||
}
|
||||
```
|
||||
|
||||
Console output:
|
||||
|
||||
```
|
||||
Matched sequence ⌚ — code points: 1
|
||||
Matched sequence ⌚ — code points: 1
|
||||
Matched sequence ↔️ — code points: 2
|
||||
Matched sequence ↔️ — code points: 2
|
||||
Matched sequence 👩 — code points: 1
|
||||
Matched sequence 👩 — code points: 1
|
||||
Matched sequence 👩🏿 — code points: 2
|
||||
Matched sequence 👩🏿 — code points: 2
|
||||
```
|
||||
|
||||
To match emoji in their textual representation as well (i.e. emoji that are not `Emoji_Presentation` symbols and that aren’t forced to render as emoji by a variation selector), `require` the other regex:
|
||||
|
||||
```js
|
||||
const emojiRegex = require('emoji-regex/text.js');
|
||||
```
|
||||
|
||||
Additionally, in environments which support ES2015 Unicode escapes, you may `require` ES2015-style versions of the regexes:
|
||||
|
||||
```js
|
||||
const emojiRegex = require('emoji-regex/es2015/index.js');
|
||||
const emojiRegexText = require('emoji-regex/es2015/text.js');
|
||||
```
|
||||
|
||||
## Author
|
||||
|
||||
| [](https://twitter.com/mathias "Follow @mathias on Twitter") |
|
||||
|---|
|
||||
| [Mathias Bynens](https://mathiasbynens.be/) |
|
||||
|
||||
## License
|
||||
|
||||
_emoji-regex_ is available under the [MIT](https://mths.be/mit) license.
|
6
backend/node_modules/postcss-cli/node_modules/emoji-regex/es2015/index.js
generated
vendored
Normal file
6
backend/node_modules/postcss-cli/node_modules/emoji-regex/es2015/index.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
6
backend/node_modules/postcss-cli/node_modules/emoji-regex/es2015/text.js
generated
vendored
Normal file
6
backend/node_modules/postcss-cli/node_modules/emoji-regex/es2015/text.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
23
backend/node_modules/postcss-cli/node_modules/emoji-regex/index.d.ts
generated
vendored
Normal file
23
backend/node_modules/postcss-cli/node_modules/emoji-regex/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
declare module 'emoji-regex' {
|
||||
function emojiRegex(): RegExp;
|
||||
|
||||
export default emojiRegex;
|
||||
}
|
||||
|
||||
declare module 'emoji-regex/text' {
|
||||
function emojiRegex(): RegExp;
|
||||
|
||||
export default emojiRegex;
|
||||
}
|
||||
|
||||
declare module 'emoji-regex/es2015' {
|
||||
function emojiRegex(): RegExp;
|
||||
|
||||
export default emojiRegex;
|
||||
}
|
||||
|
||||
declare module 'emoji-regex/es2015/text' {
|
||||
function emojiRegex(): RegExp;
|
||||
|
||||
export default emojiRegex;
|
||||
}
|
6
backend/node_modules/postcss-cli/node_modules/emoji-regex/index.js
generated
vendored
Normal file
6
backend/node_modules/postcss-cli/node_modules/emoji-regex/index.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
50
backend/node_modules/postcss-cli/node_modules/emoji-regex/package.json
generated
vendored
Normal file
50
backend/node_modules/postcss-cli/node_modules/emoji-regex/package.json
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"name": "emoji-regex",
|
||||
"version": "8.0.0",
|
||||
"description": "A regular expression to match all Emoji-only symbols as per the Unicode Standard.",
|
||||
"homepage": "https://mths.be/emoji-regex",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"keywords": [
|
||||
"unicode",
|
||||
"regex",
|
||||
"regexp",
|
||||
"regular expressions",
|
||||
"code points",
|
||||
"symbols",
|
||||
"characters",
|
||||
"emoji"
|
||||
],
|
||||
"license": "MIT",
|
||||
"author": {
|
||||
"name": "Mathias Bynens",
|
||||
"url": "https://mathiasbynens.be/"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/mathiasbynens/emoji-regex.git"
|
||||
},
|
||||
"bugs": "https://github.com/mathiasbynens/emoji-regex/issues",
|
||||
"files": [
|
||||
"LICENSE-MIT.txt",
|
||||
"index.js",
|
||||
"index.d.ts",
|
||||
"text.js",
|
||||
"es2015/index.js",
|
||||
"es2015/text.js"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "rm -rf -- es2015; babel src -d .; NODE_ENV=es2015 babel src -d ./es2015; node script/inject-sequences.js",
|
||||
"test": "mocha",
|
||||
"test:watch": "npm run test -- --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.2.3",
|
||||
"@babel/core": "^7.3.4",
|
||||
"@babel/plugin-proposal-unicode-property-regex": "^7.2.0",
|
||||
"@babel/preset-env": "^7.3.4",
|
||||
"mocha": "^6.0.2",
|
||||
"regexgen": "^1.3.0",
|
||||
"unicode-12.0.0": "^0.7.9"
|
||||
}
|
||||
}
|
6
backend/node_modules/postcss-cli/node_modules/emoji-regex/text.js
generated
vendored
Normal file
6
backend/node_modules/postcss-cli/node_modules/emoji-regex/text.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
29
backend/node_modules/postcss-cli/node_modules/string-width/index.d.ts
generated
vendored
Normal file
29
backend/node_modules/postcss-cli/node_modules/string-width/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
declare const stringWidth: {
|
||||
/**
|
||||
Get the visual width of a string - the number of columns required to display it.
|
||||
|
||||
Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.
|
||||
|
||||
@example
|
||||
```
|
||||
import stringWidth = require('string-width');
|
||||
|
||||
stringWidth('a');
|
||||
//=> 1
|
||||
|
||||
stringWidth('古');
|
||||
//=> 2
|
||||
|
||||
stringWidth('\u001B[1m古\u001B[22m');
|
||||
//=> 2
|
||||
```
|
||||
*/
|
||||
(string: string): number;
|
||||
|
||||
// TODO: remove this in the next major version, refactor the whole definition to:
|
||||
// declare function stringWidth(string: string): number;
|
||||
// export = stringWidth;
|
||||
default: typeof stringWidth;
|
||||
}
|
||||
|
||||
export = stringWidth;
|
47
backend/node_modules/postcss-cli/node_modules/string-width/index.js
generated
vendored
Normal file
47
backend/node_modules/postcss-cli/node_modules/string-width/index.js
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
'use strict';
|
||||
const stripAnsi = require('strip-ansi');
|
||||
const isFullwidthCodePoint = require('is-fullwidth-code-point');
|
||||
const emojiRegex = require('emoji-regex');
|
||||
|
||||
const stringWidth = string => {
|
||||
if (typeof string !== 'string' || string.length === 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
string = stripAnsi(string);
|
||||
|
||||
if (string.length === 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
string = string.replace(emojiRegex(), ' ');
|
||||
|
||||
let width = 0;
|
||||
|
||||
for (let i = 0; i < string.length; i++) {
|
||||
const code = string.codePointAt(i);
|
||||
|
||||
// Ignore control characters
|
||||
if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Ignore combining characters
|
||||
if (code >= 0x300 && code <= 0x36F) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Surrogates
|
||||
if (code > 0xFFFF) {
|
||||
i++;
|
||||
}
|
||||
|
||||
width += isFullwidthCodePoint(code) ? 2 : 1;
|
||||
}
|
||||
|
||||
return width;
|
||||
};
|
||||
|
||||
module.exports = stringWidth;
|
||||
// TODO: remove this in the next major version
|
||||
module.exports.default = stringWidth;
|
9
backend/node_modules/postcss-cli/node_modules/string-width/license
generated
vendored
Normal file
9
backend/node_modules/postcss-cli/node_modules/string-width/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
56
backend/node_modules/postcss-cli/node_modules/string-width/package.json
generated
vendored
Normal file
56
backend/node_modules/postcss-cli/node_modules/string-width/package.json
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"name": "string-width",
|
||||
"version": "4.2.3",
|
||||
"description": "Get the visual width of a string - the number of columns required to display it",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/string-width",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"string",
|
||||
"character",
|
||||
"unicode",
|
||||
"width",
|
||||
"visual",
|
||||
"column",
|
||||
"columns",
|
||||
"fullwidth",
|
||||
"full-width",
|
||||
"full",
|
||||
"ansi",
|
||||
"escape",
|
||||
"codes",
|
||||
"cli",
|
||||
"command-line",
|
||||
"terminal",
|
||||
"console",
|
||||
"cjk",
|
||||
"chinese",
|
||||
"japanese",
|
||||
"korean",
|
||||
"fixed-width"
|
||||
],
|
||||
"dependencies": {
|
||||
"emoji-regex": "^8.0.0",
|
||||
"is-fullwidth-code-point": "^3.0.0",
|
||||
"strip-ansi": "^6.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^1.4.1",
|
||||
"tsd": "^0.7.1",
|
||||
"xo": "^0.24.0"
|
||||
}
|
||||
}
|
50
backend/node_modules/postcss-cli/node_modules/string-width/readme.md
generated
vendored
Normal file
50
backend/node_modules/postcss-cli/node_modules/string-width/readme.md
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
# string-width
|
||||
|
||||
> Get the visual width of a string - the number of columns required to display it
|
||||
|
||||
Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.
|
||||
|
||||
Useful to be able to measure the actual width of command-line output.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install string-width
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const stringWidth = require('string-width');
|
||||
|
||||
stringWidth('a');
|
||||
//=> 1
|
||||
|
||||
stringWidth('古');
|
||||
//=> 2
|
||||
|
||||
stringWidth('\u001B[1m古\u001B[22m');
|
||||
//=> 2
|
||||
```
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module
|
||||
- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string
|
||||
- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string
|
||||
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-string-width?utm_source=npm-string-width&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
17
backend/node_modules/postcss-cli/node_modules/strip-ansi/index.d.ts
generated
vendored
Normal file
17
backend/node_modules/postcss-cli/node_modules/strip-ansi/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string.
|
||||
|
||||
@example
|
||||
```
|
||||
import stripAnsi = require('strip-ansi');
|
||||
|
||||
stripAnsi('\u001B[4mUnicorn\u001B[0m');
|
||||
//=> 'Unicorn'
|
||||
|
||||
stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
|
||||
//=> 'Click'
|
||||
```
|
||||
*/
|
||||
declare function stripAnsi(string: string): string;
|
||||
|
||||
export = stripAnsi;
|
4
backend/node_modules/postcss-cli/node_modules/strip-ansi/index.js
generated
vendored
Normal file
4
backend/node_modules/postcss-cli/node_modules/strip-ansi/index.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
'use strict';
|
||||
const ansiRegex = require('ansi-regex');
|
||||
|
||||
module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;
|
9
backend/node_modules/postcss-cli/node_modules/strip-ansi/license
generated
vendored
Normal file
9
backend/node_modules/postcss-cli/node_modules/strip-ansi/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
54
backend/node_modules/postcss-cli/node_modules/strip-ansi/package.json
generated
vendored
Normal file
54
backend/node_modules/postcss-cli/node_modules/strip-ansi/package.json
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"name": "strip-ansi",
|
||||
"version": "6.0.1",
|
||||
"description": "Strip ANSI escape codes from a string",
|
||||
"license": "MIT",
|
||||
"repository": "chalk/strip-ansi",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"strip",
|
||||
"trim",
|
||||
"remove",
|
||||
"ansi",
|
||||
"styles",
|
||||
"color",
|
||||
"colour",
|
||||
"colors",
|
||||
"terminal",
|
||||
"console",
|
||||
"string",
|
||||
"tty",
|
||||
"escape",
|
||||
"formatting",
|
||||
"rgb",
|
||||
"256",
|
||||
"shell",
|
||||
"xterm",
|
||||
"log",
|
||||
"logging",
|
||||
"command-line",
|
||||
"text"
|
||||
],
|
||||
"dependencies": {
|
||||
"ansi-regex": "^5.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^2.4.0",
|
||||
"tsd": "^0.10.0",
|
||||
"xo": "^0.25.3"
|
||||
}
|
||||
}
|
46
backend/node_modules/postcss-cli/node_modules/strip-ansi/readme.md
generated
vendored
Normal file
46
backend/node_modules/postcss-cli/node_modules/strip-ansi/readme.md
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
# strip-ansi [](https://travis-ci.org/chalk/strip-ansi)
|
||||
|
||||
> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install strip-ansi
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const stripAnsi = require('strip-ansi');
|
||||
|
||||
stripAnsi('\u001B[4mUnicorn\u001B[0m');
|
||||
//=> 'Unicorn'
|
||||
|
||||
stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
|
||||
//=> 'Click'
|
||||
```
|
||||
|
||||
|
||||
## strip-ansi for enterprise
|
||||
|
||||
Available as part of the Tidelift Subscription.
|
||||
|
||||
The maintainers of strip-ansi and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-strip-ansi?utm_source=npm-strip-ansi&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module
|
||||
- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module
|
||||
- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
|
||||
- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
|
||||
- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
|
||||
|
||||
|
||||
## Maintainers
|
||||
|
||||
- [Sindre Sorhus](https://github.com/sindresorhus)
|
||||
- [Josh Junon](https://github.com/qix-)
|
||||
|
216
backend/node_modules/postcss-cli/node_modules/wrap-ansi/index.js
generated
vendored
Normal file
216
backend/node_modules/postcss-cli/node_modules/wrap-ansi/index.js
generated
vendored
Normal file
@@ -0,0 +1,216 @@
|
||||
'use strict';
|
||||
const stringWidth = require('string-width');
|
||||
const stripAnsi = require('strip-ansi');
|
||||
const ansiStyles = require('ansi-styles');
|
||||
|
||||
const ESCAPES = new Set([
|
||||
'\u001B',
|
||||
'\u009B'
|
||||
]);
|
||||
|
||||
const END_CODE = 39;
|
||||
|
||||
const ANSI_ESCAPE_BELL = '\u0007';
|
||||
const ANSI_CSI = '[';
|
||||
const ANSI_OSC = ']';
|
||||
const ANSI_SGR_TERMINATOR = 'm';
|
||||
const ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
|
||||
|
||||
const wrapAnsi = code => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
|
||||
const wrapAnsiHyperlink = uri => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`;
|
||||
|
||||
// Calculate the length of words split on ' ', ignoring
|
||||
// the extra characters added by ansi escape codes
|
||||
const wordLengths = string => string.split(' ').map(character => stringWidth(character));
|
||||
|
||||
// Wrap a long word across multiple rows
|
||||
// Ansi escape codes do not count towards length
|
||||
const wrapWord = (rows, word, columns) => {
|
||||
const characters = [...word];
|
||||
|
||||
let isInsideEscape = false;
|
||||
let isInsideLinkEscape = false;
|
||||
let visible = stringWidth(stripAnsi(rows[rows.length - 1]));
|
||||
|
||||
for (const [index, character] of characters.entries()) {
|
||||
const characterLength = stringWidth(character);
|
||||
|
||||
if (visible + characterLength <= columns) {
|
||||
rows[rows.length - 1] += character;
|
||||
} else {
|
||||
rows.push(character);
|
||||
visible = 0;
|
||||
}
|
||||
|
||||
if (ESCAPES.has(character)) {
|
||||
isInsideEscape = true;
|
||||
isInsideLinkEscape = characters.slice(index + 1).join('').startsWith(ANSI_ESCAPE_LINK);
|
||||
}
|
||||
|
||||
if (isInsideEscape) {
|
||||
if (isInsideLinkEscape) {
|
||||
if (character === ANSI_ESCAPE_BELL) {
|
||||
isInsideEscape = false;
|
||||
isInsideLinkEscape = false;
|
||||
}
|
||||
} else if (character === ANSI_SGR_TERMINATOR) {
|
||||
isInsideEscape = false;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
visible += characterLength;
|
||||
|
||||
if (visible === columns && index < characters.length - 1) {
|
||||
rows.push('');
|
||||
visible = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// It's possible that the last row we copy over is only
|
||||
// ansi escape characters, handle this edge-case
|
||||
if (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) {
|
||||
rows[rows.length - 2] += rows.pop();
|
||||
}
|
||||
};
|
||||
|
||||
// Trims spaces from a string ignoring invisible sequences
|
||||
const stringVisibleTrimSpacesRight = string => {
|
||||
const words = string.split(' ');
|
||||
let last = words.length;
|
||||
|
||||
while (last > 0) {
|
||||
if (stringWidth(words[last - 1]) > 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
last--;
|
||||
}
|
||||
|
||||
if (last === words.length) {
|
||||
return string;
|
||||
}
|
||||
|
||||
return words.slice(0, last).join(' ') + words.slice(last).join('');
|
||||
};
|
||||
|
||||
// The wrap-ansi module can be invoked in either 'hard' or 'soft' wrap mode
|
||||
//
|
||||
// 'hard' will never allow a string to take up more than columns characters
|
||||
//
|
||||
// 'soft' allows long words to expand past the column length
|
||||
const exec = (string, columns, options = {}) => {
|
||||
if (options.trim !== false && string.trim() === '') {
|
||||
return '';
|
||||
}
|
||||
|
||||
let returnValue = '';
|
||||
let escapeCode;
|
||||
let escapeUrl;
|
||||
|
||||
const lengths = wordLengths(string);
|
||||
let rows = [''];
|
||||
|
||||
for (const [index, word] of string.split(' ').entries()) {
|
||||
if (options.trim !== false) {
|
||||
rows[rows.length - 1] = rows[rows.length - 1].trimStart();
|
||||
}
|
||||
|
||||
let rowLength = stringWidth(rows[rows.length - 1]);
|
||||
|
||||
if (index !== 0) {
|
||||
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
||||
// If we start with a new word but the current row length equals the length of the columns, add a new row
|
||||
rows.push('');
|
||||
rowLength = 0;
|
||||
}
|
||||
|
||||
if (rowLength > 0 || options.trim === false) {
|
||||
rows[rows.length - 1] += ' ';
|
||||
rowLength++;
|
||||
}
|
||||
}
|
||||
|
||||
// In 'hard' wrap mode, the length of a line is never allowed to extend past 'columns'
|
||||
if (options.hard && lengths[index] > columns) {
|
||||
const remainingColumns = (columns - rowLength);
|
||||
const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
|
||||
const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);
|
||||
if (breaksStartingNextLine < breaksStartingThisLine) {
|
||||
rows.push('');
|
||||
}
|
||||
|
||||
wrapWord(rows, word, columns);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
|
||||
if (options.wordWrap === false && rowLength < columns) {
|
||||
wrapWord(rows, word, columns);
|
||||
continue;
|
||||
}
|
||||
|
||||
rows.push('');
|
||||
}
|
||||
|
||||
if (rowLength + lengths[index] > columns && options.wordWrap === false) {
|
||||
wrapWord(rows, word, columns);
|
||||
continue;
|
||||
}
|
||||
|
||||
rows[rows.length - 1] += word;
|
||||
}
|
||||
|
||||
if (options.trim !== false) {
|
||||
rows = rows.map(stringVisibleTrimSpacesRight);
|
||||
}
|
||||
|
||||
const pre = [...rows.join('\n')];
|
||||
|
||||
for (const [index, character] of pre.entries()) {
|
||||
returnValue += character;
|
||||
|
||||
if (ESCAPES.has(character)) {
|
||||
const {groups} = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(pre.slice(index).join('')) || {groups: {}};
|
||||
if (groups.code !== undefined) {
|
||||
const code = Number.parseFloat(groups.code);
|
||||
escapeCode = code === END_CODE ? undefined : code;
|
||||
} else if (groups.uri !== undefined) {
|
||||
escapeUrl = groups.uri.length === 0 ? undefined : groups.uri;
|
||||
}
|
||||
}
|
||||
|
||||
const code = ansiStyles.codes.get(Number(escapeCode));
|
||||
|
||||
if (pre[index + 1] === '\n') {
|
||||
if (escapeUrl) {
|
||||
returnValue += wrapAnsiHyperlink('');
|
||||
}
|
||||
|
||||
if (escapeCode && code) {
|
||||
returnValue += wrapAnsi(code);
|
||||
}
|
||||
} else if (character === '\n') {
|
||||
if (escapeCode && code) {
|
||||
returnValue += wrapAnsi(escapeCode);
|
||||
}
|
||||
|
||||
if (escapeUrl) {
|
||||
returnValue += wrapAnsiHyperlink(escapeUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
};
|
||||
|
||||
// For each newline, invoke the method separately
|
||||
module.exports = (string, columns, options) => {
|
||||
return String(string)
|
||||
.normalize()
|
||||
.replace(/\r\n/g, '\n')
|
||||
.split('\n')
|
||||
.map(line => exec(line, columns, options))
|
||||
.join('\n');
|
||||
};
|
9
backend/node_modules/postcss-cli/node_modules/wrap-ansi/license
generated
vendored
Normal file
9
backend/node_modules/postcss-cli/node_modules/wrap-ansi/license
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
62
backend/node_modules/postcss-cli/node_modules/wrap-ansi/package.json
generated
vendored
Normal file
62
backend/node_modules/postcss-cli/node_modules/wrap-ansi/package.json
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"name": "wrap-ansi",
|
||||
"version": "7.0.0",
|
||||
"description": "Wordwrap a string with ANSI escape codes",
|
||||
"license": "MIT",
|
||||
"repository": "chalk/wrap-ansi",
|
||||
"funding": "https://github.com/chalk/wrap-ansi?sponsor=1",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "https://sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && nyc ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"wrap",
|
||||
"break",
|
||||
"wordwrap",
|
||||
"wordbreak",
|
||||
"linewrap",
|
||||
"ansi",
|
||||
"styles",
|
||||
"color",
|
||||
"colour",
|
||||
"colors",
|
||||
"terminal",
|
||||
"console",
|
||||
"cli",
|
||||
"string",
|
||||
"tty",
|
||||
"escape",
|
||||
"formatting",
|
||||
"rgb",
|
||||
"256",
|
||||
"shell",
|
||||
"xterm",
|
||||
"log",
|
||||
"logging",
|
||||
"command-line",
|
||||
"text"
|
||||
],
|
||||
"dependencies": {
|
||||
"ansi-styles": "^4.0.0",
|
||||
"string-width": "^4.1.0",
|
||||
"strip-ansi": "^6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^2.1.0",
|
||||
"chalk": "^4.0.0",
|
||||
"coveralls": "^3.0.3",
|
||||
"has-ansi": "^4.0.0",
|
||||
"nyc": "^15.0.1",
|
||||
"xo": "^0.29.1"
|
||||
}
|
||||
}
|
91
backend/node_modules/postcss-cli/node_modules/wrap-ansi/readme.md
generated
vendored
Normal file
91
backend/node_modules/postcss-cli/node_modules/wrap-ansi/readme.md
generated
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
# wrap-ansi [](https://travis-ci.com/chalk/wrap-ansi) [](https://coveralls.io/github/chalk/wrap-ansi?branch=master)
|
||||
|
||||
> Wordwrap a string with [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles)
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install wrap-ansi
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const chalk = require('chalk');
|
||||
const wrapAnsi = require('wrap-ansi');
|
||||
|
||||
const input = 'The quick brown ' + chalk.red('fox jumped over ') +
|
||||
'the lazy ' + chalk.green('dog and then ran away with the unicorn.');
|
||||
|
||||
console.log(wrapAnsi(input, 20));
|
||||
```
|
||||
|
||||
<img width="331" src="screenshot.png">
|
||||
|
||||
## API
|
||||
|
||||
### wrapAnsi(string, columns, options?)
|
||||
|
||||
Wrap words to the specified column width.
|
||||
|
||||
#### string
|
||||
|
||||
Type: `string`
|
||||
|
||||
String with ANSI escape codes. Like one styled by [`chalk`](https://github.com/chalk/chalk). Newline characters will be normalized to `\n`.
|
||||
|
||||
#### columns
|
||||
|
||||
Type: `number`
|
||||
|
||||
Number of columns to wrap the text to.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
##### hard
|
||||
|
||||
Type: `boolean`\
|
||||
Default: `false`
|
||||
|
||||
By default the wrap is soft, meaning long words may extend past the column width. Setting this to `true` will make it hard wrap at the column width.
|
||||
|
||||
##### wordWrap
|
||||
|
||||
Type: `boolean`\
|
||||
Default: `true`
|
||||
|
||||
By default, an attempt is made to split words at spaces, ensuring that they don't extend past the configured columns. If wordWrap is `false`, each column will instead be completely filled splitting words as necessary.
|
||||
|
||||
##### trim
|
||||
|
||||
Type: `boolean`\
|
||||
Default: `true`
|
||||
|
||||
Whitespace on all lines is removed by default. Set this option to `false` if you don't want to trim.
|
||||
|
||||
## Related
|
||||
|
||||
- [slice-ansi](https://github.com/chalk/slice-ansi) - Slice a string with ANSI escape codes
|
||||
- [cli-truncate](https://github.com/sindresorhus/cli-truncate) - Truncate a string to a specific width in the terminal
|
||||
- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
|
||||
- [jsesc](https://github.com/mathiasbynens/jsesc) - Generate ASCII-only output from Unicode strings. Useful for creating test fixtures.
|
||||
|
||||
## Maintainers
|
||||
|
||||
- [Sindre Sorhus](https://github.com/sindresorhus)
|
||||
- [Josh Junon](https://github.com/qix-)
|
||||
- [Benjamin Coe](https://github.com/bcoe)
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-wrap_ansi?utm_source=npm-wrap-ansi&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
100
backend/node_modules/postcss-cli/node_modules/y18n/CHANGELOG.md
generated
vendored
Normal file
100
backend/node_modules/postcss-cli/node_modules/y18n/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
# Change Log
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
### [5.0.8](https://www.github.com/yargs/y18n/compare/v5.0.7...v5.0.8) (2021-04-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deno:** force modern release for Deno ([b1c215a](https://www.github.com/yargs/y18n/commit/b1c215aed714bee5830e76de3e335504dc2c4dab))
|
||||
|
||||
### [5.0.7](https://www.github.com/yargs/y18n/compare/v5.0.6...v5.0.7) (2021-04-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deno:** force release for deno ([#121](https://www.github.com/yargs/y18n/issues/121)) ([d3f2560](https://www.github.com/yargs/y18n/commit/d3f2560e6cedf2bfa2352e9eec044da53f9a06b2))
|
||||
|
||||
### [5.0.6](https://www.github.com/yargs/y18n/compare/v5.0.5...v5.0.6) (2021-04-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **webpack:** skip readFileSync if not defined ([#117](https://www.github.com/yargs/y18n/issues/117)) ([6966fa9](https://www.github.com/yargs/y18n/commit/6966fa91d2881cc6a6c531e836099e01f4da1616))
|
||||
|
||||
### [5.0.5](https://www.github.com/yargs/y18n/compare/v5.0.4...v5.0.5) (2020-10-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* address prototype pollution issue ([#108](https://www.github.com/yargs/y18n/issues/108)) ([a9ac604](https://www.github.com/yargs/y18n/commit/a9ac604abf756dec9687be3843e2c93bfe581f25))
|
||||
|
||||
### [5.0.4](https://www.github.com/yargs/y18n/compare/v5.0.3...v5.0.4) (2020-10-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **exports:** node 13.0 and 13.1 require the dotted object form _with_ a string fallback ([#105](https://www.github.com/yargs/y18n/issues/105)) ([4f85d80](https://www.github.com/yargs/y18n/commit/4f85d80dbaae6d2c7899ae394f7ad97805df4886))
|
||||
|
||||
### [5.0.3](https://www.github.com/yargs/y18n/compare/v5.0.2...v5.0.3) (2020-10-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **exports:** node 13.0-13.6 require a string fallback ([#103](https://www.github.com/yargs/y18n/issues/103)) ([e39921e](https://www.github.com/yargs/y18n/commit/e39921e1017f88f5d8ea97ddea854ffe92d68e74))
|
||||
|
||||
### [5.0.2](https://www.github.com/yargs/y18n/compare/v5.0.1...v5.0.2) (2020-10-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deno:** update types for deno ^1.4.0 ([#100](https://www.github.com/yargs/y18n/issues/100)) ([3834d9a](https://www.github.com/yargs/y18n/commit/3834d9ab1332f2937c935ada5e76623290efae81))
|
||||
|
||||
### [5.0.1](https://www.github.com/yargs/y18n/compare/v5.0.0...v5.0.1) (2020-09-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* main had old index path ([#98](https://www.github.com/yargs/y18n/issues/98)) ([124f7b0](https://www.github.com/yargs/y18n/commit/124f7b047ba9596bdbdf64459988304e77f3de1b))
|
||||
|
||||
## [5.0.0](https://www.github.com/yargs/y18n/compare/v4.0.0...v5.0.0) (2020-09-05)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* exports maps are now used, which modifies import behavior.
|
||||
* drops Node 6 and 4. begin following Node.js LTS schedule (#89)
|
||||
|
||||
### Features
|
||||
|
||||
* add support for ESM and Deno [#95](https://www.github.com/yargs/y18n/issues/95)) ([4d7ae94](https://www.github.com/yargs/y18n/commit/4d7ae94bcb42e84164e2180366474b1cd321ed94))
|
||||
|
||||
|
||||
### Build System
|
||||
|
||||
* drops Node 6 and 4. begin following Node.js LTS schedule ([#89](https://www.github.com/yargs/y18n/issues/89)) ([3cc0c28](https://www.github.com/yargs/y18n/commit/3cc0c287240727b84eaf1927f903612ec80f5e43))
|
||||
|
||||
### 4.0.1 (2020-10-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* address prototype pollution issue ([#108](https://www.github.com/yargs/y18n/issues/108)) ([a9ac604](https://www.github.com/yargs/y18n/commit/7de58ca0d315990cdb38234e97fc66254cdbcd71))
|
||||
|
||||
## [4.0.0](https://github.com/yargs/y18n/compare/v3.2.1...v4.0.0) (2017-10-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* allow support for falsy values like 0 in tagged literal ([#45](https://github.com/yargs/y18n/issues/45)) ([c926123](https://github.com/yargs/y18n/commit/c926123))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **__:** added tagged template literal support ([#44](https://github.com/yargs/y18n/issues/44)) ([0598daf](https://github.com/yargs/y18n/commit/0598daf))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* **__:** dropping Node 0.10/Node 0.12 support
|
13
backend/node_modules/postcss-cli/node_modules/y18n/LICENSE
generated
vendored
Normal file
13
backend/node_modules/postcss-cli/node_modules/y18n/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
Copyright (c) 2015, Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any purpose
|
||||
with or without fee is hereby granted, provided that the above copyright notice
|
||||
and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
||||
THIS SOFTWARE.
|
127
backend/node_modules/postcss-cli/node_modules/y18n/README.md
generated
vendored
Normal file
127
backend/node_modules/postcss-cli/node_modules/y18n/README.md
generated
vendored
Normal file
@@ -0,0 +1,127 @@
|
||||
# y18n
|
||||
|
||||
[![NPM version][npm-image]][npm-url]
|
||||
[![js-standard-style][standard-image]][standard-url]
|
||||
[](https://conventionalcommits.org)
|
||||
|
||||
The bare-bones internationalization library used by yargs.
|
||||
|
||||
Inspired by [i18n](https://www.npmjs.com/package/i18n).
|
||||
|
||||
## Examples
|
||||
|
||||
_simple string translation:_
|
||||
|
||||
```js
|
||||
const __ = require('y18n')().__;
|
||||
|
||||
console.log(__('my awesome string %s', 'foo'));
|
||||
```
|
||||
|
||||
output:
|
||||
|
||||
`my awesome string foo`
|
||||
|
||||
_using tagged template literals_
|
||||
|
||||
```js
|
||||
const __ = require('y18n')().__;
|
||||
|
||||
const str = 'foo';
|
||||
|
||||
console.log(__`my awesome string ${str}`);
|
||||
```
|
||||
|
||||
output:
|
||||
|
||||
`my awesome string foo`
|
||||
|
||||
_pluralization support:_
|
||||
|
||||
```js
|
||||
const __n = require('y18n')().__n;
|
||||
|
||||
console.log(__n('one fish %s', '%d fishes %s', 2, 'foo'));
|
||||
```
|
||||
|
||||
output:
|
||||
|
||||
`2 fishes foo`
|
||||
|
||||
## Deno Example
|
||||
|
||||
As of `v5` `y18n` supports [Deno](https://github.com/denoland/deno):
|
||||
|
||||
```typescript
|
||||
import y18n from "https://deno.land/x/y18n/deno.ts";
|
||||
|
||||
const __ = y18n({
|
||||
locale: 'pirate',
|
||||
directory: './test/locales'
|
||||
}).__
|
||||
|
||||
console.info(__`Hi, ${'Ben'} ${'Coe'}!`)
|
||||
```
|
||||
|
||||
You will need to run with `--allow-read` to load alternative locales.
|
||||
|
||||
## JSON Language Files
|
||||
|
||||
The JSON language files should be stored in a `./locales` folder.
|
||||
File names correspond to locales, e.g., `en.json`, `pirate.json`.
|
||||
|
||||
When strings are observed for the first time they will be
|
||||
added to the JSON file corresponding to the current locale.
|
||||
|
||||
## Methods
|
||||
|
||||
### require('y18n')(config)
|
||||
|
||||
Create an instance of y18n with the config provided, options include:
|
||||
|
||||
* `directory`: the locale directory, default `./locales`.
|
||||
* `updateFiles`: should newly observed strings be updated in file, default `true`.
|
||||
* `locale`: what locale should be used.
|
||||
* `fallbackToLanguage`: should fallback to a language-only file (e.g. `en.json`)
|
||||
be allowed if a file matching the locale does not exist (e.g. `en_US.json`),
|
||||
default `true`.
|
||||
|
||||
### y18n.\_\_(str, arg, arg, arg)
|
||||
|
||||
Print a localized string, `%s` will be replaced with `arg`s.
|
||||
|
||||
This function can also be used as a tag for a template literal. You can use it
|
||||
like this: <code>__`hello ${'world'}`</code>. This will be equivalent to
|
||||
`__('hello %s', 'world')`.
|
||||
|
||||
### y18n.\_\_n(singularString, pluralString, count, arg, arg, arg)
|
||||
|
||||
Print a localized string with appropriate pluralization. If `%d` is provided
|
||||
in the string, the `count` will replace this placeholder.
|
||||
|
||||
### y18n.setLocale(str)
|
||||
|
||||
Set the current locale being used.
|
||||
|
||||
### y18n.getLocale()
|
||||
|
||||
What locale is currently being used?
|
||||
|
||||
### y18n.updateLocale(obj)
|
||||
|
||||
Update the current locale with the key value pairs in `obj`.
|
||||
|
||||
## Supported Node.js Versions
|
||||
|
||||
Libraries in this ecosystem make a best effort to track
|
||||
[Node.js' release schedule](https://nodejs.org/en/about/releases/). Here's [a
|
||||
post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a).
|
||||
|
||||
## License
|
||||
|
||||
ISC
|
||||
|
||||
[npm-url]: https://npmjs.org/package/y18n
|
||||
[npm-image]: https://img.shields.io/npm/v/y18n.svg
|
||||
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg
|
||||
[standard-url]: https://github.com/feross/standard
|
203
backend/node_modules/postcss-cli/node_modules/y18n/build/index.cjs
generated
vendored
Normal file
203
backend/node_modules/postcss-cli/node_modules/y18n/build/index.cjs
generated
vendored
Normal file
@@ -0,0 +1,203 @@
|
||||
'use strict';
|
||||
|
||||
var fs = require('fs');
|
||||
var util = require('util');
|
||||
var path = require('path');
|
||||
|
||||
let shim;
|
||||
class Y18N {
|
||||
constructor(opts) {
|
||||
// configurable options.
|
||||
opts = opts || {};
|
||||
this.directory = opts.directory || './locales';
|
||||
this.updateFiles = typeof opts.updateFiles === 'boolean' ? opts.updateFiles : true;
|
||||
this.locale = opts.locale || 'en';
|
||||
this.fallbackToLanguage = typeof opts.fallbackToLanguage === 'boolean' ? opts.fallbackToLanguage : true;
|
||||
// internal stuff.
|
||||
this.cache = Object.create(null);
|
||||
this.writeQueue = [];
|
||||
}
|
||||
__(...args) {
|
||||
if (typeof arguments[0] !== 'string') {
|
||||
return this._taggedLiteral(arguments[0], ...arguments);
|
||||
}
|
||||
const str = args.shift();
|
||||
let cb = function () { }; // start with noop.
|
||||
if (typeof args[args.length - 1] === 'function')
|
||||
cb = args.pop();
|
||||
cb = cb || function () { }; // noop.
|
||||
if (!this.cache[this.locale])
|
||||
this._readLocaleFile();
|
||||
// we've observed a new string, update the language file.
|
||||
if (!this.cache[this.locale][str] && this.updateFiles) {
|
||||
this.cache[this.locale][str] = str;
|
||||
// include the current directory and locale,
|
||||
// since these values could change before the
|
||||
// write is performed.
|
||||
this._enqueueWrite({
|
||||
directory: this.directory,
|
||||
locale: this.locale,
|
||||
cb
|
||||
});
|
||||
}
|
||||
else {
|
||||
cb();
|
||||
}
|
||||
return shim.format.apply(shim.format, [this.cache[this.locale][str] || str].concat(args));
|
||||
}
|
||||
__n() {
|
||||
const args = Array.prototype.slice.call(arguments);
|
||||
const singular = args.shift();
|
||||
const plural = args.shift();
|
||||
const quantity = args.shift();
|
||||
let cb = function () { }; // start with noop.
|
||||
if (typeof args[args.length - 1] === 'function')
|
||||
cb = args.pop();
|
||||
if (!this.cache[this.locale])
|
||||
this._readLocaleFile();
|
||||
let str = quantity === 1 ? singular : plural;
|
||||
if (this.cache[this.locale][singular]) {
|
||||
const entry = this.cache[this.locale][singular];
|
||||
str = entry[quantity === 1 ? 'one' : 'other'];
|
||||
}
|
||||
// we've observed a new string, update the language file.
|
||||
if (!this.cache[this.locale][singular] && this.updateFiles) {
|
||||
this.cache[this.locale][singular] = {
|
||||
one: singular,
|
||||
other: plural
|
||||
};
|
||||
// include the current directory and locale,
|
||||
// since these values could change before the
|
||||
// write is performed.
|
||||
this._enqueueWrite({
|
||||
directory: this.directory,
|
||||
locale: this.locale,
|
||||
cb
|
||||
});
|
||||
}
|
||||
else {
|
||||
cb();
|
||||
}
|
||||
// if a %d placeholder is provided, add quantity
|
||||
// to the arguments expanded by util.format.
|
||||
const values = [str];
|
||||
if (~str.indexOf('%d'))
|
||||
values.push(quantity);
|
||||
return shim.format.apply(shim.format, values.concat(args));
|
||||
}
|
||||
setLocale(locale) {
|
||||
this.locale = locale;
|
||||
}
|
||||
getLocale() {
|
||||
return this.locale;
|
||||
}
|
||||
updateLocale(obj) {
|
||||
if (!this.cache[this.locale])
|
||||
this._readLocaleFile();
|
||||
for (const key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
this.cache[this.locale][key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
_taggedLiteral(parts, ...args) {
|
||||
let str = '';
|
||||
parts.forEach(function (part, i) {
|
||||
const arg = args[i + 1];
|
||||
str += part;
|
||||
if (typeof arg !== 'undefined') {
|
||||
str += '%s';
|
||||
}
|
||||
});
|
||||
return this.__.apply(this, [str].concat([].slice.call(args, 1)));
|
||||
}
|
||||
_enqueueWrite(work) {
|
||||
this.writeQueue.push(work);
|
||||
if (this.writeQueue.length === 1)
|
||||
this._processWriteQueue();
|
||||
}
|
||||
_processWriteQueue() {
|
||||
const _this = this;
|
||||
const work = this.writeQueue[0];
|
||||
// destructure the enqueued work.
|
||||
const directory = work.directory;
|
||||
const locale = work.locale;
|
||||
const cb = work.cb;
|
||||
const languageFile = this._resolveLocaleFile(directory, locale);
|
||||
const serializedLocale = JSON.stringify(this.cache[locale], null, 2);
|
||||
shim.fs.writeFile(languageFile, serializedLocale, 'utf-8', function (err) {
|
||||
_this.writeQueue.shift();
|
||||
if (_this.writeQueue.length > 0)
|
||||
_this._processWriteQueue();
|
||||
cb(err);
|
||||
});
|
||||
}
|
||||
_readLocaleFile() {
|
||||
let localeLookup = {};
|
||||
const languageFile = this._resolveLocaleFile(this.directory, this.locale);
|
||||
try {
|
||||
// When using a bundler such as webpack, readFileSync may not be defined:
|
||||
if (shim.fs.readFileSync) {
|
||||
localeLookup = JSON.parse(shim.fs.readFileSync(languageFile, 'utf-8'));
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
if (err instanceof SyntaxError) {
|
||||
err.message = 'syntax error in ' + languageFile;
|
||||
}
|
||||
if (err.code === 'ENOENT')
|
||||
localeLookup = {};
|
||||
else
|
||||
throw err;
|
||||
}
|
||||
this.cache[this.locale] = localeLookup;
|
||||
}
|
||||
_resolveLocaleFile(directory, locale) {
|
||||
let file = shim.resolve(directory, './', locale + '.json');
|
||||
if (this.fallbackToLanguage && !this._fileExistsSync(file) && ~locale.lastIndexOf('_')) {
|
||||
// attempt fallback to language only
|
||||
const languageFile = shim.resolve(directory, './', locale.split('_')[0] + '.json');
|
||||
if (this._fileExistsSync(languageFile))
|
||||
file = languageFile;
|
||||
}
|
||||
return file;
|
||||
}
|
||||
_fileExistsSync(file) {
|
||||
return shim.exists(file);
|
||||
}
|
||||
}
|
||||
function y18n$1(opts, _shim) {
|
||||
shim = _shim;
|
||||
const y18n = new Y18N(opts);
|
||||
return {
|
||||
__: y18n.__.bind(y18n),
|
||||
__n: y18n.__n.bind(y18n),
|
||||
setLocale: y18n.setLocale.bind(y18n),
|
||||
getLocale: y18n.getLocale.bind(y18n),
|
||||
updateLocale: y18n.updateLocale.bind(y18n),
|
||||
locale: y18n.locale
|
||||
};
|
||||
}
|
||||
|
||||
var nodePlatformShim = {
|
||||
fs: {
|
||||
readFileSync: fs.readFileSync,
|
||||
writeFile: fs.writeFile
|
||||
},
|
||||
format: util.format,
|
||||
resolve: path.resolve,
|
||||
exists: (file) => {
|
||||
try {
|
||||
return fs.statSync(file).isFile();
|
||||
}
|
||||
catch (err) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const y18n = (opts) => {
|
||||
return y18n$1(opts, nodePlatformShim);
|
||||
};
|
||||
|
||||
module.exports = y18n;
|
6
backend/node_modules/postcss-cli/node_modules/y18n/build/lib/cjs.js
generated
vendored
Normal file
6
backend/node_modules/postcss-cli/node_modules/y18n/build/lib/cjs.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import { y18n as _y18n } from './index.js';
|
||||
import nodePlatformShim from './platform-shims/node.js';
|
||||
const y18n = (opts) => {
|
||||
return _y18n(opts, nodePlatformShim);
|
||||
};
|
||||
export default y18n;
|
174
backend/node_modules/postcss-cli/node_modules/y18n/build/lib/index.js
generated
vendored
Normal file
174
backend/node_modules/postcss-cli/node_modules/y18n/build/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,174 @@
|
||||
let shim;
|
||||
class Y18N {
|
||||
constructor(opts) {
|
||||
// configurable options.
|
||||
opts = opts || {};
|
||||
this.directory = opts.directory || './locales';
|
||||
this.updateFiles = typeof opts.updateFiles === 'boolean' ? opts.updateFiles : true;
|
||||
this.locale = opts.locale || 'en';
|
||||
this.fallbackToLanguage = typeof opts.fallbackToLanguage === 'boolean' ? opts.fallbackToLanguage : true;
|
||||
// internal stuff.
|
||||
this.cache = Object.create(null);
|
||||
this.writeQueue = [];
|
||||
}
|
||||
__(...args) {
|
||||
if (typeof arguments[0] !== 'string') {
|
||||
return this._taggedLiteral(arguments[0], ...arguments);
|
||||
}
|
||||
const str = args.shift();
|
||||
let cb = function () { }; // start with noop.
|
||||
if (typeof args[args.length - 1] === 'function')
|
||||
cb = args.pop();
|
||||
cb = cb || function () { }; // noop.
|
||||
if (!this.cache[this.locale])
|
||||
this._readLocaleFile();
|
||||
// we've observed a new string, update the language file.
|
||||
if (!this.cache[this.locale][str] && this.updateFiles) {
|
||||
this.cache[this.locale][str] = str;
|
||||
// include the current directory and locale,
|
||||
// since these values could change before the
|
||||
// write is performed.
|
||||
this._enqueueWrite({
|
||||
directory: this.directory,
|
||||
locale: this.locale,
|
||||
cb
|
||||
});
|
||||
}
|
||||
else {
|
||||
cb();
|
||||
}
|
||||
return shim.format.apply(shim.format, [this.cache[this.locale][str] || str].concat(args));
|
||||
}
|
||||
__n() {
|
||||
const args = Array.prototype.slice.call(arguments);
|
||||
const singular = args.shift();
|
||||
const plural = args.shift();
|
||||
const quantity = args.shift();
|
||||
let cb = function () { }; // start with noop.
|
||||
if (typeof args[args.length - 1] === 'function')
|
||||
cb = args.pop();
|
||||
if (!this.cache[this.locale])
|
||||
this._readLocaleFile();
|
||||
let str = quantity === 1 ? singular : plural;
|
||||
if (this.cache[this.locale][singular]) {
|
||||
const entry = this.cache[this.locale][singular];
|
||||
str = entry[quantity === 1 ? 'one' : 'other'];
|
||||
}
|
||||
// we've observed a new string, update the language file.
|
||||
if (!this.cache[this.locale][singular] && this.updateFiles) {
|
||||
this.cache[this.locale][singular] = {
|
||||
one: singular,
|
||||
other: plural
|
||||
};
|
||||
// include the current directory and locale,
|
||||
// since these values could change before the
|
||||
// write is performed.
|
||||
this._enqueueWrite({
|
||||
directory: this.directory,
|
||||
locale: this.locale,
|
||||
cb
|
||||
});
|
||||
}
|
||||
else {
|
||||
cb();
|
||||
}
|
||||
// if a %d placeholder is provided, add quantity
|
||||
// to the arguments expanded by util.format.
|
||||
const values = [str];
|
||||
if (~str.indexOf('%d'))
|
||||
values.push(quantity);
|
||||
return shim.format.apply(shim.format, values.concat(args));
|
||||
}
|
||||
setLocale(locale) {
|
||||
this.locale = locale;
|
||||
}
|
||||
getLocale() {
|
||||
return this.locale;
|
||||
}
|
||||
updateLocale(obj) {
|
||||
if (!this.cache[this.locale])
|
||||
this._readLocaleFile();
|
||||
for (const key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
this.cache[this.locale][key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
_taggedLiteral(parts, ...args) {
|
||||
let str = '';
|
||||
parts.forEach(function (part, i) {
|
||||
const arg = args[i + 1];
|
||||
str += part;
|
||||
if (typeof arg !== 'undefined') {
|
||||
str += '%s';
|
||||
}
|
||||
});
|
||||
return this.__.apply(this, [str].concat([].slice.call(args, 1)));
|
||||
}
|
||||
_enqueueWrite(work) {
|
||||
this.writeQueue.push(work);
|
||||
if (this.writeQueue.length === 1)
|
||||
this._processWriteQueue();
|
||||
}
|
||||
_processWriteQueue() {
|
||||
const _this = this;
|
||||
const work = this.writeQueue[0];
|
||||
// destructure the enqueued work.
|
||||
const directory = work.directory;
|
||||
const locale = work.locale;
|
||||
const cb = work.cb;
|
||||
const languageFile = this._resolveLocaleFile(directory, locale);
|
||||
const serializedLocale = JSON.stringify(this.cache[locale], null, 2);
|
||||
shim.fs.writeFile(languageFile, serializedLocale, 'utf-8', function (err) {
|
||||
_this.writeQueue.shift();
|
||||
if (_this.writeQueue.length > 0)
|
||||
_this._processWriteQueue();
|
||||
cb(err);
|
||||
});
|
||||
}
|
||||
_readLocaleFile() {
|
||||
let localeLookup = {};
|
||||
const languageFile = this._resolveLocaleFile(this.directory, this.locale);
|
||||
try {
|
||||
// When using a bundler such as webpack, readFileSync may not be defined:
|
||||
if (shim.fs.readFileSync) {
|
||||
localeLookup = JSON.parse(shim.fs.readFileSync(languageFile, 'utf-8'));
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
if (err instanceof SyntaxError) {
|
||||
err.message = 'syntax error in ' + languageFile;
|
||||
}
|
||||
if (err.code === 'ENOENT')
|
||||
localeLookup = {};
|
||||
else
|
||||
throw err;
|
||||
}
|
||||
this.cache[this.locale] = localeLookup;
|
||||
}
|
||||
_resolveLocaleFile(directory, locale) {
|
||||
let file = shim.resolve(directory, './', locale + '.json');
|
||||
if (this.fallbackToLanguage && !this._fileExistsSync(file) && ~locale.lastIndexOf('_')) {
|
||||
// attempt fallback to language only
|
||||
const languageFile = shim.resolve(directory, './', locale.split('_')[0] + '.json');
|
||||
if (this._fileExistsSync(languageFile))
|
||||
file = languageFile;
|
||||
}
|
||||
return file;
|
||||
}
|
||||
_fileExistsSync(file) {
|
||||
return shim.exists(file);
|
||||
}
|
||||
}
|
||||
export function y18n(opts, _shim) {
|
||||
shim = _shim;
|
||||
const y18n = new Y18N(opts);
|
||||
return {
|
||||
__: y18n.__.bind(y18n),
|
||||
__n: y18n.__n.bind(y18n),
|
||||
setLocale: y18n.setLocale.bind(y18n),
|
||||
getLocale: y18n.getLocale.bind(y18n),
|
||||
updateLocale: y18n.updateLocale.bind(y18n),
|
||||
locale: y18n.locale
|
||||
};
|
||||
}
|
19
backend/node_modules/postcss-cli/node_modules/y18n/build/lib/platform-shims/node.js
generated
vendored
Normal file
19
backend/node_modules/postcss-cli/node_modules/y18n/build/lib/platform-shims/node.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import { readFileSync, statSync, writeFile } from 'fs';
|
||||
import { format } from 'util';
|
||||
import { resolve } from 'path';
|
||||
export default {
|
||||
fs: {
|
||||
readFileSync,
|
||||
writeFile
|
||||
},
|
||||
format,
|
||||
resolve,
|
||||
exists: (file) => {
|
||||
try {
|
||||
return statSync(file).isFile();
|
||||
}
|
||||
catch (err) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
8
backend/node_modules/postcss-cli/node_modules/y18n/index.mjs
generated
vendored
Normal file
8
backend/node_modules/postcss-cli/node_modules/y18n/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import shim from './build/lib/platform-shims/node.js'
|
||||
import { y18n as _y18n } from './build/lib/index.js'
|
||||
|
||||
const y18n = (opts) => {
|
||||
return _y18n(opts, shim)
|
||||
}
|
||||
|
||||
export default y18n
|
70
backend/node_modules/postcss-cli/node_modules/y18n/package.json
generated
vendored
Normal file
70
backend/node_modules/postcss-cli/node_modules/y18n/package.json
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"name": "y18n",
|
||||
"version": "5.0.8",
|
||||
"description": "the bare-bones internationalization library used by yargs",
|
||||
"exports": {
|
||||
".": [
|
||||
{
|
||||
"import": "./index.mjs",
|
||||
"require": "./build/index.cjs"
|
||||
},
|
||||
"./build/index.cjs"
|
||||
]
|
||||
},
|
||||
"type": "module",
|
||||
"module": "./build/lib/index.js",
|
||||
"keywords": [
|
||||
"i18n",
|
||||
"internationalization",
|
||||
"yargs"
|
||||
],
|
||||
"homepage": "https://github.com/yargs/y18n",
|
||||
"bugs": {
|
||||
"url": "https://github.com/yargs/y18n/issues"
|
||||
},
|
||||
"repository": "yargs/y18n",
|
||||
"license": "ISC",
|
||||
"author": "Ben Coe <bencoe@gmail.com>",
|
||||
"main": "./build/index.cjs",
|
||||
"scripts": {
|
||||
"check": "standardx **/*.ts **/*.cjs **/*.mjs",
|
||||
"fix": "standardx --fix **/*.ts **/*.cjs **/*.mjs",
|
||||
"pretest": "rimraf build && tsc -p tsconfig.test.json && cross-env NODE_ENV=test npm run build:cjs",
|
||||
"test": "c8 --reporter=text --reporter=html mocha test/*.cjs",
|
||||
"test:esm": "c8 --reporter=text --reporter=html mocha test/esm/*.mjs",
|
||||
"posttest": "npm run check",
|
||||
"coverage": "c8 report --check-coverage",
|
||||
"precompile": "rimraf build",
|
||||
"compile": "tsc",
|
||||
"postcompile": "npm run build:cjs",
|
||||
"build:cjs": "rollup -c",
|
||||
"prepare": "npm run compile"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.6.4",
|
||||
"@wessberg/rollup-plugin-ts": "^1.3.1",
|
||||
"c8": "^7.3.0",
|
||||
"chai": "^4.0.1",
|
||||
"cross-env": "^7.0.2",
|
||||
"gts": "^3.0.0",
|
||||
"mocha": "^8.0.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"rollup": "^2.26.10",
|
||||
"standardx": "^7.0.0",
|
||||
"ts-transform-default-export": "^1.0.2",
|
||||
"typescript": "^4.0.0"
|
||||
},
|
||||
"files": [
|
||||
"build",
|
||||
"index.mjs",
|
||||
"!*.d.ts"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"standardx": {
|
||||
"ignore": [
|
||||
"build"
|
||||
]
|
||||
}
|
||||
}
|
308
backend/node_modules/postcss-cli/node_modules/yargs-parser/CHANGELOG.md
generated
vendored
Normal file
308
backend/node_modules/postcss-cli/node_modules/yargs-parser/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,308 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
## [21.1.1](https://github.com/yargs/yargs-parser/compare/yargs-parser-v21.1.0...yargs-parser-v21.1.1) (2022-08-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **typescript:** ignore .cts files during publish ([#454](https://github.com/yargs/yargs-parser/issues/454)) ([d69f9c3](https://github.com/yargs/yargs-parser/commit/d69f9c3a91c3ad2f9494d0a94e29a8b76c41b81b)), closes [#452](https://github.com/yargs/yargs-parser/issues/452)
|
||||
|
||||
## [21.1.0](https://github.com/yargs/yargs-parser/compare/yargs-parser-v21.0.1...yargs-parser-v21.1.0) (2022-08-03)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* allow the browser build to be imported ([#443](https://github.com/yargs/yargs-parser/issues/443)) ([a89259f](https://github.com/yargs/yargs-parser/commit/a89259ff41d6f5312b3ce8a30bef343a993f395a))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **halt-at-non-option:** prevent known args from being parsed when "unknown-options-as-args" is enabled ([#438](https://github.com/yargs/yargs-parser/issues/438)) ([c474bc1](https://github.com/yargs/yargs-parser/commit/c474bc10c3aa0ae864b95e5722730114ef15f573))
|
||||
* node version check now uses process.versions.node ([#450](https://github.com/yargs/yargs-parser/issues/450)) ([d07bcdb](https://github.com/yargs/yargs-parser/commit/d07bcdbe43075f7201fbe8a08e491217247fe1f1))
|
||||
* parse options ending with 3+ hyphens ([#434](https://github.com/yargs/yargs-parser/issues/434)) ([4f1060b](https://github.com/yargs/yargs-parser/commit/4f1060b50759fadbac3315c5117b0c3d65b0a7d8))
|
||||
|
||||
### [21.0.1](https://github.com/yargs/yargs-parser/compare/yargs-parser-v21.0.0...yargs-parser-v21.0.1) (2022-02-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* return deno env object ([#432](https://github.com/yargs/yargs-parser/issues/432)) ([b00eb87](https://github.com/yargs/yargs-parser/commit/b00eb87b4860a890dd2dab0d6058241bbfd2b3ec))
|
||||
|
||||
## [21.0.0](https://www.github.com/yargs/yargs-parser/compare/yargs-parser-v20.2.9...yargs-parser-v21.0.0) (2021-11-15)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* drops support for 10 (#421)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* esm json import ([#416](https://www.github.com/yargs/yargs-parser/issues/416)) ([90f970a](https://www.github.com/yargs/yargs-parser/commit/90f970a6482dd4f5b5eb18d38596dd6f02d73edf))
|
||||
* parser should preserve inner quotes ([#407](https://www.github.com/yargs/yargs-parser/issues/407)) ([ae11f49](https://www.github.com/yargs/yargs-parser/commit/ae11f496a8318ea8885aa25015d429b33713c314))
|
||||
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
* drops support for 10 ([#421](https://www.github.com/yargs/yargs-parser/issues/421)) ([3aaf878](https://www.github.com/yargs/yargs-parser/commit/3aaf8784f5c7f2aec6108c1c6a55537fa7e3b5c1))
|
||||
|
||||
### [20.2.9](https://www.github.com/yargs/yargs-parser/compare/yargs-parser-v20.2.8...yargs-parser-v20.2.9) (2021-06-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **build:** fixed automated release pipeline ([1fe9135](https://www.github.com/yargs/yargs-parser/commit/1fe9135884790a083615419b2861683e2597dac3))
|
||||
|
||||
### [20.2.8](https://www.github.com/yargs/yargs-parser/compare/yargs-parser-v20.2.7...yargs-parser-v20.2.8) (2021-06-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **locale:** Turkish camelize and decamelize issues with toLocaleLowerCase/toLocaleUpperCase ([2617303](https://www.github.com/yargs/yargs-parser/commit/261730383e02448562f737b94bbd1f164aed5143))
|
||||
* **perf:** address slow parse when using unknown-options-as-args ([#394](https://www.github.com/yargs/yargs-parser/issues/394)) ([441f059](https://www.github.com/yargs/yargs-parser/commit/441f059d585d446551068ad213db79ac91daf83a))
|
||||
* **string-utils:** detect [0,1] ranged values as numbers ([#388](https://www.github.com/yargs/yargs-parser/issues/388)) ([efcc32c](https://www.github.com/yargs/yargs-parser/commit/efcc32c2d6b09aba31abfa2db9bd947befe5586b))
|
||||
|
||||
### [20.2.7](https://www.github.com/yargs/yargs-parser/compare/v20.2.6...v20.2.7) (2021-03-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deno:** force release for Deno ([6687c97](https://www.github.com/yargs/yargs-parser/commit/6687c972d0f3ca7865a97908dde3080b05f8b026))
|
||||
|
||||
### [20.2.6](https://www.github.com/yargs/yargs-parser/compare/v20.2.5...v20.2.6) (2021-02-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **populate--:** -- should always be array ([#354](https://www.github.com/yargs/yargs-parser/issues/354)) ([585ae8f](https://www.github.com/yargs/yargs-parser/commit/585ae8ffad74cc02974f92d788e750137fd65146))
|
||||
|
||||
### [20.2.5](https://www.github.com/yargs/yargs-parser/compare/v20.2.4...v20.2.5) (2021-02-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* do not lowercase camel cased string ([#348](https://www.github.com/yargs/yargs-parser/issues/348)) ([5f4da1f](https://www.github.com/yargs/yargs-parser/commit/5f4da1f17d9d50542d2aaa206c9806ce3e320335))
|
||||
|
||||
### [20.2.4](https://www.github.com/yargs/yargs-parser/compare/v20.2.3...v20.2.4) (2020-11-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deno:** address import issues in Deno ([#339](https://www.github.com/yargs/yargs-parser/issues/339)) ([3b54e5e](https://www.github.com/yargs/yargs-parser/commit/3b54e5eef6e9a7b7c6eec7c12bab3ba3b8ba8306))
|
||||
|
||||
### [20.2.3](https://www.github.com/yargs/yargs-parser/compare/v20.2.2...v20.2.3) (2020-10-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **exports:** node 13.0 and 13.1 require the dotted object form _with_ a string fallback ([#336](https://www.github.com/yargs/yargs-parser/issues/336)) ([3ae7242](https://www.github.com/yargs/yargs-parser/commit/3ae7242040ff876d28dabded60ac226e00150c88))
|
||||
|
||||
### [20.2.2](https://www.github.com/yargs/yargs-parser/compare/v20.2.1...v20.2.2) (2020-10-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **exports:** node 13.0-13.6 require a string fallback ([#333](https://www.github.com/yargs/yargs-parser/issues/333)) ([291aeda](https://www.github.com/yargs/yargs-parser/commit/291aeda06b685b7a015d83bdf2558e180b37388d))
|
||||
|
||||
### [20.2.1](https://www.github.com/yargs/yargs-parser/compare/v20.2.0...v20.2.1) (2020-10-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deno:** update types for deno ^1.4.0 ([#330](https://www.github.com/yargs/yargs-parser/issues/330)) ([0ab92e5](https://www.github.com/yargs/yargs-parser/commit/0ab92e50b090f11196334c048c9c92cecaddaf56))
|
||||
|
||||
## [20.2.0](https://www.github.com/yargs/yargs-parser/compare/v20.1.0...v20.2.0) (2020-09-21)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **string-utils:** export looksLikeNumber helper ([#324](https://www.github.com/yargs/yargs-parser/issues/324)) ([c8580a2](https://www.github.com/yargs/yargs-parser/commit/c8580a2327b55f6342acecb6e72b62963d506750))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **unknown-options-as-args:** convert positionals that look like numbers ([#326](https://www.github.com/yargs/yargs-parser/issues/326)) ([f85ebb4](https://www.github.com/yargs/yargs-parser/commit/f85ebb4face9d4b0f56147659404cbe0002f3dad))
|
||||
|
||||
## [20.1.0](https://www.github.com/yargs/yargs-parser/compare/v20.0.0...v20.1.0) (2020-09-20)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* adds parse-positional-numbers configuration ([#321](https://www.github.com/yargs/yargs-parser/issues/321)) ([9cec00a](https://www.github.com/yargs/yargs-parser/commit/9cec00a622251292ffb7dce6f78f5353afaa0d4c))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **build:** update release-please; make labels kick off builds ([#323](https://www.github.com/yargs/yargs-parser/issues/323)) ([09f448b](https://www.github.com/yargs/yargs-parser/commit/09f448b4cd66e25d2872544718df46dab8af062a))
|
||||
|
||||
## [20.0.0](https://www.github.com/yargs/yargs-parser/compare/v19.0.4...v20.0.0) (2020-09-09)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* do not ship type definitions (#318)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* only strip camel case if hyphenated ([#316](https://www.github.com/yargs/yargs-parser/issues/316)) ([95a9e78](https://www.github.com/yargs/yargs-parser/commit/95a9e785127b9bbf2d1db1f1f808ca1fb100e82a)), closes [#315](https://www.github.com/yargs/yargs-parser/issues/315)
|
||||
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
* do not ship type definitions ([#318](https://www.github.com/yargs/yargs-parser/issues/318)) ([8fbd56f](https://www.github.com/yargs/yargs-parser/commit/8fbd56f1d0b6c44c30fca62708812151ca0ce330))
|
||||
|
||||
### [19.0.4](https://www.github.com/yargs/yargs-parser/compare/v19.0.3...v19.0.4) (2020-08-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **build:** fixing publication ([#310](https://www.github.com/yargs/yargs-parser/issues/310)) ([5d3c6c2](https://www.github.com/yargs/yargs-parser/commit/5d3c6c29a9126248ba601920d9cf87c78e161ff5))
|
||||
|
||||
### [19.0.3](https://www.github.com/yargs/yargs-parser/compare/v19.0.2...v19.0.3) (2020-08-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **build:** switch to action for publish ([#308](https://www.github.com/yargs/yargs-parser/issues/308)) ([5c2f305](https://www.github.com/yargs/yargs-parser/commit/5c2f30585342bcd8aaf926407c863099d256d174))
|
||||
|
||||
### [19.0.2](https://www.github.com/yargs/yargs-parser/compare/v19.0.1...v19.0.2) (2020-08-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **types:** envPrefix should be optional ([#305](https://www.github.com/yargs/yargs-parser/issues/305)) ([ae3f180](https://www.github.com/yargs/yargs-parser/commit/ae3f180e14df2de2fd962145f4518f9aa0e76523))
|
||||
|
||||
### [19.0.1](https://www.github.com/yargs/yargs-parser/compare/v19.0.0...v19.0.1) (2020-08-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **build:** push tag created for deno ([2186a14](https://www.github.com/yargs/yargs-parser/commit/2186a14989749887d56189867602e39e6679f8b0))
|
||||
|
||||
## [19.0.0](https://www.github.com/yargs/yargs-parser/compare/v18.1.3...v19.0.0) (2020-08-09)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* adds support for ESM and Deno (#295)
|
||||
* **ts:** projects using `@types/yargs-parser` may see variations in type definitions.
|
||||
* drops Node 6. begin following Node.js LTS schedule (#278)
|
||||
|
||||
### Features
|
||||
|
||||
* adds support for ESM and Deno ([#295](https://www.github.com/yargs/yargs-parser/issues/295)) ([195bc4a](https://www.github.com/yargs/yargs-parser/commit/195bc4a7f20c2a8f8e33fbb6ba96ef6e9a0120a1))
|
||||
* expose camelCase and decamelize helpers ([#296](https://www.github.com/yargs/yargs-parser/issues/296)) ([39154ce](https://www.github.com/yargs/yargs-parser/commit/39154ceb5bdcf76b5f59a9219b34cedb79b67f26))
|
||||
* **deps:** update to latest camelcase/decamelize ([#281](https://www.github.com/yargs/yargs-parser/issues/281)) ([8931ab0](https://www.github.com/yargs/yargs-parser/commit/8931ab08f686cc55286f33a95a83537da2be5516))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* boolean numeric short option ([#294](https://www.github.com/yargs/yargs-parser/issues/294)) ([f600082](https://www.github.com/yargs/yargs-parser/commit/f600082c959e092076caf420bbbc9d7a231e2418))
|
||||
* raise permission error for Deno if config load fails ([#298](https://www.github.com/yargs/yargs-parser/issues/298)) ([1174e2b](https://www.github.com/yargs/yargs-parser/commit/1174e2b3f0c845a1cd64e14ffc3703e730567a84))
|
||||
* **deps:** update dependency decamelize to v3 ([#274](https://www.github.com/yargs/yargs-parser/issues/274)) ([4d98698](https://www.github.com/yargs/yargs-parser/commit/4d98698bc6767e84ec54a0842908191739be73b7))
|
||||
* **types:** switch back to using Partial types ([#293](https://www.github.com/yargs/yargs-parser/issues/293)) ([bdc80ba](https://www.github.com/yargs/yargs-parser/commit/bdc80ba59fa13bc3025ce0a85e8bad9f9da24ea7))
|
||||
|
||||
|
||||
### Build System
|
||||
|
||||
* drops Node 6. begin following Node.js LTS schedule ([#278](https://www.github.com/yargs/yargs-parser/issues/278)) ([9014ed7](https://www.github.com/yargs/yargs-parser/commit/9014ed722a32768b96b829e65a31705db5c1458a))
|
||||
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
* **ts:** move index.js to TypeScript ([#292](https://www.github.com/yargs/yargs-parser/issues/292)) ([f78d2b9](https://www.github.com/yargs/yargs-parser/commit/f78d2b97567ac4828624406e420b4047c710b789))
|
||||
|
||||
### [18.1.3](https://www.github.com/yargs/yargs-parser/compare/v18.1.2...v18.1.3) (2020-04-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **setArg:** options using camel-case and dot-notation populated twice ([#268](https://www.github.com/yargs/yargs-parser/issues/268)) ([f7e15b9](https://www.github.com/yargs/yargs-parser/commit/f7e15b9800900b9856acac1a830a5f35847be73e))
|
||||
|
||||
### [18.1.2](https://www.github.com/yargs/yargs-parser/compare/v18.1.1...v18.1.2) (2020-03-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **array, nargs:** support -o=--value and --option=--value format ([#262](https://www.github.com/yargs/yargs-parser/issues/262)) ([41d3f81](https://www.github.com/yargs/yargs-parser/commit/41d3f8139e116706b28de9b0de3433feb08d2f13))
|
||||
|
||||
### [18.1.1](https://www.github.com/yargs/yargs-parser/compare/v18.1.0...v18.1.1) (2020-03-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* \_\_proto\_\_ will now be replaced with \_\_\_proto\_\_\_ in parse ([#258](https://www.github.com/yargs/yargs-parser/issues/258)), patching a potential
|
||||
prototype pollution vulnerability. This was reported by the Snyk Security Research Team.([63810ca](https://www.github.com/yargs/yargs-parser/commit/63810ca1ae1a24b08293a4d971e70e058c7a41e2))
|
||||
|
||||
## [18.1.0](https://www.github.com/yargs/yargs-parser/compare/v18.0.0...v18.1.0) (2020-03-07)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* introduce single-digit boolean aliases ([#255](https://www.github.com/yargs/yargs-parser/issues/255)) ([9c60265](https://www.github.com/yargs/yargs-parser/commit/9c60265fd7a03cb98e6df3e32c8c5e7508d9f56f))
|
||||
|
||||
## [18.0.0](https://www.github.com/yargs/yargs-parser/compare/v17.1.0...v18.0.0) (2020-03-02)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* the narg count is now enforced when parsing arrays.
|
||||
|
||||
### Features
|
||||
|
||||
* NaN can now be provided as a value for nargs, indicating "at least" one value is expected for array ([#251](https://www.github.com/yargs/yargs-parser/issues/251)) ([9db4be8](https://www.github.com/yargs/yargs-parser/commit/9db4be81417a2c7097128db34d86fe70ef4af70c))
|
||||
|
||||
## [17.1.0](https://www.github.com/yargs/yargs-parser/compare/v17.0.1...v17.1.0) (2020-03-01)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* introduce greedy-arrays config, for specifying whether arrays consume multiple positionals ([#249](https://www.github.com/yargs/yargs-parser/issues/249)) ([60e880a](https://www.github.com/yargs/yargs-parser/commit/60e880a837046314d89fa4725f923837fd33a9eb))
|
||||
|
||||
### [17.0.1](https://www.github.com/yargs/yargs-parser/compare/v17.0.0...v17.0.1) (2020-02-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* normalized keys were not enumerable ([#247](https://www.github.com/yargs/yargs-parser/issues/247)) ([57119f9](https://www.github.com/yargs/yargs-parser/commit/57119f9f17cf27499bd95e61c2f72d18314f11ba))
|
||||
|
||||
## [17.0.0](https://www.github.com/yargs/yargs-parser/compare/v16.1.0...v17.0.0) (2020-02-10)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* this reverts parsing behavior of booleans to that of yargs@14
|
||||
* objects used during parsing are now created with a null
|
||||
prototype. There may be some scenarios where this change in behavior
|
||||
leaks externally.
|
||||
|
||||
### Features
|
||||
|
||||
* boolean arguments will not be collected into an implicit array ([#236](https://www.github.com/yargs/yargs-parser/issues/236)) ([34c4e19](https://www.github.com/yargs/yargs-parser/commit/34c4e19bae4e7af63e3cb6fa654a97ed476e5eb5))
|
||||
* introduce nargs-eats-options config option ([#246](https://www.github.com/yargs/yargs-parser/issues/246)) ([d50822a](https://www.github.com/yargs/yargs-parser/commit/d50822ac10e1b05f2e9643671ca131ac251b6732))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* address bugs with "uknown-options-as-args" ([bc023e3](https://www.github.com/yargs/yargs-parser/commit/bc023e3b13e20a118353f9507d1c999bf388a346))
|
||||
* array should take precedence over nargs, but enforce nargs ([#243](https://www.github.com/yargs/yargs-parser/issues/243)) ([4cbc188](https://www.github.com/yargs/yargs-parser/commit/4cbc188b7abb2249529a19c090338debdad2fe6c))
|
||||
* support keys that collide with object prototypes ([#234](https://www.github.com/yargs/yargs-parser/issues/234)) ([1587b6d](https://www.github.com/yargs/yargs-parser/commit/1587b6d91db853a9109f1be6b209077993fee4de))
|
||||
* unknown options terminated with digits now handled by unknown-options-as-args ([#238](https://www.github.com/yargs/yargs-parser/issues/238)) ([d36cdfa](https://www.github.com/yargs/yargs-parser/commit/d36cdfa854254d7c7e0fe1d583818332ac46c2a5))
|
||||
|
||||
## [16.1.0](https://www.github.com/yargs/yargs-parser/compare/v16.0.0...v16.1.0) (2019-11-01)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* populate error if incompatible narg/count or array/count options are used (#191)
|
||||
|
||||
### Features
|
||||
|
||||
* options that have had their default value used are now tracked ([#211](https://www.github.com/yargs/yargs-parser/issues/211)) ([a525234](https://www.github.com/yargs/yargs-parser/commit/a525234558c847deedd73f8792e0a3b77b26e2c0))
|
||||
* populate error if incompatible narg/count or array/count options are used ([#191](https://www.github.com/yargs/yargs-parser/issues/191)) ([84a401f](https://www.github.com/yargs/yargs-parser/commit/84a401f0fa3095e0a19661670d1570d0c3b9d3c9))
|
||||
|
||||
|
||||
### Reverts
|
||||
|
||||
* revert 16.0.0 CHANGELOG entry ([920320a](https://www.github.com/yargs/yargs-parser/commit/920320ad9861bbfd58eda39221ae211540fc1daf))
|
14
backend/node_modules/postcss-cli/node_modules/yargs-parser/LICENSE.txt
generated
vendored
Normal file
14
backend/node_modules/postcss-cli/node_modules/yargs-parser/LICENSE.txt
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
Copyright (c) 2016, Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software
|
||||
for any purpose with or without fee is hereby granted, provided
|
||||
that the above copyright notice and this permission notice
|
||||
appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
|
||||
LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
|
||||
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
518
backend/node_modules/postcss-cli/node_modules/yargs-parser/README.md
generated
vendored
Normal file
518
backend/node_modules/postcss-cli/node_modules/yargs-parser/README.md
generated
vendored
Normal file
@@ -0,0 +1,518 @@
|
||||
# yargs-parser
|
||||
|
||||

|
||||
[](https://www.npmjs.com/package/yargs-parser)
|
||||
[](https://conventionalcommits.org)
|
||||

|
||||
|
||||
The mighty option parser used by [yargs](https://github.com/yargs/yargs).
|
||||
|
||||
visit the [yargs website](http://yargs.js.org/) for more examples, and thorough usage instructions.
|
||||
|
||||
<img width="250" src="https://raw.githubusercontent.com/yargs/yargs-parser/main/yargs-logo.png">
|
||||
|
||||
## Example
|
||||
|
||||
```sh
|
||||
npm i yargs-parser --save
|
||||
```
|
||||
|
||||
```js
|
||||
const argv = require('yargs-parser')(process.argv.slice(2))
|
||||
console.log(argv)
|
||||
```
|
||||
|
||||
```console
|
||||
$ node example.js --foo=33 --bar hello
|
||||
{ _: [], foo: 33, bar: 'hello' }
|
||||
```
|
||||
|
||||
_or parse a string!_
|
||||
|
||||
```js
|
||||
const argv = require('yargs-parser')('--foo=99 --bar=33')
|
||||
console.log(argv)
|
||||
```
|
||||
|
||||
```console
|
||||
{ _: [], foo: 99, bar: 33 }
|
||||
```
|
||||
|
||||
Convert an array of mixed types before passing to `yargs-parser`:
|
||||
|
||||
```js
|
||||
const parse = require('yargs-parser')
|
||||
parse(['-f', 11, '--zoom', 55].join(' ')) // <-- array to string
|
||||
parse(['-f', 11, '--zoom', 55].map(String)) // <-- array of strings
|
||||
```
|
||||
|
||||
## Deno Example
|
||||
|
||||
As of `v19` `yargs-parser` supports [Deno](https://github.com/denoland/deno):
|
||||
|
||||
```typescript
|
||||
import parser from "https://deno.land/x/yargs_parser/deno.ts";
|
||||
|
||||
const argv = parser('--foo=99 --bar=9987930', {
|
||||
string: ['bar']
|
||||
})
|
||||
console.log(argv)
|
||||
```
|
||||
|
||||
## ESM Example
|
||||
|
||||
As of `v19` `yargs-parser` supports ESM (_both in Node.js and in the browser_):
|
||||
|
||||
**Node.js:**
|
||||
|
||||
```js
|
||||
import parser from 'yargs-parser'
|
||||
|
||||
const argv = parser('--foo=99 --bar=9987930', {
|
||||
string: ['bar']
|
||||
})
|
||||
console.log(argv)
|
||||
```
|
||||
|
||||
**Browsers:**
|
||||
|
||||
```html
|
||||
<!doctype html>
|
||||
<body>
|
||||
<script type="module">
|
||||
import parser from "https://unpkg.com/yargs-parser@19.0.0/browser.js";
|
||||
|
||||
const argv = parser('--foo=99 --bar=9987930', {
|
||||
string: ['bar']
|
||||
})
|
||||
console.log(argv)
|
||||
</script>
|
||||
</body>
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### parser(args, opts={})
|
||||
|
||||
Parses command line arguments returning a simple mapping of keys and values.
|
||||
|
||||
**expects:**
|
||||
|
||||
* `args`: a string or array of strings representing the options to parse.
|
||||
* `opts`: provide a set of hints indicating how `args` should be parsed:
|
||||
* `opts.alias`: an object representing the set of aliases for a key: `{alias: {foo: ['f']}}`.
|
||||
* `opts.array`: indicate that keys should be parsed as an array: `{array: ['foo', 'bar']}`.<br>
|
||||
Indicate that keys should be parsed as an array and coerced to booleans / numbers:<br>
|
||||
`{array: [{ key: 'foo', boolean: true }, {key: 'bar', number: true}]}`.
|
||||
* `opts.boolean`: arguments should be parsed as booleans: `{boolean: ['x', 'y']}`.
|
||||
* `opts.coerce`: provide a custom synchronous function that returns a coerced value from the argument provided
|
||||
(or throws an error). For arrays the function is called only once for the entire array:<br>
|
||||
`{coerce: {foo: function (arg) {return modifiedArg}}}`.
|
||||
* `opts.config`: indicate a key that represents a path to a configuration file (this file will be loaded and parsed).
|
||||
* `opts.configObjects`: configuration objects to parse, their properties will be set as arguments:<br>
|
||||
`{configObjects: [{'x': 5, 'y': 33}, {'z': 44}]}`.
|
||||
* `opts.configuration`: provide configuration options to the yargs-parser (see: [configuration](#configuration)).
|
||||
* `opts.count`: indicate a key that should be used as a counter, e.g., `-vvv` = `{v: 3}`.
|
||||
* `opts.default`: provide default values for keys: `{default: {x: 33, y: 'hello world!'}}`.
|
||||
* `opts.envPrefix`: environment variables (`process.env`) with the prefix provided should be parsed.
|
||||
* `opts.narg`: specify that a key requires `n` arguments: `{narg: {x: 2}}`.
|
||||
* `opts.normalize`: `path.normalize()` will be applied to values set to this key.
|
||||
* `opts.number`: keys should be treated as numbers.
|
||||
* `opts.string`: keys should be treated as strings (even if they resemble a number `-x 33`).
|
||||
|
||||
**returns:**
|
||||
|
||||
* `obj`: an object representing the parsed value of `args`
|
||||
* `key/value`: key value pairs for each argument and their aliases.
|
||||
* `_`: an array representing the positional arguments.
|
||||
* [optional] `--`: an array with arguments after the end-of-options flag `--`.
|
||||
|
||||
### require('yargs-parser').detailed(args, opts={})
|
||||
|
||||
Parses a command line string, returning detailed information required by the
|
||||
yargs engine.
|
||||
|
||||
**expects:**
|
||||
|
||||
* `args`: a string or array of strings representing options to parse.
|
||||
* `opts`: provide a set of hints indicating how `args`, inputs are identical to `require('yargs-parser')(args, opts={})`.
|
||||
|
||||
**returns:**
|
||||
|
||||
* `argv`: an object representing the parsed value of `args`
|
||||
* `key/value`: key value pairs for each argument and their aliases.
|
||||
* `_`: an array representing the positional arguments.
|
||||
* [optional] `--`: an array with arguments after the end-of-options flag `--`.
|
||||
* `error`: populated with an error object if an exception occurred during parsing.
|
||||
* `aliases`: the inferred list of aliases built by combining lists in `opts.alias`.
|
||||
* `newAliases`: any new aliases added via camel-case expansion:
|
||||
* `boolean`: `{ fooBar: true }`
|
||||
* `defaulted`: any new argument created by `opts.default`, no aliases included.
|
||||
* `boolean`: `{ foo: true }`
|
||||
* `configuration`: given by default settings and `opts.configuration`.
|
||||
|
||||
<a name="configuration"></a>
|
||||
|
||||
### Configuration
|
||||
|
||||
The yargs-parser applies several automated transformations on the keys provided
|
||||
in `args`. These features can be turned on and off using the `configuration` field
|
||||
of `opts`.
|
||||
|
||||
```js
|
||||
var parsed = parser(['--no-dice'], {
|
||||
configuration: {
|
||||
'boolean-negation': false
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
### short option groups
|
||||
|
||||
* default: `true`.
|
||||
* key: `short-option-groups`.
|
||||
|
||||
Should a group of short-options be treated as boolean flags?
|
||||
|
||||
```console
|
||||
$ node example.js -abc
|
||||
{ _: [], a: true, b: true, c: true }
|
||||
```
|
||||
|
||||
_if disabled:_
|
||||
|
||||
```console
|
||||
$ node example.js -abc
|
||||
{ _: [], abc: true }
|
||||
```
|
||||
|
||||
### camel-case expansion
|
||||
|
||||
* default: `true`.
|
||||
* key: `camel-case-expansion`.
|
||||
|
||||
Should hyphenated arguments be expanded into camel-case aliases?
|
||||
|
||||
```console
|
||||
$ node example.js --foo-bar
|
||||
{ _: [], 'foo-bar': true, fooBar: true }
|
||||
```
|
||||
|
||||
_if disabled:_
|
||||
|
||||
```console
|
||||
$ node example.js --foo-bar
|
||||
{ _: [], 'foo-bar': true }
|
||||
```
|
||||
|
||||
### dot-notation
|
||||
|
||||
* default: `true`
|
||||
* key: `dot-notation`
|
||||
|
||||
Should keys that contain `.` be treated as objects?
|
||||
|
||||
```console
|
||||
$ node example.js --foo.bar
|
||||
{ _: [], foo: { bar: true } }
|
||||
```
|
||||
|
||||
_if disabled:_
|
||||
|
||||
```console
|
||||
$ node example.js --foo.bar
|
||||
{ _: [], "foo.bar": true }
|
||||
```
|
||||
|
||||
### parse numbers
|
||||
|
||||
* default: `true`
|
||||
* key: `parse-numbers`
|
||||
|
||||
Should keys that look like numbers be treated as such?
|
||||
|
||||
```console
|
||||
$ node example.js --foo=99.3
|
||||
{ _: [], foo: 99.3 }
|
||||
```
|
||||
|
||||
_if disabled:_
|
||||
|
||||
```console
|
||||
$ node example.js --foo=99.3
|
||||
{ _: [], foo: "99.3" }
|
||||
```
|
||||
|
||||
### parse positional numbers
|
||||
|
||||
* default: `true`
|
||||
* key: `parse-positional-numbers`
|
||||
|
||||
Should positional keys that look like numbers be treated as such.
|
||||
|
||||
```console
|
||||
$ node example.js 99.3
|
||||
{ _: [99.3] }
|
||||
```
|
||||
|
||||
_if disabled:_
|
||||
|
||||
```console
|
||||
$ node example.js 99.3
|
||||
{ _: ['99.3'] }
|
||||
```
|
||||
|
||||
### boolean negation
|
||||
|
||||
* default: `true`
|
||||
* key: `boolean-negation`
|
||||
|
||||
Should variables prefixed with `--no` be treated as negations?
|
||||
|
||||
```console
|
||||
$ node example.js --no-foo
|
||||
{ _: [], foo: false }
|
||||
```
|
||||
|
||||
_if disabled:_
|
||||
|
||||
```console
|
||||
$ node example.js --no-foo
|
||||
{ _: [], "no-foo": true }
|
||||
```
|
||||
|
||||
### combine arrays
|
||||
|
||||
* default: `false`
|
||||
* key: `combine-arrays`
|
||||
|
||||
Should arrays be combined when provided by both command line arguments and
|
||||
a configuration file.
|
||||
|
||||
### duplicate arguments array
|
||||
|
||||
* default: `true`
|
||||
* key: `duplicate-arguments-array`
|
||||
|
||||
Should arguments be coerced into an array when duplicated:
|
||||
|
||||
```console
|
||||
$ node example.js -x 1 -x 2
|
||||
{ _: [], x: [1, 2] }
|
||||
```
|
||||
|
||||
_if disabled:_
|
||||
|
||||
```console
|
||||
$ node example.js -x 1 -x 2
|
||||
{ _: [], x: 2 }
|
||||
```
|
||||
|
||||
### flatten duplicate arrays
|
||||
|
||||
* default: `true`
|
||||
* key: `flatten-duplicate-arrays`
|
||||
|
||||
Should array arguments be coerced into a single array when duplicated:
|
||||
|
||||
```console
|
||||
$ node example.js -x 1 2 -x 3 4
|
||||
{ _: [], x: [1, 2, 3, 4] }
|
||||
```
|
||||
|
||||
_if disabled:_
|
||||
|
||||
```console
|
||||
$ node example.js -x 1 2 -x 3 4
|
||||
{ _: [], x: [[1, 2], [3, 4]] }
|
||||
```
|
||||
|
||||
### greedy arrays
|
||||
|
||||
* default: `true`
|
||||
* key: `greedy-arrays`
|
||||
|
||||
Should arrays consume more than one positional argument following their flag.
|
||||
|
||||
```console
|
||||
$ node example --arr 1 2
|
||||
{ _: [], arr: [1, 2] }
|
||||
```
|
||||
|
||||
_if disabled:_
|
||||
|
||||
```console
|
||||
$ node example --arr 1 2
|
||||
{ _: [2], arr: [1] }
|
||||
```
|
||||
|
||||
**Note: in `v18.0.0` we are considering defaulting greedy arrays to `false`.**
|
||||
|
||||
### nargs eats options
|
||||
|
||||
* default: `false`
|
||||
* key: `nargs-eats-options`
|
||||
|
||||
Should nargs consume dash options as well as positional arguments.
|
||||
|
||||
### negation prefix
|
||||
|
||||
* default: `no-`
|
||||
* key: `negation-prefix`
|
||||
|
||||
The prefix to use for negated boolean variables.
|
||||
|
||||
```console
|
||||
$ node example.js --no-foo
|
||||
{ _: [], foo: false }
|
||||
```
|
||||
|
||||
_if set to `quux`:_
|
||||
|
||||
```console
|
||||
$ node example.js --quuxfoo
|
||||
{ _: [], foo: false }
|
||||
```
|
||||
|
||||
### populate --
|
||||
|
||||
* default: `false`.
|
||||
* key: `populate--`
|
||||
|
||||
Should unparsed flags be stored in `--` or `_`.
|
||||
|
||||
_If disabled:_
|
||||
|
||||
```console
|
||||
$ node example.js a -b -- x y
|
||||
{ _: [ 'a', 'x', 'y' ], b: true }
|
||||
```
|
||||
|
||||
_If enabled:_
|
||||
|
||||
```console
|
||||
$ node example.js a -b -- x y
|
||||
{ _: [ 'a' ], '--': [ 'x', 'y' ], b: true }
|
||||
```
|
||||
|
||||
### set placeholder key
|
||||
|
||||
* default: `false`.
|
||||
* key: `set-placeholder-key`.
|
||||
|
||||
Should a placeholder be added for keys not set via the corresponding CLI argument?
|
||||
|
||||
_If disabled:_
|
||||
|
||||
```console
|
||||
$ node example.js -a 1 -c 2
|
||||
{ _: [], a: 1, c: 2 }
|
||||
```
|
||||
|
||||
_If enabled:_
|
||||
|
||||
```console
|
||||
$ node example.js -a 1 -c 2
|
||||
{ _: [], a: 1, b: undefined, c: 2 }
|
||||
```
|
||||
|
||||
### halt at non-option
|
||||
|
||||
* default: `false`.
|
||||
* key: `halt-at-non-option`.
|
||||
|
||||
Should parsing stop at the first positional argument? This is similar to how e.g. `ssh` parses its command line.
|
||||
|
||||
_If disabled:_
|
||||
|
||||
```console
|
||||
$ node example.js -a run b -x y
|
||||
{ _: [ 'b' ], a: 'run', x: 'y' }
|
||||
```
|
||||
|
||||
_If enabled:_
|
||||
|
||||
```console
|
||||
$ node example.js -a run b -x y
|
||||
{ _: [ 'b', '-x', 'y' ], a: 'run' }
|
||||
```
|
||||
|
||||
### strip aliased
|
||||
|
||||
* default: `false`
|
||||
* key: `strip-aliased`
|
||||
|
||||
Should aliases be removed before returning results?
|
||||
|
||||
_If disabled:_
|
||||
|
||||
```console
|
||||
$ node example.js --test-field 1
|
||||
{ _: [], 'test-field': 1, testField: 1, 'test-alias': 1, testAlias: 1 }
|
||||
```
|
||||
|
||||
_If enabled:_
|
||||
|
||||
```console
|
||||
$ node example.js --test-field 1
|
||||
{ _: [], 'test-field': 1, testField: 1 }
|
||||
```
|
||||
|
||||
### strip dashed
|
||||
|
||||
* default: `false`
|
||||
* key: `strip-dashed`
|
||||
|
||||
Should dashed keys be removed before returning results? This option has no effect if
|
||||
`camel-case-expansion` is disabled.
|
||||
|
||||
_If disabled:_
|
||||
|
||||
```console
|
||||
$ node example.js --test-field 1
|
||||
{ _: [], 'test-field': 1, testField: 1 }
|
||||
```
|
||||
|
||||
_If enabled:_
|
||||
|
||||
```console
|
||||
$ node example.js --test-field 1
|
||||
{ _: [], testField: 1 }
|
||||
```
|
||||
|
||||
### unknown options as args
|
||||
|
||||
* default: `false`
|
||||
* key: `unknown-options-as-args`
|
||||
|
||||
Should unknown options be treated like regular arguments? An unknown option is one that is not
|
||||
configured in `opts`.
|
||||
|
||||
_If disabled_
|
||||
|
||||
```console
|
||||
$ node example.js --unknown-option --known-option 2 --string-option --unknown-option2
|
||||
{ _: [], unknownOption: true, knownOption: 2, stringOption: '', unknownOption2: true }
|
||||
```
|
||||
|
||||
_If enabled_
|
||||
|
||||
```console
|
||||
$ node example.js --unknown-option --known-option 2 --string-option --unknown-option2
|
||||
{ _: ['--unknown-option'], knownOption: 2, stringOption: '--unknown-option2' }
|
||||
```
|
||||
|
||||
## Supported Node.js Versions
|
||||
|
||||
Libraries in this ecosystem make a best effort to track
|
||||
[Node.js' release schedule](https://nodejs.org/en/about/releases/). Here's [a
|
||||
post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a).
|
||||
|
||||
## Special Thanks
|
||||
|
||||
The yargs project evolves from optimist and minimist. It owes its
|
||||
existence to a lot of James Halliday's hard work. Thanks [substack](https://github.com/substack) **beep** **boop** \o/
|
||||
|
||||
## License
|
||||
|
||||
ISC
|
29
backend/node_modules/postcss-cli/node_modules/yargs-parser/browser.js
generated
vendored
Normal file
29
backend/node_modules/postcss-cli/node_modules/yargs-parser/browser.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
// Main entrypoint for ESM web browser environments. Avoids using Node.js
|
||||
// specific libraries, such as "path".
|
||||
//
|
||||
// TODO: figure out reasonable web equivalents for "resolve", "normalize", etc.
|
||||
import { camelCase, decamelize, looksLikeNumber } from './build/lib/string-utils.js'
|
||||
import { YargsParser } from './build/lib/yargs-parser.js'
|
||||
const parser = new YargsParser({
|
||||
cwd: () => { return '' },
|
||||
format: (str, arg) => { return str.replace('%s', arg) },
|
||||
normalize: (str) => { return str },
|
||||
resolve: (str) => { return str },
|
||||
require: () => {
|
||||
throw Error('loading config from files not currently supported in browser')
|
||||
},
|
||||
env: () => {}
|
||||
})
|
||||
|
||||
const yargsParser = function Parser (args, opts) {
|
||||
const result = parser.parse(args.slice(), opts)
|
||||
return result.argv
|
||||
}
|
||||
yargsParser.detailed = function (args, opts) {
|
||||
return parser.parse(args.slice(), opts)
|
||||
}
|
||||
yargsParser.camelCase = camelCase
|
||||
yargsParser.decamelize = decamelize
|
||||
yargsParser.looksLikeNumber = looksLikeNumber
|
||||
|
||||
export default yargsParser
|
1050
backend/node_modules/postcss-cli/node_modules/yargs-parser/build/index.cjs
generated
vendored
Normal file
1050
backend/node_modules/postcss-cli/node_modules/yargs-parser/build/index.cjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
62
backend/node_modules/postcss-cli/node_modules/yargs-parser/build/lib/index.js
generated
vendored
Normal file
62
backend/node_modules/postcss-cli/node_modules/yargs-parser/build/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
/**
|
||||
* @fileoverview Main entrypoint for libraries using yargs-parser in Node.js
|
||||
* CJS and ESM environments.
|
||||
*
|
||||
* @license
|
||||
* Copyright (c) 2016, Contributors
|
||||
* SPDX-License-Identifier: ISC
|
||||
*/
|
||||
var _a, _b, _c;
|
||||
import { format } from 'util';
|
||||
import { normalize, resolve } from 'path';
|
||||
import { camelCase, decamelize, looksLikeNumber } from './string-utils.js';
|
||||
import { YargsParser } from './yargs-parser.js';
|
||||
import { readFileSync } from 'fs';
|
||||
// See https://github.com/yargs/yargs-parser#supported-nodejs-versions for our
|
||||
// version support policy. The YARGS_MIN_NODE_VERSION is used for testing only.
|
||||
const minNodeVersion = (process && process.env && process.env.YARGS_MIN_NODE_VERSION)
|
||||
? Number(process.env.YARGS_MIN_NODE_VERSION)
|
||||
: 12;
|
||||
const nodeVersion = (_b = (_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node) !== null && _b !== void 0 ? _b : (_c = process === null || process === void 0 ? void 0 : process.version) === null || _c === void 0 ? void 0 : _c.slice(1);
|
||||
if (nodeVersion) {
|
||||
const major = Number(nodeVersion.match(/^([^.]+)/)[1]);
|
||||
if (major < minNodeVersion) {
|
||||
throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);
|
||||
}
|
||||
}
|
||||
// Creates a yargs-parser instance using Node.js standard libraries:
|
||||
const env = process ? process.env : {};
|
||||
const parser = new YargsParser({
|
||||
cwd: process.cwd,
|
||||
env: () => {
|
||||
return env;
|
||||
},
|
||||
format,
|
||||
normalize,
|
||||
resolve,
|
||||
// TODO: figure out a way to combine ESM and CJS coverage, such that
|
||||
// we can exercise all the lines below:
|
||||
require: (path) => {
|
||||
if (typeof require !== 'undefined') {
|
||||
return require(path);
|
||||
}
|
||||
else if (path.match(/\.json$/)) {
|
||||
// Addresses: https://github.com/yargs/yargs/issues/2040
|
||||
return JSON.parse(readFileSync(path, 'utf8'));
|
||||
}
|
||||
else {
|
||||
throw Error('only .json config files are supported in ESM');
|
||||
}
|
||||
}
|
||||
});
|
||||
const yargsParser = function Parser(args, opts) {
|
||||
const result = parser.parse(args.slice(), opts);
|
||||
return result.argv;
|
||||
};
|
||||
yargsParser.detailed = function (args, opts) {
|
||||
return parser.parse(args.slice(), opts);
|
||||
};
|
||||
yargsParser.camelCase = camelCase;
|
||||
yargsParser.decamelize = decamelize;
|
||||
yargsParser.looksLikeNumber = looksLikeNumber;
|
||||
export default yargsParser;
|
65
backend/node_modules/postcss-cli/node_modules/yargs-parser/build/lib/string-utils.js
generated
vendored
Normal file
65
backend/node_modules/postcss-cli/node_modules/yargs-parser/build/lib/string-utils.js
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2016, Contributors
|
||||
* SPDX-License-Identifier: ISC
|
||||
*/
|
||||
export function camelCase(str) {
|
||||
// Handle the case where an argument is provided as camel case, e.g., fooBar.
|
||||
// by ensuring that the string isn't already mixed case:
|
||||
const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase();
|
||||
if (!isCamelCase) {
|
||||
str = str.toLowerCase();
|
||||
}
|
||||
if (str.indexOf('-') === -1 && str.indexOf('_') === -1) {
|
||||
return str;
|
||||
}
|
||||
else {
|
||||
let camelcase = '';
|
||||
let nextChrUpper = false;
|
||||
const leadingHyphens = str.match(/^-+/);
|
||||
for (let i = leadingHyphens ? leadingHyphens[0].length : 0; i < str.length; i++) {
|
||||
let chr = str.charAt(i);
|
||||
if (nextChrUpper) {
|
||||
nextChrUpper = false;
|
||||
chr = chr.toUpperCase();
|
||||
}
|
||||
if (i !== 0 && (chr === '-' || chr === '_')) {
|
||||
nextChrUpper = true;
|
||||
}
|
||||
else if (chr !== '-' && chr !== '_') {
|
||||
camelcase += chr;
|
||||
}
|
||||
}
|
||||
return camelcase;
|
||||
}
|
||||
}
|
||||
export function decamelize(str, joinString) {
|
||||
const lowercase = str.toLowerCase();
|
||||
joinString = joinString || '-';
|
||||
let notCamelcase = '';
|
||||
for (let i = 0; i < str.length; i++) {
|
||||
const chrLower = lowercase.charAt(i);
|
||||
const chrString = str.charAt(i);
|
||||
if (chrLower !== chrString && i > 0) {
|
||||
notCamelcase += `${joinString}${lowercase.charAt(i)}`;
|
||||
}
|
||||
else {
|
||||
notCamelcase += chrString;
|
||||
}
|
||||
}
|
||||
return notCamelcase;
|
||||
}
|
||||
export function looksLikeNumber(x) {
|
||||
if (x === null || x === undefined)
|
||||
return false;
|
||||
// if loaded from config, may already be a number.
|
||||
if (typeof x === 'number')
|
||||
return true;
|
||||
// hexadecimal.
|
||||
if (/^0x[0-9a-f]+$/i.test(x))
|
||||
return true;
|
||||
// don't treat 0123 as a number; as it drops the leading '0'.
|
||||
if (/^0[^.]/.test(x))
|
||||
return false;
|
||||
return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
|
||||
}
|
40
backend/node_modules/postcss-cli/node_modules/yargs-parser/build/lib/tokenize-arg-string.js
generated
vendored
Normal file
40
backend/node_modules/postcss-cli/node_modules/yargs-parser/build/lib/tokenize-arg-string.js
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2016, Contributors
|
||||
* SPDX-License-Identifier: ISC
|
||||
*/
|
||||
// take an un-split argv string and tokenize it.
|
||||
export function tokenizeArgString(argString) {
|
||||
if (Array.isArray(argString)) {
|
||||
return argString.map(e => typeof e !== 'string' ? e + '' : e);
|
||||
}
|
||||
argString = argString.trim();
|
||||
let i = 0;
|
||||
let prevC = null;
|
||||
let c = null;
|
||||
let opening = null;
|
||||
const args = [];
|
||||
for (let ii = 0; ii < argString.length; ii++) {
|
||||
prevC = c;
|
||||
c = argString.charAt(ii);
|
||||
// split on spaces unless we're in quotes.
|
||||
if (c === ' ' && !opening) {
|
||||
if (!(prevC === ' ')) {
|
||||
i++;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
// don't split the string if we're in matching
|
||||
// opening or closing single and double quotes.
|
||||
if (c === opening) {
|
||||
opening = null;
|
||||
}
|
||||
else if ((c === "'" || c === '"') && !opening) {
|
||||
opening = c;
|
||||
}
|
||||
if (!args[i])
|
||||
args[i] = '';
|
||||
args[i] += c;
|
||||
}
|
||||
return args;
|
||||
}
|
12
backend/node_modules/postcss-cli/node_modules/yargs-parser/build/lib/yargs-parser-types.js
generated
vendored
Normal file
12
backend/node_modules/postcss-cli/node_modules/yargs-parser/build/lib/yargs-parser-types.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2016, Contributors
|
||||
* SPDX-License-Identifier: ISC
|
||||
*/
|
||||
export var DefaultValuesForTypeKey;
|
||||
(function (DefaultValuesForTypeKey) {
|
||||
DefaultValuesForTypeKey["BOOLEAN"] = "boolean";
|
||||
DefaultValuesForTypeKey["STRING"] = "string";
|
||||
DefaultValuesForTypeKey["NUMBER"] = "number";
|
||||
DefaultValuesForTypeKey["ARRAY"] = "array";
|
||||
})(DefaultValuesForTypeKey || (DefaultValuesForTypeKey = {}));
|
1045
backend/node_modules/postcss-cli/node_modules/yargs-parser/build/lib/yargs-parser.js
generated
vendored
Normal file
1045
backend/node_modules/postcss-cli/node_modules/yargs-parser/build/lib/yargs-parser.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
92
backend/node_modules/postcss-cli/node_modules/yargs-parser/package.json
generated
vendored
Normal file
92
backend/node_modules/postcss-cli/node_modules/yargs-parser/package.json
generated
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
{
|
||||
"name": "yargs-parser",
|
||||
"version": "21.1.1",
|
||||
"description": "the mighty option parser used by yargs",
|
||||
"main": "build/index.cjs",
|
||||
"exports": {
|
||||
".": [
|
||||
{
|
||||
"import": "./build/lib/index.js",
|
||||
"require": "./build/index.cjs"
|
||||
},
|
||||
"./build/index.cjs"
|
||||
],
|
||||
"./browser": [
|
||||
"./browser.js"
|
||||
]
|
||||
},
|
||||
"type": "module",
|
||||
"module": "./build/lib/index.js",
|
||||
"scripts": {
|
||||
"check": "standardx '**/*.ts' && standardx '**/*.js' && standardx '**/*.cjs'",
|
||||
"fix": "standardx --fix '**/*.ts' && standardx --fix '**/*.js' && standardx --fix '**/*.cjs'",
|
||||
"pretest": "rimraf build && tsc -p tsconfig.test.json && cross-env NODE_ENV=test npm run build:cjs",
|
||||
"test": "c8 --reporter=text --reporter=html mocha test/*.cjs",
|
||||
"test:esm": "c8 --reporter=text --reporter=html mocha test/*.mjs",
|
||||
"test:browser": "start-server-and-test 'serve ./ -p 8080' http://127.0.0.1:8080/package.json 'node ./test/browser/yargs-test.cjs'",
|
||||
"pretest:typescript": "npm run pretest",
|
||||
"test:typescript": "c8 mocha ./build/test/typescript/*.js",
|
||||
"coverage": "c8 report --check-coverage",
|
||||
"precompile": "rimraf build",
|
||||
"compile": "tsc",
|
||||
"postcompile": "npm run build:cjs",
|
||||
"build:cjs": "rollup -c",
|
||||
"prepare": "npm run compile"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/yargs/yargs-parser.git"
|
||||
},
|
||||
"keywords": [
|
||||
"argument",
|
||||
"parser",
|
||||
"yargs",
|
||||
"command",
|
||||
"cli",
|
||||
"parsing",
|
||||
"option",
|
||||
"args",
|
||||
"argument"
|
||||
],
|
||||
"author": "Ben Coe <ben@npmjs.com>",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@types/chai": "^4.2.11",
|
||||
"@types/mocha": "^9.0.0",
|
||||
"@types/node": "^16.11.4",
|
||||
"@typescript-eslint/eslint-plugin": "^3.10.1",
|
||||
"@typescript-eslint/parser": "^3.10.1",
|
||||
"c8": "^7.3.0",
|
||||
"chai": "^4.2.0",
|
||||
"cross-env": "^7.0.2",
|
||||
"eslint": "^7.0.0",
|
||||
"eslint-plugin-import": "^2.20.1",
|
||||
"eslint-plugin-node": "^11.0.0",
|
||||
"gts": "^3.0.0",
|
||||
"mocha": "^10.0.0",
|
||||
"puppeteer": "^16.0.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"rollup": "^2.22.1",
|
||||
"rollup-plugin-cleanup": "^3.1.1",
|
||||
"rollup-plugin-ts": "^3.0.2",
|
||||
"serve": "^14.0.0",
|
||||
"standardx": "^7.0.0",
|
||||
"start-server-and-test": "^1.11.2",
|
||||
"ts-transform-default-export": "^1.0.2",
|
||||
"typescript": "^4.0.0"
|
||||
},
|
||||
"files": [
|
||||
"browser.js",
|
||||
"build",
|
||||
"!*.d.ts",
|
||||
"!*.d.cts"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"standardx": {
|
||||
"ignore": [
|
||||
"build"
|
||||
]
|
||||
}
|
||||
}
|
21
backend/node_modules/postcss-cli/node_modules/yargs/LICENSE
generated
vendored
Normal file
21
backend/node_modules/postcss-cli/node_modules/yargs/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright 2010 James Halliday (mail@substack.net); Modified work Copyright 2014 Contributors (ben@npmjs.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
204
backend/node_modules/postcss-cli/node_modules/yargs/README.md
generated
vendored
Normal file
204
backend/node_modules/postcss-cli/node_modules/yargs/README.md
generated
vendored
Normal file
@@ -0,0 +1,204 @@
|
||||
<p align="center">
|
||||
<img width="250" src="https://raw.githubusercontent.com/yargs/yargs/main/yargs-logo.png">
|
||||
</p>
|
||||
<h1 align="center"> Yargs </h1>
|
||||
<p align="center">
|
||||
<b >Yargs be a node.js library fer hearties tryin' ter parse optstrings</b>
|
||||
</p>
|
||||
|
||||
<br>
|
||||
|
||||

|
||||
[![NPM version][npm-image]][npm-url]
|
||||
[![js-standard-style][standard-image]][standard-url]
|
||||
[![Coverage][coverage-image]][coverage-url]
|
||||
[![Conventional Commits][conventional-commits-image]][conventional-commits-url]
|
||||
[![Slack][slack-image]][slack-url]
|
||||
|
||||
## Description
|
||||
Yargs helps you build interactive command line tools, by parsing arguments and generating an elegant user interface.
|
||||
|
||||
It gives you:
|
||||
|
||||
* commands and (grouped) options (`my-program.js serve --port=5000`).
|
||||
* a dynamically generated help menu based on your arguments:
|
||||
|
||||
```
|
||||
mocha [spec..]
|
||||
|
||||
Run tests with Mocha
|
||||
|
||||
Commands
|
||||
mocha inspect [spec..] Run tests with Mocha [default]
|
||||
mocha init <path> create a client-side Mocha setup at <path>
|
||||
|
||||
Rules & Behavior
|
||||
--allow-uncaught Allow uncaught errors to propagate [boolean]
|
||||
--async-only, -A Require all tests to use a callback (async) or
|
||||
return a Promise [boolean]
|
||||
```
|
||||
|
||||
* bash-completion shortcuts for commands and options.
|
||||
* and [tons more](/docs/api.md).
|
||||
|
||||
## Installation
|
||||
|
||||
Stable version:
|
||||
```bash
|
||||
npm i yargs
|
||||
```
|
||||
|
||||
Bleeding edge version with the most recent features:
|
||||
```bash
|
||||
npm i yargs@next
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Simple Example
|
||||
|
||||
```javascript
|
||||
#!/usr/bin/env node
|
||||
const yargs = require('yargs/yargs')
|
||||
const { hideBin } = require('yargs/helpers')
|
||||
const argv = yargs(hideBin(process.argv)).argv
|
||||
|
||||
if (argv.ships > 3 && argv.distance < 53.5) {
|
||||
console.log('Plunder more riffiwobbles!')
|
||||
} else {
|
||||
console.log('Retreat from the xupptumblers!')
|
||||
}
|
||||
```
|
||||
|
||||
```bash
|
||||
$ ./plunder.js --ships=4 --distance=22
|
||||
Plunder more riffiwobbles!
|
||||
|
||||
$ ./plunder.js --ships 12 --distance 98.7
|
||||
Retreat from the xupptumblers!
|
||||
```
|
||||
|
||||
> Note: `hideBin` is a shorthand for [`process.argv.slice(2)`](https://nodejs.org/en/knowledge/command-line/how-to-parse-command-line-arguments/). It has the benefit that it takes into account variations in some environments, e.g., [Electron](https://github.com/electron/electron/issues/4690).
|
||||
|
||||
### Complex Example
|
||||
|
||||
```javascript
|
||||
#!/usr/bin/env node
|
||||
const yargs = require('yargs/yargs')
|
||||
const { hideBin } = require('yargs/helpers')
|
||||
|
||||
yargs(hideBin(process.argv))
|
||||
.command('serve [port]', 'start the server', (yargs) => {
|
||||
return yargs
|
||||
.positional('port', {
|
||||
describe: 'port to bind on',
|
||||
default: 5000
|
||||
})
|
||||
}, (argv) => {
|
||||
if (argv.verbose) console.info(`start server on :${argv.port}`)
|
||||
serve(argv.port)
|
||||
})
|
||||
.option('verbose', {
|
||||
alias: 'v',
|
||||
type: 'boolean',
|
||||
description: 'Run with verbose logging'
|
||||
})
|
||||
.parse()
|
||||
```
|
||||
|
||||
Run the example above with `--help` to see the help for the application.
|
||||
|
||||
## Supported Platforms
|
||||
|
||||
### TypeScript
|
||||
|
||||
yargs has type definitions at [@types/yargs][type-definitions].
|
||||
|
||||
```
|
||||
npm i @types/yargs --save-dev
|
||||
```
|
||||
|
||||
See usage examples in [docs](/docs/typescript.md).
|
||||
|
||||
### Deno
|
||||
|
||||
As of `v16`, `yargs` supports [Deno](https://github.com/denoland/deno):
|
||||
|
||||
```typescript
|
||||
import yargs from 'https://deno.land/x/yargs/deno.ts'
|
||||
import { Arguments } from 'https://deno.land/x/yargs/deno-types.ts'
|
||||
|
||||
yargs(Deno.args)
|
||||
.command('download <files...>', 'download a list of files', (yargs: any) => {
|
||||
return yargs.positional('files', {
|
||||
describe: 'a list of files to do something with'
|
||||
})
|
||||
}, (argv: Arguments) => {
|
||||
console.info(argv)
|
||||
})
|
||||
.strictCommands()
|
||||
.demandCommand(1)
|
||||
.parse()
|
||||
```
|
||||
|
||||
### ESM
|
||||
|
||||
As of `v16`,`yargs` supports ESM imports:
|
||||
|
||||
```js
|
||||
import yargs from 'yargs'
|
||||
import { hideBin } from 'yargs/helpers'
|
||||
|
||||
yargs(hideBin(process.argv))
|
||||
.command('curl <url>', 'fetch the contents of the URL', () => {}, (argv) => {
|
||||
console.info(argv)
|
||||
})
|
||||
.demandCommand(1)
|
||||
.parse()
|
||||
```
|
||||
|
||||
### Usage in Browser
|
||||
|
||||
See examples of using yargs in the browser in [docs](/docs/browser.md).
|
||||
|
||||
## Community
|
||||
|
||||
Having problems? want to contribute? join our [community slack](http://devtoolscommunity.herokuapp.com).
|
||||
|
||||
## Documentation
|
||||
|
||||
### Table of Contents
|
||||
|
||||
* [Yargs' API](/docs/api.md)
|
||||
* [Examples](/docs/examples.md)
|
||||
* [Parsing Tricks](/docs/tricks.md)
|
||||
* [Stop the Parser](/docs/tricks.md#stop)
|
||||
* [Negating Boolean Arguments](/docs/tricks.md#negate)
|
||||
* [Numbers](/docs/tricks.md#numbers)
|
||||
* [Arrays](/docs/tricks.md#arrays)
|
||||
* [Objects](/docs/tricks.md#objects)
|
||||
* [Quotes](/docs/tricks.md#quotes)
|
||||
* [Advanced Topics](/docs/advanced.md)
|
||||
* [Composing Your App Using Commands](/docs/advanced.md#commands)
|
||||
* [Building Configurable CLI Apps](/docs/advanced.md#configuration)
|
||||
* [Customizing Yargs' Parser](/docs/advanced.md#customizing)
|
||||
* [Bundling yargs](/docs/bundling.md)
|
||||
* [Contributing](/contributing.md)
|
||||
|
||||
## Supported Node.js Versions
|
||||
|
||||
Libraries in this ecosystem make a best effort to track
|
||||
[Node.js' release schedule](https://nodejs.org/en/about/releases/). Here's [a
|
||||
post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a).
|
||||
|
||||
[npm-url]: https://www.npmjs.com/package/yargs
|
||||
[npm-image]: https://img.shields.io/npm/v/yargs.svg
|
||||
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg
|
||||
[standard-url]: http://standardjs.com/
|
||||
[conventional-commits-image]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg
|
||||
[conventional-commits-url]: https://conventionalcommits.org/
|
||||
[slack-image]: http://devtoolscommunity.herokuapp.com/badge.svg
|
||||
[slack-url]: http://devtoolscommunity.herokuapp.com
|
||||
[type-definitions]: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs
|
||||
[coverage-image]: https://img.shields.io/nycrc/yargs/yargs
|
||||
[coverage-url]: https://github.com/yargs/yargs/blob/main/.nycrc
|
5
backend/node_modules/postcss-cli/node_modules/yargs/browser.d.ts
generated
vendored
Normal file
5
backend/node_modules/postcss-cli/node_modules/yargs/browser.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import {YargsFactory} from './build/lib/yargs-factory';
|
||||
|
||||
declare const Yargs: ReturnType<typeof YargsFactory>;
|
||||
|
||||
export default Yargs;
|
7
backend/node_modules/postcss-cli/node_modules/yargs/browser.mjs
generated
vendored
Normal file
7
backend/node_modules/postcss-cli/node_modules/yargs/browser.mjs
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
// Bootstrap yargs for browser:
|
||||
import browserPlatformShim from './lib/platform-shims/browser.mjs';
|
||||
import {YargsFactory} from './build/lib/yargs-factory.js';
|
||||
|
||||
const Yargs = YargsFactory(browserPlatformShim);
|
||||
|
||||
export default Yargs;
|
1
backend/node_modules/postcss-cli/node_modules/yargs/build/index.cjs
generated
vendored
Normal file
1
backend/node_modules/postcss-cli/node_modules/yargs/build/index.cjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
62
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/argsert.js
generated
vendored
Normal file
62
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/argsert.js
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
import { YError } from './yerror.js';
|
||||
import { parseCommand } from './parse-command.js';
|
||||
const positionName = ['first', 'second', 'third', 'fourth', 'fifth', 'sixth'];
|
||||
export function argsert(arg1, arg2, arg3) {
|
||||
function parseArgs() {
|
||||
return typeof arg1 === 'object'
|
||||
? [{ demanded: [], optional: [] }, arg1, arg2]
|
||||
: [
|
||||
parseCommand(`cmd ${arg1}`),
|
||||
arg2,
|
||||
arg3,
|
||||
];
|
||||
}
|
||||
try {
|
||||
let position = 0;
|
||||
const [parsed, callerArguments, _length] = parseArgs();
|
||||
const args = [].slice.call(callerArguments);
|
||||
while (args.length && args[args.length - 1] === undefined)
|
||||
args.pop();
|
||||
const length = _length || args.length;
|
||||
if (length < parsed.demanded.length) {
|
||||
throw new YError(`Not enough arguments provided. Expected ${parsed.demanded.length} but received ${args.length}.`);
|
||||
}
|
||||
const totalCommands = parsed.demanded.length + parsed.optional.length;
|
||||
if (length > totalCommands) {
|
||||
throw new YError(`Too many arguments provided. Expected max ${totalCommands} but received ${length}.`);
|
||||
}
|
||||
parsed.demanded.forEach(demanded => {
|
||||
const arg = args.shift();
|
||||
const observedType = guessType(arg);
|
||||
const matchingTypes = demanded.cmd.filter(type => type === observedType || type === '*');
|
||||
if (matchingTypes.length === 0)
|
||||
argumentTypeError(observedType, demanded.cmd, position);
|
||||
position += 1;
|
||||
});
|
||||
parsed.optional.forEach(optional => {
|
||||
if (args.length === 0)
|
||||
return;
|
||||
const arg = args.shift();
|
||||
const observedType = guessType(arg);
|
||||
const matchingTypes = optional.cmd.filter(type => type === observedType || type === '*');
|
||||
if (matchingTypes.length === 0)
|
||||
argumentTypeError(observedType, optional.cmd, position);
|
||||
position += 1;
|
||||
});
|
||||
}
|
||||
catch (err) {
|
||||
console.warn(err.stack);
|
||||
}
|
||||
}
|
||||
function guessType(arg) {
|
||||
if (Array.isArray(arg)) {
|
||||
return 'array';
|
||||
}
|
||||
else if (arg === null) {
|
||||
return 'null';
|
||||
}
|
||||
return typeof arg;
|
||||
}
|
||||
function argumentTypeError(observedType, allowedTypes, position) {
|
||||
throw new YError(`Invalid ${positionName[position] || 'manyith'} argument. Expected ${allowedTypes.join(' or ')} but received ${observedType}.`);
|
||||
}
|
449
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/command.js
generated
vendored
Normal file
449
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/command.js
generated
vendored
Normal file
@@ -0,0 +1,449 @@
|
||||
import { assertNotStrictEqual, } from './typings/common-types.js';
|
||||
import { isPromise } from './utils/is-promise.js';
|
||||
import { applyMiddleware, commandMiddlewareFactory, } from './middleware.js';
|
||||
import { parseCommand } from './parse-command.js';
|
||||
import { isYargsInstance, } from './yargs-factory.js';
|
||||
import { maybeAsyncResult } from './utils/maybe-async-result.js';
|
||||
import whichModule from './utils/which-module.js';
|
||||
const DEFAULT_MARKER = /(^\*)|(^\$0)/;
|
||||
export class CommandInstance {
|
||||
constructor(usage, validation, globalMiddleware, shim) {
|
||||
this.requireCache = new Set();
|
||||
this.handlers = {};
|
||||
this.aliasMap = {};
|
||||
this.frozens = [];
|
||||
this.shim = shim;
|
||||
this.usage = usage;
|
||||
this.globalMiddleware = globalMiddleware;
|
||||
this.validation = validation;
|
||||
}
|
||||
addDirectory(dir, req, callerFile, opts) {
|
||||
opts = opts || {};
|
||||
if (typeof opts.recurse !== 'boolean')
|
||||
opts.recurse = false;
|
||||
if (!Array.isArray(opts.extensions))
|
||||
opts.extensions = ['js'];
|
||||
const parentVisit = typeof opts.visit === 'function' ? opts.visit : (o) => o;
|
||||
opts.visit = (obj, joined, filename) => {
|
||||
const visited = parentVisit(obj, joined, filename);
|
||||
if (visited) {
|
||||
if (this.requireCache.has(joined))
|
||||
return visited;
|
||||
else
|
||||
this.requireCache.add(joined);
|
||||
this.addHandler(visited);
|
||||
}
|
||||
return visited;
|
||||
};
|
||||
this.shim.requireDirectory({ require: req, filename: callerFile }, dir, opts);
|
||||
}
|
||||
addHandler(cmd, description, builder, handler, commandMiddleware, deprecated) {
|
||||
let aliases = [];
|
||||
const middlewares = commandMiddlewareFactory(commandMiddleware);
|
||||
handler = handler || (() => { });
|
||||
if (Array.isArray(cmd)) {
|
||||
if (isCommandAndAliases(cmd)) {
|
||||
[cmd, ...aliases] = cmd;
|
||||
}
|
||||
else {
|
||||
for (const command of cmd) {
|
||||
this.addHandler(command);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (isCommandHandlerDefinition(cmd)) {
|
||||
let command = Array.isArray(cmd.command) || typeof cmd.command === 'string'
|
||||
? cmd.command
|
||||
: this.moduleName(cmd);
|
||||
if (cmd.aliases)
|
||||
command = [].concat(command).concat(cmd.aliases);
|
||||
this.addHandler(command, this.extractDesc(cmd), cmd.builder, cmd.handler, cmd.middlewares, cmd.deprecated);
|
||||
return;
|
||||
}
|
||||
else if (isCommandBuilderDefinition(builder)) {
|
||||
this.addHandler([cmd].concat(aliases), description, builder.builder, builder.handler, builder.middlewares, builder.deprecated);
|
||||
return;
|
||||
}
|
||||
if (typeof cmd === 'string') {
|
||||
const parsedCommand = parseCommand(cmd);
|
||||
aliases = aliases.map(alias => parseCommand(alias).cmd);
|
||||
let isDefault = false;
|
||||
const parsedAliases = [parsedCommand.cmd].concat(aliases).filter(c => {
|
||||
if (DEFAULT_MARKER.test(c)) {
|
||||
isDefault = true;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
if (parsedAliases.length === 0 && isDefault)
|
||||
parsedAliases.push('$0');
|
||||
if (isDefault) {
|
||||
parsedCommand.cmd = parsedAliases[0];
|
||||
aliases = parsedAliases.slice(1);
|
||||
cmd = cmd.replace(DEFAULT_MARKER, parsedCommand.cmd);
|
||||
}
|
||||
aliases.forEach(alias => {
|
||||
this.aliasMap[alias] = parsedCommand.cmd;
|
||||
});
|
||||
if (description !== false) {
|
||||
this.usage.command(cmd, description, isDefault, aliases, deprecated);
|
||||
}
|
||||
this.handlers[parsedCommand.cmd] = {
|
||||
original: cmd,
|
||||
description,
|
||||
handler,
|
||||
builder: builder || {},
|
||||
middlewares,
|
||||
deprecated,
|
||||
demanded: parsedCommand.demanded,
|
||||
optional: parsedCommand.optional,
|
||||
};
|
||||
if (isDefault)
|
||||
this.defaultCommand = this.handlers[parsedCommand.cmd];
|
||||
}
|
||||
}
|
||||
getCommandHandlers() {
|
||||
return this.handlers;
|
||||
}
|
||||
getCommands() {
|
||||
return Object.keys(this.handlers).concat(Object.keys(this.aliasMap));
|
||||
}
|
||||
hasDefaultCommand() {
|
||||
return !!this.defaultCommand;
|
||||
}
|
||||
runCommand(command, yargs, parsed, commandIndex, helpOnly, helpOrVersionSet) {
|
||||
const commandHandler = this.handlers[command] ||
|
||||
this.handlers[this.aliasMap[command]] ||
|
||||
this.defaultCommand;
|
||||
const currentContext = yargs.getInternalMethods().getContext();
|
||||
const parentCommands = currentContext.commands.slice();
|
||||
const isDefaultCommand = !command;
|
||||
if (command) {
|
||||
currentContext.commands.push(command);
|
||||
currentContext.fullCommands.push(commandHandler.original);
|
||||
}
|
||||
const builderResult = this.applyBuilderUpdateUsageAndParse(isDefaultCommand, commandHandler, yargs, parsed.aliases, parentCommands, commandIndex, helpOnly, helpOrVersionSet);
|
||||
return isPromise(builderResult)
|
||||
? builderResult.then(result => this.applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, result.innerArgv, currentContext, helpOnly, result.aliases, yargs))
|
||||
: this.applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, builderResult.innerArgv, currentContext, helpOnly, builderResult.aliases, yargs);
|
||||
}
|
||||
applyBuilderUpdateUsageAndParse(isDefaultCommand, commandHandler, yargs, aliases, parentCommands, commandIndex, helpOnly, helpOrVersionSet) {
|
||||
const builder = commandHandler.builder;
|
||||
let innerYargs = yargs;
|
||||
if (isCommandBuilderCallback(builder)) {
|
||||
yargs.getInternalMethods().getUsageInstance().freeze();
|
||||
const builderOutput = builder(yargs.getInternalMethods().reset(aliases), helpOrVersionSet);
|
||||
if (isPromise(builderOutput)) {
|
||||
return builderOutput.then(output => {
|
||||
innerYargs = isYargsInstance(output) ? output : yargs;
|
||||
return this.parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly);
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (isCommandBuilderOptionDefinitions(builder)) {
|
||||
yargs.getInternalMethods().getUsageInstance().freeze();
|
||||
innerYargs = yargs.getInternalMethods().reset(aliases);
|
||||
Object.keys(commandHandler.builder).forEach(key => {
|
||||
innerYargs.option(key, builder[key]);
|
||||
});
|
||||
}
|
||||
return this.parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly);
|
||||
}
|
||||
parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly) {
|
||||
if (isDefaultCommand)
|
||||
innerYargs.getInternalMethods().getUsageInstance().unfreeze(true);
|
||||
if (this.shouldUpdateUsage(innerYargs)) {
|
||||
innerYargs
|
||||
.getInternalMethods()
|
||||
.getUsageInstance()
|
||||
.usage(this.usageFromParentCommandsCommandHandler(parentCommands, commandHandler), commandHandler.description);
|
||||
}
|
||||
const innerArgv = innerYargs
|
||||
.getInternalMethods()
|
||||
.runYargsParserAndExecuteCommands(null, undefined, true, commandIndex, helpOnly);
|
||||
return isPromise(innerArgv)
|
||||
? innerArgv.then(argv => ({
|
||||
aliases: innerYargs.parsed.aliases,
|
||||
innerArgv: argv,
|
||||
}))
|
||||
: {
|
||||
aliases: innerYargs.parsed.aliases,
|
||||
innerArgv: innerArgv,
|
||||
};
|
||||
}
|
||||
shouldUpdateUsage(yargs) {
|
||||
return (!yargs.getInternalMethods().getUsageInstance().getUsageDisabled() &&
|
||||
yargs.getInternalMethods().getUsageInstance().getUsage().length === 0);
|
||||
}
|
||||
usageFromParentCommandsCommandHandler(parentCommands, commandHandler) {
|
||||
const c = DEFAULT_MARKER.test(commandHandler.original)
|
||||
? commandHandler.original.replace(DEFAULT_MARKER, '').trim()
|
||||
: commandHandler.original;
|
||||
const pc = parentCommands.filter(c => {
|
||||
return !DEFAULT_MARKER.test(c);
|
||||
});
|
||||
pc.push(c);
|
||||
return `$0 ${pc.join(' ')}`;
|
||||
}
|
||||
handleValidationAndGetResult(isDefaultCommand, commandHandler, innerArgv, currentContext, aliases, yargs, middlewares, positionalMap) {
|
||||
if (!yargs.getInternalMethods().getHasOutput()) {
|
||||
const validation = yargs
|
||||
.getInternalMethods()
|
||||
.runValidation(aliases, positionalMap, yargs.parsed.error, isDefaultCommand);
|
||||
innerArgv = maybeAsyncResult(innerArgv, result => {
|
||||
validation(result);
|
||||
return result;
|
||||
});
|
||||
}
|
||||
if (commandHandler.handler && !yargs.getInternalMethods().getHasOutput()) {
|
||||
yargs.getInternalMethods().setHasOutput();
|
||||
const populateDoubleDash = !!yargs.getOptions().configuration['populate--'];
|
||||
yargs
|
||||
.getInternalMethods()
|
||||
.postProcess(innerArgv, populateDoubleDash, false, false);
|
||||
innerArgv = applyMiddleware(innerArgv, yargs, middlewares, false);
|
||||
innerArgv = maybeAsyncResult(innerArgv, result => {
|
||||
const handlerResult = commandHandler.handler(result);
|
||||
return isPromise(handlerResult)
|
||||
? handlerResult.then(() => result)
|
||||
: result;
|
||||
});
|
||||
if (!isDefaultCommand) {
|
||||
yargs.getInternalMethods().getUsageInstance().cacheHelpMessage();
|
||||
}
|
||||
if (isPromise(innerArgv) &&
|
||||
!yargs.getInternalMethods().hasParseCallback()) {
|
||||
innerArgv.catch(error => {
|
||||
try {
|
||||
yargs.getInternalMethods().getUsageInstance().fail(null, error);
|
||||
}
|
||||
catch (_err) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
if (!isDefaultCommand) {
|
||||
currentContext.commands.pop();
|
||||
currentContext.fullCommands.pop();
|
||||
}
|
||||
return innerArgv;
|
||||
}
|
||||
applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, innerArgv, currentContext, helpOnly, aliases, yargs) {
|
||||
let positionalMap = {};
|
||||
if (helpOnly)
|
||||
return innerArgv;
|
||||
if (!yargs.getInternalMethods().getHasOutput()) {
|
||||
positionalMap = this.populatePositionals(commandHandler, innerArgv, currentContext, yargs);
|
||||
}
|
||||
const middlewares = this.globalMiddleware
|
||||
.getMiddleware()
|
||||
.slice(0)
|
||||
.concat(commandHandler.middlewares);
|
||||
const maybePromiseArgv = applyMiddleware(innerArgv, yargs, middlewares, true);
|
||||
return isPromise(maybePromiseArgv)
|
||||
? maybePromiseArgv.then(resolvedInnerArgv => this.handleValidationAndGetResult(isDefaultCommand, commandHandler, resolvedInnerArgv, currentContext, aliases, yargs, middlewares, positionalMap))
|
||||
: this.handleValidationAndGetResult(isDefaultCommand, commandHandler, maybePromiseArgv, currentContext, aliases, yargs, middlewares, positionalMap);
|
||||
}
|
||||
populatePositionals(commandHandler, argv, context, yargs) {
|
||||
argv._ = argv._.slice(context.commands.length);
|
||||
const demanded = commandHandler.demanded.slice(0);
|
||||
const optional = commandHandler.optional.slice(0);
|
||||
const positionalMap = {};
|
||||
this.validation.positionalCount(demanded.length, argv._.length);
|
||||
while (demanded.length) {
|
||||
const demand = demanded.shift();
|
||||
this.populatePositional(demand, argv, positionalMap);
|
||||
}
|
||||
while (optional.length) {
|
||||
const maybe = optional.shift();
|
||||
this.populatePositional(maybe, argv, positionalMap);
|
||||
}
|
||||
argv._ = context.commands.concat(argv._.map(a => '' + a));
|
||||
this.postProcessPositionals(argv, positionalMap, this.cmdToParseOptions(commandHandler.original), yargs);
|
||||
return positionalMap;
|
||||
}
|
||||
populatePositional(positional, argv, positionalMap) {
|
||||
const cmd = positional.cmd[0];
|
||||
if (positional.variadic) {
|
||||
positionalMap[cmd] = argv._.splice(0).map(String);
|
||||
}
|
||||
else {
|
||||
if (argv._.length)
|
||||
positionalMap[cmd] = [String(argv._.shift())];
|
||||
}
|
||||
}
|
||||
cmdToParseOptions(cmdString) {
|
||||
const parseOptions = {
|
||||
array: [],
|
||||
default: {},
|
||||
alias: {},
|
||||
demand: {},
|
||||
};
|
||||
const parsed = parseCommand(cmdString);
|
||||
parsed.demanded.forEach(d => {
|
||||
const [cmd, ...aliases] = d.cmd;
|
||||
if (d.variadic) {
|
||||
parseOptions.array.push(cmd);
|
||||
parseOptions.default[cmd] = [];
|
||||
}
|
||||
parseOptions.alias[cmd] = aliases;
|
||||
parseOptions.demand[cmd] = true;
|
||||
});
|
||||
parsed.optional.forEach(o => {
|
||||
const [cmd, ...aliases] = o.cmd;
|
||||
if (o.variadic) {
|
||||
parseOptions.array.push(cmd);
|
||||
parseOptions.default[cmd] = [];
|
||||
}
|
||||
parseOptions.alias[cmd] = aliases;
|
||||
});
|
||||
return parseOptions;
|
||||
}
|
||||
postProcessPositionals(argv, positionalMap, parseOptions, yargs) {
|
||||
const options = Object.assign({}, yargs.getOptions());
|
||||
options.default = Object.assign(parseOptions.default, options.default);
|
||||
for (const key of Object.keys(parseOptions.alias)) {
|
||||
options.alias[key] = (options.alias[key] || []).concat(parseOptions.alias[key]);
|
||||
}
|
||||
options.array = options.array.concat(parseOptions.array);
|
||||
options.config = {};
|
||||
const unparsed = [];
|
||||
Object.keys(positionalMap).forEach(key => {
|
||||
positionalMap[key].map(value => {
|
||||
if (options.configuration['unknown-options-as-args'])
|
||||
options.key[key] = true;
|
||||
unparsed.push(`--${key}`);
|
||||
unparsed.push(value);
|
||||
});
|
||||
});
|
||||
if (!unparsed.length)
|
||||
return;
|
||||
const config = Object.assign({}, options.configuration, {
|
||||
'populate--': false,
|
||||
});
|
||||
const parsed = this.shim.Parser.detailed(unparsed, Object.assign({}, options, {
|
||||
configuration: config,
|
||||
}));
|
||||
if (parsed.error) {
|
||||
yargs
|
||||
.getInternalMethods()
|
||||
.getUsageInstance()
|
||||
.fail(parsed.error.message, parsed.error);
|
||||
}
|
||||
else {
|
||||
const positionalKeys = Object.keys(positionalMap);
|
||||
Object.keys(positionalMap).forEach(key => {
|
||||
positionalKeys.push(...parsed.aliases[key]);
|
||||
});
|
||||
Object.keys(parsed.argv).forEach(key => {
|
||||
if (positionalKeys.includes(key)) {
|
||||
if (!positionalMap[key])
|
||||
positionalMap[key] = parsed.argv[key];
|
||||
if (!this.isInConfigs(yargs, key) &&
|
||||
!this.isDefaulted(yargs, key) &&
|
||||
Object.prototype.hasOwnProperty.call(argv, key) &&
|
||||
Object.prototype.hasOwnProperty.call(parsed.argv, key) &&
|
||||
(Array.isArray(argv[key]) || Array.isArray(parsed.argv[key]))) {
|
||||
argv[key] = [].concat(argv[key], parsed.argv[key]);
|
||||
}
|
||||
else {
|
||||
argv[key] = parsed.argv[key];
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
isDefaulted(yargs, key) {
|
||||
const { default: defaults } = yargs.getOptions();
|
||||
return (Object.prototype.hasOwnProperty.call(defaults, key) ||
|
||||
Object.prototype.hasOwnProperty.call(defaults, this.shim.Parser.camelCase(key)));
|
||||
}
|
||||
isInConfigs(yargs, key) {
|
||||
const { configObjects } = yargs.getOptions();
|
||||
return (configObjects.some(c => Object.prototype.hasOwnProperty.call(c, key)) ||
|
||||
configObjects.some(c => Object.prototype.hasOwnProperty.call(c, this.shim.Parser.camelCase(key))));
|
||||
}
|
||||
runDefaultBuilderOn(yargs) {
|
||||
if (!this.defaultCommand)
|
||||
return;
|
||||
if (this.shouldUpdateUsage(yargs)) {
|
||||
const commandString = DEFAULT_MARKER.test(this.defaultCommand.original)
|
||||
? this.defaultCommand.original
|
||||
: this.defaultCommand.original.replace(/^[^[\]<>]*/, '$0 ');
|
||||
yargs
|
||||
.getInternalMethods()
|
||||
.getUsageInstance()
|
||||
.usage(commandString, this.defaultCommand.description);
|
||||
}
|
||||
const builder = this.defaultCommand.builder;
|
||||
if (isCommandBuilderCallback(builder)) {
|
||||
return builder(yargs, true);
|
||||
}
|
||||
else if (!isCommandBuilderDefinition(builder)) {
|
||||
Object.keys(builder).forEach(key => {
|
||||
yargs.option(key, builder[key]);
|
||||
});
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
moduleName(obj) {
|
||||
const mod = whichModule(obj);
|
||||
if (!mod)
|
||||
throw new Error(`No command name given for module: ${this.shim.inspect(obj)}`);
|
||||
return this.commandFromFilename(mod.filename);
|
||||
}
|
||||
commandFromFilename(filename) {
|
||||
return this.shim.path.basename(filename, this.shim.path.extname(filename));
|
||||
}
|
||||
extractDesc({ describe, description, desc }) {
|
||||
for (const test of [describe, description, desc]) {
|
||||
if (typeof test === 'string' || test === false)
|
||||
return test;
|
||||
assertNotStrictEqual(test, true, this.shim);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
freeze() {
|
||||
this.frozens.push({
|
||||
handlers: this.handlers,
|
||||
aliasMap: this.aliasMap,
|
||||
defaultCommand: this.defaultCommand,
|
||||
});
|
||||
}
|
||||
unfreeze() {
|
||||
const frozen = this.frozens.pop();
|
||||
assertNotStrictEqual(frozen, undefined, this.shim);
|
||||
({
|
||||
handlers: this.handlers,
|
||||
aliasMap: this.aliasMap,
|
||||
defaultCommand: this.defaultCommand,
|
||||
} = frozen);
|
||||
}
|
||||
reset() {
|
||||
this.handlers = {};
|
||||
this.aliasMap = {};
|
||||
this.defaultCommand = undefined;
|
||||
this.requireCache = new Set();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
export function command(usage, validation, globalMiddleware, shim) {
|
||||
return new CommandInstance(usage, validation, globalMiddleware, shim);
|
||||
}
|
||||
export function isCommandBuilderDefinition(builder) {
|
||||
return (typeof builder === 'object' &&
|
||||
!!builder.builder &&
|
||||
typeof builder.handler === 'function');
|
||||
}
|
||||
function isCommandAndAliases(cmd) {
|
||||
return cmd.every(c => typeof c === 'string');
|
||||
}
|
||||
export function isCommandBuilderCallback(builder) {
|
||||
return typeof builder === 'function';
|
||||
}
|
||||
function isCommandBuilderOptionDefinitions(builder) {
|
||||
return typeof builder === 'object';
|
||||
}
|
||||
export function isCommandHandlerDefinition(cmd) {
|
||||
return typeof cmd === 'object' && !Array.isArray(cmd);
|
||||
}
|
48
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/completion-templates.js
generated
vendored
Normal file
48
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/completion-templates.js
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
export const completionShTemplate = `###-begin-{{app_name}}-completions-###
|
||||
#
|
||||
# yargs command completion script
|
||||
#
|
||||
# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc
|
||||
# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.
|
||||
#
|
||||
_{{app_name}}_yargs_completions()
|
||||
{
|
||||
local cur_word args type_list
|
||||
|
||||
cur_word="\${COMP_WORDS[COMP_CWORD]}"
|
||||
args=("\${COMP_WORDS[@]}")
|
||||
|
||||
# ask yargs to generate completions.
|
||||
type_list=$({{app_path}} --get-yargs-completions "\${args[@]}")
|
||||
|
||||
COMPREPLY=( $(compgen -W "\${type_list}" -- \${cur_word}) )
|
||||
|
||||
# if no match was found, fall back to filename completion
|
||||
if [ \${#COMPREPLY[@]} -eq 0 ]; then
|
||||
COMPREPLY=()
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}
|
||||
###-end-{{app_name}}-completions-###
|
||||
`;
|
||||
export const completionZshTemplate = `#compdef {{app_name}}
|
||||
###-begin-{{app_name}}-completions-###
|
||||
#
|
||||
# yargs command completion script
|
||||
#
|
||||
# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc
|
||||
# or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.
|
||||
#
|
||||
_{{app_name}}_yargs_completions()
|
||||
{
|
||||
local reply
|
||||
local si=$IFS
|
||||
IFS=$'\n' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}"))
|
||||
IFS=$si
|
||||
_describe 'values' reply
|
||||
}
|
||||
compdef _{{app_name}}_yargs_completions {{app_name}}
|
||||
###-end-{{app_name}}-completions-###
|
||||
`;
|
243
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/completion.js
generated
vendored
Normal file
243
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/completion.js
generated
vendored
Normal file
@@ -0,0 +1,243 @@
|
||||
import { isCommandBuilderCallback } from './command.js';
|
||||
import { assertNotStrictEqual } from './typings/common-types.js';
|
||||
import * as templates from './completion-templates.js';
|
||||
import { isPromise } from './utils/is-promise.js';
|
||||
import { parseCommand } from './parse-command.js';
|
||||
export class Completion {
|
||||
constructor(yargs, usage, command, shim) {
|
||||
var _a, _b, _c;
|
||||
this.yargs = yargs;
|
||||
this.usage = usage;
|
||||
this.command = command;
|
||||
this.shim = shim;
|
||||
this.completionKey = 'get-yargs-completions';
|
||||
this.aliases = null;
|
||||
this.customCompletionFunction = null;
|
||||
this.indexAfterLastReset = 0;
|
||||
this.zshShell =
|
||||
(_c = (((_a = this.shim.getEnv('SHELL')) === null || _a === void 0 ? void 0 : _a.includes('zsh')) ||
|
||||
((_b = this.shim.getEnv('ZSH_NAME')) === null || _b === void 0 ? void 0 : _b.includes('zsh')))) !== null && _c !== void 0 ? _c : false;
|
||||
}
|
||||
defaultCompletion(args, argv, current, done) {
|
||||
const handlers = this.command.getCommandHandlers();
|
||||
for (let i = 0, ii = args.length; i < ii; ++i) {
|
||||
if (handlers[args[i]] && handlers[args[i]].builder) {
|
||||
const builder = handlers[args[i]].builder;
|
||||
if (isCommandBuilderCallback(builder)) {
|
||||
this.indexAfterLastReset = i + 1;
|
||||
const y = this.yargs.getInternalMethods().reset();
|
||||
builder(y, true);
|
||||
return y.argv;
|
||||
}
|
||||
}
|
||||
}
|
||||
const completions = [];
|
||||
this.commandCompletions(completions, args, current);
|
||||
this.optionCompletions(completions, args, argv, current);
|
||||
this.choicesFromOptionsCompletions(completions, args, argv, current);
|
||||
this.choicesFromPositionalsCompletions(completions, args, argv, current);
|
||||
done(null, completions);
|
||||
}
|
||||
commandCompletions(completions, args, current) {
|
||||
const parentCommands = this.yargs
|
||||
.getInternalMethods()
|
||||
.getContext().commands;
|
||||
if (!current.match(/^-/) &&
|
||||
parentCommands[parentCommands.length - 1] !== current &&
|
||||
!this.previousArgHasChoices(args)) {
|
||||
this.usage.getCommands().forEach(usageCommand => {
|
||||
const commandName = parseCommand(usageCommand[0]).cmd;
|
||||
if (args.indexOf(commandName) === -1) {
|
||||
if (!this.zshShell) {
|
||||
completions.push(commandName);
|
||||
}
|
||||
else {
|
||||
const desc = usageCommand[1] || '';
|
||||
completions.push(commandName.replace(/:/g, '\\:') + ':' + desc);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
optionCompletions(completions, args, argv, current) {
|
||||
if ((current.match(/^-/) || (current === '' && completions.length === 0)) &&
|
||||
!this.previousArgHasChoices(args)) {
|
||||
const options = this.yargs.getOptions();
|
||||
const positionalKeys = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || [];
|
||||
Object.keys(options.key).forEach(key => {
|
||||
const negable = !!options.configuration['boolean-negation'] &&
|
||||
options.boolean.includes(key);
|
||||
const isPositionalKey = positionalKeys.includes(key);
|
||||
if (!isPositionalKey &&
|
||||
!options.hiddenOptions.includes(key) &&
|
||||
!this.argsContainKey(args, key, negable)) {
|
||||
this.completeOptionKey(key, completions, current, negable && !!options.default[key]);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
choicesFromOptionsCompletions(completions, args, argv, current) {
|
||||
if (this.previousArgHasChoices(args)) {
|
||||
const choices = this.getPreviousArgChoices(args);
|
||||
if (choices && choices.length > 0) {
|
||||
completions.push(...choices.map(c => c.replace(/:/g, '\\:')));
|
||||
}
|
||||
}
|
||||
}
|
||||
choicesFromPositionalsCompletions(completions, args, argv, current) {
|
||||
if (current === '' &&
|
||||
completions.length > 0 &&
|
||||
this.previousArgHasChoices(args)) {
|
||||
return;
|
||||
}
|
||||
const positionalKeys = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || [];
|
||||
const offset = Math.max(this.indexAfterLastReset, this.yargs.getInternalMethods().getContext().commands.length +
|
||||
1);
|
||||
const positionalKey = positionalKeys[argv._.length - offset - 1];
|
||||
if (!positionalKey) {
|
||||
return;
|
||||
}
|
||||
const choices = this.yargs.getOptions().choices[positionalKey] || [];
|
||||
for (const choice of choices) {
|
||||
if (choice.startsWith(current)) {
|
||||
completions.push(choice.replace(/:/g, '\\:'));
|
||||
}
|
||||
}
|
||||
}
|
||||
getPreviousArgChoices(args) {
|
||||
if (args.length < 1)
|
||||
return;
|
||||
let previousArg = args[args.length - 1];
|
||||
let filter = '';
|
||||
if (!previousArg.startsWith('-') && args.length > 1) {
|
||||
filter = previousArg;
|
||||
previousArg = args[args.length - 2];
|
||||
}
|
||||
if (!previousArg.startsWith('-'))
|
||||
return;
|
||||
const previousArgKey = previousArg.replace(/^-+/, '');
|
||||
const options = this.yargs.getOptions();
|
||||
const possibleAliases = [
|
||||
previousArgKey,
|
||||
...(this.yargs.getAliases()[previousArgKey] || []),
|
||||
];
|
||||
let choices;
|
||||
for (const possibleAlias of possibleAliases) {
|
||||
if (Object.prototype.hasOwnProperty.call(options.key, possibleAlias) &&
|
||||
Array.isArray(options.choices[possibleAlias])) {
|
||||
choices = options.choices[possibleAlias];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (choices) {
|
||||
return choices.filter(choice => !filter || choice.startsWith(filter));
|
||||
}
|
||||
}
|
||||
previousArgHasChoices(args) {
|
||||
const choices = this.getPreviousArgChoices(args);
|
||||
return choices !== undefined && choices.length > 0;
|
||||
}
|
||||
argsContainKey(args, key, negable) {
|
||||
const argsContains = (s) => args.indexOf((/^[^0-9]$/.test(s) ? '-' : '--') + s) !== -1;
|
||||
if (argsContains(key))
|
||||
return true;
|
||||
if (negable && argsContains(`no-${key}`))
|
||||
return true;
|
||||
if (this.aliases) {
|
||||
for (const alias of this.aliases[key]) {
|
||||
if (argsContains(alias))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
completeOptionKey(key, completions, current, negable) {
|
||||
var _a, _b, _c, _d;
|
||||
let keyWithDesc = key;
|
||||
if (this.zshShell) {
|
||||
const descs = this.usage.getDescriptions();
|
||||
const aliasKey = (_b = (_a = this === null || this === void 0 ? void 0 : this.aliases) === null || _a === void 0 ? void 0 : _a[key]) === null || _b === void 0 ? void 0 : _b.find(alias => {
|
||||
const desc = descs[alias];
|
||||
return typeof desc === 'string' && desc.length > 0;
|
||||
});
|
||||
const descFromAlias = aliasKey ? descs[aliasKey] : undefined;
|
||||
const desc = (_d = (_c = descs[key]) !== null && _c !== void 0 ? _c : descFromAlias) !== null && _d !== void 0 ? _d : '';
|
||||
keyWithDesc = `${key.replace(/:/g, '\\:')}:${desc
|
||||
.replace('__yargsString__:', '')
|
||||
.replace(/(\r\n|\n|\r)/gm, ' ')}`;
|
||||
}
|
||||
const startsByTwoDashes = (s) => /^--/.test(s);
|
||||
const isShortOption = (s) => /^[^0-9]$/.test(s);
|
||||
const dashes = !startsByTwoDashes(current) && isShortOption(key) ? '-' : '--';
|
||||
completions.push(dashes + keyWithDesc);
|
||||
if (negable) {
|
||||
completions.push(dashes + 'no-' + keyWithDesc);
|
||||
}
|
||||
}
|
||||
customCompletion(args, argv, current, done) {
|
||||
assertNotStrictEqual(this.customCompletionFunction, null, this.shim);
|
||||
if (isSyncCompletionFunction(this.customCompletionFunction)) {
|
||||
const result = this.customCompletionFunction(current, argv);
|
||||
if (isPromise(result)) {
|
||||
return result
|
||||
.then(list => {
|
||||
this.shim.process.nextTick(() => {
|
||||
done(null, list);
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
this.shim.process.nextTick(() => {
|
||||
done(err, undefined);
|
||||
});
|
||||
});
|
||||
}
|
||||
return done(null, result);
|
||||
}
|
||||
else if (isFallbackCompletionFunction(this.customCompletionFunction)) {
|
||||
return this.customCompletionFunction(current, argv, (onCompleted = done) => this.defaultCompletion(args, argv, current, onCompleted), completions => {
|
||||
done(null, completions);
|
||||
});
|
||||
}
|
||||
else {
|
||||
return this.customCompletionFunction(current, argv, completions => {
|
||||
done(null, completions);
|
||||
});
|
||||
}
|
||||
}
|
||||
getCompletion(args, done) {
|
||||
const current = args.length ? args[args.length - 1] : '';
|
||||
const argv = this.yargs.parse(args, true);
|
||||
const completionFunction = this.customCompletionFunction
|
||||
? (argv) => this.customCompletion(args, argv, current, done)
|
||||
: (argv) => this.defaultCompletion(args, argv, current, done);
|
||||
return isPromise(argv)
|
||||
? argv.then(completionFunction)
|
||||
: completionFunction(argv);
|
||||
}
|
||||
generateCompletionScript($0, cmd) {
|
||||
let script = this.zshShell
|
||||
? templates.completionZshTemplate
|
||||
: templates.completionShTemplate;
|
||||
const name = this.shim.path.basename($0);
|
||||
if ($0.match(/\.js$/))
|
||||
$0 = `./${$0}`;
|
||||
script = script.replace(/{{app_name}}/g, name);
|
||||
script = script.replace(/{{completion_command}}/g, cmd);
|
||||
return script.replace(/{{app_path}}/g, $0);
|
||||
}
|
||||
registerFunction(fn) {
|
||||
this.customCompletionFunction = fn;
|
||||
}
|
||||
setParsed(parsed) {
|
||||
this.aliases = parsed.aliases;
|
||||
}
|
||||
}
|
||||
export function completion(yargs, usage, command, shim) {
|
||||
return new Completion(yargs, usage, command, shim);
|
||||
}
|
||||
function isSyncCompletionFunction(completionFunction) {
|
||||
return completionFunction.length < 3;
|
||||
}
|
||||
function isFallbackCompletionFunction(completionFunction) {
|
||||
return completionFunction.length > 3;
|
||||
}
|
88
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/middleware.js
generated
vendored
Normal file
88
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/middleware.js
generated
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
import { argsert } from './argsert.js';
|
||||
import { isPromise } from './utils/is-promise.js';
|
||||
export class GlobalMiddleware {
|
||||
constructor(yargs) {
|
||||
this.globalMiddleware = [];
|
||||
this.frozens = [];
|
||||
this.yargs = yargs;
|
||||
}
|
||||
addMiddleware(callback, applyBeforeValidation, global = true, mutates = false) {
|
||||
argsert('<array|function> [boolean] [boolean] [boolean]', [callback, applyBeforeValidation, global], arguments.length);
|
||||
if (Array.isArray(callback)) {
|
||||
for (let i = 0; i < callback.length; i++) {
|
||||
if (typeof callback[i] !== 'function') {
|
||||
throw Error('middleware must be a function');
|
||||
}
|
||||
const m = callback[i];
|
||||
m.applyBeforeValidation = applyBeforeValidation;
|
||||
m.global = global;
|
||||
}
|
||||
Array.prototype.push.apply(this.globalMiddleware, callback);
|
||||
}
|
||||
else if (typeof callback === 'function') {
|
||||
const m = callback;
|
||||
m.applyBeforeValidation = applyBeforeValidation;
|
||||
m.global = global;
|
||||
m.mutates = mutates;
|
||||
this.globalMiddleware.push(callback);
|
||||
}
|
||||
return this.yargs;
|
||||
}
|
||||
addCoerceMiddleware(callback, option) {
|
||||
const aliases = this.yargs.getAliases();
|
||||
this.globalMiddleware = this.globalMiddleware.filter(m => {
|
||||
const toCheck = [...(aliases[option] || []), option];
|
||||
if (!m.option)
|
||||
return true;
|
||||
else
|
||||
return !toCheck.includes(m.option);
|
||||
});
|
||||
callback.option = option;
|
||||
return this.addMiddleware(callback, true, true, true);
|
||||
}
|
||||
getMiddleware() {
|
||||
return this.globalMiddleware;
|
||||
}
|
||||
freeze() {
|
||||
this.frozens.push([...this.globalMiddleware]);
|
||||
}
|
||||
unfreeze() {
|
||||
const frozen = this.frozens.pop();
|
||||
if (frozen !== undefined)
|
||||
this.globalMiddleware = frozen;
|
||||
}
|
||||
reset() {
|
||||
this.globalMiddleware = this.globalMiddleware.filter(m => m.global);
|
||||
}
|
||||
}
|
||||
export function commandMiddlewareFactory(commandMiddleware) {
|
||||
if (!commandMiddleware)
|
||||
return [];
|
||||
return commandMiddleware.map(middleware => {
|
||||
middleware.applyBeforeValidation = false;
|
||||
return middleware;
|
||||
});
|
||||
}
|
||||
export function applyMiddleware(argv, yargs, middlewares, beforeValidation) {
|
||||
return middlewares.reduce((acc, middleware) => {
|
||||
if (middleware.applyBeforeValidation !== beforeValidation) {
|
||||
return acc;
|
||||
}
|
||||
if (middleware.mutates) {
|
||||
if (middleware.applied)
|
||||
return acc;
|
||||
middleware.applied = true;
|
||||
}
|
||||
if (isPromise(acc)) {
|
||||
return acc
|
||||
.then(initialObj => Promise.all([initialObj, middleware(initialObj, yargs)]))
|
||||
.then(([initialObj, middlewareObj]) => Object.assign(initialObj, middlewareObj));
|
||||
}
|
||||
else {
|
||||
const result = middleware(acc, yargs);
|
||||
return isPromise(result)
|
||||
? result.then(middlewareObj => Object.assign(acc, middlewareObj))
|
||||
: Object.assign(acc, result);
|
||||
}
|
||||
}, argv);
|
||||
}
|
32
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/parse-command.js
generated
vendored
Normal file
32
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/parse-command.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
export function parseCommand(cmd) {
|
||||
const extraSpacesStrippedCommand = cmd.replace(/\s{2,}/g, ' ');
|
||||
const splitCommand = extraSpacesStrippedCommand.split(/\s+(?![^[]*]|[^<]*>)/);
|
||||
const bregex = /\.*[\][<>]/g;
|
||||
const firstCommand = splitCommand.shift();
|
||||
if (!firstCommand)
|
||||
throw new Error(`No command found in: ${cmd}`);
|
||||
const parsedCommand = {
|
||||
cmd: firstCommand.replace(bregex, ''),
|
||||
demanded: [],
|
||||
optional: [],
|
||||
};
|
||||
splitCommand.forEach((cmd, i) => {
|
||||
let variadic = false;
|
||||
cmd = cmd.replace(/\s/g, '');
|
||||
if (/\.+[\]>]/.test(cmd) && i === splitCommand.length - 1)
|
||||
variadic = true;
|
||||
if (/^\[/.test(cmd)) {
|
||||
parsedCommand.optional.push({
|
||||
cmd: cmd.replace(bregex, '').split('|'),
|
||||
variadic,
|
||||
});
|
||||
}
|
||||
else {
|
||||
parsedCommand.demanded.push({
|
||||
cmd: cmd.replace(bregex, '').split('|'),
|
||||
variadic,
|
||||
});
|
||||
}
|
||||
});
|
||||
return parsedCommand;
|
||||
}
|
9
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/typings/common-types.js
generated
vendored
Normal file
9
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/typings/common-types.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
export function assertNotStrictEqual(actual, expected, shim, message) {
|
||||
shim.assert.notStrictEqual(actual, expected, message);
|
||||
}
|
||||
export function assertSingleKey(actual, shim) {
|
||||
shim.assert.strictEqual(typeof actual, 'string');
|
||||
}
|
||||
export function objectKeys(object) {
|
||||
return Object.keys(object);
|
||||
}
|
1
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/typings/yargs-parser-types.js
generated
vendored
Normal file
1
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/typings/yargs-parser-types.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
584
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/usage.js
generated
vendored
Normal file
584
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/usage.js
generated
vendored
Normal file
@@ -0,0 +1,584 @@
|
||||
import { objFilter } from './utils/obj-filter.js';
|
||||
import { YError } from './yerror.js';
|
||||
import setBlocking from './utils/set-blocking.js';
|
||||
function isBoolean(fail) {
|
||||
return typeof fail === 'boolean';
|
||||
}
|
||||
export function usage(yargs, shim) {
|
||||
const __ = shim.y18n.__;
|
||||
const self = {};
|
||||
const fails = [];
|
||||
self.failFn = function failFn(f) {
|
||||
fails.push(f);
|
||||
};
|
||||
let failMessage = null;
|
||||
let globalFailMessage = null;
|
||||
let showHelpOnFail = true;
|
||||
self.showHelpOnFail = function showHelpOnFailFn(arg1 = true, arg2) {
|
||||
const [enabled, message] = typeof arg1 === 'string' ? [true, arg1] : [arg1, arg2];
|
||||
if (yargs.getInternalMethods().isGlobalContext()) {
|
||||
globalFailMessage = message;
|
||||
}
|
||||
failMessage = message;
|
||||
showHelpOnFail = enabled;
|
||||
return self;
|
||||
};
|
||||
let failureOutput = false;
|
||||
self.fail = function fail(msg, err) {
|
||||
const logger = yargs.getInternalMethods().getLoggerInstance();
|
||||
if (fails.length) {
|
||||
for (let i = fails.length - 1; i >= 0; --i) {
|
||||
const fail = fails[i];
|
||||
if (isBoolean(fail)) {
|
||||
if (err)
|
||||
throw err;
|
||||
else if (msg)
|
||||
throw Error(msg);
|
||||
}
|
||||
else {
|
||||
fail(msg, err, self);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (yargs.getExitProcess())
|
||||
setBlocking(true);
|
||||
if (!failureOutput) {
|
||||
failureOutput = true;
|
||||
if (showHelpOnFail) {
|
||||
yargs.showHelp('error');
|
||||
logger.error();
|
||||
}
|
||||
if (msg || err)
|
||||
logger.error(msg || err);
|
||||
const globalOrCommandFailMessage = failMessage || globalFailMessage;
|
||||
if (globalOrCommandFailMessage) {
|
||||
if (msg || err)
|
||||
logger.error('');
|
||||
logger.error(globalOrCommandFailMessage);
|
||||
}
|
||||
}
|
||||
err = err || new YError(msg);
|
||||
if (yargs.getExitProcess()) {
|
||||
return yargs.exit(1);
|
||||
}
|
||||
else if (yargs.getInternalMethods().hasParseCallback()) {
|
||||
return yargs.exit(1, err);
|
||||
}
|
||||
else {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
};
|
||||
let usages = [];
|
||||
let usageDisabled = false;
|
||||
self.usage = (msg, description) => {
|
||||
if (msg === null) {
|
||||
usageDisabled = true;
|
||||
usages = [];
|
||||
return self;
|
||||
}
|
||||
usageDisabled = false;
|
||||
usages.push([msg, description || '']);
|
||||
return self;
|
||||
};
|
||||
self.getUsage = () => {
|
||||
return usages;
|
||||
};
|
||||
self.getUsageDisabled = () => {
|
||||
return usageDisabled;
|
||||
};
|
||||
self.getPositionalGroupName = () => {
|
||||
return __('Positionals:');
|
||||
};
|
||||
let examples = [];
|
||||
self.example = (cmd, description) => {
|
||||
examples.push([cmd, description || '']);
|
||||
};
|
||||
let commands = [];
|
||||
self.command = function command(cmd, description, isDefault, aliases, deprecated = false) {
|
||||
if (isDefault) {
|
||||
commands = commands.map(cmdArray => {
|
||||
cmdArray[2] = false;
|
||||
return cmdArray;
|
||||
});
|
||||
}
|
||||
commands.push([cmd, description || '', isDefault, aliases, deprecated]);
|
||||
};
|
||||
self.getCommands = () => commands;
|
||||
let descriptions = {};
|
||||
self.describe = function describe(keyOrKeys, desc) {
|
||||
if (Array.isArray(keyOrKeys)) {
|
||||
keyOrKeys.forEach(k => {
|
||||
self.describe(k, desc);
|
||||
});
|
||||
}
|
||||
else if (typeof keyOrKeys === 'object') {
|
||||
Object.keys(keyOrKeys).forEach(k => {
|
||||
self.describe(k, keyOrKeys[k]);
|
||||
});
|
||||
}
|
||||
else {
|
||||
descriptions[keyOrKeys] = desc;
|
||||
}
|
||||
};
|
||||
self.getDescriptions = () => descriptions;
|
||||
let epilogs = [];
|
||||
self.epilog = msg => {
|
||||
epilogs.push(msg);
|
||||
};
|
||||
let wrapSet = false;
|
||||
let wrap;
|
||||
self.wrap = cols => {
|
||||
wrapSet = true;
|
||||
wrap = cols;
|
||||
};
|
||||
self.getWrap = () => {
|
||||
if (shim.getEnv('YARGS_DISABLE_WRAP')) {
|
||||
return null;
|
||||
}
|
||||
if (!wrapSet) {
|
||||
wrap = windowWidth();
|
||||
wrapSet = true;
|
||||
}
|
||||
return wrap;
|
||||
};
|
||||
const deferY18nLookupPrefix = '__yargsString__:';
|
||||
self.deferY18nLookup = str => deferY18nLookupPrefix + str;
|
||||
self.help = function help() {
|
||||
if (cachedHelpMessage)
|
||||
return cachedHelpMessage;
|
||||
normalizeAliases();
|
||||
const base$0 = yargs.customScriptName
|
||||
? yargs.$0
|
||||
: shim.path.basename(yargs.$0);
|
||||
const demandedOptions = yargs.getDemandedOptions();
|
||||
const demandedCommands = yargs.getDemandedCommands();
|
||||
const deprecatedOptions = yargs.getDeprecatedOptions();
|
||||
const groups = yargs.getGroups();
|
||||
const options = yargs.getOptions();
|
||||
let keys = [];
|
||||
keys = keys.concat(Object.keys(descriptions));
|
||||
keys = keys.concat(Object.keys(demandedOptions));
|
||||
keys = keys.concat(Object.keys(demandedCommands));
|
||||
keys = keys.concat(Object.keys(options.default));
|
||||
keys = keys.filter(filterHiddenOptions);
|
||||
keys = Object.keys(keys.reduce((acc, key) => {
|
||||
if (key !== '_')
|
||||
acc[key] = true;
|
||||
return acc;
|
||||
}, {}));
|
||||
const theWrap = self.getWrap();
|
||||
const ui = shim.cliui({
|
||||
width: theWrap,
|
||||
wrap: !!theWrap,
|
||||
});
|
||||
if (!usageDisabled) {
|
||||
if (usages.length) {
|
||||
usages.forEach(usage => {
|
||||
ui.div({ text: `${usage[0].replace(/\$0/g, base$0)}` });
|
||||
if (usage[1]) {
|
||||
ui.div({ text: `${usage[1]}`, padding: [1, 0, 0, 0] });
|
||||
}
|
||||
});
|
||||
ui.div();
|
||||
}
|
||||
else if (commands.length) {
|
||||
let u = null;
|
||||
if (demandedCommands._) {
|
||||
u = `${base$0} <${__('command')}>\n`;
|
||||
}
|
||||
else {
|
||||
u = `${base$0} [${__('command')}]\n`;
|
||||
}
|
||||
ui.div(`${u}`);
|
||||
}
|
||||
}
|
||||
if (commands.length > 1 || (commands.length === 1 && !commands[0][2])) {
|
||||
ui.div(__('Commands:'));
|
||||
const context = yargs.getInternalMethods().getContext();
|
||||
const parentCommands = context.commands.length
|
||||
? `${context.commands.join(' ')} `
|
||||
: '';
|
||||
if (yargs.getInternalMethods().getParserConfiguration()['sort-commands'] ===
|
||||
true) {
|
||||
commands = commands.sort((a, b) => a[0].localeCompare(b[0]));
|
||||
}
|
||||
const prefix = base$0 ? `${base$0} ` : '';
|
||||
commands.forEach(command => {
|
||||
const commandString = `${prefix}${parentCommands}${command[0].replace(/^\$0 ?/, '')}`;
|
||||
ui.span({
|
||||
text: commandString,
|
||||
padding: [0, 2, 0, 2],
|
||||
width: maxWidth(commands, theWrap, `${base$0}${parentCommands}`) + 4,
|
||||
}, { text: command[1] });
|
||||
const hints = [];
|
||||
if (command[2])
|
||||
hints.push(`[${__('default')}]`);
|
||||
if (command[3] && command[3].length) {
|
||||
hints.push(`[${__('aliases:')} ${command[3].join(', ')}]`);
|
||||
}
|
||||
if (command[4]) {
|
||||
if (typeof command[4] === 'string') {
|
||||
hints.push(`[${__('deprecated: %s', command[4])}]`);
|
||||
}
|
||||
else {
|
||||
hints.push(`[${__('deprecated')}]`);
|
||||
}
|
||||
}
|
||||
if (hints.length) {
|
||||
ui.div({
|
||||
text: hints.join(' '),
|
||||
padding: [0, 0, 0, 2],
|
||||
align: 'right',
|
||||
});
|
||||
}
|
||||
else {
|
||||
ui.div();
|
||||
}
|
||||
});
|
||||
ui.div();
|
||||
}
|
||||
const aliasKeys = (Object.keys(options.alias) || []).concat(Object.keys(yargs.parsed.newAliases) || []);
|
||||
keys = keys.filter(key => !yargs.parsed.newAliases[key] &&
|
||||
aliasKeys.every(alias => (options.alias[alias] || []).indexOf(key) === -1));
|
||||
const defaultGroup = __('Options:');
|
||||
if (!groups[defaultGroup])
|
||||
groups[defaultGroup] = [];
|
||||
addUngroupedKeys(keys, options.alias, groups, defaultGroup);
|
||||
const isLongSwitch = (sw) => /^--/.test(getText(sw));
|
||||
const displayedGroups = Object.keys(groups)
|
||||
.filter(groupName => groups[groupName].length > 0)
|
||||
.map(groupName => {
|
||||
const normalizedKeys = groups[groupName]
|
||||
.filter(filterHiddenOptions)
|
||||
.map(key => {
|
||||
if (aliasKeys.includes(key))
|
||||
return key;
|
||||
for (let i = 0, aliasKey; (aliasKey = aliasKeys[i]) !== undefined; i++) {
|
||||
if ((options.alias[aliasKey] || []).includes(key))
|
||||
return aliasKey;
|
||||
}
|
||||
return key;
|
||||
});
|
||||
return { groupName, normalizedKeys };
|
||||
})
|
||||
.filter(({ normalizedKeys }) => normalizedKeys.length > 0)
|
||||
.map(({ groupName, normalizedKeys }) => {
|
||||
const switches = normalizedKeys.reduce((acc, key) => {
|
||||
acc[key] = [key]
|
||||
.concat(options.alias[key] || [])
|
||||
.map(sw => {
|
||||
if (groupName === self.getPositionalGroupName())
|
||||
return sw;
|
||||
else {
|
||||
return ((/^[0-9]$/.test(sw)
|
||||
? options.boolean.includes(key)
|
||||
? '-'
|
||||
: '--'
|
||||
: sw.length > 1
|
||||
? '--'
|
||||
: '-') + sw);
|
||||
}
|
||||
})
|
||||
.sort((sw1, sw2) => isLongSwitch(sw1) === isLongSwitch(sw2)
|
||||
? 0
|
||||
: isLongSwitch(sw1)
|
||||
? 1
|
||||
: -1)
|
||||
.join(', ');
|
||||
return acc;
|
||||
}, {});
|
||||
return { groupName, normalizedKeys, switches };
|
||||
});
|
||||
const shortSwitchesUsed = displayedGroups
|
||||
.filter(({ groupName }) => groupName !== self.getPositionalGroupName())
|
||||
.some(({ normalizedKeys, switches }) => !normalizedKeys.every(key => isLongSwitch(switches[key])));
|
||||
if (shortSwitchesUsed) {
|
||||
displayedGroups
|
||||
.filter(({ groupName }) => groupName !== self.getPositionalGroupName())
|
||||
.forEach(({ normalizedKeys, switches }) => {
|
||||
normalizedKeys.forEach(key => {
|
||||
if (isLongSwitch(switches[key])) {
|
||||
switches[key] = addIndentation(switches[key], '-x, '.length);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
displayedGroups.forEach(({ groupName, normalizedKeys, switches }) => {
|
||||
ui.div(groupName);
|
||||
normalizedKeys.forEach(key => {
|
||||
const kswitch = switches[key];
|
||||
let desc = descriptions[key] || '';
|
||||
let type = null;
|
||||
if (desc.includes(deferY18nLookupPrefix))
|
||||
desc = __(desc.substring(deferY18nLookupPrefix.length));
|
||||
if (options.boolean.includes(key))
|
||||
type = `[${__('boolean')}]`;
|
||||
if (options.count.includes(key))
|
||||
type = `[${__('count')}]`;
|
||||
if (options.string.includes(key))
|
||||
type = `[${__('string')}]`;
|
||||
if (options.normalize.includes(key))
|
||||
type = `[${__('string')}]`;
|
||||
if (options.array.includes(key))
|
||||
type = `[${__('array')}]`;
|
||||
if (options.number.includes(key))
|
||||
type = `[${__('number')}]`;
|
||||
const deprecatedExtra = (deprecated) => typeof deprecated === 'string'
|
||||
? `[${__('deprecated: %s', deprecated)}]`
|
||||
: `[${__('deprecated')}]`;
|
||||
const extra = [
|
||||
key in deprecatedOptions
|
||||
? deprecatedExtra(deprecatedOptions[key])
|
||||
: null,
|
||||
type,
|
||||
key in demandedOptions ? `[${__('required')}]` : null,
|
||||
options.choices && options.choices[key]
|
||||
? `[${__('choices:')} ${self.stringifiedValues(options.choices[key])}]`
|
||||
: null,
|
||||
defaultString(options.default[key], options.defaultDescription[key]),
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(' ');
|
||||
ui.span({
|
||||
text: getText(kswitch),
|
||||
padding: [0, 2, 0, 2 + getIndentation(kswitch)],
|
||||
width: maxWidth(switches, theWrap) + 4,
|
||||
}, desc);
|
||||
const shouldHideOptionExtras = yargs.getInternalMethods().getUsageConfiguration()['hide-types'] ===
|
||||
true;
|
||||
if (extra && !shouldHideOptionExtras)
|
||||
ui.div({ text: extra, padding: [0, 0, 0, 2], align: 'right' });
|
||||
else
|
||||
ui.div();
|
||||
});
|
||||
ui.div();
|
||||
});
|
||||
if (examples.length) {
|
||||
ui.div(__('Examples:'));
|
||||
examples.forEach(example => {
|
||||
example[0] = example[0].replace(/\$0/g, base$0);
|
||||
});
|
||||
examples.forEach(example => {
|
||||
if (example[1] === '') {
|
||||
ui.div({
|
||||
text: example[0],
|
||||
padding: [0, 2, 0, 2],
|
||||
});
|
||||
}
|
||||
else {
|
||||
ui.div({
|
||||
text: example[0],
|
||||
padding: [0, 2, 0, 2],
|
||||
width: maxWidth(examples, theWrap) + 4,
|
||||
}, {
|
||||
text: example[1],
|
||||
});
|
||||
}
|
||||
});
|
||||
ui.div();
|
||||
}
|
||||
if (epilogs.length > 0) {
|
||||
const e = epilogs
|
||||
.map(epilog => epilog.replace(/\$0/g, base$0))
|
||||
.join('\n');
|
||||
ui.div(`${e}\n`);
|
||||
}
|
||||
return ui.toString().replace(/\s*$/, '');
|
||||
};
|
||||
function maxWidth(table, theWrap, modifier) {
|
||||
let width = 0;
|
||||
if (!Array.isArray(table)) {
|
||||
table = Object.values(table).map(v => [v]);
|
||||
}
|
||||
table.forEach(v => {
|
||||
width = Math.max(shim.stringWidth(modifier ? `${modifier} ${getText(v[0])}` : getText(v[0])) + getIndentation(v[0]), width);
|
||||
});
|
||||
if (theWrap)
|
||||
width = Math.min(width, parseInt((theWrap * 0.5).toString(), 10));
|
||||
return width;
|
||||
}
|
||||
function normalizeAliases() {
|
||||
const demandedOptions = yargs.getDemandedOptions();
|
||||
const options = yargs.getOptions();
|
||||
(Object.keys(options.alias) || []).forEach(key => {
|
||||
options.alias[key].forEach(alias => {
|
||||
if (descriptions[alias])
|
||||
self.describe(key, descriptions[alias]);
|
||||
if (alias in demandedOptions)
|
||||
yargs.demandOption(key, demandedOptions[alias]);
|
||||
if (options.boolean.includes(alias))
|
||||
yargs.boolean(key);
|
||||
if (options.count.includes(alias))
|
||||
yargs.count(key);
|
||||
if (options.string.includes(alias))
|
||||
yargs.string(key);
|
||||
if (options.normalize.includes(alias))
|
||||
yargs.normalize(key);
|
||||
if (options.array.includes(alias))
|
||||
yargs.array(key);
|
||||
if (options.number.includes(alias))
|
||||
yargs.number(key);
|
||||
});
|
||||
});
|
||||
}
|
||||
let cachedHelpMessage;
|
||||
self.cacheHelpMessage = function () {
|
||||
cachedHelpMessage = this.help();
|
||||
};
|
||||
self.clearCachedHelpMessage = function () {
|
||||
cachedHelpMessage = undefined;
|
||||
};
|
||||
self.hasCachedHelpMessage = function () {
|
||||
return !!cachedHelpMessage;
|
||||
};
|
||||
function addUngroupedKeys(keys, aliases, groups, defaultGroup) {
|
||||
let groupedKeys = [];
|
||||
let toCheck = null;
|
||||
Object.keys(groups).forEach(group => {
|
||||
groupedKeys = groupedKeys.concat(groups[group]);
|
||||
});
|
||||
keys.forEach(key => {
|
||||
toCheck = [key].concat(aliases[key]);
|
||||
if (!toCheck.some(k => groupedKeys.indexOf(k) !== -1)) {
|
||||
groups[defaultGroup].push(key);
|
||||
}
|
||||
});
|
||||
return groupedKeys;
|
||||
}
|
||||
function filterHiddenOptions(key) {
|
||||
return (yargs.getOptions().hiddenOptions.indexOf(key) < 0 ||
|
||||
yargs.parsed.argv[yargs.getOptions().showHiddenOpt]);
|
||||
}
|
||||
self.showHelp = (level) => {
|
||||
const logger = yargs.getInternalMethods().getLoggerInstance();
|
||||
if (!level)
|
||||
level = 'error';
|
||||
const emit = typeof level === 'function' ? level : logger[level];
|
||||
emit(self.help());
|
||||
};
|
||||
self.functionDescription = fn => {
|
||||
const description = fn.name
|
||||
? shim.Parser.decamelize(fn.name, '-')
|
||||
: __('generated-value');
|
||||
return ['(', description, ')'].join('');
|
||||
};
|
||||
self.stringifiedValues = function stringifiedValues(values, separator) {
|
||||
let string = '';
|
||||
const sep = separator || ', ';
|
||||
const array = [].concat(values);
|
||||
if (!values || !array.length)
|
||||
return string;
|
||||
array.forEach(value => {
|
||||
if (string.length)
|
||||
string += sep;
|
||||
string += JSON.stringify(value);
|
||||
});
|
||||
return string;
|
||||
};
|
||||
function defaultString(value, defaultDescription) {
|
||||
let string = `[${__('default:')} `;
|
||||
if (value === undefined && !defaultDescription)
|
||||
return null;
|
||||
if (defaultDescription) {
|
||||
string += defaultDescription;
|
||||
}
|
||||
else {
|
||||
switch (typeof value) {
|
||||
case 'string':
|
||||
string += `"${value}"`;
|
||||
break;
|
||||
case 'object':
|
||||
string += JSON.stringify(value);
|
||||
break;
|
||||
default:
|
||||
string += value;
|
||||
}
|
||||
}
|
||||
return `${string}]`;
|
||||
}
|
||||
function windowWidth() {
|
||||
const maxWidth = 80;
|
||||
if (shim.process.stdColumns) {
|
||||
return Math.min(maxWidth, shim.process.stdColumns);
|
||||
}
|
||||
else {
|
||||
return maxWidth;
|
||||
}
|
||||
}
|
||||
let version = null;
|
||||
self.version = ver => {
|
||||
version = ver;
|
||||
};
|
||||
self.showVersion = level => {
|
||||
const logger = yargs.getInternalMethods().getLoggerInstance();
|
||||
if (!level)
|
||||
level = 'error';
|
||||
const emit = typeof level === 'function' ? level : logger[level];
|
||||
emit(version);
|
||||
};
|
||||
self.reset = function reset(localLookup) {
|
||||
failMessage = null;
|
||||
failureOutput = false;
|
||||
usages = [];
|
||||
usageDisabled = false;
|
||||
epilogs = [];
|
||||
examples = [];
|
||||
commands = [];
|
||||
descriptions = objFilter(descriptions, k => !localLookup[k]);
|
||||
return self;
|
||||
};
|
||||
const frozens = [];
|
||||
self.freeze = function freeze() {
|
||||
frozens.push({
|
||||
failMessage,
|
||||
failureOutput,
|
||||
usages,
|
||||
usageDisabled,
|
||||
epilogs,
|
||||
examples,
|
||||
commands,
|
||||
descriptions,
|
||||
});
|
||||
};
|
||||
self.unfreeze = function unfreeze(defaultCommand = false) {
|
||||
const frozen = frozens.pop();
|
||||
if (!frozen)
|
||||
return;
|
||||
if (defaultCommand) {
|
||||
descriptions = { ...frozen.descriptions, ...descriptions };
|
||||
commands = [...frozen.commands, ...commands];
|
||||
usages = [...frozen.usages, ...usages];
|
||||
examples = [...frozen.examples, ...examples];
|
||||
epilogs = [...frozen.epilogs, ...epilogs];
|
||||
}
|
||||
else {
|
||||
({
|
||||
failMessage,
|
||||
failureOutput,
|
||||
usages,
|
||||
usageDisabled,
|
||||
epilogs,
|
||||
examples,
|
||||
commands,
|
||||
descriptions,
|
||||
} = frozen);
|
||||
}
|
||||
};
|
||||
return self;
|
||||
}
|
||||
function isIndentedText(text) {
|
||||
return typeof text === 'object';
|
||||
}
|
||||
function addIndentation(text, indent) {
|
||||
return isIndentedText(text)
|
||||
? { text: text.text, indentation: text.indentation + indent }
|
||||
: { text, indentation: indent };
|
||||
}
|
||||
function getIndentation(text) {
|
||||
return isIndentedText(text) ? text.indentation : 0;
|
||||
}
|
||||
function getText(text) {
|
||||
return isIndentedText(text) ? text.text : text;
|
||||
}
|
59
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/utils/apply-extends.js
generated
vendored
Normal file
59
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/utils/apply-extends.js
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
import { YError } from '../yerror.js';
|
||||
let previouslyVisitedConfigs = [];
|
||||
let shim;
|
||||
export function applyExtends(config, cwd, mergeExtends, _shim) {
|
||||
shim = _shim;
|
||||
let defaultConfig = {};
|
||||
if (Object.prototype.hasOwnProperty.call(config, 'extends')) {
|
||||
if (typeof config.extends !== 'string')
|
||||
return defaultConfig;
|
||||
const isPath = /\.json|\..*rc$/.test(config.extends);
|
||||
let pathToDefault = null;
|
||||
if (!isPath) {
|
||||
try {
|
||||
pathToDefault = require.resolve(config.extends);
|
||||
}
|
||||
catch (_err) {
|
||||
return config;
|
||||
}
|
||||
}
|
||||
else {
|
||||
pathToDefault = getPathToDefaultConfig(cwd, config.extends);
|
||||
}
|
||||
checkForCircularExtends(pathToDefault);
|
||||
previouslyVisitedConfigs.push(pathToDefault);
|
||||
defaultConfig = isPath
|
||||
? JSON.parse(shim.readFileSync(pathToDefault, 'utf8'))
|
||||
: require(config.extends);
|
||||
delete config.extends;
|
||||
defaultConfig = applyExtends(defaultConfig, shim.path.dirname(pathToDefault), mergeExtends, shim);
|
||||
}
|
||||
previouslyVisitedConfigs = [];
|
||||
return mergeExtends
|
||||
? mergeDeep(defaultConfig, config)
|
||||
: Object.assign({}, defaultConfig, config);
|
||||
}
|
||||
function checkForCircularExtends(cfgPath) {
|
||||
if (previouslyVisitedConfigs.indexOf(cfgPath) > -1) {
|
||||
throw new YError(`Circular extended configurations: '${cfgPath}'.`);
|
||||
}
|
||||
}
|
||||
function getPathToDefaultConfig(cwd, pathToExtend) {
|
||||
return shim.path.resolve(cwd, pathToExtend);
|
||||
}
|
||||
function mergeDeep(config1, config2) {
|
||||
const target = {};
|
||||
function isObject(obj) {
|
||||
return obj && typeof obj === 'object' && !Array.isArray(obj);
|
||||
}
|
||||
Object.assign(target, config1);
|
||||
for (const key of Object.keys(config2)) {
|
||||
if (isObject(config2[key]) && isObject(target[key])) {
|
||||
target[key] = mergeDeep(config1[key], config2[key]);
|
||||
}
|
||||
else {
|
||||
target[key] = config2[key];
|
||||
}
|
||||
}
|
||||
return target;
|
||||
}
|
5
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/utils/is-promise.js
generated
vendored
Normal file
5
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/utils/is-promise.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export function isPromise(maybePromise) {
|
||||
return (!!maybePromise &&
|
||||
!!maybePromise.then &&
|
||||
typeof maybePromise.then === 'function');
|
||||
}
|
34
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/utils/levenshtein.js
generated
vendored
Normal file
34
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/utils/levenshtein.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
export function levenshtein(a, b) {
|
||||
if (a.length === 0)
|
||||
return b.length;
|
||||
if (b.length === 0)
|
||||
return a.length;
|
||||
const matrix = [];
|
||||
let i;
|
||||
for (i = 0; i <= b.length; i++) {
|
||||
matrix[i] = [i];
|
||||
}
|
||||
let j;
|
||||
for (j = 0; j <= a.length; j++) {
|
||||
matrix[0][j] = j;
|
||||
}
|
||||
for (i = 1; i <= b.length; i++) {
|
||||
for (j = 1; j <= a.length; j++) {
|
||||
if (b.charAt(i - 1) === a.charAt(j - 1)) {
|
||||
matrix[i][j] = matrix[i - 1][j - 1];
|
||||
}
|
||||
else {
|
||||
if (i > 1 &&
|
||||
j > 1 &&
|
||||
b.charAt(i - 2) === a.charAt(j - 1) &&
|
||||
b.charAt(i - 1) === a.charAt(j - 2)) {
|
||||
matrix[i][j] = matrix[i - 2][j - 2] + 1;
|
||||
}
|
||||
else {
|
||||
matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, Math.min(matrix[i][j - 1] + 1, matrix[i - 1][j] + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return matrix[b.length][a.length];
|
||||
}
|
17
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/utils/maybe-async-result.js
generated
vendored
Normal file
17
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/utils/maybe-async-result.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import { isPromise } from './is-promise.js';
|
||||
export function maybeAsyncResult(getResult, resultHandler, errorHandler = (err) => {
|
||||
throw err;
|
||||
}) {
|
||||
try {
|
||||
const result = isFunction(getResult) ? getResult() : getResult;
|
||||
return isPromise(result)
|
||||
? result.then((result) => resultHandler(result))
|
||||
: resultHandler(result);
|
||||
}
|
||||
catch (err) {
|
||||
return errorHandler(err);
|
||||
}
|
||||
}
|
||||
function isFunction(arg) {
|
||||
return typeof arg === 'function';
|
||||
}
|
10
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/utils/obj-filter.js
generated
vendored
Normal file
10
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/utils/obj-filter.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import { objectKeys } from '../typings/common-types.js';
|
||||
export function objFilter(original = {}, filter = () => true) {
|
||||
const obj = {};
|
||||
objectKeys(original).forEach(key => {
|
||||
if (filter(key, original[key])) {
|
||||
obj[key] = original[key];
|
||||
}
|
||||
});
|
||||
return obj;
|
||||
}
|
17
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/utils/process-argv.js
generated
vendored
Normal file
17
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/utils/process-argv.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
function getProcessArgvBinIndex() {
|
||||
if (isBundledElectronApp())
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
function isBundledElectronApp() {
|
||||
return isElectronApp() && !process.defaultApp;
|
||||
}
|
||||
function isElectronApp() {
|
||||
return !!process.versions.electron;
|
||||
}
|
||||
export function hideBin(argv) {
|
||||
return argv.slice(getProcessArgvBinIndex() + 1);
|
||||
}
|
||||
export function getProcessArgvBin() {
|
||||
return process.argv[getProcessArgvBinIndex()];
|
||||
}
|
12
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/utils/set-blocking.js
generated
vendored
Normal file
12
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/utils/set-blocking.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
export default function setBlocking(blocking) {
|
||||
if (typeof process === 'undefined')
|
||||
return;
|
||||
[process.stdout, process.stderr].forEach(_stream => {
|
||||
const stream = _stream;
|
||||
if (stream._handle &&
|
||||
stream.isTTY &&
|
||||
typeof stream._handle.setBlocking === 'function') {
|
||||
stream._handle.setBlocking(blocking);
|
||||
}
|
||||
});
|
||||
}
|
10
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/utils/which-module.js
generated
vendored
Normal file
10
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/utils/which-module.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
export default function whichModule(exported) {
|
||||
if (typeof require === 'undefined')
|
||||
return null;
|
||||
for (let i = 0, files = Object.keys(require.cache), mod; i < files.length; i++) {
|
||||
mod = require.cache[files[i]];
|
||||
if (mod.exports === exported)
|
||||
return mod;
|
||||
}
|
||||
return null;
|
||||
}
|
305
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/validation.js
generated
vendored
Normal file
305
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/validation.js
generated
vendored
Normal file
@@ -0,0 +1,305 @@
|
||||
import { argsert } from './argsert.js';
|
||||
import { assertNotStrictEqual, } from './typings/common-types.js';
|
||||
import { levenshtein as distance } from './utils/levenshtein.js';
|
||||
import { objFilter } from './utils/obj-filter.js';
|
||||
const specialKeys = ['$0', '--', '_'];
|
||||
export function validation(yargs, usage, shim) {
|
||||
const __ = shim.y18n.__;
|
||||
const __n = shim.y18n.__n;
|
||||
const self = {};
|
||||
self.nonOptionCount = function nonOptionCount(argv) {
|
||||
const demandedCommands = yargs.getDemandedCommands();
|
||||
const positionalCount = argv._.length + (argv['--'] ? argv['--'].length : 0);
|
||||
const _s = positionalCount - yargs.getInternalMethods().getContext().commands.length;
|
||||
if (demandedCommands._ &&
|
||||
(_s < demandedCommands._.min || _s > demandedCommands._.max)) {
|
||||
if (_s < demandedCommands._.min) {
|
||||
if (demandedCommands._.minMsg !== undefined) {
|
||||
usage.fail(demandedCommands._.minMsg
|
||||
? demandedCommands._.minMsg
|
||||
.replace(/\$0/g, _s.toString())
|
||||
.replace(/\$1/, demandedCommands._.min.toString())
|
||||
: null);
|
||||
}
|
||||
else {
|
||||
usage.fail(__n('Not enough non-option arguments: got %s, need at least %s', 'Not enough non-option arguments: got %s, need at least %s', _s, _s.toString(), demandedCommands._.min.toString()));
|
||||
}
|
||||
}
|
||||
else if (_s > demandedCommands._.max) {
|
||||
if (demandedCommands._.maxMsg !== undefined) {
|
||||
usage.fail(demandedCommands._.maxMsg
|
||||
? demandedCommands._.maxMsg
|
||||
.replace(/\$0/g, _s.toString())
|
||||
.replace(/\$1/, demandedCommands._.max.toString())
|
||||
: null);
|
||||
}
|
||||
else {
|
||||
usage.fail(__n('Too many non-option arguments: got %s, maximum of %s', 'Too many non-option arguments: got %s, maximum of %s', _s, _s.toString(), demandedCommands._.max.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
self.positionalCount = function positionalCount(required, observed) {
|
||||
if (observed < required) {
|
||||
usage.fail(__n('Not enough non-option arguments: got %s, need at least %s', 'Not enough non-option arguments: got %s, need at least %s', observed, observed + '', required + ''));
|
||||
}
|
||||
};
|
||||
self.requiredArguments = function requiredArguments(argv, demandedOptions) {
|
||||
let missing = null;
|
||||
for (const key of Object.keys(demandedOptions)) {
|
||||
if (!Object.prototype.hasOwnProperty.call(argv, key) ||
|
||||
typeof argv[key] === 'undefined') {
|
||||
missing = missing || {};
|
||||
missing[key] = demandedOptions[key];
|
||||
}
|
||||
}
|
||||
if (missing) {
|
||||
const customMsgs = [];
|
||||
for (const key of Object.keys(missing)) {
|
||||
const msg = missing[key];
|
||||
if (msg && customMsgs.indexOf(msg) < 0) {
|
||||
customMsgs.push(msg);
|
||||
}
|
||||
}
|
||||
const customMsg = customMsgs.length ? `\n${customMsgs.join('\n')}` : '';
|
||||
usage.fail(__n('Missing required argument: %s', 'Missing required arguments: %s', Object.keys(missing).length, Object.keys(missing).join(', ') + customMsg));
|
||||
}
|
||||
};
|
||||
self.unknownArguments = function unknownArguments(argv, aliases, positionalMap, isDefaultCommand, checkPositionals = true) {
|
||||
var _a;
|
||||
const commandKeys = yargs
|
||||
.getInternalMethods()
|
||||
.getCommandInstance()
|
||||
.getCommands();
|
||||
const unknown = [];
|
||||
const currentContext = yargs.getInternalMethods().getContext();
|
||||
Object.keys(argv).forEach(key => {
|
||||
if (!specialKeys.includes(key) &&
|
||||
!Object.prototype.hasOwnProperty.call(positionalMap, key) &&
|
||||
!Object.prototype.hasOwnProperty.call(yargs.getInternalMethods().getParseContext(), key) &&
|
||||
!self.isValidAndSomeAliasIsNotNew(key, aliases)) {
|
||||
unknown.push(key);
|
||||
}
|
||||
});
|
||||
if (checkPositionals &&
|
||||
(currentContext.commands.length > 0 ||
|
||||
commandKeys.length > 0 ||
|
||||
isDefaultCommand)) {
|
||||
argv._.slice(currentContext.commands.length).forEach(key => {
|
||||
if (!commandKeys.includes('' + key)) {
|
||||
unknown.push('' + key);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (checkPositionals) {
|
||||
const demandedCommands = yargs.getDemandedCommands();
|
||||
const maxNonOptDemanded = ((_a = demandedCommands._) === null || _a === void 0 ? void 0 : _a.max) || 0;
|
||||
const expected = currentContext.commands.length + maxNonOptDemanded;
|
||||
if (expected < argv._.length) {
|
||||
argv._.slice(expected).forEach(key => {
|
||||
key = String(key);
|
||||
if (!currentContext.commands.includes(key) &&
|
||||
!unknown.includes(key)) {
|
||||
unknown.push(key);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
if (unknown.length) {
|
||||
usage.fail(__n('Unknown argument: %s', 'Unknown arguments: %s', unknown.length, unknown.map(s => (s.trim() ? s : `"${s}"`)).join(', ')));
|
||||
}
|
||||
};
|
||||
self.unknownCommands = function unknownCommands(argv) {
|
||||
const commandKeys = yargs
|
||||
.getInternalMethods()
|
||||
.getCommandInstance()
|
||||
.getCommands();
|
||||
const unknown = [];
|
||||
const currentContext = yargs.getInternalMethods().getContext();
|
||||
if (currentContext.commands.length > 0 || commandKeys.length > 0) {
|
||||
argv._.slice(currentContext.commands.length).forEach(key => {
|
||||
if (!commandKeys.includes('' + key)) {
|
||||
unknown.push('' + key);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (unknown.length > 0) {
|
||||
usage.fail(__n('Unknown command: %s', 'Unknown commands: %s', unknown.length, unknown.join(', ')));
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
self.isValidAndSomeAliasIsNotNew = function isValidAndSomeAliasIsNotNew(key, aliases) {
|
||||
if (!Object.prototype.hasOwnProperty.call(aliases, key)) {
|
||||
return false;
|
||||
}
|
||||
const newAliases = yargs.parsed.newAliases;
|
||||
return [key, ...aliases[key]].some(a => !Object.prototype.hasOwnProperty.call(newAliases, a) || !newAliases[key]);
|
||||
};
|
||||
self.limitedChoices = function limitedChoices(argv) {
|
||||
const options = yargs.getOptions();
|
||||
const invalid = {};
|
||||
if (!Object.keys(options.choices).length)
|
||||
return;
|
||||
Object.keys(argv).forEach(key => {
|
||||
if (specialKeys.indexOf(key) === -1 &&
|
||||
Object.prototype.hasOwnProperty.call(options.choices, key)) {
|
||||
[].concat(argv[key]).forEach(value => {
|
||||
if (options.choices[key].indexOf(value) === -1 &&
|
||||
value !== undefined) {
|
||||
invalid[key] = (invalid[key] || []).concat(value);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
const invalidKeys = Object.keys(invalid);
|
||||
if (!invalidKeys.length)
|
||||
return;
|
||||
let msg = __('Invalid values:');
|
||||
invalidKeys.forEach(key => {
|
||||
msg += `\n ${__('Argument: %s, Given: %s, Choices: %s', key, usage.stringifiedValues(invalid[key]), usage.stringifiedValues(options.choices[key]))}`;
|
||||
});
|
||||
usage.fail(msg);
|
||||
};
|
||||
let implied = {};
|
||||
self.implies = function implies(key, value) {
|
||||
argsert('<string|object> [array|number|string]', [key, value], arguments.length);
|
||||
if (typeof key === 'object') {
|
||||
Object.keys(key).forEach(k => {
|
||||
self.implies(k, key[k]);
|
||||
});
|
||||
}
|
||||
else {
|
||||
yargs.global(key);
|
||||
if (!implied[key]) {
|
||||
implied[key] = [];
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
value.forEach(i => self.implies(key, i));
|
||||
}
|
||||
else {
|
||||
assertNotStrictEqual(value, undefined, shim);
|
||||
implied[key].push(value);
|
||||
}
|
||||
}
|
||||
};
|
||||
self.getImplied = function getImplied() {
|
||||
return implied;
|
||||
};
|
||||
function keyExists(argv, val) {
|
||||
const num = Number(val);
|
||||
val = isNaN(num) ? val : num;
|
||||
if (typeof val === 'number') {
|
||||
val = argv._.length >= val;
|
||||
}
|
||||
else if (val.match(/^--no-.+/)) {
|
||||
val = val.match(/^--no-(.+)/)[1];
|
||||
val = !Object.prototype.hasOwnProperty.call(argv, val);
|
||||
}
|
||||
else {
|
||||
val = Object.prototype.hasOwnProperty.call(argv, val);
|
||||
}
|
||||
return val;
|
||||
}
|
||||
self.implications = function implications(argv) {
|
||||
const implyFail = [];
|
||||
Object.keys(implied).forEach(key => {
|
||||
const origKey = key;
|
||||
(implied[key] || []).forEach(value => {
|
||||
let key = origKey;
|
||||
const origValue = value;
|
||||
key = keyExists(argv, key);
|
||||
value = keyExists(argv, value);
|
||||
if (key && !value) {
|
||||
implyFail.push(` ${origKey} -> ${origValue}`);
|
||||
}
|
||||
});
|
||||
});
|
||||
if (implyFail.length) {
|
||||
let msg = `${__('Implications failed:')}\n`;
|
||||
implyFail.forEach(value => {
|
||||
msg += value;
|
||||
});
|
||||
usage.fail(msg);
|
||||
}
|
||||
};
|
||||
let conflicting = {};
|
||||
self.conflicts = function conflicts(key, value) {
|
||||
argsert('<string|object> [array|string]', [key, value], arguments.length);
|
||||
if (typeof key === 'object') {
|
||||
Object.keys(key).forEach(k => {
|
||||
self.conflicts(k, key[k]);
|
||||
});
|
||||
}
|
||||
else {
|
||||
yargs.global(key);
|
||||
if (!conflicting[key]) {
|
||||
conflicting[key] = [];
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
value.forEach(i => self.conflicts(key, i));
|
||||
}
|
||||
else {
|
||||
conflicting[key].push(value);
|
||||
}
|
||||
}
|
||||
};
|
||||
self.getConflicting = () => conflicting;
|
||||
self.conflicting = function conflictingFn(argv) {
|
||||
Object.keys(argv).forEach(key => {
|
||||
if (conflicting[key]) {
|
||||
conflicting[key].forEach(value => {
|
||||
if (value && argv[key] !== undefined && argv[value] !== undefined) {
|
||||
usage.fail(__('Arguments %s and %s are mutually exclusive', key, value));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
if (yargs.getInternalMethods().getParserConfiguration()['strip-dashed']) {
|
||||
Object.keys(conflicting).forEach(key => {
|
||||
conflicting[key].forEach(value => {
|
||||
if (value &&
|
||||
argv[shim.Parser.camelCase(key)] !== undefined &&
|
||||
argv[shim.Parser.camelCase(value)] !== undefined) {
|
||||
usage.fail(__('Arguments %s and %s are mutually exclusive', key, value));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
self.recommendCommands = function recommendCommands(cmd, potentialCommands) {
|
||||
const threshold = 3;
|
||||
potentialCommands = potentialCommands.sort((a, b) => b.length - a.length);
|
||||
let recommended = null;
|
||||
let bestDistance = Infinity;
|
||||
for (let i = 0, candidate; (candidate = potentialCommands[i]) !== undefined; i++) {
|
||||
const d = distance(cmd, candidate);
|
||||
if (d <= threshold && d < bestDistance) {
|
||||
bestDistance = d;
|
||||
recommended = candidate;
|
||||
}
|
||||
}
|
||||
if (recommended)
|
||||
usage.fail(__('Did you mean %s?', recommended));
|
||||
};
|
||||
self.reset = function reset(localLookup) {
|
||||
implied = objFilter(implied, k => !localLookup[k]);
|
||||
conflicting = objFilter(conflicting, k => !localLookup[k]);
|
||||
return self;
|
||||
};
|
||||
const frozens = [];
|
||||
self.freeze = function freeze() {
|
||||
frozens.push({
|
||||
implied,
|
||||
conflicting,
|
||||
});
|
||||
};
|
||||
self.unfreeze = function unfreeze() {
|
||||
const frozen = frozens.pop();
|
||||
assertNotStrictEqual(frozen, undefined, shim);
|
||||
({ implied, conflicting } = frozen);
|
||||
};
|
||||
return self;
|
||||
}
|
1512
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/yargs-factory.js
generated
vendored
Normal file
1512
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/yargs-factory.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
9
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/yerror.js
generated
vendored
Normal file
9
backend/node_modules/postcss-cli/node_modules/yargs/build/lib/yerror.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
export class YError extends Error {
|
||||
constructor(msg) {
|
||||
super(msg || 'yargs error');
|
||||
this.name = 'YError';
|
||||
if (Error.captureStackTrace) {
|
||||
Error.captureStackTrace(this, YError);
|
||||
}
|
||||
}
|
||||
}
|
10
backend/node_modules/postcss-cli/node_modules/yargs/helpers/helpers.mjs
generated
vendored
Normal file
10
backend/node_modules/postcss-cli/node_modules/yargs/helpers/helpers.mjs
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import {applyExtends as _applyExtends} from '../build/lib/utils/apply-extends.js';
|
||||
import {hideBin} from '../build/lib/utils/process-argv.js';
|
||||
import Parser from 'yargs-parser';
|
||||
import shim from '../lib/platform-shims/esm.mjs';
|
||||
|
||||
const applyExtends = (config, cwd, mergeExtends) => {
|
||||
return _applyExtends(config, cwd, mergeExtends, shim);
|
||||
};
|
||||
|
||||
export {applyExtends, hideBin, Parser};
|
14
backend/node_modules/postcss-cli/node_modules/yargs/helpers/index.js
generated
vendored
Normal file
14
backend/node_modules/postcss-cli/node_modules/yargs/helpers/index.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
const {
|
||||
applyExtends,
|
||||
cjsPlatformShim,
|
||||
Parser,
|
||||
processArgv,
|
||||
} = require('../build/index.cjs');
|
||||
|
||||
module.exports = {
|
||||
applyExtends: (config, cwd, mergeExtends) => {
|
||||
return applyExtends(config, cwd, mergeExtends, cjsPlatformShim);
|
||||
},
|
||||
hideBin: processArgv.hideBin,
|
||||
Parser,
|
||||
};
|
3
backend/node_modules/postcss-cli/node_modules/yargs/helpers/package.json
generated
vendored
Normal file
3
backend/node_modules/postcss-cli/node_modules/yargs/helpers/package.json
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"type": "commonjs"
|
||||
}
|
53
backend/node_modules/postcss-cli/node_modules/yargs/index.cjs
generated
vendored
Normal file
53
backend/node_modules/postcss-cli/node_modules/yargs/index.cjs
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
'use strict';
|
||||
// classic singleton yargs API, to use yargs
|
||||
// without running as a singleton do:
|
||||
// require('yargs/yargs')(process.argv.slice(2))
|
||||
const {Yargs, processArgv} = require('./build/index.cjs');
|
||||
|
||||
Argv(processArgv.hideBin(process.argv));
|
||||
|
||||
module.exports = Argv;
|
||||
|
||||
function Argv(processArgs, cwd) {
|
||||
const argv = Yargs(processArgs, cwd, require);
|
||||
singletonify(argv);
|
||||
// TODO(bcoe): warn if argv.parse() or argv.argv is used directly.
|
||||
return argv;
|
||||
}
|
||||
|
||||
function defineGetter(obj, key, getter) {
|
||||
Object.defineProperty(obj, key, {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get: getter,
|
||||
});
|
||||
}
|
||||
function lookupGetter(obj, key) {
|
||||
const desc = Object.getOwnPropertyDescriptor(obj, key);
|
||||
if (typeof desc !== 'undefined') {
|
||||
return desc.get;
|
||||
}
|
||||
}
|
||||
|
||||
/* Hack an instance of Argv with process.argv into Argv
|
||||
so people can do
|
||||
require('yargs')(['--beeble=1','-z','zizzle']).argv
|
||||
to parse a list of args and
|
||||
require('yargs').argv
|
||||
to get a parsed version of process.argv.
|
||||
*/
|
||||
function singletonify(inst) {
|
||||
[
|
||||
...Object.keys(inst),
|
||||
...Object.getOwnPropertyNames(inst.constructor.prototype),
|
||||
].forEach(key => {
|
||||
if (key === 'argv') {
|
||||
defineGetter(Argv, key, lookupGetter(inst, key));
|
||||
} else if (typeof inst[key] === 'function') {
|
||||
Argv[key] = inst[key].bind(inst);
|
||||
} else {
|
||||
defineGetter(Argv, '$0', () => inst.$0);
|
||||
defineGetter(Argv, 'parsed', () => inst.parsed);
|
||||
}
|
||||
});
|
||||
}
|
8
backend/node_modules/postcss-cli/node_modules/yargs/index.mjs
generated
vendored
Normal file
8
backend/node_modules/postcss-cli/node_modules/yargs/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
// Bootstraps yargs for ESM:
|
||||
import esmPlatformShim from './lib/platform-shims/esm.mjs';
|
||||
import {YargsFactory} from './build/lib/yargs-factory.js';
|
||||
|
||||
const Yargs = YargsFactory(esmPlatformShim);
|
||||
export default Yargs;
|
95
backend/node_modules/postcss-cli/node_modules/yargs/lib/platform-shims/browser.mjs
generated
vendored
Normal file
95
backend/node_modules/postcss-cli/node_modules/yargs/lib/platform-shims/browser.mjs
generated
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
'use strict';
|
||||
|
||||
import cliui from 'https://unpkg.com/cliui@7.0.1/index.mjs'; // eslint-disable-line
|
||||
import Parser from 'https://unpkg.com/yargs-parser@19.0.0/browser.js'; // eslint-disable-line
|
||||
import {getProcessArgvBin} from '../../build/lib/utils/process-argv.js';
|
||||
import {YError} from '../../build/lib/yerror.js';
|
||||
|
||||
const REQUIRE_ERROR = 'require is not supported in browser';
|
||||
const REQUIRE_DIRECTORY_ERROR =
|
||||
'loading a directory of commands is not supported in browser';
|
||||
|
||||
export default {
|
||||
assert: {
|
||||
notStrictEqual: (a, b) => {
|
||||
// noop.
|
||||
},
|
||||
strictEqual: (a, b) => {
|
||||
// noop.
|
||||
},
|
||||
},
|
||||
cliui,
|
||||
findUp: () => undefined,
|
||||
getEnv: key => {
|
||||
// There is no environment in browser:
|
||||
return undefined;
|
||||
},
|
||||
inspect: console.log,
|
||||
getCallerFile: () => {
|
||||
throw new YError(REQUIRE_DIRECTORY_ERROR);
|
||||
},
|
||||
getProcessArgvBin,
|
||||
mainFilename: 'yargs',
|
||||
Parser,
|
||||
path: {
|
||||
basename: str => str,
|
||||
dirname: str => str,
|
||||
extname: str => str,
|
||||
relative: str => str,
|
||||
},
|
||||
process: {
|
||||
argv: () => [],
|
||||
cwd: () => '',
|
||||
emitWarning: (warning, name) => {},
|
||||
execPath: () => '',
|
||||
// exit is noop browser:
|
||||
exit: () => {},
|
||||
nextTick: cb => {
|
||||
// eslint-disable-next-line no-undef
|
||||
window.setTimeout(cb, 1);
|
||||
},
|
||||
stdColumns: 80,
|
||||
},
|
||||
readFileSync: () => {
|
||||
return '';
|
||||
},
|
||||
require: () => {
|
||||
throw new YError(REQUIRE_ERROR);
|
||||
},
|
||||
requireDirectory: () => {
|
||||
throw new YError(REQUIRE_DIRECTORY_ERROR);
|
||||
},
|
||||
stringWidth: str => {
|
||||
return [...str].length;
|
||||
},
|
||||
// TODO: replace this with y18n once it's ported to ESM:
|
||||
y18n: {
|
||||
__: (...str) => {
|
||||
if (str.length === 0) return '';
|
||||
const args = str.slice(1);
|
||||
return sprintf(str[0], ...args);
|
||||
},
|
||||
__n: (str1, str2, count, ...args) => {
|
||||
if (count === 1) {
|
||||
return sprintf(str1, ...args);
|
||||
} else {
|
||||
return sprintf(str2, ...args);
|
||||
}
|
||||
},
|
||||
getLocale: () => {
|
||||
return 'en_US';
|
||||
},
|
||||
setLocale: () => {},
|
||||
updateLocale: () => {},
|
||||
},
|
||||
};
|
||||
|
||||
function sprintf(_str, ...args) {
|
||||
let str = '';
|
||||
const split = _str.split('%s');
|
||||
split.forEach((token, i) => {
|
||||
str += `${token}${split[i + 1] !== undefined && args[i] ? args[i] : ''}`;
|
||||
});
|
||||
return str;
|
||||
}
|
73
backend/node_modules/postcss-cli/node_modules/yargs/lib/platform-shims/esm.mjs
generated
vendored
Normal file
73
backend/node_modules/postcss-cli/node_modules/yargs/lib/platform-shims/esm.mjs
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
'use strict'
|
||||
|
||||
import { notStrictEqual, strictEqual } from 'assert'
|
||||
import cliui from 'cliui'
|
||||
import escalade from 'escalade/sync'
|
||||
import { inspect } from 'util'
|
||||
import { readFileSync } from 'fs'
|
||||
import { fileURLToPath } from 'url';
|
||||
import Parser from 'yargs-parser'
|
||||
import { basename, dirname, extname, relative, resolve } from 'path'
|
||||
import { getProcessArgvBin } from '../../build/lib/utils/process-argv.js'
|
||||
import { YError } from '../../build/lib/yerror.js'
|
||||
import y18n from 'y18n'
|
||||
|
||||
const REQUIRE_ERROR = 'require is not supported by ESM'
|
||||
const REQUIRE_DIRECTORY_ERROR = 'loading a directory of commands is not supported yet for ESM'
|
||||
|
||||
let __dirname;
|
||||
try {
|
||||
__dirname = fileURLToPath(import.meta.url);
|
||||
} catch (e) {
|
||||
__dirname = process.cwd();
|
||||
}
|
||||
const mainFilename = __dirname.substring(0, __dirname.lastIndexOf('node_modules'));
|
||||
|
||||
export default {
|
||||
assert: {
|
||||
notStrictEqual,
|
||||
strictEqual
|
||||
},
|
||||
cliui,
|
||||
findUp: escalade,
|
||||
getEnv: (key) => {
|
||||
return process.env[key]
|
||||
},
|
||||
inspect,
|
||||
getCallerFile: () => {
|
||||
throw new YError(REQUIRE_DIRECTORY_ERROR)
|
||||
},
|
||||
getProcessArgvBin,
|
||||
mainFilename: mainFilename || process.cwd(),
|
||||
Parser,
|
||||
path: {
|
||||
basename,
|
||||
dirname,
|
||||
extname,
|
||||
relative,
|
||||
resolve
|
||||
},
|
||||
process: {
|
||||
argv: () => process.argv,
|
||||
cwd: process.cwd,
|
||||
emitWarning: (warning, type) => process.emitWarning(warning, type),
|
||||
execPath: () => process.execPath,
|
||||
exit: process.exit,
|
||||
nextTick: process.nextTick,
|
||||
stdColumns: typeof process.stdout.columns !== 'undefined' ? process.stdout.columns : null
|
||||
},
|
||||
readFileSync,
|
||||
require: () => {
|
||||
throw new YError(REQUIRE_ERROR)
|
||||
},
|
||||
requireDirectory: () => {
|
||||
throw new YError(REQUIRE_DIRECTORY_ERROR)
|
||||
},
|
||||
stringWidth: (str) => {
|
||||
return [...str].length
|
||||
},
|
||||
y18n: y18n({
|
||||
directory: resolve(__dirname, '../../../locales'),
|
||||
updateFiles: false
|
||||
})
|
||||
}
|
46
backend/node_modules/postcss-cli/node_modules/yargs/locales/be.json
generated
vendored
Normal file
46
backend/node_modules/postcss-cli/node_modules/yargs/locales/be.json
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"Commands:": "Каманды:",
|
||||
"Options:": "Опцыі:",
|
||||
"Examples:": "Прыклады:",
|
||||
"boolean": "булевы тып",
|
||||
"count": "падлік",
|
||||
"string": "радковы тып",
|
||||
"number": "лік",
|
||||
"array": "масіў",
|
||||
"required": "неабходна",
|
||||
"default": "па змаўчанні",
|
||||
"default:": "па змаўчанні:",
|
||||
"choices:": "магчымасці:",
|
||||
"aliases:": "аліасы:",
|
||||
"generated-value": "згенераванае значэнне",
|
||||
"Not enough non-option arguments: got %s, need at least %s": {
|
||||
"one": "Недастаткова неапцыйных аргументаў: ёсць %s, трэба як мінімум %s",
|
||||
"other": "Недастаткова неапцыйных аргументаў: ёсць %s, трэба як мінімум %s"
|
||||
},
|
||||
"Too many non-option arguments: got %s, maximum of %s": {
|
||||
"one": "Занадта шмат неапцыйных аргументаў: ёсць %s, максімум дапушчальна %s",
|
||||
"other": "Занадта шмат неапцыйных аргументаў: ёсць %s, максімум дапушчальна %s"
|
||||
},
|
||||
"Missing argument value: %s": {
|
||||
"one": "Не хапае значэння аргументу: %s",
|
||||
"other": "Не хапае значэнняў аргументаў: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "Не хапае неабходнага аргументу: %s",
|
||||
"other": "Не хапае неабходных аргументаў: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "Невядомы аргумент: %s",
|
||||
"other": "Невядомыя аргументы: %s"
|
||||
},
|
||||
"Invalid values:": "Несапраўдныя значэння:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "Аргумент: %s, Дадзенае значэнне: %s, Магчымасці: %s",
|
||||
"Argument check failed: %s": "Праверка аргументаў не ўдалася: %s",
|
||||
"Implications failed:": "Дадзены аргумент патрабуе наступны дадатковы аргумент:",
|
||||
"Not enough arguments following: %s": "Недастаткова наступных аргументаў: %s",
|
||||
"Invalid JSON config file: %s": "Несапраўдны файл канфігурацыі JSON: %s",
|
||||
"Path to JSON config file": "Шлях да файла канфігурацыі JSON",
|
||||
"Show help": "Паказаць дапамогу",
|
||||
"Show version number": "Паказаць нумар версіі",
|
||||
"Did you mean %s?": "Вы мелі на ўвазе %s?"
|
||||
}
|
51
backend/node_modules/postcss-cli/node_modules/yargs/locales/cs.json
generated
vendored
Normal file
51
backend/node_modules/postcss-cli/node_modules/yargs/locales/cs.json
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"Commands:": "Příkazy:",
|
||||
"Options:": "Možnosti:",
|
||||
"Examples:": "Příklady:",
|
||||
"boolean": "logická hodnota",
|
||||
"count": "počet",
|
||||
"string": "řetězec",
|
||||
"number": "číslo",
|
||||
"array": "pole",
|
||||
"required": "povinné",
|
||||
"default": "výchozí",
|
||||
"default:": "výchozí:",
|
||||
"choices:": "volby:",
|
||||
"aliases:": "aliasy:",
|
||||
"generated-value": "generovaná-hodnota",
|
||||
"Not enough non-option arguments: got %s, need at least %s": {
|
||||
"one": "Nedostatek argumentů: zadáno %s, je potřeba alespoň %s",
|
||||
"other": "Nedostatek argumentů: zadáno %s, je potřeba alespoň %s"
|
||||
},
|
||||
"Too many non-option arguments: got %s, maximum of %s": {
|
||||
"one": "Příliš mnoho argumentů: zadáno %s, maximálně %s",
|
||||
"other": "Příliš mnoho argumentů: zadáno %s, maximálně %s"
|
||||
},
|
||||
"Missing argument value: %s": {
|
||||
"one": "Chybí hodnota argumentu: %s",
|
||||
"other": "Chybí hodnoty argumentů: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "Chybí požadovaný argument: %s",
|
||||
"other": "Chybí požadované argumenty: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "Neznámý argument: %s",
|
||||
"other": "Neznámé argumenty: %s"
|
||||
},
|
||||
"Invalid values:": "Neplatné hodnoty:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "Argument: %s, Zadáno: %s, Možnosti: %s",
|
||||
"Argument check failed: %s": "Kontrola argumentů se nezdařila: %s",
|
||||
"Implications failed:": "Chybí závislé argumenty:",
|
||||
"Not enough arguments following: %s": "Následuje nedostatek argumentů: %s",
|
||||
"Invalid JSON config file: %s": "Neplatný konfigurační soubor JSON: %s",
|
||||
"Path to JSON config file": "Cesta ke konfiguračnímu souboru JSON",
|
||||
"Show help": "Zobrazit nápovědu",
|
||||
"Show version number": "Zobrazit číslo verze",
|
||||
"Did you mean %s?": "Měl jste na mysli %s?",
|
||||
"Arguments %s and %s are mutually exclusive" : "Argumenty %s a %s se vzájemně vylučují",
|
||||
"Positionals:": "Poziční:",
|
||||
"command": "příkaz",
|
||||
"deprecated": "zastaralé",
|
||||
"deprecated: %s": "zastaralé: %s"
|
||||
}
|
46
backend/node_modules/postcss-cli/node_modules/yargs/locales/de.json
generated
vendored
Normal file
46
backend/node_modules/postcss-cli/node_modules/yargs/locales/de.json
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"Commands:": "Kommandos:",
|
||||
"Options:": "Optionen:",
|
||||
"Examples:": "Beispiele:",
|
||||
"boolean": "boolean",
|
||||
"count": "Zähler",
|
||||
"string": "string",
|
||||
"number": "Zahl",
|
||||
"array": "array",
|
||||
"required": "erforderlich",
|
||||
"default": "Standard",
|
||||
"default:": "Standard:",
|
||||
"choices:": "Möglichkeiten:",
|
||||
"aliases:": "Aliase:",
|
||||
"generated-value": "Generierter-Wert",
|
||||
"Not enough non-option arguments: got %s, need at least %s": {
|
||||
"one": "Nicht genügend Argumente ohne Optionen: %s vorhanden, mindestens %s benötigt",
|
||||
"other": "Nicht genügend Argumente ohne Optionen: %s vorhanden, mindestens %s benötigt"
|
||||
},
|
||||
"Too many non-option arguments: got %s, maximum of %s": {
|
||||
"one": "Zu viele Argumente ohne Optionen: %s vorhanden, maximal %s erlaubt",
|
||||
"other": "Zu viele Argumente ohne Optionen: %s vorhanden, maximal %s erlaubt"
|
||||
},
|
||||
"Missing argument value: %s": {
|
||||
"one": "Fehlender Argumentwert: %s",
|
||||
"other": "Fehlende Argumentwerte: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "Fehlendes Argument: %s",
|
||||
"other": "Fehlende Argumente: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "Unbekanntes Argument: %s",
|
||||
"other": "Unbekannte Argumente: %s"
|
||||
},
|
||||
"Invalid values:": "Unzulässige Werte:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gegeben: %s, Möglichkeiten: %s",
|
||||
"Argument check failed: %s": "Argumente-Check fehlgeschlagen: %s",
|
||||
"Implications failed:": "Fehlende abhängige Argumente:",
|
||||
"Not enough arguments following: %s": "Nicht genügend Argumente nach: %s",
|
||||
"Invalid JSON config file: %s": "Fehlerhafte JSON-Config Datei: %s",
|
||||
"Path to JSON config file": "Pfad zur JSON-Config Datei",
|
||||
"Show help": "Hilfe anzeigen",
|
||||
"Show version number": "Version anzeigen",
|
||||
"Did you mean %s?": "Meintest du %s?"
|
||||
}
|
55
backend/node_modules/postcss-cli/node_modules/yargs/locales/en.json
generated
vendored
Normal file
55
backend/node_modules/postcss-cli/node_modules/yargs/locales/en.json
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"Commands:": "Commands:",
|
||||
"Options:": "Options:",
|
||||
"Examples:": "Examples:",
|
||||
"boolean": "boolean",
|
||||
"count": "count",
|
||||
"string": "string",
|
||||
"number": "number",
|
||||
"array": "array",
|
||||
"required": "required",
|
||||
"default": "default",
|
||||
"default:": "default:",
|
||||
"choices:": "choices:",
|
||||
"aliases:": "aliases:",
|
||||
"generated-value": "generated-value",
|
||||
"Not enough non-option arguments: got %s, need at least %s": {
|
||||
"one": "Not enough non-option arguments: got %s, need at least %s",
|
||||
"other": "Not enough non-option arguments: got %s, need at least %s"
|
||||
},
|
||||
"Too many non-option arguments: got %s, maximum of %s": {
|
||||
"one": "Too many non-option arguments: got %s, maximum of %s",
|
||||
"other": "Too many non-option arguments: got %s, maximum of %s"
|
||||
},
|
||||
"Missing argument value: %s": {
|
||||
"one": "Missing argument value: %s",
|
||||
"other": "Missing argument values: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "Missing required argument: %s",
|
||||
"other": "Missing required arguments: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "Unknown argument: %s",
|
||||
"other": "Unknown arguments: %s"
|
||||
},
|
||||
"Unknown command: %s": {
|
||||
"one": "Unknown command: %s",
|
||||
"other": "Unknown commands: %s"
|
||||
},
|
||||
"Invalid values:": "Invalid values:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "Argument: %s, Given: %s, Choices: %s",
|
||||
"Argument check failed: %s": "Argument check failed: %s",
|
||||
"Implications failed:": "Missing dependent arguments:",
|
||||
"Not enough arguments following: %s": "Not enough arguments following: %s",
|
||||
"Invalid JSON config file: %s": "Invalid JSON config file: %s",
|
||||
"Path to JSON config file": "Path to JSON config file",
|
||||
"Show help": "Show help",
|
||||
"Show version number": "Show version number",
|
||||
"Did you mean %s?": "Did you mean %s?",
|
||||
"Arguments %s and %s are mutually exclusive" : "Arguments %s and %s are mutually exclusive",
|
||||
"Positionals:": "Positionals:",
|
||||
"command": "command",
|
||||
"deprecated": "deprecated",
|
||||
"deprecated: %s": "deprecated: %s"
|
||||
}
|
46
backend/node_modules/postcss-cli/node_modules/yargs/locales/es.json
generated
vendored
Normal file
46
backend/node_modules/postcss-cli/node_modules/yargs/locales/es.json
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"Commands:": "Comandos:",
|
||||
"Options:": "Opciones:",
|
||||
"Examples:": "Ejemplos:",
|
||||
"boolean": "booleano",
|
||||
"count": "cuenta",
|
||||
"string": "cadena de caracteres",
|
||||
"number": "número",
|
||||
"array": "tabla",
|
||||
"required": "requerido",
|
||||
"default": "defecto",
|
||||
"default:": "defecto:",
|
||||
"choices:": "selección:",
|
||||
"aliases:": "alias:",
|
||||
"generated-value": "valor-generado",
|
||||
"Not enough non-option arguments: got %s, need at least %s": {
|
||||
"one": "Hacen falta argumentos no-opcionales: Número recibido %s, necesita por lo menos %s",
|
||||
"other": "Hacen falta argumentos no-opcionales: Número recibido %s, necesita por lo menos %s"
|
||||
},
|
||||
"Too many non-option arguments: got %s, maximum of %s": {
|
||||
"one": "Demasiados argumentos no-opcionales: Número recibido %s, máximo es %s",
|
||||
"other": "Demasiados argumentos no-opcionales: Número recibido %s, máximo es %s"
|
||||
},
|
||||
"Missing argument value: %s": {
|
||||
"one": "Falta argumento: %s",
|
||||
"other": "Faltan argumentos: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "Falta argumento requerido: %s",
|
||||
"other": "Faltan argumentos requeridos: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "Argumento desconocido: %s",
|
||||
"other": "Argumentos desconocidos: %s"
|
||||
},
|
||||
"Invalid values:": "Valores inválidos:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Recibido: %s, Seleccionados: %s",
|
||||
"Argument check failed: %s": "Verificación de argumento ha fallado: %s",
|
||||
"Implications failed:": "Implicaciones fallidas:",
|
||||
"Not enough arguments following: %s": "No hay suficientes argumentos después de: %s",
|
||||
"Invalid JSON config file: %s": "Archivo de configuración JSON inválido: %s",
|
||||
"Path to JSON config file": "Ruta al archivo de configuración JSON",
|
||||
"Show help": "Muestra ayuda",
|
||||
"Show version number": "Muestra número de versión",
|
||||
"Did you mean %s?": "Quisiste decir %s?"
|
||||
}
|
49
backend/node_modules/postcss-cli/node_modules/yargs/locales/fi.json
generated
vendored
Normal file
49
backend/node_modules/postcss-cli/node_modules/yargs/locales/fi.json
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"Commands:": "Komennot:",
|
||||
"Options:": "Valinnat:",
|
||||
"Examples:": "Esimerkkejä:",
|
||||
"boolean": "totuusarvo",
|
||||
"count": "lukumäärä",
|
||||
"string": "merkkijono",
|
||||
"number": "numero",
|
||||
"array": "taulukko",
|
||||
"required": "pakollinen",
|
||||
"default": "oletusarvo",
|
||||
"default:": "oletusarvo:",
|
||||
"choices:": "vaihtoehdot:",
|
||||
"aliases:": "aliakset:",
|
||||
"generated-value": "generoitu-arvo",
|
||||
"Not enough non-option arguments: got %s, need at least %s": {
|
||||
"one": "Liian vähän argumentteja, jotka eivät ole valintoja: annettu %s, vaaditaan vähintään %s",
|
||||
"other": "Liian vähän argumentteja, jotka eivät ole valintoja: annettu %s, vaaditaan vähintään %s"
|
||||
},
|
||||
"Too many non-option arguments: got %s, maximum of %s": {
|
||||
"one": "Liikaa argumentteja, jotka eivät ole valintoja: annettu %s, sallitaan enintään %s",
|
||||
"other": "Liikaa argumentteja, jotka eivät ole valintoja: annettu %s, sallitaan enintään %s"
|
||||
},
|
||||
"Missing argument value: %s": {
|
||||
"one": "Argumentin arvo puuttuu: %s",
|
||||
"other": "Argumentin arvot puuttuvat: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "Pakollinen argumentti puuttuu: %s",
|
||||
"other": "Pakollisia argumentteja puuttuu: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "Tuntematon argumentti: %s",
|
||||
"other": "Tuntemattomia argumentteja: %s"
|
||||
},
|
||||
"Invalid values:": "Virheelliset arvot:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "Argumentti: %s, Annettu: %s, Vaihtoehdot: %s",
|
||||
"Argument check failed: %s": "Argumentin tarkistus epäonnistui: %s",
|
||||
"Implications failed:": "Riippuvia argumentteja puuttuu:",
|
||||
"Not enough arguments following: %s": "Argumentin perässä ei ole tarpeeksi argumentteja: %s",
|
||||
"Invalid JSON config file: %s": "Epävalidi JSON-asetustiedosto: %s",
|
||||
"Path to JSON config file": "JSON-asetustiedoston polku",
|
||||
"Show help": "Näytä ohje",
|
||||
"Show version number": "Näytä versionumero",
|
||||
"Did you mean %s?": "Tarkoititko %s?",
|
||||
"Arguments %s and %s are mutually exclusive" : "Argumentit %s ja %s eivät ole yhteensopivat",
|
||||
"Positionals:": "Sijaintiparametrit:",
|
||||
"command": "komento"
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user