concurrently
Advanced tools
Comparing version 7.4.0 to 7.5.0
@@ -90,3 +90,3 @@ #!/usr/bin/env node | ||
}, | ||
// This one is provided for free. Chalk reads this itself and removes colours. | ||
// This one is provided for free. Chalk reads this itself and removes colors. | ||
// https://www.npmjs.com/package/chalk#chalksupportscolor | ||
@@ -144,4 +144,4 @@ 'no-color': { | ||
'- Available modifiers: reset, bold, dim, italic, underline, inverse, hidden, strikethrough\n' + | ||
'- Available colors: black, red, green, yellow, blue, magenta, cyan, white, gray \n' + | ||
'or any hex values for colors, eg #23de43\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' + | ||
@@ -148,0 +148,0 @@ 'See https://www.npmjs.com/package/chalk for more information.', |
@@ -24,2 +24,10 @@ "use strict"; | ||
{ | ||
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', | ||
@@ -26,0 +34,0 @@ example: '$ CONCURRENTLY_RAW=true CONCURRENTLY_KILL_OTHERS=true $0 "echo hello" "echo world"', |
@@ -30,3 +30,3 @@ /// <reference types="node" /> | ||
/** | ||
* Color to use on prefix of command. | ||
* Color to use on prefix of the command. | ||
*/ | ||
@@ -33,0 +33,0 @@ prefixColor?: string; |
@@ -19,2 +19,3 @@ "use strict"; | ||
const output_writer_1 = require("./output-writer"); | ||
const prefix_color_selector_1 = require("./prefix-color-selector"); | ||
const defaults = { | ||
@@ -37,2 +38,3 @@ spawn: spawn_command_1.default, | ||
const options = lodash_1.default.defaults(baseOptions, defaults); | ||
const prefixColorSelector = new prefix_color_selector_1.PrefixColorSelector(options.prefixColors); | ||
const commandParsers = [ | ||
@@ -46,3 +48,2 @@ new strip_quotes_1.StripQuotes(), | ||
} | ||
let lastColor = ''; | ||
let commands = (0, lodash_1.default)(baseCommands) | ||
@@ -52,7 +53,5 @@ .map(mapToCommandInfo) | ||
.map((command, index) => { | ||
// Use documented behaviour of repeating last color when specifying more commands than colors | ||
lastColor = (options.prefixColors && options.prefixColors[index]) || lastColor; | ||
return new command_1.Command({ | ||
index, | ||
prefixColor: lastColor, | ||
prefixColor: prefixColorSelector.getNextColor(), | ||
...command, | ||
@@ -59,0 +58,0 @@ }, (0, get_spawn_opts_1.getSpawnOpts)({ |
@@ -28,7 +28,4 @@ /// <reference types="node" /> | ||
commands: Command[]; | ||
onFinish?: undefined; | ||
} | { | ||
commands: Command[]; | ||
onFinish: () => void; | ||
onFinish?: () => void | undefined; | ||
}; | ||
} |
{ | ||
"name": "concurrently", | ||
"version": "7.4.0", | ||
"version": "7.5.0", | ||
"description": "Run commands concurrently", | ||
@@ -66,3 +66,3 @@ "main": "index.js", | ||
"@swc/jest": "^0.2.21", | ||
"@types/jest": "^28.1.6", | ||
"@types/jest": "^28.1.8", | ||
"@types/lodash": "^4.14.178", | ||
@@ -81,5 +81,5 @@ "@types/node": "^16.11.47", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-jest": "^26.8.2", | ||
"eslint-plugin-jest": "^27.0.4", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"eslint-plugin-simple-import-sort": "^7.0.0", | ||
"eslint-plugin-simple-import-sort": "^8.0.0", | ||
"jest": "^28.1.3", | ||
@@ -91,3 +91,3 @@ "jest-create-mock-instance": "^2.0.0", | ||
"string-argv": "^0.3.1", | ||
"typescript": "^4.5.4" | ||
"typescript": "~4.8.3" | ||
}, | ||
@@ -94,0 +94,0 @@ "files": [ |
@@ -194,4 +194,5 @@ # concurrently | ||
- Available colors: black, red, green, yellow, blue, | ||
magenta, cyan, white, gray | ||
or any hex values for colors, eg #23de43 | ||
magenta, cyan, white, gray, | ||
any hex values for colors (e.g. #23de43) or auto for | ||
an automatically picked color | ||
- Available background colors: bgBlack, bgRed, | ||
@@ -254,2 +255,10 @@ bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite | ||
- 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 | ||
@@ -329,8 +338,8 @@ | ||
Default: the name of the process, or its index if no name is set. | ||
- `prefixColors`: a list of colors as supported by [chalk](https://www.npmjs.com/package/chalk). | ||
If concurrently would run more commands than there are colors, the last color is repeated. | ||
- `prefixColors`: a list of colors as supported by [chalk](https://www.npmjs.com/package/chalk) or `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, colouring or extra stuff. | ||
be logged, without any prefixes, coloring or extra stuff. | ||
- `successCondition`: the condition to consider the run was successful. | ||
@@ -337,0 +346,0 @@ 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. |
116187
55
2414
433