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/concurrently/LICENSE
generated
vendored
Normal file
21
backend/node_modules/concurrently/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Kimmo Brunfeldt
|
||||
|
||||
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.
|
434
backend/node_modules/concurrently/README.md
generated
vendored
Normal file
434
backend/node_modules/concurrently/README.md
generated
vendored
Normal file
@@ -0,0 +1,434 @@
|
||||
# concurrently
|
||||
|
||||
[](https://github.com/open-cli-tools/concurrently/releases)
|
||||
[](https://github.com/open-cli-tools/concurrently/blob/main/LICENSE)
|
||||
[](https://www.npmjs.com/package/concurrently)
|
||||
[](https://github.com/open-cli-tools/concurrently/actions/workflows/test.yml)
|
||||
[](https://coveralls.io/github/open-cli-tools/concurrently?branch=main)
|
||||
|
||||
Run multiple commands concurrently.
|
||||
Like `npm run watch-js & npm run watch-less` but better.
|
||||
|
||||

|
||||
|
||||
**Table of Contents**
|
||||
|
||||
- [concurrently](#concurrently)
|
||||
- [Why](#why)
|
||||
- [Installation](#installation)
|
||||
- [Usage](#usage)
|
||||
- [API](#api)
|
||||
- [`concurrently(commands[, options])`](#concurrentlycommands-options)
|
||||
- [`Command`](#command)
|
||||
- [`CloseEvent`](#closeevent)
|
||||
- [FAQ](#faq)
|
||||
|
||||
## Why
|
||||
|
||||
I like [task automation with npm](https://web.archive.org/web/20220531064025/https://github.com/substack/blog/blob/master/npm_run.markdown)
|
||||
but the usual way to run multiple commands concurrently is
|
||||
`npm run watch-js & npm run watch-css`. That's fine but it's hard to keep
|
||||
on track of different outputs. Also if one process fails, others still keep running
|
||||
and you won't even notice the difference.
|
||||
|
||||
Another option would be to just run all commands in separate terminals. I got
|
||||
tired of opening terminals and made **concurrently**.
|
||||
|
||||
**Features:**
|
||||
|
||||
- Cross platform (including Windows)
|
||||
- Output is easy to follow with prefixes
|
||||
- With `--kill-others` switch, all commands are killed if one dies
|
||||
- Spawns commands with [spawn-command](https://github.com/mmalecki/spawn-command)
|
||||
|
||||
## Installation
|
||||
|
||||
**concurrently** can be installed in the global scope (if you'd like to have it available and use it on the whole system) or locally for a specific package (for example if you'd like to use it in the `scripts` section of your package):
|
||||
|
||||
| | npm | Yarn | pnpm | Bun |
|
||||
| ----------- | ----------------------- | ------------------------------ | -------------------------- | ------------------------- |
|
||||
| **Global** | `npm i -g concurrently` | `yarn global add concurrently` | `pnpm add -g concurrently` | `bun add -g concurrently` |
|
||||
| **Local**\* | `npm i -D concurrently` | `yarn add -D concurrently` | `pnpm add -D concurrently` | `bun add -d concurrently` |
|
||||
|
||||
<sub>\* It's recommended to add **concurrently** to `devDependencies` as it's usually used for developing purposes. Please adjust the command if this doesn't apply in your case.</sub>
|
||||
|
||||
## Usage
|
||||
|
||||
> **Note**
|
||||
> The `concurrently` command is now also available under the shorthand alias `conc`.
|
||||
|
||||
The tool is written in Node.js, but you can use it to run **any** commands.
|
||||
|
||||
Remember to surround separate commands with quotes:
|
||||
|
||||
```bash
|
||||
concurrently "command1 arg" "command2 arg"
|
||||
```
|
||||
|
||||
Otherwise **concurrently** would try to run 4 separate commands:
|
||||
`command1`, `arg`, `command2`, `arg`.
|
||||
|
||||
In package.json, escape quotes:
|
||||
|
||||
```bash
|
||||
"start": "concurrently \"command1 arg\" \"command2 arg\""
|
||||
```
|
||||
|
||||
NPM run commands can be shortened:
|
||||
|
||||
```bash
|
||||
concurrently "npm:watch-js" "npm:watch-css" "npm:watch-node"
|
||||
|
||||
# Equivalent to:
|
||||
concurrently -n watch-js,watch-css,watch-node "npm run watch-js" "npm run watch-css" "npm run watch-node"
|
||||
```
|
||||
|
||||
NPM shortened commands also support wildcards. Given the following scripts in
|
||||
package.json:
|
||||
|
||||
```jsonc
|
||||
{
|
||||
//...
|
||||
"scripts": {
|
||||
// ...
|
||||
"watch-js": "...",
|
||||
"watch-css": "...",
|
||||
"watch-node": "..."
|
||||
// ...
|
||||
}
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
```bash
|
||||
concurrently "npm:watch-*"
|
||||
|
||||
# Equivalent to:
|
||||
concurrently -n js,css,node "npm run watch-js" "npm run watch-css" "npm run watch-node"
|
||||
|
||||
# Any name provided for the wildcard command will be used as a prefix to the wildcard
|
||||
# part of the script name:
|
||||
concurrently -n w: npm:watch-*
|
||||
|
||||
# Equivalent to:
|
||||
concurrently -n w:js,w:css,w:node "npm run watch-js" "npm run watch-css" "npm run watch-node"
|
||||
```
|
||||
|
||||
Exclusion is also supported. Given the following scripts in package.json:
|
||||
|
||||
```jsonc
|
||||
{
|
||||
// ...
|
||||
"scripts": {
|
||||
"lint:js": "...",
|
||||
"lint:ts": "...",
|
||||
"lint:fix:js": "...",
|
||||
"lint:fix:ts": "..."
|
||||
// ...
|
||||
}
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
```bash
|
||||
# Running only lint:js and lint:ts
|
||||
# with lint:fix:js and lint:fix:ts excluded
|
||||
concurrently "npm:lint:*(!fix)"
|
||||
```
|
||||
|
||||
Good frontend one-liner example [here](https://github.com/kimmobrunfeldt/dont-copy-paste-this-frontend-template/blob/5cd2bde719654941bdfc0a42c6f1b8e69ae79980/package.json#L9).
|
||||
|
||||
Help:
|
||||
|
||||
```
|
||||
concurrently [options] <command ...>
|
||||
|
||||
General
|
||||
-m, --max-processes How many processes should run at once.
|
||||
Exact number or a percent of CPUs available (for example "50%").
|
||||
New processes only spawn after all restart tries
|
||||
of a process. [string]
|
||||
-n, --names List of custom names to be used in prefix
|
||||
template.
|
||||
Example names: "main,browser,server" [string]
|
||||
--name-separator The character to split <names> on. Example usage:
|
||||
-n "styles|scripts|server" --name-separator "|"
|
||||
[default: ","]
|
||||
-s, --success Which command(s) must exit with code 0 in order
|
||||
for concurrently exit with code 0 too. Options
|
||||
are:
|
||||
- "first" for the first command to exit;
|
||||
- "last" for the last command to exit;
|
||||
- "all" for all commands;
|
||||
- "command-{name}"/"command-{index}" for the
|
||||
commands with that name or index;
|
||||
- "!command-{name}"/"!command-{index}" for all
|
||||
commands but the ones with that name or index.
|
||||
[default: "all"]
|
||||
-r, --raw Output only raw output of processes, disables
|
||||
prettifying and concurrently coloring. [boolean]
|
||||
--no-color Disables colors from logging [boolean]
|
||||
--hide Comma-separated list of processes to hide the
|
||||
output.
|
||||
The processes can be identified by their name or
|
||||
index. [string] [default: ""]
|
||||
-g, --group Order the output as if the commands were run
|
||||
sequentially. [boolean]
|
||||
--timings Show timing information for all processes.
|
||||
[boolean] [default: false]
|
||||
-P, --passthrough-arguments Passthrough additional arguments to commands
|
||||
(accessible via placeholders) instead of treating
|
||||
them as commands. [boolean] [default: false]
|
||||
|
||||
Prefix styling
|
||||
-p, --prefix Prefix used in logging for each process.
|
||||
Possible values: index, pid, time, command, name,
|
||||
none, or a template. Example template: "{time}-{pid}"
|
||||
[string] [default: index or name (when --names is set)]
|
||||
-c, --prefix-colors Comma-separated list of chalk colors to use on
|
||||
prefixes. If there are more commands than colors, the
|
||||
last color will be repeated.
|
||||
- Available modifiers: reset, bold, dim, italic,
|
||||
underline, inverse, hidden, strikethrough
|
||||
- Available colors: black, red, green, yellow, blue,
|
||||
magenta, cyan, white, gray,
|
||||
any hex values for colors (e.g. #23de43) or auto for
|
||||
an automatically picked color
|
||||
- Available background colors: bgBlack, bgRed,
|
||||
bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite
|
||||
See https://www.npmjs.com/package/chalk for more
|
||||
information. [string] [default: "reset"]
|
||||
-l, --prefix-length Limit how many characters of the command is displayed
|
||||
in prefix. The option can be used to shorten the
|
||||
prefix when it is set to "command"
|
||||
[number] [default: 10]
|
||||
-t, --timestamp-format Specify the timestamp in moment/date-fns format.
|
||||
[string] [default: "yyyy-MM-dd HH:mm:ss.SSS"]
|
||||
|
||||
Input handling
|
||||
-i, --handle-input Whether input should be forwarded to the child
|
||||
processes. See examples for more information.
|
||||
[boolean]
|
||||
--default-input-target Identifier for child process to which input on
|
||||
stdin should be sent if not specified at start of
|
||||
input.
|
||||
Can be either the index or the name of the
|
||||
process. [default: 0]
|
||||
|
||||
Killing other processes
|
||||
-k, --kill-others Kill other processes if one exits or dies.[boolean]
|
||||
--kill-others-on-fail Kill other processes if one exits with non zero
|
||||
status code. [boolean]
|
||||
--kill-signal Signal to send to other processes if one exits or dies.
|
||||
(SIGTERM/SIGKILL, defaults to SIGTERM) [string]
|
||||
|
||||
Restarting
|
||||
--restart-tries How many times a process that died should restart.
|
||||
Negative numbers will make the process restart forever.
|
||||
[number] [default: 0]
|
||||
--restart-after Delay time to respawn the process, in milliseconds.
|
||||
[number] [default: 0]
|
||||
|
||||
Options:
|
||||
-h, --help Show help [boolean]
|
||||
-v, -V, --version Show version number [boolean]
|
||||
|
||||
|
||||
Examples:
|
||||
|
||||
- Output nothing more than stdout+stderr of child processes
|
||||
|
||||
$ concurrently --raw "npm run watch-less" "npm run watch-js"
|
||||
|
||||
- Normal output but without colors e.g. when logging to file
|
||||
|
||||
$ concurrently --no-color "grunt watch" "http-server" > log
|
||||
|
||||
- Custom prefix
|
||||
|
||||
$ concurrently --prefix "{time}-{pid}" "npm run watch" "http-server"
|
||||
|
||||
- Custom names and colored prefixes
|
||||
|
||||
$ concurrently --names "HTTP,WATCH" -c "bgBlue.bold,bgMagenta.bold"
|
||||
"http-server" "npm run watch"
|
||||
|
||||
- Auto varying colored prefixes
|
||||
|
||||
$ concurrently -c "auto" "npm run watch" "http-server"
|
||||
|
||||
- Mixing auto and manual colored prefixes
|
||||
|
||||
$ concurrently -c "red,auto" "npm run watch" "http-server" "echo hello"
|
||||
|
||||
- Configuring via environment variables with CONCURRENTLY_ prefix
|
||||
|
||||
$ CONCURRENTLY_RAW=true CONCURRENTLY_KILL_OTHERS=true concurrently "echo
|
||||
hello" "echo world"
|
||||
|
||||
- Send input to default
|
||||
|
||||
$ concurrently --handle-input "nodemon" "npm run watch-js"
|
||||
rs # Sends rs command to nodemon process
|
||||
|
||||
- Send input to specific child identified by index
|
||||
|
||||
$ concurrently --handle-input "npm run watch-js" nodemon
|
||||
1:rs
|
||||
|
||||
- Send input to specific child identified by name
|
||||
|
||||
$ concurrently --handle-input -n js,srv "npm run watch-js" nodemon
|
||||
srv:rs
|
||||
|
||||
- Shortened NPM run commands
|
||||
|
||||
$ concurrently npm:watch-node npm:watch-js npm:watch-css
|
||||
|
||||
- Shortened NPM run command with wildcard (make sure to wrap it in quotes!)
|
||||
|
||||
$ concurrently "npm:watch-*"
|
||||
|
||||
- Exclude patterns so that between "lint:js" and "lint:fix:js", only "lint:js"
|
||||
is ran
|
||||
|
||||
$ concurrently "npm:*(!fix)"
|
||||
|
||||
- Passthrough some additional arguments via '{<number>}' placeholder
|
||||
|
||||
$ concurrently -P "echo {1}" -- foo
|
||||
|
||||
- Passthrough all additional arguments via '{@}' placeholder
|
||||
|
||||
$ concurrently -P "npm:dev-* -- {@}" -- --watch --noEmit
|
||||
|
||||
- Passthrough all additional arguments combined via '{*}' placeholder
|
||||
|
||||
$ concurrently -P "npm:dev-* -- {*}" -- --watch --noEmit
|
||||
|
||||
For more details, visit https://github.com/open-cli-tools/concurrently
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
**concurrently** can be used programmatically by using the API documented below:
|
||||
|
||||
### `concurrently(commands[, options])`
|
||||
|
||||
- `commands`: an array of either strings (containing the commands to run) or objects
|
||||
with the shape `{ command, name, prefixColor, env, cwd }`.
|
||||
|
||||
- `options` (optional): an object containing any of the below:
|
||||
- `cwd`: the working directory to be used by all commands. Can be overriden per command.
|
||||
Default: `process.cwd()`.
|
||||
- `defaultInputTarget`: the default input target when reading from `inputStream`.
|
||||
Default: `0`.
|
||||
- `handleInput`: when `true`, reads input from `process.stdin`.
|
||||
- `inputStream`: a [`Readable` stream](https://nodejs.org/dist/latest-v10.x/docs/api/stream.html#stream_readable_streams)
|
||||
to read the input from. Should only be used in the rare instance you would like to stream anything other than `process.stdin`. Overrides `handleInput`.
|
||||
- `pauseInputStreamOnFinish`: by default, pauses the input stream (`process.stdin` when `handleInput` is enabled, or `inputStream` if provided) when all of the processes have finished. If you need to read from the input stream after `concurrently` has finished, set this to `false`. ([#252](https://github.com/kimmobrunfeldt/concurrently/issues/252)).
|
||||
- `killOthers`: an array of exitting conditions that will cause a process to kill others.
|
||||
Can contain any of `success` or `failure`.
|
||||
- `maxProcesses`: how many processes should run at once.
|
||||
- `outputStream`: a [`Writable` stream](https://nodejs.org/dist/latest-v10.x/docs/api/stream.html#stream_writable_streams)
|
||||
to write logs to. Default: `process.stdout`.
|
||||
- `prefix`: the prefix type to use when logging processes output.
|
||||
Possible values: `index`, `pid`, `time`, `command`, `name`, `none`, or a template (eg `[{time} process: {pid}]`).
|
||||
Default: the name of the process, or its index if no name is set.
|
||||
- `prefixColors`: a list of colors or a string as supported by [chalk](https://www.npmjs.com/package/chalk) and additional style `auto` for an automatically picked color.
|
||||
If concurrently would run more commands than there are colors, the last color is repeated, unless if the last color value is `auto` which means following colors are automatically picked to vary.
|
||||
Prefix colors specified per-command take precedence over this list.
|
||||
- `prefixLength`: how many characters to show when prefixing with `command`. Default: `10`
|
||||
- `raw`: whether raw mode should be used, meaning strictly process output will
|
||||
be logged, without any prefixes, coloring or extra stuff. Can be overriden per command.
|
||||
- `successCondition`: the condition to consider the run was successful.
|
||||
If `first`, only the first process to exit will make up the success of the run; if `last`, the last process that exits will determine whether the run succeeds.
|
||||
Anything else means all processes should exit successfully.
|
||||
- `restartTries`: how many attempts to restart a process that dies will be made. Default: `0`.
|
||||
- `restartDelay`: how many milliseconds to wait between process restarts. Default: `0`.
|
||||
- `timestampFormat`: a [date-fns format](https://date-fns.org/v2.0.1/docs/format)
|
||||
to use when prefixing with `time`. Default: `yyyy-MM-dd HH:mm:ss.ZZZ`
|
||||
- `additionalArguments`: list of additional arguments passed that will get replaced in each command. If not defined, no argument replacing will happen.
|
||||
|
||||
> **Returns:** an object in the shape `{ result, commands }`.
|
||||
>
|
||||
> - `result`: a `Promise` that resolves if the run was successful (according to `successCondition` option),
|
||||
> or rejects, containing an array of [`CloseEvent`](#CloseEvent), in the order that the commands terminated.
|
||||
> - `commands`: an array of all spawned [`Command`s](#Command).
|
||||
|
||||
Example:
|
||||
|
||||
```js
|
||||
const concurrently = require('concurrently');
|
||||
const { result } = concurrently(
|
||||
[
|
||||
'npm:watch-*',
|
||||
{ command: 'nodemon', name: 'server' },
|
||||
{ command: 'deploy', name: 'deploy', env: { PUBLIC_KEY: '...' } },
|
||||
{
|
||||
command: 'watch',
|
||||
name: 'watch',
|
||||
cwd: path.resolve(__dirname, 'scripts/watchers'),
|
||||
},
|
||||
],
|
||||
{
|
||||
prefix: 'name',
|
||||
killOthers: ['failure', 'success'],
|
||||
restartTries: 3,
|
||||
cwd: path.resolve(__dirname, 'scripts'),
|
||||
},
|
||||
);
|
||||
result.then(success, failure);
|
||||
```
|
||||
|
||||
### `Command`
|
||||
|
||||
An object that contains all information about a spawned command, and ways to interact with it.<br>
|
||||
It has the following properties:
|
||||
|
||||
- `index`: the index of the command among all commands spawned.
|
||||
- `command`: the command line of the command.
|
||||
- `name`: the name of the command; defaults to an empty string.
|
||||
- `cwd`: the current working directory of the command.
|
||||
- `env`: an object with all the environment variables that the command will be spawned with.
|
||||
- `killed`: whether the command has been killed.
|
||||
- `exited`: whether the command exited yet.
|
||||
- `pid`: the command's process ID.
|
||||
- `stdin`: a Writable stream to the command's `stdin`.
|
||||
- `stdout`: an RxJS observable to the command's `stdout`.
|
||||
- `stderr`: an RxJS observable to the command's `stderr`.
|
||||
- `error`: an RxJS observable to the command's error events (e.g. when it fails to spawn).
|
||||
- `timer`: an RxJS observable to the command's timing events (e.g. starting, stopping).
|
||||
- `close`: an RxJS observable to the command's close events.
|
||||
See [`CloseEvent`](#CloseEvent) for more information.
|
||||
- `start()`: starts the command, setting up all
|
||||
- `kill([signal])`: kills the command, optionally specifying a signal (e.g. `SIGTERM`, `SIGKILL`, etc).
|
||||
|
||||
### `CloseEvent`
|
||||
|
||||
An object with information about a command's closing event.<br>
|
||||
It contains the following properties:
|
||||
|
||||
- `command`: a stripped down version of [`Command`](#command), including only `name`, `command`, `env` and `cwd` properties.
|
||||
- `index`: the index of the command among all commands spawned.
|
||||
- `killed`: whether the command exited because it was killed.
|
||||
- `exitCode`: the exit code of the command's process, or the signal which it was killed with.
|
||||
- `timings`: an object in the shape `{ startDate, endDate, durationSeconds }`.
|
||||
|
||||
## FAQ
|
||||
|
||||
- Process exited with code _null_?
|
||||
|
||||
From [Node child_process documentation](http://nodejs.org/api/child_process.html#child_process_event_exit), `exit` event:
|
||||
|
||||
> This event is emitted after the child process ends. If the process
|
||||
> terminated normally, code is the final exit code of the process,
|
||||
> otherwise null. If the process terminated due to receipt of a signal,
|
||||
> signal is the string name of the signal, otherwise null.
|
||||
|
||||
So _null_ means the process didn't terminate normally. This will make **concurrently**
|
||||
to return non-zero exit code too.
|
||||
|
||||
- Does this work with the npm-replacements [yarn](https://github.com/yarnpkg/yarn), [pnpm](https://pnpm.js.org/), or [Bun](https://bun.sh/)?
|
||||
|
||||
Yes! In all examples above, you may replace "`npm`" with "`yarn`", "`pnpm`", or "`bun`".
|
2
backend/node_modules/concurrently/dist/bin/concurrently.d.ts
generated
vendored
Normal file
2
backend/node_modules/concurrently/dist/bin/concurrently.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env node
|
||||
export {};
|
232
backend/node_modules/concurrently/dist/bin/concurrently.js
generated
vendored
Normal file
232
backend/node_modules/concurrently/dist/bin/concurrently.js
generated
vendored
Normal file
@@ -0,0 +1,232 @@
|
||||
#!/usr/bin/env node
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const yargs_1 = __importDefault(require("yargs"));
|
||||
const helpers_1 = require("yargs/helpers");
|
||||
const defaults = __importStar(require("../src/defaults"));
|
||||
const index_1 = __importDefault(require("../src/index"));
|
||||
const epilogue_1 = require("./epilogue");
|
||||
// Clean-up arguments (yargs expects only the arguments after the program name)
|
||||
const cleanArgs = (0, helpers_1.hideBin)(process.argv);
|
||||
// Find argument separator (double dash)
|
||||
const argsSepIdx = cleanArgs.findIndex((arg) => arg === '--');
|
||||
// Arguments before separator
|
||||
const argsBeforeSep = argsSepIdx >= 0 ? cleanArgs.slice(0, argsSepIdx) : cleanArgs;
|
||||
// Arguments after separator
|
||||
const argsAfterSep = argsSepIdx >= 0 ? cleanArgs.slice(argsSepIdx + 1) : [];
|
||||
const args = (0, yargs_1.default)(argsBeforeSep)
|
||||
.usage('$0 [options] <command ...>')
|
||||
.help('h')
|
||||
.alias('h', 'help')
|
||||
.version()
|
||||
.alias('version', 'v')
|
||||
.alias('version', 'V')
|
||||
// TODO: Add some tests for this.
|
||||
.env('CONCURRENTLY')
|
||||
.options({
|
||||
// General
|
||||
'max-processes': {
|
||||
alias: 'm',
|
||||
describe: 'How many processes should run at once.\n' +
|
||||
'New processes only spawn after all restart tries of a process.\n' +
|
||||
'Exact number or a percent of CPUs available (for example "50%")',
|
||||
type: 'string',
|
||||
},
|
||||
names: {
|
||||
alias: 'n',
|
||||
describe: 'List of custom names to be used in prefix template.\n' +
|
||||
'Example names: "main,browser,server"',
|
||||
type: 'string',
|
||||
},
|
||||
'name-separator': {
|
||||
describe: 'The character to split <names> on. Example usage:\n' +
|
||||
'-n "styles|scripts|server" --name-separator "|"',
|
||||
default: defaults.nameSeparator,
|
||||
},
|
||||
success: {
|
||||
alias: 's',
|
||||
describe: 'Which command(s) must exit with code 0 in order for concurrently exit with ' +
|
||||
'code 0 too. Options are:\n' +
|
||||
'- "first" for the first command to exit;\n' +
|
||||
'- "last" for the last command to exit;\n' +
|
||||
'- "all" for all commands;\n' +
|
||||
// Note: not a typo. Multiple commands can have the same name.
|
||||
'- "command-{name}"/"command-{index}" for the commands with that name or index;\n' +
|
||||
'- "!command-{name}"/"!command-{index}" for all commands but the ones with that ' +
|
||||
'name or index.\n',
|
||||
default: defaults.success,
|
||||
},
|
||||
raw: {
|
||||
alias: 'r',
|
||||
describe: 'Output only raw output of processes, disables prettifying ' +
|
||||
'and concurrently coloring.',
|
||||
type: 'boolean',
|
||||
},
|
||||
// This one is provided for free. Chalk reads this itself and removes colors.
|
||||
// https://www.npmjs.com/package/chalk#chalksupportscolor
|
||||
'no-color': {
|
||||
describe: 'Disables colors from logging',
|
||||
type: 'boolean',
|
||||
},
|
||||
hide: {
|
||||
describe: 'Comma-separated list of processes to hide the output.\n' +
|
||||
'The processes can be identified by their name or index.',
|
||||
default: defaults.hide,
|
||||
type: 'string',
|
||||
},
|
||||
group: {
|
||||
alias: 'g',
|
||||
describe: 'Order the output as if the commands were run sequentially.',
|
||||
type: 'boolean',
|
||||
},
|
||||
timings: {
|
||||
describe: 'Show timing information for all processes.',
|
||||
type: 'boolean',
|
||||
default: defaults.timings,
|
||||
},
|
||||
'passthrough-arguments': {
|
||||
alias: 'P',
|
||||
describe: 'Passthrough additional arguments to commands (accessible via placeholders) ' +
|
||||
'instead of treating them as commands.',
|
||||
type: 'boolean',
|
||||
default: defaults.passthroughArguments,
|
||||
},
|
||||
// Kill others
|
||||
'kill-others': {
|
||||
alias: 'k',
|
||||
describe: 'Kill other processes if one exits or dies.',
|
||||
type: 'boolean',
|
||||
},
|
||||
'kill-others-on-fail': {
|
||||
describe: 'Kill other processes if one exits with non zero status code.',
|
||||
type: 'boolean',
|
||||
},
|
||||
'kill-signal': {
|
||||
alias: 'ks',
|
||||
describe: 'Signal to send to other processes if one exits or dies. (SIGTERM/SIGKILL, defaults to SIGTERM)',
|
||||
type: 'string',
|
||||
default: defaults.killSignal,
|
||||
},
|
||||
// Prefix
|
||||
prefix: {
|
||||
alias: 'p',
|
||||
describe: 'Prefix used in logging for each process.\n' +
|
||||
'Possible values: index, pid, time, command, name, none, or a template. ' +
|
||||
'Example template: "{time}-{pid}"',
|
||||
defaultDescription: 'index or name (when --names is set)',
|
||||
type: 'string',
|
||||
},
|
||||
'prefix-colors': {
|
||||
alias: 'c',
|
||||
describe: 'Comma-separated list of chalk colors to use on prefixes. ' +
|
||||
'If there are more commands than colors, the last color will be repeated.\n' +
|
||||
'- Available modifiers: reset, bold, dim, italic, underline, inverse, hidden, strikethrough\n' +
|
||||
'- Available colors: black, red, green, yellow, blue, magenta, cyan, white, gray, \n' +
|
||||
'any hex values for colors (e.g. #23de43) or auto for an automatically picked color\n' +
|
||||
'- Available background colors: bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite\n' +
|
||||
'See https://www.npmjs.com/package/chalk for more information.',
|
||||
default: defaults.prefixColors,
|
||||
type: 'string',
|
||||
},
|
||||
'prefix-length': {
|
||||
alias: 'l',
|
||||
describe: 'Limit how many characters of the command is displayed in prefix. ' +
|
||||
'The option can be used to shorten the prefix when it is set to "command"',
|
||||
default: defaults.prefixLength,
|
||||
type: 'number',
|
||||
},
|
||||
'timestamp-format': {
|
||||
alias: 't',
|
||||
describe: 'Specify the timestamp in moment/date-fns format.',
|
||||
default: defaults.timestampFormat,
|
||||
type: 'string',
|
||||
},
|
||||
// Restarting
|
||||
'restart-tries': {
|
||||
describe: 'How many times a process that died should restart.\n' +
|
||||
'Negative numbers will make the process restart forever.',
|
||||
default: defaults.restartTries,
|
||||
type: 'number',
|
||||
},
|
||||
'restart-after': {
|
||||
describe: 'Delay time to respawn the process, in milliseconds.',
|
||||
default: defaults.restartDelay,
|
||||
type: 'number',
|
||||
},
|
||||
// Input
|
||||
'handle-input': {
|
||||
alias: 'i',
|
||||
describe: 'Whether input should be forwarded to the child processes. ' +
|
||||
'See examples for more information.',
|
||||
type: 'boolean',
|
||||
},
|
||||
'default-input-target': {
|
||||
default: defaults.defaultInputTarget,
|
||||
describe: 'Identifier for child process to which input on stdin ' +
|
||||
'should be sent if not specified at start of input.\n' +
|
||||
'Can be either the index or the name of the process.',
|
||||
},
|
||||
})
|
||||
.group(['m', 'n', 'name-separator', 's', 'r', 'no-color', 'hide', 'g', 'timings', 'P'], 'General')
|
||||
.group(['p', 'c', 'l', 't'], 'Prefix styling')
|
||||
.group(['i', 'default-input-target'], 'Input handling')
|
||||
.group(['k', 'kill-others-on-fail', 'kill-signal'], 'Killing other processes')
|
||||
.group(['restart-tries', 'restart-after'], 'Restarting')
|
||||
.epilogue(epilogue_1.epilogue)
|
||||
.parseSync();
|
||||
// Get names of commands by the specified separator
|
||||
const names = (args.names || '').split(args.nameSeparator);
|
||||
// If "passthrough-arguments" is disabled, treat additional arguments as commands
|
||||
const commands = args.passthroughArguments ? args._ : [...args._, ...argsAfterSep];
|
||||
(0, index_1.default)(commands.map((command, index) => ({
|
||||
command: String(command),
|
||||
name: names[index],
|
||||
})), {
|
||||
handleInput: args.handleInput,
|
||||
defaultInputTarget: args.defaultInputTarget,
|
||||
killOthers: args.killOthers
|
||||
? ['success', 'failure']
|
||||
: args.killOthersOnFail
|
||||
? ['failure']
|
||||
: [],
|
||||
killSignal: args.killSignal,
|
||||
maxProcesses: args.maxProcesses,
|
||||
raw: args.raw,
|
||||
hide: args.hide.split(','),
|
||||
group: args.group,
|
||||
prefix: args.prefix,
|
||||
prefixColors: args.prefixColors.split(','),
|
||||
prefixLength: args.prefixLength,
|
||||
restartDelay: args.restartAfter,
|
||||
restartTries: args.restartTries,
|
||||
successCondition: args.success,
|
||||
timestampFormat: args.timestampFormat,
|
||||
timings: args.timings,
|
||||
additionalArguments: args.passthroughArguments ? argsAfterSep : undefined,
|
||||
}).result.then(() => process.exit(0), () => process.exit(1));
|
1
backend/node_modules/concurrently/dist/bin/epilogue.d.ts
generated
vendored
Normal file
1
backend/node_modules/concurrently/dist/bin/epilogue.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare const epilogue: string;
|
90
backend/node_modules/concurrently/dist/bin/epilogue.js
generated
vendored
Normal file
90
backend/node_modules/concurrently/dist/bin/epilogue.js
generated
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.epilogue = void 0;
|
||||
// Add new examples here.
|
||||
// Always start with `$ $0` so that it a) symbolizes a command line; and b) $0 gets replaced by the binary name uniformly.
|
||||
const examples = [
|
||||
{
|
||||
description: 'Output nothing more than stdout+stderr of child processes',
|
||||
example: '$ $0 --raw "npm run watch-less" "npm run watch-js"',
|
||||
},
|
||||
{
|
||||
description: 'Normal output but without colors e.g. when logging to file',
|
||||
example: '$ $0 --no-color "grunt watch" "http-server" > log',
|
||||
},
|
||||
{
|
||||
description: 'Custom prefix',
|
||||
example: '$ $0 --prefix "{time}-{pid}" "npm run watch" "http-server"',
|
||||
},
|
||||
{
|
||||
description: 'Custom names and colored prefixes',
|
||||
example: '$ $0 --names "HTTP,WATCH" -c "bgBlue.bold,bgMagenta.bold" "http-server" "npm run watch"',
|
||||
},
|
||||
{
|
||||
description: 'Auto varying colored prefixes',
|
||||
example: '$ $0 -c "auto" "npm run watch" "http-server"',
|
||||
},
|
||||
{
|
||||
description: 'Mixing auto and manual colored prefixes',
|
||||
example: '$ $0 -c "red,auto" "npm run watch" "http-server" "echo hello"',
|
||||
},
|
||||
{
|
||||
description: 'Configuring via environment variables with CONCURRENTLY_ prefix',
|
||||
example: '$ CONCURRENTLY_RAW=true CONCURRENTLY_KILL_OTHERS=true $0 "echo hello" "echo world"',
|
||||
},
|
||||
{
|
||||
description: 'Send input to default',
|
||||
example: [
|
||||
'$ $0 --handle-input "nodemon" "npm run watch-js"',
|
||||
'rs # Sends rs command to nodemon process',
|
||||
].join('\n'),
|
||||
},
|
||||
{
|
||||
description: 'Send input to specific child identified by index',
|
||||
example: ['$ $0 --handle-input "npm run watch-js" nodemon', '1:rs'].join('\n'),
|
||||
},
|
||||
{
|
||||
description: 'Send input to specific child identified by name',
|
||||
example: ['$ $0 --handle-input -n js,srv "npm run watch-js" nodemon', 'srv:rs'].join('\n'),
|
||||
},
|
||||
{
|
||||
description: 'Shortened NPM run commands',
|
||||
example: '$ $0 npm:watch-node npm:watch-js npm:watch-css',
|
||||
},
|
||||
{
|
||||
description: 'Shortened NPM run command with wildcard (make sure to wrap it in quotes!)',
|
||||
example: '$ $0 "npm:watch-*"',
|
||||
},
|
||||
{
|
||||
description: 'Exclude patterns so that between "lint:js" and "lint:fix:js", only "lint:js" is ran',
|
||||
example: '$ $0 "npm:*(!fix)"',
|
||||
},
|
||||
{
|
||||
description: "Passthrough some additional arguments via '{<number>}' placeholder",
|
||||
example: '$ $0 -P "echo {1}" -- foo',
|
||||
},
|
||||
{
|
||||
description: "Passthrough all additional arguments via '{@}' placeholder",
|
||||
example: '$ $0 -P "npm:dev-* -- {@}" -- --watch --noEmit',
|
||||
},
|
||||
{
|
||||
description: "Passthrough all additional arguments combined via '{*}' placeholder",
|
||||
example: '$ $0 -P "npm:dev-* -- {*}" -- --watch --noEmit',
|
||||
},
|
||||
];
|
||||
const examplesString = examples
|
||||
.map(({ example, description }) => [
|
||||
` - ${description}`,
|
||||
example
|
||||
.split('\n')
|
||||
.map((line) => ` ${line}`)
|
||||
.join('\n'),
|
||||
].join('\n\n'))
|
||||
.join('\n\n');
|
||||
exports.epilogue = `
|
||||
Examples:
|
||||
|
||||
${examplesString}
|
||||
|
||||
For more details, visit https://github.com/open-cli-tools/concurrently
|
||||
`;
|
19
backend/node_modules/concurrently/dist/src/command-parser/command-parser.d.ts
generated
vendored
Normal file
19
backend/node_modules/concurrently/dist/src/command-parser/command-parser.d.ts
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import { CommandInfo } from '../command';
|
||||
/**
|
||||
* A command parser encapsulates a specific logic for mapping `CommandInfo` objects
|
||||
* into another `CommandInfo`.
|
||||
*
|
||||
* A prime example is turning an abstract `npm:foo` into `npm run foo`, but it could also turn
|
||||
* the prefix color of a command brighter, or maybe even prefixing each command with `time(1)`.
|
||||
*/
|
||||
export interface CommandParser {
|
||||
/**
|
||||
* Parses `commandInfo` and returns one or more `CommandInfo`s.
|
||||
*
|
||||
* Returning multiple `CommandInfo` is used when there are multiple possibilities of commands to
|
||||
* run given the original input.
|
||||
* An example of this is when the command contains a wildcard and it must be expanded into all
|
||||
* viable options so that the consumer can decide which ones to run.
|
||||
*/
|
||||
parse(commandInfo: CommandInfo): CommandInfo | CommandInfo[];
|
||||
}
|
2
backend/node_modules/concurrently/dist/src/command-parser/command-parser.js
generated
vendored
Normal file
2
backend/node_modules/concurrently/dist/src/command-parser/command-parser.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
17
backend/node_modules/concurrently/dist/src/command-parser/expand-arguments.d.ts
generated
vendored
Normal file
17
backend/node_modules/concurrently/dist/src/command-parser/expand-arguments.d.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import { CommandInfo } from '../command';
|
||||
import { CommandParser } from './command-parser';
|
||||
/**
|
||||
* Replace placeholders with additional arguments.
|
||||
*/
|
||||
export declare class ExpandArguments implements CommandParser {
|
||||
private readonly additionalArguments;
|
||||
constructor(additionalArguments: string[]);
|
||||
parse(commandInfo: CommandInfo): {
|
||||
command: string;
|
||||
name: string;
|
||||
env?: Record<string, unknown> | undefined;
|
||||
cwd?: string | undefined;
|
||||
prefixColor?: string | undefined;
|
||||
raw?: boolean | undefined;
|
||||
};
|
||||
}
|
38
backend/node_modules/concurrently/dist/src/command-parser/expand-arguments.js
generated
vendored
Normal file
38
backend/node_modules/concurrently/dist/src/command-parser/expand-arguments.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ExpandArguments = void 0;
|
||||
const shell_quote_1 = require("shell-quote");
|
||||
/**
|
||||
* Replace placeholders with additional arguments.
|
||||
*/
|
||||
class ExpandArguments {
|
||||
constructor(additionalArguments) {
|
||||
this.additionalArguments = additionalArguments;
|
||||
}
|
||||
parse(commandInfo) {
|
||||
const command = commandInfo.command.replace(/\\?\{([@*]|[1-9][0-9]*)\}/g, (match, placeholderTarget) => {
|
||||
// Don't replace the placeholder if it is escaped by a backslash.
|
||||
if (match.startsWith('\\')) {
|
||||
return match.slice(1);
|
||||
}
|
||||
// Replace numeric placeholder if value exists in additional arguments.
|
||||
if (!isNaN(placeholderTarget) &&
|
||||
placeholderTarget <= this.additionalArguments.length) {
|
||||
return (0, shell_quote_1.quote)([this.additionalArguments[placeholderTarget - 1]]);
|
||||
}
|
||||
// Replace all arguments placeholder.
|
||||
if (placeholderTarget === '@') {
|
||||
return (0, shell_quote_1.quote)(this.additionalArguments);
|
||||
}
|
||||
// Replace combined arguments placeholder.
|
||||
if (placeholderTarget === '*') {
|
||||
return (0, shell_quote_1.quote)([this.additionalArguments.join(' ')]);
|
||||
}
|
||||
// Replace placeholder with empty string
|
||||
// if value doesn't exist in additional arguments.
|
||||
return '';
|
||||
});
|
||||
return { ...commandInfo, command };
|
||||
}
|
||||
}
|
||||
exports.ExpandArguments = ExpandArguments;
|
8
backend/node_modules/concurrently/dist/src/command-parser/expand-npm-shortcut.d.ts
generated
vendored
Normal file
8
backend/node_modules/concurrently/dist/src/command-parser/expand-npm-shortcut.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { CommandInfo } from '../command';
|
||||
import { CommandParser } from './command-parser';
|
||||
/**
|
||||
* Expands commands prefixed with `npm:`, `yarn:`, `pnpm:`, or `bun:` into the full version `npm run <command>` and so on.
|
||||
*/
|
||||
export declare class ExpandNpmShortcut implements CommandParser {
|
||||
parse(commandInfo: CommandInfo): CommandInfo;
|
||||
}
|
20
backend/node_modules/concurrently/dist/src/command-parser/expand-npm-shortcut.js
generated
vendored
Normal file
20
backend/node_modules/concurrently/dist/src/command-parser/expand-npm-shortcut.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ExpandNpmShortcut = void 0;
|
||||
/**
|
||||
* Expands commands prefixed with `npm:`, `yarn:`, `pnpm:`, or `bun:` into the full version `npm run <command>` and so on.
|
||||
*/
|
||||
class ExpandNpmShortcut {
|
||||
parse(commandInfo) {
|
||||
const [, npmCmd, cmdName, args] = commandInfo.command.match(/^(npm|yarn|pnpm|bun):(\S+)(.*)/) || [];
|
||||
if (!cmdName) {
|
||||
return commandInfo;
|
||||
}
|
||||
return {
|
||||
...commandInfo,
|
||||
name: commandInfo.name || cmdName,
|
||||
command: `${npmCmd} run ${cmdName}${args}`,
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.ExpandNpmShortcut = ExpandNpmShortcut;
|
13
backend/node_modules/concurrently/dist/src/command-parser/expand-npm-wildcard.d.ts
generated
vendored
Normal file
13
backend/node_modules/concurrently/dist/src/command-parser/expand-npm-wildcard.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import { CommandInfo } from '../command';
|
||||
import { CommandParser } from './command-parser';
|
||||
/**
|
||||
* Finds wildcards in npm/yarn/pnpm/bun run commands and replaces them with all matching scripts in the
|
||||
* `package.json` file of the current directory.
|
||||
*/
|
||||
export declare class ExpandNpmWildcard implements CommandParser {
|
||||
private readonly readPackage;
|
||||
static readPackage(): any;
|
||||
private scripts?;
|
||||
constructor(readPackage?: typeof ExpandNpmWildcard.readPackage);
|
||||
parse(commandInfo: CommandInfo): CommandInfo | CommandInfo[];
|
||||
}
|
68
backend/node_modules/concurrently/dist/src/command-parser/expand-npm-wildcard.js
generated
vendored
Normal file
68
backend/node_modules/concurrently/dist/src/command-parser/expand-npm-wildcard.js
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ExpandNpmWildcard = void 0;
|
||||
const fs_1 = __importDefault(require("fs"));
|
||||
const lodash_1 = __importDefault(require("lodash"));
|
||||
const OMISSION = /\(!([^)]+)\)/;
|
||||
/**
|
||||
* Finds wildcards in npm/yarn/pnpm/bun run commands and replaces them with all matching scripts in the
|
||||
* `package.json` file of the current directory.
|
||||
*/
|
||||
class ExpandNpmWildcard {
|
||||
static readPackage() {
|
||||
try {
|
||||
const json = fs_1.default.readFileSync('package.json', { encoding: 'utf-8' });
|
||||
return JSON.parse(json);
|
||||
}
|
||||
catch (e) {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
constructor(readPackage = ExpandNpmWildcard.readPackage) {
|
||||
this.readPackage = readPackage;
|
||||
}
|
||||
parse(commandInfo) {
|
||||
const [, npmCmd, cmdName, args] = commandInfo.command.match(/(npm|yarn|pnpm|bun) run (\S+)([^&]*)/) || [];
|
||||
const wildcardPosition = (cmdName || '').indexOf('*');
|
||||
// If the regex didn't match an npm script, or it has no wildcard,
|
||||
// then we have nothing to do here
|
||||
if (!cmdName || wildcardPosition === -1) {
|
||||
return commandInfo;
|
||||
}
|
||||
if (!this.scripts) {
|
||||
this.scripts = Object.keys(this.readPackage().scripts || {});
|
||||
}
|
||||
const omissionRegex = cmdName.match(OMISSION);
|
||||
const cmdNameSansOmission = cmdName.replace(OMISSION, '');
|
||||
const preWildcard = lodash_1.default.escapeRegExp(cmdNameSansOmission.slice(0, wildcardPosition));
|
||||
const postWildcard = lodash_1.default.escapeRegExp(cmdNameSansOmission.slice(wildcardPosition + 1));
|
||||
const wildcardRegex = new RegExp(`^${preWildcard}(.*?)${postWildcard}$`);
|
||||
// If 'commandInfo.name' doesn't match 'cmdName', this means a custom name
|
||||
// has been specified and thus becomes the prefix (as described in the README).
|
||||
const prefix = commandInfo.name !== cmdName ? commandInfo.name : '';
|
||||
return this.scripts
|
||||
.map((script) => {
|
||||
const match = script.match(wildcardRegex);
|
||||
if (omissionRegex) {
|
||||
const toOmit = script.match(new RegExp(omissionRegex[1]));
|
||||
if (toOmit) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (match) {
|
||||
return {
|
||||
...commandInfo,
|
||||
command: `${npmCmd} run ${script}${args}`,
|
||||
// Will use an empty command name if no prefix has been specified and
|
||||
// the wildcard match is empty, e.g. if `npm:watch-*` matches `npm run watch-`.
|
||||
name: prefix + match[1],
|
||||
};
|
||||
}
|
||||
})
|
||||
.filter((commandInfo) => !!commandInfo);
|
||||
}
|
||||
}
|
||||
exports.ExpandNpmWildcard = ExpandNpmWildcard;
|
15
backend/node_modules/concurrently/dist/src/command-parser/strip-quotes.d.ts
generated
vendored
Normal file
15
backend/node_modules/concurrently/dist/src/command-parser/strip-quotes.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import { CommandInfo } from '../command';
|
||||
import { CommandParser } from './command-parser';
|
||||
/**
|
||||
* Strips quotes around commands so that they can run on the current shell.
|
||||
*/
|
||||
export declare class StripQuotes implements CommandParser {
|
||||
parse(commandInfo: CommandInfo): {
|
||||
command: string;
|
||||
name: string;
|
||||
env?: Record<string, unknown> | undefined;
|
||||
cwd?: string | undefined;
|
||||
prefixColor?: string | undefined;
|
||||
raw?: boolean | undefined;
|
||||
};
|
||||
}
|
17
backend/node_modules/concurrently/dist/src/command-parser/strip-quotes.js
generated
vendored
Normal file
17
backend/node_modules/concurrently/dist/src/command-parser/strip-quotes.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.StripQuotes = void 0;
|
||||
/**
|
||||
* Strips quotes around commands so that they can run on the current shell.
|
||||
*/
|
||||
class StripQuotes {
|
||||
parse(commandInfo) {
|
||||
let { command } = commandInfo;
|
||||
// Removes the quotes surrounding a command.
|
||||
if (/^"(.+?)"$/.test(command) || /^'(.+?)'$/.test(command)) {
|
||||
command = command.slice(1, command.length - 1);
|
||||
}
|
||||
return { ...commandInfo, command };
|
||||
}
|
||||
}
|
||||
exports.StripQuotes = StripQuotes;
|
121
backend/node_modules/concurrently/dist/src/command.d.ts
generated
vendored
Normal file
121
backend/node_modules/concurrently/dist/src/command.d.ts
generated
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
/// <reference types="node" />
|
||||
/// <reference types="node" />
|
||||
/// <reference types="node" />
|
||||
/// <reference types="node" />
|
||||
import { ChildProcess as BaseChildProcess, SpawnOptions } from 'child_process';
|
||||
import * as Rx from 'rxjs';
|
||||
import { EventEmitter, Writable } from 'stream';
|
||||
/**
|
||||
* Identifier for a command; if string, it's the command's name, if number, it's the index.
|
||||
*/
|
||||
export type CommandIdentifier = string | number;
|
||||
export interface CommandInfo {
|
||||
/**
|
||||
* Command's name.
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Which command line the command has.
|
||||
*/
|
||||
command: string;
|
||||
/**
|
||||
* Which environment variables should the spawned process have.
|
||||
*/
|
||||
env?: Record<string, unknown>;
|
||||
/**
|
||||
* The current working directory of the process when spawned.
|
||||
*/
|
||||
cwd?: string;
|
||||
/**
|
||||
* Color to use on prefix of the command.
|
||||
*/
|
||||
prefixColor?: string;
|
||||
/**
|
||||
* Output command in raw format.
|
||||
*/
|
||||
raw?: boolean;
|
||||
}
|
||||
export interface CloseEvent {
|
||||
command: CommandInfo;
|
||||
/**
|
||||
* The command's index among all commands ran.
|
||||
*/
|
||||
index: number;
|
||||
/**
|
||||
* Whether the command exited because it was killed.
|
||||
*/
|
||||
killed: boolean;
|
||||
/**
|
||||
* The exit code or signal for the command.
|
||||
*/
|
||||
exitCode: string | number;
|
||||
timings: {
|
||||
startDate: Date;
|
||||
endDate: Date;
|
||||
durationSeconds: number;
|
||||
};
|
||||
}
|
||||
export interface TimerEvent {
|
||||
startDate: Date;
|
||||
endDate?: Date;
|
||||
}
|
||||
/**
|
||||
* Subtype of NodeJS's child_process including only what's actually needed for a command to work.
|
||||
*/
|
||||
export type ChildProcess = EventEmitter & Pick<BaseChildProcess, 'pid' | 'stdin' | 'stdout' | 'stderr'>;
|
||||
/**
|
||||
* Interface for a function that must kill the process with `pid`, optionally sending `signal` to it.
|
||||
*/
|
||||
export type KillProcess = (pid: number, signal?: string) => void;
|
||||
/**
|
||||
* Interface for a function that spawns a command and returns its child process instance.
|
||||
*/
|
||||
export type SpawnCommand = (command: string, options: SpawnOptions) => ChildProcess;
|
||||
export declare class Command implements CommandInfo {
|
||||
private readonly killProcess;
|
||||
private readonly spawn;
|
||||
private readonly spawnOpts;
|
||||
readonly index: number;
|
||||
/** @inheritdoc */
|
||||
readonly name: string;
|
||||
/** @inheritdoc */
|
||||
readonly command: string;
|
||||
/** @inheritdoc */
|
||||
readonly prefixColor?: string;
|
||||
/** @inheritdoc */
|
||||
readonly env: Record<string, unknown>;
|
||||
/** @inheritdoc */
|
||||
readonly cwd?: string;
|
||||
readonly close: Rx.Subject<CloseEvent>;
|
||||
readonly error: Rx.Subject<unknown>;
|
||||
readonly stdout: Rx.Subject<Buffer>;
|
||||
readonly stderr: Rx.Subject<Buffer>;
|
||||
readonly timer: Rx.Subject<TimerEvent>;
|
||||
process?: ChildProcess;
|
||||
stdin?: Writable;
|
||||
pid?: number;
|
||||
killed: boolean;
|
||||
exited: boolean;
|
||||
/** @deprecated */
|
||||
get killable(): boolean;
|
||||
constructor({ index, name, command, prefixColor, env, cwd }: CommandInfo & {
|
||||
index: number;
|
||||
}, spawnOpts: SpawnOptions, spawn: SpawnCommand, killProcess: KillProcess);
|
||||
/**
|
||||
* Starts this command, piping output, error and close events onto the corresponding observables.
|
||||
*/
|
||||
start(): void;
|
||||
/**
|
||||
* Kills this command, optionally specifying a signal to send to it.
|
||||
*/
|
||||
kill(code?: string): void;
|
||||
/**
|
||||
* Detects whether a command can be killed.
|
||||
*
|
||||
* Also works as a type guard on the input `command`.
|
||||
*/
|
||||
static canKill(command: Command): command is Command & {
|
||||
pid: number;
|
||||
process: ChildProcess;
|
||||
};
|
||||
}
|
117
backend/node_modules/concurrently/dist/src/command.js
generated
vendored
Normal file
117
backend/node_modules/concurrently/dist/src/command.js
generated
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Command = void 0;
|
||||
const Rx = __importStar(require("rxjs"));
|
||||
class Command {
|
||||
/** @deprecated */
|
||||
get killable() {
|
||||
return Command.canKill(this);
|
||||
}
|
||||
constructor({ index, name, command, prefixColor, env, cwd }, spawnOpts, spawn, killProcess) {
|
||||
this.close = new Rx.Subject();
|
||||
this.error = new Rx.Subject();
|
||||
this.stdout = new Rx.Subject();
|
||||
this.stderr = new Rx.Subject();
|
||||
this.timer = new Rx.Subject();
|
||||
this.killed = false;
|
||||
this.exited = false;
|
||||
this.index = index;
|
||||
this.name = name;
|
||||
this.command = command;
|
||||
this.prefixColor = prefixColor;
|
||||
this.env = env || {};
|
||||
this.cwd = cwd;
|
||||
this.killProcess = killProcess;
|
||||
this.spawn = spawn;
|
||||
this.spawnOpts = spawnOpts;
|
||||
}
|
||||
/**
|
||||
* Starts this command, piping output, error and close events onto the corresponding observables.
|
||||
*/
|
||||
start() {
|
||||
const child = this.spawn(this.command, this.spawnOpts);
|
||||
this.process = child;
|
||||
this.pid = child.pid;
|
||||
const startDate = new Date(Date.now());
|
||||
const highResStartTime = process.hrtime();
|
||||
this.timer.next({ startDate });
|
||||
Rx.fromEvent(child, 'error').subscribe((event) => {
|
||||
this.process = undefined;
|
||||
const endDate = new Date(Date.now());
|
||||
this.timer.next({ startDate, endDate });
|
||||
this.error.next(event);
|
||||
});
|
||||
Rx.fromEvent(child, 'close')
|
||||
.pipe(Rx.map((event) => event))
|
||||
.subscribe(([exitCode, signal]) => {
|
||||
this.process = undefined;
|
||||
this.exited = true;
|
||||
const endDate = new Date(Date.now());
|
||||
this.timer.next({ startDate, endDate });
|
||||
const [durationSeconds, durationNanoSeconds] = process.hrtime(highResStartTime);
|
||||
this.close.next({
|
||||
command: this,
|
||||
index: this.index,
|
||||
exitCode: exitCode ?? String(signal),
|
||||
killed: this.killed,
|
||||
timings: {
|
||||
startDate,
|
||||
endDate,
|
||||
durationSeconds: durationSeconds + durationNanoSeconds / 1e9,
|
||||
},
|
||||
});
|
||||
});
|
||||
child.stdout &&
|
||||
pipeTo(Rx.fromEvent(child.stdout, 'data').pipe(Rx.map((event) => event)), this.stdout);
|
||||
child.stderr &&
|
||||
pipeTo(Rx.fromEvent(child.stderr, 'data').pipe(Rx.map((event) => event)), this.stderr);
|
||||
this.stdin = child.stdin || undefined;
|
||||
}
|
||||
/**
|
||||
* Kills this command, optionally specifying a signal to send to it.
|
||||
*/
|
||||
kill(code) {
|
||||
if (Command.canKill(this)) {
|
||||
this.killed = true;
|
||||
this.killProcess(this.pid, code);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Detects whether a command can be killed.
|
||||
*
|
||||
* Also works as a type guard on the input `command`.
|
||||
*/
|
||||
static canKill(command) {
|
||||
return !!command.pid && !!command.process;
|
||||
}
|
||||
}
|
||||
exports.Command = Command;
|
||||
/**
|
||||
* Pipes all events emitted by `stream` into `subject`.
|
||||
*/
|
||||
function pipeTo(stream, subject) {
|
||||
stream.subscribe((event) => subject.next(event));
|
||||
}
|
40
backend/node_modules/concurrently/dist/src/completion-listener.d.ts
generated
vendored
Normal file
40
backend/node_modules/concurrently/dist/src/completion-listener.d.ts
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
import * as Rx from 'rxjs';
|
||||
import { CloseEvent, Command } from './command';
|
||||
/**
|
||||
* Defines which command(s) in a list must exit successfully (with an exit code of `0`):
|
||||
*
|
||||
* - `first`: only the first specified command;
|
||||
* - `last`: only the last specified command;
|
||||
* - `all`: all commands.
|
||||
* - `command-{name|index}`: only the commands with the specified names or index.
|
||||
* - `!command-{name|index}`: all commands but the ones with the specified names or index.
|
||||
*/
|
||||
export type SuccessCondition = 'first' | 'last' | 'all' | `command-${string | number}` | `!command-${string | number}`;
|
||||
/**
|
||||
* Provides logic to determine whether lists of commands ran successfully.
|
||||
*/
|
||||
export declare class CompletionListener {
|
||||
private readonly successCondition;
|
||||
private readonly scheduler?;
|
||||
constructor({ successCondition, scheduler, }: {
|
||||
/**
|
||||
* How this instance will define that a list of commands ran successfully.
|
||||
* Defaults to `all`.
|
||||
*
|
||||
* @see {SuccessCondition}
|
||||
*/
|
||||
successCondition?: SuccessCondition;
|
||||
/**
|
||||
* For testing only.
|
||||
*/
|
||||
scheduler?: Rx.SchedulerLike;
|
||||
});
|
||||
private isSuccess;
|
||||
/**
|
||||
* Given a list of commands, wait for all of them to exit and then evaluate their exit codes.
|
||||
*
|
||||
* @returns A Promise that resolves if the success condition is met, or rejects otherwise.
|
||||
*/
|
||||
listen(commands: Command[]): Promise<CloseEvent[]>;
|
||||
private emitWithScheduler;
|
||||
}
|
77
backend/node_modules/concurrently/dist/src/completion-listener.js
generated
vendored
Normal file
77
backend/node_modules/concurrently/dist/src/completion-listener.js
generated
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.CompletionListener = void 0;
|
||||
const Rx = __importStar(require("rxjs"));
|
||||
const operators_1 = require("rxjs/operators");
|
||||
/**
|
||||
* Provides logic to determine whether lists of commands ran successfully.
|
||||
*/
|
||||
class CompletionListener {
|
||||
constructor({ successCondition = 'all', scheduler, }) {
|
||||
this.successCondition = successCondition;
|
||||
this.scheduler = scheduler;
|
||||
}
|
||||
isSuccess(events) {
|
||||
if (this.successCondition === 'first') {
|
||||
return events[0].exitCode === 0;
|
||||
}
|
||||
else if (this.successCondition === 'last') {
|
||||
return events[events.length - 1].exitCode === 0;
|
||||
}
|
||||
const commandSyntaxMatch = this.successCondition.match(/^!?command-(.+)$/);
|
||||
if (commandSyntaxMatch == null) {
|
||||
// If not a `command-` syntax, then it's an 'all' condition or it's treated as such.
|
||||
return events.every(({ exitCode }) => exitCode === 0);
|
||||
}
|
||||
// Check `command-` syntax condition.
|
||||
// Note that a command's `name` is not necessarily unique,
|
||||
// in which case all of them must meet the success condition.
|
||||
const nameOrIndex = commandSyntaxMatch[1];
|
||||
const targetCommandsEvents = events.filter(({ command, index }) => command.name === nameOrIndex || index === Number(nameOrIndex));
|
||||
if (this.successCondition.startsWith('!')) {
|
||||
// All commands except the specified ones must exit succesfully
|
||||
return events.every((event) => targetCommandsEvents.includes(event) || event.exitCode === 0);
|
||||
}
|
||||
// Only the specified commands must exit succesfully
|
||||
return (targetCommandsEvents.length > 0 &&
|
||||
targetCommandsEvents.every((event) => event.exitCode === 0));
|
||||
}
|
||||
/**
|
||||
* Given a list of commands, wait for all of them to exit and then evaluate their exit codes.
|
||||
*
|
||||
* @returns A Promise that resolves if the success condition is met, or rejects otherwise.
|
||||
*/
|
||||
listen(commands) {
|
||||
const closeStreams = commands.map((command) => command.close);
|
||||
return Rx.lastValueFrom(Rx.merge(...closeStreams).pipe((0, operators_1.bufferCount)(closeStreams.length), (0, operators_1.switchMap)((exitInfos) => this.isSuccess(exitInfos)
|
||||
? this.emitWithScheduler(Rx.of(exitInfos))
|
||||
: this.emitWithScheduler(Rx.throwError(() => exitInfos))), (0, operators_1.take)(1)));
|
||||
}
|
||||
emitWithScheduler(input) {
|
||||
return this.scheduler ? input.pipe(Rx.observeOn(this.scheduler)) : input;
|
||||
}
|
||||
}
|
||||
exports.CompletionListener = CompletionListener;
|
110
backend/node_modules/concurrently/dist/src/concurrently.d.ts
generated
vendored
Normal file
110
backend/node_modules/concurrently/dist/src/concurrently.d.ts
generated
vendored
Normal file
@@ -0,0 +1,110 @@
|
||||
/// <reference types="node" />
|
||||
import { Writable } from 'stream';
|
||||
import { CloseEvent, Command, CommandInfo, KillProcess, SpawnCommand } from './command';
|
||||
import { SuccessCondition } from './completion-listener';
|
||||
import { FlowController } from './flow-control/flow-controller';
|
||||
import { Logger } from './logger';
|
||||
/**
|
||||
* A command that is to be passed into `concurrently()`.
|
||||
* If value is a string, then that's the command's command line.
|
||||
* Fine grained options can be defined by using the object format.
|
||||
*/
|
||||
export type ConcurrentlyCommandInput = string | ({
|
||||
command: string;
|
||||
} & Partial<CommandInfo>);
|
||||
export type ConcurrentlyResult = {
|
||||
/**
|
||||
* All commands created and ran by concurrently.
|
||||
*/
|
||||
commands: Command[];
|
||||
/**
|
||||
* A promise that resolves when concurrently ran successfully according to the specified
|
||||
* success condition, or reject otherwise.
|
||||
*
|
||||
* Both the resolved and rejected value is the list of all command's close events.
|
||||
*/
|
||||
result: Promise<CloseEvent[]>;
|
||||
};
|
||||
export type ConcurrentlyOptions = {
|
||||
logger?: Logger;
|
||||
/**
|
||||
* Which stream should the commands output be written to.
|
||||
*/
|
||||
outputStream?: Writable;
|
||||
/**
|
||||
* Whether the output should be ordered as if the commands were run sequentially.
|
||||
*/
|
||||
group?: boolean;
|
||||
/**
|
||||
* A comma-separated list of chalk colors or a string for available styles listed below to use on prefixes.
|
||||
* If there are more commands than colors, the last color will be repeated.
|
||||
*
|
||||
* Available modifiers:
|
||||
* - `reset`, `bold`, `dim`, `italic`, `underline`, `inverse`, `hidden`, `strikethrough`
|
||||
*
|
||||
* Available colors:
|
||||
* - `black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`, `gray`,
|
||||
* any hex values for colors (e.g. `#23de43`) or `auto` for an automatically picked color
|
||||
*
|
||||
* Available background colors:
|
||||
* - `bgBlack`, `bgRed`, `bgGreen`, `bgYellow`, `bgBlue`, `bgMagenta`, `bgCyan`, `bgWhite`
|
||||
*
|
||||
* @see {@link https://www.npmjs.com/package/chalk} for more information.
|
||||
*/
|
||||
prefixColors?: string | string[];
|
||||
/**
|
||||
* Maximum number of commands to run at once.
|
||||
* Exact number or a percent of CPUs available (for example "50%").
|
||||
*
|
||||
* If undefined, then all processes will start in parallel.
|
||||
* Setting this value to 1 will achieve sequential running.
|
||||
*/
|
||||
maxProcesses?: number | string;
|
||||
/**
|
||||
* Whether commands should be spawned in raw mode.
|
||||
* Defaults to false.
|
||||
*/
|
||||
raw?: boolean;
|
||||
/**
|
||||
* The current working directory of commands which didn't specify one.
|
||||
* Defaults to `process.cwd()`.
|
||||
*/
|
||||
cwd?: string;
|
||||
/**
|
||||
* @see CompletionListener
|
||||
*/
|
||||
successCondition?: SuccessCondition;
|
||||
/**
|
||||
* Which flow controllers should be applied on commands spawned by concurrently.
|
||||
* Defaults to an empty array.
|
||||
*/
|
||||
controllers: FlowController[];
|
||||
/**
|
||||
* A function that will spawn commands.
|
||||
* Defaults to the `spawn-command` module.
|
||||
*/
|
||||
spawn: SpawnCommand;
|
||||
/**
|
||||
* A function that will kill processes.
|
||||
* Defaults to the `tree-kill` module.
|
||||
*/
|
||||
kill: KillProcess;
|
||||
/**
|
||||
* Signal to send to killed processes.
|
||||
*/
|
||||
killSignal?: string;
|
||||
/**
|
||||
* List of additional arguments passed that will get replaced in each command.
|
||||
* If not defined, no argument replacing will happen.
|
||||
*
|
||||
* @see ExpandArguments
|
||||
*/
|
||||
additionalArguments?: string[];
|
||||
};
|
||||
/**
|
||||
* Core concurrently functionality -- spawns the given commands concurrently and
|
||||
* returns the commands themselves + the result according to the specified success condition.
|
||||
*
|
||||
* @see CompletionListener
|
||||
*/
|
||||
export declare function concurrently(baseCommands: ConcurrentlyCommandInput[], baseOptions?: Partial<ConcurrentlyOptions>): ConcurrentlyResult;
|
130
backend/node_modules/concurrently/dist/src/concurrently.js
generated
vendored
Normal file
130
backend/node_modules/concurrently/dist/src/concurrently.js
generated
vendored
Normal file
@@ -0,0 +1,130 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.concurrently = void 0;
|
||||
const assert_1 = __importDefault(require("assert"));
|
||||
const lodash_1 = __importDefault(require("lodash"));
|
||||
const os_1 = require("os");
|
||||
const spawn_command_1 = __importDefault(require("spawn-command"));
|
||||
const tree_kill_1 = __importDefault(require("tree-kill"));
|
||||
const command_1 = require("./command");
|
||||
const expand_arguments_1 = require("./command-parser/expand-arguments");
|
||||
const expand_npm_shortcut_1 = require("./command-parser/expand-npm-shortcut");
|
||||
const expand_npm_wildcard_1 = require("./command-parser/expand-npm-wildcard");
|
||||
const strip_quotes_1 = require("./command-parser/strip-quotes");
|
||||
const completion_listener_1 = require("./completion-listener");
|
||||
const get_spawn_opts_1 = require("./get-spawn-opts");
|
||||
const output_writer_1 = require("./output-writer");
|
||||
const prefix_color_selector_1 = require("./prefix-color-selector");
|
||||
const defaults = {
|
||||
spawn: spawn_command_1.default,
|
||||
kill: tree_kill_1.default,
|
||||
raw: false,
|
||||
controllers: [],
|
||||
cwd: undefined,
|
||||
};
|
||||
/**
|
||||
* Core concurrently functionality -- spawns the given commands concurrently and
|
||||
* returns the commands themselves + the result according to the specified success condition.
|
||||
*
|
||||
* @see CompletionListener
|
||||
*/
|
||||
function concurrently(baseCommands, baseOptions) {
|
||||
assert_1.default.ok(Array.isArray(baseCommands), '[concurrently] commands should be an array');
|
||||
assert_1.default.notStrictEqual(baseCommands.length, 0, '[concurrently] no commands provided');
|
||||
const options = lodash_1.default.defaults(baseOptions, defaults);
|
||||
const prefixColorSelector = new prefix_color_selector_1.PrefixColorSelector(options.prefixColors);
|
||||
const commandParsers = [
|
||||
new strip_quotes_1.StripQuotes(),
|
||||
new expand_npm_shortcut_1.ExpandNpmShortcut(),
|
||||
new expand_npm_wildcard_1.ExpandNpmWildcard(),
|
||||
];
|
||||
if (options.additionalArguments) {
|
||||
commandParsers.push(new expand_arguments_1.ExpandArguments(options.additionalArguments));
|
||||
}
|
||||
let commands = (0, lodash_1.default)(baseCommands)
|
||||
.map(mapToCommandInfo)
|
||||
.flatMap((command) => parseCommand(command, commandParsers))
|
||||
.map((command, index) => {
|
||||
return new command_1.Command({
|
||||
index,
|
||||
prefixColor: prefixColorSelector.getNextColor(),
|
||||
...command,
|
||||
}, (0, get_spawn_opts_1.getSpawnOpts)({
|
||||
raw: command.raw ?? options.raw,
|
||||
env: command.env,
|
||||
cwd: command.cwd || options.cwd,
|
||||
}), options.spawn, options.kill);
|
||||
})
|
||||
.value();
|
||||
const handleResult = options.controllers.reduce(({ commands: prevCommands, onFinishCallbacks }, controller) => {
|
||||
const { commands, onFinish } = controller.handle(prevCommands);
|
||||
return {
|
||||
commands,
|
||||
onFinishCallbacks: lodash_1.default.concat(onFinishCallbacks, onFinish ? [onFinish] : []),
|
||||
};
|
||||
}, { commands, onFinishCallbacks: [] });
|
||||
commands = handleResult.commands;
|
||||
if (options.logger && options.outputStream) {
|
||||
const outputWriter = new output_writer_1.OutputWriter({
|
||||
outputStream: options.outputStream,
|
||||
group: !!options.group,
|
||||
commands,
|
||||
});
|
||||
options.logger.output.subscribe(({ command, text }) => outputWriter.write(command, text));
|
||||
}
|
||||
const commandsLeft = commands.slice();
|
||||
const maxProcesses = Math.max(1, (typeof options.maxProcesses === 'string' && options.maxProcesses.endsWith('%')
|
||||
? Math.round(((0, os_1.cpus)().length * Number(options.maxProcesses.slice(0, -1))) / 100)
|
||||
: Number(options.maxProcesses)) || commandsLeft.length);
|
||||
for (let i = 0; i < maxProcesses; i++) {
|
||||
maybeRunMore(commandsLeft);
|
||||
}
|
||||
const result = new completion_listener_1.CompletionListener({ successCondition: options.successCondition })
|
||||
.listen(commands)
|
||||
.finally(() => {
|
||||
handleResult.onFinishCallbacks.forEach((onFinish) => onFinish());
|
||||
});
|
||||
return {
|
||||
result,
|
||||
commands,
|
||||
};
|
||||
}
|
||||
exports.concurrently = concurrently;
|
||||
function mapToCommandInfo(command) {
|
||||
if (typeof command === 'string') {
|
||||
return mapToCommandInfo({ command });
|
||||
}
|
||||
assert_1.default.ok(command.command, '[concurrently] command cannot be empty');
|
||||
return {
|
||||
command: command.command,
|
||||
name: command.name || '',
|
||||
env: command.env || {},
|
||||
cwd: command.cwd || '',
|
||||
...(command.prefixColor
|
||||
? {
|
||||
prefixColor: command.prefixColor,
|
||||
}
|
||||
: {}),
|
||||
...(command.raw !== undefined
|
||||
? {
|
||||
raw: command.raw,
|
||||
}
|
||||
: {}),
|
||||
};
|
||||
}
|
||||
function parseCommand(command, parsers) {
|
||||
return parsers.reduce((commands, parser) => lodash_1.default.flatMap(commands, (command) => parser.parse(command)), lodash_1.default.castArray(command));
|
||||
}
|
||||
function maybeRunMore(commandsLeft) {
|
||||
const command = commandsLeft.shift();
|
||||
if (!command) {
|
||||
return;
|
||||
}
|
||||
command.start();
|
||||
command.close.subscribe(() => {
|
||||
maybeRunMore(commandsLeft);
|
||||
});
|
||||
}
|
68
backend/node_modules/concurrently/dist/src/defaults.d.ts
generated
vendored
Normal file
68
backend/node_modules/concurrently/dist/src/defaults.d.ts
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
import { SuccessCondition } from './completion-listener';
|
||||
export declare const defaultInputTarget = 0;
|
||||
/**
|
||||
* Whether process.stdin should be forwarded to child processes.
|
||||
*/
|
||||
export declare const handleInput = false;
|
||||
/**
|
||||
* How many processes to run at once.
|
||||
*/
|
||||
export declare const maxProcesses = 0;
|
||||
/**
|
||||
* Indices and names of commands whose output are not to be logged.
|
||||
*/
|
||||
export declare const hide = "";
|
||||
/**
|
||||
* The character to split <names> on.
|
||||
*/
|
||||
export declare const nameSeparator = ",";
|
||||
/**
|
||||
* Which prefix style to use when logging processes output.
|
||||
*/
|
||||
export declare const prefix = "";
|
||||
/**
|
||||
* Default prefix color.
|
||||
* @see https://www.npmjs.com/package/chalk
|
||||
*/
|
||||
export declare const prefixColors = "reset";
|
||||
/**
|
||||
* How many bytes we'll show on the command prefix.
|
||||
*/
|
||||
export declare const prefixLength = 10;
|
||||
export declare const raw = false;
|
||||
/**
|
||||
* Number of attempts of restarting a process, if it exits with non-0 code.
|
||||
*/
|
||||
export declare const restartTries = 0;
|
||||
/**
|
||||
* How many milliseconds concurrently should wait before restarting a process.
|
||||
*/
|
||||
export declare const restartDelay = 0;
|
||||
/**
|
||||
* Condition of success for concurrently itself.
|
||||
*/
|
||||
export declare const success: SuccessCondition;
|
||||
/**
|
||||
* Date format used when logging date/time.
|
||||
* @see https://date-fns.org/v2.0.1/docs/format
|
||||
*/
|
||||
export declare const timestampFormat = "yyyy-MM-dd HH:mm:ss.SSS";
|
||||
/**
|
||||
* Current working dir passed as option to spawn command.
|
||||
* Defaults to process.cwd()
|
||||
*/
|
||||
export declare const cwd: string | undefined;
|
||||
/**
|
||||
* Whether to show timing information for processes in console output.
|
||||
*/
|
||||
export declare const timings = false;
|
||||
/**
|
||||
* Passthrough additional arguments to commands (accessible via placeholders) instead of treating them as commands.
|
||||
*/
|
||||
export declare const passthroughArguments = false;
|
||||
/**
|
||||
* Signal to send to other processes if one exits or dies.
|
||||
*
|
||||
* Defaults to OS specific signal. (SIGTERM on Linux/MacOS)
|
||||
*/
|
||||
export declare const killSignal: string | undefined;
|
73
backend/node_modules/concurrently/dist/src/defaults.js
generated
vendored
Normal file
73
backend/node_modules/concurrently/dist/src/defaults.js
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
"use strict";
|
||||
// This file is meant to be a shared place for default configs.
|
||||
// It's read by the flow controllers, the executable, etc.
|
||||
// Refer to tests for the meaning of the different possible values.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.killSignal = exports.passthroughArguments = exports.timings = exports.cwd = exports.timestampFormat = exports.success = exports.restartDelay = exports.restartTries = exports.raw = exports.prefixLength = exports.prefixColors = exports.prefix = exports.nameSeparator = exports.hide = exports.maxProcesses = exports.handleInput = exports.defaultInputTarget = void 0;
|
||||
exports.defaultInputTarget = 0;
|
||||
/**
|
||||
* Whether process.stdin should be forwarded to child processes.
|
||||
*/
|
||||
exports.handleInput = false;
|
||||
/**
|
||||
* How many processes to run at once.
|
||||
*/
|
||||
exports.maxProcesses = 0;
|
||||
/**
|
||||
* Indices and names of commands whose output are not to be logged.
|
||||
*/
|
||||
exports.hide = '';
|
||||
/**
|
||||
* The character to split <names> on.
|
||||
*/
|
||||
exports.nameSeparator = ',';
|
||||
/**
|
||||
* Which prefix style to use when logging processes output.
|
||||
*/
|
||||
exports.prefix = '';
|
||||
/**
|
||||
* Default prefix color.
|
||||
* @see https://www.npmjs.com/package/chalk
|
||||
*/
|
||||
exports.prefixColors = 'reset';
|
||||
/**
|
||||
* How many bytes we'll show on the command prefix.
|
||||
*/
|
||||
exports.prefixLength = 10;
|
||||
exports.raw = false;
|
||||
/**
|
||||
* Number of attempts of restarting a process, if it exits with non-0 code.
|
||||
*/
|
||||
exports.restartTries = 0;
|
||||
/**
|
||||
* How many milliseconds concurrently should wait before restarting a process.
|
||||
*/
|
||||
exports.restartDelay = 0;
|
||||
/**
|
||||
* Condition of success for concurrently itself.
|
||||
*/
|
||||
exports.success = 'all';
|
||||
/**
|
||||
* Date format used when logging date/time.
|
||||
* @see https://date-fns.org/v2.0.1/docs/format
|
||||
*/
|
||||
exports.timestampFormat = 'yyyy-MM-dd HH:mm:ss.SSS';
|
||||
/**
|
||||
* Current working dir passed as option to spawn command.
|
||||
* Defaults to process.cwd()
|
||||
*/
|
||||
exports.cwd = undefined;
|
||||
/**
|
||||
* Whether to show timing information for processes in console output.
|
||||
*/
|
||||
exports.timings = false;
|
||||
/**
|
||||
* Passthrough additional arguments to commands (accessible via placeholders) instead of treating them as commands.
|
||||
*/
|
||||
exports.passthroughArguments = false;
|
||||
/**
|
||||
* Signal to send to other processes if one exits or dies.
|
||||
*
|
||||
* Defaults to OS specific signal. (SIGTERM on Linux/MacOS)
|
||||
*/
|
||||
exports.killSignal = undefined;
|
13
backend/node_modules/concurrently/dist/src/flow-control/flow-controller.d.ts
generated
vendored
Normal file
13
backend/node_modules/concurrently/dist/src/flow-control/flow-controller.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Command } from '../command';
|
||||
/**
|
||||
* Interface for a class that controls and/or watches the behavior of commands.
|
||||
*
|
||||
* This may include logging their output, creating interactions between them, or changing when they
|
||||
* actually finish.
|
||||
*/
|
||||
export interface FlowController {
|
||||
handle(commands: Command[]): {
|
||||
commands: Command[];
|
||||
onFinish?: () => void;
|
||||
};
|
||||
}
|
2
backend/node_modules/concurrently/dist/src/flow-control/flow-controller.js
generated
vendored
Normal file
2
backend/node_modules/concurrently/dist/src/flow-control/flow-controller.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
30
backend/node_modules/concurrently/dist/src/flow-control/input-handler.d.ts
generated
vendored
Normal file
30
backend/node_modules/concurrently/dist/src/flow-control/input-handler.d.ts
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
/// <reference types="node" />
|
||||
import { Readable } from 'stream';
|
||||
import { Command, CommandIdentifier } from '../command';
|
||||
import { Logger } from '../logger';
|
||||
import { FlowController } from './flow-controller';
|
||||
/**
|
||||
* Sends input from concurrently through to commands.
|
||||
*
|
||||
* Input can start with a command identifier, in which case it will be sent to that specific command.
|
||||
* For instance, `0:bla` will send `bla` to command at index `0`, and `server:stop` will send `stop`
|
||||
* to command with name `server`.
|
||||
*
|
||||
* If the input doesn't start with a command identifier, it is then always sent to the default target.
|
||||
*/
|
||||
export declare class InputHandler implements FlowController {
|
||||
private readonly logger;
|
||||
private readonly defaultInputTarget;
|
||||
private readonly inputStream?;
|
||||
private readonly pauseInputStreamOnFinish;
|
||||
constructor({ defaultInputTarget, inputStream, pauseInputStreamOnFinish, logger, }: {
|
||||
inputStream?: Readable;
|
||||
logger: Logger;
|
||||
defaultInputTarget?: CommandIdentifier;
|
||||
pauseInputStreamOnFinish?: boolean;
|
||||
});
|
||||
handle(commands: Command[]): {
|
||||
commands: Command[];
|
||||
onFinish?: () => void | undefined;
|
||||
};
|
||||
}
|
90
backend/node_modules/concurrently/dist/src/flow-control/input-handler.js
generated
vendored
Normal file
90
backend/node_modules/concurrently/dist/src/flow-control/input-handler.js
generated
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.InputHandler = void 0;
|
||||
const Rx = __importStar(require("rxjs"));
|
||||
const operators_1 = require("rxjs/operators");
|
||||
const defaults = __importStar(require("../defaults"));
|
||||
/**
|
||||
* Sends input from concurrently through to commands.
|
||||
*
|
||||
* Input can start with a command identifier, in which case it will be sent to that specific command.
|
||||
* For instance, `0:bla` will send `bla` to command at index `0`, and `server:stop` will send `stop`
|
||||
* to command with name `server`.
|
||||
*
|
||||
* If the input doesn't start with a command identifier, it is then always sent to the default target.
|
||||
*/
|
||||
class InputHandler {
|
||||
constructor({ defaultInputTarget, inputStream, pauseInputStreamOnFinish, logger, }) {
|
||||
this.logger = logger;
|
||||
this.defaultInputTarget = defaultInputTarget || defaults.defaultInputTarget;
|
||||
this.inputStream = inputStream;
|
||||
this.pauseInputStreamOnFinish = pauseInputStreamOnFinish !== false;
|
||||
}
|
||||
handle(commands) {
|
||||
const { inputStream } = this;
|
||||
if (!inputStream) {
|
||||
return { commands };
|
||||
}
|
||||
const commandsMap = new Map();
|
||||
for (const command of commands) {
|
||||
commandsMap.set(command.index.toString(), command);
|
||||
commandsMap.set(command.name, command);
|
||||
}
|
||||
Rx.fromEvent(inputStream, 'data')
|
||||
.pipe((0, operators_1.map)((data) => String(data)))
|
||||
.subscribe((data) => {
|
||||
let command, input;
|
||||
const dataParts = data.split(/:(.+)/s);
|
||||
let target = dataParts[0];
|
||||
if (dataParts.length > 1 && (command = commandsMap.get(target))) {
|
||||
input = dataParts[1];
|
||||
}
|
||||
else {
|
||||
// If `target` does not match a registered command,
|
||||
// fallback to `defaultInputTarget` and forward the whole input data
|
||||
target = this.defaultInputTarget.toString();
|
||||
command = commandsMap.get(target);
|
||||
input = data;
|
||||
}
|
||||
if (command && command.stdin) {
|
||||
command.stdin.write(input);
|
||||
}
|
||||
else {
|
||||
this.logger.logGlobalEvent(`Unable to find command "${target}", or it has no stdin open\n`);
|
||||
}
|
||||
});
|
||||
return {
|
||||
commands,
|
||||
onFinish: () => {
|
||||
if (this.pauseInputStreamOnFinish) {
|
||||
// https://github.com/kimmobrunfeldt/concurrently/issues/252
|
||||
inputStream.pause();
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.InputHandler = InputHandler;
|
17
backend/node_modules/concurrently/dist/src/flow-control/kill-on-signal.d.ts
generated
vendored
Normal file
17
backend/node_modules/concurrently/dist/src/flow-control/kill-on-signal.d.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
/// <reference types="node" />
|
||||
import EventEmitter from 'events';
|
||||
import { Command } from '../command';
|
||||
import { FlowController } from './flow-controller';
|
||||
/**
|
||||
* Watches the main concurrently process for signals and sends the same signal down to each spawned
|
||||
* command.
|
||||
*/
|
||||
export declare class KillOnSignal implements FlowController {
|
||||
private readonly process;
|
||||
constructor({ process }: {
|
||||
process: EventEmitter;
|
||||
});
|
||||
handle(commands: Command[]): {
|
||||
commands: Command[];
|
||||
};
|
||||
}
|
36
backend/node_modules/concurrently/dist/src/flow-control/kill-on-signal.js
generated
vendored
Normal file
36
backend/node_modules/concurrently/dist/src/flow-control/kill-on-signal.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.KillOnSignal = void 0;
|
||||
const operators_1 = require("rxjs/operators");
|
||||
/**
|
||||
* Watches the main concurrently process for signals and sends the same signal down to each spawned
|
||||
* command.
|
||||
*/
|
||||
class KillOnSignal {
|
||||
constructor({ process }) {
|
||||
this.process = process;
|
||||
}
|
||||
handle(commands) {
|
||||
let caughtSignal;
|
||||
['SIGINT', 'SIGTERM', 'SIGHUP'].forEach((signal) => {
|
||||
this.process.on(signal, () => {
|
||||
caughtSignal = signal;
|
||||
commands.forEach((command) => command.kill(signal));
|
||||
});
|
||||
});
|
||||
return {
|
||||
commands: commands.map((command) => {
|
||||
const closeStream = command.close.pipe((0, operators_1.map)((exitInfo) => {
|
||||
const exitCode = caughtSignal === 'SIGINT' ? 0 : exitInfo.exitCode;
|
||||
return { ...exitInfo, exitCode };
|
||||
}));
|
||||
return new Proxy(command, {
|
||||
get(target, prop) {
|
||||
return prop === 'close' ? closeStream : target[prop];
|
||||
},
|
||||
});
|
||||
}),
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.KillOnSignal = KillOnSignal;
|
20
backend/node_modules/concurrently/dist/src/flow-control/kill-others.d.ts
generated
vendored
Normal file
20
backend/node_modules/concurrently/dist/src/flow-control/kill-others.d.ts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Command } from '../command';
|
||||
import { Logger } from '../logger';
|
||||
import { FlowController } from './flow-controller';
|
||||
export type ProcessCloseCondition = 'failure' | 'success';
|
||||
/**
|
||||
* Sends a SIGTERM signal to all commands when one of the commands exits with a matching condition.
|
||||
*/
|
||||
export declare class KillOthers implements FlowController {
|
||||
private readonly logger;
|
||||
private readonly conditions;
|
||||
private readonly killSignal;
|
||||
constructor({ logger, conditions, killSignal, }: {
|
||||
logger: Logger;
|
||||
conditions: ProcessCloseCondition | ProcessCloseCondition[];
|
||||
killSignal: string | undefined;
|
||||
});
|
||||
handle(commands: Command[]): {
|
||||
commands: Command[];
|
||||
};
|
||||
}
|
35
backend/node_modules/concurrently/dist/src/flow-control/kill-others.js
generated
vendored
Normal file
35
backend/node_modules/concurrently/dist/src/flow-control/kill-others.js
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.KillOthers = void 0;
|
||||
const lodash_1 = __importDefault(require("lodash"));
|
||||
const operators_1 = require("rxjs/operators");
|
||||
const command_1 = require("../command");
|
||||
/**
|
||||
* Sends a SIGTERM signal to all commands when one of the commands exits with a matching condition.
|
||||
*/
|
||||
class KillOthers {
|
||||
constructor({ logger, conditions, killSignal, }) {
|
||||
this.logger = logger;
|
||||
this.conditions = lodash_1.default.castArray(conditions);
|
||||
this.killSignal = killSignal;
|
||||
}
|
||||
handle(commands) {
|
||||
const conditions = this.conditions.filter((condition) => condition === 'failure' || condition === 'success');
|
||||
if (!conditions.length) {
|
||||
return { commands };
|
||||
}
|
||||
const closeStates = commands.map((command) => command.close.pipe((0, operators_1.map)(({ exitCode }) => exitCode === 0 ? 'success' : 'failure'), (0, operators_1.filter)((state) => conditions.includes(state))));
|
||||
closeStates.forEach((closeState) => closeState.subscribe(() => {
|
||||
const killableCommands = commands.filter((command) => command_1.Command.canKill(command));
|
||||
if (killableCommands.length) {
|
||||
this.logger.logGlobalEvent(`Sending ${this.killSignal || 'SIGTERM'} to other processes..`);
|
||||
killableCommands.forEach((command) => command.kill(this.killSignal));
|
||||
}
|
||||
}));
|
||||
return { commands };
|
||||
}
|
||||
}
|
||||
exports.KillOthers = KillOthers;
|
15
backend/node_modules/concurrently/dist/src/flow-control/log-error.d.ts
generated
vendored
Normal file
15
backend/node_modules/concurrently/dist/src/flow-control/log-error.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Command } from '../command';
|
||||
import { Logger } from '../logger';
|
||||
import { FlowController } from './flow-controller';
|
||||
/**
|
||||
* Logs when commands failed executing, e.g. due to the executable not existing in the system.
|
||||
*/
|
||||
export declare class LogError implements FlowController {
|
||||
private readonly logger;
|
||||
constructor({ logger }: {
|
||||
logger: Logger;
|
||||
});
|
||||
handle(commands: Command[]): {
|
||||
commands: Command[];
|
||||
};
|
||||
}
|
20
backend/node_modules/concurrently/dist/src/flow-control/log-error.js
generated
vendored
Normal file
20
backend/node_modules/concurrently/dist/src/flow-control/log-error.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.LogError = void 0;
|
||||
/**
|
||||
* Logs when commands failed executing, e.g. due to the executable not existing in the system.
|
||||
*/
|
||||
class LogError {
|
||||
constructor({ logger }) {
|
||||
this.logger = logger;
|
||||
}
|
||||
handle(commands) {
|
||||
commands.forEach((command) => command.error.subscribe((event) => {
|
||||
this.logger.logCommandEvent(`Error occurred when executing command: ${command.command}`, command);
|
||||
const errorText = String(event instanceof Error ? event.stack || event : event);
|
||||
this.logger.logCommandEvent(errorText, command);
|
||||
}));
|
||||
return { commands };
|
||||
}
|
||||
}
|
||||
exports.LogError = LogError;
|
15
backend/node_modules/concurrently/dist/src/flow-control/log-exit.d.ts
generated
vendored
Normal file
15
backend/node_modules/concurrently/dist/src/flow-control/log-exit.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Command } from '../command';
|
||||
import { Logger } from '../logger';
|
||||
import { FlowController } from './flow-controller';
|
||||
/**
|
||||
* Logs the exit code/signal of commands.
|
||||
*/
|
||||
export declare class LogExit implements FlowController {
|
||||
private readonly logger;
|
||||
constructor({ logger }: {
|
||||
logger: Logger;
|
||||
});
|
||||
handle(commands: Command[]): {
|
||||
commands: Command[];
|
||||
};
|
||||
}
|
18
backend/node_modules/concurrently/dist/src/flow-control/log-exit.js
generated
vendored
Normal file
18
backend/node_modules/concurrently/dist/src/flow-control/log-exit.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.LogExit = void 0;
|
||||
/**
|
||||
* Logs the exit code/signal of commands.
|
||||
*/
|
||||
class LogExit {
|
||||
constructor({ logger }) {
|
||||
this.logger = logger;
|
||||
}
|
||||
handle(commands) {
|
||||
commands.forEach((command) => command.close.subscribe(({ exitCode }) => {
|
||||
this.logger.logCommandEvent(`${command.command} exited with code ${exitCode}`, command);
|
||||
}));
|
||||
return { commands };
|
||||
}
|
||||
}
|
||||
exports.LogExit = LogExit;
|
15
backend/node_modules/concurrently/dist/src/flow-control/log-output.d.ts
generated
vendored
Normal file
15
backend/node_modules/concurrently/dist/src/flow-control/log-output.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Command } from '../command';
|
||||
import { Logger } from '../logger';
|
||||
import { FlowController } from './flow-controller';
|
||||
/**
|
||||
* Logs the stdout and stderr output of commands.
|
||||
*/
|
||||
export declare class LogOutput implements FlowController {
|
||||
private readonly logger;
|
||||
constructor({ logger }: {
|
||||
logger: Logger;
|
||||
});
|
||||
handle(commands: Command[]): {
|
||||
commands: Command[];
|
||||
};
|
||||
}
|
19
backend/node_modules/concurrently/dist/src/flow-control/log-output.js
generated
vendored
Normal file
19
backend/node_modules/concurrently/dist/src/flow-control/log-output.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.LogOutput = void 0;
|
||||
/**
|
||||
* Logs the stdout and stderr output of commands.
|
||||
*/
|
||||
class LogOutput {
|
||||
constructor({ logger }) {
|
||||
this.logger = logger;
|
||||
}
|
||||
handle(commands) {
|
||||
commands.forEach((command) => {
|
||||
command.stdout.subscribe((text) => this.logger.logCommandText(text.toString(), command));
|
||||
command.stderr.subscribe((text) => this.logger.logCommandText(text.toString(), command));
|
||||
});
|
||||
return { commands };
|
||||
}
|
||||
}
|
||||
exports.LogOutput = LogOutput;
|
31
backend/node_modules/concurrently/dist/src/flow-control/log-timings.d.ts
generated
vendored
Normal file
31
backend/node_modules/concurrently/dist/src/flow-control/log-timings.d.ts
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
import { CloseEvent, Command } from '../command';
|
||||
import { Logger } from '../logger';
|
||||
import { FlowController } from './flow-controller';
|
||||
type TimingInfo = {
|
||||
name: string;
|
||||
duration: string;
|
||||
'exit code': string | number;
|
||||
killed: boolean;
|
||||
command: string;
|
||||
};
|
||||
/**
|
||||
* Logs timing information about commands as they start/stop and then a summary when all commands finish.
|
||||
*/
|
||||
export declare class LogTimings implements FlowController {
|
||||
static mapCloseEventToTimingInfo({ command, timings, killed, exitCode, }: CloseEvent): TimingInfo;
|
||||
private readonly logger?;
|
||||
private readonly timestampFormat;
|
||||
constructor({ logger, timestampFormat, }: {
|
||||
logger?: Logger;
|
||||
timestampFormat?: string;
|
||||
});
|
||||
private printExitInfoTimingTable;
|
||||
handle(commands: Command[]): {
|
||||
commands: Command[];
|
||||
onFinish?: undefined;
|
||||
} | {
|
||||
commands: Command[];
|
||||
onFinish: () => void;
|
||||
};
|
||||
}
|
||||
export {};
|
92
backend/node_modules/concurrently/dist/src/flow-control/log-timings.js
generated
vendored
Normal file
92
backend/node_modules/concurrently/dist/src/flow-control/log-timings.js
generated
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.LogTimings = void 0;
|
||||
const assert = __importStar(require("assert"));
|
||||
const format_1 = __importDefault(require("date-fns/format"));
|
||||
const lodash_1 = __importDefault(require("lodash"));
|
||||
const Rx = __importStar(require("rxjs"));
|
||||
const operators_1 = require("rxjs/operators");
|
||||
const defaults = __importStar(require("../defaults"));
|
||||
/**
|
||||
* Logs timing information about commands as they start/stop and then a summary when all commands finish.
|
||||
*/
|
||||
class LogTimings {
|
||||
static mapCloseEventToTimingInfo({ command, timings, killed, exitCode, }) {
|
||||
const readableDurationMs = (timings.endDate.getTime() - timings.startDate.getTime()).toLocaleString();
|
||||
return {
|
||||
name: command.name,
|
||||
duration: readableDurationMs,
|
||||
'exit code': exitCode,
|
||||
killed,
|
||||
command: command.command,
|
||||
};
|
||||
}
|
||||
constructor({ logger, timestampFormat = defaults.timestampFormat, }) {
|
||||
this.logger = logger;
|
||||
this.timestampFormat = timestampFormat;
|
||||
}
|
||||
printExitInfoTimingTable(exitInfos) {
|
||||
assert.ok(this.logger);
|
||||
const exitInfoTable = (0, lodash_1.default)(exitInfos)
|
||||
.sortBy(({ timings }) => timings.durationSeconds)
|
||||
.reverse()
|
||||
.map(LogTimings.mapCloseEventToTimingInfo)
|
||||
.value();
|
||||
this.logger.logGlobalEvent('Timings:');
|
||||
this.logger.logTable(exitInfoTable);
|
||||
return exitInfos;
|
||||
}
|
||||
handle(commands) {
|
||||
const { logger } = this;
|
||||
if (!logger) {
|
||||
return { commands };
|
||||
}
|
||||
// individual process timings
|
||||
commands.forEach((command) => {
|
||||
command.timer.subscribe(({ startDate, endDate }) => {
|
||||
if (!endDate) {
|
||||
const formattedStartDate = (0, format_1.default)(startDate, this.timestampFormat);
|
||||
logger.logCommandEvent(`${command.command} started at ${formattedStartDate}`, command);
|
||||
}
|
||||
else {
|
||||
const durationMs = endDate.getTime() - startDate.getTime();
|
||||
const formattedEndDate = (0, format_1.default)(endDate, this.timestampFormat);
|
||||
logger.logCommandEvent(`${command.command} stopped at ${formattedEndDate} after ${durationMs.toLocaleString()}ms`, command);
|
||||
}
|
||||
});
|
||||
});
|
||||
// overall summary timings
|
||||
const closeStreams = commands.map((command) => command.close);
|
||||
const finished = new Rx.Subject();
|
||||
const allProcessesClosed = Rx.merge(...closeStreams).pipe((0, operators_1.bufferCount)(closeStreams.length), (0, operators_1.take)(1), (0, operators_1.combineLatestWith)(finished));
|
||||
allProcessesClosed.subscribe(([exitInfos]) => this.printExitInfoTimingTable(exitInfos));
|
||||
return { commands, onFinish: () => finished.next() };
|
||||
}
|
||||
}
|
||||
exports.LogTimings = LogTimings;
|
22
backend/node_modules/concurrently/dist/src/flow-control/restart-process.d.ts
generated
vendored
Normal file
22
backend/node_modules/concurrently/dist/src/flow-control/restart-process.d.ts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import * as Rx from 'rxjs';
|
||||
import { Command } from '../command';
|
||||
import { Logger } from '../logger';
|
||||
import { FlowController } from './flow-controller';
|
||||
/**
|
||||
* Restarts commands that fail up to a defined number of times.
|
||||
*/
|
||||
export declare class RestartProcess implements FlowController {
|
||||
private readonly logger;
|
||||
private readonly scheduler?;
|
||||
readonly delay: number;
|
||||
readonly tries: number;
|
||||
constructor({ delay, tries, logger, scheduler, }: {
|
||||
delay?: number;
|
||||
tries?: number;
|
||||
logger: Logger;
|
||||
scheduler?: Rx.SchedulerLike;
|
||||
});
|
||||
handle(commands: Command[]): {
|
||||
commands: Command[];
|
||||
};
|
||||
}
|
76
backend/node_modules/concurrently/dist/src/flow-control/restart-process.js
generated
vendored
Normal file
76
backend/node_modules/concurrently/dist/src/flow-control/restart-process.js
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.RestartProcess = void 0;
|
||||
const Rx = __importStar(require("rxjs"));
|
||||
const operators_1 = require("rxjs/operators");
|
||||
const defaults = __importStar(require("../defaults"));
|
||||
/**
|
||||
* Restarts commands that fail up to a defined number of times.
|
||||
*/
|
||||
class RestartProcess {
|
||||
constructor({ delay, tries, logger, scheduler, }) {
|
||||
this.logger = logger;
|
||||
this.delay = delay != null ? +delay : defaults.restartDelay;
|
||||
this.tries = tries != null ? +tries : defaults.restartTries;
|
||||
this.tries = this.tries < 0 ? Infinity : this.tries;
|
||||
this.scheduler = scheduler;
|
||||
}
|
||||
handle(commands) {
|
||||
if (this.tries === 0) {
|
||||
return { commands };
|
||||
}
|
||||
commands
|
||||
.map((command) => command.close.pipe((0, operators_1.take)(this.tries), (0, operators_1.takeWhile)(({ exitCode }) => exitCode !== 0)))
|
||||
.map((failure, index) => Rx.merge(
|
||||
// Delay the emission (so that the restarts happen on time),
|
||||
// explicitly telling the subscriber that a restart is needed
|
||||
failure.pipe((0, operators_1.delay)(this.delay, this.scheduler), (0, operators_1.map)(() => true)),
|
||||
// Skip the first N emissions (as these would be duplicates of the above),
|
||||
// meaning it will be empty because of success, or failed all N times,
|
||||
// and no more restarts should be attempted.
|
||||
failure.pipe((0, operators_1.skip)(this.tries), (0, operators_1.map)(() => false), (0, operators_1.defaultIfEmpty)(false))).subscribe((restart) => {
|
||||
const command = commands[index];
|
||||
if (restart) {
|
||||
this.logger.logCommandEvent(`${command.command} restarted`, command);
|
||||
command.start();
|
||||
}
|
||||
}));
|
||||
return {
|
||||
commands: commands.map((command) => {
|
||||
const closeStream = command.close.pipe((0, operators_1.filter)(({ exitCode }, emission) => {
|
||||
// We let all success codes pass, and failures only after restarting won't happen again
|
||||
return exitCode === 0 || emission >= this.tries;
|
||||
}));
|
||||
return new Proxy(command, {
|
||||
get(target, prop) {
|
||||
return prop === 'close' ? closeStream : target[prop];
|
||||
},
|
||||
});
|
||||
}),
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.RestartProcess = RestartProcess;
|
34
backend/node_modules/concurrently/dist/src/get-spawn-opts.d.ts
generated
vendored
Normal file
34
backend/node_modules/concurrently/dist/src/get-spawn-opts.d.ts
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
/// <reference types="node" />
|
||||
/// <reference types="node" />
|
||||
/// <reference types="node" />
|
||||
/// <reference types="node" />
|
||||
/// <reference types="node" />
|
||||
import { SpawnOptions } from 'child_process';
|
||||
import supportsColor from 'supports-color';
|
||||
export declare const getSpawnOpts: ({ colorSupport, cwd, process, raw, env, }: {
|
||||
/**
|
||||
* What the color support of the spawned processes should be.
|
||||
* If set to `false`, then no colors should be output.
|
||||
*
|
||||
* Defaults to whatever the terminal's stdout support is.
|
||||
*/
|
||||
colorSupport?: false | Pick<supportsColor.supportsColor.Level, "level"> | undefined;
|
||||
/**
|
||||
* The NodeJS process.
|
||||
*/
|
||||
process?: Pick<NodeJS.Process, "platform" | "cwd" | "env"> | undefined;
|
||||
/**
|
||||
* A custom working directory to spawn processes in.
|
||||
* Defaults to `process.cwd()`.
|
||||
*/
|
||||
cwd?: string | undefined;
|
||||
/**
|
||||
* Whether to customize the options for spawning processes in raw mode.
|
||||
* Defaults to false.
|
||||
*/
|
||||
raw?: boolean | undefined;
|
||||
/**
|
||||
* Map of custom environment variables to include in the spawn options.
|
||||
*/
|
||||
env?: Record<string, unknown> | undefined;
|
||||
}) => SpawnOptions;
|
18
backend/node_modules/concurrently/dist/src/get-spawn-opts.js
generated
vendored
Normal file
18
backend/node_modules/concurrently/dist/src/get-spawn-opts.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getSpawnOpts = void 0;
|
||||
const supports_color_1 = __importDefault(require("supports-color"));
|
||||
const getSpawnOpts = ({ colorSupport = supports_color_1.default.stdout, cwd, process = global.process, raw = false, env = {}, }) => ({
|
||||
cwd: cwd || process.cwd(),
|
||||
...(raw && { stdio: 'inherit' }),
|
||||
...(/^win/.test(process.platform) && { detached: false }),
|
||||
env: {
|
||||
...(colorSupport ? { FORCE_COLOR: colorSupport.level.toString() } : {}),
|
||||
...process.env,
|
||||
...env,
|
||||
},
|
||||
});
|
||||
exports.getSpawnOpts = getSpawnOpts;
|
74
backend/node_modules/concurrently/dist/src/index.d.ts
generated
vendored
Normal file
74
backend/node_modules/concurrently/dist/src/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
/// <reference types="node" />
|
||||
import { Readable } from 'stream';
|
||||
import { CloseEvent, Command, CommandIdentifier, TimerEvent } from './command';
|
||||
import { concurrently, ConcurrentlyCommandInput, ConcurrentlyOptions as BaseConcurrentlyOptions, ConcurrentlyResult } from './concurrently';
|
||||
import { FlowController } from './flow-control/flow-controller';
|
||||
import { InputHandler } from './flow-control/input-handler';
|
||||
import { KillOnSignal } from './flow-control/kill-on-signal';
|
||||
import { KillOthers, ProcessCloseCondition } from './flow-control/kill-others';
|
||||
import { LogError } from './flow-control/log-error';
|
||||
import { LogExit } from './flow-control/log-exit';
|
||||
import { LogOutput } from './flow-control/log-output';
|
||||
import { LogTimings } from './flow-control/log-timings';
|
||||
import { RestartProcess } from './flow-control/restart-process';
|
||||
import { Logger } from './logger';
|
||||
export type ConcurrentlyOptions = BaseConcurrentlyOptions & {
|
||||
/**
|
||||
* Which command(s) should have their output hidden.
|
||||
*/
|
||||
hide?: CommandIdentifier | CommandIdentifier[];
|
||||
/**
|
||||
* The prefix format to use when logging a command's output.
|
||||
* Defaults to the command's index.
|
||||
*/
|
||||
prefix?: string;
|
||||
/**
|
||||
* How many characters should a prefix have at most, used when the prefix format is `command`.
|
||||
*/
|
||||
prefixLength?: number;
|
||||
/**
|
||||
* Whether output should be formatted to include prefixes and whether "event" logs will be logged.
|
||||
*/
|
||||
raw?: boolean;
|
||||
/**
|
||||
* Date format used when logging date/time.
|
||||
* @see https://date-fns.org/v2.0.1/docs/format
|
||||
*/
|
||||
timestampFormat?: string;
|
||||
defaultInputTarget?: CommandIdentifier;
|
||||
inputStream?: Readable;
|
||||
handleInput?: boolean;
|
||||
pauseInputStreamOnFinish?: boolean;
|
||||
/**
|
||||
* How much time in milliseconds to wait before restarting a command.
|
||||
*
|
||||
* @see RestartProcess
|
||||
*/
|
||||
restartDelay?: number;
|
||||
/**
|
||||
* How many times commands should be restarted when they exit with a failure.
|
||||
*
|
||||
* @see RestartProcess
|
||||
*/
|
||||
restartTries?: number;
|
||||
/**
|
||||
* Under which condition(s) should other commands be killed when the first one exits.
|
||||
*
|
||||
* @see KillOthers
|
||||
*/
|
||||
killOthers?: ProcessCloseCondition | ProcessCloseCondition[];
|
||||
/**
|
||||
* Whether to output timing information for processes.
|
||||
*
|
||||
* @see LogTimings
|
||||
*/
|
||||
timings?: boolean;
|
||||
/**
|
||||
* List of additional arguments passed that will get replaced in each command.
|
||||
* If not defined, no argument replacing will happen.
|
||||
*/
|
||||
additionalArguments?: string[];
|
||||
};
|
||||
declare const _default: (commands: ConcurrentlyCommandInput[], options?: Partial<ConcurrentlyOptions>) => ConcurrentlyResult;
|
||||
export default _default;
|
||||
export { CloseEvent, Command, CommandIdentifier, concurrently, ConcurrentlyCommandInput, ConcurrentlyResult, FlowController, InputHandler, KillOnSignal, KillOthers, LogError, LogExit, Logger, LogOutput, LogTimings, RestartProcess, TimerEvent, };
|
71
backend/node_modules/concurrently/dist/src/index.js
generated
vendored
Normal file
71
backend/node_modules/concurrently/dist/src/index.js
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.RestartProcess = exports.LogTimings = exports.LogOutput = exports.Logger = exports.LogExit = exports.LogError = exports.KillOthers = exports.KillOnSignal = exports.InputHandler = exports.concurrently = exports.Command = void 0;
|
||||
const command_1 = require("./command");
|
||||
Object.defineProperty(exports, "Command", { enumerable: true, get: function () { return command_1.Command; } });
|
||||
const concurrently_1 = require("./concurrently");
|
||||
Object.defineProperty(exports, "concurrently", { enumerable: true, get: function () { return concurrently_1.concurrently; } });
|
||||
const input_handler_1 = require("./flow-control/input-handler");
|
||||
Object.defineProperty(exports, "InputHandler", { enumerable: true, get: function () { return input_handler_1.InputHandler; } });
|
||||
const kill_on_signal_1 = require("./flow-control/kill-on-signal");
|
||||
Object.defineProperty(exports, "KillOnSignal", { enumerable: true, get: function () { return kill_on_signal_1.KillOnSignal; } });
|
||||
const kill_others_1 = require("./flow-control/kill-others");
|
||||
Object.defineProperty(exports, "KillOthers", { enumerable: true, get: function () { return kill_others_1.KillOthers; } });
|
||||
const log_error_1 = require("./flow-control/log-error");
|
||||
Object.defineProperty(exports, "LogError", { enumerable: true, get: function () { return log_error_1.LogError; } });
|
||||
const log_exit_1 = require("./flow-control/log-exit");
|
||||
Object.defineProperty(exports, "LogExit", { enumerable: true, get: function () { return log_exit_1.LogExit; } });
|
||||
const log_output_1 = require("./flow-control/log-output");
|
||||
Object.defineProperty(exports, "LogOutput", { enumerable: true, get: function () { return log_output_1.LogOutput; } });
|
||||
const log_timings_1 = require("./flow-control/log-timings");
|
||||
Object.defineProperty(exports, "LogTimings", { enumerable: true, get: function () { return log_timings_1.LogTimings; } });
|
||||
const restart_process_1 = require("./flow-control/restart-process");
|
||||
Object.defineProperty(exports, "RestartProcess", { enumerable: true, get: function () { return restart_process_1.RestartProcess; } });
|
||||
const logger_1 = require("./logger");
|
||||
Object.defineProperty(exports, "Logger", { enumerable: true, get: function () { return logger_1.Logger; } });
|
||||
exports.default = (commands, options = {}) => {
|
||||
const logger = new logger_1.Logger({
|
||||
hide: options.hide,
|
||||
prefixFormat: options.prefix,
|
||||
prefixLength: options.prefixLength,
|
||||
raw: options.raw,
|
||||
timestampFormat: options.timestampFormat,
|
||||
});
|
||||
return (0, concurrently_1.concurrently)(commands, {
|
||||
maxProcesses: options.maxProcesses,
|
||||
raw: options.raw,
|
||||
successCondition: options.successCondition,
|
||||
cwd: options.cwd,
|
||||
logger,
|
||||
outputStream: options.outputStream || process.stdout,
|
||||
group: options.group,
|
||||
controllers: [
|
||||
new log_error_1.LogError({ logger }),
|
||||
new log_output_1.LogOutput({ logger }),
|
||||
new log_exit_1.LogExit({ logger }),
|
||||
new input_handler_1.InputHandler({
|
||||
logger,
|
||||
defaultInputTarget: options.defaultInputTarget,
|
||||
inputStream: options.inputStream || (options.handleInput ? process.stdin : undefined),
|
||||
pauseInputStreamOnFinish: options.pauseInputStreamOnFinish,
|
||||
}),
|
||||
new kill_on_signal_1.KillOnSignal({ process }),
|
||||
new restart_process_1.RestartProcess({
|
||||
logger,
|
||||
delay: options.restartDelay,
|
||||
tries: options.restartTries,
|
||||
}),
|
||||
new kill_others_1.KillOthers({
|
||||
logger,
|
||||
conditions: options.killOthers || [],
|
||||
killSignal: options.killSignal,
|
||||
}),
|
||||
new log_timings_1.LogTimings({
|
||||
logger: options.timings ? logger : undefined,
|
||||
timestampFormat: options.timestampFormat,
|
||||
}),
|
||||
],
|
||||
prefixColors: options.prefixColors || [],
|
||||
additionalArguments: options.additionalArguments,
|
||||
});
|
||||
};
|
72
backend/node_modules/concurrently/dist/src/logger.d.ts
generated
vendored
Normal file
72
backend/node_modules/concurrently/dist/src/logger.d.ts
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
import * as Rx from 'rxjs';
|
||||
import { Command, CommandIdentifier } from './command';
|
||||
export declare class Logger {
|
||||
private readonly hide;
|
||||
private readonly raw;
|
||||
private readonly prefixFormat?;
|
||||
private readonly prefixLength;
|
||||
private readonly timestampFormat;
|
||||
/**
|
||||
* Last character emitted.
|
||||
* If `undefined`, then nothing has been logged yet.
|
||||
*/
|
||||
private lastChar?;
|
||||
/**
|
||||
* Observable that emits when there's been output logged.
|
||||
* If `command` is is `undefined`, then the log is for a global event.
|
||||
*/
|
||||
readonly output: Rx.Subject<{
|
||||
command: Command | undefined;
|
||||
text: string;
|
||||
}>;
|
||||
constructor({ hide, prefixFormat, prefixLength, raw, timestampFormat, }: {
|
||||
/**
|
||||
* Which command(s) should have their output hidden.
|
||||
*/
|
||||
hide?: CommandIdentifier | CommandIdentifier[];
|
||||
/**
|
||||
* Whether output should be formatted to include prefixes and whether "event" logs will be
|
||||
* logged.
|
||||
*/
|
||||
raw?: boolean;
|
||||
/**
|
||||
* The prefix format to use when logging a command's output.
|
||||
* Defaults to the command's index.
|
||||
*/
|
||||
prefixFormat?: string;
|
||||
/**
|
||||
* How many characters should a prefix have at most, used when the prefix format is `command`.
|
||||
*/
|
||||
prefixLength?: number;
|
||||
/**
|
||||
* Date format used when logging date/time.
|
||||
* @see https://date-fns.org/v2.0.1/docs/format
|
||||
*/
|
||||
timestampFormat?: string;
|
||||
});
|
||||
private shortenText;
|
||||
private getPrefixesFor;
|
||||
getPrefix(command: Command): string;
|
||||
colorText(command: Command, text: string): string;
|
||||
/**
|
||||
* Logs an event for a command (e.g. start, stop).
|
||||
*
|
||||
* If raw mode is on, then nothing is logged.
|
||||
*/
|
||||
logCommandEvent(text: string, command: Command): void;
|
||||
logCommandText(text: string, command: Command): void;
|
||||
/**
|
||||
* Logs a global event (e.g. sending signals to processes).
|
||||
*
|
||||
* If raw mode is on, then nothing is logged.
|
||||
*/
|
||||
logGlobalEvent(text: string): void;
|
||||
/**
|
||||
* Logs a table from an input object array, like `console.table`.
|
||||
*
|
||||
* Each row is a single input item, and they are presented in the input order.
|
||||
*/
|
||||
logTable(tableContents: Record<string, unknown>[]): void;
|
||||
log(prefix: string, text: string, command?: Command): void;
|
||||
emit(command: Command | undefined, text: string): void;
|
||||
}
|
202
backend/node_modules/concurrently/dist/src/logger.js
generated
vendored
Normal file
202
backend/node_modules/concurrently/dist/src/logger.js
generated
vendored
Normal file
@@ -0,0 +1,202 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Logger = void 0;
|
||||
const chalk_1 = __importDefault(require("chalk"));
|
||||
const format_1 = __importDefault(require("date-fns/format"));
|
||||
const lodash_1 = __importDefault(require("lodash"));
|
||||
const Rx = __importStar(require("rxjs"));
|
||||
const defaults = __importStar(require("./defaults"));
|
||||
class Logger {
|
||||
constructor({ hide, prefixFormat, prefixLength, raw = false, timestampFormat, }) {
|
||||
/**
|
||||
* Observable that emits when there's been output logged.
|
||||
* If `command` is is `undefined`, then the log is for a global event.
|
||||
*/
|
||||
this.output = new Rx.Subject();
|
||||
// To avoid empty strings from hiding the output of commands that don't have a name,
|
||||
// keep in the list of commands to hide only strings with some length.
|
||||
// This might happen through the CLI when no `--hide` argument is specified, for example.
|
||||
this.hide = lodash_1.default.castArray(hide)
|
||||
.filter((name) => name || name === 0)
|
||||
.map(String);
|
||||
this.raw = raw;
|
||||
this.prefixFormat = prefixFormat;
|
||||
this.prefixLength = prefixLength || defaults.prefixLength;
|
||||
this.timestampFormat = timestampFormat || defaults.timestampFormat;
|
||||
}
|
||||
shortenText(text) {
|
||||
if (!text || text.length <= this.prefixLength) {
|
||||
return text;
|
||||
}
|
||||
const ellipsis = '..';
|
||||
const prefixLength = this.prefixLength - ellipsis.length;
|
||||
const endLength = Math.floor(prefixLength / 2);
|
||||
const beginningLength = prefixLength - endLength;
|
||||
const beginnning = text.slice(0, beginningLength);
|
||||
const end = text.slice(text.length - endLength, text.length);
|
||||
return beginnning + ellipsis + end;
|
||||
}
|
||||
getPrefixesFor(command) {
|
||||
return {
|
||||
pid: String(command.pid),
|
||||
index: String(command.index),
|
||||
name: command.name,
|
||||
command: this.shortenText(command.command),
|
||||
time: (0, format_1.default)(Date.now(), this.timestampFormat),
|
||||
};
|
||||
}
|
||||
getPrefix(command) {
|
||||
const prefix = this.prefixFormat || (command.name ? 'name' : 'index');
|
||||
if (prefix === 'none') {
|
||||
return '';
|
||||
}
|
||||
const prefixes = this.getPrefixesFor(command);
|
||||
if (Object.keys(prefixes).includes(prefix)) {
|
||||
return `[${prefixes[prefix]}]`;
|
||||
}
|
||||
return lodash_1.default.reduce(prefixes, (prev, val, key) => {
|
||||
const keyRegex = new RegExp(lodash_1.default.escapeRegExp(`{${key}}`), 'g');
|
||||
return prev.replace(keyRegex, String(val));
|
||||
}, prefix);
|
||||
}
|
||||
colorText(command, text) {
|
||||
let color;
|
||||
if (command.prefixColor && command.prefixColor.startsWith('#')) {
|
||||
color = chalk_1.default.hex(command.prefixColor);
|
||||
}
|
||||
else {
|
||||
const defaultColor = lodash_1.default.get(chalk_1.default, defaults.prefixColors, chalk_1.default.reset);
|
||||
color = lodash_1.default.get(chalk_1.default, command.prefixColor ?? '', defaultColor);
|
||||
}
|
||||
return color(text);
|
||||
}
|
||||
/**
|
||||
* Logs an event for a command (e.g. start, stop).
|
||||
*
|
||||
* If raw mode is on, then nothing is logged.
|
||||
*/
|
||||
logCommandEvent(text, command) {
|
||||
if (this.raw) {
|
||||
return;
|
||||
}
|
||||
this.logCommandText(chalk_1.default.reset(text) + '\n', command);
|
||||
}
|
||||
logCommandText(text, command) {
|
||||
if (this.hide.includes(String(command.index)) || this.hide.includes(command.name)) {
|
||||
return;
|
||||
}
|
||||
const prefix = this.colorText(command, this.getPrefix(command));
|
||||
return this.log(prefix + (prefix ? ' ' : ''), text, command);
|
||||
}
|
||||
/**
|
||||
* Logs a global event (e.g. sending signals to processes).
|
||||
*
|
||||
* If raw mode is on, then nothing is logged.
|
||||
*/
|
||||
logGlobalEvent(text) {
|
||||
if (this.raw) {
|
||||
return;
|
||||
}
|
||||
this.log(chalk_1.default.reset('-->') + ' ', chalk_1.default.reset(text) + '\n');
|
||||
}
|
||||
/**
|
||||
* Logs a table from an input object array, like `console.table`.
|
||||
*
|
||||
* Each row is a single input item, and they are presented in the input order.
|
||||
*/
|
||||
logTable(tableContents) {
|
||||
// For now, can only print array tables with some content.
|
||||
if (this.raw || !Array.isArray(tableContents) || !tableContents.length) {
|
||||
return;
|
||||
}
|
||||
let nextColIndex = 0;
|
||||
const headers = {};
|
||||
const contentRows = tableContents.map((row) => {
|
||||
const rowContents = [];
|
||||
Object.keys(row).forEach((col) => {
|
||||
if (!headers[col]) {
|
||||
headers[col] = {
|
||||
index: nextColIndex++,
|
||||
length: col.length,
|
||||
};
|
||||
}
|
||||
const colIndex = headers[col].index;
|
||||
const formattedValue = String(row[col] == null ? '' : row[col]);
|
||||
// Update the column length in case this rows value is longer than the previous length for the column.
|
||||
headers[col].length = Math.max(formattedValue.length, headers[col].length);
|
||||
rowContents[colIndex] = formattedValue;
|
||||
return rowContents;
|
||||
});
|
||||
return rowContents;
|
||||
});
|
||||
const headersFormatted = Object.keys(headers).map((header) => header.padEnd(headers[header].length, ' '));
|
||||
if (!headersFormatted.length) {
|
||||
// No columns exist.
|
||||
return;
|
||||
}
|
||||
const borderRowFormatted = headersFormatted.map((header) => '─'.padEnd(header.length, '─'));
|
||||
this.logGlobalEvent(`┌─${borderRowFormatted.join('─┬─')}─┐`);
|
||||
this.logGlobalEvent(`│ ${headersFormatted.join(' │ ')} │`);
|
||||
this.logGlobalEvent(`├─${borderRowFormatted.join('─┼─')}─┤`);
|
||||
contentRows.forEach((contentRow) => {
|
||||
const contentRowFormatted = headersFormatted.map((header, colIndex) => {
|
||||
// If the table was expanded after this row was processed, it won't have this column.
|
||||
// Use an empty string in this case.
|
||||
const col = contentRow[colIndex] || '';
|
||||
return col.padEnd(header.length, ' ');
|
||||
});
|
||||
this.logGlobalEvent(`│ ${contentRowFormatted.join(' │ ')} │`);
|
||||
});
|
||||
this.logGlobalEvent(`└─${borderRowFormatted.join('─┴─')}─┘`);
|
||||
}
|
||||
log(prefix, text, command) {
|
||||
if (this.raw) {
|
||||
return this.emit(command, text);
|
||||
}
|
||||
// #70 - replace some ANSI code that would impact clearing lines
|
||||
text = text.replace(/\u2026/g, '...');
|
||||
const lines = text.split('\n').map((line, index, lines) => {
|
||||
// First line will write prefix only if we finished the last write with a LF.
|
||||
// Last line won't write prefix because it should be empty.
|
||||
if (index === 0 || index === lines.length - 1) {
|
||||
return line;
|
||||
}
|
||||
return prefix + line;
|
||||
});
|
||||
if (!this.lastChar || this.lastChar === '\n') {
|
||||
this.emit(command, prefix);
|
||||
}
|
||||
this.lastChar = text[text.length - 1];
|
||||
this.emit(command, lines.join('\n'));
|
||||
}
|
||||
emit(command, text) {
|
||||
this.output.next({ command, text });
|
||||
}
|
||||
}
|
||||
exports.Logger = Logger;
|
19
backend/node_modules/concurrently/dist/src/output-writer.d.ts
generated
vendored
Normal file
19
backend/node_modules/concurrently/dist/src/output-writer.d.ts
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
/// <reference types="node" />
|
||||
import { Writable } from 'stream';
|
||||
import { Command } from './command';
|
||||
/**
|
||||
* Class responsible for actually writing output onto a writable stream.
|
||||
*/
|
||||
export declare class OutputWriter {
|
||||
private readonly outputStream;
|
||||
private readonly group;
|
||||
readonly buffers: string[][];
|
||||
activeCommandIndex: number;
|
||||
constructor({ outputStream, group, commands, }: {
|
||||
outputStream: Writable;
|
||||
group: boolean;
|
||||
commands: Command[];
|
||||
});
|
||||
write(command: Command | undefined, text: string): void;
|
||||
private flushBuffer;
|
||||
}
|
71
backend/node_modules/concurrently/dist/src/output-writer.js
generated
vendored
Normal file
71
backend/node_modules/concurrently/dist/src/output-writer.js
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.OutputWriter = void 0;
|
||||
const Rx = __importStar(require("rxjs"));
|
||||
/**
|
||||
* Class responsible for actually writing output onto a writable stream.
|
||||
*/
|
||||
class OutputWriter {
|
||||
constructor({ outputStream, group, commands, }) {
|
||||
this.activeCommandIndex = 0;
|
||||
this.outputStream = outputStream;
|
||||
this.group = group;
|
||||
this.buffers = commands.map(() => []);
|
||||
if (this.group) {
|
||||
Rx.merge(...commands.map((c) => c.close)).subscribe((command) => {
|
||||
if (command.index !== this.activeCommandIndex) {
|
||||
return;
|
||||
}
|
||||
for (let i = command.index + 1; i < commands.length; i++) {
|
||||
this.activeCommandIndex = i;
|
||||
this.flushBuffer(i);
|
||||
if (!commands[i].exited) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
write(command, text) {
|
||||
if (this.group && command) {
|
||||
if (command.index <= this.activeCommandIndex) {
|
||||
this.outputStream.write(text);
|
||||
}
|
||||
else {
|
||||
this.buffers[command.index].push(text);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// "global" logs (command=null) are output out of order
|
||||
this.outputStream.write(text);
|
||||
}
|
||||
}
|
||||
flushBuffer(index) {
|
||||
this.buffers[index].forEach((t) => this.outputStream.write(t));
|
||||
this.buffers[index] = [];
|
||||
}
|
||||
}
|
||||
exports.OutputWriter = OutputWriter;
|
11
backend/node_modules/concurrently/dist/src/prefix-color-selector.d.ts
generated
vendored
Normal file
11
backend/node_modules/concurrently/dist/src/prefix-color-selector.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import chalk from 'chalk';
|
||||
export declare class PrefixColorSelector {
|
||||
private colorGenerator;
|
||||
constructor(customColors?: string | string[]);
|
||||
/** A list of colors that are readable in a terminal. */
|
||||
static get ACCEPTABLE_CONSOLE_COLORS(): ("stderr" | keyof chalk.Chalk | "supportsColor" | "Level" | "Color" | "ForegroundColor" | "BackgroundColor" | "Modifiers")[];
|
||||
/**
|
||||
* @returns The given custom colors then a set of acceptable console colors indefinitely.
|
||||
*/
|
||||
getNextColor(): string;
|
||||
}
|
93
backend/node_modules/concurrently/dist/src/prefix-color-selector.js
generated
vendored
Normal file
93
backend/node_modules/concurrently/dist/src/prefix-color-selector.js
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.PrefixColorSelector = void 0;
|
||||
function getConsoleColorsWithoutCustomColors(customColors) {
|
||||
return PrefixColorSelector.ACCEPTABLE_CONSOLE_COLORS.filter(
|
||||
// Consider the "Bright" variants of colors to be the same as the plain color to avoid similar colors
|
||||
(color) => !customColors.includes(color.replace(/Bright$/, '')));
|
||||
}
|
||||
/**
|
||||
* Creates a generator that yields an infinite stream of colors.
|
||||
*/
|
||||
function* createColorGenerator(customColors) {
|
||||
// Custom colors should be used as is, except for "auto"
|
||||
const nextAutoColors = getConsoleColorsWithoutCustomColors(customColors);
|
||||
let lastColor;
|
||||
for (const customColor of customColors) {
|
||||
let currentColor = customColor;
|
||||
if (currentColor !== 'auto') {
|
||||
yield currentColor; // Manual color
|
||||
}
|
||||
else {
|
||||
// Find the first auto color that is not the same as the last color
|
||||
while (currentColor === 'auto' || lastColor === currentColor) {
|
||||
if (!nextAutoColors.length) {
|
||||
// There could be more "auto" values than auto colors so this needs to be able to refill
|
||||
nextAutoColors.push(...PrefixColorSelector.ACCEPTABLE_CONSOLE_COLORS);
|
||||
}
|
||||
currentColor = String(nextAutoColors.shift());
|
||||
}
|
||||
yield currentColor; // Auto color
|
||||
}
|
||||
lastColor = currentColor;
|
||||
}
|
||||
const lastCustomColor = customColors[customColors.length - 1] || '';
|
||||
if (lastCustomColor !== 'auto') {
|
||||
while (true) {
|
||||
yield lastCustomColor; // If last custom color was not "auto" then return same color forever, to maintain existing behaviour
|
||||
}
|
||||
}
|
||||
// Finish the initial set(s) of auto colors to avoid repetition
|
||||
for (const color of nextAutoColors) {
|
||||
yield color;
|
||||
}
|
||||
// Yield an infinite stream of acceptable console colors
|
||||
//
|
||||
// If the given custom colors use every ACCEPTABLE_CONSOLE_COLORS except one then there is a chance a color will be repeated,
|
||||
// however its highly unlikely and low consequence so not worth the extra complexity to account for it
|
||||
while (true) {
|
||||
for (const color of PrefixColorSelector.ACCEPTABLE_CONSOLE_COLORS) {
|
||||
yield color; // Repeat colors forever
|
||||
}
|
||||
}
|
||||
}
|
||||
class PrefixColorSelector {
|
||||
constructor(customColors = []) {
|
||||
const normalizedColors = typeof customColors === 'string' ? [customColors] : customColors;
|
||||
this.colorGenerator = createColorGenerator(normalizedColors);
|
||||
}
|
||||
/** A list of colors that are readable in a terminal. */
|
||||
static get ACCEPTABLE_CONSOLE_COLORS() {
|
||||
// Colors picked randomly, can be amended if required
|
||||
return [
|
||||
// Prevent duplicates, in case the list becomes significantly large
|
||||
...new Set([
|
||||
// Text colors
|
||||
'cyan',
|
||||
'yellow',
|
||||
'greenBright',
|
||||
'blueBright',
|
||||
'magentaBright',
|
||||
'white',
|
||||
'grey',
|
||||
'red',
|
||||
// Background colors
|
||||
'bgCyan',
|
||||
'bgYellow',
|
||||
'bgGreenBright',
|
||||
'bgBlueBright',
|
||||
'bgMagenta',
|
||||
'bgWhiteBright',
|
||||
'bgGrey',
|
||||
'bgRed',
|
||||
]),
|
||||
];
|
||||
}
|
||||
/**
|
||||
* @returns The given custom colors then a set of acceptable console colors indefinitely.
|
||||
*/
|
||||
getNextColor() {
|
||||
return this.colorGenerator.next().value;
|
||||
}
|
||||
}
|
||||
exports.PrefixColorSelector = PrefixColorSelector;
|
9
backend/node_modules/concurrently/index.js
generated
vendored
Normal file
9
backend/node_modules/concurrently/index.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
/*
|
||||
* While in local development, make sure you've run `pnpm run build` first.
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const concurrently = require('./dist/src/index.js');
|
||||
|
||||
module.exports = exports = concurrently.default;
|
||||
Object.assign(exports, concurrently);
|
10
backend/node_modules/concurrently/index.mjs
generated
vendored
Normal file
10
backend/node_modules/concurrently/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* While in local development, make sure you've run `pnpm run build` first.
|
||||
*/
|
||||
|
||||
import concurrently from './dist/src/index.js';
|
||||
|
||||
// NOTE: the star reexport doesn't work in Node <12.20, <14.13 and <15.
|
||||
export * from './dist/src/index.js';
|
||||
|
||||
export default concurrently.default;
|
37
backend/node_modules/concurrently/node_modules/ansi-regex/index.d.ts
generated
vendored
Normal file
37
backend/node_modules/concurrently/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/concurrently/node_modules/ansi-regex/index.js
generated
vendored
Normal file
10
backend/node_modules/concurrently/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/concurrently/node_modules/ansi-regex/license
generated
vendored
Normal file
9
backend/node_modules/concurrently/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/concurrently/node_modules/ansi-regex/package.json
generated
vendored
Normal file
55
backend/node_modules/concurrently/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/concurrently/node_modules/ansi-regex/readme.md
generated
vendored
Normal file
78
backend/node_modules/concurrently/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/concurrently/node_modules/cliui/CHANGELOG.md
generated
vendored
Normal file
139
backend/node_modules/concurrently/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/concurrently/node_modules/cliui/LICENSE.txt
generated
vendored
Normal file
14
backend/node_modules/concurrently/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/concurrently/node_modules/cliui/README.md
generated
vendored
Normal file
141
backend/node_modules/concurrently/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/concurrently/node_modules/cliui/build/index.cjs
generated
vendored
Normal file
302
backend/node_modules/concurrently/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/concurrently/node_modules/cliui/build/index.d.cts
generated
vendored
Normal file
43
backend/node_modules/concurrently/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/concurrently/node_modules/cliui/build/lib/index.js
generated
vendored
Normal file
287
backend/node_modules/concurrently/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/concurrently/node_modules/cliui/build/lib/string-utils.js
generated
vendored
Normal file
27
backend/node_modules/concurrently/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/concurrently/node_modules/cliui/index.mjs
generated
vendored
Normal file
13
backend/node_modules/concurrently/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/concurrently/node_modules/cliui/package.json
generated
vendored
Normal file
83
backend/node_modules/concurrently/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/concurrently/node_modules/emoji-regex/LICENSE-MIT.txt
generated
vendored
Normal file
20
backend/node_modules/concurrently/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/concurrently/node_modules/emoji-regex/README.md
generated
vendored
Normal file
73
backend/node_modules/concurrently/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/concurrently/node_modules/emoji-regex/es2015/index.js
generated
vendored
Normal file
6
backend/node_modules/concurrently/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/concurrently/node_modules/emoji-regex/es2015/text.js
generated
vendored
Normal file
6
backend/node_modules/concurrently/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/concurrently/node_modules/emoji-regex/index.d.ts
generated
vendored
Normal file
23
backend/node_modules/concurrently/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/concurrently/node_modules/emoji-regex/index.js
generated
vendored
Normal file
6
backend/node_modules/concurrently/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/concurrently/node_modules/emoji-regex/package.json
generated
vendored
Normal file
50
backend/node_modules/concurrently/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/concurrently/node_modules/emoji-regex/text.js
generated
vendored
Normal file
6
backend/node_modules/concurrently/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/concurrently/node_modules/string-width/index.d.ts
generated
vendored
Normal file
29
backend/node_modules/concurrently/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/concurrently/node_modules/string-width/index.js
generated
vendored
Normal file
47
backend/node_modules/concurrently/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/concurrently/node_modules/string-width/license
generated
vendored
Normal file
9
backend/node_modules/concurrently/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/concurrently/node_modules/string-width/package.json
generated
vendored
Normal file
56
backend/node_modules/concurrently/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/concurrently/node_modules/string-width/readme.md
generated
vendored
Normal file
50
backend/node_modules/concurrently/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/concurrently/node_modules/strip-ansi/index.d.ts
generated
vendored
Normal file
17
backend/node_modules/concurrently/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/concurrently/node_modules/strip-ansi/index.js
generated
vendored
Normal file
4
backend/node_modules/concurrently/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/concurrently/node_modules/strip-ansi/license
generated
vendored
Normal file
9
backend/node_modules/concurrently/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/concurrently/node_modules/strip-ansi/package.json
generated
vendored
Normal file
54
backend/node_modules/concurrently/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/concurrently/node_modules/strip-ansi/readme.md
generated
vendored
Normal file
46
backend/node_modules/concurrently/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/concurrently/node_modules/wrap-ansi/index.js
generated
vendored
Normal file
216
backend/node_modules/concurrently/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/concurrently/node_modules/wrap-ansi/license
generated
vendored
Normal file
9
backend/node_modules/concurrently/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/concurrently/node_modules/wrap-ansi/package.json
generated
vendored
Normal file
62
backend/node_modules/concurrently/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/concurrently/node_modules/wrap-ansi/readme.md
generated
vendored
Normal file
91
backend/node_modules/concurrently/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/concurrently/node_modules/y18n/CHANGELOG.md
generated
vendored
Normal file
100
backend/node_modules/concurrently/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/concurrently/node_modules/y18n/LICENSE
generated
vendored
Normal file
13
backend/node_modules/concurrently/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/concurrently/node_modules/y18n/README.md
generated
vendored
Normal file
127
backend/node_modules/concurrently/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/concurrently/node_modules/y18n/build/index.cjs
generated
vendored
Normal file
203
backend/node_modules/concurrently/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/concurrently/node_modules/y18n/build/lib/cjs.js
generated
vendored
Normal file
6
backend/node_modules/concurrently/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/concurrently/node_modules/y18n/build/lib/index.js
generated
vendored
Normal file
174
backend/node_modules/concurrently/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/concurrently/node_modules/y18n/build/lib/platform-shims/node.js
generated
vendored
Normal file
19
backend/node_modules/concurrently/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/concurrently/node_modules/y18n/index.mjs
generated
vendored
Normal file
8
backend/node_modules/concurrently/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/concurrently/node_modules/y18n/package.json
generated
vendored
Normal file
70
backend/node_modules/concurrently/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/concurrently/node_modules/yargs-parser/CHANGELOG.md
generated
vendored
Normal file
308
backend/node_modules/concurrently/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))
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user