@lerna/child-process
Advanced tools
Comparing version 3.14.2 to 3.16.5
@@ -6,2 +6,13 @@ # Change Log | ||
## [3.16.5](https://github.com/lerna/lerna/compare/v3.16.4...v3.16.5) (2019-10-07) | ||
### Bug Fixes | ||
* **child-process:** Use Set to manage book-keeping instead of mutable integer ([5dbea32](https://github.com/lerna/lerna/commit/5dbea32)) | ||
## [3.14.2](https://github.com/lerna/lerna/compare/v3.14.1...v3.14.2) (2019-06-09) | ||
@@ -8,0 +19,0 @@ |
18
index.js
@@ -9,5 +9,5 @@ "use strict"; | ||
// bookkeeping for spawned processes | ||
let children = 0; | ||
const children = new Set(); | ||
// when streaming children are spawned, use this color for prefix | ||
// when streaming processes are spawned, use this color for prefix | ||
const colorWheel = ["cyan", "magenta", "blue", "yellow", "green", "red"]; | ||
@@ -58,5 +58,5 @@ const NUM_COLORS = colorWheel.length; | ||
// Avoid "Possible EventEmitter memory leak detected" warning due to piped stdio | ||
if (children > process.stdout.listenerCount("close")) { | ||
process.stdout.setMaxListeners(children); | ||
process.stderr.setMaxListeners(children); | ||
if (children.size > process.stdout.listenerCount("close")) { | ||
process.stdout.setMaxListeners(children.size); | ||
process.stderr.setMaxListeners(children.size); | ||
} | ||
@@ -71,3 +71,3 @@ | ||
function getChildProcessCount() { | ||
return children; | ||
return children.size; | ||
} | ||
@@ -92,7 +92,5 @@ | ||
function spawnProcess(command, args, opts) { | ||
children += 1; | ||
const child = execa(command, args, opts); | ||
const drain = (code, signal) => { | ||
children -= 1; | ||
children.delete(child); | ||
@@ -112,2 +110,4 @@ // don't run repeatedly if this is the error event | ||
children.add(child); | ||
return child; | ||
@@ -114,0 +114,0 @@ } |
{ | ||
"name": "@lerna/child-process", | ||
"version": "3.14.2", | ||
"version": "3.16.5", | ||
"description": "Lerna's internal child_process wrapper", | ||
@@ -38,3 +38,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "b22345b9870f62f1125e109fcc47d2e4260b9d09" | ||
"gitHead": "f0574092a2db90142b3a27ec1a4941cddbdcdf62" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9087