Socket
Socket
Sign inDemoInstall

@lerna/command

Package Overview
Dependencies
Maintainers
2
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lerna/command - npm Package Compare versions

Comparing version 3.21.0 to 4.0.0

28

CHANGELOG.md

@@ -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"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc