From 780f0eb6f89c1ead2ab573313a456f47230672b3 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Fri, 1 Dec 2023 16:24:38 -0700 Subject: [PATCH] chore: use global npm for workspace tests --- .github/workflows/ci-libnpmaccess.yml | 14 +++++++++++--- .github/workflows/ci-libnpmdiff.yml | 14 +++++++++++--- .github/workflows/ci-libnpmexec.yml | 14 +++++++++++--- .github/workflows/ci-libnpmfund.yml | 14 +++++++++++--- .github/workflows/ci-libnpmhook.yml | 14 +++++++++++--- .github/workflows/ci-libnpmorg.yml | 14 +++++++++++--- .github/workflows/ci-libnpmpack.yml | 14 +++++++++++--- .github/workflows/ci-libnpmpublish.yml | 14 +++++++++++--- .github/workflows/ci-libnpmsearch.yml | 14 +++++++++++--- .github/workflows/ci-libnpmteam.yml | 14 +++++++++++--- .github/workflows/ci-libnpmversion.yml | 14 +++++++++++--- .github/workflows/ci-npmcli-arborist.yml | 14 +++++++++++--- .github/workflows/ci-npmcli-config.yml | 14 +++++++++++--- .github/workflows/ci-npmcli-docs.yml | 18 +++++++++++++++--- .github/workflows/ci-npmcli-mock-globals.yml | 14 +++++++++++--- .github/workflows/ci-npmcli-mock-registry.yml | 14 +++++++++++--- .github/workflows/ci-npmcli-smoke-tests.yml | 14 +++++++++++--- docs/package.json | 4 ++-- mock-globals/package.json | 4 ++-- mock-registry/package.json | 4 ++-- scripts/template-oss/index.js | 4 ++++ smoke-tests/package.json | 4 ++-- workspaces/arborist/package.json | 4 ++-- workspaces/config/package.json | 4 ++-- workspaces/libnpmaccess/package.json | 4 ++-- workspaces/libnpmdiff/package.json | 4 ++-- workspaces/libnpmexec/package.json | 4 ++-- workspaces/libnpmfund/package.json | 4 ++-- workspaces/libnpmhook/package.json | 4 ++-- workspaces/libnpmorg/package.json | 4 ++-- workspaces/libnpmpack/package.json | 4 ++-- workspaces/libnpmpublish/package.json | 4 ++-- workspaces/libnpmsearch/package.json | 4 ++-- workspaces/libnpmteam/package.json | 4 ++-- workspaces/libnpmversion/package.json | 4 ++-- 35 files changed, 229 insertions(+), 85 deletions(-) diff --git a/.github/workflows/ci-libnpmaccess.yml b/.github/workflows/ci-libnpmaccess.yml index 8047e9064d9f9..b846ec2f1231d 100644 --- a/.github/workflows/ci-libnpmaccess.yml +++ b/.github/workflows/ci-libnpmaccess.yml @@ -39,14 +39,18 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps run: node scripts/resetdeps.js - name: Lint - run: node . run lint --ignore-scripts -w libnpmaccess + run: npm run lint --ignore-scripts -w libnpmaccess - name: Post Lint - run: node . run postlint --ignore-scripts -w libnpmaccess + run: npm run postlint --ignore-scripts -w libnpmaccess test: name: Test - ${{ matrix.platform.name }} - ${{ matrix.node-version }} @@ -88,6 +92,10 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -95,6 +103,6 @@ jobs: - name: Add Problem Matcher run: echo "::add-matcher::.github/matchers/tap.json" - name: Test - run: node . test --ignore-scripts -w libnpmaccess + run: npm test --ignore-scripts -w libnpmaccess - name: Check Git Status run: node scripts/git-dirty.js diff --git a/.github/workflows/ci-libnpmdiff.yml b/.github/workflows/ci-libnpmdiff.yml index ba13cb14a7339..4f997637ac4a0 100644 --- a/.github/workflows/ci-libnpmdiff.yml +++ b/.github/workflows/ci-libnpmdiff.yml @@ -39,14 +39,18 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps run: node scripts/resetdeps.js - name: Lint - run: node . run lint --ignore-scripts -w libnpmdiff + run: npm run lint --ignore-scripts -w libnpmdiff - name: Post Lint - run: node . run postlint --ignore-scripts -w libnpmdiff + run: npm run postlint --ignore-scripts -w libnpmdiff test: name: Test - ${{ matrix.platform.name }} - ${{ matrix.node-version }} @@ -88,6 +92,10 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -95,6 +103,6 @@ jobs: - name: Add Problem Matcher run: echo "::add-matcher::.github/matchers/tap.json" - name: Test - run: node . test --ignore-scripts -w libnpmdiff + run: npm test --ignore-scripts -w libnpmdiff - name: Check Git Status run: node scripts/git-dirty.js diff --git a/.github/workflows/ci-libnpmexec.yml b/.github/workflows/ci-libnpmexec.yml index 74d4d1c2ca869..f0209034e34ba 100644 --- a/.github/workflows/ci-libnpmexec.yml +++ b/.github/workflows/ci-libnpmexec.yml @@ -39,14 +39,18 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps run: node scripts/resetdeps.js - name: Lint - run: node . run lint --ignore-scripts -w libnpmexec + run: npm run lint --ignore-scripts -w libnpmexec - name: Post Lint - run: node . run postlint --ignore-scripts -w libnpmexec + run: npm run postlint --ignore-scripts -w libnpmexec test: name: Test - ${{ matrix.platform.name }} - ${{ matrix.node-version }} @@ -88,6 +92,10 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -95,6 +103,6 @@ jobs: - name: Add Problem Matcher run: echo "::add-matcher::.github/matchers/tap.json" - name: Test - run: node . test --ignore-scripts -w libnpmexec + run: npm test --ignore-scripts -w libnpmexec - name: Check Git Status run: node scripts/git-dirty.js diff --git a/.github/workflows/ci-libnpmfund.yml b/.github/workflows/ci-libnpmfund.yml index 8b35df78f1c99..8c87f8d82e0a8 100644 --- a/.github/workflows/ci-libnpmfund.yml +++ b/.github/workflows/ci-libnpmfund.yml @@ -39,14 +39,18 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps run: node scripts/resetdeps.js - name: Lint - run: node . run lint --ignore-scripts -w libnpmfund + run: npm run lint --ignore-scripts -w libnpmfund - name: Post Lint - run: node . run postlint --ignore-scripts -w libnpmfund + run: npm run postlint --ignore-scripts -w libnpmfund test: name: Test - ${{ matrix.platform.name }} - ${{ matrix.node-version }} @@ -88,6 +92,10 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -95,6 +103,6 @@ jobs: - name: Add Problem Matcher run: echo "::add-matcher::.github/matchers/tap.json" - name: Test - run: node . test --ignore-scripts -w libnpmfund + run: npm test --ignore-scripts -w libnpmfund - name: Check Git Status run: node scripts/git-dirty.js diff --git a/.github/workflows/ci-libnpmhook.yml b/.github/workflows/ci-libnpmhook.yml index 3746b78785d61..b83adcebf1504 100644 --- a/.github/workflows/ci-libnpmhook.yml +++ b/.github/workflows/ci-libnpmhook.yml @@ -39,14 +39,18 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps run: node scripts/resetdeps.js - name: Lint - run: node . run lint --ignore-scripts -w libnpmhook + run: npm run lint --ignore-scripts -w libnpmhook - name: Post Lint - run: node . run postlint --ignore-scripts -w libnpmhook + run: npm run postlint --ignore-scripts -w libnpmhook test: name: Test - ${{ matrix.platform.name }} - ${{ matrix.node-version }} @@ -88,6 +92,10 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -95,6 +103,6 @@ jobs: - name: Add Problem Matcher run: echo "::add-matcher::.github/matchers/tap.json" - name: Test - run: node . test --ignore-scripts -w libnpmhook + run: npm test --ignore-scripts -w libnpmhook - name: Check Git Status run: node scripts/git-dirty.js diff --git a/.github/workflows/ci-libnpmorg.yml b/.github/workflows/ci-libnpmorg.yml index 36eb2b213d40f..9aa89720490a1 100644 --- a/.github/workflows/ci-libnpmorg.yml +++ b/.github/workflows/ci-libnpmorg.yml @@ -39,14 +39,18 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps run: node scripts/resetdeps.js - name: Lint - run: node . run lint --ignore-scripts -w libnpmorg + run: npm run lint --ignore-scripts -w libnpmorg - name: Post Lint - run: node . run postlint --ignore-scripts -w libnpmorg + run: npm run postlint --ignore-scripts -w libnpmorg test: name: Test - ${{ matrix.platform.name }} - ${{ matrix.node-version }} @@ -88,6 +92,10 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -95,6 +103,6 @@ jobs: - name: Add Problem Matcher run: echo "::add-matcher::.github/matchers/tap.json" - name: Test - run: node . test --ignore-scripts -w libnpmorg + run: npm test --ignore-scripts -w libnpmorg - name: Check Git Status run: node scripts/git-dirty.js diff --git a/.github/workflows/ci-libnpmpack.yml b/.github/workflows/ci-libnpmpack.yml index 3dbfa8fb69e22..0e15706e4eac7 100644 --- a/.github/workflows/ci-libnpmpack.yml +++ b/.github/workflows/ci-libnpmpack.yml @@ -39,14 +39,18 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps run: node scripts/resetdeps.js - name: Lint - run: node . run lint --ignore-scripts -w libnpmpack + run: npm run lint --ignore-scripts -w libnpmpack - name: Post Lint - run: node . run postlint --ignore-scripts -w libnpmpack + run: npm run postlint --ignore-scripts -w libnpmpack test: name: Test - ${{ matrix.platform.name }} - ${{ matrix.node-version }} @@ -88,6 +92,10 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -95,6 +103,6 @@ jobs: - name: Add Problem Matcher run: echo "::add-matcher::.github/matchers/tap.json" - name: Test - run: node . test --ignore-scripts -w libnpmpack + run: npm test --ignore-scripts -w libnpmpack - name: Check Git Status run: node scripts/git-dirty.js diff --git a/.github/workflows/ci-libnpmpublish.yml b/.github/workflows/ci-libnpmpublish.yml index 77798940dd8ef..42950d13ae439 100644 --- a/.github/workflows/ci-libnpmpublish.yml +++ b/.github/workflows/ci-libnpmpublish.yml @@ -39,14 +39,18 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps run: node scripts/resetdeps.js - name: Lint - run: node . run lint --ignore-scripts -w libnpmpublish + run: npm run lint --ignore-scripts -w libnpmpublish - name: Post Lint - run: node . run postlint --ignore-scripts -w libnpmpublish + run: npm run postlint --ignore-scripts -w libnpmpublish test: name: Test - ${{ matrix.platform.name }} - ${{ matrix.node-version }} @@ -88,6 +92,10 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -95,6 +103,6 @@ jobs: - name: Add Problem Matcher run: echo "::add-matcher::.github/matchers/tap.json" - name: Test - run: node . test --ignore-scripts -w libnpmpublish + run: npm test --ignore-scripts -w libnpmpublish - name: Check Git Status run: node scripts/git-dirty.js diff --git a/.github/workflows/ci-libnpmsearch.yml b/.github/workflows/ci-libnpmsearch.yml index 12656b5b67289..ba3bf93d36be6 100644 --- a/.github/workflows/ci-libnpmsearch.yml +++ b/.github/workflows/ci-libnpmsearch.yml @@ -39,14 +39,18 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps run: node scripts/resetdeps.js - name: Lint - run: node . run lint --ignore-scripts -w libnpmsearch + run: npm run lint --ignore-scripts -w libnpmsearch - name: Post Lint - run: node . run postlint --ignore-scripts -w libnpmsearch + run: npm run postlint --ignore-scripts -w libnpmsearch test: name: Test - ${{ matrix.platform.name }} - ${{ matrix.node-version }} @@ -88,6 +92,10 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -95,6 +103,6 @@ jobs: - name: Add Problem Matcher run: echo "::add-matcher::.github/matchers/tap.json" - name: Test - run: node . test --ignore-scripts -w libnpmsearch + run: npm test --ignore-scripts -w libnpmsearch - name: Check Git Status run: node scripts/git-dirty.js diff --git a/.github/workflows/ci-libnpmteam.yml b/.github/workflows/ci-libnpmteam.yml index e2edac4df923b..36953e1980d15 100644 --- a/.github/workflows/ci-libnpmteam.yml +++ b/.github/workflows/ci-libnpmteam.yml @@ -39,14 +39,18 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps run: node scripts/resetdeps.js - name: Lint - run: node . run lint --ignore-scripts -w libnpmteam + run: npm run lint --ignore-scripts -w libnpmteam - name: Post Lint - run: node . run postlint --ignore-scripts -w libnpmteam + run: npm run postlint --ignore-scripts -w libnpmteam test: name: Test - ${{ matrix.platform.name }} - ${{ matrix.node-version }} @@ -88,6 +92,10 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -95,6 +103,6 @@ jobs: - name: Add Problem Matcher run: echo "::add-matcher::.github/matchers/tap.json" - name: Test - run: node . test --ignore-scripts -w libnpmteam + run: npm test --ignore-scripts -w libnpmteam - name: Check Git Status run: node scripts/git-dirty.js diff --git a/.github/workflows/ci-libnpmversion.yml b/.github/workflows/ci-libnpmversion.yml index 4d17c596b193c..126ba9f37f163 100644 --- a/.github/workflows/ci-libnpmversion.yml +++ b/.github/workflows/ci-libnpmversion.yml @@ -39,14 +39,18 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps run: node scripts/resetdeps.js - name: Lint - run: node . run lint --ignore-scripts -w libnpmversion + run: npm run lint --ignore-scripts -w libnpmversion - name: Post Lint - run: node . run postlint --ignore-scripts -w libnpmversion + run: npm run postlint --ignore-scripts -w libnpmversion test: name: Test - ${{ matrix.platform.name }} - ${{ matrix.node-version }} @@ -88,6 +92,10 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -95,6 +103,6 @@ jobs: - name: Add Problem Matcher run: echo "::add-matcher::.github/matchers/tap.json" - name: Test - run: node . test --ignore-scripts -w libnpmversion + run: npm test --ignore-scripts -w libnpmversion - name: Check Git Status run: node scripts/git-dirty.js diff --git a/.github/workflows/ci-npmcli-arborist.yml b/.github/workflows/ci-npmcli-arborist.yml index 480de4354619b..7f6b97a01e39a 100644 --- a/.github/workflows/ci-npmcli-arborist.yml +++ b/.github/workflows/ci-npmcli-arborist.yml @@ -39,14 +39,18 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps run: node scripts/resetdeps.js - name: Lint - run: node . run lint --ignore-scripts -w @npmcli/arborist + run: npm run lint --ignore-scripts -w @npmcli/arborist - name: Post Lint - run: node . run postlint --ignore-scripts -w @npmcli/arborist + run: npm run postlint --ignore-scripts -w @npmcli/arborist test: name: Test - ${{ matrix.platform.name }} - ${{ matrix.node-version }} @@ -88,6 +92,10 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -95,6 +103,6 @@ jobs: - name: Add Problem Matcher run: echo "::add-matcher::.github/matchers/tap.json" - name: Test - run: node . test --ignore-scripts -w @npmcli/arborist + run: npm test --ignore-scripts -w @npmcli/arborist - name: Check Git Status run: node scripts/git-dirty.js diff --git a/.github/workflows/ci-npmcli-config.yml b/.github/workflows/ci-npmcli-config.yml index aa3757f623198..74c59343be046 100644 --- a/.github/workflows/ci-npmcli-config.yml +++ b/.github/workflows/ci-npmcli-config.yml @@ -39,14 +39,18 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps run: node scripts/resetdeps.js - name: Lint - run: node . run lint --ignore-scripts -w @npmcli/config + run: npm run lint --ignore-scripts -w @npmcli/config - name: Post Lint - run: node . run postlint --ignore-scripts -w @npmcli/config + run: npm run postlint --ignore-scripts -w @npmcli/config test: name: Test - ${{ matrix.platform.name }} - ${{ matrix.node-version }} @@ -88,6 +92,10 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -95,6 +103,6 @@ jobs: - name: Add Problem Matcher run: echo "::add-matcher::.github/matchers/tap.json" - name: Test - run: node . test --ignore-scripts -w @npmcli/config + run: npm test --ignore-scripts -w @npmcli/config - name: Check Git Status run: node scripts/git-dirty.js diff --git a/.github/workflows/ci-npmcli-docs.yml b/.github/workflows/ci-npmcli-docs.yml index 5098e112121cc..bbb9296e7d08b 100644 --- a/.github/workflows/ci-npmcli-docs.yml +++ b/.github/workflows/ci-npmcli-docs.yml @@ -39,14 +39,18 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps run: node scripts/resetdeps.js - name: Lint - run: node . run lint --ignore-scripts -w @npmcli/docs + run: npm run lint --ignore-scripts -w @npmcli/docs - name: Post Lint - run: node . run postlint --ignore-scripts -w @npmcli/docs + run: npm run postlint --ignore-scripts -w @npmcli/docs test: name: Test - ${{ matrix.platform.name }} - ${{ matrix.node-version }} @@ -84,6 +88,10 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -91,7 +99,7 @@ jobs: - name: Add Problem Matcher run: echo "::add-matcher::.github/matchers/tap.json" - name: Test - run: node . test --ignore-scripts -w @npmcli/docs + run: npm test --ignore-scripts -w @npmcli/docs - name: Check Git Status run: node scripts/git-dirty.js @@ -118,6 +126,10 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps diff --git a/.github/workflows/ci-npmcli-mock-globals.yml b/.github/workflows/ci-npmcli-mock-globals.yml index 75fbea4cd1d3f..ba2dca9434369 100644 --- a/.github/workflows/ci-npmcli-mock-globals.yml +++ b/.github/workflows/ci-npmcli-mock-globals.yml @@ -39,14 +39,18 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps run: node scripts/resetdeps.js - name: Lint - run: node . run lint --ignore-scripts -w @npmcli/mock-globals + run: npm run lint --ignore-scripts -w @npmcli/mock-globals - name: Post Lint - run: node . run postlint --ignore-scripts -w @npmcli/mock-globals + run: npm run postlint --ignore-scripts -w @npmcli/mock-globals test: name: Test - ${{ matrix.platform.name }} - ${{ matrix.node-version }} @@ -87,6 +91,10 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -94,6 +102,6 @@ jobs: - name: Add Problem Matcher run: echo "::add-matcher::.github/matchers/tap.json" - name: Test - run: node . test --ignore-scripts -w @npmcli/mock-globals + run: npm test --ignore-scripts -w @npmcli/mock-globals - name: Check Git Status run: node scripts/git-dirty.js diff --git a/.github/workflows/ci-npmcli-mock-registry.yml b/.github/workflows/ci-npmcli-mock-registry.yml index ea1a63563f48d..51d51bca51adb 100644 --- a/.github/workflows/ci-npmcli-mock-registry.yml +++ b/.github/workflows/ci-npmcli-mock-registry.yml @@ -39,14 +39,18 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps run: node scripts/resetdeps.js - name: Lint - run: node . run lint --ignore-scripts -w @npmcli/mock-registry + run: npm run lint --ignore-scripts -w @npmcli/mock-registry - name: Post Lint - run: node . run postlint --ignore-scripts -w @npmcli/mock-registry + run: npm run postlint --ignore-scripts -w @npmcli/mock-registry test: name: Test - ${{ matrix.platform.name }} - ${{ matrix.node-version }} @@ -87,6 +91,10 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -94,6 +102,6 @@ jobs: - name: Add Problem Matcher run: echo "::add-matcher::.github/matchers/tap.json" - name: Test - run: node . test --ignore-scripts -w @npmcli/mock-registry + run: npm test --ignore-scripts -w @npmcli/mock-registry - name: Check Git Status run: node scripts/git-dirty.js diff --git a/.github/workflows/ci-npmcli-smoke-tests.yml b/.github/workflows/ci-npmcli-smoke-tests.yml index eecf1fb5f3c89..4d8456968e2a1 100644 --- a/.github/workflows/ci-npmcli-smoke-tests.yml +++ b/.github/workflows/ci-npmcli-smoke-tests.yml @@ -39,14 +39,18 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps run: node scripts/resetdeps.js - name: Lint - run: node . run lint --ignore-scripts -w @npmcli/smoke-tests + run: npm run lint --ignore-scripts -w @npmcli/smoke-tests - name: Post Lint - run: node . run postlint --ignore-scripts -w @npmcli/smoke-tests + run: npm run postlint --ignore-scripts -w @npmcli/smoke-tests test: name: Test - ${{ matrix.platform.name }} - ${{ matrix.node-version }} @@ -87,6 +91,10 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm + - name: Install Latest npm + uses: ./.github/actions/install-latest-npm + with: + node: ${{ steps.node.outputs.node-version }} - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -94,6 +102,6 @@ jobs: - name: Add Problem Matcher run: echo "::add-matcher::.github/matchers/tap.json" - name: Test - run: node . test --ignore-scripts -w @npmcli/smoke-tests + run: npm test --ignore-scripts -w @npmcli/smoke-tests - name: Check Git Status run: node scripts/git-dirty.js diff --git a/docs/package.json b/docs/package.json index 3d6d80fac0fa0..705267f045513 100644 --- a/docs/package.json +++ b/docs/package.json @@ -8,10 +8,10 @@ "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "postlint": "template-oss-check", "template-oss-apply": "template-oss-apply --force", - "lintfix": "node .. run lint -- --fix", + "lintfix": "npm run lint -- --fix", "snap": "tap", "test": "tap", - "posttest": "node .. run lint", + "posttest": "npm run lint", "build": "node bin/build.js" }, "repository": { diff --git a/mock-globals/package.json b/mock-globals/package.json index 7a25fe1714b1b..e67ba6feadf53 100644 --- a/mock-globals/package.json +++ b/mock-globals/package.json @@ -9,9 +9,9 @@ "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "postlint": "template-oss-check", "template-oss-apply": "template-oss-apply --force", - "lintfix": "node .. run lint -- --fix", + "lintfix": "npm run lint -- --fix", "snap": "tap", - "posttest": "node .. run lint" + "posttest": "npm run lint" }, "repository": { "type": "git", diff --git a/mock-registry/package.json b/mock-registry/package.json index 796fadbf72318..85cea98b565c6 100644 --- a/mock-registry/package.json +++ b/mock-registry/package.json @@ -9,9 +9,9 @@ "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "postlint": "template-oss-check", "template-oss-apply": "template-oss-apply --force", - "lintfix": "node .. run lint -- --fix", + "lintfix": "npm run lint -- --fix", "snap": "tap", - "posttest": "node .. run lint" + "posttest": "npm run lint" }, "repository": { "type": "git", diff --git a/scripts/template-oss/index.js b/scripts/template-oss/index.js index f18acc210b355..0f214723f558c 100644 --- a/scripts/template-oss/index.js +++ b/scripts/template-oss/index.js @@ -1,3 +1,7 @@ module.exports = { ...require('./branch-specific-config.js'), + // Make workspaces use the global version of in workflows. + // This is needed while workspaces and npm have different engines. + // TODO: make npm and its workspaces always use the same engines and delete this. + npm: 'npm', } diff --git a/smoke-tests/package.json b/smoke-tests/package.json index eaad3495c329d..777b22c8aab33 100644 --- a/smoke-tests/package.json +++ b/smoke-tests/package.json @@ -7,10 +7,10 @@ "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "postlint": "template-oss-check", "template-oss-apply": "template-oss-apply --force", - "lintfix": "node .. run lint -- --fix", + "lintfix": "npm run lint -- --fix", "snap": "tap", "test": "tap", - "posttest": "node .. run lint" + "posttest": "npm run lint" }, "repository": { "type": "git", diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index ea6ee17e2fd30..bdb38815ad2fd 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -49,11 +49,11 @@ }, "scripts": { "test": "tap", - "posttest": "node ../.. run lint", + "posttest": "npm run lint", "snap": "tap", "test-proxy": "ARBORIST_TEST_PROXY=1 tap --snapshot", "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", - "lintfix": "node ../.. run lint -- --fix", + "lintfix": "npm run lint -- --fix", "benchmark": "node scripts/benchmark.js", "benchclean": "rm -rf scripts/benchmark/*/", "postlint": "template-oss-check", diff --git a/workspaces/config/package.json b/workspaces/config/package.json index baeb3c4f0755c..d2e2a72c0f312 100644 --- a/workspaces/config/package.json +++ b/workspaces/config/package.json @@ -19,8 +19,8 @@ "snap": "tap", "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "postlint": "template-oss-check", - "lintfix": "node ../.. run lint -- --fix", - "posttest": "node ../.. run lint", + "lintfix": "npm run lint -- --fix", + "posttest": "npm run lint", "template-oss-apply": "template-oss-apply --force" }, "tap": { diff --git a/workspaces/libnpmaccess/package.json b/workspaces/libnpmaccess/package.json index 73a3ac2852010..bb9d002b166a9 100644 --- a/workspaces/libnpmaccess/package.json +++ b/workspaces/libnpmaccess/package.json @@ -9,9 +9,9 @@ "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "test": "tap", "postlint": "template-oss-check", - "lintfix": "node ../.. run lint -- --fix", + "lintfix": "npm run lint -- --fix", "snap": "tap", - "posttest": "node ../.. run lint", + "posttest": "npm run lint", "template-oss-apply": "template-oss-apply --force" }, "devDependencies": { diff --git a/workspaces/libnpmdiff/package.json b/workspaces/libnpmdiff/package.json index 2ddf44987581d..3fdcd9afc567d 100644 --- a/workspaces/libnpmdiff/package.json +++ b/workspaces/libnpmdiff/package.json @@ -33,9 +33,9 @@ "license": "ISC", "scripts": { "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", - "lintfix": "node ../.. run lint -- --fix", + "lintfix": "npm run lint -- --fix", "test": "tap", - "posttest": "node ../.. run lint", + "posttest": "npm run lint", "snap": "tap", "postlint": "template-oss-check", "template-oss-apply": "template-oss-apply --force" diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index 0f8d355210e28..04b253ab88c79 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -34,11 +34,11 @@ "license": "ISC", "scripts": { "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", - "posttest": "node ../.. run lint", + "posttest": "npm run lint", "test": "tap", "snap": "tap", "postlint": "template-oss-check", - "lintfix": "node ../.. run lint -- --fix", + "lintfix": "npm run lint -- --fix", "template-oss-apply": "template-oss-apply --force" }, "tap": { diff --git a/workspaces/libnpmfund/package.json b/workspaces/libnpmfund/package.json index d940d7eef91ee..7e02b33f83c0f 100644 --- a/workspaces/libnpmfund/package.json +++ b/workspaces/libnpmfund/package.json @@ -32,8 +32,8 @@ "license": "ISC", "scripts": { "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", - "lintfix": "node ../.. run lint -- --fix", - "posttest": "node ../.. run lint", + "lintfix": "npm run lint -- --fix", + "posttest": "npm run lint", "test": "tap", "snap": "tap", "postlint": "template-oss-check", diff --git a/workspaces/libnpmhook/package.json b/workspaces/libnpmhook/package.json index f22aab85e508e..db85bd3f9397f 100644 --- a/workspaces/libnpmhook/package.json +++ b/workspaces/libnpmhook/package.json @@ -11,9 +11,9 @@ "test": "tap", "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "postlint": "template-oss-check", - "lintfix": "node ../.. run lint -- --fix", + "lintfix": "npm run lint -- --fix", "snap": "tap", - "posttest": "node ../.. run lint", + "posttest": "npm run lint", "template-oss-apply": "template-oss-apply --force" }, "repository": { diff --git a/workspaces/libnpmorg/package.json b/workspaces/libnpmorg/package.json index 5b695012ac2ab..dab4078231c5b 100644 --- a/workspaces/libnpmorg/package.json +++ b/workspaces/libnpmorg/package.json @@ -16,9 +16,9 @@ "scripts": { "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "test": "tap", - "posttest": "node ../.. run lint", + "posttest": "npm run lint", "postlint": "template-oss-check", - "lintfix": "node ../.. run lint -- --fix", + "lintfix": "npm run lint -- --fix", "snap": "tap", "template-oss-apply": "template-oss-apply --force" }, diff --git a/workspaces/libnpmpack/package.json b/workspaces/libnpmpack/package.json index caa97a7ffceca..84f03428c39a1 100644 --- a/workspaces/libnpmpack/package.json +++ b/workspaces/libnpmpack/package.json @@ -15,9 +15,9 @@ "scripts": { "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "test": "tap", - "posttest": "node ../.. run lint", + "posttest": "npm run lint", "postlint": "template-oss-check", - "lintfix": "node ../.. run lint -- --fix", + "lintfix": "npm run lint -- --fix", "snap": "tap", "template-oss-apply": "template-oss-apply --force" }, diff --git a/workspaces/libnpmpublish/package.json b/workspaces/libnpmpublish/package.json index 95c14d4eaa661..010b09b1357e3 100644 --- a/workspaces/libnpmpublish/package.json +++ b/workspaces/libnpmpublish/package.json @@ -15,9 +15,9 @@ "license": "ISC", "scripts": { "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", - "lintfix": "node ../.. run lint -- --fix", + "lintfix": "npm run lint -- --fix", "test": "tap", - "posttest": "node ../.. run lint", + "posttest": "npm run lint", "postlint": "template-oss-check", "snap": "tap", "template-oss-apply": "template-oss-apply --force" diff --git a/workspaces/libnpmsearch/package.json b/workspaces/libnpmsearch/package.json index 65be90f5fb0a9..eddb7970ac9fa 100644 --- a/workspaces/libnpmsearch/package.json +++ b/workspaces/libnpmsearch/package.json @@ -16,11 +16,11 @@ ], "license": "ISC", "scripts": { - "posttest": "node ../.. run lint", + "posttest": "npm run lint", "test": "tap", "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "postlint": "template-oss-check", - "lintfix": "node ../.. run lint -- --fix", + "lintfix": "npm run lint -- --fix", "snap": "tap", "template-oss-apply": "template-oss-apply --force" }, diff --git a/workspaces/libnpmteam/package.json b/workspaces/libnpmteam/package.json index e80e7579c5569..1d08b59927b7c 100644 --- a/workspaces/libnpmteam/package.json +++ b/workspaces/libnpmteam/package.json @@ -8,9 +8,9 @@ "scripts": { "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "test": "tap", - "posttest": "node ../.. run lint", + "posttest": "npm run lint", "postlint": "template-oss-check", - "lintfix": "node ../.. run lint -- --fix", + "lintfix": "npm run lint -- --fix", "snap": "tap", "template-oss-apply": "template-oss-apply --force" }, diff --git a/workspaces/libnpmversion/package.json b/workspaces/libnpmversion/package.json index 417c102c724b8..a5088e1ac8f12 100644 --- a/workspaces/libnpmversion/package.json +++ b/workspaces/libnpmversion/package.json @@ -17,10 +17,10 @@ "scripts": { "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "test": "tap", - "posttest": "node ../.. run lint", + "posttest": "npm run lint", "snap": "tap", "postlint": "template-oss-check", - "lintfix": "node ../.. run lint -- --fix", + "lintfix": "npm run lint -- --fix", "template-oss-apply": "template-oss-apply --force" }, "tap": {