concurrently 3.4.0 → 3.6.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.
- package/.eslintrc.json +23 -0
- package/.travis.yml +4 -3
- package/README.md +115 -18
- package/appveyor.yml +1 -2
- package/package.json +11 -3
- package/src/findChild.js +11 -0
- package/src/main.js +251 -126
- package/src/parseCmds.js +65 -0
- package/src/pkgInfo.js +17 -0
- package/test/support/read-echo.js +12 -0
- package/test/support/signal.js +5 -5
- package/test/test-findChild.js +39 -0
- package/test/test-functional.js +329 -88
- package/test/test-parseCmds.js +204 -0
- package/test/utils.js +42 -17
- package/.eslintrc +0 -31
- package/.jshintrc +0 -17
- package/.npmignore +0 -31
- package/tst.js +0 -1
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"root": true,
|
|
3
|
+
"env": {
|
|
4
|
+
"browser": false,
|
|
5
|
+
"node": true
|
|
6
|
+
},
|
|
7
|
+
"parserOptions": {
|
|
8
|
+
"ecmaVersion": 6
|
|
9
|
+
},
|
|
10
|
+
"rules": {
|
|
11
|
+
"block-spacing": "error",
|
|
12
|
+
"curly": "error",
|
|
13
|
+
"eqeqeq": ["error", "always", { "null": "ignore" }],
|
|
14
|
+
"indent": ["error", 4],
|
|
15
|
+
"keyword-spacing": "error",
|
|
16
|
+
"no-var": "error",
|
|
17
|
+
"prefer-const": "error",
|
|
18
|
+
"quotes": ["error", "single"],
|
|
19
|
+
"semi": "error",
|
|
20
|
+
"space-before-blocks": "error",
|
|
21
|
+
"space-before-function-paren": ["error", "never"]
|
|
22
|
+
}
|
|
23
|
+
}
|
package/.travis.yml
CHANGED
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ Like `npm run watch-js & npm run watch-less` but better.
|
|
|
11
11
|
|
|
12
12
|
**Features:**
|
|
13
13
|
|
|
14
|
-
* Cross platform
|
|
14
|
+
* Cross platform (including Windows)
|
|
15
15
|
* Output is easy to follow with prefixes
|
|
16
16
|
* With `--kill-others` switch, all commands are killed if one dies
|
|
17
17
|
* Spawns commands with [spawn-command](https://github.com/mmalecki/spawn-command)
|
|
@@ -32,7 +32,7 @@ npm install concurrently --save
|
|
|
32
32
|
|
|
33
33
|
## Usage
|
|
34
34
|
|
|
35
|
-
Remember to surround separate commands with quotes
|
|
35
|
+
Remember to surround separate commands with quotes:
|
|
36
36
|
```bash
|
|
37
37
|
concurrently "command1 arg" "command2 arg"
|
|
38
38
|
```
|
|
@@ -46,6 +46,46 @@ In package.json, escape quotes:
|
|
|
46
46
|
"start": "concurrently \"command1 arg\" \"command2 arg\""
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
+
NPM run commands can be shortened:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
concurrently "npm:watch-js" "npm:watch-css" "npm:watch-node"
|
|
53
|
+
|
|
54
|
+
# Equivalent to:
|
|
55
|
+
concurrently -n watch-js,watch-css,watch-node "npm run watch-js" "npm run watch-css" "npm run watch-node"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
NPM shortened commands also support wildcards. Given the following scripts in
|
|
59
|
+
package.json:
|
|
60
|
+
|
|
61
|
+
```javascript
|
|
62
|
+
{
|
|
63
|
+
//...
|
|
64
|
+
"scripts": {
|
|
65
|
+
// ...
|
|
66
|
+
"watch-js": "...",
|
|
67
|
+
"watch-css": "...",
|
|
68
|
+
"watch-node": "...",
|
|
69
|
+
// ...
|
|
70
|
+
},
|
|
71
|
+
// ...
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
concurrently "npm:watch-*"
|
|
77
|
+
|
|
78
|
+
# Equivalent to:
|
|
79
|
+
concurrently -n js,css,node "npm run watch-js" "npm run watch-css" "npm run watch-node"
|
|
80
|
+
|
|
81
|
+
# Any name provided for the wildcard command will be used as a prefix to the wildcard
|
|
82
|
+
# part of the script name:
|
|
83
|
+
concurrently -n w: npm:watch-*
|
|
84
|
+
|
|
85
|
+
# Equivalent to:
|
|
86
|
+
concurrently -n w:js,w:css,w:node "npm run watch-js" "npm run watch-css" "npm run watch-node"
|
|
87
|
+
```
|
|
88
|
+
|
|
49
89
|
Good frontend one-liner example [here](https://github.com/kimmobrunfeldt/dont-copy-paste-this-frontend-template/blob/5cd2bde719654941bdfc0a42c6f1b8e69ae79980/package.json#L9).
|
|
50
90
|
|
|
51
91
|
Help:
|
|
@@ -59,9 +99,10 @@ Options:
|
|
|
59
99
|
-h, --help output usage information
|
|
60
100
|
-V, --version output the version number
|
|
61
101
|
-k, --kill-others kill other processes if one exits or dies
|
|
102
|
+
--kill-others-on-fail kill other processes if one exits with non zero status code
|
|
62
103
|
--no-color disable colors from logging
|
|
63
104
|
-p, --prefix <prefix> prefix used in logging for each process.
|
|
64
|
-
Possible values: index, pid, time, command, name, none, or a template. Default: index. Example template: "{time}-{pid}"
|
|
105
|
+
Possible values: index, pid, time, command, name, none, or a template. Default: index or name (when --names is set). Example template: "{time}-{pid}"
|
|
65
106
|
|
|
66
107
|
-n, --names <names> List of custom names to be used in prefix template.
|
|
67
108
|
Example names: "main,browser,server"
|
|
@@ -85,12 +126,30 @@ Options:
|
|
|
85
126
|
The option can be used to shorten long commands.
|
|
86
127
|
Works only if prefix is set to "command". Default: 10
|
|
87
128
|
|
|
129
|
+
--allow-restart Restart a process which died. Default: false
|
|
130
|
+
|
|
131
|
+
--restart-after <miliseconds> delay time to respawn the process. Default: 0
|
|
132
|
+
|
|
133
|
+
--restart-tries <times> limit the number of respawn tries. Default: 1
|
|
134
|
+
|
|
135
|
+
--default-input-target <identifier> 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
|
|
136
|
+
|
|
137
|
+
Input:
|
|
138
|
+
|
|
139
|
+
Input can be sent to any of the child processes using either the name or index
|
|
140
|
+
of the command followed by a colon. If no child identifier is specified then the
|
|
141
|
+
input will be sent to the child specified by the `--default-input-target`
|
|
142
|
+
option, which defaults to index 0.
|
|
88
143
|
|
|
89
144
|
Examples:
|
|
90
145
|
|
|
91
146
|
- Kill other processes if one exits or dies
|
|
92
147
|
|
|
93
148
|
$ concurrently --kill-others "grunt watch" "http-server"
|
|
149
|
+
|
|
150
|
+
- Kill other processes if one exits with non zero status code
|
|
151
|
+
|
|
152
|
+
$ concurrently --kill-others-on-fail "npm run build:client" "npm run build:server"
|
|
94
153
|
|
|
95
154
|
- Output nothing more than stdout+stderr of child processes
|
|
96
155
|
|
|
@@ -106,7 +165,59 @@ Examples:
|
|
|
106
165
|
|
|
107
166
|
- Custom names and colored prefixes
|
|
108
167
|
|
|
109
|
-
$ concurrently --
|
|
168
|
+
$ concurrently --names "HTTP,WATCH" -c "bgBlue.bold,bgMagenta.bold" "http-server" "npm run watch"
|
|
169
|
+
|
|
170
|
+
- Shortened NPM run commands
|
|
171
|
+
|
|
172
|
+
$ concurrently npm:watch-node npm:watch-js npm:watch-css
|
|
173
|
+
|
|
174
|
+
- Send input to default
|
|
175
|
+
|
|
176
|
+
$ concurrently "nodemon" "npm run watch-js"
|
|
177
|
+
rs # Sends rs command to nodemon process
|
|
178
|
+
|
|
179
|
+
- Specify a default-input-target
|
|
180
|
+
|
|
181
|
+
$ concurrently --default-input-target 1 "npm run watch-js" nodemon
|
|
182
|
+
rs
|
|
183
|
+
|
|
184
|
+
- Send input to specific child identified by index
|
|
185
|
+
|
|
186
|
+
$ concurrently "npm run watch-js" nodemon
|
|
187
|
+
1:rs
|
|
188
|
+
|
|
189
|
+
- Send input to specific child identified by name
|
|
190
|
+
|
|
191
|
+
$ concurrently -n js,srv "npm run watch-js" nodemon
|
|
192
|
+
srv:rs
|
|
193
|
+
|
|
194
|
+
- Send input to default
|
|
195
|
+
|
|
196
|
+
$ concurrently "nodemon" "npm run watch-js"
|
|
197
|
+
rs # Sends rs command to nodemon process
|
|
198
|
+
|
|
199
|
+
- Specify a default-input-target
|
|
200
|
+
|
|
201
|
+
$ concurrently --default-input-target 1 "npm run watch-js" nodemon
|
|
202
|
+
rs
|
|
203
|
+
|
|
204
|
+
- Send input to specific child identified by index
|
|
205
|
+
|
|
206
|
+
$ concurrently "npm run watch-js" nodemon
|
|
207
|
+
1:rs
|
|
208
|
+
|
|
209
|
+
- Send input to specific child identified by name
|
|
210
|
+
|
|
211
|
+
$ concurrently -n js,srv "npm run watch-js" nodemon
|
|
212
|
+
srv:rs
|
|
213
|
+
|
|
214
|
+
- Shortened NPM run commands
|
|
215
|
+
|
|
216
|
+
$ concurrently npm:watch-node npm:watch-js npm:watch-css
|
|
217
|
+
|
|
218
|
+
- Shortened NPM run command with wildcard
|
|
219
|
+
|
|
220
|
+
$ concurrently npm:watch-*
|
|
110
221
|
|
|
111
222
|
For more details, visit https://github.com/kimmobrunfeldt/concurrently
|
|
112
223
|
```
|
|
@@ -137,17 +248,3 @@ and you won't even notice the difference.
|
|
|
137
248
|
|
|
138
249
|
Another option would be to just run all commands in separate terminals. I got
|
|
139
250
|
tired of opening terminals and made **concurrently**.
|
|
140
|
-
|
|
141
|
-
### NPM Issue
|
|
142
|
-
|
|
143
|
-
Previously I thought this could fix some problems I had with watching scripts and this readme said:
|
|
144
|
-
|
|
145
|
-
> When running watch or serve tasks, I'd recommend to use `--kill-others` option:
|
|
146
|
-
>
|
|
147
|
-
> ```bash
|
|
148
|
-
> concurrently --kill-others "npm run watch-js" "npm run watch-less"
|
|
149
|
-
> ```
|
|
150
|
-
>
|
|
151
|
-
> That way, if for some reason e.g. your `watch-less` died, you would notice it easier.
|
|
152
|
-
|
|
153
|
-
However NPM didn't work as I hoped it would. See [this issue](https://github.com/kimmobrunfeldt/concurrently/issues/4).
|
package/appveyor.yml
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
environment:
|
|
2
2
|
matrix:
|
|
3
|
-
- nodejs_version: '
|
|
3
|
+
- nodejs_version: '8'
|
|
4
4
|
- nodejs_version: '6'
|
|
5
5
|
- nodejs_version: '4'
|
|
6
6
|
install:
|
|
7
7
|
- ps: Install-Product node $env:nodejs_version
|
|
8
8
|
- set CI=true
|
|
9
9
|
- npm -g install npm@latest
|
|
10
|
-
- npm install -g mocha
|
|
11
10
|
- set PATH=%APPDATA%\npm;%PATH%
|
|
12
11
|
- npm install
|
|
13
12
|
build: off
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "concurrently",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.1",
|
|
4
4
|
"description": "Run commands concurrently",
|
|
5
5
|
"main": "src/main.js",
|
|
6
6
|
"bin": {
|
|
@@ -11,7 +11,12 @@
|
|
|
11
11
|
"node": ">=4.0.0"
|
|
12
12
|
},
|
|
13
13
|
"scripts": {
|
|
14
|
-
"
|
|
14
|
+
"lint": "eslint .",
|
|
15
|
+
"test": "mocha",
|
|
16
|
+
"echo": "echo",
|
|
17
|
+
"echo-test": "echo test",
|
|
18
|
+
"echo-sound-beep": "echo beep",
|
|
19
|
+
"echo-sound-boop": "echo boop"
|
|
15
20
|
},
|
|
16
21
|
"repository": {
|
|
17
22
|
"type": "git",
|
|
@@ -32,10 +37,11 @@
|
|
|
32
37
|
},
|
|
33
38
|
"homepage": "https://github.com/kimmobrunfeldt/concurrently",
|
|
34
39
|
"dependencies": {
|
|
35
|
-
"chalk": "
|
|
40
|
+
"chalk": "^2.4.1",
|
|
36
41
|
"commander": "2.6.0",
|
|
37
42
|
"date-fns": "^1.23.0",
|
|
38
43
|
"lodash": "^4.5.1",
|
|
44
|
+
"read-pkg": "^3.0.0",
|
|
39
45
|
"rx": "2.3.24",
|
|
40
46
|
"spawn-command": "^0.0.2-1",
|
|
41
47
|
"supports-color": "^3.2.3",
|
|
@@ -43,12 +49,14 @@
|
|
|
43
49
|
},
|
|
44
50
|
"devDependencies": {
|
|
45
51
|
"chai": "^1.10.0",
|
|
52
|
+
"eslint": "^4.19.1",
|
|
46
53
|
"mocha": "^2.1.0",
|
|
47
54
|
"mustache": "^1.0.0",
|
|
48
55
|
"releasor": "^1.2.1",
|
|
49
56
|
"semver": "^4.2.0",
|
|
50
57
|
"shell-quote": "^1.4.3",
|
|
51
58
|
"shelljs": "^0.3.0",
|
|
59
|
+
"sinon": "^4.1.3",
|
|
52
60
|
"string": "^3.0.0"
|
|
53
61
|
}
|
|
54
62
|
}
|
package/src/findChild.js
ADDED