concurrently 8.2.0 → 8.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/src/command.js +7 -3
- package/dist/src/completion-listener.js +1 -1
- package/dist/src/concurrently.d.ts +15 -2
- package/dist/src/flow-control/log-timings.d.ts +4 -0
- package/dist/src/flow-control/log-timings.js +4 -3
- package/dist/src/flow-control/restart-process.js +2 -2
- package/dist/src/get-spawn-opts.d.ts +1 -1
- package/dist/src/prefix-color-selector.d.ts +1 -1
- package/dist/src/prefix-color-selector.js +2 -1
- package/package.json +21 -21
package/README.md
CHANGED
|
@@ -335,7 +335,7 @@ For more details, visit https://github.com/open-cli-tools/concurrently
|
|
|
335
335
|
- `prefix`: the prefix type to use when logging processes output.
|
|
336
336
|
Possible values: `index`, `pid`, `time`, `command`, `name`, `none`, or a template (eg `[{time} process: {pid}]`).
|
|
337
337
|
Default: the name of the process, or its index if no name is set.
|
|
338
|
-
- `prefixColors`: a list of colors as supported by [chalk](https://www.npmjs.com/package/chalk)
|
|
338
|
+
- `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.
|
|
339
339
|
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.
|
|
340
340
|
Prefix colors specified per-command take precedence over this list.
|
|
341
341
|
- `prefixLength`: how many characters to show when prefixing with `command`. Default: `10`
|
|
@@ -376,7 +376,7 @@ const { result } = concurrently(
|
|
|
376
376
|
killOthers: ['failure', 'success'],
|
|
377
377
|
restartTries: 3,
|
|
378
378
|
cwd: path.resolve(__dirname, 'scripts'),
|
|
379
|
-
}
|
|
379
|
+
},
|
|
380
380
|
);
|
|
381
381
|
result.then(success, failure);
|
|
382
382
|
```
|
package/dist/src/command.js
CHANGED
|
@@ -64,7 +64,9 @@ class Command {
|
|
|
64
64
|
this.timer.next({ startDate, endDate });
|
|
65
65
|
this.error.next(event);
|
|
66
66
|
});
|
|
67
|
-
Rx.fromEvent(child, 'close')
|
|
67
|
+
Rx.fromEvent(child, 'close')
|
|
68
|
+
.pipe(Rx.map((event) => event))
|
|
69
|
+
.subscribe(([exitCode, signal]) => {
|
|
68
70
|
this.process = undefined;
|
|
69
71
|
this.exited = true;
|
|
70
72
|
const endDate = new Date(Date.now());
|
|
@@ -82,8 +84,10 @@ class Command {
|
|
|
82
84
|
},
|
|
83
85
|
});
|
|
84
86
|
});
|
|
85
|
-
child.stdout &&
|
|
86
|
-
|
|
87
|
+
child.stdout &&
|
|
88
|
+
pipeTo(Rx.fromEvent(child.stdout, 'data').pipe(Rx.map((event) => event)), this.stdout);
|
|
89
|
+
child.stderr &&
|
|
90
|
+
pipeTo(Rx.fromEvent(child.stderr, 'data').pipe(Rx.map((event) => event)), this.stderr);
|
|
87
91
|
this.stdin = child.stdin || undefined;
|
|
88
92
|
}
|
|
89
93
|
/**
|
|
@@ -68,7 +68,7 @@ class CompletionListener {
|
|
|
68
68
|
const closeStreams = commands.map((command) => command.close);
|
|
69
69
|
return Rx.lastValueFrom(Rx.merge(...closeStreams).pipe((0, operators_1.bufferCount)(closeStreams.length), (0, operators_1.switchMap)((exitInfos) => this.isSuccess(exitInfos)
|
|
70
70
|
? this.emitWithScheduler(Rx.of(exitInfos))
|
|
71
|
-
: this.emitWithScheduler(Rx.throwError(exitInfos))), (0, operators_1.take)(1)));
|
|
71
|
+
: this.emitWithScheduler(Rx.throwError(() => exitInfos))), (0, operators_1.take)(1)));
|
|
72
72
|
}
|
|
73
73
|
emitWithScheduler(input) {
|
|
74
74
|
return this.scheduler ? input.pipe(Rx.observeOn(this.scheduler)) : input;
|
|
@@ -36,9 +36,22 @@ export type ConcurrentlyOptions = {
|
|
|
36
36
|
*/
|
|
37
37
|
group?: boolean;
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* A comma-separated list of chalk colors or a string for available styles listed below to use on prefixes.
|
|
40
|
+
* If there are more commands than colors, the last color will be repeated.
|
|
41
|
+
*
|
|
42
|
+
* Available modifiers:
|
|
43
|
+
* - `reset`, `bold`, `dim`, `italic`, `underline`, `inverse`, `hidden`, `strikethrough`
|
|
44
|
+
*
|
|
45
|
+
* Available colors:
|
|
46
|
+
* - `black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`, `gray`,
|
|
47
|
+
* any hex values for colors (e.g. `#23de43`) or `auto` for an automatically picked color
|
|
48
|
+
*
|
|
49
|
+
* Available background colors:
|
|
50
|
+
* - `bgBlack`, `bgRed`, `bgGreen`, `bgYellow`, `bgBlue`, `bgMagenta`, `bgCyan`, `bgWhite`
|
|
51
|
+
*
|
|
52
|
+
* @see {@link https://www.npmjs.com/package/chalk} for more information.
|
|
40
53
|
*/
|
|
41
|
-
prefixColors?: string[];
|
|
54
|
+
prefixColors?: string | string[];
|
|
42
55
|
/**
|
|
43
56
|
* Maximum number of commands to run at once.
|
|
44
57
|
* Exact number or a percent of CPUs available (for example "50%").
|
|
@@ -22,6 +22,10 @@ export declare class LogTimings implements FlowController {
|
|
|
22
22
|
private printExitInfoTimingTable;
|
|
23
23
|
handle(commands: Command[]): {
|
|
24
24
|
commands: Command[];
|
|
25
|
+
onFinish?: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
commands: Command[];
|
|
28
|
+
onFinish: () => void;
|
|
25
29
|
};
|
|
26
30
|
}
|
|
27
31
|
export {};
|
|
@@ -83,9 +83,10 @@ class LogTimings {
|
|
|
83
83
|
});
|
|
84
84
|
// overall summary timings
|
|
85
85
|
const closeStreams = commands.map((command) => command.close);
|
|
86
|
-
const
|
|
87
|
-
allProcessesClosed.
|
|
88
|
-
|
|
86
|
+
const finished = new Rx.Subject();
|
|
87
|
+
const allProcessesClosed = Rx.merge(...closeStreams).pipe((0, operators_1.bufferCount)(closeStreams.length), (0, operators_1.take)(1), (0, operators_1.combineLatestWith)(finished));
|
|
88
|
+
allProcessesClosed.subscribe(([exitInfos]) => this.printExitInfoTimingTable(exitInfos));
|
|
89
|
+
return { commands, onFinish: () => finished.next() };
|
|
89
90
|
}
|
|
90
91
|
}
|
|
91
92
|
exports.LogTimings = LogTimings;
|
|
@@ -47,11 +47,11 @@ class RestartProcess {
|
|
|
47
47
|
.map((failure, index) => Rx.merge(
|
|
48
48
|
// Delay the emission (so that the restarts happen on time),
|
|
49
49
|
// explicitly telling the subscriber that a restart is needed
|
|
50
|
-
failure.pipe((0, operators_1.delay)(this.delay, this.scheduler), (0, operators_1.
|
|
50
|
+
failure.pipe((0, operators_1.delay)(this.delay, this.scheduler), (0, operators_1.map)(() => true)),
|
|
51
51
|
// Skip the first N emissions (as these would be duplicates of the above),
|
|
52
52
|
// meaning it will be empty because of success, or failed all N times,
|
|
53
53
|
// and no more restarts should be attempted.
|
|
54
|
-
failure.pipe((0, operators_1.skip)(this.tries), (0, operators_1.
|
|
54
|
+
failure.pipe((0, operators_1.skip)(this.tries), (0, operators_1.map)(() => false), (0, operators_1.defaultIfEmpty)(false))).subscribe((restart) => {
|
|
55
55
|
const command = commands[index];
|
|
56
56
|
if (restart) {
|
|
57
57
|
this.logger.logCommandEvent(`${command.command} restarted`, command);
|
|
@@ -16,7 +16,7 @@ export declare const getSpawnOpts: ({ colorSupport, cwd, process, raw, env, }: {
|
|
|
16
16
|
/**
|
|
17
17
|
* The NodeJS process.
|
|
18
18
|
*/
|
|
19
|
-
process?: Pick<NodeJS.Process, "
|
|
19
|
+
process?: Pick<NodeJS.Process, "platform" | "cwd" | "env"> | undefined;
|
|
20
20
|
/**
|
|
21
21
|
* A custom working directory to spawn processes in.
|
|
22
22
|
* Defaults to `process.cwd()`.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
export declare class PrefixColorSelector {
|
|
3
3
|
private colorGenerator;
|
|
4
|
-
constructor(customColors?: string[]);
|
|
4
|
+
constructor(customColors?: string | string[]);
|
|
5
5
|
/** A list of colors that are readable in a terminal. */
|
|
6
6
|
static get ACCEPTABLE_CONSOLE_COLORS(): ("stderr" | keyof chalk.Chalk | "supportsColor" | "Level" | "Color" | "ForegroundColor" | "BackgroundColor" | "Modifiers")[];
|
|
7
7
|
/**
|
|
@@ -53,7 +53,8 @@ function* createColorGenerator(customColors) {
|
|
|
53
53
|
}
|
|
54
54
|
class PrefixColorSelector {
|
|
55
55
|
constructor(customColors = []) {
|
|
56
|
-
|
|
56
|
+
const normalizedColors = typeof customColors === 'string' ? [customColors] : customColors;
|
|
57
|
+
this.colorGenerator = createColorGenerator(normalizedColors);
|
|
57
58
|
}
|
|
58
59
|
/** A list of colors that are readable in a terminal. */
|
|
59
60
|
static get ACCEPTABLE_CONSOLE_COLORS() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "concurrently",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.2",
|
|
4
4
|
"description": "Run commands concurrently",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -49,33 +49,33 @@
|
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@hirez_io/observer-spy": "^2.2.0",
|
|
52
|
-
"@swc/core": "^1.3.
|
|
53
|
-
"@swc/jest": "^0.2.
|
|
54
|
-
"@types/jest": "^29.5.
|
|
55
|
-
"@types/lodash": "^4.14.
|
|
56
|
-
"@types/node": "^14.18.
|
|
57
|
-
"@types/shell-quote": "^1.7.
|
|
58
|
-
"@types/supports-color": "^8.1.
|
|
59
|
-
"@types/yargs": "^17.0.
|
|
60
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
61
|
-
"@typescript-eslint/parser": "^
|
|
52
|
+
"@swc/core": "^1.3.93",
|
|
53
|
+
"@swc/jest": "^0.2.29",
|
|
54
|
+
"@types/jest": "^29.5.6",
|
|
55
|
+
"@types/lodash": "^4.14.200",
|
|
56
|
+
"@types/node": "^14.18.62",
|
|
57
|
+
"@types/shell-quote": "^1.7.3",
|
|
58
|
+
"@types/supports-color": "^8.1.2",
|
|
59
|
+
"@types/yargs": "^17.0.29",
|
|
60
|
+
"@typescript-eslint/eslint-plugin": "^6.8.0",
|
|
61
|
+
"@typescript-eslint/parser": "^6.8.0",
|
|
62
62
|
"coveralls-next": "^4.2.0",
|
|
63
63
|
"ctrlc-wrapper": "^0.0.4",
|
|
64
|
-
"esbuild": "~0.
|
|
65
|
-
"eslint": "^8.
|
|
66
|
-
"eslint-config-prettier": "^
|
|
67
|
-
"eslint-plugin-import": "^2.
|
|
68
|
-
"eslint-plugin-jest": "^27.2
|
|
69
|
-
"eslint-plugin-prettier": "^
|
|
64
|
+
"esbuild": "~0.19.5",
|
|
65
|
+
"eslint": "^8.51.0",
|
|
66
|
+
"eslint-config-prettier": "^9.0.0",
|
|
67
|
+
"eslint-plugin-import": "^2.28.1",
|
|
68
|
+
"eslint-plugin-jest": "^27.4.2",
|
|
69
|
+
"eslint-plugin-prettier": "^5.0.1",
|
|
70
70
|
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
71
71
|
"husky": "^8.0.3",
|
|
72
|
-
"jest": "^29.
|
|
72
|
+
"jest": "^29.7.0",
|
|
73
73
|
"jest-create-mock-instance": "^2.0.0",
|
|
74
|
-
"lint-staged": "^13.
|
|
75
|
-
"prettier": "^
|
|
74
|
+
"lint-staged": "^13.3.0",
|
|
75
|
+
"prettier": "^3.0.3",
|
|
76
76
|
"safe-publish-latest": "^2.0.0",
|
|
77
77
|
"string-argv": "^0.3.2",
|
|
78
|
-
"typescript": "~5.
|
|
78
|
+
"typescript": "~5.2.2"
|
|
79
79
|
},
|
|
80
80
|
"files": [
|
|
81
81
|
"dist",
|