@lerna/command
Advanced tools
Comparing version 3.21.0 to 4.0.0
@@ -6,2 +6,30 @@ # Change Log | ||
# [4.0.0](https://github.com/lerna/lerna/compare/v3.22.1...v4.0.0) (2021-02-10) | ||
### Features | ||
* **deps:** execa@^5.0.0 ([d8100fd](https://github.com/lerna/lerna/commit/d8100fd9e0742b049ed16ac77e976ce34234ebfc)) | ||
* Consume named exports of sibling modules ([63499e3](https://github.com/lerna/lerna/commit/63499e33652bc78fe23751875d74017e2f16a689)) | ||
* Drop support for Node v6.x & v8.x ([ff4bb4d](https://github.com/lerna/lerna/commit/ff4bb4da215555e3bb136f5af09b5cbc631e57bb)) | ||
* Expose named export ([c1303f1](https://github.com/lerna/lerna/commit/c1303f13adc4cf15f96ff25889b52149f8224c0e)) | ||
* Remove default export ([e2f1ec3](https://github.com/lerna/lerna/commit/e2f1ec3dd049d2a89880029908a2aa7c66f15082)) | ||
* **deps:** execa@^4.1.0 ([9051dca](https://github.com/lerna/lerna/commit/9051dcab1a68b56db09b82ab0345c5f36bcfee2d)) | ||
### BREAKING CHANGES | ||
* The default export has been removed, please use a named export instead. | ||
* Node v6.x & v8.x are no longer supported. Please upgrade to the latest LTS release. | ||
Here's the gnarly one-liner I used to make these changes: | ||
``` | ||
npx lerna exec --concurrency 1 --stream -- 'json -I -f package.json -e '"'"'this.engines=this.engines||{};this.engines.node=">= 10.18.0"'"'" | ||
``` | ||
(requires `npm i -g json` beforehand) | ||
# [3.21.0](https://github.com/lerna/lerna/compare/v3.20.2...v3.21.0) (2020-05-13) | ||
@@ -8,0 +36,0 @@ |
32
index.js
@@ -9,11 +9,11 @@ "use strict"; | ||
const PackageGraph = require("@lerna/package-graph"); | ||
const Project = require("@lerna/project"); | ||
const writeLogFile = require("@lerna/write-log-file"); | ||
const ValidationError = require("@lerna/validation-error"); | ||
const { PackageGraph } = require("@lerna/package-graph"); | ||
const { Project } = require("@lerna/project"); | ||
const { writeLogFile } = require("@lerna/write-log-file"); | ||
const { ValidationError } = require("@lerna/validation-error"); | ||
const cleanStack = require("./lib/clean-stack"); | ||
const defaultOptions = require("./lib/default-options"); | ||
const logPackageError = require("./lib/log-package-error"); | ||
const warnIfHanging = require("./lib/warn-if-hanging"); | ||
const { cleanStack } = require("./lib/clean-stack"); | ||
const { defaultOptions } = require("./lib/default-options"); | ||
const { logPackageError } = require("./lib/log-package-error"); | ||
const { warnIfHanging } = require("./lib/warn-if-hanging"); | ||
@@ -58,3 +58,3 @@ const DEFAULT_CONCURRENCY = os.cpus().length; | ||
chain.then( | ||
result => { | ||
(result) => { | ||
warnIfHanging(); | ||
@@ -64,3 +64,3 @@ | ||
}, | ||
err => { | ||
(err) => { | ||
if (err.pkg) { | ||
@@ -165,3 +165,3 @@ // Cleanly log specific package error details | ||
// The current command always overrides otherCommandConfigs | ||
const overrides = [this.name, ...this.otherCommandConfigs].map(key => commandConfig[key]); | ||
const overrides = [this.name, ...this.otherCommandConfigs].map((key) => commandConfig[key]); | ||
@@ -185,2 +185,4 @@ this.options = defaultOptions( | ||
this.toposort = sort === undefined || sort; | ||
/** @type {import("@lerna/child-process").ExecOpts} */ | ||
this.execOpts = { | ||
@@ -227,3 +229,3 @@ cwd: this.project.rootPath, | ||
return execa.sync("git", ["rev-parse"], opts).code === 0; | ||
return execa.sync("git", ["rev-parse"], opts).exitCode === 0; | ||
} | ||
@@ -269,3 +271,3 @@ | ||
chain = chain.then(() => this.project.getPackages()); | ||
chain = chain.then(packages => { | ||
chain = chain.then((packages) => { | ||
this.packageGraph = new PackageGraph(packages); | ||
@@ -280,3 +282,3 @@ }); | ||
.then(() => this.initialize()) | ||
.then(proceed => { | ||
.then((proceed) => { | ||
if (proceed !== false) { | ||
@@ -298,2 +300,2 @@ return this.execute(); | ||
module.exports = Command; | ||
module.exports.Command = Command; |
"use strict"; | ||
module.exports = cleanStack; | ||
module.exports.cleanStack = cleanStack; | ||
/** | ||
* @param {import("execa").ExecaError} err | ||
* @param {string} className | ||
*/ | ||
function cleanStack(err, className) { | ||
const lines = err.stack ? err.stack.split("\n") : String(err).split("\n"); | ||
const cutoff = new RegExp(`^ at ${className}.runCommand .*$`); | ||
const relevantIndex = lines.findIndex(line => cutoff.test(line)); | ||
const relevantIndex = lines.findIndex((line) => cutoff.test(line)); | ||
@@ -10,0 +14,0 @@ if (relevantIndex) { |
"use strict"; | ||
module.exports = defaultOptions; | ||
module.exports.defaultOptions = defaultOptions; | ||
@@ -5,0 +5,0 @@ // _.defaults(), but simplified: |
@@ -5,6 +5,10 @@ "use strict"; | ||
module.exports = logPackageError; | ||
module.exports.logPackageError = logPackageError; | ||
/** | ||
* @param {import("execa").ExecaError & { pkg: import("@lerna/package").Package }} err | ||
* @param {boolean} stream | ||
*/ | ||
function logPackageError(err, stream = false) { | ||
log.error(err.cmd, `exited ${err.code} in '${err.pkg.name}'`); | ||
log.error(err.command, `exited ${err.exitCode} in '${err.pkg.name}'`); | ||
@@ -17,3 +21,3 @@ if (stream) { | ||
if (err.stdout) { | ||
log.error(err.cmd, "stdout:"); | ||
log.error(err.command, "stdout:"); | ||
directLog(err.stdout); | ||
@@ -23,3 +27,3 @@ } | ||
if (err.stderr) { | ||
log.error(err.cmd, "stderr:"); | ||
log.error(err.command, "stderr:"); | ||
directLog(err.stderr); | ||
@@ -29,5 +33,6 @@ } | ||
// Below is just to ensure something sensible is printed after the long stream of logs | ||
log.error(err.cmd, `exited ${err.code} in '${err.pkg.name}'`); | ||
log.error(err.command, `exited ${err.exitCode} in '${err.pkg.name}'`); | ||
} | ||
/** @param {string} message */ | ||
function directLog(message) { | ||
@@ -34,0 +39,0 @@ log.pause(); |
"use strict"; | ||
const log = require("npmlog"); | ||
const ChildProcessUtilities = require("@lerna/child-process"); | ||
const childProcess = require("@lerna/child-process"); | ||
module.exports = warnIfHanging; | ||
module.exports.warnIfHanging = warnIfHanging; | ||
function warnIfHanging() { | ||
const childProcessCount = ChildProcessUtilities.getChildProcessCount(); | ||
const childProcessCount = childProcess.getChildProcessCount(); | ||
@@ -11,0 +11,0 @@ if (childProcessCount > 0) { |
{ | ||
"name": "@lerna/command", | ||
"version": "3.21.0", | ||
"version": "4.0.0", | ||
"description": "Lerna's internal base class for commands", | ||
@@ -21,3 +21,3 @@ "keywords": [ | ||
"engines": { | ||
"node": ">= 6.9.0" | ||
"node": ">= 10.18.0" | ||
}, | ||
@@ -36,14 +36,14 @@ "publishConfig": { | ||
"dependencies": { | ||
"@lerna/child-process": "3.16.5", | ||
"@lerna/package-graph": "3.18.5", | ||
"@lerna/project": "3.21.0", | ||
"@lerna/validation-error": "3.13.0", | ||
"@lerna/write-log-file": "3.13.0", | ||
"@lerna/child-process": "4.0.0", | ||
"@lerna/package-graph": "4.0.0", | ||
"@lerna/project": "4.0.0", | ||
"@lerna/validation-error": "4.0.0", | ||
"@lerna/write-log-file": "4.0.0", | ||
"clone-deep": "^4.0.1", | ||
"dedent": "^0.7.0", | ||
"execa": "^1.0.0", | ||
"execa": "^5.0.0", | ||
"is-ci": "^2.0.0", | ||
"npmlog": "^4.1.2" | ||
}, | ||
"gitHead": "3367257cabe1540a3b9468acbfa0d01ba391077d" | ||
"gitHead": "4582c476e07dddddd6b2e3ab6e7f52c1f9eed59a" | ||
} |
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
28260
316
+ Added@babel/code-frame@7.26.2(transitive)
+ Added@babel/helper-validator-identifier@7.25.9(transitive)
+ Added@lerna/child-process@4.0.0(transitive)
+ Added@lerna/package@4.0.0(transitive)
+ Added@lerna/package-graph@4.0.0(transitive)
+ Added@lerna/prerelease-id-from-version@4.0.0(transitive)
+ Added@lerna/project@4.0.0(transitive)
+ Added@lerna/validation-error@4.0.0(transitive)
+ Added@lerna/write-log-file@4.0.0(transitive)
+ Added@nodelib/fs.scandir@2.1.5(transitive)
+ Added@nodelib/fs.stat@2.0.5(transitive)
+ Added@nodelib/fs.walk@1.2.8(transitive)
+ Added@types/parse-json@4.0.2(transitive)
+ Addedaggregate-error@3.1.0(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedarray-union@2.1.0(transitive)
+ Addedbraces@3.0.3(transitive)
+ Addedcallsites@3.1.0(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedclean-stack@2.2.0(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedcosmiconfig@7.1.0(transitive)
+ Addedcross-spawn@7.0.3(transitive)
+ Addeddetect-indent@6.1.0(transitive)
+ Addeddir-glob@3.0.1(transitive)
+ Addeddot-prop@6.0.1(transitive)
+ Addedexeca@5.1.1(transitive)
+ Addedfast-glob@3.3.2(transitive)
+ Addedfastq@1.17.1(transitive)
+ Addedfill-range@7.1.1(transitive)
+ Addedget-stream@6.0.1(transitive)
+ Addedglobby@11.1.0(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedhosted-git-info@4.1.0(transitive)
+ Addedhuman-signals@2.1.0(transitive)
+ Addedignore@5.3.2(transitive)
+ Addedimport-fresh@3.3.0(transitive)
+ Addedindent-string@4.0.0(transitive)
+ Addedis-number@7.0.0(transitive)
+ Addedis-obj@2.0.0(transitive)
+ Addedis-plain-obj@2.1.0(transitive)
+ Addedis-stream@2.0.1(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedjson-parse-even-better-errors@2.3.1(transitive)
+ Addedlines-and-columns@1.2.4(transitive)
+ Addedload-json-file@6.2.0(transitive)
+ Addedlru-cache@6.0.0(transitive)
+ Addedmake-dir@3.1.0(transitive)
+ Addedmerge-stream@2.0.0(transitive)
+ Addedmicromatch@4.0.8(transitive)
+ Addedmimic-fn@2.1.0(transitive)
+ Addednpm-package-arg@8.1.5(transitive)
+ Addednpm-run-path@4.0.1(transitive)
+ Addedonetime@5.1.2(transitive)
+ Addedp-map@4.0.0(transitive)
+ Addedparent-module@1.0.1(transitive)
+ Addedparse-json@5.2.0(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedpath-type@4.0.0(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedpicomatch@2.3.1(transitive)
+ Addedqueue-microtask@1.2.3(transitive)
+ Addedresolve-from@5.0.0(transitive)
+ Addedreusify@1.0.4(transitive)
+ Addedrun-parallel@1.2.0(transitive)
+ Addedsemver@7.6.3(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedslash@3.0.0(transitive)
+ Addedsort-keys@4.2.0(transitive)
+ Addedstrip-bom@4.0.0(transitive)
+ Addedstrip-final-newline@2.0.0(transitive)
+ Addedsupports-color@7.2.0(transitive)
+ Addedto-regex-range@5.0.1(transitive)
+ Addedtype-fest@0.4.10.6.0(transitive)
+ Addedtypedarray-to-buffer@3.1.5(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedwrite-file-atomic@3.0.3(transitive)
+ Addedwrite-json-file@4.3.0(transitive)
+ Addedwrite-pkg@4.0.0(transitive)
+ Addedyallist@4.0.0(transitive)
+ Addedyaml@1.10.2(transitive)
- Removed@lerna/child-process@3.16.5(transitive)
- Removed@lerna/package@3.16.0(transitive)
- Removed@lerna/package-graph@3.18.5(transitive)
- Removed@lerna/prerelease-id-from-version@3.16.0(transitive)
- Removed@lerna/project@3.21.0(transitive)
- Removed@lerna/validation-error@3.13.0(transitive)
- Removed@lerna/write-log-file@3.13.0(transitive)
- Removed@mrmlnc/readdir-enhanced@2.2.1(transitive)
- Removed@nodelib/fs.stat@1.1.3(transitive)
- Removed@types/glob@7.2.0(transitive)
- Removed@types/minimatch@5.1.2(transitive)
- Removed@types/node@22.9.0(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedargparse@1.0.10(transitive)
- Removedarr-diff@4.0.0(transitive)
- Removedarr-flatten@1.1.0(transitive)
- Removedarr-union@3.1.0(transitive)
- Removedarray-union@1.0.2(transitive)
- Removedarray-uniq@1.0.3(transitive)
- Removedarray-unique@0.3.2(transitive)
- Removedassign-symbols@1.0.0(transitive)
- Removedatob@2.1.2(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbase@0.11.2(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedbraces@2.3.2(transitive)
- Removedcache-base@1.0.1(transitive)
- Removedcall-me-maybe@1.0.2(transitive)
- Removedcaller-callsite@2.0.0(transitive)
- Removedcaller-path@2.0.0(transitive)
- Removedcallsites@2.0.0(transitive)
- Removedchalk@2.4.2(transitive)
- Removedclass-utils@0.3.6(transitive)
- Removedcollection-visit@1.0.0(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedcomponent-emitter@1.3.1(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedcopy-descriptor@0.1.1(transitive)
- Removedcosmiconfig@5.2.1(transitive)
- Removedcross-spawn@6.0.5(transitive)
- Removeddebug@2.6.9(transitive)
- Removeddecode-uri-component@0.2.2(transitive)
- Removeddefine-property@0.2.51.0.02.0.2(transitive)
- Removeddir-glob@2.2.2(transitive)
- Removeddot-prop@4.2.1(transitive)
- Removedend-of-stream@1.4.4(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedesprima@4.0.1(transitive)
- Removedexeca@1.0.0(transitive)
- Removedexpand-brackets@2.1.4(transitive)
- Removedextend-shallow@2.0.13.0.2(transitive)
- Removedextglob@2.0.4(transitive)
- Removedfast-glob@2.2.7(transitive)
- Removedfill-range@4.0.0(transitive)
- Removedfor-in@1.0.2(transitive)
- Removedfragment-cache@0.2.1(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-stream@4.1.0(transitive)
- Removedget-value@2.0.6(transitive)
- Removedglob@7.2.3(transitive)
- Removedglob-parent@3.1.0(transitive)
- Removedglob-to-regexp@0.3.0(transitive)
- Removedglobby@9.2.0(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedhas-value@0.3.11.0.0(transitive)
- Removedhas-values@0.1.41.0.0(transitive)
- Removedhasown@2.0.2(transitive)
- Removedhosted-git-info@2.8.9(transitive)
- Removedignore@4.0.6(transitive)
- Removedimport-fresh@2.0.0(transitive)
- Removedinflight@1.0.6(transitive)
- Removedis-accessor-descriptor@1.0.1(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedis-data-descriptor@1.0.1(transitive)
- Removedis-descriptor@0.1.71.0.3(transitive)
- Removedis-directory@0.3.1(transitive)
- Removedis-extendable@0.1.11.0.1(transitive)
- Removedis-glob@3.1.0(transitive)
- Removedis-number@3.0.0(transitive)
- Removedis-obj@1.0.1(transitive)
- Removedis-stream@1.1.0(transitive)
- Removedis-windows@1.0.2(transitive)
- Removedisobject@2.1.0(transitive)
- Removedjs-yaml@3.14.1(transitive)
- Removedjson-parse-better-errors@1.0.2(transitive)
- Removedkind-of@3.2.24.0.0(transitive)
- Removedload-json-file@5.3.0(transitive)
- Removedmake-dir@1.3.0(transitive)
- Removedmap-cache@0.2.2(transitive)
- Removedmap-visit@1.0.0(transitive)
- Removedmicromatch@3.1.10(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedmixin-deep@1.3.2(transitive)
- Removedms@2.0.0(transitive)
- Removednanomatch@1.2.13(transitive)
- Removednice-try@1.0.5(transitive)
- Removednpm-package-arg@6.1.1(transitive)
- Removednpm-run-path@2.0.2(transitive)
- Removedobject-copy@0.1.0(transitive)
- Removedobject-visit@1.0.1(transitive)
- Removedobject.pick@1.3.0(transitive)
- Removedonce@1.4.0(transitive)
- Removedos-homedir@1.0.2(transitive)
- Removedos-tmpdir@1.0.2(transitive)
- Removedosenv@0.1.5(transitive)
- Removedp-finally@1.0.0(transitive)
- Removedp-map@2.1.0(transitive)
- Removedparse-json@4.0.0(transitive)
- Removedpascalcase@0.1.1(transitive)
- Removedpath-dirname@1.0.2(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedpath-key@2.0.1(transitive)
- Removedpath-type@3.0.0(transitive)
- Removedpify@3.0.0(transitive)
- Removedposix-character-classes@0.1.1(transitive)
- Removedpump@3.0.2(transitive)
- Removedregex-not@1.0.2(transitive)
- Removedrepeat-element@1.1.4(transitive)
- Removedrepeat-string@1.6.1(transitive)
- Removedresolve-from@3.0.0(transitive)
- Removedresolve-url@0.2.1(transitive)
- Removedret@0.1.15(transitive)
- Removedsafe-regex@1.1.0(transitive)
- Removedset-value@2.0.1(transitive)
- Removedshebang-command@1.2.0(transitive)
- Removedshebang-regex@1.0.0(transitive)
- Removedslash@2.0.0(transitive)
- Removedsnapdragon@0.8.2(transitive)
- Removedsnapdragon-node@2.1.1(transitive)
- Removedsnapdragon-util@3.0.1(transitive)
- Removedsource-map@0.5.7(transitive)
- Removedsource-map-resolve@0.5.3(transitive)
- Removedsource-map-url@0.4.1(transitive)
- Removedsplit-string@3.1.0(transitive)
- Removedsprintf-js@1.0.3(transitive)
- Removedstatic-extend@0.1.2(transitive)
- Removedstrip-bom@3.0.0(transitive)
- Removedstrip-eof@1.0.0(transitive)
- Removedsupports-color@5.5.0(transitive)
- Removedto-object-path@0.3.0(transitive)
- Removedto-regex@3.0.2(transitive)
- Removedto-regex-range@2.1.1(transitive)
- Removedtype-fest@0.3.1(transitive)
- Removedundici-types@6.19.8(transitive)
- Removedunion-value@1.0.1(transitive)
- Removedunset-value@1.0.0(transitive)
- Removedurix@0.1.0(transitive)
- Removeduse@3.1.1(transitive)
- Removedwhich@1.3.1(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedwrite-json-file@2.3.0(transitive)
- Removedwrite-pkg@3.2.0(transitive)
Updated@lerna/child-process@4.0.0
Updated@lerna/package-graph@4.0.0
Updated@lerna/project@4.0.0
Updated@lerna/write-log-file@4.0.0
Updatedexeca@^5.0.0