@lerna/run-lifecycle
Advanced tools
Comparing version 4.0.0 to 5.0.0-alpha.0
{ | ||
"name": "@lerna/run-lifecycle", | ||
"version": "4.0.0", | ||
"version": "5.0.0-alpha.0", | ||
"description": "An internal Lerna tool", | ||
@@ -20,3 +20,3 @@ "keywords": [ | ||
"engines": { | ||
"node": ">= 10.18.0" | ||
"node": "^14.19.3 || >=16.0.0" | ||
}, | ||
@@ -35,7 +35,7 @@ "publishConfig": { | ||
"dependencies": { | ||
"@lerna/npm-conf": "4.0.0", | ||
"npm-lifecycle": "^3.1.5", | ||
"@lerna/npm-conf": "5.0.0-alpha.0", | ||
"@npmcli/run-script": "^3.0.2", | ||
"npmlog": "^4.1.2" | ||
}, | ||
"gitHead": "4582c476e07dddddd6b2e3ab6e7f52c1f9eed59a" | ||
"gitHead": "5451a79392742a6e942a845de1e46db0a41b1c2e" | ||
} |
@@ -0,5 +1,7 @@ | ||
// @ts-check | ||
"use strict"; | ||
const log = require("npmlog"); | ||
const runScript = require("npm-lifecycle"); | ||
const runScript = require("@npmcli/run-script"); | ||
const npmConf = require("@lerna/npm-conf"); | ||
@@ -39,2 +41,11 @@ | ||
/** | ||
* Adapted from https://github.com/npm/run-script/blob/bb5156063ea3a7e167a6d5435847d9389146ec89/lib/run-script-pkg.js#L9 | ||
* Modified to add back "path" and make it behave more like "npm-lifecycle" | ||
*/ | ||
function printCommandBanner(id, event, cmd, path) { | ||
// eslint-disable-next-line no-console | ||
return console.log(`\n> ${id ? `${id} ` : ""}${event} ${path}\n> ${cmd.trim().replace(/\n/g, "\n> ")}\n`); | ||
} | ||
/** | ||
* Run a lifecycle script for a package. | ||
@@ -59,2 +70,3 @@ * @param {import("@lerna/package").Package} pkg | ||
const dir = pkg.location; | ||
const id = `${pkg.name}@${pkg.version}`; | ||
const config = {}; | ||
@@ -97,19 +109,37 @@ | ||
// TODO: remove pkg._id when npm-lifecycle no longer relies on it | ||
pkg._id = `${pkg.name}@${pkg.version}`; // eslint-disable-line | ||
// _id is needed by @npmcli/run-script | ||
// eslint-disable-next-line no-underscore-dangle | ||
pkg._id = id; | ||
opts.log.silly("lifecycle", "%j starting in %j", stage, pkg.name); | ||
return runScript(pkg, stage, dir, { | ||
config, | ||
dir, | ||
failOk: false, | ||
log: opts.log, | ||
// bring along camelCased aliases | ||
nodeOptions: opts.nodeOptions, | ||
scriptShell: opts.scriptShell, | ||
scriptsPrependNodePath: opts.scriptsPrependNodePath, | ||
unsafePerm: opts.unsafePerm, | ||
// info log here to reproduce previous behavior when this was powered by "npm-lifecycle" | ||
opts.log.info("lifecycle", `${id}~${stage}: ${id}`); | ||
/** | ||
* 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. | ||
*/ | ||
const stdio = "pipe"; | ||
if (log.level !== "silent") { | ||
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()); | ||
opts.log.silly("lifecycle", "%j finished in %j", stage, pkg.name); | ||
@@ -119,3 +149,3 @@ }, | ||
// propagate the exit code | ||
const exitCode = err.errno || 1; | ||
const exitCode = err.code || 1; | ||
@@ -122,0 +152,0 @@ // error logging has already occurred on stderr, but we need to stop the chain |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
140
6063
3
2
1
+ Added@npmcli/run-script@^3.0.2
+ Added@gar/promisify@1.1.3(transitive)
+ Added@lerna/npm-conf@5.0.0-alpha.0(transitive)
+ Added@npmcli/fs@1.1.1(transitive)
+ Added@npmcli/move-file@1.1.2(transitive)
+ Added@npmcli/node-gyp@2.0.0(transitive)
+ Added@npmcli/promise-spawn@3.0.0(transitive)
+ Added@npmcli/run-script@3.0.3(transitive)
+ Added@tootallnate/once@1.1.2(transitive)
+ Addedagent-base@6.0.2(transitive)
+ Addedagentkeepalive@4.5.0(transitive)
+ Addedaggregate-error@3.1.0(transitive)
+ Addedansi-regex@5.0.1(transitive)
+ Addedaproba@2.0.0(transitive)
+ Addedare-we-there-yet@3.0.1(transitive)
+ Addedcacache@15.3.0(transitive)
+ Addedchownr@2.0.0(transitive)
+ Addedclean-stack@2.2.0(transitive)
+ Addedcolor-support@1.1.3(transitive)
+ Addeddebug@4.3.7(transitive)
+ Addedemoji-regex@8.0.0(transitive)
+ Addedencoding@0.1.13(transitive)
+ Addederr-code@2.0.3(transitive)
+ Addedfs-minipass@2.1.0(transitive)
+ Addedgauge@4.0.4(transitive)
+ Addedhttp-cache-semantics@4.1.1(transitive)
+ Addedhttp-proxy-agent@4.0.1(transitive)
+ Addedhttps-proxy-agent@5.0.1(transitive)
+ Addedhumanize-ms@1.2.1(transitive)
+ Addediconv-lite@0.6.3(transitive)
+ Addedimurmurhash@0.1.4(transitive)
+ Addedindent-string@4.0.0(transitive)
+ Addedinfer-owner@1.0.4(transitive)
+ Addedip-address@9.0.5(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedis-lambda@1.0.1(transitive)
+ Addedjsbn@1.1.0(transitive)
+ Addedjson-parse-even-better-errors@2.3.1(transitive)
+ Addedlru-cache@6.0.0(transitive)
+ Addedmake-fetch-happen@9.1.0(transitive)
+ Addedminipass@3.3.65.0.0(transitive)
+ Addedminipass-collect@1.0.2(transitive)
+ Addedminipass-fetch@1.4.1(transitive)
+ Addedminipass-flush@1.0.5(transitive)
+ Addedminipass-pipeline@1.2.4(transitive)
+ Addedminipass-sized@1.0.3(transitive)
+ Addedminizlib@2.1.2(transitive)
+ Addedmkdirp@1.0.4(transitive)
+ Addedms@2.1.3(transitive)
+ Addednegotiator@0.6.3(transitive)
+ Addednode-gyp@8.4.1(transitive)
+ Addednopt@5.0.0(transitive)
+ Addednpm-normalize-package-bin@1.0.1(transitive)
+ Addednpmlog@6.0.2(transitive)
+ Addedp-map@4.0.0(transitive)
+ Addedpromise-inflight@1.0.1(transitive)
+ Addedpromise-retry@2.0.1(transitive)
+ Addedread-package-json-fast@2.0.3(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedretry@0.12.0(transitive)
+ Addedrimraf@3.0.2(transitive)
+ Addedsemver@7.6.3(transitive)
+ Addedsmart-buffer@4.2.0(transitive)
+ Addedsocks@2.8.3(transitive)
+ Addedsocks-proxy-agent@6.2.1(transitive)
+ Addedsprintf-js@1.1.3(transitive)
+ Addedssri@8.0.1(transitive)
+ Addedstring-width@4.2.3(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedtar@6.2.1(transitive)
+ Addedunique-filename@1.1.1(transitive)
+ Addedunique-slug@2.0.2(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedyallist@4.0.0(transitive)
- Removednpm-lifecycle@^3.1.5
- Removed@lerna/npm-conf@4.0.0(transitive)
- Removedajv@6.12.6(transitive)
- Removedasn1@0.2.6(transitive)
- Removedassert-plus@1.0.0(transitive)
- Removedasynckit@0.4.0(transitive)
- Removedaws-sign2@0.7.0(transitive)
- Removedaws4@1.13.2(transitive)
- Removedbcrypt-pbkdf@1.0.2(transitive)
- Removedbyline@5.0.0(transitive)
- Removedcaseless@0.12.0(transitive)
- Removedchownr@1.1.4(transitive)
- Removedcombined-stream@1.0.8(transitive)
- Removedcore-util-is@1.0.2(transitive)
- Removeddashdash@1.14.1(transitive)
- Removeddelayed-stream@1.0.0(transitive)
- Removedecc-jsbn@0.1.2(transitive)
- Removedextend@3.0.2(transitive)
- Removedextsprintf@1.3.0(transitive)
- Removedfast-deep-equal@3.1.3(transitive)
- Removedfast-json-stable-stringify@2.1.0(transitive)
- Removedforever-agent@0.6.1(transitive)
- Removedform-data@2.3.3(transitive)
- Removedfs-minipass@1.2.7(transitive)
- Removedgetpass@0.1.7(transitive)
- Removedhar-schema@2.0.0(transitive)
- Removedhar-validator@5.1.5(transitive)
- Removedhttp-signature@1.2.0(transitive)
- Removedis-typedarray@1.0.0(transitive)
- Removedisstream@0.1.2(transitive)
- Removedjsbn@0.1.1(transitive)
- Removedjson-schema@0.4.0(transitive)
- Removedjson-schema-traverse@0.4.1(transitive)
- Removedjson-stringify-safe@5.0.1(transitive)
- Removedjsprim@1.4.2(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedminimist@1.2.8(transitive)
- Removedminipass@2.9.0(transitive)
- Removedminizlib@1.3.3(transitive)
- Removedmkdirp@0.5.6(transitive)
- Removednode-gyp@5.1.1(transitive)
- Removednopt@4.0.3(transitive)
- Removednpm-lifecycle@3.1.5(transitive)
- Removedoauth-sign@0.9.0(transitive)
- Removedos-homedir@1.0.2(transitive)
- Removedos-tmpdir@1.0.2(transitive)
- Removedosenv@0.1.5(transitive)
- Removedperformance-now@2.1.0(transitive)
- Removedpsl@1.9.0(transitive)
- Removedpunycode@2.3.1(transitive)
- Removedqs@6.5.3(transitive)
- Removedrequest@2.88.2(transitive)
- Removedresolve-from@4.0.0(transitive)
- Removedrimraf@2.7.1(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsemver@5.7.2(transitive)
- Removedslide@1.1.6(transitive)
- Removedsshpk@1.18.0(transitive)
- Removedtar@4.4.19(transitive)
- Removedtough-cookie@2.5.0(transitive)
- Removedtunnel-agent@0.6.0(transitive)
- Removedtweetnacl@0.14.5(transitive)
- Removeduid-number@0.0.6(transitive)
- Removedumask@1.1.0(transitive)
- Removeduri-js@4.4.1(transitive)
- Removeduuid@3.4.0(transitive)
- Removedverror@1.10.0(transitive)
- Removedwhich@1.3.1(transitive)
- Removedyallist@3.1.1(transitive)