@lerna/run-lifecycle
Advanced tools
Comparing version 5.2.0 to 5.3.0
{ | ||
"name": "@lerna/run-lifecycle", | ||
"version": "5.2.0", | ||
"version": "5.3.0", | ||
"description": "An internal Lerna tool", | ||
@@ -34,7 +34,8 @@ "keywords": [ | ||
"dependencies": { | ||
"@lerna/npm-conf": "5.2.0", | ||
"@npmcli/run-script": "^3.0.2", | ||
"npmlog": "^6.0.2" | ||
"@lerna/npm-conf": "5.3.0", | ||
"@npmcli/run-script": "^4.1.7", | ||
"npmlog": "^6.0.2", | ||
"p-queue": "^6.6.2" | ||
}, | ||
"gitHead": "4f43ba15b0024f87ec04c68522c78bcd1edbc185" | ||
"gitHead": "535afac9b27892e8e5354aae950338a7187356f2" | ||
} |
@@ -8,3 +8,6 @@ // @ts-check | ||
const npmConf = require("@lerna/npm-conf"); | ||
const PQueue = require("p-queue").default; | ||
const queue = new PQueue({ concurrency: 1 }); | ||
module.exports.runLifecycle = runLifecycle; | ||
@@ -22,2 +25,3 @@ module.exports.createRunner = createRunner; | ||
* @property {boolean} [unsafePerm=true] | ||
* @property {string} [stdio] | ||
*/ | ||
@@ -120,5 +124,5 @@ | ||
* In order to match the previous behavior of "npm-lifecycle", we have to disable the writing | ||
* to the parent process and print the command banner ourself. | ||
* to the parent process and print the command banner ourselves, unless overridden by the options. | ||
*/ | ||
const stdio = "pipe"; | ||
const stdio = opts.stdio || "pipe"; | ||
if (log.level !== "silent") { | ||
@@ -128,38 +132,42 @@ printCommandBanner(id, stage, pkg.scripts[stage], dir); | ||
return runScript({ | ||
event: stage, | ||
path: dir, | ||
pkg, | ||
args: [], | ||
stdio, | ||
banner: false, | ||
scriptShell: config.scriptShell, | ||
}).then( | ||
({ stdout }) => { | ||
/** | ||
* This adjustment is based on trying to match the existing integration test outputs when migrating | ||
* from "npm-lifecycle" to "@npmcli/run-script". | ||
*/ | ||
// eslint-disable-next-line no-console | ||
console.log(stdout.toString().trimEnd()); | ||
return queue.add(async () => | ||
runScript({ | ||
event: stage, | ||
path: dir, | ||
pkg, | ||
args: [], | ||
stdio, | ||
banner: false, | ||
scriptShell: config.scriptShell, | ||
}).then( | ||
({ stdout }) => { | ||
if (stdout) { | ||
/** | ||
* This adjustment is based on trying to match the existing integration test outputs when migrating | ||
* from "npm-lifecycle" to "@npmcli/run-script". | ||
*/ | ||
// eslint-disable-next-line no-console | ||
console.log(stdout.toString().trimEnd()); | ||
} | ||
opts.log.silly("lifecycle", "%j finished in %j", stage, pkg.name); | ||
}, | ||
(err) => { | ||
// propagate the exit code | ||
const exitCode = err.code || 1; | ||
opts.log.silly("lifecycle", "%j finished in %j", stage, pkg.name); | ||
}, | ||
(err) => { | ||
// propagate the exit code | ||
const exitCode = err.code || 1; | ||
// error logging has already occurred on stderr, but we need to stop the chain | ||
log.error("lifecycle", "%j errored in %j, exiting %d", stage, pkg.name, exitCode); | ||
// error logging has already occurred on stderr, but we need to stop the chain | ||
log.error("lifecycle", "%j errored in %j, exiting %d", stage, pkg.name, exitCode); | ||
// ensure clean logging, avoiding spurious log dump | ||
err.name = "ValidationError"; | ||
// ensure clean logging, avoiding spurious log dump | ||
err.name = "ValidationError"; | ||
// our yargs.fail() handler expects a numeric .exitCode, not .errno | ||
err.exitCode = exitCode; | ||
process.exitCode = exitCode; | ||
// our yargs.fail() handler expects a numeric .exitCode, not .errno | ||
err.exitCode = exitCode; | ||
process.exitCode = exitCode; | ||
// stop the chain | ||
throw err; | ||
} | ||
// stop the chain | ||
throw err; | ||
} | ||
) | ||
); | ||
@@ -166,0 +174,0 @@ } |
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
7412
147
4
+ Addedp-queue@^6.6.2
+ Added@lerna/npm-conf@5.3.0(transitive)
+ Added@npmcli/fs@2.1.2(transitive)
+ Added@npmcli/move-file@2.0.1(transitive)
+ Added@npmcli/run-script@4.2.1(transitive)
+ Added@tootallnate/once@2.0.0(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedcacache@16.1.3(transitive)
+ Addedeventemitter3@4.0.7(transitive)
+ Addedexponential-backoff@3.1.1(transitive)
+ Addedglob@8.1.0(transitive)
+ Addedhttp-proxy-agent@5.0.0(transitive)
+ Addedlru-cache@7.18.3(transitive)
+ Addedmake-fetch-happen@10.2.1(transitive)
+ Addedminimatch@5.1.6(transitive)
+ Addedminipass-fetch@2.1.2(transitive)
+ Addednode-gyp@9.4.1(transitive)
+ Addednopt@6.0.0(transitive)
+ Addedp-finally@1.0.0(transitive)
+ Addedp-queue@6.6.2(transitive)
+ Addedp-timeout@3.2.0(transitive)
+ Addedsocks-proxy-agent@7.0.0(transitive)
+ Addedssri@9.0.1(transitive)
+ Addedunique-filename@2.0.1(transitive)
+ Addedunique-slug@3.0.0(transitive)
- Removed@lerna/npm-conf@5.2.0(transitive)
- Removed@npmcli/fs@1.1.1(transitive)
- Removed@npmcli/move-file@1.1.2(transitive)
- Removed@npmcli/run-script@3.0.3(transitive)
- Removed@tootallnate/once@1.1.2(transitive)
- Removedcacache@15.3.0(transitive)
- Removedhttp-proxy-agent@4.0.1(transitive)
- Removedlru-cache@6.0.0(transitive)
- Removedmake-fetch-happen@9.1.0(transitive)
- Removedminipass-fetch@1.4.1(transitive)
- Removednode-gyp@8.4.1(transitive)
- Removednopt@5.0.0(transitive)
- Removedsocks-proxy-agent@6.2.1(transitive)
- Removedssri@8.0.1(transitive)
- Removedunique-filename@1.1.1(transitive)
- Removedunique-slug@2.0.2(transitive)
Updated@lerna/npm-conf@5.3.0
Updated@npmcli/run-script@^4.1.7