From 9754b173de26f3173e7f41eab34733fe9ba50f1d 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 4cce29085f3ab..e0619ae267984 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 a9f1714491a4f..2640858b13028 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 b6708e415dae1..70f06cc1ff2ce 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 5a9d53f3f5e2b..2410c2e559fc0 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 6cc88da757933..5ed6535aa2e88 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 d782aa9cd58a5..ba63c1d6ce8a8 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 a974729facda3..51a5429e82556 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 6eb6ad1ecb457..49ce96cb2a7a9 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 ee6c8d749d2c2..95b34c3554283 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 305e89efc836a..0690138e833cf 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 14c8c3fac00a6..d721bbec32236 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 9ae458b52c01d..70a4901483069 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 462f38a478076..edfe521fcb6c6 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 dc747f682fc42..2709685975364 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 26d2fa2a2df46..3d1c950ed714c 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 5d310184bec44..2215f808b6c2b 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 ec5d30cb436ef..da233e308717d 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": {