From 165a837dc80d814239ee6c71163578cae640fc3e Mon Sep 17 00:00:00 2001 From: Justin Bennett Date: Wed, 7 Apr 2021 17:37:17 -0400 Subject: [PATCH 1/2] Prefer npx over yarn for running lerna commands --- plugins/npm/src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/npm/src/index.ts b/plugins/npm/src/index.ts index 2acae069c..283857019 100644 --- a/plugins/npm/src/index.ts +++ b/plugins/npm/src/index.ts @@ -379,7 +379,7 @@ const getIndependentNextReleases = async ( ) => { const packages = await getLernaPackages(); const [, changedPackagesResult = ""] = await on( - execPromise("yarn", ["lerna", "changed", "-a"]) + execPromise("npx", ["lerna", "changed", "-a"]) ); const changedPackages = changedPackagesResult .split("\n") @@ -688,7 +688,7 @@ export default class NPMPlugin implements IPlugin { // made, so no release will be made. if (isIndependent) { try { - await execPromise("yarn", ["lerna", "updated", "-a"]); + await execPromise("npx", ["lerna", "updated", "-a"]); } catch (error) { auto.logger.log.warn( "Lerna detected no changes in project. Aborting release since nothing would be published." @@ -836,7 +836,7 @@ export default class NPMPlugin implements IPlugin { } const [, changedPackagesResult = ""] = await on( - execPromise("yarn", ["lerna", "changed"]) + execPromise("npx", ["lerna", "changed"]) ); const changedPackages = changedPackagesResult.split("\n"); From 8f3197cd42142881832c50d5475f72d2aa63cdb0 Mon Sep 17 00:00:00 2001 From: Justin Bennett Date: Wed, 7 Apr 2021 17:46:41 -0400 Subject: [PATCH 2/2] Fix tests referencing yarn --- plugins/npm/__tests__/npm-next.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/npm/__tests__/npm-next.test.ts b/plugins/npm/__tests__/npm-next.test.ts index 2a4338540..82d3ca6fc 100644 --- a/plugins/npm/__tests__/npm-next.test.ts +++ b/plugins/npm/__tests__/npm-next.test.ts @@ -513,7 +513,7 @@ describe("next", () => { ); } - if (command === "yarn" && args[0] === "lerna" && args[1] === "changed") { + if (command === "npx" && args[0] === "lerna" && args[1] === "changed") { return Promise.resolve("@foo/foo\n@foo/foo-bar"); } @@ -596,7 +596,7 @@ describe("next", () => { ); } - if (command === "yarn" && args[0] === "lerna" && args[1] === "changed") { + if (command === "npx" && args[0] === "lerna" && args[1] === "changed") { return Promise.resolve("@foo/foo\n@foo/foo-bar"); } @@ -666,7 +666,7 @@ describe("next", () => { return Promise.resolve("@foo/foo@1.0.0-next.0"); } - if (command === "yarn" && args[0] === "lerna" && args[1] === "changed") { + if (command === "npx" && args[0] === "lerna" && args[1] === "changed") { return Promise.resolve("@foo/foo (PRIVATE)"); }