From 52a0d4f351a6903675cbe8ee96223522e8c94785 Mon Sep 17 00:00:00 2001 From: Denis Davidyuk Date: Tue, 26 Nov 2024 13:53:59 +0500 Subject: [PATCH] chore: use `npm pack` in tests --- .gitignore | 3 ++- src/init/next-artifacts/docker-compose.yml | 1 - tests/util.mjs | 13 +++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index a8866972..8c98df27 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ node_modules site .testdir build -.venv \ No newline at end of file +.venv +aeternity-aeproject-*.tgz \ No newline at end of file diff --git a/src/init/next-artifacts/docker-compose.yml b/src/init/next-artifacts/docker-compose.yml index 359f2ec2..e6b3edf3 100644 --- a/src/init/next-artifacts/docker-compose.yml +++ b/src/init/next-artifacts/docker-compose.yml @@ -1,4 +1,3 @@ -version: "3.6" services: aeproject_node: image: aeternity/aeternity:${NODE_TAG:-latest}-bundle diff --git a/tests/util.mjs b/tests/util.mjs index c54220e3..a2778d33 100644 --- a/tests/util.mjs +++ b/tests/util.mjs @@ -22,12 +22,13 @@ export function cleanLocal() { if (fs.existsSync(cwd)) fs.rmSync(cwd, { recursive: true }); } +let isPacked = false; + export async function linkLocalLib(folder) { const c = folder ? path.join(cwd, folder) : cwd; - await exec("npm i .. -D", { cwd: c }); - await exec( - 'perl -i -pe \'s/"prepare"/"rem-prepare"/g\' ../node_modules/@aeternity/aepp-sdk/package.json', - { cwd: c }, - ); - await exec("npm i ../node_modules/@aeternity/aepp-sdk", { cwd: c }); + if (!isPacked) { + await exec("npm pack --ignore-scripts"); + isPacked = true; + } + await exec(`npm i ${path.join(process.cwd(), "aeternity-aeproject-*.tgz")} -D`, { cwd: c }); }