concurrently 8.2.2 → 9.0.1

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.
Files changed (62) hide show
  1. package/README.md +34 -239
  2. package/dist/bin/concurrently.js +37 -22
  3. package/dist/bin/read-package.d.ts +6 -0
  4. package/dist/bin/read-package.js +47 -0
  5. package/dist/src/command-parser/expand-arguments.d.ts +1 -0
  6. package/dist/src/command-parser/expand-arguments.js +1 -0
  7. package/dist/src/command-parser/expand-npm-shortcut.d.ts +1 -1
  8. package/dist/src/command-parser/expand-npm-shortcut.js +4 -3
  9. package/dist/src/command-parser/expand-npm-wildcard.js +4 -2
  10. package/dist/src/command-parser/strip-quotes.d.ts +1 -0
  11. package/dist/src/command.d.ts +46 -5
  12. package/dist/src/command.js +91 -16
  13. package/dist/src/completion-listener.d.ts +4 -1
  14. package/dist/src/completion-listener.js +30 -6
  15. package/dist/src/concurrently.d.ts +16 -4
  16. package/dist/src/concurrently.js +15 -14
  17. package/dist/src/date-format.d.ts +19 -0
  18. package/dist/src/date-format.js +318 -0
  19. package/dist/src/defaults.d.ts +1 -1
  20. package/dist/src/defaults.js +1 -1
  21. package/dist/src/flow-control/flow-controller.d.ts +1 -1
  22. package/dist/src/flow-control/input-handler.js +4 -0
  23. package/dist/src/flow-control/kill-on-signal.d.ts +4 -1
  24. package/dist/src/flow-control/kill-on-signal.js +8 -1
  25. package/dist/src/flow-control/kill-others.d.ts +4 -1
  26. package/dist/src/flow-control/kill-others.js +7 -1
  27. package/dist/src/flow-control/log-error.js +1 -0
  28. package/dist/src/flow-control/log-exit.js +1 -0
  29. package/dist/src/flow-control/log-output.js +1 -0
  30. package/dist/src/flow-control/log-timings.d.ts +1 -1
  31. package/dist/src/flow-control/log-timings.js +6 -4
  32. package/dist/src/flow-control/logger-padding.d.ts +13 -0
  33. package/dist/src/flow-control/logger-padding.js +35 -0
  34. package/dist/src/flow-control/restart-process.d.ts +3 -2
  35. package/dist/src/flow-control/restart-process.js +14 -2
  36. package/dist/src/flow-control/teardown.d.ts +21 -0
  37. package/dist/src/flow-control/teardown.js +72 -0
  38. package/dist/src/index.d.ts +18 -8
  39. package/dist/src/index.js +28 -7
  40. package/dist/src/logger.d.ts +25 -10
  41. package/dist/src/logger.js +78 -39
  42. package/dist/src/output-writer.js +6 -2
  43. package/dist/src/prefix-color-selector.js +1 -0
  44. package/dist/src/{get-spawn-opts.d.ts → spawn.d.ts} +20 -5
  45. package/dist/src/spawn.js +49 -0
  46. package/docs/README.md +13 -0
  47. package/docs/cli/configuration.md +11 -0
  48. package/docs/cli/input-handling.md +40 -0
  49. package/docs/cli/output-control.md +35 -0
  50. package/docs/cli/passthrough-arguments.md +80 -0
  51. package/docs/cli/prefixing.md +147 -0
  52. package/docs/cli/restarting.md +38 -0
  53. package/docs/cli/shortcuts.md +72 -0
  54. package/docs/demo.gif +0 -0
  55. package/index.d.mts +7 -0
  56. package/index.d.ts +11 -0
  57. package/index.js +6 -1
  58. package/index.mjs +2 -2
  59. package/package.json +37 -29
  60. package/dist/bin/epilogue.d.ts +0 -1
  61. package/dist/bin/epilogue.js +0 -90
  62. package/dist/src/get-spawn-opts.js +0 -18
@@ -0,0 +1,40 @@
1
+ # Input Handling
2
+
3
+ By default, concurrently doesn't send input to any commands it spawns.<br/>
4
+ In the below example, typing `rs` to manually restart [nodemon](https://nodemon.io/) does nothing:
5
+
6
+ ```bash
7
+ $ concurrently "nodemon" "npm run watch-js"
8
+ rs
9
+ ```
10
+
11
+ To turn on input handling, it's necessary to set the `--handle-input`/`-i` flag.<br/>
12
+ This will send `rs` to the first command:
13
+
14
+ ```bash
15
+ $ concurrently --handle-input "nodemon" "npm run watch-js"
16
+ rs
17
+ ```
18
+
19
+ To send input to a different command instead, it's possible to prefix the input with the command index, followed by a `:`.<br/>
20
+ For example, the below sends `rs` to the second command:
21
+
22
+ ```bash
23
+ $ concurrently --handle-input "npm run watch-js" "nodemon"
24
+ 1:rs
25
+ ```
26
+
27
+ If the command has a name, it's also possible to target it using that command's name:
28
+
29
+ ```bash
30
+ $ concurrently --handle-input --names js,server "npm run watch-js" "nodemon"
31
+ server:rs
32
+ ```
33
+
34
+ It's also possible to change the default command that receives input.<br/>
35
+ To do this, set the `--default-input-target` flag to a command's index or name.
36
+
37
+ ```bash
38
+ $ concurrently --handle-input --default-input-target 1 "npm run watch-js" "nodemon"
39
+ rs
40
+ ```
@@ -0,0 +1,35 @@
1
+ # Output Control
2
+
3
+ concurrently offers a few ways to control a command's output.
4
+
5
+ ## Hiding
6
+
7
+ A command's outputs (and all its events) can be hidden by using the `--hide` flag.
8
+
9
+ ```bash
10
+ $ concurrently --hide 0 "echo Hello there" "echo 'General Kenobi!'"
11
+ [1] General Kenobi!
12
+ [1] echo 'General Kenobi!' exited with code 0
13
+ ```
14
+
15
+ ## Grouping
16
+
17
+ It might be useful at times to make sure that the commands outputs are grouped together, while running them in parallel.<br/>
18
+ This can be done with the `--group` flag.
19
+
20
+ ```bash
21
+ $ concurrently --group "echo Hello there && sleep 2 && echo 'General Kenobi!'" "echo hi Star Wars fans"
22
+ [0] Hello there
23
+ [0] General Kenobi!
24
+ [0] echo Hello there && sleep 2 && echo 'General Kenobi!' exited with code 0
25
+ [1] hi Star Wars fans
26
+ [1] echo hi Star Wars fans exited with code 0
27
+ ```
28
+
29
+ ## No Colors
30
+
31
+ When piping concurrently's outputs to another command or file, you might want to force it to not use colors, as these can break the other command's parsing, or reduce the legibility of the output in non-terminal environments.
32
+
33
+ ```bash
34
+ $ concurrently -c red,blue --no-color "echo Hello there" "echo 'General Kenobi!'"
35
+ ```
@@ -0,0 +1,80 @@
1
+ # Passthrough Arguments
2
+
3
+ If you have a shortcut for running a specific combination of commands through concurrently,
4
+ you might need at some point to pass additional arguments/flags to some of these.
5
+
6
+ For example, imagine you have in your `package.json` file scripts like this:
7
+
8
+ ```jsonc
9
+ {
10
+ // ...
11
+ "scripts": {
12
+ "build:client": "tsc -p client",
13
+ "build:server": "tsc -p server",
14
+ "build": "concurrently npm:build:client npm:build:server"
15
+ }
16
+ }
17
+ ```
18
+
19
+ If you wanted to run only either `build:server` or `build:client` with an additional `--noEmit` flag,
20
+ you can do so with `npm run build:server -- --watch`, for example.<br/>
21
+ However, if you want to do that while using concurrently, as `npm run dev -- --noEmit` for example,
22
+ you might find that concurrently actually parses `--watch` as its own flag, which does nothing,
23
+ because it doesn't exist.
24
+
25
+ To solve this, you can set the `--passthrough-arguments`/`-P` flag, which instructs concurrently to
26
+ take everything after a `--` as additional arguments that are passed through to the input commands
27
+ via a few placeholder styles:
28
+
29
+ ## Single argument
30
+
31
+ We can modify the original `build` script to pass a single additional argument/flag to a script by using
32
+ a 1-indexed `{number}` placeholder to the command you want it to apply to:
33
+
34
+ ```jsonc
35
+ {
36
+ // ...
37
+ "scripts": {
38
+ // ...
39
+ "build": "concurrently -P 'npm:build:client -- {1}' npm:build:server --",
40
+ "typecheck": "npm run build -- --noEmit"
41
+ }
42
+ }
43
+ ```
44
+
45
+ With this, running `npm run typecheck` will pass `--noEmit` only to `npm run build:client`.
46
+
47
+ ## All arguments
48
+
49
+ In the original `build` example script, you're more likely to want to pass every additional argument/flag
50
+ to your commands. This can be done with the `{@}` placeholder.
51
+
52
+ ```jsonc
53
+ {
54
+ // ...
55
+ "scripts": {
56
+ // ...
57
+ "build": "concurrently -P 'npm:build:client -- {@}' 'npm:build:server -- {@}' --",
58
+ "typecheck": "npm run build -- --watch --noEmit"
59
+ }
60
+ }
61
+ ```
62
+
63
+ In the above example, both `--watch` and `--noEmit` are passed to each command.
64
+
65
+ ## All arguments, combined
66
+
67
+ If for some reason you wish to combine all additional arguments into a single one, you can do that with the `{*}` placeholder,
68
+ which wraps the arguments in quotes.
69
+
70
+ ```jsonc
71
+ {
72
+ // ...
73
+ "scripts": {
74
+ // ...
75
+ "build": "concurrently -P 'npm:build:client -- --outDir {*}/client' 'npm:build:server -- --outDir {*}/server' -- $(date)"
76
+ }
77
+ }
78
+ ```
79
+
80
+ In the above example, the output of the `date` command, which looks like `Sun 1 Sep 2024 23:50:00 AEST` will be passed as a single string to the `--outDir` parameter of both commands.
@@ -0,0 +1,147 @@
1
+ # Prefixing
2
+
3
+ ## Prefix Styles
4
+
5
+ concurrently will by default prefix each command's outputs with a zero-based index, wrapped in square brackets:
6
+
7
+ ```bash
8
+ $ concurrently "echo Hello there" "echo 'General Kenobi!'"
9
+ [0] Hello there
10
+ [1] General Kenobi!
11
+ [0] echo Hello there exited with code 0
12
+ [1] echo 'General Kenobi!' exited with code 0
13
+ ```
14
+
15
+ If you've given the commands names, they are used instead:
16
+
17
+ ```bash
18
+ $ concurrently --names one,two "echo Hello there" "echo 'General Kenobi!'"
19
+ [one] Hello there
20
+ [two] General Kenobi!
21
+ [one] echo Hello there exited with code 0
22
+ [two] echo 'General Kenobi!' exited with code 0
23
+ ```
24
+
25
+ There are other prefix styles available too:
26
+
27
+ | Style | Description |
28
+ | --------- | --------------------------------- |
29
+ | `index` | Zero-based command's index |
30
+ | `name` | The command's name |
31
+ | `command` | The command's line |
32
+ | `time` | Time of output |
33
+ | `pid` | ID of the command's process (PID) |
34
+ | `none` | No prefix |
35
+
36
+ Any of these can be used by setting the `--prefix`/`-p` flag. For example:
37
+
38
+ ```bash
39
+ $ concurrently --prefix pid "echo Hello there" "echo 'General Kenobi!'"
40
+ [2222] Hello there
41
+ [2223] General Kenobi!
42
+ [2222] echo Hello there exited with code 0
43
+ [2223] echo 'General Kenobi!' exited with code 0
44
+ ```
45
+
46
+ It's also possible to have a prefix based on a template. Any of the styles listed above can be used by wrapping it in `{}`.
47
+ Doing so will also remove the square brackets:
48
+
49
+ ```bash
50
+ $ concurrently --prefix "{index}-{pid}" "echo Hello there" "echo 'General Kenobi!'"
51
+ 0-2222 Hello there
52
+ 1-2223 General Kenobi!
53
+ 0-2222 echo Hello there exited with code 0
54
+ 1-2223 echo 'General Kenobi!' exited with code 0
55
+ ```
56
+
57
+ ## Prefix Colors
58
+
59
+ By default, there are no colors applied to concurrently prefixes, and they just use whatever the terminal's defaults are.
60
+
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`), or `auto`, to automatically select a color.
63
+
64
+ ```bash
65
+ $ concurrently -c red,blue "echo Hello there" "echo 'General Kenobi!'"
66
+ ```
67
+
68
+ <details>
69
+ <summary>List of available color names</summary>
70
+
71
+ - `black`
72
+ - `blue`
73
+ - `cyan`
74
+ - `green`
75
+ - `gray`
76
+ - `magenta`
77
+ - `red`
78
+ - `white`
79
+ - `yellow`
80
+ </details>
81
+
82
+ Colors can take modifiers too. Several can be applied at once by prepending `.<modifier 1>.<modifier 2>` and so on.
83
+
84
+ ```bash
85
+ $ concurrently -c red,bold.blue.dim "echo Hello there" "echo 'General Kenobi!'"
86
+ ```
87
+
88
+ <details>
89
+ <summary>List of available modifiers</summary>
90
+
91
+ - `reset`
92
+ - `bold`
93
+ - `dim`
94
+ - `hidden`
95
+ - `inverse`
96
+ - `italic`
97
+ - `strikethrough`
98
+ - `underline`
99
+ </details>
100
+
101
+ A background color can be set in a similary fashion.
102
+
103
+ ```bash
104
+ $ concurrently -c bgGray,red.bgBlack "echo Hello there" "echo 'General Kenobi!'"
105
+ ```
106
+
107
+ <details>
108
+ <summary>List of available background color names</summary>
109
+
110
+ - `bgBlack`
111
+ - `bgBlue`
112
+ - `bgCyan`
113
+ - `bgGreen`
114
+ - `bgGray`
115
+ - `bgMagenta`
116
+ - `bgRed`
117
+ - `bgWhite`
118
+ - `bgYellow`
119
+ </details>
120
+
121
+ ## Prefix Length
122
+
123
+ When using the `command` prefix style, it's possible that it'll be too long.<br/>
124
+ It can be limited by setting the `--prefix-length`/`-l` flag:
125
+
126
+ ```bash
127
+ $ concurrently -p command -l 10 "echo Hello there" "echo 'General Kenobi!'"
128
+ [echo..here] Hello there
129
+ [echo..bi!'] General Kenobi!
130
+ [echo..here] echo Hello there exited with code 0
131
+ [echo..bi!'] echo 'General Kenobi!' exited with code 0
132
+ ```
133
+
134
+ It's also possible that some prefixes are too short, and you want all of them to have the same length.<br/>
135
+ This can be done by setting the `--pad-prefix` flag:
136
+
137
+ ```bash
138
+ $ concurrently -n foo,barbaz --pad-prefix "echo Hello there" "echo 'General Kenobi!'"
139
+ [foo ] Hello there
140
+ [foo ] echo Hello there exited with code 0
141
+ [barbaz] General Kenobi!
142
+ [barbaz] echo 'General Kenobi!' exited with code 0
143
+ ```
144
+
145
+ > [!NOTE]
146
+ > If using the `pid` prefix style in combination with [`--restart-tries`](./restarting.md), the length of the PID might grow, in which case all subsequent lines will match the new length.<br/>
147
+ > This might happen, for example, if the PID was 99 and it's now 100.
@@ -0,0 +1,38 @@
1
+ # Restarting Commands
2
+
3
+ Sometimes it's useful to have commands that exited with a non-zero status to restart automatically.<br/>
4
+ concurrently lets you configure how many times you wish for such a command to restart through the `--restart-tries` flag:
5
+
6
+ ```bash
7
+ $ concurrently --restart-tries 2 "exit 1"
8
+ [0] exit 1 exited with code 1
9
+ [0] exit 1 restarted
10
+ [0] exit 1 exited with code 1
11
+ [0] exit 1 restarted
12
+ [0] exit 1 exited with code 1
13
+ ```
14
+
15
+ Sometimes, it might be interesting to have commands wait before restarting.<br/>
16
+ To do this, simply set `--restart-after` to a the number of milliseconds you'd like to delay restarting.
17
+
18
+ ```bash
19
+ $ concurrently -p time --restart-tries 1 --restart-after 3000 "exit 1"
20
+ [2024-09-01 23:43:55.871] exit 1 exited with code 1
21
+ [2024-09-01 23:43:58.874] exit 1 restarted
22
+ [2024-09-01 23:43:58.891] exit 1 exited with code 1
23
+ ```
24
+
25
+ If a command is not having success spawning, you might want to instead apply an exponential back-off.<br/>
26
+ Set `--restart-after exponential` to have commands respawn with a `2^N` seconds delay.
27
+
28
+ ```bash
29
+ $ concurrently -p time --restart-tries 3 --restart-after exponential "exit 1"
30
+
31
+ [2024-09-01 23:49:01.124] exit 1 exited with code 1
32
+ [2024-09-01 23:49:02.127] exit 1 restarted
33
+ [2024-09-01 23:49:02.139] exit 1 exited with code 1
34
+ [2024-09-01 23:49:04.141] exit 1 restarted
35
+ [2024-09-01 23:49:04.157] exit 1 exited with code 1
36
+ [2024-09-01 23:49:08.158] exit 1 restarted
37
+ [2024-09-01 23:49:08.174] exit 1 exited with code 1
38
+ ```
@@ -0,0 +1,72 @@
1
+ # Command Shortcuts
2
+
3
+ Package managers that execute scripts from a `package.json` file can be shortened when in concurrently.<br/>
4
+ The following are supported:
5
+
6
+ | Syntax | Expands to |
7
+ | --------------- | --------------------- |
8
+ | `npm:<script>` | `npm run <script>` |
9
+ | `pnpm:<script>` | `pnpm run <script>` |
10
+ | `yarn:<script>` | `yarn run <script>` |
11
+ | `bun:<script>` | `bun run <script>` |
12
+ | `node:<script>` | `node --run <script>` |
13
+
14
+ > [!NOTE]
15
+ >
16
+ > `node --run` is only available from [Node 22 onwards](https://nodejs.org/en/blog/announcements/v22-release-announce#running-packagejson-scripts).
17
+
18
+ For example, given the following `package.json` contents:
19
+
20
+ ```jsonc
21
+ {
22
+ // ...
23
+ "scripts": {
24
+ "lint:js": "...",
25
+ "lint:ts": "...",
26
+ "lint:fix:js": "...",
27
+ "lint:fix:ts": "..."
28
+ // ...
29
+ }
30
+ // ...
31
+ }
32
+ ```
33
+
34
+ It's possible to run some of these with the following command line:
35
+
36
+ ```bash
37
+ $ concurrently "pnpm:lint:js"
38
+ # Is equivalent to
39
+ $ concurrently -n lint:js "pnpm run lint:js"
40
+ ```
41
+
42
+ Note that the command automatically receives a name equal to the script name.
43
+
44
+ If you have several scripts with similar name patterns, you can use the `*` wildcard to run all of them at once.<br/>
45
+ The spawned commands will receive names set to whatever the `*` wildcard matched.
46
+
47
+ ```bash
48
+ $ concurrently "npm:lint:fix:*"
49
+ # is equivalent to
50
+ $ concurrently -n js,ts "npm run lint:fix:js" "npm run lint:fix:ts"
51
+ ```
52
+
53
+ If you specify a command name when using wildcards, it'll be a prefix of what the `*` wildcard matched:
54
+
55
+ ```bash
56
+ $ concurrently -n fix: "npm:lint:fix:*"
57
+ # is equivalent to
58
+ $ concurrently -n fix:js,fix:ts "npm run lint:fix:js" "npm run lint:fix:ts"
59
+ ```
60
+
61
+ Filtering out commands matched by wildcard is also possible. Do this with by including `(!<some pattern>)` in the command line:
62
+
63
+ ```bash
64
+ $ concurrently 'yarn:lint:*(!fix)'
65
+ # is equivalent to
66
+ $ concurrently -n js,ts "yarn run lint:js" "yarn run lint:ts"
67
+ ```
68
+
69
+ > [!NOTE]
70
+ > If you use this syntax with double quotes (`"`), bash and other shells might fail
71
+ > parsing it. You'll need to escape the `!`, or use single quote (`'`) instead.<br/>
72
+ > See [here](https://serverfault.com/a/208266/160539) for more information.
package/docs/demo.gif ADDED
Binary file
package/index.d.mts ADDED
@@ -0,0 +1,7 @@
1
+ /*
2
+ * While in local development, make sure you've run `pnpm run build` first.
3
+ */
4
+ import { concurrently } from './dist/src/index.js';
5
+
6
+ export * from './dist/src/index.js';
7
+ export default concurrently;
package/index.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ /*
2
+ * While in local development, make sure you've run `pnpm run build` first.
3
+ */
4
+ import { concurrently } from './dist/src/index.js';
5
+
6
+ export * from './dist/src/index.js';
7
+ // @ts-expect-error ignore the usage of `export =` along with `export default`.
8
+ // This is seemingly fine, but the file needs to be included in the TS project, which can't be done
9
+ // due to importing from `dist`. See https://stackoverflow.com/q/42609768/2083599
10
+ export = concurrently;
11
+ export default concurrently;
package/index.js CHANGED
@@ -5,5 +5,10 @@
5
5
  // eslint-disable-next-line @typescript-eslint/no-var-requires
6
6
  const concurrently = require('./dist/src/index.js');
7
7
 
8
- module.exports = exports = concurrently.default;
8
+ // For require()
9
+ module.exports = exports = concurrently.concurrently;
10
+
11
+ // For TS + import syntax; mimics `export default`
12
+ exports.default = exports;
13
+
9
14
  Object.assign(exports, concurrently);
package/index.mjs CHANGED
@@ -2,9 +2,9 @@
2
2
  * While in local development, make sure you've run `pnpm run build` first.
3
3
  */
4
4
 
5
- import concurrently from './dist/src/index.js';
5
+ import { concurrently } from './dist/src/index.js';
6
6
 
7
7
  // NOTE: the star reexport doesn't work in Node <12.20, <14.13 and <15.
8
8
  export * from './dist/src/index.js';
9
9
 
10
- export default concurrently.default;
10
+ export default concurrently;
package/package.json CHANGED
@@ -1,23 +1,28 @@
1
1
  {
2
2
  "name": "concurrently",
3
- "version": "8.2.2",
3
+ "version": "9.0.1",
4
4
  "description": "Run commands concurrently",
5
+ "packageManager": "pnpm@8.15.9+sha256.daa27a0b541bc635323ff96c2ded995467ff9fe6d69ff67021558aa9ad9dcc36",
5
6
  "main": "index.js",
6
- "types": "dist/src/index.d.ts",
7
+ "types": "index.d.ts",
7
8
  "type": "commonjs",
8
9
  "bin": {
9
10
  "concurrently": "./dist/bin/concurrently.js",
10
11
  "conc": "./dist/bin/concurrently.js"
11
12
  },
12
13
  "engines": {
13
- "node": "^14.13.0 || >=16.0.0"
14
+ "node": ">=18"
14
15
  },
15
16
  "exports": {
16
17
  ".": {
17
- "types": "./dist/src/index.d.ts",
18
- "import": "./index.mjs",
19
- "require": "./index.js",
20
- "default": "./index.js"
18
+ "import": {
19
+ "types": "./index.d.mts",
20
+ "default": "./index.mjs"
21
+ },
22
+ "require": {
23
+ "types": "./index.d.ts",
24
+ "default": "./index.js"
25
+ }
21
26
  },
22
27
  "./package.json": "./package.json"
23
28
  },
@@ -38,40 +43,39 @@
38
43
  "license": "MIT",
39
44
  "dependencies": {
40
45
  "chalk": "^4.1.2",
41
- "date-fns": "^2.30.0",
42
46
  "lodash": "^4.17.21",
43
47
  "rxjs": "^7.8.1",
44
48
  "shell-quote": "^1.8.1",
45
- "spawn-command": "0.0.2",
46
49
  "supports-color": "^8.1.1",
47
50
  "tree-kill": "^1.2.2",
48
51
  "yargs": "^17.7.2"
49
52
  },
50
53
  "devDependencies": {
51
54
  "@hirez_io/observer-spy": "^2.2.0",
52
- "@swc/core": "^1.3.93",
53
- "@swc/jest": "^0.2.29",
55
+ "@jest/types": "^29.6.3",
56
+ "@swc/core": "^1.7.23",
57
+ "@swc/jest": "^0.2.36",
54
58
  "@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
- "coveralls-next": "^4.2.0",
59
+ "@types/lodash": "^4.17.7",
60
+ "@types/node": "^18.19.50",
61
+ "@types/shell-quote": "^1.7.5",
62
+ "@types/supports-color": "^8.1.3",
63
+ "@types/yargs": "^17.0.33",
64
+ "@typescript-eslint/eslint-plugin": "^7.18.0",
65
+ "@typescript-eslint/parser": "^7.18.0",
66
+ "coveralls-next": "^4.2.1",
63
67
  "ctrlc-wrapper": "^0.0.4",
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",
68
+ "esbuild": "~0.23.1",
69
+ "eslint": "^8.57.0",
70
+ "eslint-config-prettier": "^9.1.0",
71
+ "eslint-plugin-import": "^2.30.0",
72
+ "eslint-plugin-jest": "^27.9.0",
73
+ "eslint-plugin-prettier": "^5.2.1",
70
74
  "eslint-plugin-simple-import-sort": "^10.0.0",
71
- "husky": "^8.0.3",
75
+ "husky": "^9.1.5",
72
76
  "jest": "^29.7.0",
73
77
  "jest-create-mock-instance": "^2.0.0",
74
- "lint-staged": "^13.3.0",
78
+ "lint-staged": "^15.2.10",
75
79
  "prettier": "^3.0.3",
76
80
  "safe-publish-latest": "^2.0.0",
77
81
  "string-argv": "^0.3.2",
@@ -80,10 +84,13 @@
80
84
  "files": [
81
85
  "dist",
82
86
  "index.js",
87
+ "index.d.ts",
83
88
  "index.mjs",
89
+ "index.d.mts",
84
90
  "!**/fixtures",
85
91
  "!**/*.spec.js",
86
- "!**/*.spec.d.ts"
92
+ "!**/*.spec.d.ts",
93
+ "docs"
87
94
  ],
88
95
  "lint-staged": {
89
96
  "*.?(m){js,ts}": "eslint --fix",
@@ -98,6 +105,7 @@
98
105
  "lint": "eslint --ignore-path .gitignore --ext mjs,js,ts .",
99
106
  "lint:fix": "pnpm run lint --fix",
100
107
  "report-coverage": "cat coverage/lcov.info | coveralls",
101
- "test": "jest"
108
+ "test": "jest --selectProjects unit",
109
+ "test:smoke": "jest --selectProjects smoke"
102
110
  }
103
111
  }
@@ -1 +0,0 @@
1
- export declare const epilogue: string;
@@ -1,90 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.epilogue = void 0;
4
- // Add new examples here.
5
- // Always start with `$ $0` so that it a) symbolizes a command line; and b) $0 gets replaced by the binary name uniformly.
6
- const examples = [
7
- {
8
- description: 'Output nothing more than stdout+stderr of child processes',
9
- example: '$ $0 --raw "npm run watch-less" "npm run watch-js"',
10
- },
11
- {
12
- description: 'Normal output but without colors e.g. when logging to file',
13
- example: '$ $0 --no-color "grunt watch" "http-server" > log',
14
- },
15
- {
16
- description: 'Custom prefix',
17
- example: '$ $0 --prefix "{time}-{pid}" "npm run watch" "http-server"',
18
- },
19
- {
20
- description: 'Custom names and colored prefixes',
21
- example: '$ $0 --names "HTTP,WATCH" -c "bgBlue.bold,bgMagenta.bold" "http-server" "npm run watch"',
22
- },
23
- {
24
- description: 'Auto varying colored prefixes',
25
- example: '$ $0 -c "auto" "npm run watch" "http-server"',
26
- },
27
- {
28
- description: 'Mixing auto and manual colored prefixes',
29
- example: '$ $0 -c "red,auto" "npm run watch" "http-server" "echo hello"',
30
- },
31
- {
32
- description: 'Configuring via environment variables with CONCURRENTLY_ prefix',
33
- example: '$ CONCURRENTLY_RAW=true CONCURRENTLY_KILL_OTHERS=true $0 "echo hello" "echo world"',
34
- },
35
- {
36
- description: 'Send input to default',
37
- example: [
38
- '$ $0 --handle-input "nodemon" "npm run watch-js"',
39
- 'rs # Sends rs command to nodemon process',
40
- ].join('\n'),
41
- },
42
- {
43
- description: 'Send input to specific child identified by index',
44
- example: ['$ $0 --handle-input "npm run watch-js" nodemon', '1:rs'].join('\n'),
45
- },
46
- {
47
- description: 'Send input to specific child identified by name',
48
- example: ['$ $0 --handle-input -n js,srv "npm run watch-js" nodemon', 'srv:rs'].join('\n'),
49
- },
50
- {
51
- description: 'Shortened NPM run commands',
52
- example: '$ $0 npm:watch-node npm:watch-js npm:watch-css',
53
- },
54
- {
55
- description: 'Shortened NPM run command with wildcard (make sure to wrap it in quotes!)',
56
- example: '$ $0 "npm:watch-*"',
57
- },
58
- {
59
- description: 'Exclude patterns so that between "lint:js" and "lint:fix:js", only "lint:js" is ran',
60
- example: '$ $0 "npm:*(!fix)"',
61
- },
62
- {
63
- description: "Passthrough some additional arguments via '{<number>}' placeholder",
64
- example: '$ $0 -P "echo {1}" -- foo',
65
- },
66
- {
67
- description: "Passthrough all additional arguments via '{@}' placeholder",
68
- example: '$ $0 -P "npm:dev-* -- {@}" -- --watch --noEmit',
69
- },
70
- {
71
- description: "Passthrough all additional arguments combined via '{*}' placeholder",
72
- example: '$ $0 -P "npm:dev-* -- {*}" -- --watch --noEmit',
73
- },
74
- ];
75
- const examplesString = examples
76
- .map(({ example, description }) => [
77
- ` - ${description}`,
78
- example
79
- .split('\n')
80
- .map((line) => ` ${line}`)
81
- .join('\n'),
82
- ].join('\n\n'))
83
- .join('\n\n');
84
- exports.epilogue = `
85
- Examples:
86
-
87
- ${examplesString}
88
-
89
- For more details, visit https://github.com/open-cli-tools/concurrently
90
- `;