From a4f9444b3ffedde6bf05a9cc3fa1c418028755b7 Mon Sep 17 00:00:00 2001 From: Anas AIT ALI Date: Tue, 15 Nov 2022 12:58:00 +0100 Subject: [PATCH 01/14] feat(packageresolution): add lockfileVersion 2+ packages support --- src/getPackageResolution.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/getPackageResolution.ts b/src/getPackageResolution.ts index afe6265b..ccfb3612 100644 --- a/src/getPackageResolution.ts +++ b/src/getPackageResolution.ts @@ -106,11 +106,17 @@ export function getPackageResolution({ } } lockFileStack.reverse() - const relevantStackEntry = lockFileStack.find( - (entry) => - entry.dependencies && packageDetails.name in entry.dependencies, - ) - const pkg = relevantStackEntry.dependencies[packageDetails.name] + const relevantStackEntry = lockFileStack.find((entry) => { + if (entry.dependencies) { + return entry.dependencies && packageDetails.name in entry.dependencies + } else if (entry.packages) { + return entry.packages && packageDetails.path in entry.packages + } + throw new Error("Cannot find dependencies or packages in lockfile") + }) + const pkg = relevantStackEntry.dependencies + ? relevantStackEntry.dependencies[packageDetails.name] + : relevantStackEntry.packages[packageDetails.path] return pkg.resolved || pkg.version || pkg.from } } @@ -120,7 +126,6 @@ if (require.main === module) { if (!packageDetails) { console.error(`Can't find package ${process.argv[2]}`) process.exit(1) - throw new Error() } console.log( getPackageResolution({ From 36949bd7196f2bf64bd6e3ffa8eb94566d4f5026 Mon Sep 17 00:00:00 2001 From: Anas AIT ALI Date: Fri, 2 Dec 2022 01:18:20 +0100 Subject: [PATCH 02/14] test(packageresolution): add lockfile version support integration tests --- .../__snapshots__/lockfile.test.ts.snap | 142 ++++++++++++++++++ integration-tests/lockfile/lockfile.sh | 33 ++++ integration-tests/lockfile/lockfile.test.ts | 2 + integration-tests/lockfile/package.json | 11 ++ integration-tests/lockfile/yarn.lock | 8 + 5 files changed, 196 insertions(+) create mode 100644 integration-tests/lockfile/__snapshots__/lockfile.test.ts.snap create mode 100755 integration-tests/lockfile/lockfile.sh create mode 100644 integration-tests/lockfile/lockfile.test.ts create mode 100644 integration-tests/lockfile/package.json create mode 100644 integration-tests/lockfile/yarn.lock diff --git a/integration-tests/lockfile/__snapshots__/lockfile.test.ts.snap b/integration-tests/lockfile/__snapshots__/lockfile.test.ts.snap new file mode 100644 index 00000000..872a1a74 --- /dev/null +++ b/integration-tests/lockfile/__snapshots__/lockfile.test.ts.snap @@ -0,0 +1,142 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Test lockfile: check patch with lockfile 1 1`] = ` +"SNAPSHOT: check patch with lockfile 1 +diff --git a/node_modules/left-pad/index.js b/node_modules/left-pad/index.js +index e90aec3..7f8fdaa 100644 +--- a/node_modules/left-pad/index.js ++++ b/node_modules/left-pad/index.js +@@ -22,9 +22,9 @@ var cache = [ + function leftPad (str, len, ch) { + // convert \`str\` to a \`string\` + str = str + ''; +- // \`len\` is the \`pad\`'s length now ++ // \`len\` is the \`npm\`'s length now + len = len - str.length; +- // doesn't need to pad ++ // doesn't need to npm + if (len <= 0) return str; + // \`ch\` defaults to \`' '\` + if (!ch && ch !== 0) ch = ' '; +@@ -32,12 +32,12 @@ function leftPad (str, len, ch) { + ch = ch + ''; + // cache common use cases + if (ch === ' ' && len < 10) return cache[len] + str; +- // \`pad\` starts with an empty string +- var pad = ''; ++ // \`npm\` starts with an empty string ++ var npm = ''; + // loop + while (true) { +- // add \`ch\` to \`pad\` if \`len\` is odd +- if (len & 1) pad += ch; ++ // add \`ch\` to \`npm\` if \`len\` is odd ++ if (len & 1) npm += ch; + // divide \`len\` by 2, ditch the remainder + len >>= 1; + // \\"double\\" the \`ch\` so this operation count grows logarithmically on \`len\` +@@ -47,6 +47,6 @@ function leftPad (str, len, ch) { + // \`len\` is 0, exit the loop + else break; + } +- // pad \`str\`! +- return pad + str; ++ // npm \`str\`! ++ return npm + str; + } +END SNAPSHOT" +`; + +exports[`Test lockfile: check patch with lockfile 2 1`] = ` +"SNAPSHOT: check patch with lockfile 2 +diff --git a/node_modules/left-pad/index.js b/node_modules/left-pad/index.js +index e90aec3..7f8fdaa 100644 +--- a/node_modules/left-pad/index.js ++++ b/node_modules/left-pad/index.js +@@ -22,9 +22,9 @@ var cache = [ + function leftPad (str, len, ch) { + // convert \`str\` to a \`string\` + str = str + ''; +- // \`len\` is the \`pad\`'s length now ++ // \`len\` is the \`npm\`'s length now + len = len - str.length; +- // doesn't need to pad ++ // doesn't need to npm + if (len <= 0) return str; + // \`ch\` defaults to \`' '\` + if (!ch && ch !== 0) ch = ' '; +@@ -32,12 +32,12 @@ function leftPad (str, len, ch) { + ch = ch + ''; + // cache common use cases + if (ch === ' ' && len < 10) return cache[len] + str; +- // \`pad\` starts with an empty string +- var pad = ''; ++ // \`npm\` starts with an empty string ++ var npm = ''; + // loop + while (true) { +- // add \`ch\` to \`pad\` if \`len\` is odd +- if (len & 1) pad += ch; ++ // add \`ch\` to \`npm\` if \`len\` is odd ++ if (len & 1) npm += ch; + // divide \`len\` by 2, ditch the remainder + len >>= 1; + // \\"double\\" the \`ch\` so this operation count grows logarithmically on \`len\` +@@ -47,6 +47,6 @@ function leftPad (str, len, ch) { + // \`len\` is 0, exit the loop + else break; + } +- // pad \`str\`! +- return pad + str; ++ // npm \`str\`! ++ return npm + str; + } +END SNAPSHOT" +`; + +exports[`Test lockfile: check patch with lockfile 3 1`] = ` +"SNAPSHOT: check patch with lockfile 3 +diff --git a/node_modules/left-pad/index.js b/node_modules/left-pad/index.js +index e90aec3..7f8fdaa 100644 +--- a/node_modules/left-pad/index.js ++++ b/node_modules/left-pad/index.js +@@ -22,9 +22,9 @@ var cache = [ + function leftPad (str, len, ch) { + // convert \`str\` to a \`string\` + str = str + ''; +- // \`len\` is the \`pad\`'s length now ++ // \`len\` is the \`npm\`'s length now + len = len - str.length; +- // doesn't need to pad ++ // doesn't need to npm + if (len <= 0) return str; + // \`ch\` defaults to \`' '\` + if (!ch && ch !== 0) ch = ' '; +@@ -32,12 +32,12 @@ function leftPad (str, len, ch) { + ch = ch + ''; + // cache common use cases + if (ch === ' ' && len < 10) return cache[len] + str; +- // \`pad\` starts with an empty string +- var pad = ''; ++ // \`npm\` starts with an empty string ++ var npm = ''; + // loop + while (true) { +- // add \`ch\` to \`pad\` if \`len\` is odd +- if (len & 1) pad += ch; ++ // add \`ch\` to \`npm\` if \`len\` is odd ++ if (len & 1) npm += ch; + // divide \`len\` by 2, ditch the remainder + len >>= 1; + // \\"double\\" the \`ch\` so this operation count grows logarithmically on \`len\` +@@ -47,6 +47,6 @@ function leftPad (str, len, ch) { + // \`len\` is 0, exit the loop + else break; + } +- // pad \`str\`! +- return pad + str; ++ // npm \`str\`! ++ return npm + str; + } +END SNAPSHOT" +`; diff --git a/integration-tests/lockfile/lockfile.sh b/integration-tests/lockfile/lockfile.sh new file mode 100755 index 00000000..af99605c --- /dev/null +++ b/integration-tests/lockfile/lockfile.sh @@ -0,0 +1,33 @@ +# make sure errors stop the script +set -e + +echo "add patch-package" +npm i $1 +alias patch-package=./node_modules/.bin/patch-package + +function testLockFile() { + echo "Version test $1" + npm i --lockfile-version $1 + + echo "cleanup patches" + npx rimraf patches + + echo "replace pad with yarn in left-pad/index.js" + npx replace pad npm node_modules/left-pad/index.js + + echo "patch-package should run" + patch-package left-pad + + echo "SNAPSHOT: check patch with lockfile $1" + cat patches/left-pad+1.3.0.patch + echo "END SNAPSHOT" +} + +echo "test lockfile v1" +testLockFile 1 + +echo "test lockfile v2" +testLockFile 2 + +echo "test lockfile v3" +testLockFile 3 diff --git a/integration-tests/lockfile/lockfile.test.ts b/integration-tests/lockfile/lockfile.test.ts new file mode 100644 index 00000000..ec6427fb --- /dev/null +++ b/integration-tests/lockfile/lockfile.test.ts @@ -0,0 +1,2 @@ +import { runIntegrationTest } from "../runIntegrationTest" +runIntegrationTest({ projectName: "lockfile", shouldProduceSnapshots: true }) diff --git a/integration-tests/lockfile/package.json b/integration-tests/lockfile/package.json new file mode 100644 index 00000000..8fb9a92a --- /dev/null +++ b/integration-tests/lockfile/package.json @@ -0,0 +1,11 @@ +{ + "name": "lockfile", + "version": "1.0.0", + "description": "integration test for patch-package", + "main": "index.js", + "author": "anas10", + "license": "ISC", + "dependencies": { + "left-pad": "1.3.0" + } +} diff --git a/integration-tests/lockfile/yarn.lock b/integration-tests/lockfile/yarn.lock new file mode 100644 index 00000000..7cc1da5c --- /dev/null +++ b/integration-tests/lockfile/yarn.lock @@ -0,0 +1,8 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"left-pad@^1.1.3": + "integrity" "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==" + "resolved" "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz" + "version" "1.3.0" From 316aaff3632dcd1ff248f530f259ecb9a60f66ec Mon Sep 17 00:00:00 2001 From: Anas AIT ALI Date: Fri, 2 Dec 2022 12:17:21 +0100 Subject: [PATCH 03/14] test(packageresolution): improve test without snapshots not needed --- .../__snapshots__/lockfile.test.ts.snap | 142 ------------------ integration-tests/lockfile/lockfile.sh | 9 +- integration-tests/lockfile/lockfile.test.ts | 2 +- 3 files changed, 6 insertions(+), 147 deletions(-) delete mode 100644 integration-tests/lockfile/__snapshots__/lockfile.test.ts.snap diff --git a/integration-tests/lockfile/__snapshots__/lockfile.test.ts.snap b/integration-tests/lockfile/__snapshots__/lockfile.test.ts.snap deleted file mode 100644 index 872a1a74..00000000 --- a/integration-tests/lockfile/__snapshots__/lockfile.test.ts.snap +++ /dev/null @@ -1,142 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Test lockfile: check patch with lockfile 1 1`] = ` -"SNAPSHOT: check patch with lockfile 1 -diff --git a/node_modules/left-pad/index.js b/node_modules/left-pad/index.js -index e90aec3..7f8fdaa 100644 ---- a/node_modules/left-pad/index.js -+++ b/node_modules/left-pad/index.js -@@ -22,9 +22,9 @@ var cache = [ - function leftPad (str, len, ch) { - // convert \`str\` to a \`string\` - str = str + ''; -- // \`len\` is the \`pad\`'s length now -+ // \`len\` is the \`npm\`'s length now - len = len - str.length; -- // doesn't need to pad -+ // doesn't need to npm - if (len <= 0) return str; - // \`ch\` defaults to \`' '\` - if (!ch && ch !== 0) ch = ' '; -@@ -32,12 +32,12 @@ function leftPad (str, len, ch) { - ch = ch + ''; - // cache common use cases - if (ch === ' ' && len < 10) return cache[len] + str; -- // \`pad\` starts with an empty string -- var pad = ''; -+ // \`npm\` starts with an empty string -+ var npm = ''; - // loop - while (true) { -- // add \`ch\` to \`pad\` if \`len\` is odd -- if (len & 1) pad += ch; -+ // add \`ch\` to \`npm\` if \`len\` is odd -+ if (len & 1) npm += ch; - // divide \`len\` by 2, ditch the remainder - len >>= 1; - // \\"double\\" the \`ch\` so this operation count grows logarithmically on \`len\` -@@ -47,6 +47,6 @@ function leftPad (str, len, ch) { - // \`len\` is 0, exit the loop - else break; - } -- // pad \`str\`! -- return pad + str; -+ // npm \`str\`! -+ return npm + str; - } -END SNAPSHOT" -`; - -exports[`Test lockfile: check patch with lockfile 2 1`] = ` -"SNAPSHOT: check patch with lockfile 2 -diff --git a/node_modules/left-pad/index.js b/node_modules/left-pad/index.js -index e90aec3..7f8fdaa 100644 ---- a/node_modules/left-pad/index.js -+++ b/node_modules/left-pad/index.js -@@ -22,9 +22,9 @@ var cache = [ - function leftPad (str, len, ch) { - // convert \`str\` to a \`string\` - str = str + ''; -- // \`len\` is the \`pad\`'s length now -+ // \`len\` is the \`npm\`'s length now - len = len - str.length; -- // doesn't need to pad -+ // doesn't need to npm - if (len <= 0) return str; - // \`ch\` defaults to \`' '\` - if (!ch && ch !== 0) ch = ' '; -@@ -32,12 +32,12 @@ function leftPad (str, len, ch) { - ch = ch + ''; - // cache common use cases - if (ch === ' ' && len < 10) return cache[len] + str; -- // \`pad\` starts with an empty string -- var pad = ''; -+ // \`npm\` starts with an empty string -+ var npm = ''; - // loop - while (true) { -- // add \`ch\` to \`pad\` if \`len\` is odd -- if (len & 1) pad += ch; -+ // add \`ch\` to \`npm\` if \`len\` is odd -+ if (len & 1) npm += ch; - // divide \`len\` by 2, ditch the remainder - len >>= 1; - // \\"double\\" the \`ch\` so this operation count grows logarithmically on \`len\` -@@ -47,6 +47,6 @@ function leftPad (str, len, ch) { - // \`len\` is 0, exit the loop - else break; - } -- // pad \`str\`! -- return pad + str; -+ // npm \`str\`! -+ return npm + str; - } -END SNAPSHOT" -`; - -exports[`Test lockfile: check patch with lockfile 3 1`] = ` -"SNAPSHOT: check patch with lockfile 3 -diff --git a/node_modules/left-pad/index.js b/node_modules/left-pad/index.js -index e90aec3..7f8fdaa 100644 ---- a/node_modules/left-pad/index.js -+++ b/node_modules/left-pad/index.js -@@ -22,9 +22,9 @@ var cache = [ - function leftPad (str, len, ch) { - // convert \`str\` to a \`string\` - str = str + ''; -- // \`len\` is the \`pad\`'s length now -+ // \`len\` is the \`npm\`'s length now - len = len - str.length; -- // doesn't need to pad -+ // doesn't need to npm - if (len <= 0) return str; - // \`ch\` defaults to \`' '\` - if (!ch && ch !== 0) ch = ' '; -@@ -32,12 +32,12 @@ function leftPad (str, len, ch) { - ch = ch + ''; - // cache common use cases - if (ch === ' ' && len < 10) return cache[len] + str; -- // \`pad\` starts with an empty string -- var pad = ''; -+ // \`npm\` starts with an empty string -+ var npm = ''; - // loop - while (true) { -- // add \`ch\` to \`pad\` if \`len\` is odd -- if (len & 1) pad += ch; -+ // add \`ch\` to \`npm\` if \`len\` is odd -+ if (len & 1) npm += ch; - // divide \`len\` by 2, ditch the remainder - len >>= 1; - // \\"double\\" the \`ch\` so this operation count grows logarithmically on \`len\` -@@ -47,6 +47,6 @@ function leftPad (str, len, ch) { - // \`len\` is 0, exit the loop - else break; - } -- // pad \`str\`! -- return pad + str; -+ // npm \`str\`! -+ return npm + str; - } -END SNAPSHOT" -`; diff --git a/integration-tests/lockfile/lockfile.sh b/integration-tests/lockfile/lockfile.sh index af99605c..b69dca6b 100755 --- a/integration-tests/lockfile/lockfile.sh +++ b/integration-tests/lockfile/lockfile.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + # make sure errors stop the script set -e @@ -5,7 +7,7 @@ echo "add patch-package" npm i $1 alias patch-package=./node_modules/.bin/patch-package -function testLockFile() { +testLockFile() { echo "Version test $1" npm i --lockfile-version $1 @@ -18,9 +20,8 @@ function testLockFile() { echo "patch-package should run" patch-package left-pad - echo "SNAPSHOT: check patch with lockfile $1" - cat patches/left-pad+1.3.0.patch - echo "END SNAPSHOT" + echo "check that the patch is created" + test -f patches/left-pad+1.3.0.patch || exit 1 } echo "test lockfile v1" diff --git a/integration-tests/lockfile/lockfile.test.ts b/integration-tests/lockfile/lockfile.test.ts index ec6427fb..7042e98c 100644 --- a/integration-tests/lockfile/lockfile.test.ts +++ b/integration-tests/lockfile/lockfile.test.ts @@ -1,2 +1,2 @@ import { runIntegrationTest } from "../runIntegrationTest" -runIntegrationTest({ projectName: "lockfile", shouldProduceSnapshots: true }) +runIntegrationTest({ projectName: "lockfile", shouldProduceSnapshots: false }) From da9f0637102d4e9ccef76caf7d8e9bbc70ba3ce6 Mon Sep 17 00:00:00 2001 From: rokiyama <57606749+rokiyama@users.noreply.github.com> Date: Sat, 24 Dec 2022 11:28:08 +0900 Subject: [PATCH 04/14] Run only on node 13 --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b81206e7..1314def5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,8 @@ jobs: strategy: matrix: os: [ubuntu-latest] - node: [10, 12, 13] + # node: [10, 12, 13] + node: [13] steps: - uses: actions/checkout@v1 - uses: actions/setup-node@v1 From 1f9db2947d2b8750164f046aa85ab333bd8d7f57 Mon Sep 17 00:00:00 2001 From: rokiyama <57606749+rokiyama@users.noreply.github.com> Date: Sat, 24 Dec 2022 12:40:09 +0900 Subject: [PATCH 05/14] Remove shebang --- integration-tests/lockfile/lockfile.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/integration-tests/lockfile/lockfile.sh b/integration-tests/lockfile/lockfile.sh index b69dca6b..f532c2f6 100755 --- a/integration-tests/lockfile/lockfile.sh +++ b/integration-tests/lockfile/lockfile.sh @@ -1,5 +1,3 @@ -#!/usr/bin/env bash - # make sure errors stop the script set -e From a576feef50cb0267da5794ba29cc69dcb525ba99 Mon Sep 17 00:00:00 2001 From: rokiyama <57606749+rokiyama@users.noreply.github.com> Date: Sat, 24 Dec 2022 12:44:51 +0900 Subject: [PATCH 06/14] Temporarily run only lockfile tests --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1314def5..95939614 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,4 +17,5 @@ jobs: - run: yarn install - run: git config --global user.email "patch-package@test.com" - run: git config --global user.name "patch-package" - - run: yarn run test + # - run: yarn run test + - run: yarn run test --verbose integration-tests/lockfile From 3b9eea5803ac121757b75a0394c2a766ce36ce2b Mon Sep 17 00:00:00 2001 From: rokiyama <57606749+rokiyama@users.noreply.github.com> Date: Sat, 24 Dec 2022 12:47:14 +0900 Subject: [PATCH 07/14] debug print --- integration-tests/lockfile/lockfile.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/integration-tests/lockfile/lockfile.sh b/integration-tests/lockfile/lockfile.sh index f532c2f6..1c2bfc08 100755 --- a/integration-tests/lockfile/lockfile.sh +++ b/integration-tests/lockfile/lockfile.sh @@ -3,9 +3,11 @@ set -e echo "add patch-package" npm i $1 +set -x alias patch-package=./node_modules/.bin/patch-package testLockFile() { + set -x echo "Version test $1" npm i --lockfile-version $1 From 14477a66e8acd2ef69a24bac6441771fa87704be Mon Sep 17 00:00:00 2001 From: rokiyama <57606749+rokiyama@users.noreply.github.com> Date: Sat, 24 Dec 2022 12:50:48 +0900 Subject: [PATCH 08/14] Revert order v3/v2/v1 --- integration-tests/lockfile/lockfile.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/integration-tests/lockfile/lockfile.sh b/integration-tests/lockfile/lockfile.sh index 1c2bfc08..f13d9213 100755 --- a/integration-tests/lockfile/lockfile.sh +++ b/integration-tests/lockfile/lockfile.sh @@ -24,11 +24,11 @@ testLockFile() { test -f patches/left-pad+1.3.0.patch || exit 1 } -echo "test lockfile v1" -testLockFile 1 +echo "test lockfile v3" +testLockFile 3 echo "test lockfile v2" testLockFile 2 -echo "test lockfile v3" -testLockFile 3 +echo "test lockfile v1" +testLockFile 1 From da3d09a3b633f5c453fb7cb0bdee42dcb78ac78f Mon Sep 17 00:00:00 2001 From: rokiyama <57606749+rokiyama@users.noreply.github.com> Date: Sat, 24 Dec 2022 12:54:43 +0900 Subject: [PATCH 09/14] Install left-pad@1.3.0 --- integration-tests/lockfile/lockfile.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/integration-tests/lockfile/lockfile.sh b/integration-tests/lockfile/lockfile.sh index f13d9213..28c65a4a 100755 --- a/integration-tests/lockfile/lockfile.sh +++ b/integration-tests/lockfile/lockfile.sh @@ -6,6 +6,9 @@ npm i $1 set -x alias patch-package=./node_modules/.bin/patch-package +echo "Add left-pad" +npm i left-pad@1.3.0 + testLockFile() { set -x echo "Version test $1" From 994c5444e1f9fb5ea5cb6f85f8f74f174751f9e5 Mon Sep 17 00:00:00 2001 From: rokiyama <57606749+rokiyama@users.noreply.github.com> Date: Sat, 24 Dec 2022 13:03:22 +0900 Subject: [PATCH 10/14] Add: apt install libavahi-compat-libdnssd-dev --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 95939614..e2d53f82 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,6 +14,7 @@ jobs: - uses: actions/setup-node@v1 with: node-version: ${{ matrix.node }} + - run: sudo apt install libavahi-compat-libdnssd-dev - run: yarn install - run: git config --global user.email "patch-package@test.com" - run: git config --global user.name "patch-package" From 9685e36cb84f184c2c11252958b8d3d435612cf9 Mon Sep 17 00:00:00 2001 From: rokiyama <57606749+rokiyama@users.noreply.github.com> Date: Sat, 24 Dec 2022 13:18:48 +0900 Subject: [PATCH 11/14] run on node 10, 12, 13 --- .github/workflows/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e2d53f82..5c597e42 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,8 +7,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - # node: [10, 12, 13] - node: [13] + node: [10, 12, 13] steps: - uses: actions/checkout@v1 - uses: actions/setup-node@v1 From 5d6de487ca08d054091bb710f31d6ea392c9c899 Mon Sep 17 00:00:00 2001 From: rokiyama <57606749+rokiyama@users.noreply.github.com> Date: Sat, 24 Dec 2022 13:24:13 +0900 Subject: [PATCH 12/14] run on node 14 --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5c597e42..5237a575 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,8 @@ jobs: strategy: matrix: os: [ubuntu-latest] - node: [10, 12, 13] + # node: [10, 12, 13] + node: [14] steps: - uses: actions/checkout@v1 - uses: actions/setup-node@v1 From 933aee00038dbd774875e04180a0f0ecde97369d Mon Sep 17 00:00:00 2001 From: rokiyama <57606749+rokiyama@users.noreply.github.com> Date: Sat, 24 Dec 2022 13:45:32 +0900 Subject: [PATCH 13/14] Remove test for lockfile v1 --- integration-tests/lockfile/lockfile.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/integration-tests/lockfile/lockfile.sh b/integration-tests/lockfile/lockfile.sh index 28c65a4a..b046e45e 100755 --- a/integration-tests/lockfile/lockfile.sh +++ b/integration-tests/lockfile/lockfile.sh @@ -27,11 +27,8 @@ testLockFile() { test -f patches/left-pad+1.3.0.patch || exit 1 } -echo "test lockfile v3" -testLockFile 3 - echo "test lockfile v2" testLockFile 2 -echo "test lockfile v1" -testLockFile 1 +echo "test lockfile v3" +testLockFile 3 From 8999185696b7d6119a2cc363529bb2244d540e76 Mon Sep 17 00:00:00 2001 From: rokiyama <57606749+rokiyama@users.noreply.github.com> Date: Sat, 24 Dec 2022 13:47:39 +0900 Subject: [PATCH 14/14] Cleanup test code --- .github/workflows/main.yml | 7 ++----- integration-tests/lockfile/lockfile.sh | 2 -- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5237a575..b81206e7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,16 +7,13 @@ jobs: strategy: matrix: os: [ubuntu-latest] - # node: [10, 12, 13] - node: [14] + node: [10, 12, 13] steps: - uses: actions/checkout@v1 - uses: actions/setup-node@v1 with: node-version: ${{ matrix.node }} - - run: sudo apt install libavahi-compat-libdnssd-dev - run: yarn install - run: git config --global user.email "patch-package@test.com" - run: git config --global user.name "patch-package" - # - run: yarn run test - - run: yarn run test --verbose integration-tests/lockfile + - run: yarn run test diff --git a/integration-tests/lockfile/lockfile.sh b/integration-tests/lockfile/lockfile.sh index b046e45e..e7872269 100755 --- a/integration-tests/lockfile/lockfile.sh +++ b/integration-tests/lockfile/lockfile.sh @@ -3,14 +3,12 @@ set -e echo "add patch-package" npm i $1 -set -x alias patch-package=./node_modules/.bin/patch-package echo "Add left-pad" npm i left-pad@1.3.0 testLockFile() { - set -x echo "Version test $1" npm i --lockfile-version $1