From 06a26c919b82203acd1fc625a3da81803c499dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominykas=20Blyz=CC=8Ce=CC=87?= Date: Mon, 3 May 2021 17:33:34 +0300 Subject: [PATCH 1/4] ci: add GH workflow for CI --- .github/workflows/ci.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..9063224 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,25 @@ +name: Node.js CI + +on: + push: + branches: + - main + pull_request: + +jobs: + + test: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [ 16, 14, 12, 10 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - run: npm run test From 42eab1cb4cc1a9a951fff9d986b3766c2c7dd9ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominykas=20Blyz=CC=8Ce=CC=87?= Date: Mon, 3 May 2021 17:37:21 +0300 Subject: [PATCH 2/4] ci: set CI git user --- .github/workflows/ci.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9063224..2e80f5a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,6 +18,9 @@ jobs: steps: - uses: actions/checkout@v2 + - run: | + git config user.name github-actions + git config user.email github-actions@github.com - uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} From 92f91798a5dbe9315404408d4b5b08382124e1ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominykas=20Blyz=CC=8Ce=CC=87?= Date: Mon, 3 May 2021 17:38:50 +0300 Subject: [PATCH 3/4] ci: set CI git user --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2e80f5a..67ced9c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,8 +19,8 @@ jobs: steps: - uses: actions/checkout@v2 - run: | - git config user.name github-actions - git config user.email github-actions@github.com + git config --global user.name github-actions + git config --global user.email github-actions@github.com - uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} From 822efb44446ae20e46b927d99eb10d3ab207ffb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominykas=20Blyz=CC=8Ce=CC=87?= Date: Mon, 3 May 2021 17:59:58 +0300 Subject: [PATCH 4/4] fix: rely on latest arborist properties This was introduced in 2.1.0, it breaks tests locally for whatever reason, but passes in CI. `isProjectRoot` also checks for "dep === dep.root.target", which I assume is the correct and desired behavior. --- lib/deps.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/deps.js b/lib/deps.js index 21fb60e..3c6e6b3 100644 --- a/lib/deps.js +++ b/lib/deps.js @@ -31,7 +31,7 @@ internals.resolve = async ({ packageJson, lockfile }, options) => { for (const dep of arborist.idealTree.inventory.values()) { - if (dep.root === dep) { + if (dep.isProjectRoot) { // root node is not a dep, really continue; } @@ -41,7 +41,7 @@ internals.resolve = async ({ packageJson, lockfile }, options) => { continue; } - if (!options.deep && ![...dep.edgesIn].some(({ from }) => from === arborist.idealTree)) { + if (!options.deep && ![...dep.edgesIn].some(({ from }) => from.isProjectRoot)) { continue; } diff --git a/package.json b/package.json index c3459c4..ec54ec9 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ }, "dependencies": { "@hapi/wreck": "^17.0.0", - "@npmcli/arborist": "^2.0.0", + "@npmcli/arborist": "^2.1.0", "@pkgjs/nv": "0.1.0", "debug": "^4.1.1", "git-url-parse": "^11.1.2",