From 945427e523d644f6468792d42047d196f32e01d7 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Mon, 26 Feb 2024 11:50:32 -0700 Subject: [PATCH] chore: @npmcli/template-oss@4.21.3 --- .eslintrc.js | 1 + .github/actions/create-check/action.yml | 52 +++ .github/actions/install-latest-npm/action.yml | 58 ++++ .github/workflows/audit.yml | 1 - .github/workflows/ci-libnpmaccess.yml | 2 - .github/workflows/ci-libnpmdiff.yml | 2 - .github/workflows/ci-libnpmexec.yml | 2 - .github/workflows/ci-libnpmfund.yml | 2 - .github/workflows/ci-libnpmhook.yml | 2 - .github/workflows/ci-libnpmorg.yml | 2 - .github/workflows/ci-libnpmpack.yml | 2 - .github/workflows/ci-libnpmpublish.yml | 2 - .github/workflows/ci-libnpmsearch.yml | 2 - .github/workflows/ci-libnpmteam.yml | 2 - .github/workflows/ci-libnpmversion.yml | 2 - .github/workflows/ci-npmcli-arborist.yml | 2 - .github/workflows/ci-npmcli-config.yml | 2 - .github/workflows/ci-npmcli-docs.yml | 3 - .github/workflows/ci-npmcli-mock-globals.yml | 2 - .github/workflows/ci-npmcli-mock-registry.yml | 2 - .github/workflows/ci-npmcli-smoke-tests.yml | 2 - .github/workflows/ci-release.yml | 168 ++-------- .github/workflows/ci.yml | 5 - .github/workflows/create-node-pr.yml | 1 - .github/workflows/pull-request.yml | 7 +- .github/workflows/release-integration.yml | 31 ++ .github/workflows/release.yml | 309 +++++++----------- .gitignore | 3 + docs/.eslintrc.js | 3 + docs/.gitignore | 2 + docs/package.json | 8 +- mock-globals/.eslintrc.js | 3 + mock-globals/.gitignore | 2 + mock-globals/package.json | 6 +- mock-registry/.eslintrc.js | 3 + mock-registry/.gitignore | 2 + mock-registry/package.json | 6 +- package.json | 6 +- release-please-config.json | 73 +++-- ...n.yml => _job-release-integration-yml.hbs} | 2 +- .../{_step-deps.yml => _step-deps-yml.hbs} | 0 .../{_step-test.yml => _step-test-yml.hbs} | 2 +- ...npmcli-docs.yml => ci-npmcli-docs-yml.hbs} | 8 +- .../{ci-release.yml => ci-release-yml.hbs} | 14 +- scripts/template-oss/{ci.yml => ci-yml.hbs} | 8 +- ...ate-node-pr.yml => create-node-pr-yml.hbs} | 2 +- ...tegration.yml => node-integration-yml.hbs} | 0 scripts/template-oss/package-json.hbs | 5 + scripts/template-oss/root.js | 18 +- smoke-tests/.eslintrc.js | 3 + smoke-tests/.gitignore | 2 + smoke-tests/package.json | 6 +- workspaces/arborist/.eslintrc.js | 3 + workspaces/arborist/.gitignore | 2 + workspaces/arborist/package.json | 6 +- workspaces/config/.eslintrc.js | 3 + workspaces/config/.gitignore | 2 + workspaces/config/package.json | 6 +- workspaces/libnpmaccess/.eslintrc.js | 3 + workspaces/libnpmaccess/.gitignore | 2 + workspaces/libnpmaccess/package.json | 6 +- workspaces/libnpmdiff/.eslintrc.js | 3 + workspaces/libnpmdiff/.gitignore | 2 + workspaces/libnpmdiff/package.json | 6 +- workspaces/libnpmexec/.eslintrc.js | 3 + workspaces/libnpmexec/.gitignore | 2 + workspaces/libnpmexec/package.json | 6 +- workspaces/libnpmfund/.eslintrc.js | 3 + workspaces/libnpmfund/.gitignore | 2 + workspaces/libnpmfund/package.json | 6 +- workspaces/libnpmhook/.eslintrc.js | 3 + workspaces/libnpmhook/.gitignore | 2 + workspaces/libnpmhook/package.json | 6 +- workspaces/libnpmorg/.eslintrc.js | 3 + workspaces/libnpmorg/.gitignore | 2 + workspaces/libnpmorg/package.json | 6 +- workspaces/libnpmpack/.eslintrc.js | 3 + workspaces/libnpmpack/.gitignore | 2 + workspaces/libnpmpack/package.json | 6 +- workspaces/libnpmpublish/.eslintrc.js | 3 + workspaces/libnpmpublish/.gitignore | 2 + workspaces/libnpmpublish/package.json | 6 +- workspaces/libnpmsearch/.eslintrc.js | 3 + workspaces/libnpmsearch/.gitignore | 2 + workspaces/libnpmsearch/package.json | 6 +- workspaces/libnpmteam/.eslintrc.js | 3 + workspaces/libnpmteam/.gitignore | 2 + workspaces/libnpmteam/package.json | 6 +- workspaces/libnpmversion/.eslintrc.js | 3 + workspaces/libnpmversion/.gitignore | 2 + workspaces/libnpmversion/package.json | 6 +- 91 files changed, 507 insertions(+), 491 deletions(-) create mode 100644 .github/actions/create-check/action.yml create mode 100644 .github/actions/install-latest-npm/action.yml create mode 100644 .github/workflows/release-integration.yml rename scripts/template-oss/{_job-release-integration.yml => _job-release-integration-yml.hbs} (72%) rename scripts/template-oss/{_step-deps.yml => _step-deps-yml.hbs} (100%) rename scripts/template-oss/{_step-test.yml => _step-test-yml.hbs} (69%) rename scripts/template-oss/{ci-npmcli-docs.yml => ci-npmcli-docs-yml.hbs} (82%) rename scripts/template-oss/{ci-release.yml => ci-release-yml.hbs} (79%) rename scripts/template-oss/{ci.yml => ci-yml.hbs} (87%) rename scripts/template-oss/{create-node-pr.yml => create-node-pr-yml.hbs} (93%) rename scripts/template-oss/{node-integration.yml => node-integration-yml.hbs} (100%) create mode 100644 scripts/template-oss/package-json.hbs diff --git a/.eslintrc.js b/.eslintrc.js index 7500bf792a820..b9ba04d34368a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -11,6 +11,7 @@ const localConfigs = readdir(__dirname) module.exports = { root: true, ignorePatterns: [ + 'tap-testdir*/', 'docs/**', 'smoke-tests/**', 'mock-globals/**', diff --git a/.github/actions/create-check/action.yml b/.github/actions/create-check/action.yml new file mode 100644 index 0000000000000..0e7d6ce0f4748 --- /dev/null +++ b/.github/actions/create-check/action.yml @@ -0,0 +1,52 @@ +# This file is automatically added by @npmcli/template-oss. Do not edit. + +name: 'Create Check' +inputs: + name: + required: true + token: + required: true + sha: + required: true + check-name: + default: '' +outputs: + check-id: + value: ${{ steps.create-check.outputs.check_id }} +runs: + using: "composite" + steps: + - name: Get Workflow Job + uses: actions/github-script@v6 + id: workflow + env: + JOB_NAME: "${{ inputs.name }}" + SHA: "${{ inputs.sha }}" + with: + result-encoding: string + script: | + const { repo: { owner, repo}, runId, serverUrl } = context + const { JOB_NAME, SHA } = process.env + + const job = await github.rest.actions.listJobsForWorkflowRun({ + owner, + repo, + run_id: runId, + per_page: 100 + }).then(r => r.data.jobs.find(j => j.name.endsWith(JOB_NAME))) + + return [ + `This check is assosciated with ${serverUrl}/${owner}/${repo}/commit/${SHA}.`, + 'Run logs:', + job?.html_url || `could not be found for a job ending with: "${JOB_NAME}"`, + ].join(' ') + - name: Create Check + uses: LouisBrunner/checks-action@v1.6.0 + id: create-check + with: + token: ${{ inputs.token }} + sha: ${{ inputs.sha }} + status: in_progress + name: ${{ inputs.check-name || inputs.name }} + output: | + {"summary":"${{ steps.workflow.outputs.result }}"} diff --git a/.github/actions/install-latest-npm/action.yml b/.github/actions/install-latest-npm/action.yml new file mode 100644 index 0000000000000..8339dbf03882d --- /dev/null +++ b/.github/actions/install-latest-npm/action.yml @@ -0,0 +1,58 @@ +# This file is automatically added by @npmcli/template-oss. Do not edit. + +name: 'Install Latest npm' +description: 'Install the latest version of npm compatible with the Node version' +inputs: + node: + description: 'Current Node version' + required: true +runs: + using: "composite" + steps: + # node 10/12/14 ship with npm@6, which is known to fail when updating itself in windows + - name: Update Windows npm + if: | + runner.os == 'Windows' && ( + startsWith(inputs.node, 'v10.') || + startsWith(inputs.node, 'v12.') || + startsWith(inputs.node, 'v14.') + ) + shell: cmd + run: | + curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz + tar xf npm-7.5.4.tgz + cd package + node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz + cd .. + rmdir /s /q package + - name: Install Latest npm + shell: bash + env: + NODE_VERSION: ${{ inputs.node }} + working-directory: ${{ runner.temp }} + run: | + MATCH="" + SPECS=("latest" "next-10" "next-9" "next-8" "next-7" "next-6") + + echo "node@$NODE_VERSION" + + for SPEC in ${SPECS[@]}; do + ENGINES=$(npm view npm@$SPEC --json | jq -r '.engines.node') + echo "Checking if node@$NODE_VERSION satisfies npm@$SPEC ($ENGINES)" + + if npx semver -r "$ENGINES" "$NODE_VERSION" > /dev/null; then + MATCH=$SPEC + echo "Found compatible version: npm@$MATCH" + break + fi + done + + if [ -z $MATCH ]; then + echo "Could not find a compatible version of npm for node@$NODE_VERSION" + exit 1 + fi + + npm i --prefer-online --no-fund --no-audit -g npm@$MATCH + - name: npm Version + shell: bash + run: npm -v diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index ebf4331f34ee9..12af9f91ad7c0 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -30,7 +30,6 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps diff --git a/.github/workflows/ci-libnpmaccess.yml b/.github/workflows/ci-libnpmaccess.yml index 962b3d2dc6b9d..9283ece52e3e5 100644 --- a/.github/workflows/ci-libnpmaccess.yml +++ b/.github/workflows/ci-libnpmaccess.yml @@ -39,7 +39,6 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -91,7 +90,6 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps diff --git a/.github/workflows/ci-libnpmdiff.yml b/.github/workflows/ci-libnpmdiff.yml index ba52570bb5fce..7a69e9746f487 100644 --- a/.github/workflows/ci-libnpmdiff.yml +++ b/.github/workflows/ci-libnpmdiff.yml @@ -39,7 +39,6 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -91,7 +90,6 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps diff --git a/.github/workflows/ci-libnpmexec.yml b/.github/workflows/ci-libnpmexec.yml index ab2363427bb86..faa4de83c21d5 100644 --- a/.github/workflows/ci-libnpmexec.yml +++ b/.github/workflows/ci-libnpmexec.yml @@ -39,7 +39,6 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -91,7 +90,6 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps diff --git a/.github/workflows/ci-libnpmfund.yml b/.github/workflows/ci-libnpmfund.yml index 76f843fb275f1..d1fc86fd7fc88 100644 --- a/.github/workflows/ci-libnpmfund.yml +++ b/.github/workflows/ci-libnpmfund.yml @@ -39,7 +39,6 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -91,7 +90,6 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps diff --git a/.github/workflows/ci-libnpmhook.yml b/.github/workflows/ci-libnpmhook.yml index bf2b89574d03f..13cc3bca9b1fc 100644 --- a/.github/workflows/ci-libnpmhook.yml +++ b/.github/workflows/ci-libnpmhook.yml @@ -39,7 +39,6 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -91,7 +90,6 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps diff --git a/.github/workflows/ci-libnpmorg.yml b/.github/workflows/ci-libnpmorg.yml index 0c1e9388924c1..c8c44c26560fe 100644 --- a/.github/workflows/ci-libnpmorg.yml +++ b/.github/workflows/ci-libnpmorg.yml @@ -39,7 +39,6 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -91,7 +90,6 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps diff --git a/.github/workflows/ci-libnpmpack.yml b/.github/workflows/ci-libnpmpack.yml index 378096b12d4b0..7a1c08c84ebc8 100644 --- a/.github/workflows/ci-libnpmpack.yml +++ b/.github/workflows/ci-libnpmpack.yml @@ -39,7 +39,6 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -91,7 +90,6 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps diff --git a/.github/workflows/ci-libnpmpublish.yml b/.github/workflows/ci-libnpmpublish.yml index b87eb60dff424..d458c8e73a193 100644 --- a/.github/workflows/ci-libnpmpublish.yml +++ b/.github/workflows/ci-libnpmpublish.yml @@ -39,7 +39,6 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -91,7 +90,6 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps diff --git a/.github/workflows/ci-libnpmsearch.yml b/.github/workflows/ci-libnpmsearch.yml index 64e462c5d8fc1..1ed48602c121f 100644 --- a/.github/workflows/ci-libnpmsearch.yml +++ b/.github/workflows/ci-libnpmsearch.yml @@ -39,7 +39,6 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -91,7 +90,6 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps diff --git a/.github/workflows/ci-libnpmteam.yml b/.github/workflows/ci-libnpmteam.yml index 6bae0ceb1f729..916d1ab69f40f 100644 --- a/.github/workflows/ci-libnpmteam.yml +++ b/.github/workflows/ci-libnpmteam.yml @@ -39,7 +39,6 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -91,7 +90,6 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps diff --git a/.github/workflows/ci-libnpmversion.yml b/.github/workflows/ci-libnpmversion.yml index 6bf078137fece..9a13243321f69 100644 --- a/.github/workflows/ci-libnpmversion.yml +++ b/.github/workflows/ci-libnpmversion.yml @@ -39,7 +39,6 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -91,7 +90,6 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps diff --git a/.github/workflows/ci-npmcli-arborist.yml b/.github/workflows/ci-npmcli-arborist.yml index 83fd136ef8424..cdbef83e46ca6 100644 --- a/.github/workflows/ci-npmcli-arborist.yml +++ b/.github/workflows/ci-npmcli-arborist.yml @@ -39,7 +39,6 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -91,7 +90,6 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps diff --git a/.github/workflows/ci-npmcli-config.yml b/.github/workflows/ci-npmcli-config.yml index 17b1781107c56..597c2561cfa77 100644 --- a/.github/workflows/ci-npmcli-config.yml +++ b/.github/workflows/ci-npmcli-config.yml @@ -39,7 +39,6 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -91,7 +90,6 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps diff --git a/.github/workflows/ci-npmcli-docs.yml b/.github/workflows/ci-npmcli-docs.yml index 40e4b8139e630..5098e112121cc 100644 --- a/.github/workflows/ci-npmcli-docs.yml +++ b/.github/workflows/ci-npmcli-docs.yml @@ -39,7 +39,6 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -85,7 +84,6 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -120,7 +118,6 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm - - 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 4927571c9a912..88255de6ac7d7 100644 --- a/.github/workflows/ci-npmcli-mock-globals.yml +++ b/.github/workflows/ci-npmcli-mock-globals.yml @@ -39,7 +39,6 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -91,7 +90,6 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps diff --git a/.github/workflows/ci-npmcli-mock-registry.yml b/.github/workflows/ci-npmcli-mock-registry.yml index 933309406bf10..a2181a8094c27 100644 --- a/.github/workflows/ci-npmcli-mock-registry.yml +++ b/.github/workflows/ci-npmcli-mock-registry.yml @@ -39,7 +39,6 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -91,7 +90,6 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps diff --git a/.github/workflows/ci-npmcli-smoke-tests.yml b/.github/workflows/ci-npmcli-smoke-tests.yml index 4b4912b212d8b..7da4ff4f7b943 100644 --- a/.github/workflows/ci-npmcli-smoke-tests.yml +++ b/.github/workflows/ci-npmcli-smoke-tests.yml @@ -39,7 +39,6 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -91,7 +90,6 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml index 3c963eb7f9a7d..220564e90d1ef 100644 --- a/.github/workflows/ci-release.yml +++ b/.github/workflows/ci-release.yml @@ -27,49 +27,6 @@ jobs: run: shell: bash steps: - - name: Get Workflow Job - uses: actions/github-script@v6 - if: inputs.check-sha - id: check-output - env: - JOB_NAME: "Lint All" - MATRIX_NAME: "" - with: - script: | - const { owner, repo } = context.repo - - const { data } = await github.rest.actions.listJobsForWorkflowRun({ - owner, - repo, - run_id: context.runId, - per_page: 100 - }) - - const jobName = process.env.JOB_NAME + process.env.MATRIX_NAME - const job = data.jobs.find(j => j.name.endsWith(jobName)) - const jobUrl = job?.html_url - - const shaUrl = `${context.serverUrl}/${owner}/${repo}/commit/${{ inputs.check-sha }}` - - let summary = `This check is assosciated with ${shaUrl}\n\n` - - if (jobUrl) { - summary += `For run logs, click here: ${jobUrl}` - } else { - summary += `Run logs could not be found for a job with name: "${jobName}"` - } - - return { summary } - - name: Create Check - uses: LouisBrunner/checks-action@v1.6.0 - id: check - if: inputs.check-sha - with: - token: ${{ secrets.GITHUB_TOKEN }} - status: in_progress - name: Lint All - sha: ${{ inputs.check-sha }} - output: ${{ steps.check-output.outputs.result }} - name: Checkout uses: actions/checkout@v3 with: @@ -78,6 +35,14 @@ jobs: run: | git config --global user.email "npm-cli+bot@github.com" git config --global user.name "npm CLI robot" + - name: Create Check + id: create-check + if: ${{ inputs.check-sha }} + uses: ./.github/actions/create-check + with: + name: "Lint All" + token: ${{ secrets.GITHUB_TOKEN }} + sha: ${{ inputs.check-sha }} - name: Setup Node uses: actions/setup-node@v3 id: node @@ -85,7 +50,6 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -96,11 +60,11 @@ jobs: run: node . run postlint --ignore-scripts -ws -iwr --if-present - name: Conclude Check uses: LouisBrunner/checks-action@v1.6.0 - if: steps.check.outputs.check_id && always() + if: always() with: token: ${{ secrets.GITHUB_TOKEN }} conclusion: ${{ job.status }} - check_id: ${{ steps.check.outputs.check_id }} + check_id: ${{ steps.create-check.outputs.check-id }} test-all: name: Test All - ${{ matrix.platform.name }} - ${{ matrix.node-version }} @@ -131,49 +95,6 @@ jobs: run: shell: ${{ matrix.platform.shell }} steps: - - name: Get Workflow Job - uses: actions/github-script@v6 - if: inputs.check-sha - id: check-output - env: - JOB_NAME: "Test All" - MATRIX_NAME: " - ${{ matrix.platform.name }} - ${{ matrix.node-version }}" - with: - script: | - const { owner, repo } = context.repo - - const { data } = await github.rest.actions.listJobsForWorkflowRun({ - owner, - repo, - run_id: context.runId, - per_page: 100 - }) - - const jobName = process.env.JOB_NAME + process.env.MATRIX_NAME - const job = data.jobs.find(j => j.name.endsWith(jobName)) - const jobUrl = job?.html_url - - const shaUrl = `${context.serverUrl}/${owner}/${repo}/commit/${{ inputs.check-sha }}` - - let summary = `This check is assosciated with ${shaUrl}\n\n` - - if (jobUrl) { - summary += `For run logs, click here: ${jobUrl}` - } else { - summary += `Run logs could not be found for a job with name: "${jobName}"` - } - - return { summary } - - name: Create Check - uses: LouisBrunner/checks-action@v1.6.0 - id: check - if: inputs.check-sha - with: - token: ${{ secrets.GITHUB_TOKEN }} - status: in_progress - name: Test All - ${{ matrix.platform.name }} - ${{ matrix.node-version }} - sha: ${{ inputs.check-sha }} - output: ${{ steps.check-output.outputs.result }} - name: Checkout uses: actions/checkout@v3 with: @@ -182,6 +103,14 @@ jobs: run: | git config --global user.email "npm-cli+bot@github.com" git config --global user.name "npm CLI robot" + - name: Create Check + id: create-check + if: ${{ inputs.check-sha }} + uses: ./.github/actions/create-check + with: + name: "Test All - ${{ matrix.platform.name }} - ${{ matrix.node-version }}" + token: ${{ secrets.GITHUB_TOKEN }} + sha: ${{ inputs.check-sha }} - name: Setup Node uses: actions/setup-node@v3 id: node @@ -189,7 +118,6 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -202,11 +130,11 @@ jobs: run: node scripts/git-dirty.js - name: Conclude Check uses: LouisBrunner/checks-action@v1.6.0 - if: steps.check.outputs.check_id && always() + if: always() with: token: ${{ secrets.GITHUB_TOKEN }} conclusion: ${{ job.status }} - check_id: ${{ steps.check.outputs.check_id }} + check_id: ${{ steps.create-check.outputs.check-id }} smoke-publish: # This cant be tested on Windows because our node_modules directory @@ -238,49 +166,6 @@ jobs: run: shell: ${{ matrix.platform.shell }} steps: - - name: Get Workflow Job - uses: actions/github-script@v6 - if: inputs.check-sha - id: check-output - env: - JOB_NAME: "Smoke Publish" - MATRIX_NAME: " - ${{ matrix.platform.name }} - ${{ matrix.node-version }}" - with: - script: | - const { owner, repo } = context.repo - - const { data } = await github.rest.actions.listJobsForWorkflowRun({ - owner, - repo, - run_id: context.runId, - per_page: 100 - }) - - const jobName = process.env.JOB_NAME + process.env.MATRIX_NAME - const job = data.jobs.find(j => j.name.endsWith(jobName)) - const jobUrl = job?.html_url - - const shaUrl = `${context.serverUrl}/${owner}/${repo}/commit/${{ inputs.check-sha }}` - - let summary = `This check is assosciated with ${shaUrl}\n\n` - - if (jobUrl) { - summary += `For run logs, click here: ${jobUrl}` - } else { - summary += `Run logs could not be found for a job with name: "${jobName}"` - } - - return { summary } - - name: Create Check - uses: LouisBrunner/checks-action@v1.6.0 - id: check - if: inputs.check-sha - with: - token: ${{ secrets.GITHUB_TOKEN }} - status: in_progress - name: Smoke Publish - ${{ matrix.platform.name }} - ${{ matrix.node-version }} - sha: ${{ inputs.check-sha }} - output: ${{ steps.check-output.outputs.result }} - name: Checkout uses: actions/checkout@v3 with: @@ -289,6 +174,14 @@ jobs: run: | git config --global user.email "npm-cli+bot@github.com" git config --global user.name "npm CLI robot" + - name: Create Check + id: create-check + if: ${{ inputs.check-sha }} + uses: ./.github/actions/create-check + with: + name: "Smoke Publish - ${{ matrix.platform.name }} - ${{ matrix.node-version }}" + token: ${{ secrets.GITHUB_TOKEN }} + sha: ${{ inputs.check-sha }} - name: Setup Node uses: actions/setup-node@v3 id: node @@ -296,7 +189,6 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -324,8 +216,8 @@ jobs: fi - name: Conclude Check uses: LouisBrunner/checks-action@v1.6.0 - if: steps.check.outputs.check_id && always() + if: always() with: token: ${{ secrets.GITHUB_TOKEN }} conclusion: ${{ job.status }} - check_id: ${{ steps.check.outputs.check_id }} + check_id: ${{ steps.create-check.outputs.check-id }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 34d8a5aa6e898..be3570b747fad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,6 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -99,7 +98,6 @@ jobs: node-version: ${{ matrix.node-version }} check-latest: contains(matrix.node-version, '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -132,7 +130,6 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -161,7 +158,6 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -191,7 +187,6 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps diff --git a/.github/workflows/create-node-pr.yml b/.github/workflows/create-node-pr.yml index 8e25f68d6e264..96cb3c6fe5bad 100644 --- a/.github/workflows/create-node-pr.yml +++ b/.github/workflows/create-node-pr.yml @@ -40,7 +40,6 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index eba2201c068fe..100b68cec4e92 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -34,7 +34,6 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -42,11 +41,9 @@ jobs: - name: Run Commitlint on Commits id: commit continue-on-error: true - run: | - npx --offline commitlint -V --from 'origin/${{ github.base_ref }}' --to ${{ github.event.pull_request.head.sha }} + run: npx --offline commitlint -V --from 'origin/${{ github.base_ref }}' --to ${{ github.event.pull_request.head.sha }} - name: Run Commitlint on PR Title if: steps.commit.outcome == 'failure' env: PR_TITLE: ${{ github.event.pull_request.title }} - run: | - echo "$PR_TITLE" | npx --offline commitlint -V + run: echo "$PR_TITLE" | npx --offline commitlint -V diff --git a/.github/workflows/release-integration.yml b/.github/workflows/release-integration.yml new file mode 100644 index 0000000000000..cfb18e6abc8ba --- /dev/null +++ b/.github/workflows/release-integration.yml @@ -0,0 +1,31 @@ +# This file is automatically added by @npmcli/template-oss. Do not edit. + +name: Release Integration + +on: + workflow_dispatch: + inputs: + releases: + required: true + type: string + description: 'A json array of releases. Required fields: publish: tagName, publishTag. publish check: pkgName, version' + workflow_call: + inputs: + releases: + required: true + type: string + description: 'A json array of releases. Required fields: publish: tagName, publishTag. publish check: pkgName, version' + +jobs: + publish: + strategy: + fail-fast: false + matrix: + nodeVersion: + - 18 + - 20 + - nightly + uses: ./.github/workflows/node-integration.yml + with: + nodeVersion: ${{ matrix.nodeVersion }} + npmVersion: ${{ fromJSON(inputs.releases)[0].version }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 98101a806b9ae..e2c690f52643c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,11 +3,6 @@ name: Release on: - workflow_dispatch: - inputs: - release-pr: - description: a release PR number to rerun release jobs on - type: string push: branches: - latest @@ -22,12 +17,12 @@ jobs: release: outputs: pr: ${{ steps.release.outputs.pr }} - release: ${{ steps.release.outputs.release }} - releases: ${{ steps.release.outputs.releases }} - branch: ${{ steps.release.outputs.pr-branch }} + pr-branch: ${{ steps.release.outputs.pr-branch }} pr-number: ${{ steps.release.outputs.pr-number }} - comment-id: ${{ steps.pr-comment.outputs.result }} - check-id: ${{ steps.check.outputs.check_id }} + pr-sha: ${{ steps.release.outputs.pr-sha }} + releases: ${{ steps.release.outputs.releases }} + comment-id: ${{ steps.create-comment.outputs.comment-id || steps.update-comment.outputs.comment-id }} + check-id: ${{ steps.create-check.outputs.check-id }} name: Release if: github.repository_owner == 'npm' runs-on: ubuntu-latest @@ -48,7 +43,6 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps @@ -57,89 +51,54 @@ jobs: id: release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - npx --offline template-oss-release-please "${{ github.ref_name }}" "${{ inputs.release-pr }}" - - name: Post Pull Request Comment + run: npx --offline template-oss-release-please --branch="${{ github.ref_name }}" --backport="" --defaultTag="latest" + - name: Create Release Manager Comment Text if: steps.release.outputs.pr-number uses: actions/github-script@v6 - id: pr-comment - env: - PR_NUMBER: ${{ steps.release.outputs.pr-number }} - REF_NAME: ${{ github.ref_name }} + id: comment-text with: + result-encoding: string script: | - const { REF_NAME, PR_NUMBER: issue_number } = process.env const { runId, repo: { owner, repo } } = context - const { data: workflow } = await github.rest.actions.getWorkflowRun({ owner, repo, run_id: runId }) - - let body = '## Release Manager\n\n' - - const comments = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number }) - let commentId = comments.find(c => c.user.login === 'github-actions[bot]' && c.body.startsWith(body))?.id - - body += `Release workflow run: ${workflow.html_url}\n\n#### Force CI to Update This Release\n\n` - body += `This PR will be updated and CI will run for every non-\`chore:\` commit that is pushed to \`${REF_NAME}\`. ` - body += `To force CI to update this PR, run this command:\n\n` - body += `\`\`\`\ngh workflow run release.yml -r ${REF_NAME} -R ${owner}/${repo} -f release-pr=${issue_number}\n\`\`\`` - - if (commentId) { - await github.rest.issues.updateComment({ owner, repo, comment_id: commentId, body }) - } else { - const { data: comment } = await github.rest.issues.createComment({ owner, repo, issue_number, body }) - commentId = comment?.id - } - - return commentId - - name: Get Workflow Job - uses: actions/github-script@v6 - if: steps.release.outputs.pr-sha - id: check-output - env: - JOB_NAME: "Release" - MATRIX_NAME: "" + return['## Release Manager', `Release workflow run: ${workflow.html_url}`].join('\n\n') + - name: Find Release Manager Comment + uses: peter-evans/find-comment@v2 + if: steps.release.outputs.pr-number + id: found-comment with: - script: | - const { owner, repo } = context.repo - - const { data } = await github.rest.actions.listJobsForWorkflowRun({ - owner, - repo, - run_id: context.runId, - per_page: 100 - }) - - const jobName = process.env.JOB_NAME + process.env.MATRIX_NAME - const job = data.jobs.find(j => j.name.endsWith(jobName)) - const jobUrl = job?.html_url - - const shaUrl = `${context.serverUrl}/${owner}/${repo}/commit/${{ steps.release.outputs.pr-sha }}` - - let summary = `This check is assosciated with ${shaUrl}\n\n` - - if (jobUrl) { - summary += `For run logs, click here: ${jobUrl}` - } else { - summary += `Run logs could not be found for a job with name: "${jobName}"` - } - - return { summary } + issue-number: ${{ steps.release.outputs.pr-number }} + comment-author: 'github-actions[bot]' + body-includes: '## Release Manager' + - name: Create Release Manager Comment + id: create-comment + if: steps.release.outputs.pr-number && !steps.found-comment.outputs.comment-id + uses: peter-evans/create-or-update-comment@v3 + with: + issue-number: ${{ steps.release.outputs.pr-number }} + body: ${{ steps.comment-text.outputs.result }} + - name: Update Release Manager Comment + id: update-comment + if: steps.release.outputs.pr-number && steps.found-comment.outputs.comment-id + uses: peter-evans/create-or-update-comment@v3 + with: + comment-id: ${{ steps.found-comment.outputs.comment-id }} + body: ${{ steps.comment-text.outputs.result }} + edit-mode: 'replace' - name: Create Check - uses: LouisBrunner/checks-action@v1.6.0 - id: check + id: create-check + uses: ./.github/actions/create-check if: steps.release.outputs.pr-sha with: + name: "Release" token: ${{ secrets.GITHUB_TOKEN }} - status: in_progress - name: Release sha: ${{ steps.release.outputs.pr-sha }} - output: ${{ steps.check-output.outputs.result }} update: needs: release outputs: sha: ${{ steps.commit.outputs.sha }} - check-id: ${{ steps.check.outputs.check_id }} + check-id: ${{ steps.create-check.outputs.check-id }} name: Update - Release if: github.repository_owner == 'npm' && needs.release.outputs.pr runs-on: ubuntu-latest @@ -151,7 +110,7 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 - ref: ${{ needs.release.outputs.branch }} + ref: ${{ needs.release.outputs.pr-branch }} - name: Setup Git User run: | git config --global user.email "npm-cli+bot@github.com" @@ -163,19 +122,25 @@ jobs: node-version: 20.x check-latest: contains('20.x', '.x') cache: npm - - name: Check Git Status run: node scripts/git-dirty.js - name: Reset Deps run: node scripts/resetdeps.js + - name: Create Release Manager Checklist Text + id: comment-text + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: node . exec --offline -- template-oss-release-manager --pr="${{ needs.release.outputs.pr-number }}" --backport="" --defaultTag="latest" --lockfile + - name: Append Release Manager Comment + uses: peter-evans/create-or-update-comment@v3 + with: + comment-id: ${{ needs.release.outputs.comment-id }} + body: ${{ steps.comment-text.outputs.result }} + edit-mode: 'append' - name: Run Post Pull Request Actions env: - RELEASE_PR_NUMBER: ${{ needs.release.outputs.pr-number }} - RELEASE_COMMENT_ID: ${{ needs.release.outputs.comment-id }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - node . exec --offline -- template-oss-release-manager --lockfile=true --publish=false - node . run rp-pull-request --ignore-scripts -ws -iwr --if-present + run: node . run rp-pull-request --ignore-scripts -ws -iwr --if-present -- --pr="${{ needs.release.outputs.pr-number }}" --commentId="${{ needs.release.outputs.comment-id }}" - name: Commit id: commit env: @@ -184,52 +149,16 @@ jobs: git commit --all --amend --no-edit || true git push --force-with-lease echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT - - name: Get Workflow Job - uses: actions/github-script@v6 - if: steps.commit.outputs.sha - id: check-output - env: - JOB_NAME: "Update - Release" - MATRIX_NAME: "" - with: - script: | - const { owner, repo } = context.repo - - const { data } = await github.rest.actions.listJobsForWorkflowRun({ - owner, - repo, - run_id: context.runId, - per_page: 100 - }) - - const jobName = process.env.JOB_NAME + process.env.MATRIX_NAME - const job = data.jobs.find(j => j.name.endsWith(jobName)) - const jobUrl = job?.html_url - - const shaUrl = `${context.serverUrl}/${owner}/${repo}/commit/${{ steps.commit.outputs.sha }}` - - let summary = `This check is assosciated with ${shaUrl}\n\n` - - if (jobUrl) { - summary += `For run logs, click here: ${jobUrl}` - } else { - summary += `Run logs could not be found for a job with name: "${jobName}"` - } - - return { summary } - name: Create Check - uses: LouisBrunner/checks-action@v1.6.0 - id: check - if: steps.commit.outputs.sha + id: create-check + uses: ./.github/actions/create-check with: + name: "Update - Release" + check-name: "Release" token: ${{ secrets.GITHUB_TOKEN }} - status: in_progress - name: Release sha: ${{ steps.commit.outputs.sha }} - output: ${{ steps.check-output.outputs.result }} - name: Conclude Check uses: LouisBrunner/checks-action@v1.6.0 - if: needs.release.outputs.check-id && always() with: token: ${{ secrets.GITHUB_TOKEN }} conclusion: ${{ job.status }} @@ -241,7 +170,7 @@ jobs: if: needs.release.outputs.pr uses: ./.github/workflows/ci-release.yml with: - ref: ${{ needs.release.outputs.branch }} + ref: ${{ needs.release.outputs.pr-branch }} check-sha: ${{ needs.update.outputs.sha }} post-ci: @@ -253,8 +182,8 @@ jobs: run: shell: bash steps: - - name: Get Needs Result - id: needs-result + - name: Get CI Conclusion + id: conclusion run: | result="" if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then @@ -267,14 +196,15 @@ jobs: echo "result=$result" >> $GITHUB_OUTPUT - name: Conclude Check uses: LouisBrunner/checks-action@v1.6.0 - if: needs.update.outputs.check-id && always() with: token: ${{ secrets.GITHUB_TOKEN }} - conclusion: ${{ steps.needs-result.outputs.result }} + conclusion: ${{ steps.conclusion.outputs.result }} check_id: ${{ needs.update.outputs.check-id }} post-release: needs: release + outputs: + comment-id: ${{ steps.create-comment.outputs.comment-id }} name: Post Release - Release if: github.repository_owner == 'npm' && needs.release.outputs.releases runs-on: ubuntu-latest @@ -282,66 +212,50 @@ jobs: run: shell: bash steps: - - name: Create Release PR Comment + - name: Create Release PR Comment Text + id: comment-text uses: actions/github-script@v6 env: RELEASES: ${{ needs.release.outputs.releases }} with: + result-encoding: string script: | const releases = JSON.parse(process.env.RELEASES) const { runId, repo: { owner, repo } } = context const issue_number = releases[0].prNumber - - let body = '## Release Workflow\n\n' - for (const { pkgName, version, url } of releases) { - body += `- \`${pkgName}@${version}\` ${url}\n` - } - - const comments = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number }) - .then(cs => cs.map(c => ({ id: c.id, login: c.user.login, body: c.body }))) - console.log(`Found comments: ${JSON.stringify(comments, null, 2)}`) - const releaseComments = comments.filter(c => c.login === 'github-actions[bot]' && c.body.includes('Release is at')) - - for (const comment of releaseComments) { - console.log(`Release comment: ${JSON.stringify(comment, null, 2)}`) - await github.rest.issues.deleteComment({ owner, repo, comment_id: comment.id }) - } - const runUrl = `https://github.com/${owner}/${repo}/actions/runs/${runId}` - await github.rest.issues.createComment({ - owner, - repo, - issue_number, - body: `${body}- Workflow run: :arrows_counterclockwise: ${runUrl}`, - }) + + return [ + '## Release Workflow\n', + ...releases.map(r => `- \`${r.pkgName}@${r.version}\` ${r.url}`), + `- Workflow run: :arrows_counterclockwise: ${runUrl}`, + ].join('\n') + - name: Create Release PR Comment + id: create-comment + uses: peter-evans/create-or-update-comment@v3 + with: + issue-number: ${{ fromJSON(needs.release.outputs.releases)[0].prNumber }} + body: ${{ steps.comment-text.outputs.result }} release-integration: needs: release name: Release Integration - if: needs.release.outputs.release - strategy: - fail-fast: false - matrix: - nodeVersion: - - 18 - - 20 - - nightly - uses: ./.github/workflows/node-integration.yml + if: needs.release.outputs.releases + uses: ./.github/workflows/release-integration.yml with: - nodeVersion: ${{ matrix.nodeVersion }} - npmVersion: ${{ fromJSON(needs.release.outputs.release).version }} + releases: ${{ needs.release.outputs.releases }} post-release-integration: - needs: [ release, release-integration ] + needs: [ release, release-integration, post-release ] name: Post Release Integration - Release - if: github.repository_owner == 'npm' && needs.release.outputs.release && always() + if: github.repository_owner == 'npm' && needs.release.outputs.releases && always() runs-on: ubuntu-latest defaults: run: shell: bash steps: - - name: Get Needs Result - id: needs-result + - name: Get Post Release Conclusion + id: conclusion run: | if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then result="x" @@ -351,39 +265,38 @@ jobs: result="white_check_mark" fi echo "result=$result" >> $GITHUB_OUTPUT - - name: Update Release PR Comment + - name: Find Release PR Comment + uses: peter-evans/find-comment@v2 + id: found-comment + with: + issue-number: ${{ fromJSON(needs.release.outputs.releases)[0].prNumber }} + comment-author: 'github-actions[bot]' + body-includes: '## Release Workflow' + - name: Create Release PR Comment Text + id: comment-text + if: steps.found-comment.outputs.comment-id uses: actions/github-script@v6 env: - PR_NUMBER: ${{ fromJSON(needs.release.outputs.release).prNumber }} - RESULT: ${{ steps.needs-result.outputs.result }} + RESULT: ${{ steps.conclusion.outputs.result }} + BODY: ${{ steps.found-comment.outputs.comment-body }} with: + result-encoding: string script: | - const { PR_NUMBER: issue_number, RESULT } = process.env - const { runId, repo: { owner, repo } } = context - - const comments = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number }) - const updateComment = comments.find(c => - c.user.login === 'github-actions[bot]' && - c.body.startsWith('## Release Workflow\n\n') && - c.body.includes(runId) - ) - - if (updateComment) { - console.log('Found comment to update:', JSON.stringify(updateComment, null, 2)) - let body = updateComment.body.replace(/Workflow run: :[a-z_]+:/, `Workflow run: :${RESULT}:`) - const tagCodeowner = RESULT !== 'white_check_mark' - if (tagCodeowner) { - body += `\n\n:rotating_light:` - body += ` @npm/cli-team: The post-release workflow failed for this release.` - body += ` Manual steps may need to be taken after examining the workflow output` - body += ` from the above workflow run. :rotating_light:` - } - await github.rest.issues.updateComment({ - owner, - repo, - body, - comment_id: updateComment.id, - }) - } else { - console.log('No matching comments found:', JSON.stringify(comments, null, 2)) + const { RESULT, BODY } = process.env + const body = [BODY.replace(/(Workflow run: :)[a-z_]+(:)/, `$1${RESULT}$2`)] + if (RESULT !== 'white_check_mark') { + body.push(':rotating_light::rotating_light::rotating_light:') + body.push([ + '@npm/cli-team: The post-release workflow failed for this release.', + 'Manual steps may need to be taken after examining the workflow output.' + ].join(' ')) + body.push(':rotating_light::rotating_light::rotating_light:') } + return body.join('\n\n').trim() + - name: Update Release PR Comment + if: steps.comment-text.outputs.result + uses: peter-evans/create-or-update-comment@v3 + with: + comment-id: ${{ steps.found-comment.outputs.comment-id }} + body: ${{ steps.comment-text.outputs.result }} + edit-mode: 'replace' diff --git a/.gitignore b/.gitignore index 5135a77dff8dd..2a10ae9bd8888 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ # ignore everything in the root /* +# transient test directories +tap-testdir*/ # keep these !**/.gitignore @@ -38,6 +40,7 @@ !/SECURITY.md !/tap-snapshots/ !/test/ +!/tsconfig.json !/docs/ !/smoke-tests/ !/mock-globals/ diff --git a/docs/.eslintrc.js b/docs/.eslintrc.js index 5db9f815536f1..f21d26eccec7d 100644 --- a/docs/.eslintrc.js +++ b/docs/.eslintrc.js @@ -10,6 +10,9 @@ const localConfigs = readdir(__dirname) module.exports = { root: true, + ignorePatterns: [ + 'tap-testdir*/', + ], extends: [ '@npmcli', ...localConfigs, diff --git a/docs/.gitignore b/docs/.gitignore index 79af2bfcaa4d8..a96d056a7064e 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -2,6 +2,8 @@ # ignore everything in the root /* +# transient test directories +tap-testdir*/ # keep these !**/.gitignore diff --git a/docs/package.json b/docs/package.json index 2993141489fdb..8b31c90ba6798 100644 --- a/docs/package.json +++ b/docs/package.json @@ -5,7 +5,7 @@ "private": true, "main": "lib/index.js", "scripts": { - "lint": "eslint \"**/*.js\"", + "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "postlint": "template-oss-check", "template-oss-apply": "template-oss-apply --force", "lintfix": "node .. run lint -- --fix", @@ -23,7 +23,7 @@ "@isaacs/string-locale-compare": "^1.1.0", "@npmcli/config": "^6.1.7", "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.19.0", + "@npmcli/template-oss": "4.21.3", "front-matter": "^4.0.2", "ignore-walk": "^6.0.1", "jsdom": "^21.1.0", @@ -57,11 +57,11 @@ "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", "ciVersions": "latest", "engines": "^14.17.0 || ^16.13.0 || >=18.0.0", - "version": "4.19.0", + "version": "4.21.3", "content": "../scripts/template-oss/index.js", "workspaceRepo": { "add": { - ".github/workflows/ci-{{ pkgNameFs }}.yml": "ci-npmcli-docs.yml" + ".github/workflows/ci-{{ pkgNameFs }}.yml": "ci-npmcli-docs-yml.hbs" } } } diff --git a/mock-globals/.eslintrc.js b/mock-globals/.eslintrc.js index 5db9f815536f1..f21d26eccec7d 100644 --- a/mock-globals/.eslintrc.js +++ b/mock-globals/.eslintrc.js @@ -10,6 +10,9 @@ const localConfigs = readdir(__dirname) module.exports = { root: true, + ignorePatterns: [ + 'tap-testdir*/', + ], extends: [ '@npmcli', ...localConfigs, diff --git a/mock-globals/.gitignore b/mock-globals/.gitignore index 79af2bfcaa4d8..a96d056a7064e 100644 --- a/mock-globals/.gitignore +++ b/mock-globals/.gitignore @@ -2,6 +2,8 @@ # ignore everything in the root /* +# transient test directories +tap-testdir*/ # keep these !**/.gitignore diff --git a/mock-globals/package.json b/mock-globals/package.json index a06f91e4509de..92b82c9da30eb 100644 --- a/mock-globals/package.json +++ b/mock-globals/package.json @@ -6,7 +6,7 @@ "private": true, "scripts": { "test": "tap", - "lint": "eslint \"**/*.js\"", + "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "postlint": "template-oss-check", "template-oss-apply": "template-oss-apply --force", "lintfix": "node .. run lint -- --fix", @@ -34,7 +34,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.19.0" + "version": "4.21.3" }, "tap": { "branches": 89, @@ -48,7 +48,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.1", - "@npmcli/template-oss": "4.19.0", + "@npmcli/template-oss": "4.21.3", "tap": "^16.3.2" } } diff --git a/mock-registry/.eslintrc.js b/mock-registry/.eslintrc.js index 5db9f815536f1..f21d26eccec7d 100644 --- a/mock-registry/.eslintrc.js +++ b/mock-registry/.eslintrc.js @@ -10,6 +10,9 @@ const localConfigs = readdir(__dirname) module.exports = { root: true, + ignorePatterns: [ + 'tap-testdir*/', + ], extends: [ '@npmcli', ...localConfigs, diff --git a/mock-registry/.gitignore b/mock-registry/.gitignore index 79af2bfcaa4d8..a96d056a7064e 100644 --- a/mock-registry/.gitignore +++ b/mock-registry/.gitignore @@ -2,6 +2,8 @@ # ignore everything in the root /* +# transient test directories +tap-testdir*/ # keep these !**/.gitignore diff --git a/mock-registry/package.json b/mock-registry/package.json index ef8516e0b3ae2..f5058523b254d 100644 --- a/mock-registry/package.json +++ b/mock-registry/package.json @@ -6,7 +6,7 @@ "private": true, "scripts": { "test": "tap", - "lint": "eslint \"**/*.js\"", + "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "postlint": "template-oss-check", "template-oss-apply": "template-oss-apply --force", "lintfix": "node .. run lint -- --fix", @@ -34,7 +34,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.19.0" + "version": "4.21.3" }, "tap": { "no-coverage": true, @@ -46,7 +46,7 @@ "devDependencies": { "@npmcli/arborist": "^6.1.1", "@npmcli/eslint-config": "^4.0.1", - "@npmcli/template-oss": "4.19.0", + "@npmcli/template-oss": "4.21.3", "json-stringify-safe": "^5.0.1", "nock": "^13.3.0", "npm-package-arg": "^10.1.0", diff --git a/package.json b/package.json index 4efc468e31422..feb7cf4fd3dcf 100644 --- a/package.json +++ b/package.json @@ -200,7 +200,7 @@ "@npmcli/git": "^4.1.0", "@npmcli/mock-globals": "^1.0.0", "@npmcli/mock-registry": "^1.0.0", - "@npmcli/template-oss": "4.19.0", + "@npmcli/template-oss": "4.21.3", "@tufjs/repo-mock": "^1.3.1", "ajv": "^8.12.0", "ajv-formats": "^2.1.1", @@ -225,7 +225,7 @@ "snap": "tap", "prepack": "node . run build -w docs", "posttest": "node . run lint", - "lint": "eslint \"**/*.js\"", + "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "lintfix": "node . run lint -- --fix", "lint-all": "node . run lint -ws -iwr --if-present", "resetdeps": "node scripts/resetdeps.js", @@ -256,7 +256,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.19.0", + "version": "4.21.3", "content": "./scripts/template-oss/root.js" }, "license": "Artistic-2.0", diff --git a/release-please-config.json b/release-please-config.json index 1f55692a80bac..98e7f50ba4caf 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -1,66 +1,67 @@ { "plugins": [ - "node-workspace" + "node-workspace", + "node-workspace-format" ], "changelog-sections": [ { "type": "feat", "section": "Features", - "hidden": false + "hidden": false, + "collapse": false }, { "type": "fix", "section": "Bug Fixes", - "hidden": false + "hidden": false, + "collapse": false }, { "type": "docs", "section": "Documentation", - "hidden": false + "hidden": false, + "collapse": false }, { "type": "deps", "section": "Dependencies", - "hidden": false + "hidden": false, + "collapse": false }, { "type": "chore", - "hidden": true + "section": "Chores", + "hidden": false, + "collapse": false } ], "packages": { ".": { - "package-name": "" - }, - "workspaces/arborist": { - }, - "workspaces/config": { - }, - "workspaces/libnpmaccess": { - }, - "workspaces/libnpmdiff": { - }, - "workspaces/libnpmexec": { - }, - "workspaces/libnpmfund": { - }, - "workspaces/libnpmhook": { - }, - "workspaces/libnpmorg": { - }, - "workspaces/libnpmpack": { - }, - "workspaces/libnpmpublish": { - }, - "workspaces/libnpmsearch": { - }, - "workspaces/libnpmteam": { - }, - "workspaces/libnpmversion": { - } + "package-name": "", + "exclude-paths": [ + "docs", + "smoke-tests", + "mock-globals", + "mock-registry", + "workspaces" + ] + }, + "workspaces/arborist": {}, + "workspaces/config": {}, + "workspaces/libnpmaccess": {}, + "workspaces/libnpmdiff": {}, + "workspaces/libnpmexec": {}, + "workspaces/libnpmfund": {}, + "workspaces/libnpmhook": {}, + "workspaces/libnpmorg": {}, + "workspaces/libnpmpack": {}, + "workspaces/libnpmpublish": {}, + "workspaces/libnpmsearch": {}, + "workspaces/libnpmteam": {}, + "workspaces/libnpmversion": {} }, "prerelease": false, - "exclude-packages-from-root": true, "group-pull-request-title-pattern": "chore: release ${version}", - "pull-request-title-pattern": "chore: release${component} ${version}" + "pull-request-title-pattern": "chore: release${component} ${version}", + "prerelease-type": "pre" } diff --git a/scripts/template-oss/_job-release-integration.yml b/scripts/template-oss/_job-release-integration-yml.hbs similarity index 72% rename from scripts/template-oss/_job-release-integration.yml rename to scripts/template-oss/_job-release-integration-yml.hbs index 248bd5276e10e..4898733c57e4c 100644 --- a/scripts/template-oss/_job-release-integration.yml +++ b/scripts/template-oss/_job-release-integration-yml.hbs @@ -8,4 +8,4 @@ strategy: uses: ./.github/workflows/node-integration.yml with: nodeVersion: $\{{ matrix.nodeVersion }} - npmVersion: $\{{ fromJSON(needs.release.outputs.release).version }} + npmVersion: $\{{ fromJSON(inputs.releases)[0].version }} diff --git a/scripts/template-oss/_step-deps.yml b/scripts/template-oss/_step-deps-yml.hbs similarity index 100% rename from scripts/template-oss/_step-deps.yml rename to scripts/template-oss/_step-deps-yml.hbs diff --git a/scripts/template-oss/_step-test.yml b/scripts/template-oss/_step-test-yml.hbs similarity index 69% rename from scripts/template-oss/_step-test.yml rename to scripts/template-oss/_step-test-yml.hbs index f46e11cdc39fd..f25fc951350c9 100644 --- a/scripts/template-oss/_step-test.yml +++ b/scripts/template-oss/_step-test-yml.hbs @@ -1,3 +1,3 @@ -{{> defaultStepTest }} +{{> defaultStepTestYml }} - name: Check Git Status run: node scripts/git-dirty.js diff --git a/scripts/template-oss/ci-npmcli-docs.yml b/scripts/template-oss/ci-npmcli-docs-yml.hbs similarity index 82% rename from scripts/template-oss/ci-npmcli-docs.yml rename to scripts/template-oss/ci-npmcli-docs-yml.hbs index 82397433e0671..a5c4733e59581 100644 --- a/scripts/template-oss/ci-npmcli-docs.yml +++ b/scripts/template-oss/ci-npmcli-docs-yml.hbs @@ -1,7 +1,11 @@ -{{> ci }} +{{> ciYml }} compare-docs: - {{> job jobName="Compare Docs" jobCheckout=(obj fetch-depth=0) jobIf="github.event_name == 'pull_request'" }} + {{> jobYml + jobName="Compare Docs" + jobCheckout=(obj fetch-depth=0) + jobIf="github.event_name == 'pull_request'" + }} - name: Build Docs run: | node . run build -w docs diff --git a/scripts/template-oss/ci-release.yml b/scripts/template-oss/ci-release-yml.hbs similarity index 79% rename from scripts/template-oss/ci-release.yml rename to scripts/template-oss/ci-release-yml.hbs index 5170c6e399981..c3baff23c906b 100644 --- a/scripts/template-oss/ci-release.yml +++ b/scripts/template-oss/ci-release-yml.hbs @@ -1,14 +1,14 @@ -{{> ciRelease}} +{{> ciReleaseYml }} smoke-publish: # This cant be tested on Windows because our node_modules directory # checks in symlinks which are not supported there. This should be # fixed somehow, because this means some forms of local development # are likely broken on Windows as well. - {{> jobMatrix + {{> jobMatrixYml jobName="Smoke Publish" - jobCheck=(obj sha="inputs.check-sha") jobCheckout=(obj ref="${{ inputs.ref }}") + jobCreateCheck=(obj sha="${{ inputs.check-sha }}") windowsCI=false }} - name: Pack @@ -32,4 +32,10 @@ echo "found: $NPM_GLOBAL_VERSION, expected: $NPM_VERSION" exit 1 fi - {{> stepChecks jobCheck=true }} + - name: Conclude Check + uses: LouisBrunner/checks-action@v1.6.0 + if: always() + with: + token: $\{{ secrets.GITHUB_TOKEN }} + conclusion: $\{{ job.status }} + check_id: $\{{ steps.create-check.outputs.check-id }} diff --git a/scripts/template-oss/ci.yml b/scripts/template-oss/ci-yml.hbs similarity index 87% rename from scripts/template-oss/ci.yml rename to scripts/template-oss/ci-yml.hbs index a00a161f1a86a..bdd4e3b5ccab5 100644 --- a/scripts/template-oss/ci.yml +++ b/scripts/template-oss/ci-yml.hbs @@ -1,12 +1,12 @@ -{{> ci }} +{{> ciYml }} licenses: - {{> job jobName="Check Licenses" }} + {{> jobYml jobName="Check Licenses" }} - name: Check Licenses run: {{rootNpmPath}} run licenses smoke-tests: - {{> job jobName="Smoke Tests" }} + {{> jobYml jobName="Smoke Tests" }} - name: Run Smoke Tests run: {{rootNpmPath}} test -w smoke-tests --ignore-scripts - name: Check Git Status @@ -19,7 +19,7 @@ run: shell: cmd steps: - {{> stepsSetup }} + {{> stepsSetupYml }} - name: Setup WSL uses: Vampire/setup-wsl@v2.0.1 - name: Setup Cygwin diff --git a/scripts/template-oss/create-node-pr.yml b/scripts/template-oss/create-node-pr-yml.hbs similarity index 93% rename from scripts/template-oss/create-node-pr.yml rename to scripts/template-oss/create-node-pr-yml.hbs index 3946ba7b264ed..80279c02220e8 100644 --- a/scripts/template-oss/create-node-pr.yml +++ b/scripts/template-oss/create-node-pr-yml.hbs @@ -16,7 +16,7 @@ on: jobs: create-pull-request: - {{> job jobName="Create Node PR" jobCheckout=(obj fetch-depth=0) }} + {{> jobYml jobName="Create Node PR" jobCheckout=(obj fetch-depth=0) }} - name: Checkout Node uses: actions/checkout@v3 with: diff --git a/scripts/template-oss/node-integration.yml b/scripts/template-oss/node-integration-yml.hbs similarity index 100% rename from scripts/template-oss/node-integration.yml rename to scripts/template-oss/node-integration-yml.hbs diff --git a/scripts/template-oss/package-json.hbs b/scripts/template-oss/package-json.hbs new file mode 100644 index 0000000000000..c20b2f9c2feeb --- /dev/null +++ b/scripts/template-oss/package-json.hbs @@ -0,0 +1,5 @@ +{ + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } +} diff --git a/scripts/template-oss/root.js b/scripts/template-oss/root.js index 22ddf00264f19..ff8a67b578103 100644 --- a/scripts/template-oss/root.js +++ b/scripts/template-oss/root.js @@ -2,6 +2,7 @@ module.exports = { rootModule: { add: { 'CONTRIBUTING.md': false, + 'package.json': { file: 'package-json.hbs', overwrite: false }, }, }, rootRepo: { @@ -10,11 +11,11 @@ module.exports = { '.github/ISSUE_TEMPLATE/config.yml': false, '.github/dependabot.yml': false, '.github/settings.yml': false, - '.github/workflows/ci-release.yml': 'ci-release.yml', - '.github/workflows/ci.yml': 'ci.yml', - '.github/workflows/create-node-pr.yml': 'create-node-pr.yml', - '.github/workflows/node-integration.yml': 'node-integration.yml', '.github/workflows/post-dependabot.yml': false, + '.github/workflows/ci-release.yml': 'ci-release-yml.hbs', + '.github/workflows/ci.yml': 'ci-yml.hbs', + '.github/workflows/create-node-pr.yml': 'create-node-pr-yml.hbs', + '.github/workflows/node-integration.yml': 'node-integration-yml.hbs', }, }, workspaceRepo: { @@ -24,6 +25,12 @@ module.exports = { '.github/workflows/ci-release.yml': false, '.github/workflows/post-dependabot.yml': false, '.github/workflows/release.yml': false, + '.github/workflows/pull-request.yml': false, + }, + }, + workspaceModule: { + add: { + 'package.json': { file: 'package-json.hbs', overwrite: false }, }, }, lockfile: true, @@ -35,7 +42,10 @@ module.exports = { 'docs/output/', 'man/', ], + allowDistPaths: false, allowPaths: [ + '/bin/', + '/lib/', '/node_modules/', '/index.js', '/DEPENDENCIES.md', diff --git a/smoke-tests/.eslintrc.js b/smoke-tests/.eslintrc.js index 5db9f815536f1..f21d26eccec7d 100644 --- a/smoke-tests/.eslintrc.js +++ b/smoke-tests/.eslintrc.js @@ -10,6 +10,9 @@ const localConfigs = readdir(__dirname) module.exports = { root: true, + ignorePatterns: [ + 'tap-testdir*/', + ], extends: [ '@npmcli', ...localConfigs, diff --git a/smoke-tests/.gitignore b/smoke-tests/.gitignore index 79af2bfcaa4d8..a96d056a7064e 100644 --- a/smoke-tests/.gitignore +++ b/smoke-tests/.gitignore @@ -2,6 +2,8 @@ # ignore everything in the root /* +# transient test directories +tap-testdir*/ # keep these !**/.gitignore diff --git a/smoke-tests/package.json b/smoke-tests/package.json index 21842fc9bbd9b..2b4bc593e64b6 100644 --- a/smoke-tests/package.json +++ b/smoke-tests/package.json @@ -4,7 +4,7 @@ "version": "1.0.1", "private": true, "scripts": { - "lint": "eslint \"**/*.js\"", + "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "postlint": "template-oss-check", "template-oss-apply": "template-oss-apply --force", "lintfix": "node .. run lint -- --fix", @@ -21,7 +21,7 @@ "@npmcli/eslint-config": "^4.0.0", "@npmcli/mock-registry": "^1.0.0", "@npmcli/promise-spawn": "^6.0.2", - "@npmcli/template-oss": "4.19.0", + "@npmcli/template-oss": "4.21.3", "proxy": "^2.1.1", "tap": "^16.3.4", "which": "^3.0.0" @@ -30,7 +30,7 @@ "license": "ISC", "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.19.0", + "version": "4.21.3", "content": "../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/arborist/.eslintrc.js b/workspaces/arborist/.eslintrc.js index 5db9f815536f1..f21d26eccec7d 100644 --- a/workspaces/arborist/.eslintrc.js +++ b/workspaces/arborist/.eslintrc.js @@ -10,6 +10,9 @@ const localConfigs = readdir(__dirname) module.exports = { root: true, + ignorePatterns: [ + 'tap-testdir*/', + ], extends: [ '@npmcli', ...localConfigs, diff --git a/workspaces/arborist/.gitignore b/workspaces/arborist/.gitignore index 79af2bfcaa4d8..a96d056a7064e 100644 --- a/workspaces/arborist/.gitignore +++ b/workspaces/arborist/.gitignore @@ -2,6 +2,8 @@ # ignore everything in the root /* +# transient test directories +tap-testdir*/ # keep these !**/.gitignore diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index 5caf7268ceaea..c5b8d0029eab7 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -39,7 +39,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.19.0", + "@npmcli/template-oss": "4.21.3", "benchmark": "^2.1.4", "minify-registry-metadata": "^3.0.0", "nock": "^13.3.0", @@ -52,7 +52,7 @@ "posttest": "node ../.. run lint", "snap": "tap", "test-proxy": "ARBORIST_TEST_PROXY=1 tap --snapshot", - "lint": "eslint \"**/*.js\"", + "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "lintfix": "node ../.. run lint -- --fix", "benchmark": "node scripts/benchmark.js", "benchclean": "rm -rf scripts/benchmark/*/", @@ -91,7 +91,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.19.0", + "version": "4.21.3", "content": "../../scripts/template-oss/index.js" } } diff --git a/workspaces/config/.eslintrc.js b/workspaces/config/.eslintrc.js index 5db9f815536f1..f21d26eccec7d 100644 --- a/workspaces/config/.eslintrc.js +++ b/workspaces/config/.eslintrc.js @@ -10,6 +10,9 @@ const localConfigs = readdir(__dirname) module.exports = { root: true, + ignorePatterns: [ + 'tap-testdir*/', + ], extends: [ '@npmcli', ...localConfigs, diff --git a/workspaces/config/.gitignore b/workspaces/config/.gitignore index 79af2bfcaa4d8..a96d056a7064e 100644 --- a/workspaces/config/.gitignore +++ b/workspaces/config/.gitignore @@ -2,6 +2,8 @@ # ignore everything in the root /* +# transient test directories +tap-testdir*/ # keep these !**/.gitignore diff --git a/workspaces/config/package.json b/workspaces/config/package.json index 348876474a222..e9b1cf4c0d348 100644 --- a/workspaces/config/package.json +++ b/workspaces/config/package.json @@ -17,7 +17,7 @@ "scripts": { "test": "tap", "snap": "tap", - "lint": "eslint \"**/*.js\"", + "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "postlint": "template-oss-check", "lintfix": "node ../.. run lint -- --fix", "posttest": "node ../.. run lint", @@ -32,7 +32,7 @@ "devDependencies": { "@npmcli/eslint-config": "^4.0.0", "@npmcli/mock-globals": "^1.0.0", - "@npmcli/template-oss": "4.19.0", + "@npmcli/template-oss": "4.21.3", "tap": "^16.3.4" }, "dependencies": { @@ -50,7 +50,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.19.0", + "version": "4.21.3", "content": "../../scripts/template-oss/index.js" } } diff --git a/workspaces/libnpmaccess/.eslintrc.js b/workspaces/libnpmaccess/.eslintrc.js index 5db9f815536f1..f21d26eccec7d 100644 --- a/workspaces/libnpmaccess/.eslintrc.js +++ b/workspaces/libnpmaccess/.eslintrc.js @@ -10,6 +10,9 @@ const localConfigs = readdir(__dirname) module.exports = { root: true, + ignorePatterns: [ + 'tap-testdir*/', + ], extends: [ '@npmcli', ...localConfigs, diff --git a/workspaces/libnpmaccess/.gitignore b/workspaces/libnpmaccess/.gitignore index 79af2bfcaa4d8..a96d056a7064e 100644 --- a/workspaces/libnpmaccess/.gitignore +++ b/workspaces/libnpmaccess/.gitignore @@ -2,6 +2,8 @@ # ignore everything in the root /* +# transient test directories +tap-testdir*/ # keep these !**/.gitignore diff --git a/workspaces/libnpmaccess/package.json b/workspaces/libnpmaccess/package.json index 67e1537e70b3f..efa404d507d21 100644 --- a/workspaces/libnpmaccess/package.json +++ b/workspaces/libnpmaccess/package.json @@ -6,7 +6,7 @@ "license": "ISC", "main": "lib/index.js", "scripts": { - "lint": "eslint \"**/*.js\"", + "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "test": "tap", "postlint": "template-oss-check", "lintfix": "node ../.. run lint -- --fix", @@ -17,7 +17,7 @@ "devDependencies": { "@npmcli/eslint-config": "^4.0.0", "@npmcli/mock-registry": "^1.0.0", - "@npmcli/template-oss": "4.19.0", + "@npmcli/template-oss": "4.21.3", "nock": "^13.3.0", "tap": "^16.3.4" }, @@ -41,7 +41,7 @@ ], "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.19.0", + "version": "4.21.3", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/libnpmdiff/.eslintrc.js b/workspaces/libnpmdiff/.eslintrc.js index 5db9f815536f1..f21d26eccec7d 100644 --- a/workspaces/libnpmdiff/.eslintrc.js +++ b/workspaces/libnpmdiff/.eslintrc.js @@ -10,6 +10,9 @@ const localConfigs = readdir(__dirname) module.exports = { root: true, + ignorePatterns: [ + 'tap-testdir*/', + ], extends: [ '@npmcli', ...localConfigs, diff --git a/workspaces/libnpmdiff/.gitignore b/workspaces/libnpmdiff/.gitignore index 79af2bfcaa4d8..a96d056a7064e 100644 --- a/workspaces/libnpmdiff/.gitignore +++ b/workspaces/libnpmdiff/.gitignore @@ -2,6 +2,8 @@ # ignore everything in the root /* +# transient test directories +tap-testdir*/ # keep these !**/.gitignore diff --git a/workspaces/libnpmdiff/package.json b/workspaces/libnpmdiff/package.json index 8b58300494693..bc9446795f1fc 100644 --- a/workspaces/libnpmdiff/package.json +++ b/workspaces/libnpmdiff/package.json @@ -32,7 +32,7 @@ ], "license": "ISC", "scripts": { - "lint": "eslint \"**/*.js\"", + "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "lintfix": "node ../.. run lint -- --fix", "test": "tap", "posttest": "node ../.. run lint", @@ -42,7 +42,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.19.0", + "@npmcli/template-oss": "4.21.3", "tap": "^16.3.4" }, "dependencies": { @@ -58,7 +58,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.19.0", + "version": "4.21.3", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/libnpmexec/.eslintrc.js b/workspaces/libnpmexec/.eslintrc.js index 5db9f815536f1..f21d26eccec7d 100644 --- a/workspaces/libnpmexec/.eslintrc.js +++ b/workspaces/libnpmexec/.eslintrc.js @@ -10,6 +10,9 @@ const localConfigs = readdir(__dirname) module.exports = { root: true, + ignorePatterns: [ + 'tap-testdir*/', + ], extends: [ '@npmcli', ...localConfigs, diff --git a/workspaces/libnpmexec/.gitignore b/workspaces/libnpmexec/.gitignore index 79af2bfcaa4d8..a96d056a7064e 100644 --- a/workspaces/libnpmexec/.gitignore +++ b/workspaces/libnpmexec/.gitignore @@ -2,6 +2,8 @@ # ignore everything in the root /* +# transient test directories +tap-testdir*/ # keep these !**/.gitignore diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index e3a0ab1f3e5ab..de831e27b8c56 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -33,7 +33,7 @@ ], "license": "ISC", "scripts": { - "lint": "eslint \"**/*.js\"", + "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "posttest": "node ../.. run lint", "test": "tap", "snap": "tap", @@ -51,7 +51,7 @@ "devDependencies": { "@npmcli/eslint-config": "^4.0.0", "@npmcli/mock-registry": "^1.0.0", - "@npmcli/template-oss": "4.19.0", + "@npmcli/template-oss": "4.21.3", "bin-links": "^4.0.1", "chalk": "^5.2.0", "just-extend": "^6.2.0", @@ -73,7 +73,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.19.0", + "version": "4.21.3", "content": "../../scripts/template-oss/index.js" } } diff --git a/workspaces/libnpmfund/.eslintrc.js b/workspaces/libnpmfund/.eslintrc.js index 5db9f815536f1..f21d26eccec7d 100644 --- a/workspaces/libnpmfund/.eslintrc.js +++ b/workspaces/libnpmfund/.eslintrc.js @@ -10,6 +10,9 @@ const localConfigs = readdir(__dirname) module.exports = { root: true, + ignorePatterns: [ + 'tap-testdir*/', + ], extends: [ '@npmcli', ...localConfigs, diff --git a/workspaces/libnpmfund/.gitignore b/workspaces/libnpmfund/.gitignore index 79af2bfcaa4d8..a96d056a7064e 100644 --- a/workspaces/libnpmfund/.gitignore +++ b/workspaces/libnpmfund/.gitignore @@ -2,6 +2,8 @@ # ignore everything in the root /* +# transient test directories +tap-testdir*/ # keep these !**/.gitignore diff --git a/workspaces/libnpmfund/package.json b/workspaces/libnpmfund/package.json index 4bae7161bfdb6..b33f198ee180b 100644 --- a/workspaces/libnpmfund/package.json +++ b/workspaces/libnpmfund/package.json @@ -31,7 +31,7 @@ ], "license": "ISC", "scripts": { - "lint": "eslint \"**/*.js\"", + "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "lintfix": "node ../.. run lint -- --fix", "posttest": "node ../.. run lint", "test": "tap", @@ -41,7 +41,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.19.0", + "@npmcli/template-oss": "4.21.3", "tap": "^16.3.4" }, "dependencies": { @@ -52,7 +52,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.19.0", + "version": "4.21.3", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/libnpmhook/.eslintrc.js b/workspaces/libnpmhook/.eslintrc.js index 5db9f815536f1..f21d26eccec7d 100644 --- a/workspaces/libnpmhook/.eslintrc.js +++ b/workspaces/libnpmhook/.eslintrc.js @@ -10,6 +10,9 @@ const localConfigs = readdir(__dirname) module.exports = { root: true, + ignorePatterns: [ + 'tap-testdir*/', + ], extends: [ '@npmcli', ...localConfigs, diff --git a/workspaces/libnpmhook/.gitignore b/workspaces/libnpmhook/.gitignore index 79af2bfcaa4d8..a96d056a7064e 100644 --- a/workspaces/libnpmhook/.gitignore +++ b/workspaces/libnpmhook/.gitignore @@ -2,6 +2,8 @@ # ignore everything in the root /* +# transient test directories +tap-testdir*/ # keep these !**/.gitignore diff --git a/workspaces/libnpmhook/package.json b/workspaces/libnpmhook/package.json index 9dad336d0e8dd..9c3851dd4ccac 100644 --- a/workspaces/libnpmhook/package.json +++ b/workspaces/libnpmhook/package.json @@ -9,7 +9,7 @@ ], "scripts": { "test": "tap", - "lint": "eslint \"**/*.js\"", + "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "postlint": "template-oss-check", "lintfix": "node ../.. run lint -- --fix", "snap": "tap", @@ -35,7 +35,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.19.0", + "@npmcli/template-oss": "4.21.3", "nock": "^13.3.0", "tap": "^16.3.4" }, @@ -44,7 +44,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.19.0", + "version": "4.21.3", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/libnpmorg/.eslintrc.js b/workspaces/libnpmorg/.eslintrc.js index 5db9f815536f1..f21d26eccec7d 100644 --- a/workspaces/libnpmorg/.eslintrc.js +++ b/workspaces/libnpmorg/.eslintrc.js @@ -10,6 +10,9 @@ const localConfigs = readdir(__dirname) module.exports = { root: true, + ignorePatterns: [ + 'tap-testdir*/', + ], extends: [ '@npmcli', ...localConfigs, diff --git a/workspaces/libnpmorg/.gitignore b/workspaces/libnpmorg/.gitignore index 79af2bfcaa4d8..a96d056a7064e 100644 --- a/workspaces/libnpmorg/.gitignore +++ b/workspaces/libnpmorg/.gitignore @@ -2,6 +2,8 @@ # ignore everything in the root /* +# transient test directories +tap-testdir*/ # keep these !**/.gitignore diff --git a/workspaces/libnpmorg/package.json b/workspaces/libnpmorg/package.json index 833cfc6c6e849..4d974ad4034a5 100644 --- a/workspaces/libnpmorg/package.json +++ b/workspaces/libnpmorg/package.json @@ -14,7 +14,7 @@ ], "license": "ISC", "scripts": { - "lint": "eslint \"**/*.js\"", + "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "test": "tap", "posttest": "node ../.. run lint", "postlint": "template-oss-check", @@ -28,7 +28,7 @@ ], "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.19.0", + "@npmcli/template-oss": "4.21.3", "minipass": "^7.0.4", "nock": "^13.3.0", "tap": "^16.3.4" @@ -49,7 +49,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.19.0", + "version": "4.21.3", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/libnpmpack/.eslintrc.js b/workspaces/libnpmpack/.eslintrc.js index 5db9f815536f1..f21d26eccec7d 100644 --- a/workspaces/libnpmpack/.eslintrc.js +++ b/workspaces/libnpmpack/.eslintrc.js @@ -10,6 +10,9 @@ const localConfigs = readdir(__dirname) module.exports = { root: true, + ignorePatterns: [ + 'tap-testdir*/', + ], extends: [ '@npmcli', ...localConfigs, diff --git a/workspaces/libnpmpack/.gitignore b/workspaces/libnpmpack/.gitignore index 79af2bfcaa4d8..a96d056a7064e 100644 --- a/workspaces/libnpmpack/.gitignore +++ b/workspaces/libnpmpack/.gitignore @@ -2,6 +2,8 @@ # ignore everything in the root /* +# transient test directories +tap-testdir*/ # keep these !**/.gitignore diff --git a/workspaces/libnpmpack/package.json b/workspaces/libnpmpack/package.json index 940fa3aa57656..076d0049b60f1 100644 --- a/workspaces/libnpmpack/package.json +++ b/workspaces/libnpmpack/package.json @@ -13,7 +13,7 @@ ], "license": "ISC", "scripts": { - "lint": "eslint \"**/*.js\"", + "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "test": "tap", "posttest": "node ../.. run lint", "postlint": "template-oss-check", @@ -23,7 +23,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.19.0", + "@npmcli/template-oss": "4.21.3", "nock": "^13.3.0", "spawk": "^1.7.1", "tap": "^16.3.4" @@ -46,7 +46,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.19.0", + "version": "4.21.3", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/libnpmpublish/.eslintrc.js b/workspaces/libnpmpublish/.eslintrc.js index 5db9f815536f1..f21d26eccec7d 100644 --- a/workspaces/libnpmpublish/.eslintrc.js +++ b/workspaces/libnpmpublish/.eslintrc.js @@ -10,6 +10,9 @@ const localConfigs = readdir(__dirname) module.exports = { root: true, + ignorePatterns: [ + 'tap-testdir*/', + ], extends: [ '@npmcli', ...localConfigs, diff --git a/workspaces/libnpmpublish/.gitignore b/workspaces/libnpmpublish/.gitignore index 79af2bfcaa4d8..a96d056a7064e 100644 --- a/workspaces/libnpmpublish/.gitignore +++ b/workspaces/libnpmpublish/.gitignore @@ -2,6 +2,8 @@ # ignore everything in the root /* +# transient test directories +tap-testdir*/ # keep these !**/.gitignore diff --git a/workspaces/libnpmpublish/package.json b/workspaces/libnpmpublish/package.json index 55d416524f5cb..00f5547cccd4c 100644 --- a/workspaces/libnpmpublish/package.json +++ b/workspaces/libnpmpublish/package.json @@ -14,7 +14,7 @@ ], "license": "ISC", "scripts": { - "lint": "eslint \"**/*.js\"", + "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "lintfix": "node ../.. run lint -- --fix", "test": "tap", "posttest": "node ../.. run lint", @@ -26,7 +26,7 @@ "@npmcli/eslint-config": "^4.0.0", "@npmcli/mock-globals": "^1.0.0", "@npmcli/mock-registry": "^1.0.0", - "@npmcli/template-oss": "4.19.0", + "@npmcli/template-oss": "4.21.3", "lodash.clonedeep": "^4.5.0", "nock": "^13.3.0", "tap": "^16.3.4" @@ -53,7 +53,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.19.0", + "version": "4.21.3", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/libnpmsearch/.eslintrc.js b/workspaces/libnpmsearch/.eslintrc.js index 5db9f815536f1..f21d26eccec7d 100644 --- a/workspaces/libnpmsearch/.eslintrc.js +++ b/workspaces/libnpmsearch/.eslintrc.js @@ -10,6 +10,9 @@ const localConfigs = readdir(__dirname) module.exports = { root: true, + ignorePatterns: [ + 'tap-testdir*/', + ], extends: [ '@npmcli', ...localConfigs, diff --git a/workspaces/libnpmsearch/.gitignore b/workspaces/libnpmsearch/.gitignore index 79af2bfcaa4d8..a96d056a7064e 100644 --- a/workspaces/libnpmsearch/.gitignore +++ b/workspaces/libnpmsearch/.gitignore @@ -2,6 +2,8 @@ # ignore everything in the root /* +# transient test directories +tap-testdir*/ # keep these !**/.gitignore diff --git a/workspaces/libnpmsearch/package.json b/workspaces/libnpmsearch/package.json index 8a357f7b688f1..e7080c8ab19f7 100644 --- a/workspaces/libnpmsearch/package.json +++ b/workspaces/libnpmsearch/package.json @@ -18,7 +18,7 @@ "scripts": { "posttest": "node ../.. run lint", "test": "tap", - "lint": "eslint \"**/*.js\"", + "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "postlint": "template-oss-check", "lintfix": "node ../.. run lint -- --fix", "snap": "tap", @@ -26,7 +26,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.19.0", + "@npmcli/template-oss": "4.21.3", "nock": "^13.3.0", "tap": "^16.3.4" }, @@ -45,7 +45,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.19.0", + "version": "4.21.3", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/libnpmteam/.eslintrc.js b/workspaces/libnpmteam/.eslintrc.js index 5db9f815536f1..f21d26eccec7d 100644 --- a/workspaces/libnpmteam/.eslintrc.js +++ b/workspaces/libnpmteam/.eslintrc.js @@ -10,6 +10,9 @@ const localConfigs = readdir(__dirname) module.exports = { root: true, + ignorePatterns: [ + 'tap-testdir*/', + ], extends: [ '@npmcli', ...localConfigs, diff --git a/workspaces/libnpmteam/.gitignore b/workspaces/libnpmteam/.gitignore index 79af2bfcaa4d8..a96d056a7064e 100644 --- a/workspaces/libnpmteam/.gitignore +++ b/workspaces/libnpmteam/.gitignore @@ -2,6 +2,8 @@ # ignore everything in the root /* +# transient test directories +tap-testdir*/ # keep these !**/.gitignore diff --git a/workspaces/libnpmteam/package.json b/workspaces/libnpmteam/package.json index 80e0b5f87b11f..0cece6cfea51f 100644 --- a/workspaces/libnpmteam/package.json +++ b/workspaces/libnpmteam/package.json @@ -6,7 +6,7 @@ "license": "ISC", "main": "lib/index.js", "scripts": { - "lint": "eslint \"**/*.js\"", + "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "test": "tap", "posttest": "node ../.. run lint", "postlint": "template-oss-check", @@ -16,7 +16,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.19.0", + "@npmcli/template-oss": "4.21.3", "nock": "^13.3.0", "tap": "^16.3.4" }, @@ -39,7 +39,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.19.0", + "version": "4.21.3", "content": "../../scripts/template-oss/index.js" }, "tap": { diff --git a/workspaces/libnpmversion/.eslintrc.js b/workspaces/libnpmversion/.eslintrc.js index 5db9f815536f1..f21d26eccec7d 100644 --- a/workspaces/libnpmversion/.eslintrc.js +++ b/workspaces/libnpmversion/.eslintrc.js @@ -10,6 +10,9 @@ const localConfigs = readdir(__dirname) module.exports = { root: true, + ignorePatterns: [ + 'tap-testdir*/', + ], extends: [ '@npmcli', ...localConfigs, diff --git a/workspaces/libnpmversion/.gitignore b/workspaces/libnpmversion/.gitignore index 79af2bfcaa4d8..a96d056a7064e 100644 --- a/workspaces/libnpmversion/.gitignore +++ b/workspaces/libnpmversion/.gitignore @@ -2,6 +2,8 @@ # ignore everything in the root /* +# transient test directories +tap-testdir*/ # keep these !**/.gitignore diff --git a/workspaces/libnpmversion/package.json b/workspaces/libnpmversion/package.json index 64a27a7e5d813..e049ff0da5fa0 100644 --- a/workspaces/libnpmversion/package.json +++ b/workspaces/libnpmversion/package.json @@ -15,7 +15,7 @@ "author": "GitHub Inc.", "license": "ISC", "scripts": { - "lint": "eslint \"**/*.js\"", + "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "test": "tap", "posttest": "node ../.. run lint", "snap": "tap", @@ -32,7 +32,7 @@ }, "devDependencies": { "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.19.0", + "@npmcli/template-oss": "4.21.3", "require-inject": "^1.4.4", "tap": "^16.3.4" }, @@ -48,7 +48,7 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.19.0", + "version": "4.21.3", "content": "../../scripts/template-oss/index.js" } }