concurrently 9.2.1 → 10.0.0
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 +25 -14
- package/dist/bin/{concurrently.js → index.js} +23 -62
- package/dist/bin/index.spec.d.ts +1 -0
- package/dist/bin/index.spec.js +368 -0
- package/dist/bin/normalize-cli-command.d.ts +1 -0
- package/dist/bin/normalize-cli-command.js +15 -0
- package/dist/bin/normalize-cli-command.spec.d.ts +1 -0
- package/dist/bin/normalize-cli-command.spec.js +36 -0
- package/dist/bin/read-package-json.d.ts +4 -0
- package/dist/bin/read-package-json.js +17 -0
- package/dist/lib/__fixtures__/create-mock-instance.d.ts +2 -0
- package/dist/lib/__fixtures__/create-mock-instance.js +5 -0
- package/dist/lib/__fixtures__/fake-command.d.ts +6 -0
- package/dist/lib/__fixtures__/fake-command.js +37 -0
- package/dist/lib/assert.d.ts +10 -0
- package/dist/lib/assert.js +24 -0
- package/dist/lib/assert.spec.d.ts +1 -0
- package/dist/lib/assert.spec.js +41 -0
- package/dist/{src → lib}/command-parser/expand-arguments.d.ts +2 -2
- package/dist/{src → lib}/command-parser/expand-arguments.js +7 -12
- package/dist/lib/command-parser/expand-arguments.spec.d.ts +1 -0
- package/dist/lib/command-parser/expand-arguments.spec.js +57 -0
- package/dist/{src → lib}/command-parser/expand-shortcut.d.ts +2 -2
- package/dist/{src → lib}/command-parser/expand-shortcut.js +1 -5
- package/dist/lib/command-parser/expand-shortcut.spec.d.ts +1 -0
- package/dist/lib/command-parser/expand-shortcut.spec.js +36 -0
- package/dist/{src → lib}/command-parser/expand-wildcard.d.ts +2 -2
- package/dist/{src → lib}/command-parser/expand-wildcard.js +21 -28
- package/dist/lib/command-parser/expand-wildcard.spec.d.ts +1 -0
- package/dist/lib/command-parser/expand-wildcard.spec.js +288 -0
- package/dist/{src → lib}/command.d.ts +5 -4
- package/dist/{src → lib}/command.js +3 -39
- package/dist/lib/command.spec.d.ts +1 -0
- package/dist/lib/command.spec.js +369 -0
- package/dist/{src → lib}/completion-listener.d.ts +2 -2
- package/dist/{src → lib}/completion-listener.js +9 -46
- package/dist/lib/completion-listener.spec.d.ts +1 -0
- package/dist/lib/completion-listener.spec.js +229 -0
- package/dist/{src → lib}/concurrently.d.ts +10 -10
- package/dist/{src → lib}/concurrently.js +29 -40
- package/dist/lib/concurrently.spec.d.ts +1 -0
- package/dist/lib/concurrently.spec.js +320 -0
- package/dist/{src → lib}/date-format.d.ts +2 -2
- package/dist/{src → lib}/date-format.js +97 -76
- package/dist/lib/date-format.spec.d.ts +1 -0
- package/dist/lib/date-format.spec.js +480 -0
- package/dist/{src → lib}/defaults.d.ts +2 -6
- package/dist/{src → lib}/defaults.js +16 -23
- package/dist/{src → lib}/flow-control/input-handler.d.ts +4 -4
- package/dist/{src → lib}/flow-control/input-handler.js +8 -44
- package/dist/lib/flow-control/input-handler.spec.d.ts +1 -0
- package/dist/lib/flow-control/input-handler.spec.js +116 -0
- package/dist/{src → lib}/flow-control/kill-on-signal.d.ts +3 -3
- package/dist/{src → lib}/flow-control/kill-on-signal.js +3 -7
- package/dist/lib/flow-control/kill-on-signal.spec.d.ts +1 -0
- package/dist/lib/flow-control/kill-on-signal.spec.js +63 -0
- package/dist/{src → lib}/flow-control/kill-others.d.ts +3 -3
- package/dist/{src → lib}/flow-control/kill-others.js +8 -12
- package/dist/lib/flow-control/kill-others.spec.d.ts +1 -0
- package/dist/lib/flow-control/kill-others.spec.js +98 -0
- package/dist/{src → lib}/flow-control/log-error.d.ts +3 -3
- package/dist/{src → lib}/flow-control/log-error.js +1 -5
- package/dist/lib/flow-control/log-error.spec.d.ts +1 -0
- package/dist/lib/flow-control/log-error.spec.js +33 -0
- package/dist/{src → lib}/flow-control/log-exit.d.ts +3 -3
- package/dist/{src → lib}/flow-control/log-exit.js +1 -5
- package/dist/lib/flow-control/log-exit.spec.d.ts +1 -0
- package/dist/lib/flow-control/log-exit.spec.js +24 -0
- package/dist/{src → lib}/flow-control/log-output.d.ts +3 -3
- package/dist/{src → lib}/flow-control/log-output.js +1 -5
- package/dist/lib/flow-control/log-output.spec.d.ts +1 -0
- package/dist/lib/flow-control/log-output.spec.js +33 -0
- package/dist/{src → lib}/flow-control/log-timings.d.ts +3 -3
- package/dist/{src → lib}/flow-control/log-timings.js +8 -45
- package/dist/lib/flow-control/log-timings.spec.d.ts +1 -0
- package/dist/lib/flow-control/log-timings.spec.js +89 -0
- package/dist/{src → lib}/flow-control/logger-padding.d.ts +3 -3
- package/dist/{src → lib}/flow-control/logger-padding.js +7 -7
- package/dist/lib/flow-control/logger-padding.spec.d.ts +1 -0
- package/dist/lib/flow-control/logger-padding.spec.js +60 -0
- package/dist/{src → lib}/flow-control/output-error-handler.d.ts +4 -4
- package/dist/{src → lib}/flow-control/output-error-handler.js +3 -7
- package/dist/lib/flow-control/output-error-handler.spec.d.ts +1 -0
- package/dist/lib/flow-control/output-error-handler.spec.js +41 -0
- package/dist/{src → lib}/flow-control/restart-process.d.ts +4 -4
- package/dist/lib/flow-control/restart-process.js +61 -0
- package/dist/lib/flow-control/restart-process.spec.d.ts +1 -0
- package/dist/lib/flow-control/restart-process.spec.js +127 -0
- package/dist/{src → lib}/flow-control/teardown.d.ts +4 -5
- package/dist/lib/flow-control/teardown.js +45 -0
- package/dist/lib/flow-control/teardown.spec.d.ts +1 -0
- package/dist/lib/flow-control/teardown.spec.js +93 -0
- package/dist/{src → lib}/index.d.ts +21 -19
- package/dist/lib/index.js +98 -0
- package/dist/{src → lib}/jsonc.js +3 -8
- package/dist/lib/jsonc.spec.d.ts +1 -0
- package/dist/lib/jsonc.spec.js +73 -0
- package/dist/{src → lib}/logger.d.ts +3 -2
- package/dist/{src → lib}/logger.js +109 -65
- package/dist/lib/logger.spec.d.ts +1 -0
- package/dist/lib/logger.spec.js +507 -0
- package/dist/{src → lib}/observables.d.ts +1 -1
- package/dist/{src → lib}/observables.js +3 -6
- package/dist/lib/observables.spec.d.ts +1 -0
- package/dist/lib/observables.spec.js +29 -0
- package/dist/{src → lib}/output-writer.d.ts +3 -3
- package/dist/{src → lib}/output-writer.js +4 -41
- package/dist/lib/output-writer.spec.d.ts +1 -0
- package/dist/lib/output-writer.spec.js +96 -0
- package/dist/lib/prefix-color-selector.d.ts +21 -0
- package/dist/{src → lib}/prefix-color-selector.js +14 -31
- package/dist/lib/prefix-color-selector.spec.d.ts +1 -0
- package/dist/lib/prefix-color-selector.spec.js +159 -0
- package/dist/{src → lib}/spawn.d.ts +14 -5
- package/dist/lib/spawn.js +105 -0
- package/dist/lib/spawn.spec.d.ts +1 -0
- package/dist/lib/spawn.spec.js +100 -0
- package/dist/lib/utils.d.ts +25 -0
- package/dist/lib/utils.js +52 -0
- package/dist/lib/utils.spec.d.ts +1 -0
- package/dist/lib/utils.spec.js +58 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/README.md +6 -0
- package/docs/cli/prefixing.md +44 -4
- package/docs/shell-resolution.md +48 -0
- package/package.json +59 -75
- package/dist/bin/read-package.d.ts +0 -6
- package/dist/bin/read-package.js +0 -56
- package/dist/src/assert.d.ts +0 -5
- package/dist/src/assert.js +0 -15
- package/dist/src/command-parser/command-parser.d.ts +0 -19
- package/dist/src/command-parser/command-parser.js +0 -2
- package/dist/src/command-parser/strip-quotes.d.ts +0 -16
- package/dist/src/command-parser/strip-quotes.js +0 -17
- package/dist/src/flow-control/flow-controller.d.ts +0 -13
- package/dist/src/flow-control/flow-controller.js +0 -2
- package/dist/src/flow-control/restart-process.js +0 -98
- package/dist/src/flow-control/teardown.js +0 -82
- package/dist/src/index.js +0 -96
- package/dist/src/prefix-color-selector.d.ts +0 -11
- package/dist/src/spawn.js +0 -49
- package/dist/src/utils.d.ts +0 -10
- package/dist/src/utils.js +0 -16
- package/index.d.mts +0 -7
- package/index.d.ts +0 -11
- package/index.js +0 -14
- package/index.mjs +0 -9
- /package/dist/bin/{concurrently.d.ts → index.d.ts} +0 -0
- /package/dist/{src → lib}/jsonc.d.ts +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { castArray, escapeRegExp, splitOutsideParens } from './utils.js';
|
|
3
|
+
describe('#escapeRegExp()', () => {
|
|
4
|
+
it('escapes all RegExp chars', () => {
|
|
5
|
+
// eslint-disable-next-line no-useless-escape
|
|
6
|
+
const result = escapeRegExp('\*?{}.(?<test>.)|[]');
|
|
7
|
+
expect(result).toBe('\\*\\?\\{\\}\\.\\(\\?<test>\\.\\)\\|\\[\\]');
|
|
8
|
+
});
|
|
9
|
+
});
|
|
10
|
+
describe('#castArray()', () => {
|
|
11
|
+
it('returns empty array for nullish input values', () => {
|
|
12
|
+
const result1 = castArray();
|
|
13
|
+
const result2 = castArray(undefined);
|
|
14
|
+
const result3 = castArray(null);
|
|
15
|
+
expect(result1).toStrictEqual([]);
|
|
16
|
+
expect(result2).toStrictEqual([]);
|
|
17
|
+
expect(result3).toStrictEqual([]);
|
|
18
|
+
});
|
|
19
|
+
it('directly returns value if it is already of type array', () => {
|
|
20
|
+
const value = ['example'];
|
|
21
|
+
const result = castArray(value);
|
|
22
|
+
expect(result).toBe(value);
|
|
23
|
+
});
|
|
24
|
+
describe('casts primitives to an array', () => {
|
|
25
|
+
it.each([1, 'example', {}])('%s', (value) => {
|
|
26
|
+
const result = castArray(value);
|
|
27
|
+
expect(result).toStrictEqual([value]);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
describe('#splitOutsideParens()', () => {
|
|
32
|
+
it('splits on the given delimiter', () => {
|
|
33
|
+
expect(splitOutsideParens('red,blue', ',')).toEqual(['red', 'blue']);
|
|
34
|
+
});
|
|
35
|
+
it('preserves delimiters inside parentheses', () => {
|
|
36
|
+
expect(splitOutsideParens('red,rgb(255,0,0),blue', ',')).toEqual([
|
|
37
|
+
'red',
|
|
38
|
+
'rgb(255,0,0)',
|
|
39
|
+
'blue',
|
|
40
|
+
]);
|
|
41
|
+
});
|
|
42
|
+
it('splits chalk-style dotted color paths, preserving function calls', () => {
|
|
43
|
+
expect(splitOutsideParens('black.bgHex(#533AFD).dim', '.')).toEqual([
|
|
44
|
+
'black',
|
|
45
|
+
'bgHex(#533AFD)',
|
|
46
|
+
'dim',
|
|
47
|
+
]);
|
|
48
|
+
});
|
|
49
|
+
it('trims whitespace around each segment', () => {
|
|
50
|
+
expect(splitOutsideParens(' red , blue ', ',')).toEqual(['red', 'blue']);
|
|
51
|
+
});
|
|
52
|
+
it('drops empty segments', () => {
|
|
53
|
+
expect(splitOutsideParens(',,red,,', ',')).toEqual(['red']);
|
|
54
|
+
});
|
|
55
|
+
it('returns an empty array for an empty input', () => {
|
|
56
|
+
expect(splitOutsideParens('', ',')).toEqual([]);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../bin/
|
|
1
|
+
{"root":["../bin/index.spec.ts","../bin/index.ts","../bin/normalize-cli-command.spec.ts","../bin/normalize-cli-command.ts","../bin/read-package-json.ts","../lib/assert.spec.ts","../lib/assert.ts","../lib/command.spec.ts","../lib/command.ts","../lib/completion-listener.spec.ts","../lib/completion-listener.ts","../lib/concurrently.spec.ts","../lib/concurrently.ts","../lib/date-format.spec.ts","../lib/date-format.ts","../lib/defaults.ts","../lib/index.ts","../lib/jsonc.spec.ts","../lib/jsonc.ts","../lib/logger.spec.ts","../lib/logger.ts","../lib/observables.spec.ts","../lib/observables.ts","../lib/output-writer.spec.ts","../lib/output-writer.ts","../lib/prefix-color-selector.spec.ts","../lib/prefix-color-selector.ts","../lib/spawn.spec.ts","../lib/spawn.ts","../lib/utils.spec.ts","../lib/utils.ts","../lib/__fixtures__/create-mock-instance.ts","../lib/__fixtures__/fake-command.ts","../lib/command-parser/command-parser.d.ts","../lib/command-parser/expand-arguments.spec.ts","../lib/command-parser/expand-arguments.ts","../lib/command-parser/expand-shortcut.spec.ts","../lib/command-parser/expand-shortcut.ts","../lib/command-parser/expand-wildcard.spec.ts","../lib/command-parser/expand-wildcard.ts","../lib/declarations/intl.d.ts","../lib/flow-control/flow-controller.d.ts","../lib/flow-control/input-handler.spec.ts","../lib/flow-control/input-handler.ts","../lib/flow-control/kill-on-signal.spec.ts","../lib/flow-control/kill-on-signal.ts","../lib/flow-control/kill-others.spec.ts","../lib/flow-control/kill-others.ts","../lib/flow-control/log-error.spec.ts","../lib/flow-control/log-error.ts","../lib/flow-control/log-exit.spec.ts","../lib/flow-control/log-exit.ts","../lib/flow-control/log-output.spec.ts","../lib/flow-control/log-output.ts","../lib/flow-control/log-timings.spec.ts","../lib/flow-control/log-timings.ts","../lib/flow-control/logger-padding.spec.ts","../lib/flow-control/logger-padding.ts","../lib/flow-control/output-error-handler.spec.ts","../lib/flow-control/output-error-handler.ts","../lib/flow-control/restart-process.spec.ts","../lib/flow-control/restart-process.ts","../lib/flow-control/teardown.spec.ts","../lib/flow-control/teardown.ts"],"version":"5.9.3"}
|
package/docs/README.md
CHANGED
package/docs/cli/prefixing.md
CHANGED
|
@@ -56,10 +56,10 @@ $ concurrently --prefix '{index}-{pid}' 'echo Hello there' 'echo General Kenobi!
|
|
|
56
56
|
|
|
57
57
|
## Prefix Colors
|
|
58
58
|
|
|
59
|
-
By default,
|
|
59
|
+
By default, concurrently automatically assigns colors to each command's prefix, cycling through `cyan`, `magenta`, `green`, `yellow`, and `blue` (the same palette and order used by turborepo).
|
|
60
60
|
|
|
61
61
|
This can be changed by using the `--prefix-colors`/`-c` flag, which takes a comma-separated list of colors to use.<br/>
|
|
62
|
-
The available values are color names (e.g. `green`, `magenta`, `gray`, etc), a hex value (such as `#23de43`),
|
|
62
|
+
The available values are color names (e.g. `green`, `magenta`, `gray`, etc), a hex value (such as `#23de43`), `auto` to automatically select a color, or `reset` to disable coloring.
|
|
63
63
|
|
|
64
64
|
```bash
|
|
65
65
|
$ concurrently -c red,blue 'echo Hello there' 'echo General Kenobi!'
|
|
@@ -79,10 +79,10 @@ $ concurrently -c red,blue 'echo Hello there' 'echo General Kenobi!'
|
|
|
79
79
|
- `yellow`
|
|
80
80
|
</details>
|
|
81
81
|
|
|
82
|
-
Colors can take modifiers too. Several can be applied at once by
|
|
82
|
+
Colors can take modifiers too. Several can be applied at once by appending `.<modifier 1>.<modifier 2>` and so on.
|
|
83
83
|
|
|
84
84
|
```bash
|
|
85
|
-
$ concurrently -c
|
|
85
|
+
$ concurrently -c '#23de43.inverse,bold.blue.dim' 'echo Hello there' 'echo General Kenobi!'
|
|
86
86
|
```
|
|
87
87
|
|
|
88
88
|
<details>
|
|
@@ -118,6 +118,46 @@ $ concurrently -c bgGray,red.bgBlack 'echo Hello there' 'echo General Kenobi!'
|
|
|
118
118
|
- `bgYellow`
|
|
119
119
|
</details>
|
|
120
120
|
|
|
121
|
+
### Advanced Color Functions
|
|
122
|
+
|
|
123
|
+
concurrently supports all [Chalk color functions](https://github.com/chalk/chalk#256-and-truecolor-color-support):
|
|
124
|
+
|
|
125
|
+
| Function | Description |
|
|
126
|
+
| ---------------- | --------------------------- |
|
|
127
|
+
| `#RRGGBB` | Foreground hex (shorthand) |
|
|
128
|
+
| `bg#RRGGBB` | Background hex (shorthand) |
|
|
129
|
+
| `hex(#RRGGBB)` | Foreground hex |
|
|
130
|
+
| `bgHex(#RRGGBB)` | Background hex |
|
|
131
|
+
| `rgb(R,G,B)` | Foreground RGB (0-255) |
|
|
132
|
+
| `bgRgb(R,G,B)` | Background RGB (0-255) |
|
|
133
|
+
| `ansi256(N)` | Foreground ANSI 256 (0-255) |
|
|
134
|
+
| `bgAnsi256(N)` | Background ANSI 256 (0-255) |
|
|
135
|
+
|
|
136
|
+
All functions can be chained with colors and modifiers:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# Hex colors
|
|
140
|
+
$ concurrently -c 'bg#FF0000.bold,black.bgHex(#00FF00).dim' 'echo Red bg' 'echo Green bg'
|
|
141
|
+
|
|
142
|
+
# RGB colors
|
|
143
|
+
$ concurrently -c 'rgb(255,136,0).bold,black.bgRgb(100,100,255)' 'echo Orange' 'echo Blue bg'
|
|
144
|
+
|
|
145
|
+
# ANSI 256 colors
|
|
146
|
+
$ concurrently -c 'ansi256(199),ansi256(50).bgAnsi256(17)' 'echo Pink' 'echo Cyan on blue'
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Scoping the Color to Part of a Template
|
|
150
|
+
|
|
151
|
+
By default, the entire prefix is colored. When using a template, you can restrict coloring to a specific region by wrapping it with the `{color}` and `{/color}` markers — anything outside the markers is rendered without color.
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
$ concurrently -c red,blue --prefix '[{color}{name}{/color}] {pid}' --names one,two 'echo Hello there' 'echo General Kenobi!'
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
In the example above, only `one` and `two` are colored — the surrounding brackets and the PID stay in the terminal's default color.
|
|
158
|
+
|
|
159
|
+
If only one of the markers is present, the missing side is implicit: an `{color}` without a matching `{/color}` colors everything from the opener to the end of the prefix, and a `{/color}` without a preceding `{color}` colors everything from the start of the prefix up to the closer. A template with neither marker is colored in full, matching the previous behavior.
|
|
160
|
+
|
|
121
161
|
## Prefix Length
|
|
122
162
|
|
|
123
163
|
When using the `command` prefix style, it's possible that it'll be too long.<br/>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Shell Resolution
|
|
2
|
+
|
|
3
|
+
Each command runs inside a shell, not as a bare executable.
|
|
4
|
+
By default, concurrently uses `cmd.exe` on Windows and `/bin/sh` elsewhere.
|
|
5
|
+
|
|
6
|
+
## Using a different shell
|
|
7
|
+
|
|
8
|
+
If the default shell isn't suitable, it's possible to instruct concurrently to use a specific shell in a few ways.
|
|
9
|
+
|
|
10
|
+
This is useful, for example, to use Unix-style syntax (for example `BROWSER=none npm start`) on Windows, if you set concurrently shell to e.g. Git Bash.
|
|
11
|
+
|
|
12
|
+
### Via explicit override
|
|
13
|
+
|
|
14
|
+
An explicit shell override takes precedence over every other configuration.
|
|
15
|
+
To do that, pass the `--shell` flag to the CLI:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
concurrently --shell "C:\Program Files\Git\bin\bash.exe" "echo Hello world | xargs -n 1 echo"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Or via the API:
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
concurrently(['echo Hello world | xargs -n 1 echo'], {
|
|
25
|
+
shell: 'C:\\Program Files\\Git\\bin\\bash.exe',
|
|
26
|
+
});
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Via npm/pnpm/yarn v1
|
|
30
|
+
|
|
31
|
+
When using npm, pnpm or yarn v1 to run concurrently via a `package.json` script, the
|
|
32
|
+
[`script-shell` configuration](https://docs.npmjs.com/cli/v6/using-npm/config#script-shell) is inherited and used to spawn commands.
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm config set script-shell /bin/bash
|
|
36
|
+
npm dev # Runs the dev script on bash. Concurrently will also run commands using bash.
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Supported shells
|
|
40
|
+
|
|
41
|
+
If you've specified a different shell, concurrently detects its kind and spawns commands
|
|
42
|
+
using the right syntax for that shell.
|
|
43
|
+
|
|
44
|
+
The following shell types are supported:
|
|
45
|
+
|
|
46
|
+
- Windows `cmd.exe`
|
|
47
|
+
- Powershell
|
|
48
|
+
- Any POSIX compliant shells (bash, zsh, dash, etc)
|
package/package.json
CHANGED
|
@@ -1,35 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "concurrently",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "10.0.0",
|
|
5
|
+
"packageManager": "pnpm@10.18.2+sha512.9fb969fa749b3ade6035e0f109f0b8a60b5d08a1a87fdf72e337da90dcc93336e2280ca4e44f2358a649b83c17959e9993e777c2080879f3801e6f0d999ad3dd",
|
|
4
6
|
"description": "Run commands concurrently",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"bin": {
|
|
9
|
-
"concurrently": "./dist/bin/concurrently.js",
|
|
10
|
-
"conc": "./dist/bin/concurrently.js"
|
|
11
|
-
},
|
|
12
|
-
"engines": {
|
|
13
|
-
"node": ">=18"
|
|
14
|
-
},
|
|
15
|
-
"exports": {
|
|
16
|
-
".": {
|
|
17
|
-
"import": {
|
|
18
|
-
"types": "./index.d.mts",
|
|
19
|
-
"default": "./index.mjs"
|
|
20
|
-
},
|
|
21
|
-
"require": {
|
|
22
|
-
"types": "./index.d.ts",
|
|
23
|
-
"default": "./index.js"
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"./package.json": "./package.json"
|
|
27
|
-
},
|
|
7
|
+
"author": "Kimmo Brunfeldt",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"funding": "https://github.com/open-cli-tools/concurrently?sponsor=1",
|
|
28
10
|
"repository": {
|
|
29
11
|
"type": "git",
|
|
30
12
|
"url": "https://github.com/open-cli-tools/concurrently.git"
|
|
31
13
|
},
|
|
32
|
-
"funding": "https://github.com/open-cli-tools/concurrently?sponsor=1",
|
|
33
14
|
"keywords": [
|
|
34
15
|
"bash",
|
|
35
16
|
"concurrent",
|
|
@@ -38,69 +19,72 @@
|
|
|
38
19
|
"command",
|
|
39
20
|
"sh"
|
|
40
21
|
],
|
|
41
|
-
"
|
|
42
|
-
|
|
22
|
+
"exports": {
|
|
23
|
+
".": "./dist/lib/index.js",
|
|
24
|
+
"./package.json": "./package.json"
|
|
25
|
+
},
|
|
26
|
+
"types": "./dist/lib/index.d.ts",
|
|
27
|
+
"bin": {
|
|
28
|
+
"concurrently": "./dist/bin/index.js",
|
|
29
|
+
"conc": "./dist/bin/index.js"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"!**/*.spec.d.ts",
|
|
33
|
+
"!**/*.spec.js",
|
|
34
|
+
"!**/__fixtures__",
|
|
35
|
+
"dist",
|
|
36
|
+
"dist/tsconfig.tsbuildinfo",
|
|
37
|
+
"docs"
|
|
38
|
+
],
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=22"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "tsc --build",
|
|
44
|
+
"postbuild": "chmod +x dist/bin/index.js",
|
|
45
|
+
"typecheck": "tsc --noEmit",
|
|
46
|
+
"format": "prettier --check '**/*.{json,y?(a)ml,md}'",
|
|
47
|
+
"lint": "eslint",
|
|
48
|
+
"prepublishOnly": "safe-publish-latest && pnpm run build",
|
|
49
|
+
"test": "vitest --project unit",
|
|
50
|
+
"test:smoke": "vitest run --project smoke",
|
|
51
|
+
"prepare": "husky"
|
|
52
|
+
},
|
|
43
53
|
"dependencies": {
|
|
44
|
-
"chalk": "
|
|
54
|
+
"chalk": "5.6.2",
|
|
45
55
|
"rxjs": "7.8.2",
|
|
46
|
-
"shell-quote": "1.8.
|
|
47
|
-
"supports-color": "
|
|
56
|
+
"shell-quote": "1.8.4",
|
|
57
|
+
"supports-color": "10.2.2",
|
|
48
58
|
"tree-kill": "1.2.2",
|
|
49
|
-
"yargs": "
|
|
59
|
+
"yargs": "18.0.0"
|
|
50
60
|
},
|
|
51
61
|
"devDependencies": {
|
|
52
|
-
"@eslint/js": "^
|
|
62
|
+
"@eslint/js": "^10.0.1",
|
|
53
63
|
"@hirez_io/observer-spy": "^2.2.0",
|
|
54
|
-
"@types/node": "^
|
|
64
|
+
"@types/node": "^20.19.41",
|
|
55
65
|
"@types/shell-quote": "^1.7.5",
|
|
56
|
-
"@types/
|
|
57
|
-
"@
|
|
58
|
-
"@vitest/
|
|
59
|
-
"@vitest/eslint-plugin": "^1.3.4",
|
|
60
|
-
"coveralls-next": "^5.0.0",
|
|
66
|
+
"@types/yargs": "^17.0.35",
|
|
67
|
+
"@vitest/coverage-v8": "^4.1.6",
|
|
68
|
+
"@vitest/eslint-plugin": "^1.6.17",
|
|
61
69
|
"ctrlc-wrapper": "^0.0.5",
|
|
62
|
-
"
|
|
63
|
-
"eslint": "^
|
|
64
|
-
"eslint-config-flat-gitignore": "^2.1.0",
|
|
70
|
+
"eslint": "^10.4.0",
|
|
71
|
+
"eslint-config-flat-gitignore": "^2.3.0",
|
|
65
72
|
"eslint-config-prettier": "^10.1.8",
|
|
66
|
-
"eslint-plugin-import-lite": "^0.
|
|
67
|
-
"eslint-plugin-prettier": "^5.5.
|
|
68
|
-
"eslint-plugin-simple-import-sort": "^
|
|
69
|
-
"globals": "
|
|
73
|
+
"eslint-plugin-import-lite": "^0.6.0",
|
|
74
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
75
|
+
"eslint-plugin-simple-import-sort": "^13.0.0",
|
|
76
|
+
"globals": "^17.6.0",
|
|
70
77
|
"husky": "^9.1.7",
|
|
71
|
-
"lint-staged": "^
|
|
72
|
-
"prettier": "^3.
|
|
78
|
+
"lint-staged": "^17.0.5",
|
|
79
|
+
"prettier": "^3.8.3",
|
|
73
80
|
"safe-publish-latest": "^2.0.0",
|
|
74
81
|
"string-argv": "^0.3.2",
|
|
75
|
-
"typescript": "~5.9.
|
|
76
|
-
"typescript-eslint": "^8.
|
|
77
|
-
"vitest": "^
|
|
82
|
+
"typescript": "~5.9.3",
|
|
83
|
+
"typescript-eslint": "^8.59.3",
|
|
84
|
+
"vitest": "^4.1.6"
|
|
78
85
|
},
|
|
79
|
-
"files": [
|
|
80
|
-
"dist",
|
|
81
|
-
"index.js",
|
|
82
|
-
"index.d.ts",
|
|
83
|
-
"index.mjs",
|
|
84
|
-
"index.d.mts",
|
|
85
|
-
"!**/fixtures",
|
|
86
|
-
"!**/*.spec.js",
|
|
87
|
-
"!**/*.spec.d.ts",
|
|
88
|
-
"docs"
|
|
89
|
-
],
|
|
90
86
|
"lint-staged": {
|
|
91
|
-
"
|
|
87
|
+
"*.{js,ts}": "eslint --fix",
|
|
92
88
|
"*.{json,y?(a)ml,md}": "prettier --write"
|
|
93
|
-
},
|
|
94
|
-
"scripts": {
|
|
95
|
-
"build": "tsc --build",
|
|
96
|
-
"postbuild": "chmod +x dist/bin/concurrently.js",
|
|
97
|
-
"clean": "tsc --build --clean",
|
|
98
|
-
"format": "prettier --check '**/*.{json,y?(a)ml,md}'",
|
|
99
|
-
"format:fix": "pnpm run format --write",
|
|
100
|
-
"lint": "eslint",
|
|
101
|
-
"lint:fix": "pnpm run lint --fix",
|
|
102
|
-
"report-coverage": "cat coverage/lcov.info | coveralls",
|
|
103
|
-
"test": "vitest --project unit",
|
|
104
|
-
"test:smoke": "vitest run --project smoke"
|
|
105
89
|
}
|
|
106
|
-
}
|
|
90
|
+
}
|
package/dist/bin/read-package.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.readPackage = readPackage;
|
|
37
|
-
const fs = __importStar(require("fs"));
|
|
38
|
-
const path = __importStar(require("path"));
|
|
39
|
-
/**
|
|
40
|
-
* Traverses the directory tree until a package.json file is found.
|
|
41
|
-
*
|
|
42
|
-
* @throws if the root directory is reached, and no package.json is found.
|
|
43
|
-
*/
|
|
44
|
-
function readPackage() {
|
|
45
|
-
let dir = require.main?.path ?? process.cwd();
|
|
46
|
-
let oldDir = dir;
|
|
47
|
-
do {
|
|
48
|
-
const pkgPath = path.join(dir, 'package.json');
|
|
49
|
-
if (fs.existsSync(pkgPath)) {
|
|
50
|
-
return JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
51
|
-
}
|
|
52
|
-
oldDir = dir;
|
|
53
|
-
dir = path.dirname(dir);
|
|
54
|
-
} while (oldDir !== dir);
|
|
55
|
-
throw new Error('package.json not found');
|
|
56
|
-
}
|
package/dist/src/assert.d.ts
DELETED
package/dist/src/assert.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.assertDeprecated = assertDeprecated;
|
|
4
|
-
const deprecations = new Set();
|
|
5
|
-
/**
|
|
6
|
-
* Asserts that some condition is true, and if not, prints a warning about it being deprecated.
|
|
7
|
-
* The message is printed only once.
|
|
8
|
-
*/
|
|
9
|
-
function assertDeprecated(check, name, message) {
|
|
10
|
-
if (!check && !deprecations.has(name)) {
|
|
11
|
-
// eslint-disable-next-line no-console
|
|
12
|
-
console.warn(`[concurrently] ${name} is deprecated. ${message}`);
|
|
13
|
-
deprecations.add(name);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { CommandInfo } from '../command';
|
|
2
|
-
/**
|
|
3
|
-
* A command parser encapsulates a specific logic for mapping `CommandInfo` objects
|
|
4
|
-
* into another `CommandInfo`.
|
|
5
|
-
*
|
|
6
|
-
* A prime example is turning an abstract `npm:foo` into `npm run foo`, but it could also turn
|
|
7
|
-
* the prefix color of a command brighter, or maybe even prefixing each command with `time(1)`.
|
|
8
|
-
*/
|
|
9
|
-
export interface CommandParser {
|
|
10
|
-
/**
|
|
11
|
-
* Parses `commandInfo` and returns one or more `CommandInfo`s.
|
|
12
|
-
*
|
|
13
|
-
* Returning multiple `CommandInfo` is used when there are multiple possibilities of commands to
|
|
14
|
-
* run given the original input.
|
|
15
|
-
* An example of this is when the command contains a wildcard and it must be expanded into all
|
|
16
|
-
* viable options so that the consumer can decide which ones to run.
|
|
17
|
-
*/
|
|
18
|
-
parse(commandInfo: CommandInfo): CommandInfo | CommandInfo[];
|
|
19
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { CommandInfo } from '../command';
|
|
2
|
-
import { CommandParser } from './command-parser';
|
|
3
|
-
/**
|
|
4
|
-
* Strips quotes around commands so that they can run on the current shell.
|
|
5
|
-
*/
|
|
6
|
-
export declare class StripQuotes implements CommandParser {
|
|
7
|
-
parse(commandInfo: CommandInfo): {
|
|
8
|
-
command: string;
|
|
9
|
-
name: string;
|
|
10
|
-
env?: Record<string, unknown>;
|
|
11
|
-
cwd?: string;
|
|
12
|
-
prefixColor?: string;
|
|
13
|
-
ipc?: number;
|
|
14
|
-
raw?: boolean;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StripQuotes = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Strips quotes around commands so that they can run on the current shell.
|
|
6
|
-
*/
|
|
7
|
-
class StripQuotes {
|
|
8
|
-
parse(commandInfo) {
|
|
9
|
-
let { command } = commandInfo;
|
|
10
|
-
// Removes the quotes surrounding a command.
|
|
11
|
-
if (/^"(.+?)"$/.test(command) || /^'(.+?)'$/.test(command)) {
|
|
12
|
-
command = command.slice(1, command.length - 1);
|
|
13
|
-
}
|
|
14
|
-
return { ...commandInfo, command };
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
exports.StripQuotes = StripQuotes;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Command } from '../command';
|
|
2
|
-
/**
|
|
3
|
-
* Interface for a class that controls and/or watches the behavior of commands.
|
|
4
|
-
*
|
|
5
|
-
* This may include logging their output, creating interactions between them, or changing when they
|
|
6
|
-
* actually finish.
|
|
7
|
-
*/
|
|
8
|
-
export interface FlowController {
|
|
9
|
-
handle(commands: Command[]): {
|
|
10
|
-
commands: Command[];
|
|
11
|
-
onFinish?: () => void | Promise<void>;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.RestartProcess = void 0;
|
|
37
|
-
const Rx = __importStar(require("rxjs"));
|
|
38
|
-
const operators_1 = require("rxjs/operators");
|
|
39
|
-
const defaults = __importStar(require("../defaults"));
|
|
40
|
-
/**
|
|
41
|
-
* Restarts commands that fail up to a defined number of times.
|
|
42
|
-
*/
|
|
43
|
-
class RestartProcess {
|
|
44
|
-
logger;
|
|
45
|
-
scheduler;
|
|
46
|
-
delay;
|
|
47
|
-
tries;
|
|
48
|
-
constructor({ delay, tries, logger, scheduler, }) {
|
|
49
|
-
this.logger = logger;
|
|
50
|
-
this.delay = delay ?? 0;
|
|
51
|
-
this.tries = tries != null ? +tries : defaults.restartTries;
|
|
52
|
-
this.tries = this.tries < 0 ? Infinity : this.tries;
|
|
53
|
-
this.scheduler = scheduler;
|
|
54
|
-
}
|
|
55
|
-
handle(commands) {
|
|
56
|
-
if (this.tries === 0) {
|
|
57
|
-
return { commands };
|
|
58
|
-
}
|
|
59
|
-
const delayOperator = (0, operators_1.delayWhen)((_, index) => {
|
|
60
|
-
const { delay } = this;
|
|
61
|
-
const value = delay === 'exponential' ? Math.pow(2, index) * 1000 : delay;
|
|
62
|
-
return Rx.timer(value, this.scheduler);
|
|
63
|
-
});
|
|
64
|
-
commands
|
|
65
|
-
.map((command) => command.close.pipe((0, operators_1.take)(this.tries), (0, operators_1.takeWhile)(({ exitCode }) => exitCode !== 0)))
|
|
66
|
-
.forEach((failure, index) => Rx.merge(
|
|
67
|
-
// Delay the emission (so that the restarts happen on time),
|
|
68
|
-
// explicitly telling the subscriber that a restart is needed
|
|
69
|
-
failure.pipe(delayOperator, (0, operators_1.map)(() => true)),
|
|
70
|
-
// Skip the first N emissions (as these would be duplicates of the above),
|
|
71
|
-
// meaning it will be empty because of success, or failed all N times,
|
|
72
|
-
// and no more restarts should be attempted.
|
|
73
|
-
failure.pipe((0, operators_1.skip)(this.tries), (0, operators_1.map)(() => false), (0, operators_1.defaultIfEmpty)(false))).subscribe((restart) => {
|
|
74
|
-
const command = commands[index];
|
|
75
|
-
if (restart) {
|
|
76
|
-
this.logger.logCommandEvent(`${command.command} restarted`, command);
|
|
77
|
-
command.start();
|
|
78
|
-
}
|
|
79
|
-
}));
|
|
80
|
-
return {
|
|
81
|
-
commands: commands.map((command) => {
|
|
82
|
-
const closeStream = command.close.pipe((0, operators_1.filter)(({ exitCode }, emission) => {
|
|
83
|
-
// We let all success codes pass, and failures only after restarting won't happen again
|
|
84
|
-
return exitCode === 0 || emission >= this.tries;
|
|
85
|
-
}));
|
|
86
|
-
// Return a proxy so that mutations happen on the original Command object.
|
|
87
|
-
// If either `Object.assign()` or `Object.create()` were used, it'd be hard to
|
|
88
|
-
// reflect the mutations on Command objects referenced by previous flow controllers.
|
|
89
|
-
return new Proxy(command, {
|
|
90
|
-
get(target, prop) {
|
|
91
|
-
return prop === 'close' ? closeStream : target[prop];
|
|
92
|
-
},
|
|
93
|
-
});
|
|
94
|
-
}),
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
exports.RestartProcess = RestartProcess;
|