From e25559322bbb4da7925406c44e826413287e509c Mon Sep 17 00:00:00 2001 From: Jihun Lee Date: Mon, 23 May 2022 05:47:16 +0900 Subject: [PATCH 1/2] fix(libnpmexec): fix bug not install latest pkg --- workspaces/libnpmexec/lib/index.js | 2 +- workspaces/libnpmexec/test/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/workspaces/libnpmexec/lib/index.js b/workspaces/libnpmexec/lib/index.js index fbe5c5520c381..928afa5b89516 100644 --- a/workspaces/libnpmexec/lib/index.js +++ b/workspaces/libnpmexec/lib/index.js @@ -166,7 +166,7 @@ const exec = async (opts) => { const add = manis .filter(mani => !mani[_localManifest]) .filter(filterMissingPackagesFromInstallDir) - .map(mani => mani._from) + .map(mani => mani._id ? mani._id : mani._from) .sort((a, b) => a.localeCompare(b, 'en')) // no need to install if already present diff --git a/workspaces/libnpmexec/test/index.js b/workspaces/libnpmexec/test/index.js index 834dcff0a1ff6..a64425898db6e 100644 --- a/workspaces/libnpmexec/test/index.js +++ b/workspaces/libnpmexec/test/index.js @@ -657,7 +657,7 @@ t.test('no prompt if CI, multiple packages', async t => { warn (title, msg) { t.equal(title, 'exec', 'should warn exec title') const expected = 'The following packages were not found and will be ' + - 'installed: @ruyadorno/create-index, @ruyadorno/create-test' + 'installed: @ruyadorno/create-index@1.0.0, @ruyadorno/create-test@1.0.0' t.equal(msg, expected, 'should warn installing pkg') }, }, From f68ef8eb3acf0fbce91df59ac73ce470944bdfcf Mon Sep 17 00:00:00 2001 From: Jihun Lee Date: Mon, 23 May 2022 06:18:43 +0900 Subject: [PATCH 2/2] chore: simplify code Co-authored-by: Jordan Harband --- workspaces/libnpmexec/lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workspaces/libnpmexec/lib/index.js b/workspaces/libnpmexec/lib/index.js index 928afa5b89516..dfe7560120702 100644 --- a/workspaces/libnpmexec/lib/index.js +++ b/workspaces/libnpmexec/lib/index.js @@ -166,7 +166,7 @@ const exec = async (opts) => { const add = manis .filter(mani => !mani[_localManifest]) .filter(filterMissingPackagesFromInstallDir) - .map(mani => mani._id ? mani._id : mani._from) + .map(mani => mani._id || mani._from) .sort((a, b) => a.localeCompare(b, 'en')) // no need to install if already present