diff --git a/.github/workflows/ci-docs.yml b/.github/workflows/ci-docs.yml index 68c3b649e9ad6..43fa240ecdaec 100644 --- a/.github/workflows/ci-docs.yml +++ b/.github/workflows/ci-docs.yml @@ -34,7 +34,7 @@ jobs: - name: Update npm to latest run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v - - run: npm i --ignore-scripts + - run: npm i --ignore-scripts --no-audit --no-fund - run: npm run lint -w docs test: @@ -81,5 +81,5 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v - - run: npm i --ignore-scripts + - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w docs diff --git a/.github/workflows/ci-libnpmaccess.yml b/.github/workflows/ci-libnpmaccess.yml index 43f0765ff08a0..ca1eb19ae0f01 100644 --- a/.github/workflows/ci-libnpmaccess.yml +++ b/.github/workflows/ci-libnpmaccess.yml @@ -34,7 +34,7 @@ jobs: - name: Update npm to latest run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v - - run: npm i --ignore-scripts + - run: npm i --ignore-scripts --no-audit --no-fund - run: npm run lint -w libnpmaccess test: @@ -86,5 +86,5 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v - - run: npm i --ignore-scripts + - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmaccess diff --git a/.github/workflows/ci-libnpmdiff.yml b/.github/workflows/ci-libnpmdiff.yml index f8c01d5d57e2a..856b8d9570b77 100644 --- a/.github/workflows/ci-libnpmdiff.yml +++ b/.github/workflows/ci-libnpmdiff.yml @@ -34,7 +34,7 @@ jobs: - name: Update npm to latest run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v - - run: npm i --ignore-scripts + - run: npm i --ignore-scripts --no-audit --no-fund - run: npm run lint -w libnpmdiff test: @@ -86,5 +86,5 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v - - run: npm i --ignore-scripts + - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmdiff diff --git a/.github/workflows/ci-libnpmexec.yml b/.github/workflows/ci-libnpmexec.yml index 5674b4d7d88fd..8c30d053471c3 100644 --- a/.github/workflows/ci-libnpmexec.yml +++ b/.github/workflows/ci-libnpmexec.yml @@ -34,7 +34,7 @@ jobs: - name: Update npm to latest run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v - - run: npm i --ignore-scripts + - run: npm i --ignore-scripts --no-audit --no-fund - run: npm run lint -w libnpmexec test: @@ -86,5 +86,5 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v - - run: npm i --ignore-scripts + - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmexec diff --git a/.github/workflows/ci-libnpmfund.yml b/.github/workflows/ci-libnpmfund.yml index 7a4fdd921b139..337db5b8bf39e 100644 --- a/.github/workflows/ci-libnpmfund.yml +++ b/.github/workflows/ci-libnpmfund.yml @@ -34,7 +34,7 @@ jobs: - name: Update npm to latest run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v - - run: npm i --ignore-scripts + - run: npm i --ignore-scripts --no-audit --no-fund - run: npm run lint -w libnpmfund test: @@ -86,5 +86,5 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v - - run: npm i --ignore-scripts + - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmfund diff --git a/.github/workflows/ci-libnpmhook.yml b/.github/workflows/ci-libnpmhook.yml index e6281e7fd801f..3ccceb99f8912 100644 --- a/.github/workflows/ci-libnpmhook.yml +++ b/.github/workflows/ci-libnpmhook.yml @@ -34,7 +34,7 @@ jobs: - name: Update npm to latest run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v - - run: npm i --ignore-scripts + - run: npm i --ignore-scripts --no-audit --no-fund - run: npm run lint -w libnpmhook test: @@ -86,5 +86,5 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v - - run: npm i --ignore-scripts + - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmhook diff --git a/.github/workflows/ci-libnpmorg.yml b/.github/workflows/ci-libnpmorg.yml index 5737035bc24d0..2f9ba90a357c5 100644 --- a/.github/workflows/ci-libnpmorg.yml +++ b/.github/workflows/ci-libnpmorg.yml @@ -34,7 +34,7 @@ jobs: - name: Update npm to latest run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v - - run: npm i --ignore-scripts + - run: npm i --ignore-scripts --no-audit --no-fund - run: npm run lint -w libnpmorg test: @@ -86,5 +86,5 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v - - run: npm i --ignore-scripts + - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmorg diff --git a/.github/workflows/ci-libnpmpack.yml b/.github/workflows/ci-libnpmpack.yml index b6cb5ea4a5ba4..146950c4f825a 100644 --- a/.github/workflows/ci-libnpmpack.yml +++ b/.github/workflows/ci-libnpmpack.yml @@ -34,7 +34,7 @@ jobs: - name: Update npm to latest run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v - - run: npm i --ignore-scripts + - run: npm i --ignore-scripts --no-audit --no-fund - run: npm run lint -w libnpmpack test: @@ -86,5 +86,5 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v - - run: npm i --ignore-scripts + - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmpack diff --git a/.github/workflows/ci-libnpmpublish.yml b/.github/workflows/ci-libnpmpublish.yml index b9c150d49023a..16d693c969866 100644 --- a/.github/workflows/ci-libnpmpublish.yml +++ b/.github/workflows/ci-libnpmpublish.yml @@ -34,7 +34,7 @@ jobs: - name: Update npm to latest run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v - - run: npm i --ignore-scripts + - run: npm i --ignore-scripts --no-audit --no-fund - run: npm run lint -w libnpmpublish test: @@ -86,5 +86,5 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v - - run: npm i --ignore-scripts + - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmpublish diff --git a/.github/workflows/ci-libnpmsearch.yml b/.github/workflows/ci-libnpmsearch.yml index d9ddc0e17d2c5..93f2a0caa5f7c 100644 --- a/.github/workflows/ci-libnpmsearch.yml +++ b/.github/workflows/ci-libnpmsearch.yml @@ -34,7 +34,7 @@ jobs: - name: Update npm to latest run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v - - run: npm i --ignore-scripts + - run: npm i --ignore-scripts --no-audit --no-fund - run: npm run lint -w libnpmsearch test: @@ -86,5 +86,5 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v - - run: npm i --ignore-scripts + - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmsearch diff --git a/.github/workflows/ci-libnpmteam.yml b/.github/workflows/ci-libnpmteam.yml index 24519315f7ed0..baaf78ce8dd03 100644 --- a/.github/workflows/ci-libnpmteam.yml +++ b/.github/workflows/ci-libnpmteam.yml @@ -34,7 +34,7 @@ jobs: - name: Update npm to latest run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v - - run: npm i --ignore-scripts + - run: npm i --ignore-scripts --no-audit --no-fund - run: npm run lint -w libnpmteam test: @@ -86,5 +86,5 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v - - run: npm i --ignore-scripts + - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmteam diff --git a/.github/workflows/ci-libnpmversion.yml b/.github/workflows/ci-libnpmversion.yml index 193b8d5ce4b47..3b24bf420b38e 100644 --- a/.github/workflows/ci-libnpmversion.yml +++ b/.github/workflows/ci-libnpmversion.yml @@ -34,7 +34,7 @@ jobs: - name: Update npm to latest run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v - - run: npm i --ignore-scripts + - run: npm i --ignore-scripts --no-audit --no-fund - run: npm run lint -w libnpmversion test: @@ -86,5 +86,5 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v - - run: npm i --ignore-scripts + - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w libnpmversion diff --git a/.github/workflows/ci-npmcli-arborist.yml b/.github/workflows/ci-npmcli-arborist.yml index 32978d92f7cf9..9998450969334 100644 --- a/.github/workflows/ci-npmcli-arborist.yml +++ b/.github/workflows/ci-npmcli-arborist.yml @@ -34,7 +34,7 @@ jobs: - name: Update npm to latest run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v - - run: npm i --ignore-scripts + - run: npm i --ignore-scripts --no-audit --no-fund - run: npm run lint -w @npmcli/arborist test: @@ -86,5 +86,5 @@ jobs: if: ${{ !startsWith(matrix.node-version, '10.') }} run: npm i --prefer-online --no-fund --no-audit -g npm@latest - run: npm -v - - run: npm i --ignore-scripts + - run: npm i --ignore-scripts --no-audit --no-fund - run: npm test --ignore-scripts -w @npmcli/arborist diff --git a/.github/workflows/release-please-libnpmaccess.yml b/.github/workflows/release-please-libnpmaccess.yml index ae798bcb894dc..d71654dda1a6e 100644 --- a/.github/workflows/release-please-libnpmaccess.yml +++ b/.github/workflows/release-please-libnpmaccess.yml @@ -10,6 +10,10 @@ on: - main - latest +permissions: + contents: write + pull-requests: write + jobs: release-please: runs-on: ubuntu-latest @@ -20,6 +24,9 @@ jobs: release-type: node monorepo-tags: true path: workspaces/libnpmaccess + # name can be removed after this is merged + # https://github.com/google-github-actions/release-please-action/pull/459 + package-name: "libnpmaccess" changelog-types: > [ {"type":"feat","section":"Features","hidden":false}, @@ -28,3 +35,26 @@ jobs: {"type":"deps","section":"Dependencies","hidden":false}, {"type":"chore","hidden":true} ] + - uses: actions/checkout@v3 + - name: Setup git user + run: | + git config --global user.email "ops+npm-cli@npmjs.com" + git config --global user.name "npm cli ops bot" + - uses: actions/setup-node@v3 + with: + node-version: 16.x + - name: Update npm to latest + run: npm i --prefer-online --no-fund --no-audit -g npm@latest + - run: npm -v + - name: Update package-lock.json and commit + if: steps.release.outputs.pr + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh pr checkout ${{ fromJSON(steps.release.outputs.pr).number }} + npm run resetdeps + title="${{ fromJSON(steps.release.outputs.pr).title }}" + # get the version from the pr title + # get everything after the last space + git commit -am "deps: libnpmaccess@${title##* }" + git push diff --git a/.github/workflows/release-please-libnpmdiff.yml b/.github/workflows/release-please-libnpmdiff.yml index 4f9a0673acff1..d9a043534b670 100644 --- a/.github/workflows/release-please-libnpmdiff.yml +++ b/.github/workflows/release-please-libnpmdiff.yml @@ -10,6 +10,10 @@ on: - main - latest +permissions: + contents: write + pull-requests: write + jobs: release-please: runs-on: ubuntu-latest @@ -20,6 +24,9 @@ jobs: release-type: node monorepo-tags: true path: workspaces/libnpmdiff + # name can be removed after this is merged + # https://github.com/google-github-actions/release-please-action/pull/459 + package-name: "libnpmdiff" changelog-types: > [ {"type":"feat","section":"Features","hidden":false}, @@ -28,3 +35,26 @@ jobs: {"type":"deps","section":"Dependencies","hidden":false}, {"type":"chore","hidden":true} ] + - uses: actions/checkout@v3 + - name: Setup git user + run: | + git config --global user.email "ops+npm-cli@npmjs.com" + git config --global user.name "npm cli ops bot" + - uses: actions/setup-node@v3 + with: + node-version: 16.x + - name: Update npm to latest + run: npm i --prefer-online --no-fund --no-audit -g npm@latest + - run: npm -v + - name: Update package-lock.json and commit + if: steps.release.outputs.pr + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh pr checkout ${{ fromJSON(steps.release.outputs.pr).number }} + npm run resetdeps + title="${{ fromJSON(steps.release.outputs.pr).title }}" + # get the version from the pr title + # get everything after the last space + git commit -am "deps: libnpmdiff@${title##* }" + git push diff --git a/.github/workflows/release-please-libnpmexec.yml b/.github/workflows/release-please-libnpmexec.yml index 7beb1148a699b..bdb8c373cf150 100644 --- a/.github/workflows/release-please-libnpmexec.yml +++ b/.github/workflows/release-please-libnpmexec.yml @@ -10,6 +10,10 @@ on: - main - latest +permissions: + contents: write + pull-requests: write + jobs: release-please: runs-on: ubuntu-latest @@ -20,6 +24,9 @@ jobs: release-type: node monorepo-tags: true path: workspaces/libnpmexec + # name can be removed after this is merged + # https://github.com/google-github-actions/release-please-action/pull/459 + package-name: "libnpmexec" changelog-types: > [ {"type":"feat","section":"Features","hidden":false}, @@ -28,3 +35,26 @@ jobs: {"type":"deps","section":"Dependencies","hidden":false}, {"type":"chore","hidden":true} ] + - uses: actions/checkout@v3 + - name: Setup git user + run: | + git config --global user.email "ops+npm-cli@npmjs.com" + git config --global user.name "npm cli ops bot" + - uses: actions/setup-node@v3 + with: + node-version: 16.x + - name: Update npm to latest + run: npm i --prefer-online --no-fund --no-audit -g npm@latest + - run: npm -v + - name: Update package-lock.json and commit + if: steps.release.outputs.pr + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh pr checkout ${{ fromJSON(steps.release.outputs.pr).number }} + npm run resetdeps + title="${{ fromJSON(steps.release.outputs.pr).title }}" + # get the version from the pr title + # get everything after the last space + git commit -am "deps: libnpmexec@${title##* }" + git push diff --git a/.github/workflows/release-please-libnpmfund.yml b/.github/workflows/release-please-libnpmfund.yml index c89a94ecf9b2a..53da00c6bafbc 100644 --- a/.github/workflows/release-please-libnpmfund.yml +++ b/.github/workflows/release-please-libnpmfund.yml @@ -10,6 +10,10 @@ on: - main - latest +permissions: + contents: write + pull-requests: write + jobs: release-please: runs-on: ubuntu-latest @@ -20,6 +24,9 @@ jobs: release-type: node monorepo-tags: true path: workspaces/libnpmfund + # name can be removed after this is merged + # https://github.com/google-github-actions/release-please-action/pull/459 + package-name: "libnpmfund" changelog-types: > [ {"type":"feat","section":"Features","hidden":false}, @@ -28,3 +35,26 @@ jobs: {"type":"deps","section":"Dependencies","hidden":false}, {"type":"chore","hidden":true} ] + - uses: actions/checkout@v3 + - name: Setup git user + run: | + git config --global user.email "ops+npm-cli@npmjs.com" + git config --global user.name "npm cli ops bot" + - uses: actions/setup-node@v3 + with: + node-version: 16.x + - name: Update npm to latest + run: npm i --prefer-online --no-fund --no-audit -g npm@latest + - run: npm -v + - name: Update package-lock.json and commit + if: steps.release.outputs.pr + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh pr checkout ${{ fromJSON(steps.release.outputs.pr).number }} + npm run resetdeps + title="${{ fromJSON(steps.release.outputs.pr).title }}" + # get the version from the pr title + # get everything after the last space + git commit -am "deps: libnpmfund@${title##* }" + git push diff --git a/.github/workflows/release-please-libnpmhook.yml b/.github/workflows/release-please-libnpmhook.yml index a5863b1cfc5e4..268e4d8f030d4 100644 --- a/.github/workflows/release-please-libnpmhook.yml +++ b/.github/workflows/release-please-libnpmhook.yml @@ -10,6 +10,10 @@ on: - main - latest +permissions: + contents: write + pull-requests: write + jobs: release-please: runs-on: ubuntu-latest @@ -20,6 +24,9 @@ jobs: release-type: node monorepo-tags: true path: workspaces/libnpmhook + # name can be removed after this is merged + # https://github.com/google-github-actions/release-please-action/pull/459 + package-name: "libnpmhook" changelog-types: > [ {"type":"feat","section":"Features","hidden":false}, @@ -28,3 +35,26 @@ jobs: {"type":"deps","section":"Dependencies","hidden":false}, {"type":"chore","hidden":true} ] + - uses: actions/checkout@v3 + - name: Setup git user + run: | + git config --global user.email "ops+npm-cli@npmjs.com" + git config --global user.name "npm cli ops bot" + - uses: actions/setup-node@v3 + with: + node-version: 16.x + - name: Update npm to latest + run: npm i --prefer-online --no-fund --no-audit -g npm@latest + - run: npm -v + - name: Update package-lock.json and commit + if: steps.release.outputs.pr + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh pr checkout ${{ fromJSON(steps.release.outputs.pr).number }} + npm run resetdeps + title="${{ fromJSON(steps.release.outputs.pr).title }}" + # get the version from the pr title + # get everything after the last space + git commit -am "deps: libnpmhook@${title##* }" + git push diff --git a/.github/workflows/release-please-libnpmorg.yml b/.github/workflows/release-please-libnpmorg.yml index 9352c64e22154..e8b7c66e73247 100644 --- a/.github/workflows/release-please-libnpmorg.yml +++ b/.github/workflows/release-please-libnpmorg.yml @@ -10,6 +10,10 @@ on: - main - latest +permissions: + contents: write + pull-requests: write + jobs: release-please: runs-on: ubuntu-latest @@ -20,6 +24,9 @@ jobs: release-type: node monorepo-tags: true path: workspaces/libnpmorg + # name can be removed after this is merged + # https://github.com/google-github-actions/release-please-action/pull/459 + package-name: "libnpmorg" changelog-types: > [ {"type":"feat","section":"Features","hidden":false}, @@ -28,3 +35,26 @@ jobs: {"type":"deps","section":"Dependencies","hidden":false}, {"type":"chore","hidden":true} ] + - uses: actions/checkout@v3 + - name: Setup git user + run: | + git config --global user.email "ops+npm-cli@npmjs.com" + git config --global user.name "npm cli ops bot" + - uses: actions/setup-node@v3 + with: + node-version: 16.x + - name: Update npm to latest + run: npm i --prefer-online --no-fund --no-audit -g npm@latest + - run: npm -v + - name: Update package-lock.json and commit + if: steps.release.outputs.pr + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh pr checkout ${{ fromJSON(steps.release.outputs.pr).number }} + npm run resetdeps + title="${{ fromJSON(steps.release.outputs.pr).title }}" + # get the version from the pr title + # get everything after the last space + git commit -am "deps: libnpmorg@${title##* }" + git push diff --git a/.github/workflows/release-please-libnpmpack.yml b/.github/workflows/release-please-libnpmpack.yml index 669bc7162b07b..50548222ef975 100644 --- a/.github/workflows/release-please-libnpmpack.yml +++ b/.github/workflows/release-please-libnpmpack.yml @@ -10,6 +10,10 @@ on: - main - latest +permissions: + contents: write + pull-requests: write + jobs: release-please: runs-on: ubuntu-latest @@ -20,6 +24,9 @@ jobs: release-type: node monorepo-tags: true path: workspaces/libnpmpack + # name can be removed after this is merged + # https://github.com/google-github-actions/release-please-action/pull/459 + package-name: "libnpmpack" changelog-types: > [ {"type":"feat","section":"Features","hidden":false}, @@ -28,3 +35,26 @@ jobs: {"type":"deps","section":"Dependencies","hidden":false}, {"type":"chore","hidden":true} ] + - uses: actions/checkout@v3 + - name: Setup git user + run: | + git config --global user.email "ops+npm-cli@npmjs.com" + git config --global user.name "npm cli ops bot" + - uses: actions/setup-node@v3 + with: + node-version: 16.x + - name: Update npm to latest + run: npm i --prefer-online --no-fund --no-audit -g npm@latest + - run: npm -v + - name: Update package-lock.json and commit + if: steps.release.outputs.pr + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh pr checkout ${{ fromJSON(steps.release.outputs.pr).number }} + npm run resetdeps + title="${{ fromJSON(steps.release.outputs.pr).title }}" + # get the version from the pr title + # get everything after the last space + git commit -am "deps: libnpmpack@${title##* }" + git push diff --git a/.github/workflows/release-please-libnpmpublish.yml b/.github/workflows/release-please-libnpmpublish.yml index 82b4ad0e27101..2bd4026d2cd37 100644 --- a/.github/workflows/release-please-libnpmpublish.yml +++ b/.github/workflows/release-please-libnpmpublish.yml @@ -10,6 +10,10 @@ on: - main - latest +permissions: + contents: write + pull-requests: write + jobs: release-please: runs-on: ubuntu-latest @@ -20,6 +24,9 @@ jobs: release-type: node monorepo-tags: true path: workspaces/libnpmpublish + # name can be removed after this is merged + # https://github.com/google-github-actions/release-please-action/pull/459 + package-name: "libnpmpublish" changelog-types: > [ {"type":"feat","section":"Features","hidden":false}, @@ -28,3 +35,26 @@ jobs: {"type":"deps","section":"Dependencies","hidden":false}, {"type":"chore","hidden":true} ] + - uses: actions/checkout@v3 + - name: Setup git user + run: | + git config --global user.email "ops+npm-cli@npmjs.com" + git config --global user.name "npm cli ops bot" + - uses: actions/setup-node@v3 + with: + node-version: 16.x + - name: Update npm to latest + run: npm i --prefer-online --no-fund --no-audit -g npm@latest + - run: npm -v + - name: Update package-lock.json and commit + if: steps.release.outputs.pr + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh pr checkout ${{ fromJSON(steps.release.outputs.pr).number }} + npm run resetdeps + title="${{ fromJSON(steps.release.outputs.pr).title }}" + # get the version from the pr title + # get everything after the last space + git commit -am "deps: libnpmpublish@${title##* }" + git push diff --git a/.github/workflows/release-please-libnpmsearch.yml b/.github/workflows/release-please-libnpmsearch.yml index 9c22260a92281..27f3fdec25aaa 100644 --- a/.github/workflows/release-please-libnpmsearch.yml +++ b/.github/workflows/release-please-libnpmsearch.yml @@ -10,6 +10,10 @@ on: - main - latest +permissions: + contents: write + pull-requests: write + jobs: release-please: runs-on: ubuntu-latest @@ -20,6 +24,9 @@ jobs: release-type: node monorepo-tags: true path: workspaces/libnpmsearch + # name can be removed after this is merged + # https://github.com/google-github-actions/release-please-action/pull/459 + package-name: "libnpmsearch" changelog-types: > [ {"type":"feat","section":"Features","hidden":false}, @@ -28,3 +35,26 @@ jobs: {"type":"deps","section":"Dependencies","hidden":false}, {"type":"chore","hidden":true} ] + - uses: actions/checkout@v3 + - name: Setup git user + run: | + git config --global user.email "ops+npm-cli@npmjs.com" + git config --global user.name "npm cli ops bot" + - uses: actions/setup-node@v3 + with: + node-version: 16.x + - name: Update npm to latest + run: npm i --prefer-online --no-fund --no-audit -g npm@latest + - run: npm -v + - name: Update package-lock.json and commit + if: steps.release.outputs.pr + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh pr checkout ${{ fromJSON(steps.release.outputs.pr).number }} + npm run resetdeps + title="${{ fromJSON(steps.release.outputs.pr).title }}" + # get the version from the pr title + # get everything after the last space + git commit -am "deps: libnpmsearch@${title##* }" + git push diff --git a/.github/workflows/release-please-libnpmteam.yml b/.github/workflows/release-please-libnpmteam.yml index 5437a9e2c804a..f0c7d6e0d1b4b 100644 --- a/.github/workflows/release-please-libnpmteam.yml +++ b/.github/workflows/release-please-libnpmteam.yml @@ -10,6 +10,10 @@ on: - main - latest +permissions: + contents: write + pull-requests: write + jobs: release-please: runs-on: ubuntu-latest @@ -20,6 +24,9 @@ jobs: release-type: node monorepo-tags: true path: workspaces/libnpmteam + # name can be removed after this is merged + # https://github.com/google-github-actions/release-please-action/pull/459 + package-name: "libnpmteam" changelog-types: > [ {"type":"feat","section":"Features","hidden":false}, @@ -28,3 +35,26 @@ jobs: {"type":"deps","section":"Dependencies","hidden":false}, {"type":"chore","hidden":true} ] + - uses: actions/checkout@v3 + - name: Setup git user + run: | + git config --global user.email "ops+npm-cli@npmjs.com" + git config --global user.name "npm cli ops bot" + - uses: actions/setup-node@v3 + with: + node-version: 16.x + - name: Update npm to latest + run: npm i --prefer-online --no-fund --no-audit -g npm@latest + - run: npm -v + - name: Update package-lock.json and commit + if: steps.release.outputs.pr + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh pr checkout ${{ fromJSON(steps.release.outputs.pr).number }} + npm run resetdeps + title="${{ fromJSON(steps.release.outputs.pr).title }}" + # get the version from the pr title + # get everything after the last space + git commit -am "deps: libnpmteam@${title##* }" + git push diff --git a/.github/workflows/release-please-libnpmversion.yml b/.github/workflows/release-please-libnpmversion.yml index 3225687078dd0..f9b91619bc2cf 100644 --- a/.github/workflows/release-please-libnpmversion.yml +++ b/.github/workflows/release-please-libnpmversion.yml @@ -10,6 +10,10 @@ on: - main - latest +permissions: + contents: write + pull-requests: write + jobs: release-please: runs-on: ubuntu-latest @@ -20,6 +24,9 @@ jobs: release-type: node monorepo-tags: true path: workspaces/libnpmversion + # name can be removed after this is merged + # https://github.com/google-github-actions/release-please-action/pull/459 + package-name: "libnpmversion" changelog-types: > [ {"type":"feat","section":"Features","hidden":false}, @@ -28,3 +35,26 @@ jobs: {"type":"deps","section":"Dependencies","hidden":false}, {"type":"chore","hidden":true} ] + - uses: actions/checkout@v3 + - name: Setup git user + run: | + git config --global user.email "ops+npm-cli@npmjs.com" + git config --global user.name "npm cli ops bot" + - uses: actions/setup-node@v3 + with: + node-version: 16.x + - name: Update npm to latest + run: npm i --prefer-online --no-fund --no-audit -g npm@latest + - run: npm -v + - name: Update package-lock.json and commit + if: steps.release.outputs.pr + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh pr checkout ${{ fromJSON(steps.release.outputs.pr).number }} + npm run resetdeps + title="${{ fromJSON(steps.release.outputs.pr).title }}" + # get the version from the pr title + # get everything after the last space + git commit -am "deps: libnpmversion@${title##* }" + git push diff --git a/.github/workflows/release-please-npmcli-arborist.yml b/.github/workflows/release-please-npmcli-arborist.yml index 651ea71b24bc4..8be72bc777e0a 100644 --- a/.github/workflows/release-please-npmcli-arborist.yml +++ b/.github/workflows/release-please-npmcli-arborist.yml @@ -10,6 +10,10 @@ on: - main - latest +permissions: + contents: write + pull-requests: write + jobs: release-please: runs-on: ubuntu-latest @@ -20,6 +24,9 @@ jobs: release-type: node monorepo-tags: true path: workspaces/arborist + # name can be removed after this is merged + # https://github.com/google-github-actions/release-please-action/pull/459 + package-name: "@npmcli/arborist" changelog-types: > [ {"type":"feat","section":"Features","hidden":false}, @@ -28,3 +35,26 @@ jobs: {"type":"deps","section":"Dependencies","hidden":false}, {"type":"chore","hidden":true} ] + - uses: actions/checkout@v3 + - name: Setup git user + run: | + git config --global user.email "ops+npm-cli@npmjs.com" + git config --global user.name "npm cli ops bot" + - uses: actions/setup-node@v3 + with: + node-version: 16.x + - name: Update npm to latest + run: npm i --prefer-online --no-fund --no-audit -g npm@latest + - run: npm -v + - name: Update package-lock.json and commit + if: steps.release.outputs.pr + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh pr checkout ${{ fromJSON(steps.release.outputs.pr).number }} + npm run resetdeps + title="${{ fromJSON(steps.release.outputs.pr).title }}" + # get the version from the pr title + # get everything after the last space + git commit -am "deps: @npmcli/arborist@${title##* }" + git push diff --git a/AUTHORS b/AUTHORS index a13a6a14ce067..c2e8eb2172f17 100644 --- a/AUTHORS +++ b/AUTHORS @@ -825,3 +825,5 @@ Tierney Cyren Mohamed Akram Wassim Chegham <1699357+manekinekko@users.noreply.github.com> David Chin +David Walker +Boris Verkhovskiy diff --git a/CHANGELOG.md b/CHANGELOG.md index 368c4fdf33373..64794ff1c9821 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,56 @@ # Changelog +## v8.6.0 (2022-03-31) + +### Features + + * [`723a0918a`](https://github.com/npm/cli/commit/723a0918a5a9d9f795584f85d04506fafda9ca42) [#4588](https://github.com/npm/cli/pull/4588) feat(version): reify on workspace version change ([@ruyadorno](https://github.com/ruyadorno)) + * [`cc6c09431`](https://github.com/npm/cli/commit/cc6c09431d7fe2db8ac1dc7a707f2dab7a7a1f83) [#4594](https://github.com/npm/cli/pull/4594) feat: add logs-dir config to set custom logging location ([@lukekarrys](https://github.com/lukekarrys)) + +### Bug Fixes + + * [`98bfd9a8c`](https://github.com/npm/cli/commit/98bfd9a8cc23930e6becd15fffabadd1c269b0a2) fix: remove always true condition (#4590) ([@XhmikosR](https://github.com/XhmikosR)) + * [`81afa5a88`](https://github.com/npm/cli/commit/81afa5a8838c71a3a5037e2c8b4ae196e19fe0d7) [#4601](https://github.com/npm/cli/pull/4601) fix(unpublish): properly apply publishConfig ([@wraithgar](https://github.com/wraithgar)) + * [`716a07fde`](https://github.com/npm/cli/commit/716a07fde7905bb69e4c6f1991bb7289589a6669) [#4607](https://github.com/npm/cli/pull/4607) fix: 100% coverage in tests ([@wraithgar](https://github.com/wraithgar)) + * [`6f9cb490e`](https://github.com/npm/cli/commit/6f9cb490e7299976c43c6a118036c130671fe188) [#4614](https://github.com/npm/cli/pull/4614) fix(arborist): handle link nodes in old lockfiles correctly ([@nlf](https://github.com/nlf)) + * [`18b8b9435`](https://github.com/npm/cli/commit/18b8b94357d8f57301fbaa0f1e5dc2cf1128bf3e) [#4617](https://github.com/npm/cli/pull/4617) fix(arborist): make sure resolveParent exists before checking props ([@nlf](https://github.com/nlf)) + * [`bd96ae407`](https://github.com/npm/cli/commit/bd96ae4071f9cc8a65e741f414db12e98537971d) [#4599](https://github.com/npm/cli/pull/4599) fix(arborist): identify and repair invalid nodes in the virtual tree ([@nlf](https://github.com/nlf)) + * [`99d884542`](https://github.com/npm/cli/commit/99d88454248f950b82652b592fe2b4d019c1060b) [#4599](https://github.com/npm/cli/pull/4599) fix: make sure we loadOverrides on the root node in loadVirtual() ([@nlf](https://github.com/nlf)) + * [`45dd8b861`](https://github.com/npm/cli/commit/45dd8b8615bb1d7a93e1733746581049a1f399e6) [#4609](https://github.com/npm/cli/pull/4609) fix: move shellout logic into commands ([@wraithgar](https://github.com/wraithgar)) + * [`a64acc0bf`](https://github.com/npm/cli/commit/a64acc0bf01e4bc68b26ead5b2d5c6db47ef16c2) [#4609](https://github.com/npm/cli/pull/4609) fix: really load all commands in tests, add description to birthday ([@wraithgar](https://github.com/wraithgar)) + * [`d8dcc02cf`](https://github.com/npm/cli/commit/d8dcc02cfd354c1314c45d6530ec926cd138210c) [#4609](https://github.com/npm/cli/pull/4609) fix: consolidate command alias code ([@wraithgar](https://github.com/wraithgar)) + * [`f76d4f2f6`](https://github.com/npm/cli/commit/f76d4f2f661bcc2534f541ee0e7d683155372baf) [#4609](https://github.com/npm/cli/pull/4609) fix: consolidate is-windows code ([@wraithgar](https://github.com/wraithgar)) + * [`57d8f75eb`](https://github.com/npm/cli/commit/57d8f75eb864486f6aa17bb3dd2f213b5c148073) [#4609](https://github.com/npm/cli/pull/4609) fix: consolidate node version support logic ([@wraithgar](https://github.com/wraithgar)) + * [`0a957f5e2`](https://github.com/npm/cli/commit/0a957f5e2fbcce51c407d22b19e38004d09c51af) [#4609](https://github.com/npm/cli/pull/4609) fix: consolidate path delimiter logic ([@wraithgar](https://github.com/wraithgar)) + * [`738a40445`](https://github.com/npm/cli/commit/738a404454677b78b25ce82a8d2e4c1f46d57ffa) [#4609](https://github.com/npm/cli/pull/4609) fix: bump knownBroken to <12.5.0 ([@wraithgar](https://github.com/wraithgar)) + * [`8b65bfd5d`](https://github.com/npm/cli/commit/8b65bfd5d610a70e1a860936be1a47f3a3df7f32) [#4629](https://github.com/npm/cli/pull/4629) fix: return otplease fn results ([@wraithgar](https://github.com/wraithgar)) + * [`d8d374d23`](https://github.com/npm/cli/commit/d8d374d23d34c17e22b52afc1cfb5247cc7c3e1d) [#4632](https://github.com/npm/cli/pull/4632) fix: consolidate split-package-names ([@wraithgar](https://github.com/wraithgar)) + * [`cc0a2ec99`](https://github.com/npm/cli/commit/cc0a2ec9999b956ea654deaf68fd49ae4bf1a1c0) [#4611](https://github.com/npm/cli/pull/4611) fix: work better with system manpages (#4610) ([@d0sboots](https://github.com/d0sboots)) + * [`668ec7f33`](https://github.com/npm/cli/commit/668ec7f33b7a76f5e86a59f7e5a6c0e068a242b1) [#4644](https://github.com/npm/cli/pull/4644) fix: only call npmlog progress methods if explicitly requested ([@lukekarrys](https://github.com/lukekarrys)) + +### Documentation + + * [`ff1367f01`](https://github.com/npm/cli/commit/ff1367f01b9dd924d039b5a6b58399101cac99ca) [#4641](https://github.com/npm/cli/pull/4641) docs: recommend prepare over prepublish ([@verhovsky](https://github.com/verhovsky)) + +### Dependencies + + * [`6df061ec2`](https://github.com/npm/cli/commit/6df061ec2a52882693ed86a3524ac6af0f88acd8) [#4594](https://github.com/npm/cli/pull/4594) deps: `npm-registry-fetch@13.1.0` + * [`6dd1139c9`](https://github.com/npm/cli/commit/6dd1139c9f302ac71f47a75e70bbe9cdf2e64960) [#4594](https://github.com/npm/cli/pull/4594) deps: `cacache@16.0.3` + * [`feb4446d5`](https://github.com/npm/cli/commit/feb4446d50a7b6a61e44a92b78e1e1af2d89a725) [#4616](https://github.com/npm/cli/pull/4616) deps: `make-fetch-happen@10.1.0` + * [`c33b53311`](https://github.com/npm/cli/commit/c33b5331120d8304e0f090ceda55e19cc6f451f4) [#4613](https://github.com/npm/cli/pull/4613) deps: `minipass-fetch@2.1.0` + * [`6a4c8ff89`](https://github.com/npm/cli/commit/6a4c8ff89acc98409060f5aa55b2f1a795a6b66c) [#4606](https://github.com/npm/cli/pull/4606) deps: `npm-audit-report@3.0.0` + * [`6e0a131d2`](https://github.com/npm/cli/commit/6e0a131d2ff3143856f388bb42c6568d5312c451) [#4627](https://github.com/npm/cli/pull/4627) deps: `debug@4.3.4` + * [`0f1cd60a1`](https://github.com/npm/cli/commit/0f1cd60a1cdb643782ae86a5a7fce84e357dbf10) [#4627](https://github.com/npm/cli/pull/4627) deps: `proc-log@2.0.1` + * [`da377eed5`](https://github.com/npm/cli/commit/da377eed5cba72185b90f5fc32ef288331c856ef) [#4627](https://github.com/npm/cli/pull/4627) deps: `parse-conflict-json@2.0.2` + * [`726a8a07a`](https://github.com/npm/cli/commit/726a8a07afeb3bd24979307679ce7e63c73b178e) [#4627](https://github.com/npm/cli/pull/4627) deps: `gauge@4.0.4` + * [`aac01b89c`](https://github.com/npm/cli/commit/aac01b89caf6336a2eb34d696296303cdadd5c08) [#4628](https://github.com/npm/cli/pull/4628) deps: `@npmcli/template-oss@3.2.1` + * [`52dfaf239`](https://github.com/npm/cli/commit/52dfaf239a3f66a05ee9d6148bc41a46b5adffd6) [#4630](https://github.com/npm/cli/pull/4630) deps: `make-fetch-happen@10.1.1` + * [`9778a5387`](https://github.com/npm/cli/commit/9778a5387771256fc81e3587922c12ec47f750ea) [#4635](https://github.com/npm/cli/pull/4635) deps: `init-package-json@3.0.2` + * [`86eff5dcc`](https://github.com/npm/cli/commit/86eff5dccb9bce2eb8d80706e8dea855faf753b3) [#4635](https://github.com/npm/cli/pull/4635) deps: `npm-package-arg@9.0.2` + * [`5b4cbb217`](https://github.com/npm/cli/commit/5b4cbb2175bfa35e347fe94e21d49a05ea64ead1) [#4635](https://github.com/npm/cli/pull/4635) deps: `validate-npm-package-name@4.0.0` + * [`a59fd2cb8`](https://github.com/npm/cli/commit/a59fd2cb863245fce56f96c90ac854e62c5c4d6f) [#4639](https://github.com/npm/cli/pull/4639) deps: `@npmcli/template-oss@3.2.2` + * [`679e569d5`](https://github.com/npm/cli/commit/679e569d5778aef312b37c1ba3bda0171366c9fb) [#4655](https://github.com/npm/cli/pull/4655) deps: `@npmcli/arborist@5.0.4` + ## v8.5.5 (2022-03-17) ### Bug Fixes diff --git a/Makefile b/Makefile index c73d07a5045df..f863dcdc87fc5 100644 --- a/Makefile +++ b/Makefile @@ -4,8 +4,6 @@ SHELL = bash PUBLISHTAG = $(shell node scripts/publish-tag.js) BRANCH = $(shell git rev-parse --abbrev-ref HEAD) -markdowns = $(shell find docs -name '*.md' | grep -v 'index') - # these docs have the @VERSION@ tag in them, so they have to be rebuilt # whenever the package.json is touched, in case the version changed. version_mandocs = $(shell grep -rl '@VERSION@' docs/content \ @@ -18,11 +16,11 @@ cli_mandocs = $(shell find docs/content/commands -name '*.md' \ files_mandocs = $(shell find docs/content/configuring-npm -name '*.md' \ |sed 's|.md|.5|g' \ - |sed 's|docs/content/configuring-npm/|man/man5/|g' ) \ + |sed 's|docs/content/configuring-npm/|man/man5/|g' ) misc_mandocs = $(shell find docs/content/using-npm -name '*.md' \ |sed 's|.md|.7|g' \ - |sed 's|docs/content/using-npm/|man/man7/|g' ) \ + |sed 's|docs/content/using-npm/|man/man7/|g' ) mandocs = $(cli_mandocs) $(files_mandocs) $(misc_mandocs) @@ -41,7 +39,7 @@ $(version_mandocs): package.json htmldocs: deps node bin/npm-cli.js rebuild cmark-gfm - node bin/npm-cli.js run build -w docs + node docs/bin/dockhand.js clean: docsclean gitclean @@ -52,9 +50,9 @@ deps: node bin/npm-cli.js run resetdeps ## targets for man files, these are encouraged to be only built by running `make docs` or `make mandocs` -man/man1/%.1: docs/content/commands/%.md scripts/docs-build.js +man/man1/%.1: docs/content/commands/%.md docs/bin/docs-build.js @[ -d man/man1 ] || mkdir -p man/man1 - node scripts/docs-build.js $< $@ + node docs/bin/docs-build.js $< $@ man/man5/npm-json.5: man/man5/package.json.5 cp $< $@ @@ -62,26 +60,25 @@ man/man5/npm-json.5: man/man5/package.json.5 man/man5/npm-global.5: man/man5/folders.5 cp $< $@ -man/man5/%.5: docs/content/configuring-npm/%.md scripts/docs-build.js +man/man5/%.5: docs/content/configuring-npm/%.md docs/bin/docs-build.js @[ -d man/man5 ] || mkdir -p man/man5 - node scripts/docs-build.js $< $@ + node docs/bin/docs-build.js $< $@ -man/man7/%.7: docs/content/using-npm/%.md scripts/docs-build.js +man/man7/%.7: docs/content/using-npm/%.md docs/bin/docs-build.js @[ -d man/man7 ] || mkdir -p man/man7 - node scripts/docs-build.js $< $@ + node docs/bin/docs-build.js $< $@ # Any time the config definitions description changes, automatically # update the documentation to account for it -docs/content/using-npm/config.md: scripts/config-doc.js lib/utils/config/*.js - node scripts/config-doc.js +docs/content/using-npm/config.md: docs/bin/config-doc.js lib/utils/config/*.js + node docs/bin/config-doc.js -docs/content/commands/npm-%.md: lib/commands/%.js scripts/config-doc-command.js lib/utils/config/*.js - node scripts/config-doc-command.js $@ $< +docs/content/commands/npm-%.md: docs/bin/config-doc-command.js lib/commands/%.js lib/utils/config/*.js lib/utils/cmd-list.js + node docs/bin/config-doc-command.js $@ $< freshdocs: touch lib/utils/config/definitions.js - touch scripts/config-doc-command.js - touch scripts/config-doc.js + touch "docs/bin/*.js" make docs test: deps diff --git a/README.md b/README.md index 46846fa0087b5..fdc80bc796a26 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ -[![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/npm/cli/Node%20CI/latest)](https://github.com/npm/cli/actions?query=workflow%3A%22Node+CI%22+branch%3Alatest) [![Coveralls github branch](https://img.shields.io/coveralls/github/npm/cli/latest)](https://coveralls.io/github/npm/cli?branch=latest) - # npm - a JavaScript package manager +[![npm version](https://img.shields.io/npm/v/npm.svg)](https://npm.im/npm) +[![license](https://img.shields.io/npm/l/npm.svg)](https://npm.im/npm) +[![CI - cli](https://github.com/npm/cli/actions/workflows/ci.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci.yml) +[![Benchmark Suite](https://github.com/npm/cli/actions/workflows/benchmark.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/benchmark.yml) + ### Requirements One of the following versions of [Node.js](https://nodejs.org/en/download/) must be installed to run **`npm`**: diff --git a/docs/.gitignore b/docs/.gitignore index 823857bf98764..2231d46ac2b98 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -18,5 +18,6 @@ !/.gitignore !/bin/ !/content/ +!/lib/ !/nav.yml !/package.json diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000000000..5fc7ccf6cd60a --- /dev/null +++ b/docs/README.md @@ -0,0 +1,5 @@ +# docs + +[![CI - docs](https://github.com/npm/cli/actions/workflows/ci-docs.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-docs.yml) + +Scripts to build the npm docs. diff --git a/scripts/config-doc-command.js b/docs/bin/config-doc-command.js similarity index 60% rename from scripts/config-doc-command.js rename to docs/bin/config-doc-command.js index efc8315619e8a..f55213cdcfd6d 100644 --- a/scripts/config-doc-command.js +++ b/docs/bin/config-doc-command.js @@ -1,27 +1,6 @@ -const { definitions } = require('../lib/utils/config/index.js') -const cmdAliases = require('../lib/utils/cmd-list').aliases -const { writeFileSync, readFileSync } = require('fs') +const fs = require('fs').promises const { resolve } = require('path') - -const configDoc = process.argv[2] -const commandFile = process.argv[3] - -const TAGS = { - CONFIG: { - START: '', - END: '', - }, - USAGE: { - START: '', - END: '', - }, -} - -// Note: commands without params skip this whole process. -const { - params, - usage, -} = require(resolve(commandFile)) +const { definitions, aliases } = require('../lib/npm.js') const describeAll = (content) => content.map(name => definitions[name].describe()).join( @@ -29,7 +8,7 @@ const describeAll = (content) => '\n\n' ) -const describeUsage = ({ usage }) => { +const describeUsage = ({ usage, configDoc, commandFile }) => { const synopsis = [] // Grab the command name from the *.md filename @@ -52,19 +31,19 @@ const describeUsage = ({ usage }) => { synopsis.push(usage.map(usageInfo => `${baseCommand} ${usageInfo}`).join('\n')) } - const aliases = Object.keys(cmdAliases).reduce((p, c) => { - if (cmdAliases[c] === commandName) { + const cmdAliases = Object.keys(aliases).reduce((p, c) => { + if (aliases[c] === commandName) { p.push(c) } return p }, []) - if (aliases.length === 1) { + if (cmdAliases.length === 1) { synopsis.push('') - synopsis.push(`alias: ${aliases[0]}`) - } else if (aliases.length > 1) { + synopsis.push(`alias: ${cmdAliases[0]}`) + } else if (cmdAliases.length > 1) { synopsis.push('') - synopsis.push(`aliases: ${aliases.join(', ')}`) + synopsis.push(`aliases: ${cmdAliases.join(', ')}`) } } } else { @@ -106,35 +85,58 @@ const addBetweenTags = ( ].join('') } -const addDescriptions = doc => +const TAGS = { + CONFIG: { + START: '', + END: '', + }, + USAGE: { + START: '', + END: '', + }, +} + +const addDescriptions = ({ doc, params }) => addBetweenTags(doc, TAGS.CONFIG.START, TAGS.CONFIG.END, describeAll(params)) -const addUsageDescriptions = doc => +const addUsageDescriptions = ({ doc, usage, configDoc, commandFile }) => addBetweenTags(doc, TAGS.USAGE.START, TAGS.USAGE.END, - describeUsage({ usage }), + describeUsage({ usage, configDoc, commandFile }), commandFile ) -try { - // always write SOMETHING so that Make sees the file is up to date. - const doc = readFileSync(configDoc, 'utf8') - const hasTag = doc.includes(TAGS.CONFIG.START) - const hasUsageTag = doc.includes(TAGS.USAGE.START) +const run = async (configDoc, commandFile) => { + try { + // Note: commands without params skip this whole process. + const { params, usage } = require(resolve(commandFile)) - if (params && params.length) { - let newDoc = hasTag ? addDescriptions(doc) : doc - newDoc = hasUsageTag ? addUsageDescriptions(newDoc) : newDoc + // always write SOMETHING so that Make sees the file is up to date. + const doc = await fs.readFile(configDoc, 'utf8') + const hasTag = doc.includes(TAGS.CONFIG.START) + const hasUsageTag = doc.includes(TAGS.USAGE.START) - if (!hasTag) { - console.error('WARNING: did not find config description section', configDoc) - } + if (params && params.length) { + let newDoc = hasTag ? addDescriptions({ doc, params }) : doc + newDoc = hasUsageTag + ? addUsageDescriptions({ doc: newDoc, usage, configDoc, commandFile }) + : newDoc + + if (!hasTag) { + console.error('WARNING: did not find config description section', configDoc) + } - if ((usage && usage.length) && !hasUsageTag) { - console.error('WARNING: did not find usage description section', configDoc) + if ((usage && usage.length) && !hasUsageTag) { + console.error('WARNING: did not find usage description section', configDoc) + } + await fs.writeFile(configDoc, newDoc) } - writeFileSync(configDoc, newDoc) + } catch (err) { + console.error(`WARNING: file cannot be open: ${configDoc}`) + throw err } -} catch (err) { - console.error(`WARNING: file cannot be open: ${configDoc}`) - console.error(err) } + +run(...process.argv.slice(2)).catch((err) => { + process.exitCode = 1 + console.error(err) +}) diff --git a/scripts/config-doc.js b/docs/bin/config-doc.js similarity index 75% rename from scripts/config-doc.js rename to docs/bin/config-doc.js index b14baa381f411..1aa96e53cbb43 100644 --- a/scripts/config-doc.js +++ b/docs/bin/config-doc.js @@ -1,7 +1,6 @@ -const { shorthands, describeAll } = require('../lib/utils/config/index.js') -const { writeFileSync, readFileSync } = require('fs') -const { resolve } = require('path') -const configDoc = resolve(__dirname, '../docs/content/using-npm/config.md') +const fs = require('fs').promises +const { resolve, relative } = require('path') +const { shorthands, describeAll } = require('../lib/npm.js') const addBetweenTags = (doc, startTag, endTag, body) => { const startSplit = doc.split(startTag) @@ -49,6 +48,16 @@ const addShorthands = doc => { return addBetweenTags(doc, startTag, endTag, body) } -const doc = readFileSync(configDoc, 'utf8') -writeFileSync(configDoc, addDescriptions(addShorthands(doc))) -console.log(`updated docs/content/using-npm/config.md`) +const run = async (dir) => { + const configDoc = resolve(dir, '../content/using-npm/config.md') + const doc = await fs.readFile(configDoc, 'utf8') + + await fs.writeFile(configDoc, addDescriptions(addShorthands(doc))) + + return `updated ${relative(process.cwd(), configDoc)}` +} + +run(__dirname).then(console.log).catch((err) => { + process.exitCode = 1 + console.error(err) +}) diff --git a/docs/bin/dockhand.js b/docs/bin/dockhand.js index 4b359e1b65940..56160136eed6f 100644 --- a/docs/bin/dockhand.js +++ b/docs/bin/dockhand.js @@ -1,5 +1,3 @@ -#!/usr/bin/env node - const path = require('path') const fs = require('fs') const yaml = require('yaml') @@ -7,35 +5,7 @@ const cmark = require('cmark-gfm') const mdx = require('@mdx-js/mdx') const mkdirp = require('mkdirp') const jsdom = require('jsdom') -const npm = require('../../lib/npm.js') - -const run = async function (rootDir) { - const dir = (...p) => path.join(rootDir, '..', ...p) - - const config = require(dir('bin', 'config.json')) - const template = fs.readFileSync(dir('bin', 'template.html'), 'utf-8') - const nav = yaml.parse(fs.readFileSync(dir('nav.yml'), 'utf-8')) - - try { - const navPaths = getNavigationPaths(nav) - const fsPaths = await renderFilesystemPaths({ - input: dir('content'), - output: dir('output'), - config, - template, - }) - - const navErrors = ensureNavigationComplete(navPaths, fsPaths) - if (navErrors) { - console.error(navErrors) - process.exit(1) - } - } catch (error) { - console.error(error) - } -} - -run(__dirname) +const { version: VERSION } = require('../lib/npm.js') function ensureNavigationComplete (navPaths, fsPaths) { const unmatchedNav = {} @@ -124,7 +94,7 @@ async function renderFile (root, outputRoot, childPath, { template, config }) { const inputPath = path.join(root, childPath) if (!inputPath.match(/\.md$/)) { - console.log(`warning: unknown file type ${inputPath}, ignored`) + console.error(`warning: unknown file type ${inputPath}, ignored`) return } @@ -140,7 +110,7 @@ async function renderFile (root, outputRoot, childPath, { template, config }) { }) // Replace any tokens in the source - md = md.replace(/@VERSION@/, npm.version) + md = md.replace(/@VERSION@/, VERSION) // Render the markdown into an HTML snippet using a GFM renderer. const content = cmark.renderHtmlSync(md, { @@ -190,7 +160,7 @@ async function renderFile (root, outputRoot, childPath, { template, config }) { return config[key.replace(/^config\./, '')] default: - console.log(`warning: unknown token '${token}' in ${inputPath}`) + console.error(`warning: unknown token '${token}' in ${inputPath}`) return '' } }) @@ -323,3 +293,30 @@ class MarkdownError extends Error { this.inner = inner } } + +const run = async function (rootDir) { + const dir = (...p) => path.join(rootDir, '..', ...p) + + const config = require(dir('lib', 'config.json')) + const template = fs.readFileSync(dir('lib', 'template.html'), 'utf-8') + const nav = yaml.parse(fs.readFileSync(dir('nav.yml'), 'utf-8')) + + const navPaths = getNavigationPaths(nav) + const fsPaths = await renderFilesystemPaths({ + input: dir('content'), + output: dir('output'), + config, + template, + }) + + const navErrors = ensureNavigationComplete(navPaths, fsPaths) + if (navErrors) { + console.error(navErrors) + throw new Error('Nav Errors') + } +} + +run(__dirname).catch((err) => { + process.exitCode = 1 + console.error(err) +}) diff --git a/docs/bin/docs-build.js b/docs/bin/docs-build.js new file mode 100644 index 0000000000000..61343bfa45729 --- /dev/null +++ b/docs/bin/docs-build.js @@ -0,0 +1,39 @@ +const fs = require('fs').promises +const marked = require('marked-man') +const { version: VERSION } = require('../lib/npm.js') + +function frontmatter (_, p1) { + const fm = {} + + p1.split(/\r?\n/).forEach((kv) => { + const result = kv.match(/^([^\s:]+):\s*(.*)/) + if (result) { + fm[result[1]] = result[2] + } + }) + + return `# ${fm.title}(${fm.section}) - ${fm.description}` +} + +function replacer (_, p1) { + return 'npm help ' + p1.replace(/npm /, '') +} + +const run = async (src, dest = src) => { + const data = await fs.readFile(src, 'utf8') + + const result = data.replace(/@VERSION@/g, VERSION) + .replace(/^$/gm, '') + .replace(/^---\n([\s\S]+\n)---/, frontmatter) + .replace(/\[([^\]]+)\]\(\/commands\/([^)]+)\)/g, replacer) + .replace(/\[([^\]]+)\]\(\/configuring-npm\/([^)]+)\)/g, replacer) + .replace(/\[([^\]]+)\]\(\/using-npm\/([^)]+)\)/g, replacer) + .trim() + + await fs.writeFile(dest, marked(result), 'utf8') +} + +run(...process.argv.slice(2)).catch((err) => { + process.exitCode = 1 + console.error(err) +}) diff --git a/docs/content/commands/npm-audit.md b/docs/content/commands/npm-audit.md index 24b700ff5abd8..0f164ac9d3ec5 100644 --- a/docs/content/commands/npm-audit.md +++ b/docs/content/commands/npm-audit.md @@ -394,6 +394,8 @@ When false, specifying individual workspaces via the `workspace` config, or all workspaces via the `workspaces` flag, will cause npm to operate only on the specified workspaces, and not on the root project. +This value is not exported to the environment for child processes. + diff --git a/docs/content/commands/npm-ci.md b/docs/content/commands/npm-ci.md index 97d1aa5523dd7..b4ce811869bb2 100644 --- a/docs/content/commands/npm-ci.md +++ b/docs/content/commands/npm-ci.md @@ -46,6 +46,13 @@ In short, the main differences between using `npm install` and `npm ci` are: * It will never write to `package.json` or any of the package-locks: installs are essentially frozen. +NOTE: If you create your `package-lock.json` file by running `npm install` +with flags that can affect the shape of your dependency tree, such as +`--legacy-peer-deps`, you _must_ provide the same flags to `npm ci` or you +are likely to encounter errors. An easy way to do this is to run +`npm config set legacy-peer-deps=true --location=project` and commit the +`.npmrc` file to your repo. + ### Example Make sure you have a package-lock and an up-to-date install: diff --git a/docs/content/commands/npm-dedupe.md b/docs/content/commands/npm-dedupe.md index b5a64831c0bba..b9768c25db88d 100644 --- a/docs/content/commands/npm-dedupe.md +++ b/docs/content/commands/npm-dedupe.md @@ -80,11 +80,9 @@ result in new modules being installed. Using `npm find-dupes` will run the command in `--dry-run` mode. -Note that by default `npm dedupe` will not update the semver values of direct -dependencies in your project `package.json`, if you want to also update -values in `package.json` you can run: `npm dedupe --save` (or add the -`save=true` option to a [configuration file](/configuring-npm/npmrc) -to make that the default behavior). +Note: `npm dedupe` will never update the semver values of direct +dependencies in your project `package.json`, if you want to update +values in `package.json` you can run: `npm update --save` instead. ### Configuration @@ -158,22 +156,6 @@ This configuration does not affect `npm ci`. -#### `save` - -* Default: `true` unless when using `npm update` or `npm dedupe` where it - defaults to `false` -* Type: Boolean - -Save installed packages to a `package.json` file as dependencies. - -When used with the `npm rm` command, removes the dependency from -`package.json`. - -Will also prevent writing to `package-lock.json` if set to `false`. - - - - #### `omit` * Default: 'dev' if the `NODE_ENV` environment variable is set to @@ -323,6 +305,8 @@ When false, specifying individual workspaces via the `workspace` config, or all workspaces via the `workspaces` flag, will cause npm to operate only on the specified workspaces, and not on the root project. +This value is not exported to the environment for child processes. + diff --git a/docs/content/commands/npm-diff.md b/docs/content/commands/npm-diff.md index c4c9eafdb3524..7dcc8af7c3b4c 100644 --- a/docs/content/commands/npm-diff.md +++ b/docs/content/commands/npm-diff.md @@ -335,6 +335,8 @@ When false, specifying individual workspaces via the `workspace` config, or all workspaces via the `workspaces` flag, will cause npm to operate only on the specified workspaces, and not on the root project. +This value is not exported to the environment for child processes. + diff --git a/docs/content/commands/npm-dist-tag.md b/docs/content/commands/npm-dist-tag.md index a0f306cd4970d..b9caf1fbe7fa9 100644 --- a/docs/content/commands/npm-dist-tag.md +++ b/docs/content/commands/npm-dist-tag.md @@ -159,6 +159,8 @@ When false, specifying individual workspaces via the `workspace` config, or all workspaces via the `workspaces` flag, will cause npm to operate only on the specified workspaces, and not on the root project. +This value is not exported to the environment for child processes. + diff --git a/docs/content/commands/npm-docs.md b/docs/content/commands/npm-docs.md index 8d5a278286a88..790d563bdb1fb 100644 --- a/docs/content/commands/npm-docs.md +++ b/docs/content/commands/npm-docs.md @@ -116,6 +116,8 @@ When false, specifying individual workspaces via the `workspace` config, or all workspaces via the `workspaces` flag, will cause npm to operate only on the specified workspaces, and not on the root project. +This value is not exported to the environment for child processes. + diff --git a/docs/content/commands/npm-exec.md b/docs/content/commands/npm-exec.md index 3645e336b9da9..8ccfa75c73386 100644 --- a/docs/content/commands/npm-exec.md +++ b/docs/content/commands/npm-exec.md @@ -205,6 +205,8 @@ When false, specifying individual workspaces via the `workspace` config, or all workspaces via the `workspaces` flag, will cause npm to operate only on the specified workspaces, and not on the root project. +This value is not exported to the environment for child processes. + diff --git a/docs/content/commands/npm-find-dupes.md b/docs/content/commands/npm-find-dupes.md index f7366fa6375d1..3549be47daae9 100644 --- a/docs/content/commands/npm-find-dupes.md +++ b/docs/content/commands/npm-find-dupes.md @@ -229,6 +229,8 @@ When false, specifying individual workspaces via the `workspace` config, or all workspaces via the `workspaces` flag, will cause npm to operate only on the specified workspaces, and not on the root project. +This value is not exported to the environment for child processes. + diff --git a/docs/content/commands/npm-init.md b/docs/content/commands/npm-init.md index 71109cd360511..5a7dd4c97ac60 100644 --- a/docs/content/commands/npm-init.md +++ b/docs/content/commands/npm-init.md @@ -264,6 +264,8 @@ When false, specifying individual workspaces via the `workspace` config, or all workspaces via the `workspaces` flag, will cause npm to operate only on the specified workspaces, and not on the root project. +This value is not exported to the environment for child processes. + diff --git a/docs/content/commands/npm-install-test.md b/docs/content/commands/npm-install-test.md index 5ac31cbf08e25..8975fc4ce61de 100644 --- a/docs/content/commands/npm-install-test.md +++ b/docs/content/commands/npm-install-test.md @@ -42,8 +42,7 @@ takes exactly the same arguments as `npm install`. #### `save` -* Default: `true` unless when using `npm update` or `npm dedupe` where it - defaults to `false` +* Default: `true` unless when using `npm update` where it defaults to `false` * Type: Boolean Save installed packages to a `package.json` file as dependencies. @@ -315,6 +314,8 @@ When false, specifying individual workspaces via the `workspace` config, or all workspaces via the `workspaces` flag, will cause npm to operate only on the specified workspaces, and not on the root project. +This value is not exported to the environment for child processes. + diff --git a/docs/content/commands/npm-install.md b/docs/content/commands/npm-install.md index 328d6fc14d9db..7e370319b82ff 100644 --- a/docs/content/commands/npm-install.md +++ b/docs/content/commands/npm-install.md @@ -432,8 +432,7 @@ These are some of the most common options related to installation. #### `save` -* Default: `true` unless when using `npm update` or `npm dedupe` where it - defaults to `false` +* Default: `true` unless when using `npm update` where it defaults to `false` * Type: Boolean Save installed packages to a `package.json` file as dependencies. @@ -705,6 +704,8 @@ When false, specifying individual workspaces via the `workspace` config, or all workspaces via the `workspaces` flag, will cause npm to operate only on the specified workspaces, and not on the root project. +This value is not exported to the environment for child processes. + diff --git a/docs/content/commands/npm-link.md b/docs/content/commands/npm-link.md index 892b55496c9b6..fb7e46de04a09 100644 --- a/docs/content/commands/npm-link.md +++ b/docs/content/commands/npm-link.md @@ -125,8 +125,7 @@ workspace(s). #### `save` -* Default: `true` unless when using `npm update` or `npm dedupe` where it - defaults to `false` +* Default: `true` unless when using `npm update` where it defaults to `false` * Type: Boolean Save installed packages to a `package.json` file as dependencies. @@ -383,6 +382,8 @@ When false, specifying individual workspaces via the `workspace` config, or all workspaces via the `workspaces` flag, will cause npm to operate only on the specified workspaces, and not on the root project. +This value is not exported to the environment for child processes. + diff --git a/docs/content/commands/npm-ls.md b/docs/content/commands/npm-ls.md index 0f06e131f414b..8d4799777e20f 100644 --- a/docs/content/commands/npm-ls.md +++ b/docs/content/commands/npm-ls.md @@ -280,6 +280,8 @@ When false, specifying individual workspaces via the `workspace` config, or all workspaces via the `workspaces` flag, will cause npm to operate only on the specified workspaces, and not on the root project. +This value is not exported to the environment for child processes. + diff --git a/docs/content/commands/npm-pack.md b/docs/content/commands/npm-pack.md index c834f643ac0bb..fa6c005e9d228 100644 --- a/docs/content/commands/npm-pack.md +++ b/docs/content/commands/npm-pack.md @@ -122,6 +122,8 @@ When false, specifying individual workspaces via the `workspace` config, or all workspaces via the `workspaces` flag, will cause npm to operate only on the specified workspaces, and not on the root project. +This value is not exported to the environment for child processes. + diff --git a/docs/content/commands/npm-prune.md b/docs/content/commands/npm-prune.md index a10a353801b7c..81dccf889ce4d 100644 --- a/docs/content/commands/npm-prune.md +++ b/docs/content/commands/npm-prune.md @@ -186,6 +186,8 @@ When false, specifying individual workspaces via the `workspace` config, or all workspaces via the `workspaces` flag, will cause npm to operate only on the specified workspaces, and not on the root project. +This value is not exported to the environment for child processes. + diff --git a/docs/content/commands/npm-publish.md b/docs/content/commands/npm-publish.md index ce6e1c1012c8e..2995f6bc81551 100644 --- a/docs/content/commands/npm-publish.md +++ b/docs/content/commands/npm-publish.md @@ -238,6 +238,8 @@ When false, specifying individual workspaces via the `workspace` config, or all workspaces via the `workspaces` flag, will cause npm to operate only on the specified workspaces, and not on the root project. +This value is not exported to the environment for child processes. + diff --git a/docs/content/commands/npm-rebuild.md b/docs/content/commands/npm-rebuild.md index d63e00b79d386..bddd18c2bcaf4 100644 --- a/docs/content/commands/npm-rebuild.md +++ b/docs/content/commands/npm-rebuild.md @@ -157,6 +157,8 @@ When false, specifying individual workspaces via the `workspace` config, or all workspaces via the `workspaces` flag, will cause npm to operate only on the specified workspaces, and not on the root project. +This value is not exported to the environment for child processes. + diff --git a/docs/content/commands/npm-repo.md b/docs/content/commands/npm-repo.md index e14f07012a248..404c724ff0290 100644 --- a/docs/content/commands/npm-repo.md +++ b/docs/content/commands/npm-repo.md @@ -103,6 +103,8 @@ When false, specifying individual workspaces via the `workspace` config, or all workspaces via the `workspaces` flag, will cause npm to operate only on the specified workspaces, and not on the root project. +This value is not exported to the environment for child processes. + diff --git a/docs/content/commands/npm-run-script.md b/docs/content/commands/npm-run-script.md index 79b7c9a25780e..73c4b1c7a748a 100644 --- a/docs/content/commands/npm-run-script.md +++ b/docs/content/commands/npm-run-script.md @@ -203,6 +203,8 @@ When false, specifying individual workspaces via the `workspace` config, or all workspaces via the `workspaces` flag, will cause npm to operate only on the specified workspaces, and not on the root project. +This value is not exported to the environment for child processes. + @@ -218,6 +220,8 @@ it's present and fail if the script fails. This is useful, for example, when running scripts that may only apply for some builds in an otherwise generic CI setup. +This value is not exported to the environment for child processes. + diff --git a/docs/content/commands/npm-set-script.md b/docs/content/commands/npm-set-script.md index 2d8e87db85219..0fc267f760c81 100644 --- a/docs/content/commands/npm-set-script.md +++ b/docs/content/commands/npm-set-script.md @@ -97,6 +97,8 @@ When false, specifying individual workspaces via the `workspace` config, or all workspaces via the `workspaces` flag, will cause npm to operate only on the specified workspaces, and not on the root project. +This value is not exported to the environment for child processes. + diff --git a/docs/content/commands/npm-uninstall.md b/docs/content/commands/npm-uninstall.md index 9316c686d4095..572d9dd8aaa3d 100644 --- a/docs/content/commands/npm-uninstall.md +++ b/docs/content/commands/npm-uninstall.md @@ -30,7 +30,7 @@ It also removes the package from the `dependencies`, `devDependencies`, `optionalDependencies`, and `peerDependencies` objects in your `package.json`. -Futher, if you have an `npm-shrinkwrap.json` or `package-lock.json`, npm +Further, if you have an `npm-shrinkwrap.json` or `package-lock.json`, npm will update those files as well. `--no-save` will tell npm not to remove the package from your @@ -70,8 +70,7 @@ npm uninstall lodash --no-save #### `save` -* Default: `true` unless when using `npm update` or `npm dedupe` where it - defaults to `false` +* Default: `true` unless when using `npm update` where it defaults to `false` * Type: Boolean Save installed packages to a `package.json` file as dependencies. @@ -141,6 +140,8 @@ When false, specifying individual workspaces via the `workspace` config, or all workspaces via the `workspaces` flag, will cause npm to operate only on the specified workspaces, and not on the root project. +This value is not exported to the environment for child processes. + diff --git a/docs/content/commands/npm-update.md b/docs/content/commands/npm-update.md index aff46b1e5b557..be0b0cb937eae 100644 --- a/docs/content/commands/npm-update.md +++ b/docs/content/commands/npm-update.md @@ -171,8 +171,7 @@ be _downgraded_. #### `save` -* Default: `true` unless when using `npm update` or `npm dedupe` where it - defaults to `false` +* Default: `true` unless when using `npm update` where it defaults to `false` * Type: Boolean Save installed packages to a `package.json` file as dependencies. @@ -433,6 +432,8 @@ When false, specifying individual workspaces via the `workspace` config, or all workspaces via the `workspaces` flag, will cause npm to operate only on the specified workspaces, and not on the root project. +This value is not exported to the environment for child processes. + diff --git a/docs/content/commands/npm-version.md b/docs/content/commands/npm-version.md index 713e5ae410dfc..8e3334d788984 100644 --- a/docs/content/commands/npm-version.md +++ b/docs/content/commands/npm-version.md @@ -166,6 +166,8 @@ When false, specifying individual workspaces via the `workspace` config, or all workspaces via the `workspaces` flag, will cause npm to operate only on the specified workspaces, and not on the root project. +This value is not exported to the environment for child processes. + diff --git a/docs/content/commands/npm-view.md b/docs/content/commands/npm-view.md index b50b4bfb56c5d..0ef17d8adfb39 100644 --- a/docs/content/commands/npm-view.md +++ b/docs/content/commands/npm-view.md @@ -180,6 +180,8 @@ When false, specifying individual workspaces via the `workspace` config, or all workspaces via the `workspaces` flag, will cause npm to operate only on the specified workspaces, and not on the root project. +This value is not exported to the environment for child processes. + diff --git a/docs/content/using-npm/config.md b/docs/content/using-npm/config.md index 39870922c0253..71dab98a3831e 100644 --- a/docs/content/using-npm/config.md +++ b/docs/content/using-npm/config.md @@ -762,6 +762,8 @@ it's present and fail if the script fails. This is useful, for example, when running scripts that may only apply for some builds in an otherwise generic CI setup. +This value is not exported to the environment for child processes. + @@ -819,6 +821,8 @@ When false, specifying individual workspaces via the `workspace` config, or all workspaces via the `workspaces` flag, will cause npm to operate only on the specified workspaces, and not on the root project. +This value is not exported to the environment for child processes. + @@ -1343,8 +1347,7 @@ The base URL of the npm registry. #### `save` -* Default: `true` unless when using `npm update` or `npm dedupe` where it - defaults to `false` +* Default: `true` unless when using `npm update` where it defaults to `false` * Type: Boolean Save installed packages to a `package.json` file as dependencies. diff --git a/docs/bin/config.json b/docs/lib/config.json similarity index 100% rename from docs/bin/config.json rename to docs/lib/config.json diff --git a/docs/lib/npm.js b/docs/lib/npm.js new file mode 100644 index 0000000000000..fb801a17bea46 --- /dev/null +++ b/docs/lib/npm.js @@ -0,0 +1,14 @@ +const { definitions, shorthands, describeAll } = require('../../lib/utils/config/index.js') +const { aliases } = require('../../lib/utils/cmd-list') +const Npm = require('../../lib/npm.js') + +// These are all the npm internals depended on by the docs scripts. If these change +// the associated targets should also be updated in the Makefile. + +module.exports = { + definitions, + shorthands, + describeAll, + aliases, + version: Npm.version, +} diff --git a/docs/bin/template.html b/docs/lib/template.html similarity index 100% rename from docs/bin/template.html rename to docs/lib/template.html diff --git a/docs/package.json b/docs/package.json index 9bd06f0946107..87c5020e21e08 100644 --- a/docs/package.json +++ b/docs/package.json @@ -4,7 +4,6 @@ "version": "1.0.0", "private": true, "scripts": { - "build": "node bin/dockhand", "lint": "eslint \"**/*.js\"", "postlint": "template-oss-check", "template-oss-apply": "template-oss-apply --force", @@ -24,18 +23,20 @@ "@mdx-js/mdx": "^1.6.22", "@npmcli/eslint-config": "^3.0.1", "@npmcli/fs": "^2.1.0", - "@npmcli/promise-spawn": "^1.3.2", - "@npmcli/template-oss": "3.2.2", + "@npmcli/promise-spawn": "^3.0.0", + "@npmcli/template-oss": "3.3.2", "cmark-gfm": "^0.9.0", "jsdom": "^18.1.0", "marked-man": "^0.7.0", - "tap": "^15.2.3", + "tap": "^16.0.1", + "which": "^2.0.2", "yaml": "^1.10.0" }, "author": "GitHub Inc.", "license": "ISC", "files": [ "bin/", + "lib/", "content/", "nav.yml" ], @@ -45,19 +46,20 @@ "tap": { "statements": 81, "branches": 72, - "functions": 80, + "functions": 75, "lines": 81 }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", "distPaths": [ "bin/", + "lib/", "content/", "nav.yml" ], "ciVersions": [ "16" ], - "version": "3.2.2" + "version": "3.3.2" } } diff --git a/docs/test/index.js b/docs/test/index.js index fab9748a3ae3d..57524327bfcbf 100644 --- a/docs/test/index.js +++ b/docs/test/index.js @@ -9,24 +9,24 @@ const output = join(cwd, 'output') const rmOutput = () => fs.rm(output, { recursive: true, force: true }).catch(() => {}) -const spawnNpm = (...args) => { +const spawnNpm = (cmd, ...args) => { // remove npm config when spawning so config set by test commands don't interfere const env = Object.entries(process.env) .filter(([k]) => k.toLowerCase() !== 'npm_config_ignore_scripts') - return spawn(which('npm'), args, { + return spawn(which(cmd), args, { env: Object.fromEntries(env), stdioString: true, cwd, }) } -t.before(() => spawnNpm('rebuild', 'cmark-gfm')) +t.before(() => spawnNpm('npm', 'rebuild', 'cmark-gfm')) t.beforeEach(() => rmOutput()) t.test('docs', async (t) => { t.rejects(() => fs.stat(output)) - const docs = await spawnNpm('run', 'build') + const docs = await spawnNpm('node', join('bin', 'dockhand')) t.equal(docs.code, 0) t.ok((await fs.stat(output)).isDirectory()) }) diff --git a/lib/commands/cache.js b/lib/commands/cache.js index b8f84abc1d941..634c8dbb42809 100644 --- a/lib/commands/cache.js +++ b/lib/commands/cache.js @@ -177,7 +177,7 @@ class Cache extends BaseCommand { async verify () { const cache = path.join(this.npm.cache, '_cacache') const prefix = cache.indexOf(process.env.HOME) === 0 - ? `~${cache.substr(process.env.HOME.length)}` + ? `~${cache.slice(process.env.HOME.length)}` : cache const stats = await cacache.verify(cache) this.npm.output(`Cache verified and compressed (${prefix})`) diff --git a/lib/commands/completion.js b/lib/commands/completion.js index d0c68af6cebfc..5b7e0d355c63c 100644 --- a/lib/commands/completion.js +++ b/lib/commands/completion.js @@ -97,17 +97,17 @@ class Completion extends BaseCommand { const word = words[w] const line = COMP_LINE const point = +COMP_POINT - const partialLine = line.substr(0, point) + const partialLine = line.slice(0, point) const partialWords = words.slice(0, w) // figure out where in that last word the point is. const partialWordRaw = args[w] let i = partialWordRaw.length - while (partialWordRaw.substr(0, i) !== partialLine.substr(-1 * i) && i > 0) { + while (partialWordRaw.slice(0, i) !== partialLine.slice(-1 * i) && i > 0) { i-- } - const partialWord = unescape(partialWordRaw.substr(0, i)) + const partialWord = unescape(partialWordRaw.slice(0, i)) partialWords.push(partialWord) const opts = { diff --git a/lib/commands/dedupe.js b/lib/commands/dedupe.js index 4662ce3241b24..96d1ac2ae9a74 100644 --- a/lib/commands/dedupe.js +++ b/lib/commands/dedupe.js @@ -12,7 +12,6 @@ class Dedupe extends ArboristWorkspaceCmd { 'legacy-bundling', 'strict-peer-deps', 'package-lock', - 'save', 'omit', 'ignore-scripts', 'audit', @@ -29,19 +28,17 @@ class Dedupe extends ArboristWorkspaceCmd { throw er } - // In the context of `npm dedupe` the save - // config value should default to `false` - const save = this.npm.config.isDefault('save') - ? false - : this.npm.config.get('save') - const dryRun = this.npm.config.get('dry-run') const where = this.npm.prefix const opts = { ...this.npm.flatOptions, path: where, dryRun, - save, + // Saving during dedupe would only update if one of your direct + // dependencies was also duplicated somewhere in your tree. It would be + // confusing if running this were to also update your package.json. In + // order to reduce potential confusion we set this to false. + save: false, workspaces: this.workspaceNames, } const arb = new Arborist(opts) diff --git a/lib/commands/doctor.js b/lib/commands/doctor.js index 22a25477e22e0..ca0438f1a2481 100644 --- a/lib/commands/doctor.js +++ b/lib/commands/doctor.js @@ -145,7 +145,7 @@ class Doctor extends BaseCommand { return '' } catch (er) { if (/^E\d{3}$/.test(er.code || '')) { - throw er.code.substr(1) + ' ' + er.message + throw er.code.slice(1) + ' ' + er.message } else { throw er.message } @@ -211,7 +211,7 @@ class Doctor extends BaseCommand { const gid = process.getgid() const files = new Set([root]) for (const f of files) { - tracker.silly('checkFilesPermission', f.substr(root.length + 1)) + tracker.silly('checkFilesPermission', f.slice(root.length + 1)) const st = await lstat(f).catch(er => { // if it can't be missing, or if it can and the error wasn't that it was missing if (!missingOk || er.code !== 'ENOENT') { diff --git a/lib/commands/help-search.js b/lib/commands/help-search.js index 9422b83561cc8..3387ac8eb542c 100644 --- a/lib/commands/help-search.js +++ b/lib/commands/help-search.js @@ -171,8 +171,8 @@ class HelpSearch extends BaseCommand { const finder = line.toLowerCase().split(arg.toLowerCase()) let p = 0 for (const f of finder) { - hilitLine.push(line.substr(p, f.length)) - const word = line.substr(p + f.length, arg.length) + hilitLine.push(line.slice(p, p + f.length)) + const word = line.slice(p + f.length, p + f.length + arg.length) const hilit = color.bgBlack(color.red(word)) hilitLine.push(hilit) p += f.length + arg.length diff --git a/lib/npm.js b/lib/npm.js index 74825c97c2355..c819a0807b507 100644 --- a/lib/npm.js +++ b/lib/npm.js @@ -131,6 +131,7 @@ class Npm extends EventEmitter { const isGlobal = this.config.get('global') const workspacesEnabled = this.config.get('workspaces') + // if cwd is a workspace, the default is set to [that workspace] const implicitWorkspace = this.config.get('workspace', 'default').length > 0 const workspacesFilters = this.config.get('workspace') const includeWorkspaceRoot = this.config.get('include-workspace-root') @@ -138,6 +139,8 @@ class Npm extends EventEmitter { // or when it is implicit and not in our ignore list const hasWorkspaceFilters = workspacesFilters.length > 0 const invalidWorkspaceConfig = workspacesEnabled === false && hasWorkspaceFilters + + // (-ws || -w foo) && (cwd is not a workspace || command is not ignoring implicit workspaces) const filterByWorkspaces = (workspacesEnabled || hasWorkspaceFilters) && (!implicitWorkspace || !command.ignoreImplicitWorkspace) // normally this would go in the constructor, but our tests don't diff --git a/lib/search/format-package-stream.js b/lib/search/format-package-stream.js index 7ff44e9e2049d..acead79e1a770 100644 --- a/lib/search/format-package-stream.js +++ b/lib/search/format-package-stream.js @@ -111,7 +111,7 @@ function addColorMarker (str, arg, i) { if (arg.charAt(0) === '/') { return str.replace( - new RegExp(arg.substr(1, arg.length - 2), 'gi'), + new RegExp(arg.slice(1, -1), 'gi'), bit => markStart + bit + markEnd ) } @@ -121,9 +121,9 @@ function addColorMarker (str, arg, i) { var p = 0 return pieces.map(function (piece) { - piece = str.substr(p, piece.length) + piece = str.slice(p, p + piece.length) var mark = markStart + - str.substr(p + piece.length, arg.length) + + str.slice(p + piece.length, p + piece.length + arg.length) + markEnd p += piece.length + arg.length return piece + mark diff --git a/lib/search/package-filter.js b/lib/search/package-filter.js index 45a67835b8c4a..bb0ae679bdccd 100644 --- a/lib/search/package-filter.js +++ b/lib/search/package-filter.js @@ -36,7 +36,7 @@ function filterWords (data, include, exclude, opts) { function match (words, pattern) { if (pattern.charAt(0) === '/') { pattern = pattern.replace(/\/$/, '') - pattern = new RegExp(pattern.substr(1, pattern.length - 1)) + pattern = new RegExp(pattern.slice(1)) return words.match(pattern) } return words.indexOf(pattern) !== -1 diff --git a/lib/utils/config/definition.js b/lib/utils/config/definition.js index fc46bc3d6a5ef..f88d8334cf01f 100644 --- a/lib/utils/config/definition.js +++ b/lib/utils/config/definition.js @@ -233,7 +233,7 @@ const wrapAll = s => { return ( '* ' + block - .substr(1) + .slice(1) .trim() .split('\n* ') .map(li => { diff --git a/lib/utils/config/definitions.js b/lib/utils/config/definitions.js index efc1f72a02059..7ff0eeb1283c5 100644 --- a/lib/utils/config/definitions.js +++ b/lib/utils/config/definitions.js @@ -880,6 +880,7 @@ define('https-proxy', { define('if-present', { default: false, type: Boolean, + envExport: false, description: ` If true, npm will not exit with an error code when \`run-script\` is invoked for a script that isn't defined in the \`scripts\` section of @@ -938,6 +939,7 @@ define('include-staged', { define('include-workspace-root', { default: false, type: Boolean, + envExport: false, description: ` Include the workspace root when workspaces are enabled for a command. @@ -1605,8 +1607,8 @@ define('registry', { define('save', { default: true, - defaultDescription: `\`true\` unless when using \`npm update\` or - \`npm dedupe\` where it defaults to \`false\``, + defaultDescription: `\`true\` unless when using \`npm update\` where it + defaults to \`false\``, usage: '-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle', type: Boolean, short: 'S', diff --git a/lib/utils/npm-usage.js b/lib/utils/npm-usage.js index 8d31f0155098b..431995ecf0bae 100644 --- a/lib/utils/npm-usage.js +++ b/lib/utils/npm-usage.js @@ -53,7 +53,7 @@ const wrap = (arr) => { out[l] = c } } - return out.join('\n ').substr(2) + return out.join('\n ').slice(2) } const usages = async (npm) => { diff --git a/lib/utils/tar.js b/lib/utils/tar.js index 2f2773c6d49bc..0a74ce8c44434 100644 --- a/lib/utils/tar.js +++ b/lib/utils/tar.js @@ -48,9 +48,9 @@ const logTar = (tarball, opts = {}) => { { name: 'integrity:', value: - tarball.integrity.toString().substr(0, 20) + + tarball.integrity.toString().slice(0, 20) + '[...]' + - tarball.integrity.toString().substr(80), + tarball.integrity.toString().slice(80), }, tarball.bundled.length && { name: 'bundled deps:', value: tarball.bundled.length }, tarball.bundled.length && { diff --git a/lib/workspaces/get-workspaces.js b/lib/workspaces/get-workspaces.js index 0cddae2a462f1..373af1d689cc3 100644 --- a/lib/workspaces/get-workspaces.js +++ b/lib/workspaces/get-workspaces.js @@ -1,8 +1,11 @@ -const { resolve } = require('path') +const { resolve, relative } = require('path') const mapWorkspaces = require('@npmcli/map-workspaces') const minimatch = require('minimatch') const rpj = require('read-package-json-fast') +// minimatch wants forward slashes only for glob patterns +const globify = pattern => pattern.split('\\').join('/') + // Returns an Map of paths to workspaces indexed by workspace name // { foo => '/path/to/foo' } const getWorkspaces = async (filters, { path, includeWorkspaceRoot, relativeFrom }) => { @@ -20,9 +23,16 @@ const getWorkspaces = async (filters, { path, includeWorkspaceRoot, relativeFrom for (const filterArg of filters) { for (const [workspaceName, workspacePath] of workspaces.entries()) { + let relativePath = relative(relativeFrom, workspacePath) + if (filterArg.startsWith('./')) { + relativePath = `./${relativePath}` + } + const relativeFilter = relative(path, filterArg) if (filterArg === workspaceName - || resolve(relativeFrom || path, filterArg) === workspacePath - || minimatch(workspacePath, `${resolve(relativeFrom || path, filterArg)}/*`)) { + || resolve(relativeFrom, filterArg) === workspacePath + || minimatch(relativePath, `${globify(relativeFilter)}/*`) + || minimatch(relativePath, `${globify(filterArg)}/*`) + ) { res.set(workspaceName, workspacePath) } } diff --git a/make.bat b/make.bat index 7d71f0f925f7c..d82d893c0802d 100644 --- a/make.bat +++ b/make.bat @@ -1,3 +1,3 @@ -:: The tests run "make doc" in the prepublish script, +:: The tests run "make -s mandocs" in the postsnap script, :: so this file gives windows something that'll exit :: successfully, without having to install make. diff --git a/node_modules/@npmcli/config/lib/env-replace.js b/node_modules/@npmcli/config/lib/env-replace.js index e0f7276b1ec2b..c851f6e4d1501 100644 --- a/node_modules/@npmcli/config/lib/env-replace.js +++ b/node_modules/@npmcli/config/lib/env-replace.js @@ -7,8 +7,8 @@ module.exports = (f, env) => f.replace(envExpr, (orig, esc, name) => { // consume the escape chars that are relevant. if (esc.length % 2) { - return orig.substr((esc.length + 1) / 2) + return orig.slice((esc.length + 1) / 2) } - return (esc.substr(esc.length / 2)) + val + return (esc.slice(esc.length / 2)) + val }) diff --git a/node_modules/@npmcli/config/lib/index.js b/node_modules/@npmcli/config/lib/index.js index 7c34de8014b8e..bb8c24602fa52 100644 --- a/node_modules/@npmcli/config/lib/index.js +++ b/node_modules/@npmcli/config/lib/index.js @@ -366,7 +366,7 @@ class Config { if (!/^npm_config_/i.test(envKey) || envVal === '') { continue } - const key = envKey.substr('npm_config_'.length) + const key = envKey.slice('npm_config_'.length) .replace(/(?!^)_/g, '-') // don't replace _ at the start of the key .toLowerCase() conf[key] = envVal @@ -396,13 +396,13 @@ class Config { validate (where) { if (!where) { let valid = true - for (const [where] of this.data.entries()) { + for (const [entryWhere] of this.data.entries()) { // no need to validate our defaults, we know they're fine // cli was already validated when parsed the first time - if (where === 'default' || where === 'builtin' || where === 'cli') { + if (entryWhere === 'default' || entryWhere === 'builtin' || entryWhere === 'cli') { continue } - const ret = this.validate(where) + const ret = this.validate(entryWhere) valid = valid && ret } return valid diff --git a/node_modules/@npmcli/config/lib/parse-field.js b/node_modules/@npmcli/config/lib/parse-field.js index 9428996c98a35..0c905bf23cb10 100644 --- a/node_modules/@npmcli/config/lib/parse-field.js +++ b/node_modules/@npmcli/config/lib/parse-field.js @@ -56,7 +56,7 @@ const parseField = (f, key, opts, listElement = false) => { if (isPath) { const homePattern = platform === 'win32' ? /^~(\/|\\)/ : /^~\// if (homePattern.test(f) && home) { - f = resolve(home, f.substr(2)) + f = resolve(home, f.slice(2)) } else { f = resolve(f) } diff --git a/node_modules/@npmcli/config/package.json b/node_modules/@npmcli/config/package.json index c36e06230a976..fff1575ea9fd3 100644 --- a/node_modules/@npmcli/config/package.json +++ b/node_modules/@npmcli/config/package.json @@ -1,15 +1,15 @@ { "name": "@npmcli/config", - "version": "4.0.1", + "version": "4.0.2", "files": [ - "bin", - "lib" + "bin/", + "lib/" ], "main": "lib/index.js", "description": "Configuration management for the npm cli", "repository": { "type": "git", - "url": "git+https://github.com/npm/config" + "url": "https://github.com/npm/config.git" }, "author": "GitHub Inc.", "license": "ISC", @@ -19,23 +19,24 @@ "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", - "lint": "eslint '**/*.js'", - "postlint": "npm-template-check", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", "lintfix": "npm run lint -- --fix", "posttest": "npm run lint", - "template-copy": "npm-template-copy --force" + "template-oss-apply": "template-oss-apply --force" }, "tap": { "check-coverage": true, "coverage-map": "map.js" }, "devDependencies": { - "@npmcli/template-oss": "^2.8.1", - "tap": "^15.1.6" + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.2.2", + "tap": "^16.0.1" }, "dependencies": { - "@npmcli/map-workspaces": "^2.0.1", - "ini": "^2.0.0", + "@npmcli/map-workspaces": "^2.0.2", + "ini": "^3.0.0", "mkdirp-infer-owner": "^2.0.0", "nopt": "^5.0.0", "proc-log": "^2.0.0", @@ -44,9 +45,10 @@ "walk-up-path": "^1.0.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" }, "templateOSS": { - "version": "2.8.1" + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.2.2" } } diff --git a/node_modules/@npmcli/disparity-colors/index.js b/node_modules/@npmcli/disparity-colors/lib/index.js similarity index 87% rename from node_modules/@npmcli/disparity-colors/index.js rename to node_modules/@npmcli/disparity-colors/lib/index.js index a02b8f884d8ac..3d2aa56be9253 100644 --- a/node_modules/@npmcli/disparity-colors/index.js +++ b/node_modules/@npmcli/disparity-colors/lib/index.js @@ -4,7 +4,7 @@ const colors = { removed: ansi.red, added: ansi.green, header: ansi.yellow, - section: ansi.magenta + section: ansi.magenta, } function colorize (str, opts) { @@ -13,10 +13,10 @@ function colorize (str, opts) { headerLength = 2 } - const color = (str, colorId) => { + const color = (colorStr, colorId) => { const { open, close } = colors[colorId] // avoid highlighting the "\n" (would highlight till the end of the line) - return str.replace(/[^\n\r]+/g, open + '$&' + close) + return colorStr.replace(/[^\n\r]+/g, open + '$&' + close) } // this RegExp will include all the `\n` chars into the lines, easier to join diff --git a/node_modules/@npmcli/disparity-colors/package.json b/node_modules/@npmcli/disparity-colors/package.json index 3f389a42c9f99..2b45920a7e783 100644 --- a/node_modules/@npmcli/disparity-colors/package.json +++ b/node_modules/@npmcli/disparity-colors/package.json @@ -1,14 +1,19 @@ { "name": "@npmcli/disparity-colors", - "version": "1.0.1", + "version": "2.0.0", + "main": "lib/index.js", "files": [ - "index.js" + "bin/", + "lib/" ], "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" }, "description": "Colorizes unified diff output", - "repository": "https://github.com/npm/disparity-colors", + "repository": { + "type": "git", + "url": "https://github.com/npm/disparity-colors.git" + }, "keywords": [ "disparity", "npm", @@ -24,7 +29,7 @@ "cli", "tty" ], - "author": "npm Inc. ", + "author": "GitHub Inc.", "contributors": [ { "name": "Ruy Adorno", @@ -34,27 +39,31 @@ ], "license": "ISC", "scripts": { - "lint": "standard index.js", + "lint": "eslint \"**/*.js\"", "pretest": "npm run lint", "test": "tap", "snap": "tap", "preversion": "npm test", "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags" + "prepublishOnly": "git push origin --follow-tags", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "posttest": "npm run lint" }, "tap": { "check-coverage": true }, - "standard": { - "ignore": [ - "/tap-snapshots/" - ] - }, "devDependencies": { - "standard": "^16.0.3", - "tap": "^14.11.0" + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.2.2", + "tap": "^16.0.1" }, "dependencies": { "ansi-styles": "^4.3.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.2.2" } } diff --git a/node_modules/@npmcli/git/lib/clone.js b/node_modules/@npmcli/git/lib/clone.js index ac5f86b14494c..3f165dd70e380 100644 --- a/node_modules/@npmcli/git/lib/clone.js +++ b/node_modules/@npmcli/git/lib/clone.js @@ -20,9 +20,9 @@ const shallowHosts = new Set([ // we have to use url.parse until we add the same shim that hosted-git-info has // to handle scp:// urls const { parse } = require('url') // eslint-disable-line node/no-deprecated-api -const { basename, resolve } = require('path') +const path = require('path') -const revs = require('./revs.js') +const getRevs = require('./revs.js') const spawn = require('./spawn.js') const { isWindows } = require('./utils.js') @@ -31,7 +31,7 @@ const fs = require('fs') const mkdirp = require('mkdirp') module.exports = (repo, ref = 'HEAD', target = null, opts = {}) => - revs(repo, opts).then(revs => clone( + getRevs(repo, opts).then(revs => clone( repo, revs, ref, @@ -48,7 +48,7 @@ const maybeShallow = (repo, opts) => { } const defaultTarget = (repo, /* istanbul ignore next */ cwd = process.cwd()) => - resolve(cwd, basename(repo.replace(/[/\\]?\.git$/, ''))) + path.resolve(cwd, path.basename(repo.replace(/[/\\]?\.git$/, ''))) const clone = (repo, revs, ref, revDoc, target, opts) => { if (!revDoc) { diff --git a/node_modules/@npmcli/git/lib/lines-to-revs.js b/node_modules/@npmcli/git/lib/lines-to-revs.js index 3cf3778fe9178..6bd7e7a4c1531 100644 --- a/node_modules/@npmcli/git/lib/lines-to-revs.js +++ b/node_modules/@npmcli/git/lib/lines-to-revs.js @@ -98,19 +98,19 @@ const lineToRevDoc = line => { // ignore the pointer. // For now, though, we have to save both, because some tags // don't have peels, if they were not annotated. - const ref = rawRef.substr('refs/tags/'.length) + const ref = rawRef.slice('refs/tags/'.length) return { sha, ref, rawRef, type } } if (type === 'branch') { - const ref = rawRef.substr('refs/heads/'.length) + const ref = rawRef.slice('refs/heads/'.length) return { sha, ref, rawRef, type } } if (type === 'pull') { // NB: merged pull requests installable with #pull/123/merge // for the merged pr, or #pull/123 for the PR head - const ref = rawRef.substr('refs/'.length).replace(/\/head$/, '') + const ref = rawRef.slice('refs/'.length).replace(/\/head$/, '') return { sha, ref, rawRef, type } } diff --git a/node_modules/@npmcli/git/lib/spawn.js b/node_modules/@npmcli/git/lib/spawn.js index 40972a509caa5..7098d7b872942 100644 --- a/node_modules/@npmcli/git/lib/spawn.js +++ b/node_modules/@npmcli/git/lib/spawn.js @@ -17,16 +17,16 @@ module.exports = (gitArgs, opts = {}) => { ? gitArgs : ['--no-replace-objects', ...gitArgs] - let retry = opts.retry - if (retry === null || retry === undefined) { - retry = { + let retryOpts = opts.retry + if (retryOpts === null || retryOpts === undefined) { + retryOpts = { retries: opts.fetchRetries || 2, factor: opts.fetchRetryFactor || 10, maxTimeout: opts.fetchRetryMaxtimeout || 60000, minTimeout: opts.fetchRetryMintimeout || 1000, } } - return promiseRetry((retry, number) => { + return promiseRetry((retryFn, number) => { if (number !== 1) { log.silly('git', `Retrying git command: ${ args.join(' ')} attempt # ${number}`) @@ -38,7 +38,7 @@ module.exports = (gitArgs, opts = {}) => { if (!gitError.shouldRetry(number)) { throw gitError } - retry(gitError) + retryFn(gitError) }) - }, retry) + }, retryOpts) } diff --git a/node_modules/@npmcli/git/package.json b/node_modules/@npmcli/git/package.json index 02cd37fa225ad..08525ae99e8ec 100644 --- a/node_modules/@npmcli/git/package.json +++ b/node_modules/@npmcli/git/package.json @@ -1,44 +1,43 @@ { "name": "@npmcli/git", - "version": "3.0.0", + "version": "3.0.1", "main": "lib/index.js", "files": [ - "bin", - "lib" + "bin/", + "lib/" ], "description": "a util for spawning git from npm CLI contexts", "repository": { "type": "git", - "url": "git+https://github.com/npm/git" + "url": "https://github.com/npm/git.git" }, "author": "GitHub Inc.", "license": "ISC", "scripts": { - "lint": "eslint '**/*.js'", - "lint:fix": "standard --fix", + "lint": "eslint \"**/*.js\"", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", "preversion": "npm test", "snap": "tap", "test": "tap", "posttest": "npm run lint", - "postlint": "npm-template-check", - "template-copy": "npm-template-copy --force", - "lintfix": "npm run lint -- --fix" + "postlint": "template-oss-check", + "lintfix": "npm run lint -- --fix", + "template-oss-apply": "template-oss-apply --force" }, "tap": { "check-coverage": true, "coverage-map": "map.js" }, "devDependencies": { - "@npmcli/template-oss": "^2.7.1", + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.2.2", "slash": "^3.0.0", - "standard": "^16.0.3", - "tap": "^15.1.6" + "tap": "^16.0.1" }, "dependencies": { - "@npmcli/promise-spawn": "^1.3.2", - "lru-cache": "^7.3.1", + "@npmcli/promise-spawn": "^3.0.0", + "lru-cache": "^7.4.4", "mkdirp": "^1.0.4", "npm-pick-manifest": "^7.0.0", "proc-log": "^2.0.0", @@ -48,10 +47,11 @@ "which": "^2.0.2" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" }, "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", "windowsCI": false, - "version": "2.7.1" + "version": "3.2.2" } } diff --git a/node_modules/@npmcli/map-workspaces/node_modules/minimatch/LICENSE b/node_modules/@npmcli/map-workspaces/node_modules/minimatch/LICENSE deleted file mode 100644 index 9517b7d995bb0..0000000000000 --- a/node_modules/@npmcli/map-workspaces/node_modules/minimatch/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) 2011-2022 Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/@npmcli/map-workspaces/node_modules/minimatch/minimatch.js b/node_modules/@npmcli/map-workspaces/node_modules/minimatch/minimatch.js deleted file mode 100644 index f3b491dd1073e..0000000000000 --- a/node_modules/@npmcli/map-workspaces/node_modules/minimatch/minimatch.js +++ /dev/null @@ -1,901 +0,0 @@ -const minimatch = module.exports = (p, pattern, options = {}) => { - assertValidPattern(pattern) - - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false - } - - return new Minimatch(pattern, options).match(p) -} - -module.exports = minimatch - -const path = require('./lib/path.js') -minimatch.sep = path.sep - -const GLOBSTAR = Symbol('globstar **') -minimatch.GLOBSTAR = GLOBSTAR -const expand = require('brace-expansion') - -const plTypes = { - '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, - '?': { open: '(?:', close: ')?' }, - '+': { open: '(?:', close: ')+' }, - '*': { open: '(?:', close: ')*' }, - '@': { open: '(?:', close: ')' } -} - -// any single thing other than / -// don't need to escape / when using new RegExp() -const qmark = '[^/]' - -// * => any number of characters -const star = qmark + '*?' - -// ** when dots are allowed. Anything goes, except .. and . -// not (^ or / followed by one or two dots followed by $ or /), -// followed by anything, any number of times. -const twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' - -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -const twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' - -// "abc" -> { a:true, b:true, c:true } -const charSet = s => s.split('').reduce((set, c) => { - set[c] = true - return set -}, {}) - -// characters that need to be escaped in RegExp. -const reSpecials = charSet('().*{}+?[]^$\\!') - -// characters that indicate we have to add the pattern start -const addPatternStartSet = charSet('[.(') - -// normalizes slashes. -const slashSplit = /\/+/ - -minimatch.filter = (pattern, options = {}) => - (p, i, list) => minimatch(p, pattern, options) - -const ext = (a, b = {}) => { - const t = {} - Object.keys(a).forEach(k => t[k] = a[k]) - Object.keys(b).forEach(k => t[k] = b[k]) - return t -} - -minimatch.defaults = def => { - if (!def || typeof def !== 'object' || !Object.keys(def).length) { - return minimatch - } - - const orig = minimatch - - const m = (p, pattern, options) => orig(p, pattern, ext(def, options)) - m.Minimatch = class Minimatch extends orig.Minimatch { - constructor (pattern, options) { - super(pattern, ext(def, options)) - } - } - m.Minimatch.defaults = options => orig.defaults(ext(def, options)).Minimatch - m.filter = (pattern, options) => orig.filter(pattern, ext(def, options)) - m.defaults = options => orig.defaults(ext(def, options)) - m.makeRe = (pattern, options) => orig.makeRe(pattern, ext(def, options)) - m.braceExpand = (pattern, options) => orig.braceExpand(pattern, ext(def, options)) - m.match = (list, pattern, options) => orig.match(list, pattern, ext(def, options)) - - return m -} - - - - - -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = (pattern, options) => braceExpand(pattern, options) - -const braceExpand = (pattern, options = {}) => { - assertValidPattern(pattern) - - // Thanks to Yeting Li for - // improving this regexp to avoid a ReDOS vulnerability. - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - // shortcut. no need to expand. - return [pattern] - } - - return expand(pattern) -} - -const MAX_PATTERN_LENGTH = 1024 * 64 -const assertValidPattern = pattern => { - if (typeof pattern !== 'string') { - throw new TypeError('invalid pattern') - } - - if (pattern.length > MAX_PATTERN_LENGTH) { - throw new TypeError('pattern is too long') - } -} - -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -const SUBPARSE = Symbol('subparse') - -minimatch.makeRe = (pattern, options) => - new Minimatch(pattern, options || {}).makeRe() - -minimatch.match = (list, pattern, options = {}) => { - const mm = new Minimatch(pattern, options) - list = list.filter(f => mm.match(f)) - if (mm.options.nonull && !list.length) { - list.push(pattern) - } - return list -} - -// replace stuff like \* with * -const globUnescape = s => s.replace(/\\(.)/g, '$1') -const regExpEscape = s => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') - -class Minimatch { - constructor (pattern, options) { - assertValidPattern(pattern) - - if (!options) options = {} - - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - this.partial = !!options.partial - - // make the set of regexps etc. - this.make() - } - - debug () {} - - make () { - const pattern = this.pattern - const options = this.options - - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } - - // step 1: figure out negation, etc. - this.parseNegate() - - // step 2: expand braces - let set = this.globSet = this.braceExpand() - - if (options.debug) this.debug = (...args) => console.error(...args) - - this.debug(this.pattern, set) - - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(s => s.split(slashSplit)) - - this.debug(this.pattern, set) - - // glob --> regexps - set = set.map((s, si, set) => s.map(this.parse, this)) - - this.debug(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(s => s.indexOf(false) === -1) - - this.debug(this.pattern, set) - - this.set = set - } - - parseNegate () { - if (this.options.nonegate) return - - const pattern = this.pattern - let negate = false - let negateOffset = 0 - - for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) { - negate = !negate - negateOffset++ - } - - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate - } - - // set partial to true to test if, for example, - // "/a/b" matches the start of "/*/b/*/d" - // Partial means, if you run out of file before you run - // out of pattern, then that's fine, as long as all - // the parts match. - matchOne (file, pattern, partial) { - var options = this.options - - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) - - this.debug('matchOne', file.length, pattern.length) - - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] - - this.debug(pattern, p, f) - - // should be impossible. - // some invalid regexp stuff in the set. - /* istanbul ignore if */ - if (p === false) return false - - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true - } - - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] - - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) - - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } - - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } - } - - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - /* istanbul ignore if */ - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } - - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === 'string') { - hit = f === p - this.debug('string match', p, f, hit) - } else { - hit = f.match(p) - this.debug('pattern match', p, f, hit) - } - - if (!hit) return false - } - - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else /* istanbul ignore else */ if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - return (fi === fl - 1) && (file[fi] === '') - } - - // should be unreachable. - /* istanbul ignore next */ - throw new Error('wtf?') - } - - braceExpand () { - return braceExpand(this.pattern, this.options) - } - - parse (pattern, isSub) { - assertValidPattern(pattern) - - const options = this.options - - // shortcuts - if (pattern === '**') { - if (!options.noglobstar) - return GLOBSTAR - else - pattern = '*' - } - if (pattern === '') return '' - - let re = '' - let hasMagic = !!options.nocase - let escaping = false - // ? => one single character - const patternListStack = [] - const negativeLists = [] - let stateChar - let inClass = false - let reClassStart = -1 - let classStart = -1 - let cs - let pl - let sp - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - const patternStart = pattern.charAt(0) === '.' ? '' // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' - : '(?!\\.)' - - const clearStateChar = () => { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case '*': - re += star - hasMagic = true - break - case '?': - re += qmark - hasMagic = true - break - default: - re += '\\' + stateChar - break - } - this.debug('clearStateChar %j %j', stateChar, re) - stateChar = false - } - } - - for (let i = 0, c; (i < pattern.length) && (c = pattern.charAt(i)); i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c) - - // skip over any that are escaped. - if (escaping) { - /* istanbul ignore next - completely not allowed, even escaped. */ - if (c === '/') { - return false - } - - if (reSpecials[c]) { - re += '\\' - } - re += c - escaping = false - continue - } - - switch (c) { - /* istanbul ignore next */ - case '/': { - // Should already be path-split by now. - return false - } - - case '\\': - clearStateChar() - escaping = true - continue - - // the various stateChar values - // for the "extglob" stuff. - case '?': - case '*': - case '+': - case '@': - case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) - - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === '!' && i === classStart + 1) c = '^' - re += c - continue - } - - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - this.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - - case '(': - if (inClass) { - re += '(' - continue - } - - if (!stateChar) { - re += '\\(' - continue - } - - patternListStack.push({ - type: stateChar, - start: i - 1, - reStart: re.length, - open: plTypes[stateChar].open, - close: plTypes[stateChar].close - }) - // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!(?:' : '(?:' - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue - - case ')': - if (inClass || !patternListStack.length) { - re += '\\)' - continue - } - - clearStateChar() - hasMagic = true - pl = patternListStack.pop() - // negation is (?:(?!js)[^/]*) - // The others are (?:) - re += pl.close - if (pl.type === '!') { - negativeLists.push(pl) - } - pl.reEnd = re.length - continue - - case '|': - if (inClass || !patternListStack.length) { - re += '\\|' - continue - } - - clearStateChar() - re += '|' - continue - - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() - - if (inClass) { - re += '\\' + c - continue - } - - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - - case ']': - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += '\\' + c - continue - } - - // handle the case where we left a class open. - // "[z-a]" is valid, equivalent to "\[z-a\]" - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + cs + ']') - } catch (er) { - // not a valid class! - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' - hasMagic = hasMagic || sp[1] - inClass = false - continue - } - - // finish up the class. - hasMagic = true - inClass = false - re += c - continue - - default: - // swallow any state char that wasn't consumed - clearStateChar() - - if (reSpecials[c] && !(c === '^' && inClass)) { - re += '\\' - } - - re += c - break - - } // switch - } // for - - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - cs = pattern.substr(classStart + 1) - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] - hasMagic = hasMagic || sp[1] - } - - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - let tail - tail = re.slice(pl.reStart + pl.open.length) - this.debug('setting tail', re, pl) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, (_, $1, $2) => { - /* istanbul ignore else - should already be done */ - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = '\\' - } - - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + '|' - }) - - this.debug('tail=%j\n %s', tail, tail, pl, re) - const t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type - - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail - } - - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' - } - - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - const addPatternStart = addPatternStartSet[re.charAt(0)] - - // Hack to work around lack of negative lookbehind in JS - // A pattern like: *.!(x).!(y|z) needs to ensure that a name - // like 'a.xyz.yz' doesn't match. So, the first negative - // lookahead, has to look ALL the way ahead, to the end of - // the pattern. - for (let n = negativeLists.length - 1; n > -1; n--) { - const nl = negativeLists[n] - - const nlBefore = re.slice(0, nl.reStart) - const nlFirst = re.slice(nl.reStart, nl.reEnd - 8) - let nlAfter = re.slice(nl.reEnd) - const nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + nlAfter - - // Handle nested stuff like *(*.js|!(*.json)), where open parens - // mean that we should *not* include the ) in the bit that is considered - // "after" the negated section. - const openParensBefore = nlBefore.split('(').length - 1 - let cleanAfter = nlAfter - for (let i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') - } - nlAfter = cleanAfter - - const dollar = nlAfter === '' && isSub !== SUBPARSE ? '$' : '' - re = nlBefore + nlFirst + nlAfter + dollar + nlLast - } - - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) { - re = '(?=.)' + re - } - - if (addPatternStart) { - re = patternStart + re - } - - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] - } - - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } - - const flags = options.nocase ? 'i' : '' - try { - return Object.assign(new RegExp('^' + re + '$', flags), { - _glob: pattern, - _src: re, - }) - } catch (er) /* istanbul ignore next - should be impossible */ { - // If it was an invalid regular expression, then it can't match - // anything. This trick looks for a character after the end of - // the string, which is of course impossible, except in multi-line - // mode, but it's not a /m regex. - return new RegExp('$.') - } - } - - makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - const set = this.set - - if (!set.length) { - this.regexp = false - return this.regexp - } - const options = this.options - - const twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - const flags = options.nocase ? 'i' : '' - - // coalesce globstars and regexpify non-globstar patterns - // if it's the only item, then we just do one twoStar - // if it's the first, and there are more, prepend (\/|twoStar\/)? to next - // if it's the last, append (\/twoStar|) to previous - // if it's in the middle, append (\/|\/twoStar\/) to previous - // then filter out GLOBSTAR symbols - let re = set.map(pattern => { - pattern = pattern.map(p => - typeof p === 'string' ? regExpEscape(p) - : p === GLOBSTAR ? GLOBSTAR - : p._src - ).reduce((set, p) => { - if (!(set[set.length - 1] === GLOBSTAR && p === GLOBSTAR)) { - set.push(p) - } - return set - }, []) - pattern.forEach((p, i) => { - if (p !== GLOBSTAR || pattern[i-1] === GLOBSTAR) { - return - } - if (i === 0) { - if (pattern.length > 1) { - pattern[i+1] = '(?:\\\/|' + twoStar + '\\\/)?' + pattern[i+1] - } else { - pattern[i] = twoStar - } - } else if (i === pattern.length - 1) { - pattern[i-1] += '(?:\\\/|' + twoStar + ')?' - } else { - pattern[i-1] += '(?:\\\/|\\\/' + twoStar + '\\\/)' + pattern[i+1] - pattern[i+1] = GLOBSTAR - } - }) - return pattern.filter(p => p !== GLOBSTAR).join('/') - }).join('|') - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = '^(?:' + re + ')$' - - // can match anything, as long as it's not this. - if (this.negate) re = '^(?!' + re + ').*$' - - try { - this.regexp = new RegExp(re, flags) - } catch (ex) /* istanbul ignore next - should be impossible */ { - this.regexp = false - } - return this.regexp - } - - match (f, partial = this.partial) { - this.debug('match', f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === '' - - if (f === '/' && partial) return true - - const options = this.options - - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } - - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) - - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. - - const set = this.set - this.debug(this.pattern, 'set', set) - - // Find the basename of the path by looking for the last non-empty segment - let filename - for (let i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break - } - - for (let i = 0; i < set.length; i++) { - const pattern = set[i] - let file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] - } - const hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } - } - - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate - } - - static defaults (def) { - return minimatch.defaults(def).Minimatch - } -} - -minimatch.Minimatch = Minimatch diff --git a/node_modules/@npmcli/metavuln-calculator/lib/advisory.js b/node_modules/@npmcli/metavuln-calculator/lib/advisory.js index 5b58ef6370724..d30838e7384f6 100644 --- a/node_modules/@npmcli/metavuln-calculator/lib/advisory.js +++ b/node_modules/@npmcli/metavuln-calculator/lib/advisory.js @@ -39,6 +39,8 @@ class Advisory { this.severity = source.severity || 'high' this.versions = [] this.vulnerableVersions = [] + this.cwe = source.cwe + this.cvss = source.cvss // advisories have the range, metavulns do not // if an advisory doesn't specify range, assume all are vulnerable @@ -326,7 +328,7 @@ class Advisory { list.push(v) } - for (const list of versionSets) { + for (const set of versionSets) { // it's common to have version lists like: // 1.0.0 // 1.0.1-alpha.0 @@ -340,54 +342,54 @@ class Advisory { // 1.0.2 // with a huge number of prerelease versions that are not installable // anyway. - // If mid has a prerelease tag, and list[0] does not, then walk it + // If mid has a prerelease tag, and set[0] does not, then walk it // back until we hit a non-prerelease version - // If mid has a prerelease tag, and list[list.length-1] does not, + // If mid has a prerelease tag, and set[set.length-1] does not, // then walk it forward until we hit a version without a prerelease tag // Similarly, if the head/tail is a prerelease, but there is a non-pr - // version in the list, then start there instead. + // version in the set, then start there instead. let h = 0 - const origHeadVuln = this.testVersion(list[h]) - while (h < list.length && /-/.test(String(list[h]))) { + const origHeadVuln = this.testVersion(set[h]) + while (h < set.length && /-/.test(String(set[h]))) { h++ } // don't filter out the whole list! they might all be pr's - if (h === list.length) { + if (h === set.length) { h = 0 } else if (origHeadVuln) { // if the original was vulnerable, assume so are all of these for (let hh = 0; hh < h; hh++) { - this[_markVulnerable](list[hh]) + this[_markVulnerable](set[hh]) } } - let t = list.length - 1 - const origTailVuln = this.testVersion(list[t]) - while (t > h && /-/.test(String(list[t]))) { + let t = set.length - 1 + const origTailVuln = this.testVersion(set[t]) + while (t > h && /-/.test(String(set[t]))) { t-- } // don't filter out the whole list! might all be pr's if (t === h) { - t = list.length - 1 + t = set.length - 1 } else if (origTailVuln) { // if original tail was vulnerable, assume these are as well - for (let tt = list.length - 1; tt > t; tt--) { - this[_markVulnerable](list[tt]) + for (let tt = set.length - 1; tt > t; tt--) { + this[_markVulnerable](set[tt]) } } const headVuln = h === 0 ? origHeadVuln - : this.testVersion(list[h]) + : this.testVersion(set[h]) - const tailVuln = t === list.length - 1 ? origTailVuln - : this.testVersion(list[t]) + const tailVuln = t === set.length - 1 ? origTailVuln + : this.testVersion(set[t]) // if head and tail both vulnerable, whole list is thrown out if (headVuln && tailVuln) { for (let v = h; v < t; v++) { - this[_markVulnerable](list[v]) + this[_markVulnerable](set[v]) } continue } @@ -397,9 +399,9 @@ class Advisory { continue } - const mid = Math.floor(list.length / 2) - const pre = list.slice(0, mid) - const post = list.slice(mid) + const mid = Math.floor(set.length / 2) + const pre = set.slice(0, mid) + const post = set.slice(mid) // if the parent list wasn't prereleases, then drop pr tags // from end of the pre list, and beginning of the post list, diff --git a/node_modules/@npmcli/metavuln-calculator/package.json b/node_modules/@npmcli/metavuln-calculator/package.json index 6c05ee529cc82..2c04e0fd420bf 100644 --- a/node_modules/@npmcli/metavuln-calculator/package.json +++ b/node_modules/@npmcli/metavuln-calculator/package.json @@ -1,13 +1,16 @@ { "name": "@npmcli/metavuln-calculator", - "version": "3.0.1", + "version": "3.1.0", "main": "lib/index.js", "files": [ - "bin", - "lib" + "bin/", + "lib/" ], "description": "Calculate meta-vulnerabilities from package security advisories", - "repository": "https://github.com/npm/metavuln-calculator", + "repository": { + "type": "git", + "url": "https://github.com/npm/metavuln-calculator.git" + }, "author": "GitHub Inc.", "license": "ISC", "scripts": { @@ -19,19 +22,20 @@ "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", "eslint": "eslint", - "lint": "eslint '**/*.js'", + "lint": "eslint \"**/*.js\"", "lintfix": "npm run lint -- --fix", - "postlint": "npm-template-check", - "template-copy": "npm-template-copy --force" + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force" }, "tap": { "check-coverage": true, "coverage-map": "map.js" }, "devDependencies": { - "@npmcli/template-oss": "^2.9.2", + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.2.0", "require-inject": "^1.4.4", - "tap": "^15.1.6" + "tap": "^16.0.1" }, "dependencies": { "cacache": "^16.0.0", @@ -40,9 +44,10 @@ "semver": "^7.3.5" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" }, "templateOSS": { - "version": "2.9.2" + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.2.0" } } diff --git a/node_modules/@npmcli/move-file/index.js b/node_modules/@npmcli/move-file/lib/index.js similarity index 72% rename from node_modules/@npmcli/move-file/index.js rename to node_modules/@npmcli/move-file/lib/index.js index 95d1888c64cfd..ecc55f0171da5 100644 --- a/node_modules/@npmcli/move-file/index.js +++ b/node_modules/@npmcli/move-file/lib/index.js @@ -6,8 +6,6 @@ const { accessSync, copyFile: copyFile_, copyFileSync, - unlink: unlink_, - unlinkSync, readdir: readdir_, readdirSync, rename: rename_, @@ -19,12 +17,11 @@ const { symlink: symlink_, symlinkSync, readlink: readlink_, - readlinkSync + readlinkSync, } = require('fs') const access = promisify(access_) const copyFile = promisify(copyFile_) -const unlink = promisify(unlink_) const readdir = promisify(readdir_) const rename = promisify(rename_) const stat = promisify(stat_) @@ -61,7 +58,7 @@ const moveFile = async (source, destination, options = {}, root = true, symlinks options = { overwrite: true, - ...options + ...options, } if (!options.overwrite && await pathExists(destination)) { @@ -77,7 +74,9 @@ const moveFile = async (source, destination, options = {}, root = true, symlinks const sourceStat = await lstat(source) if (sourceStat.isDirectory()) { const files = await readdir(source) - await Promise.all(files.map((file) => moveFile(join(source, file), join(destination, file), options, false, symlinks))) + await Promise.all(files.map((file) => + moveFile(join(source, file), join(destination, file), options, false, symlinks) + )) } else if (sourceStat.isSymbolicLink()) { symlinks.push({ source, destination }) } else { @@ -89,17 +88,24 @@ const moveFile = async (source, destination, options = {}, root = true, symlinks } if (root) { - await Promise.all(symlinks.map(async ({ source, destination }) => { - let target = await readlink(source) - // junction symlinks in windows will be absolute paths, so we need to make sure they point to the destination - if (isAbsolute(target)) - target = resolve(destination, relative(source, target)) - // try to determine what the actual file is so we can create the correct type of symlink in windows + await Promise.all(symlinks.map(async ({ source: symSource, destination: symDestination }) => { + let target = await readlink(symSource) + // junction symlinks in windows will be absolute paths, so we need to + // make sure they point to the symlink destination + if (isAbsolute(target)) { + target = resolve(symDestination, relative(symSource, target)) + } + // try to determine what the actual file is so we can create the correct + // type of symlink in windows let targetStat try { - targetStat = await stat(resolve(dirname(source), target)) + targetStat = await stat(resolve(dirname(symSource), target)) } catch (err) {} - await symlink(target, destination, targetStat && targetStat.isDirectory() ? 'junction' : 'file') + await symlink( + target, + symDestination, + targetStat && targetStat.isDirectory() ? 'junction' : 'file' + ) })) await rimraf(source) } @@ -112,7 +118,7 @@ const moveFileSync = (source, destination, options = {}, root = true, symlinks = options = { overwrite: true, - ...options + ...options, } if (!options.overwrite && pathExistsSync(destination)) { @@ -142,17 +148,24 @@ const moveFileSync = (source, destination, options = {}, root = true, symlinks = } if (root) { - for (const { source, destination } of symlinks) { - let target = readlinkSync(source) - // junction symlinks in windows will be absolute paths, so we need to make sure they point to the destination - if (isAbsolute(target)) - target = resolve(destination, relative(source, target)) - // try to determine what the actual file is so we can create the correct type of symlink in windows + for (const { source: symSource, destination: symDestination } of symlinks) { + let target = readlinkSync(symSource) + // junction symlinks in windows will be absolute paths, so we need to + // make sure they point to the symlink destination + if (isAbsolute(target)) { + target = resolve(symDestination, relative(symSource, target)) + } + // try to determine what the actual file is so we can create the correct + // type of symlink in windows let targetStat try { - targetStat = statSync(resolve(dirname(source), target)) + targetStat = statSync(resolve(dirname(symSource), target)) } catch (err) {} - symlinkSync(target, destination, targetStat && targetStat.isDirectory() ? 'junction' : 'file') + symlinkSync( + target, + symDestination, + targetStat && targetStat.isDirectory() ? 'junction' : 'file' + ) } rimrafSync(source) } diff --git a/node_modules/@npmcli/move-file/package.json b/node_modules/@npmcli/move-file/package.json index 0c066dbcfbfe6..1b1d377b0c7b2 100644 --- a/node_modules/@npmcli/move-file/package.json +++ b/node_modules/@npmcli/move-file/package.json @@ -1,34 +1,47 @@ { "name": "@npmcli/move-file", - "version": "1.1.2", + "version": "2.0.0", "files": [ - "index.js" + "bin/", + "lib/" ], + "main": "lib/index.js", "description": "move a file (fork of move-file)", "dependencies": { "mkdirp": "^1.0.4", "rimraf": "^3.0.2" }, "devDependencies": { - "require-inject": "^1.4.4", - "tap": "^14.10.7" + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.2.2", + "tap": "^16.0.1" }, "scripts": { "test": "tap", "snap": "tap", "preversion": "npm test", "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags" + "prepublishOnly": "git push origin --follow-tags", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "posttest": "npm run lint" }, "repository": { "type": "git", - "url": "git+https://github.com/npm/move-file" + "url": "https://github.com/npm/move-file.git" }, "tap": { "check-coverage": true }, "license": "MIT", "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + }, + "author": "GitHub Inc.", + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.2.2" } } diff --git a/node_modules/@npmcli/node-gyp/lib/index.js b/node_modules/@npmcli/node-gyp/lib/index.js index d4ebf14ed9af8..cdf18560e0ca2 100644 --- a/node_modules/@npmcli/node-gyp/lib/index.js +++ b/node_modules/@npmcli/node-gyp/lib/index.js @@ -1,8 +1,8 @@ const util = require('util') const fs = require('fs') -const {stat} = fs.promises || { stat: util.promisify(fs.stat) }; +const { stat } = fs.promises || { stat: util.promisify(fs.stat) } -async function isNodeGypPackage(path) { +async function isNodeGypPackage (path) { return await stat(`${path}/binding.gyp`) .then(st => st.isFile()) .catch(() => false) @@ -10,5 +10,5 @@ async function isNodeGypPackage(path) { module.exports = { isNodeGypPackage, - defaultGypInstallScript: 'node-gyp rebuild' + defaultGypInstallScript: 'node-gyp rebuild', } diff --git a/node_modules/@npmcli/node-gyp/package.json b/node_modules/@npmcli/node-gyp/package.json index 299a453b66cd3..04eeec8ff808c 100644 --- a/node_modules/@npmcli/node-gyp/package.json +++ b/node_modules/@npmcli/node-gyp/package.json @@ -1,12 +1,18 @@ { "name": "@npmcli/node-gyp", - "version": "1.0.3", + "version": "2.0.0", "description": "Tools for dealing with node-gyp packages", "scripts": { "test": "tap", "preversion": "npm test", "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags" + "prepublishOnly": "git push origin --follow-tags", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "snap": "tap", + "posttest": "npm run lint" }, "repository": { "type": "git", @@ -18,18 +24,22 @@ "node-gyp" ], "files": [ - "lib/**/*.js" + "bin/", + "lib/" ], "main": "lib/index.js", - "author": "Brian Jenkins ", + "author": "GitHub Inc.", "license": "ISC", - "tap": { - "check-coverage": true, - "coverage-map": "map.js" - }, "devDependencies": { - "require-inject": "^1.4.4", - "tap": "^14.10.6", - "tmp": "^0.2.1" + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.2.2", + "tap": "^16.0.1" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.2.2" } } diff --git a/node_modules/@npmcli/package-json/lib/index.js b/node_modules/@npmcli/package-json/lib/index.js index 87c3a63093688..e98308f3d3b84 100644 --- a/node_modules/@npmcli/package-json/lib/index.js +++ b/node_modules/@npmcli/package-json/lib/index.js @@ -73,13 +73,15 @@ class PackageJson { ) } - for (const step of knownSteps) + for (const step of knownSteps) { this[_manifest] = step({ content, originalContent: this[_manifest] }) + } // unknown properties will just be overwitten for (const [key, value] of Object.entries(content)) { - if (!knownKeys.has(key)) + if (!knownKeys.has(key)) { this[_manifest][key] = value + } } return this @@ -98,8 +100,9 @@ class PackageJson { }\n` .replace(/\n/g, eol) - if (fileContent.trim() !== this[_readFileContent].trim()) + if (fileContent.trim() !== this[_readFileContent].trim()) { return await writeFile(this[_filename], fileContent) + } } } diff --git a/node_modules/@npmcli/package-json/lib/update-dependencies.js b/node_modules/@npmcli/package-json/lib/update-dependencies.js index dac45a8bed7bf..7259949ab661d 100644 --- a/node_modules/@npmcli/package-json/lib/update-dependencies.js +++ b/node_modules/@npmcli/package-json/lib/update-dependencies.js @@ -28,8 +28,9 @@ const updateDependencies = ({ content, originalContent }) => { // optionalDependencies don't need to be repeated in two places if (pkg.dependencies) { if (pkg.optionalDependencies) { - for (const name of Object.keys(pkg.optionalDependencies)) + for (const name of Object.keys(pkg.optionalDependencies)) { delete pkg.dependencies[name] + } } } @@ -37,16 +38,18 @@ const updateDependencies = ({ content, originalContent }) => { // loop through all types of dependencies and update package json pkg for (const type of depTypes) { - if (pkg[type]) + if (pkg[type]) { result[type] = pkg[type] + } // prune empty type props from resulting object const emptyDepType = pkg[type] && typeof pkg === 'object' && Object.keys(pkg[type]).length === 0 - if (emptyDepType) + if (emptyDepType) { delete result[type] + } } // if original package.json had dep in peerDeps AND deps, preserve that. diff --git a/node_modules/@npmcli/package-json/lib/update-scripts.js b/node_modules/@npmcli/package-json/lib/update-scripts.js index 3a88d3e9a17a8..30495e54cc3c7 100644 --- a/node_modules/@npmcli/package-json/lib/update-scripts.js +++ b/node_modules/@npmcli/package-json/lib/update-scripts.js @@ -1,8 +1,9 @@ const updateScripts = ({ content, originalContent = {} }) => { const newScripts = content.scripts - if (!newScripts) + if (!newScripts) { return originalContent + } // validate scripts content being appended const hasInvalidScripts = () => diff --git a/node_modules/@npmcli/package-json/lib/update-workspaces.js b/node_modules/@npmcli/package-json/lib/update-workspaces.js index 207dd94a236d7..04bf63230636f 100644 --- a/node_modules/@npmcli/package-json/lib/update-workspaces.js +++ b/node_modules/@npmcli/package-json/lib/update-workspaces.js @@ -1,8 +1,9 @@ const updateWorkspaces = ({ content, originalContent = {} }) => { const newWorkspaces = content.workspaces - if (!newWorkspaces) + if (!newWorkspaces) { return originalContent + } // validate workspaces content being appended const hasInvalidWorkspaces = () => diff --git a/node_modules/@npmcli/package-json/package.json b/node_modules/@npmcli/package-json/package.json index 8708ec5eb6fb1..d2c4b9da9db62 100644 --- a/node_modules/@npmcli/package-json/package.json +++ b/node_modules/@npmcli/package-json/package.json @@ -1,10 +1,11 @@ { "name": "@npmcli/package-json", - "version": "1.0.1", + "version": "2.0.0", "description": "Programmatic API to update package.json", "main": "lib/index.js", "files": [ - "lib" + "bin/", + "lib/" ], "scripts": { "preversion": "npm test", @@ -12,11 +13,12 @@ "prepublishOnly": "git push origin --follow-tags", "snap": "tap", "test": "tap", - "npmclilint": "npmcli-lint", - "lint": "npm run npmclilint -- \"lib/*.*js\" \"test/*.*js\"", + "lint": "eslint \"**/*.js\"", "lintfix": "npm run lint -- --fix", - "posttest": "npm run lint --", - "postsnap": "npm run lintfix --" + "posttest": "npm run lint", + "postsnap": "npm run lintfix --", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force" }, "keywords": [ "npm", @@ -25,10 +27,22 @@ "author": "GitHub Inc.", "license": "ISC", "devDependencies": { - "@npmcli/lint": "^1.0.1", - "tap": "^15.0.9" + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.2.2", + "tap": "^16.0.1" }, "dependencies": { "json-parse-even-better-errors": "^2.3.1" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/package-json.git" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.2.2" } } diff --git a/node_modules/@npmcli/promise-spawn/index.js b/node_modules/@npmcli/promise-spawn/lib/index.js similarity index 87% rename from node_modules/@npmcli/promise-spawn/index.js rename to node_modules/@npmcli/promise-spawn/lib/index.js index 6ad51b8e08ccf..84ddc83d10bab 100644 --- a/node_modules/@npmcli/promise-spawn/index.js +++ b/node_modules/@npmcli/promise-spawn/lib/index.js @@ -1,5 +1,4 @@ -const {spawn} = require('child_process') - +const { spawn } = require('child_process') const inferOwner = require('infer-owner') const isPipe = (stdio = 'pipe', fd) => @@ -8,7 +7,7 @@ const isPipe = (stdio = 'pipe', fd) => : false // 'extra' object is for decorating the error a bit more -const promiseSpawn = (cmd, args, opts, extra = {}) => { +const promiseSpawn = (cmd, args, opts = {}, extra = {}) => { const cwd = opts.cwd || process.cwd() const isRoot = process.getuid && process.getuid() === 0 const { uid, gid } = isRoot ? inferOwner.sync(cwd) : {} @@ -16,11 +15,11 @@ const promiseSpawn = (cmd, args, opts, extra = {}) => { ...opts, cwd, uid, - gid + gid, }, extra) } -const stdioResult = (stdout, stderr, {stdioString, stdio}) => +const stdioResult = (stdout, stderr, { stdioString, stdio }) => stdioString ? { stdout: isPipe(stdio, 1) ? Buffer.concat(stdout).toString() : null, stderr: isPipe(stdio, 2) ? Buffer.concat(stderr).toString() : null, @@ -58,12 +57,13 @@ const promiseSpawnUid = (cmd, args, opts, extra) => { code, signal, ...stdioResult(stdout, stderr, opts), - ...extra + ...extra, } - if (code || signal) + if (code || signal) { rej(Object.assign(new Error('command failed'), result)) - else + } else { res(result) + } }) }) diff --git a/node_modules/@npmcli/promise-spawn/package.json b/node_modules/@npmcli/promise-spawn/package.json index be7342f56a0d8..4521b56d50560 100644 --- a/node_modules/@npmcli/promise-spawn/package.json +++ b/node_modules/@npmcli/promise-spawn/package.json @@ -1,30 +1,46 @@ { "name": "@npmcli/promise-spawn", - "version": "1.3.2", + "version": "3.0.0", "files": [ - "index.js" + "bin/", + "lib/" ], + "main": "./lib/index.js", "description": "spawn processes the way the npm cli likes to do", "repository": { "type": "git", - "url": "git+https://github.com/npm/promise-spawn" + "url": "https://github.com/npm/promise-spawn.git" }, - "author": "Isaac Z. Schlueter (https://izs.me)", + "author": "GitHub Inc.", "license": "ISC", "scripts": { "test": "tap", "snap": "tap", "preversion": "npm test", "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags" + "prepublishOnly": "git push origin --follow-tags", + "lint": "eslint \"**/*.js\"", + "lintfix": "npm run lint -- --fix", + "posttest": "npm run lint", + "postsnap": "npm run lintfix --", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force" }, "tap": { "check-coverage": true }, "devDependencies": { + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.2.2", "minipass": "^3.1.1", - "require-inject": "^1.4.4", - "tap": "^14.10.6" + "tap": "^16.0.1" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.2.2" }, "dependencies": { "infer-owner": "^1.0.4" diff --git a/node_modules/@npmcli/run-script/lib/run-script.js b/node_modules/@npmcli/run-script/lib/run-script.js index 6bb4a2e666a20..e9d18261a2c1f 100644 --- a/node_modules/@npmcli/run-script/lib/run-script.js +++ b/node_modules/@npmcli/run-script/lib/run-script.js @@ -7,7 +7,8 @@ const runScript = options => { validateOptions(options) const { pkg, path } = options return pkg ? runScriptPkg(options) - : rpj(path + '/package.json').then(pkg => runScriptPkg({ ...options, pkg })) + : rpj(path + '/package.json') + .then(readPackage => runScriptPkg({ ...options, pkg: readPackage })) } module.exports = Object.assign(runScript, { isServerPackage }) diff --git a/node_modules/@npmcli/run-script/lib/set-path.js b/node_modules/@npmcli/run-script/lib/set-path.js index d5f8707efc84f..07671f44579dc 100644 --- a/node_modules/@npmcli/run-script/lib/set-path.js +++ b/node_modules/@npmcli/run-script/lib/set-path.js @@ -12,7 +12,7 @@ const setPATH = (projectPath, env) => { const delimiter = isWindows ? ';' : ':' const PATH = Object.keys(env).filter(p => /^path$/i.test(p) && env[p]) .map(p => env[p].split(delimiter)) - .reduce((set, p) => set.concat(p.filter(p => !set.includes(p))), []) + .reduce((set, p) => set.concat(p.filter(concatted => !set.includes(concatted))), []) .join(delimiter) const pathArr = [] diff --git a/node_modules/@npmcli/run-script/package.json b/node_modules/@npmcli/run-script/package.json index 3f29f97113e53..733b27e44a1b8 100644 --- a/node_modules/@npmcli/run-script/package.json +++ b/node_modules/@npmcli/run-script/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/run-script", - "version": "3.0.1", + "version": "3.0.2", "description": "Run a lifecycle script for a package (descendant of npm-lifecycle)", "author": "GitHub Inc.", "license": "ISC", @@ -10,42 +10,44 @@ "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", "eslint": "eslint", - "lint": "eslint '**/*.js'", + "lint": "eslint \"**/*.js\"", "lintfix": "npm run lint -- --fix", - "postlint": "npm-template-check", - "template-copy": "npm-template-copy --force", + "postlint": "template-oss-check", "snap": "tap", - "posttest": "npm run lint" + "posttest": "npm run lint", + "template-oss-apply": "template-oss-apply --force" }, "tap": { "check-coverage": true, "coverage-map": "map.js" }, "devDependencies": { - "@npmcli/template-oss": "^2.9.1", + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.2.2", "minipass": "^3.1.6", "require-inject": "^1.4.4", - "tap": "^15.1.6" + "tap": "^16.0.1" }, "dependencies": { - "@npmcli/node-gyp": "^1.0.3", - "@npmcli/promise-spawn": "^1.3.2", + "@npmcli/node-gyp": "^2.0.0", + "@npmcli/promise-spawn": "^3.0.0", "node-gyp": "^9.0.0", "read-package-json-fast": "^2.0.3" }, "files": [ - "bin", - "lib" + "bin/", + "lib/" ], "main": "lib/run-script.js", "repository": { "type": "git", - "url": "git+https://github.com/npm/run-script.git" + "url": "https://github.com/npm/run-script.git" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" }, "templateOSS": { - "version": "2.9.1" + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.2.2" } } diff --git a/node_modules/bin-links/lib/check-bin.js b/node_modules/bin-links/lib/check-bin.js index 8bbe45188a479..750a34fbbff3a 100644 --- a/node_modules/bin-links/lib/check-bin.js +++ b/node_modules/bin-links/lib/check-bin.js @@ -57,18 +57,18 @@ const checkShim = async ({ target, path }) => { target + '.cmd', target + '.ps1', ] - await Promise.all(shims.map(async target => { - const current = await readCmdShim(target) - .catch(er => handleReadCmdShimError({ er, target })) + await Promise.all(shims.map(async shim => { + const current = await readCmdShim(shim) + .catch(er => handleReadCmdShimError({ er, target: shim })) if (!current) { return } - const resolved = resolve(dirname(target), current.replace(/\\/g, '/')) + const resolved = resolve(dirname(shim), current.replace(/\\/g, '/')) if (resolved.toLowerCase().indexOf(path.toLowerCase()) !== 0) { - return failEEXIST({ target }) + return failEEXIST({ target: shim }) } })) } diff --git a/node_modules/bin-links/lib/get-paths.js b/node_modules/bin-links/lib/get-paths.js index 631aef9f9117f..b93e6982dce22 100644 --- a/node_modules/bin-links/lib/get-paths.js +++ b/node_modules/bin-links/lib/get-paths.js @@ -3,7 +3,7 @@ // are present, then we can assume that they're associated. const binTarget = require('./bin-target.js') const manTarget = require('./man-target.js') -const { resolve, basename } = require('path') +const { resolve, basename, extname } = require('path') const isWindows = require('./is-windows.js') module.exports = ({ path, pkg, global, top }) => { if (top && !global) { @@ -27,23 +27,14 @@ module.exports = ({ path, pkg, global, top }) => { const manSet = [] if (manTarg && pkg.man && Array.isArray(pkg.man) && pkg.man.length) { for (const man of pkg.man) { - const parseMan = man.match(/(.*\.([0-9]+)(\.gz)?)$/) - // invalid entries invalidate the entire man set - if (!parseMan) { + if (!/.\.[0-9]+(\.gz)?$/.test(man)) { return binSet } - const stem = parseMan[1] - const sxn = parseMan[2] - const base = basename(stem) - const absFrom = resolve(path, man) + const section = extname(basename(man, '.gz')).slice(1) + const base = basename(man) - /* istanbul ignore if - should be impossible */ - if (absFrom.indexOf(path) !== 0) { - return binSet - } - - manSet.push(resolve(manTarg, 'man' + sxn, base)) + manSet.push(resolve(manTarg, 'man' + section, base)) } } diff --git a/node_modules/bin-links/lib/link-mans.js b/node_modules/bin-links/lib/link-mans.js index 54b17d1fc16d4..656e179b6ca54 100644 --- a/node_modules/bin-links/lib/link-mans.js +++ b/node_modules/bin-links/lib/link-mans.js @@ -11,7 +11,7 @@ const linkMans = ({ path, pkg, top, force }) => { // break any links to c:\\blah or /foo/blah or ../blah // and filter out duplicates const set = [...new Set(pkg.man.map(man => - man ? join('/', man).replace(/\\|:/g, '/').substr(1) : null) + man ? join('/', man).replace(/\\|:/g, '/').slice(1) : null) .filter(man => typeof man === 'string'))] return Promise.all(set.map(man => { diff --git a/node_modules/bin-links/package.json b/node_modules/bin-links/package.json index 0325ab4437656..a86948de153c5 100644 --- a/node_modules/bin-links/package.json +++ b/node_modules/bin-links/package.json @@ -1,6 +1,6 @@ { "name": "bin-links", - "version": "3.0.0", + "version": "3.0.1", "description": "JavaScript package binary linker", "main": "./lib/index.js", "scripts": { @@ -9,14 +9,15 @@ "prepublishOnly": "git push origin --follow-tags", "snap": "tap", "test": "tap", - "lint": "eslint '**/*.js'", - "postlint": "npm-template-check", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", "lintfix": "npm run lint -- --fix", - "posttest": "npm run lint" + "posttest": "npm run lint", + "template-oss-apply": "template-oss-apply --force" }, "repository": { "type": "git", - "url": "git://github.com/npm/bin-links.git" + "url": "https://github.com/npm/bin-links.git" }, "keywords": [ "npm", @@ -25,15 +26,16 @@ ], "license": "ISC", "dependencies": { - "cmd-shim": "^4.0.1", + "cmd-shim": "^5.0.0", "mkdirp-infer-owner": "^2.0.0", "npm-normalize-package-bin": "^1.0.0", - "read-cmd-shim": "^2.0.0", + "read-cmd-shim": "^3.0.0", "rimraf": "^3.0.0", "write-file-atomic": "^4.0.0" }, "devDependencies": { - "@npmcli/template-oss": "^2.5.0", + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.2.2", "mkdirp": "^1.0.3", "require-inject": "^1.4.4", "tap": "^15.0.10" @@ -43,15 +45,16 @@ "coverage-map": "map.js" }, "files": [ - "bin", - "lib" + "bin/", + "lib/" ], "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" }, "author": "GitHub Inc.", "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", "windowsCI": false, - "version": "2.5.0" + "version": "3.2.2" } } diff --git a/node_modules/brace-expansion/index.js b/node_modules/brace-expansion/index.js index 0478be81eabc2..4af9ddee463f4 100644 --- a/node_modules/brace-expansion/index.js +++ b/node_modules/brace-expansion/index.js @@ -1,4 +1,3 @@ -var concatMap = require('concat-map'); var balanced = require('balanced-match'); module.exports = expandTop; @@ -79,10 +78,6 @@ function expandTop(str) { return expand(escapeBraces(str), true).map(unescapeBraces); } -function identity(e) { - return e; -} - function embrace(str) { return '{' + str + '}'; } @@ -101,42 +96,7 @@ function expand(str, isTop) { var expansions = []; var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; - - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m.body.indexOf(',') >= 0; - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post, false) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. + if (!m) return [str]; // no need to expand pre, since it is guaranteed to be free of brace-sets var pre = m.pre; @@ -144,55 +104,97 @@ function expand(str, isTop) { ? expand(m.post, false) : ['']; - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; + if (/\$$/.test(m.pre)) { + for (var k = 0; k < post.length; k++) { + var expansion = pre+ '{' + m.body + '}' + post[k]; + expansions.push(expansion); + } + } else { + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } } } + N.push(c); + } + } else { + N = []; + + for (var j = 0; j < n.length; j++) { + N.push.apply(N, expand(n[j], false)); } - N.push(c); } - } else { - N = concatMap(n, function(el) { return expand(el, false) }); - } - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } } } diff --git a/node_modules/brace-expansion/package.json b/node_modules/brace-expansion/package.json index a18faa8fd67b8..7097d41e39de5 100644 --- a/node_modules/brace-expansion/package.json +++ b/node_modules/brace-expansion/package.json @@ -1,7 +1,7 @@ { "name": "brace-expansion", "description": "Brace expansion as known from sh/bash", - "version": "1.1.11", + "version": "2.0.1", "repository": { "type": "git", "url": "git://github.com/juliangruber/brace-expansion.git" @@ -14,11 +14,10 @@ "bench": "matcha test/perf/bench.js" }, "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" }, "devDependencies": { - "matcha": "^0.7.0", + "@c4312/matcha": "^1.3.1", "tape": "^4.6.0" }, "keywords": [], diff --git a/node_modules/cacache/package.json b/node_modules/cacache/package.json index edae9a4f995b4..3467f8af804ed 100644 --- a/node_modules/cacache/package.json +++ b/node_modules/cacache/package.json @@ -1,6 +1,6 @@ { "name": "cacache", - "version": "16.0.3", + "version": "16.0.4", "cache-version": { "content": "2", "index": "5" @@ -50,7 +50,7 @@ "license": "ISC", "dependencies": { "@npmcli/fs": "^2.1.0", - "@npmcli/move-file": "^1.1.2", + "@npmcli/move-file": "^2.0.0", "chownr": "^2.0.0", "fs-minipass": "^2.1.0", "glob": "^7.2.0", @@ -64,13 +64,13 @@ "p-map": "^4.0.0", "promise-inflight": "^1.0.1", "rimraf": "^3.0.2", - "ssri": "^8.0.1", + "ssri": "^9.0.0", "tar": "^6.1.11", "unique-filename": "^1.1.1" }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.1.2", + "@npmcli/template-oss": "3.2.2", "benchmark": "^2.1.4", "chalk": "^4.1.2", "require-inject": "^1.4.4", @@ -87,7 +87,7 @@ "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", "windowsCI": false, - "version": "3.1.2" + "version": "3.2.2" }, "author": "GitHub Inc." } diff --git a/node_modules/cmd-shim/index.js b/node_modules/cmd-shim/lib/index.js similarity index 93% rename from node_modules/cmd-shim/index.js rename to node_modules/cmd-shim/lib/index.js index 4a7614b2f9073..10494e58ad548 100644 --- a/node_modules/cmd-shim/index.js +++ b/node_modules/cmd-shim/lib/index.js @@ -8,7 +8,7 @@ // Write a binroot/pkg.bin + ".cmd" file that has this line in it: // @ %dp0% %* -const {promisify} = require('util') +const { promisify } = require('util') const fs = require('fs') const writeFile = promisify(fs.writeFile) const readFile = promisify(fs.readFile) @@ -16,10 +16,10 @@ const chmod = promisify(fs.chmod) const stat = promisify(fs.stat) const unlink = promisify(fs.unlink) -const {dirname, relative} = require('path') +const { dirname, relative } = require('path') const mkdir = require('mkdirp-infer-owner') -const toBatchSyntax = require('./lib/to-batch-syntax') -const shebangExpr = /^#\!\s*(?:\/usr\/bin\/env)?\s*([^ \t]+=[^ \t]+\s+)*\s*([^ \t]+)(.*)$/ +const toBatchSyntax = require('./to-batch-syntax') +const shebangExpr = /^#!\s*(?:\/usr\/bin\/env\s*((?:[^ \t=]+=[^ \t=]+\s+)*))?([^ \t]+)(.*)$/ const cmdShimIfExists = (from, to) => stat(from).then(() => cmdShim(from, to), () => {}) @@ -47,14 +47,15 @@ const writeShim = (from, to) => .then(data => { const firstLine = data.trim().split(/\r*\n/)[0] const shebang = firstLine.match(shebangExpr) - if (!shebang) return writeShim_(from, to) + if (!shebang) { + return writeShim_(from, to) + } const vars = shebang[1] || '' const prog = shebang[2] const args = shebang[3] || '' return writeShim_(from, to, prog, args, vars) }, er => writeShim_(from, to)) - const writeShim_ = (from, to, prog, args, variables) => { let shTarget = relative(dirname(to), from) let target = shTarget.split('/').join('\\') @@ -94,8 +95,8 @@ const writeShim_ = (from, to, prog, args, variables) => { let cmd if (longProg) { - shLongProg = shLongProg.trim(); - args = args.trim(); + shLongProg = shLongProg.trim() + args = args.trim() const variablesBatch = toBatchSyntax.convertToSetCommands(variables) cmd = head + variablesBatch @@ -110,7 +111,7 @@ const writeShim_ = (from, to, prog, args, variables) => { // prevent "Terminate Batch Job? (Y/n)" message // https://github.com/npm/cli/issues/969#issuecomment-737496588 + 'endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & ' - + `"%_prog%" ${args} ${target} %*\r\n` + + `"%_prog%" ${args} ${target} %*\r\n` } else { cmd = `${head}${prog} ${args} ${target} %*\r\n` } @@ -128,7 +129,7 @@ const writeShim_ = (from, to, prog, args, variables) => { // exec node "$basedir/node_modules/npm/bin/npm-cli.js" "$@" // fi - let sh = "#!/bin/sh\n" + let sh = '#!/bin/sh\n' sh = sh + `basedir=$(dirname "$(echo "$0" | sed -e 's,\\\\,/,g')")\n` @@ -182,7 +183,7 @@ const writeShim_ = (from, to, prog, args, variables) => { + '$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent\n' + '\n' + '$exe=""\n' - + 'if ($PSVersionTable.PSVersion -lt \"6.0\" -or $IsWindows) {\n' + + 'if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {\n' + ' # Fix case when both the Windows and Linux builds of Node\n' + ' # are installed in the same directory\n' + ' $exe=".exe"\n' diff --git a/node_modules/cmd-shim/lib/to-batch-syntax.js b/node_modules/cmd-shim/lib/to-batch-syntax.js index f3f5ffa63cbb5..86a3f01405de5 100644 --- a/node_modules/cmd-shim/lib/to-batch-syntax.js +++ b/node_modules/cmd-shim/lib/to-batch-syntax.js @@ -2,50 +2,48 @@ exports.replaceDollarWithPercentPair = replaceDollarWithPercentPair exports.convertToSetCommand = convertToSetCommand exports.convertToSetCommands = convertToSetCommands -function convertToSetCommand(key, value) { - var line = "" - key = key || "" - key = key.trim() - value = value || "" - value = value.trim() - if(key && value && value.length > 0) { - line = "@SET " + key + "=" + replaceDollarWithPercentPair(value) + "\r\n" - } - return line +function convertToSetCommand (key, value) { + var line = '' + key = key || '' + key = key.trim() + value = value || '' + value = value.trim() + if (key && value && value.length > 0) { + line = '@SET ' + key + '=' + replaceDollarWithPercentPair(value) + '\r\n' + } + return line } -function extractVariableValuePairs(declarations) { - var pairs = {} - declarations.map(function(declaration) { - var split = declaration.split("=") - pairs[split[0]]=split[1] - }) - return pairs +function extractVariableValuePairs (declarations) { + var pairs = {} + declarations.map(function (declaration) { + var split = declaration.split('=') + pairs[split[0]] = split[1] + }) + return pairs } -function convertToSetCommands(variableString) { - var variableValuePairs = extractVariableValuePairs(variableString.split(" ")) - var variableDeclarationsAsBatch = "" - Object.keys(variableValuePairs).forEach(function (key) { - variableDeclarationsAsBatch += convertToSetCommand(key, variableValuePairs[key]) - }) - return variableDeclarationsAsBatch +function convertToSetCommands (variableString) { + var variableValuePairs = extractVariableValuePairs(variableString.split(' ')) + var variableDeclarationsAsBatch = '' + Object.keys(variableValuePairs).forEach(function (key) { + variableDeclarationsAsBatch += convertToSetCommand(key, variableValuePairs[key]) + }) + return variableDeclarationsAsBatch } -function replaceDollarWithPercentPair(value) { - var dollarExpressions = /\$\{?([^\$@#\?\- \t{}:]+)\}?/g - var result = "" - var startIndex = 0 - do { - var match = dollarExpressions.exec(value) - if(match) { - var betweenMatches = value.substring(startIndex, match.index) || "" - result += betweenMatches + "%" + match[1] + "%" - startIndex = dollarExpressions.lastIndex - } - } while (dollarExpressions.lastIndex > 0) - result += value.substr(startIndex) - return result +function replaceDollarWithPercentPair (value) { + var dollarExpressions = /\$\{?([^$@#?\- \t{}:]+)\}?/g + var result = '' + var startIndex = 0 + do { + var match = dollarExpressions.exec(value) + if (match) { + var betweenMatches = value.substring(startIndex, match.index) || '' + result += betweenMatches + '%' + match[1] + '%' + startIndex = dollarExpressions.lastIndex + } + } while (dollarExpressions.lastIndex > 0) + result += value.slice(startIndex) + return result } - - diff --git a/node_modules/cmd-shim/package.json b/node_modules/cmd-shim/package.json index 11e17c8fbbdaa..1bcbdc4342ced 100644 --- a/node_modules/cmd-shim/package.json +++ b/node_modules/cmd-shim/package.json @@ -1,13 +1,19 @@ { "name": "cmd-shim", - "version": "4.1.0", + "version": "5.0.0", "description": "Used in npm for command line application support", "scripts": { "test": "tap", "snap": "tap", "preversion": "npm test", "postversion": "npm publish", - "postpublish": "git push origin --follow-tags" + "postpublish": "git push origin --follow-tags", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "prepublishOnly": "git push origin --follow-tags", + "posttest": "npm run lint" }, "repository": { "type": "git", @@ -18,19 +24,27 @@ "mkdirp-infer-owner": "^2.0.0" }, "devDependencies": { - "rimraf": "~2.2.8", - "tap": "^14.10.6" + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.2.2", + "rimraf": "^3.0.2", + "tap": "^16.0.1" }, "files": [ - "index.js", - "lib" + "bin/", + "lib/" ], + "main": "lib/index.js", "tap": { "before": "test/00-setup.js", "after": "test/zz-cleanup.js", "check-coverage": true }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + }, + "author": "GitHub Inc.", + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.2.2" } } diff --git a/node_modules/dezalgo/package.json b/node_modules/dezalgo/package.json index 634dd0d92fb40..f8ba8ec2b6b7a 100644 --- a/node_modules/dezalgo/package.json +++ b/node_modules/dezalgo/package.json @@ -1,8 +1,11 @@ { "name": "dezalgo", - "version": "1.0.3", + "version": "1.0.4", "description": "Contain async insanity so that the dark pony lord doesn't eat souls", "main": "dezalgo.js", + "files": [ + "dezalgo.js" + ], "directories": { "test": "test" }, @@ -11,7 +14,7 @@ "wrappy": "1" }, "devDependencies": { - "tap": "^1.2.0" + "tap": "^12.4.0" }, "scripts": { "test": "tap test/*.js" @@ -26,12 +29,13 @@ "the dark pony", "he comes", "asynchrony of all holy and good", - "T̯̪ͅo̯͖̹ ̻̮̖̲͢i̥̖n̢͈͇̝͍v͏͉ok̭̬̝ͅe̞͍̩̫͍̩͝ ̩̮̖̟͇͉́t͔͔͎̗h͏̗̟e̘͉̰̦̠̞͓ ͕h͉̟͎̪̠̱͠ḭ̮̩v̺͉͇̩e̵͖-̺̪m͍i̜n̪̲̲̲̮d̷ ̢r̠̼̯̹̦̦͘ͅe͓̳͓̙p̺̗̫͙͘ͅr͔̰͜e̴͓̞s͉̩̩͟ͅe͏̣n͚͇̗̭̺͍tì͙̣n͏̖̥̗͎̰̪g̞͓̭̱̯̫̕ ̣̱͜ͅc̦̰̰̠̮͎͙̀hao̺̜̻͍͙ͅs͉͓̘.͎̼̺̼͕̹͘", - "̠̞̱̰I͖͇̝̻n̦̰͍̰̟v̤̺̫̳̭̼̗͘ò̹̟̩̩͚k̢̥̠͍͉̦̬i̖͓͔̮̱̻͘n̶̳͙̫͎g̖̯̣̲̪͉ ̞͎̗͕͚ͅt̲͕̘̺̯̗̦h̘̦̲̜̻e̳͎͉̬͙ ̴̞̪̲̥f̜̯͓͓̭̭͢e̱̘͔̮e̜̤l̺̱͖̯͓͙͈͢i̵̦̬͉͔̫͚͕n͉g̨͖̙̙̹̹̟̤ ͉̪o̞̠͍̪̰͙ͅf̬̲̺ ͔͕̲͕͕̲̕c̙͉h̝͔̩̙̕ͅa̲͖̻̗̹o̥̼̫s̝̖̜̝͚̫̟.̺͚ ̸̱̲W̶̥̣͖̦i͏̤̬̱̳̣ͅt͉h̗̪̪ ̷̱͚̹̪ǫ͕̗̣̳̦͎u̼̦͔̥̮̕ţ͖͎̻͔͉ ̴͎̩òr̹̰̖͉͈͝d̷̲̦̖͓e̲͓̠r", - "̧͚̜͓̰̭̭Ṯ̫̹̜̮̟̮͝h͚̘̩̘̖̰́e ̥̘͓͉͔͙̼N̟̜̣̘͔̪e̞̞̤͢z̰̖̘͇p̠͟e̺̱̣͍͙̝ṛ̘̬͔̙͇̠d͝ḭ̯̱̥̗̩a̛ͅn͏̦ ̷̥hi̥v̖̳̹͉̮̱͝e̹̪̘̖̰̟-̴͙͓͚̜̻mi̗̺̻͙̺ͅn̪̯͈d ͏̘͓̫̳ͅơ̹͔̳̖̣͓f͈̹̘ ͕ͅc̗̤̠̜̮̥̥h̡͍̩̭̫͚̱a̤͉̤͔͜os͕̤̼͍̲̀ͅ.̡̱ ̦Za̯̱̗̭͍̣͚l̗͉̰̤g͏̣̭̬̗̲͖ͅo̶̭̩̳̟͈.̪̦̰̳", - "H̴̱̦̗̬̣͓̺e̮ ͉̠̰̞͎̖͟ẁh̛̺̯ͅo̖̫͡ ̢Ẁa̡̗i̸t͖̣͉̀ş͔̯̩ ̤̦̮͇̞̦̲B͎̭͇̦̼e̢hin͏͙̟̪d̴̰͓̻̣̮͕ͅ T͖̮̕h͖e̘̺̰̙͘ ̥Ẁ̦͔̻͚a̞͖̪͉l̪̠̻̰̣̠l̲͎͞", - "Z̘͍̼͎̣͔͝Ą̲̜̱̱̹̤͇L̶̝̰̭͔G͍̖͍O̫͜ͅ!̼̤ͅ", - "H̝̪̜͓̀̌̂̒E̢̙̠̣ ̴̳͇̥̟̠͍̐C̹̓̑̐̆͝Ó̶̭͓̚M̬̼Ĕ̖̤͔͔̟̹̽̿̊ͥ̍ͫS̻̰̦̻̖̘̱̒ͪ͌̅͟" + "To invoke the hive mind representing chaos", + "Invoking the feeling of chaos. /Without order", + "The Nezperdian Hive Mind of Chaos, (zalgo………………)", + "He who waits beyond the wall", + "ZALGO", + "HE COMES", + "there used to be some funky unicode keywords here, but it broke the npm website on chrome, so they were removed, sorry" ], "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "ISC", diff --git a/node_modules/dezalgo/test/basic.js b/node_modules/dezalgo/test/basic.js deleted file mode 100644 index da09e724da3ee..0000000000000 --- a/node_modules/dezalgo/test/basic.js +++ /dev/null @@ -1,29 +0,0 @@ -var test = require('tap').test -var dz = require('../dezalgo.js') - -test('the dark pony', function(t) { - - var n = 0 - function foo(i, cb) { - cb = dz(cb) - if (++n % 2) cb(true, i) - else process.nextTick(cb.bind(null, false, i)) - } - - var called = 0 - var order = [0, 2, 4, 6, 8, 1, 3, 5, 7, 9] - var o = 0 - for (var i = 0; i < 10; i++) { - foo(i, function(cached, i) { - t.equal(i, order[o++]) - t.equal(i % 2, cached ? 0 : 1) - called++ - }) - t.equal(called, 0) - } - - setTimeout(function() { - t.equal(called, 10) - t.end() - }) -}) diff --git a/node_modules/@npmcli/map-workspaces/node_modules/brace-expansion/LICENSE b/node_modules/glob/node_modules/brace-expansion/LICENSE similarity index 100% rename from node_modules/@npmcli/map-workspaces/node_modules/brace-expansion/LICENSE rename to node_modules/glob/node_modules/brace-expansion/LICENSE diff --git a/node_modules/@npmcli/map-workspaces/node_modules/brace-expansion/index.js b/node_modules/glob/node_modules/brace-expansion/index.js similarity index 54% rename from node_modules/@npmcli/map-workspaces/node_modules/brace-expansion/index.js rename to node_modules/glob/node_modules/brace-expansion/index.js index 4af9ddee463f4..0478be81eabc2 100644 --- a/node_modules/@npmcli/map-workspaces/node_modules/brace-expansion/index.js +++ b/node_modules/glob/node_modules/brace-expansion/index.js @@ -1,3 +1,4 @@ +var concatMap = require('concat-map'); var balanced = require('balanced-match'); module.exports = expandTop; @@ -78,6 +79,10 @@ function expandTop(str) { return expand(escapeBraces(str), true).map(unescapeBraces); } +function identity(e) { + return e; +} + function embrace(str) { return '{' + str + '}'; } @@ -96,7 +101,42 @@ function expand(str, isTop) { var expansions = []; var m = balanced('{', '}', str); - if (!m) return [str]; + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. // no need to expand pre, since it is guaranteed to be free of brace-sets var pre = m.pre; @@ -104,97 +144,55 @@ function expand(str, isTop) { ? expand(m.post, false) : ['']; - if (/\$$/.test(m.pre)) { - for (var k = 0; k < post.length; k++) { - var expansion = pre+ '{' + m.body + '}' + post[k]; - expansions.push(expansion); - } - } else { - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m.body.indexOf(',') >= 0; - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; } } - N.push(c); - } - } else { - N = []; - - for (var j = 0; j < n.length; j++) { - N.push.apply(N, expand(n[j], false)); } + N.push(c); } + } else { + N = concatMap(n, function(el) { return expand(el, false) }); + } - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); } } diff --git a/node_modules/@npmcli/map-workspaces/node_modules/brace-expansion/package.json b/node_modules/glob/node_modules/brace-expansion/package.json similarity index 90% rename from node_modules/@npmcli/map-workspaces/node_modules/brace-expansion/package.json rename to node_modules/glob/node_modules/brace-expansion/package.json index 7097d41e39de5..a18faa8fd67b8 100644 --- a/node_modules/@npmcli/map-workspaces/node_modules/brace-expansion/package.json +++ b/node_modules/glob/node_modules/brace-expansion/package.json @@ -1,7 +1,7 @@ { "name": "brace-expansion", "description": "Brace expansion as known from sh/bash", - "version": "2.0.1", + "version": "1.1.11", "repository": { "type": "git", "url": "git://github.com/juliangruber/brace-expansion.git" @@ -14,10 +14,11 @@ "bench": "matcha test/perf/bench.js" }, "dependencies": { - "balanced-match": "^1.0.0" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" }, "devDependencies": { - "@c4312/matcha": "^1.3.1", + "matcha": "^0.7.0", "tape": "^4.6.0" }, "keywords": [], diff --git a/node_modules/semver/node_modules/lru-cache/LICENSE b/node_modules/glob/node_modules/minimatch/LICENSE similarity index 100% rename from node_modules/semver/node_modules/lru-cache/LICENSE rename to node_modules/glob/node_modules/minimatch/LICENSE diff --git a/node_modules/glob/node_modules/minimatch/minimatch.js b/node_modules/glob/node_modules/minimatch/minimatch.js new file mode 100644 index 0000000000000..fda45ade7cfc3 --- /dev/null +++ b/node_modules/glob/node_modules/minimatch/minimatch.js @@ -0,0 +1,947 @@ +module.exports = minimatch +minimatch.Minimatch = Minimatch + +var path = (function () { try { return require('path') } catch (e) {}}()) || { + sep: '/' +} +minimatch.sep = path.sep + +var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} +var expand = require('brace-expansion') + +var plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +} + +// any single thing other than / +// don't need to escape / when using new RegExp() +var qmark = '[^/]' + +// * => any number of characters +var star = qmark + '*?' + +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' + +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' + +// characters that need to be escaped in RegExp. +var reSpecials = charSet('().*{}+?[]^$\\!') + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split('').reduce(function (set, c) { + set[c] = true + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} + +function ext (a, b) { + b = b || {} + var t = {} + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + return t +} + +minimatch.defaults = function (def) { + if (!def || typeof def !== 'object' || !Object.keys(def).length) { + return minimatch + } + + var orig = minimatch + + var m = function minimatch (p, pattern, options) { + return orig(p, pattern, ext(def, options)) + } + + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } + m.Minimatch.defaults = function defaults (options) { + return orig.defaults(ext(def, options)).Minimatch + } + + m.filter = function filter (pattern, options) { + return orig.filter(pattern, ext(def, options)) + } + + m.defaults = function defaults (options) { + return orig.defaults(ext(def, options)) + } + + m.makeRe = function makeRe (pattern, options) { + return orig.makeRe(pattern, ext(def, options)) + } + + m.braceExpand = function braceExpand (pattern, options) { + return orig.braceExpand(pattern, ext(def, options)) + } + + m.match = function (list, pattern, options) { + return orig.match(list, pattern, ext(def, options)) + } + + return m +} + +Minimatch.defaults = function (def) { + return minimatch.defaults(def).Minimatch +} + +function minimatch (p, pattern, options) { + assertValidPattern(pattern) + + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false + } + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options) + } + + assertValidPattern(pattern) + + if (!options) options = {} + + pattern = pattern.trim() + + // windows support: need to use /, not \ + if (!options.allowWindowsEscape && path.sep !== '/') { + pattern = pattern.split(path.sep).join('/') + } + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + this.partial = !!options.partial + + // make the set of regexps etc. + this.make() +} + +Minimatch.prototype.debug = function () {} + +Minimatch.prototype.make = make +function make () { + var pattern = this.pattern + var options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } + + // step 1: figure out negation, etc. + this.parseNegate() + + // step 2: expand braces + var set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = function debug() { console.error.apply(console, arguments) } + + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return s.indexOf(false) === -1 + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + var negate = false + var options = this.options + var negateOffset = 0 + + if (options.nonegate) return + + for (var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === '!' + ; i++) { + negate = !negate + negateOffset++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return braceExpand(pattern, options) +} + +Minimatch.prototype.braceExpand = braceExpand + +function braceExpand (pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options + } else { + options = {} + } + } + + pattern = typeof pattern === 'undefined' + ? this.pattern : pattern + + assertValidPattern(pattern) + + // Thanks to Yeting Li for + // improving this regexp to avoid a ReDOS vulnerability. + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + // shortcut. no need to expand. + return [pattern] + } + + return expand(pattern) +} + +var MAX_PATTERN_LENGTH = 1024 * 64 +var assertValidPattern = function (pattern) { + if (typeof pattern !== 'string') { + throw new TypeError('invalid pattern') + } + + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError('pattern is too long') + } +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + assertValidPattern(pattern) + + var options = this.options + + // shortcuts + if (pattern === '**') { + if (!options.noglobstar) + return GLOBSTAR + else + pattern = '*' + } + if (pattern === '') return '' + + var re = '' + var hasMagic = !!options.nocase + var escaping = false + // ? => one single character + var patternListStack = [] + var negativeLists = [] + var stateChar + var inClass = false + var reClassStart = -1 + var classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + var patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' + : '(?!\\.)' + var self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star + hasMagic = true + break + case '?': + re += qmark + hasMagic = true + break + default: + re += '\\' + stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for (var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += '\\' + c + escaping = false + continue + } + + switch (c) { + /* istanbul ignore next */ + case '/': { + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + } + + case '\\': + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === '!' && i === classStart + 1) c = '^' + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case '(': + if (inClass) { + re += '(' + continue + } + + if (!stateChar) { + re += '\\(' + continue + } + + patternListStack.push({ + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }) + // negation is (?:(?!js)[^/]*) + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ')': + if (inClass || !patternListStack.length) { + re += '\\)' + continue + } + + clearStateChar() + hasMagic = true + var pl = patternListStack.pop() + // negation is (?:(?!js)[^/]*) + // The others are (?:) + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) + } + pl.reEnd = re.length + continue + + case '|': + if (inClass || !patternListStack.length || escaping) { + re += '\\|' + escaping = false + continue + } + + clearStateChar() + re += '|' + continue + + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += '\\' + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c + escaping = false + continue + } + + // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + var cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + cs + ']') + } catch (er) { + // not a valid class! + var sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' + hasMagic = hasMagic || sp[1] + inClass = false + continue + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === '^' && inClass)) { + re += '\\' + } + + re += c + + } // switch + } // for + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.substr(classStart + 1) + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\' + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|' + }) + + this.debug('tail=%j\n %s', tail, tail, pl, re) + var t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + t + '\\(' + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += '\\\\' + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case '[': case '.': case '(': addPatternStart = true + } + + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n] + + var nlBefore = re.slice(0, nl.reStart) + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + var nlAfter = re.slice(nl.reEnd) + + nlLast += nlAfter + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + var openParensBefore = nlBefore.split('(').length - 1 + var cleanAfter = nlAfter + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + } + nlAfter = cleanAfter + + var dollar = '' + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$' + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast + re = newRe + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } + + if (addPatternStart) { + re = patternStart + re + } + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? 'i' : '' + try { + var regExp = new RegExp('^' + re + '$', flags) + } catch (er) /* istanbul ignore next - should be impossible */ { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set + + if (!set.length) { + this.regexp = false + return this.regexp + } + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + var flags = options.nocase ? 'i' : '' + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === 'string') ? regExpEscape(p) + : p._src + }).join('\\\/') + }).join('|') + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$' + + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$' + + try { + this.regexp = new RegExp(re, flags) + } catch (ex) /* istanbul ignore next - should be impossible */ { + this.regexp = false + } + return this.regexp +} + +minimatch.match = function (list, pattern, options) { + options = options || {} + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (mm.options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = function match (f, partial) { + if (typeof partial === 'undefined') partial = this.partial + this.debug('match', f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === '' + + if (f === '/' && partial) return true + + var options = this.options + + // windows: need to use /, not \ + if (path.sep !== '/') { + f = f.split(path.sep).join('/') + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, 'split', f) + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set + this.debug(this.pattern, 'set', set) + + // Find the basename of the path by looking for the last non-empty segment + var filename + var i + for (i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break + } + + for (i = 0; i < set.length; i++) { + var pattern = set[i] + var file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }) + + this.debug('matchOne', file.length, pattern.length) + + for (var fi = 0, + pi = 0, + fl = file.length, + pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi++, pi++) { + this.debug('matchOne loop') + var p = pattern[pi] + var f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + /* istanbul ignore if */ + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + var pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === '.' || swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr) + break + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr++ + } + } + + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + /* istanbul ignore if */ + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === 'string') { + hit = f === p + this.debug('string match', p, f, hit) + } else { + hit = f.match(p) + this.debug('pattern match', p, f, hit) + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else /* istanbul ignore else */ if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + return (fi === fl - 1) && (file[fi] === '') + } + + // should be unreachable. + /* istanbul ignore next */ + throw new Error('wtf?') +} + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, '$1') +} + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') +} diff --git a/node_modules/@npmcli/map-workspaces/node_modules/minimatch/package.json b/node_modules/glob/node_modules/minimatch/package.json similarity index 70% rename from node_modules/@npmcli/map-workspaces/node_modules/minimatch/package.json rename to node_modules/glob/node_modules/minimatch/package.json index 2cc856968c0b2..566efdfe45cb8 100644 --- a/node_modules/@npmcli/map-workspaces/node_modules/minimatch/package.json +++ b/node_modules/glob/node_modules/minimatch/package.json @@ -2,7 +2,10 @@ "author": "Isaac Z. Schlueter (http://blog.izs.me)", "name": "minimatch", "description": "a glob matcher in javascript", - "version": "5.0.1", + "version": "3.1.2", + "publishConfig": { + "tag": "v3-legacy" + }, "repository": { "type": "git", "url": "git://github.com/isaacs/minimatch.git" @@ -10,23 +13,21 @@ "main": "minimatch.js", "scripts": { "test": "tap", - "snap": "tap", "preversion": "npm test", "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags" + "postpublish": "git push origin --all; git push origin --tags" }, "engines": { - "node": ">=10" + "node": "*" }, "dependencies": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^1.1.7" }, "devDependencies": { "tap": "^15.1.6" }, "license": "ISC", "files": [ - "minimatch.js", - "lib" + "minimatch.js" ] } diff --git a/node_modules/graceful-fs/LICENSE b/node_modules/graceful-fs/LICENSE index 9d2c8036969be..e906a25acfb5e 100644 --- a/node_modules/graceful-fs/LICENSE +++ b/node_modules/graceful-fs/LICENSE @@ -1,6 +1,6 @@ The ISC License -Copyright (c) Isaac Z. Schlueter, Ben Noordhuis, and Contributors +Copyright (c) 2011-2022 Isaac Z. Schlueter, Ben Noordhuis, and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/node_modules/graceful-fs/graceful-fs.js b/node_modules/graceful-fs/graceful-fs.js index 947cd94bb41bc..8d5b89e4fa7fd 100644 --- a/node_modules/graceful-fs/graceful-fs.js +++ b/node_modules/graceful-fs/graceful-fs.js @@ -191,16 +191,35 @@ function patch (fs) { var fs$readdir = fs.readdir fs.readdir = readdir + var noReaddirOptionVersions = /^v[0-5]\./ function readdir (path, options, cb) { if (typeof options === 'function') cb = options, options = null + var go$readdir = noReaddirOptionVersions.test(process.version) + ? function go$readdir (path, options, cb, startTime) { + return fs$readdir(path, fs$readdirCallback( + path, options, cb, startTime + )) + } + : function go$readdir (path, options, cb, startTime) { + return fs$readdir(path, options, fs$readdirCallback( + path, options, cb, startTime + )) + } + return go$readdir(path, options, cb) - function go$readdir (path, options, cb, startTime) { - return fs$readdir(path, options, function (err, files) { + function fs$readdirCallback (path, options, cb, startTime) { + return function (err, files) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) - enqueue([go$readdir, [path, options, cb], err, startTime || Date.now(), Date.now()]) + enqueue([ + go$readdir, + [path, options, cb], + err, + startTime || Date.now(), + Date.now() + ]) else { if (files && files.sort) files.sort() @@ -208,7 +227,7 @@ function patch (fs) { if (typeof cb === 'function') cb.call(this, err, files) } - }) + } } } diff --git a/node_modules/graceful-fs/package.json b/node_modules/graceful-fs/package.json index e1cb584739202..305785687247c 100644 --- a/node_modules/graceful-fs/package.json +++ b/node_modules/graceful-fs/package.json @@ -1,7 +1,7 @@ { "name": "graceful-fs", "description": "A drop-in replacement for fs, making various improvements.", - "version": "4.2.9", + "version": "4.2.10", "repository": { "type": "git", "url": "https://github.com/isaacs/node-graceful-fs" diff --git a/node_modules/graceful-fs/polyfills.js b/node_modules/graceful-fs/polyfills.js index 26804ef0a6852..46dea36cc490f 100644 --- a/node_modules/graceful-fs/polyfills.js +++ b/node_modules/graceful-fs/polyfills.js @@ -71,13 +71,13 @@ function patch (fs) { fs.lstatSync = statFixSync(fs.lstatSync) // if lchmod/lchown do not exist, then make them no-ops - if (!fs.lchmod) { + if (fs.chmod && !fs.lchmod) { fs.lchmod = function (path, mode, cb) { if (cb) process.nextTick(cb) } fs.lchmodSync = function () {} } - if (!fs.lchown) { + if (fs.chown && !fs.lchown) { fs.lchown = function (path, uid, gid, cb) { if (cb) process.nextTick(cb) } @@ -94,32 +94,38 @@ function patch (fs) { // CPU to a busy looping process, which can cause the program causing the lock // contention to be starved of CPU by node, so the contention doesn't resolve. if (platform === "win32") { - fs.rename = (function (fs$rename) { return function (from, to, cb) { - var start = Date.now() - var backoff = 0; - fs$rename(from, to, function CB (er) { - if (er - && (er.code === "EACCES" || er.code === "EPERM") - && Date.now() - start < 60000) { - setTimeout(function() { - fs.stat(to, function (stater, st) { - if (stater && stater.code === "ENOENT") - fs$rename(from, to, CB); - else - cb(er) - }) - }, backoff) - if (backoff < 100) - backoff += 10; - return; - } - if (cb) cb(er) - }) - }})(fs.rename) + fs.rename = typeof fs.rename !== 'function' ? fs.rename + : (function (fs$rename) { + function rename (from, to, cb) { + var start = Date.now() + var backoff = 0; + fs$rename(from, to, function CB (er) { + if (er + && (er.code === "EACCES" || er.code === "EPERM") + && Date.now() - start < 60000) { + setTimeout(function() { + fs.stat(to, function (stater, st) { + if (stater && stater.code === "ENOENT") + fs$rename(from, to, CB); + else + cb(er) + }) + }, backoff) + if (backoff < 100) + backoff += 10; + return; + } + if (cb) cb(er) + }) + } + if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename) + return rename + })(fs.rename) } // if read() returns EAGAIN, then just try it again. - fs.read = (function (fs$read) { + fs.read = typeof fs.read !== 'function' ? fs.read + : (function (fs$read) { function read (fd, buffer, offset, length, position, callback_) { var callback if (callback_ && typeof callback_ === 'function') { @@ -140,7 +146,8 @@ function patch (fs) { return read })(fs.read) - fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) { + fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync + : (function (fs$readSync) { return function (fd, buffer, offset, length, position) { var eagCounter = 0 while (true) { try { @@ -199,7 +206,7 @@ function patch (fs) { } function patchLutimes (fs) { - if (constants.hasOwnProperty("O_SYMLINK")) { + if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) { fs.lutimes = function (path, at, mt, cb) { fs.open(path, constants.O_SYMLINK, function (er, fd) { if (er) { @@ -233,7 +240,7 @@ function patch (fs) { return ret } - } else { + } else if (fs.futimes) { fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } fs.lutimesSync = function () {} } diff --git a/node_modules/ignore-walk/index.js b/node_modules/ignore-walk/lib/index.js similarity index 91% rename from node_modules/ignore-walk/index.js rename to node_modules/ignore-walk/lib/index.js index 13fc954c54798..40a0726c3257f 100644 --- a/node_modules/ignore-walk/index.js +++ b/node_modules/ignore-walk/lib/index.js @@ -64,7 +64,7 @@ class Walker extends EE { this.entries = entries if (entries.length === 0) { if (this.includeEmpty) { - this.result.add(this.path.substr(this.root.length + 1)) + this.result.add(this.path.slice(this.root.length + 1)) } this.emit('done', this.result) } else { @@ -108,7 +108,9 @@ class Walker extends EE { } const rules = data.split(/\r?\n/) .filter(line => !/^#|^$/.test(line.trim())) - .map(r => new Minimatch(r, mmopt)) + .map(rule => { + return new Minimatch(rule.trim(), mmopt) + }) this.ignoreRules[file] = rules @@ -156,7 +158,7 @@ class Walker extends EE { const abs = this.path + '/' + entry if (!st.isDirectory()) { if (file) { - this.result.add(abs.substr(this.root.length + 1)) + this.result.add(abs.slice(this.root.length + 1)) } then() } else { @@ -171,21 +173,21 @@ class Walker extends EE { stat ({ entry, file, dir }, then) { const abs = this.path + '/' + entry - fs.lstat(abs, (er, st) => { - if (er) { - this.emit('error', er) + fs.lstat(abs, (lstatErr, lstatResult) => { + if (lstatErr) { + this.emit('error', lstatErr) } else { - const isSymbolicLink = st.isSymbolicLink() + const isSymbolicLink = lstatResult.isSymbolicLink() if (this.follow && isSymbolicLink) { - fs.stat(abs, (er, st) => { - if (er) { - this.emit('error', er) + fs.stat(abs, (statErr, statResult) => { + if (statErr) { + this.emit('error', statErr) } else { - this.onstat({ st, entry, file, dir, isSymbolicLink }, then) + this.onstat({ st: statResult, entry, file, dir, isSymbolicLink }, then) } }) } else { - this.onstat({ st, entry, file, dir, isSymbolicLink }, then) + this.onstat({ st: lstatResult, entry, file, dir, isSymbolicLink }, then) } } }) diff --git a/node_modules/ignore-walk/package.json b/node_modules/ignore-walk/package.json index ec6923d19aae9..1bf96eb211bbc 100644 --- a/node_modules/ignore-walk/package.json +++ b/node_modules/ignore-walk/package.json @@ -1,26 +1,31 @@ { "name": "ignore-walk", - "version": "4.0.1", + "version": "5.0.1", "description": "Nested/recursive `.gitignore`/`.npmignore` parsing and filtering.", - "main": "index.js", + "main": "lib/index.js", "devDependencies": { - "@npmcli/lint": "^1.0.2", - "mkdirp": "^0.5.1", - "mutate-fs": "^1.1.0", - "rimraf": "^2.6.1", - "tap": "^15.0.6" + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.2.2", + "mkdirp": "^1.0.4", + "mutate-fs": "^2.1.1", + "rimraf": "^3.0.2", + "tap": "^16.0.1" }, "scripts": { "test": "tap", - "posttest": "npm run lint --", - "lint": "npm run npmclilint -- \"*.*js\" \"test/**/*.*js\"", + "posttest": "npm run lint", + "lint": "eslint \"**/*.js\"", "eslint": "eslint", "lintfix": "npm run lint -- --fix", "preversion": "npm test", "postversion": "npm publish", "postpublish": "git push origin --follow-tags", "npmclilint": "npmcli-lint", - "postsnap": "npm run lintfix --" + "postsnap": "npm run lintfix --", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "prepublishOnly": "git push origin --follow-tags", + "snap": "tap" }, "keywords": [ "ignorefile", @@ -30,17 +35,18 @@ ".npmignore", "glob" ], - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "author": "GitHub Inc.", "license": "ISC", "repository": { "type": "git", - "url": "git+https://github.com/isaacs/ignore-walk.git" + "url": "https://github.com/npm/ignore-walk.git" }, "files": [ - "index.js" + "bin/", + "lib/" ], "dependencies": { - "minimatch": "^3.0.4" + "minimatch": "^5.0.1" }, "tap": { "test-env": "LC_ALL=sk", @@ -49,6 +55,11 @@ "jobs": 1 }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.2.2", + "windowsCI": false } } diff --git a/node_modules/ini/ini.js b/node_modules/ini/lib/ini.js similarity index 75% rename from node_modules/ini/ini.js rename to node_modules/ini/lib/ini.js index 7d05a719b066c..965e702493b1d 100644 --- a/node_modules/ini/ini.js +++ b/node_modules/ini/lib/ini.js @@ -1,5 +1,6 @@ const { hasOwnProperty } = Object.prototype +/* istanbul ignore next */ const eol = typeof process !== 'undefined' && process.platform === 'win32' ? '\r\n' : '\n' @@ -22,16 +23,19 @@ const encode = (obj, opt) => { for (const k of Object.keys(obj)) { const val = obj[k] if (val && Array.isArray(val)) { - for (const item of val) - out += safe(k + '[]') + separator + safe(item) + '\n' - } else if (val && typeof val === 'object') + for (const item of val) { + out += safe(k + '[]') + separator + safe(item) + eol + } + } else if (val && typeof val === 'object') { children.push(k) - else + } else { out += safe(k) + separator + safe(val) + eol + } } - if (opt.section && out.length) + if (opt.section && out.length) { out = '[' + safe(opt.section) + ']' + eol + out + } for (const k of children) { const nk = dotSplit(k).join('\\.') @@ -41,8 +45,9 @@ const encode = (obj, opt) => { section, whitespace, }) - if (out.length && child.length) + if (out.length && child.length) { out += eol + } out += child } @@ -67,11 +72,13 @@ const decode = str => { const lines = str.split(/[\r\n]+/g) for (const line of lines) { - if (!line || line.match(/^\s*[;#]/)) + if (!line || line.match(/^\s*[;#]/)) { continue + } const match = line.match(re) - if (!match) + if (!match) { continue + } if (match[1] !== undefined) { section = unsafe(match[1]) if (section === '__proto__') { @@ -86,8 +93,9 @@ const decode = str => { const keyRaw = unsafe(match[2]) const isArray = keyRaw.length > 2 && keyRaw.slice(-2) === '[]' const key = isArray ? keyRaw.slice(0, -2) : keyRaw - if (key === '__proto__') + if (key === '__proto__') { continue + } const valueRaw = match[3] ? unsafe(match[4]) : true const value = valueRaw === 'true' || valueRaw === 'false' || @@ -96,18 +104,20 @@ const decode = str => { // Convert keys with '[]' suffix to an array if (isArray) { - if (!hasOwnProperty.call(p, key)) + if (!hasOwnProperty.call(p, key)) { p[key] = [] - else if (!Array.isArray(p[key])) + } else if (!Array.isArray(p[key])) { p[key] = [p[key]] + } } // safeguard against resetting a previously defined // array by accidentally forgetting the brackets - if (Array.isArray(p[key])) + if (Array.isArray(p[key])) { p[key].push(value) - else + } else { p[key] = value + } } // {a:{y:1},"a.b":{x:2}} --> {a:{y:1,b:{x:2}}} @@ -116,55 +126,64 @@ const decode = str => { for (const k of Object.keys(out)) { if (!hasOwnProperty.call(out, k) || typeof out[k] !== 'object' || - Array.isArray(out[k])) + Array.isArray(out[k])) { continue + } // see if the parent section is also an object. // if so, add it to that, and mark this one for deletion const parts = dotSplit(k) - let p = out + p = out const l = parts.pop() const nl = l.replace(/\\\./g, '.') for (const part of parts) { - if (part === '__proto__') + if (part === '__proto__') { continue - if (!hasOwnProperty.call(p, part) || typeof p[part] !== 'object') + } + if (!hasOwnProperty.call(p, part) || typeof p[part] !== 'object') { p[part] = Object.create(null) + } p = p[part] } - if (p === out && nl === l) + if (p === out && nl === l) { continue + } p[nl] = out[k] remove.push(k) } - for (const del of remove) + for (const del of remove) { delete out[del] + } return out } -const isQuoted = val => - (val.charAt(0) === '"' && val.slice(-1) === '"') || - (val.charAt(0) === "'" && val.slice(-1) === "'") +const isQuoted = val => { + return (val.startsWith('"') && val.endsWith('"')) || + (val.startsWith("'") && val.endsWith("'")) +} -const safe = val => - (typeof val !== 'string' || +const safe = val => { + if ( + typeof val !== 'string' || val.match(/[=\r\n]/) || val.match(/^\[/) || - (val.length > 1 && - isQuoted(val)) || - val !== val.trim()) - ? JSON.stringify(val) - : val.replace(/;/g, '\\;').replace(/#/g, '\\#') + (val.length > 1 && isQuoted(val)) || + val !== val.trim() + ) { + return JSON.stringify(val) + } + return val.split(';').join('\\;').split('#').join('\\#') +} const unsafe = (val, doUnesc) => { val = (val || '').trim() if (isQuoted(val)) { // remove the single quotes before calling JSON.parse - if (val.charAt(0) === "'") - val = val.substr(1, val.length - 2) - + if (val.charAt(0) === "'") { + val = val.slice(1, -1) + } try { val = JSON.parse(val) } catch (_) {} @@ -175,21 +194,24 @@ const unsafe = (val, doUnesc) => { for (let i = 0, l = val.length; i < l; i++) { const c = val.charAt(i) if (esc) { - if ('\\;#'.indexOf(c) !== -1) + if ('\\;#'.indexOf(c) !== -1) { unesc += c - else + } else { unesc += '\\' + c + } esc = false - } else if (';#'.indexOf(c) !== -1) + } else if (';#'.indexOf(c) !== -1) { break - else if (c === '\\') + } else if (c === '\\') { esc = true - else + } else { unesc += c + } } - if (esc) + if (esc) { unesc += '\\' + } return unesc.trim() } diff --git a/node_modules/ini/package.json b/node_modules/ini/package.json index 59b7d5d0ad99b..1fe32c8f162a3 100644 --- a/node_modules/ini/package.json +++ b/node_modules/ini/package.json @@ -1,36 +1,41 @@ { - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "author": "GitHub Inc.", "name": "ini", "description": "An ini encoder/decoder for node", - "version": "2.0.0", + "version": "3.0.0", "repository": { "type": "git", - "url": "git://github.com/isaacs/ini.git" + "url": "https://github.com/npm/ini.git" }, - "main": "ini.js", + "main": "lib/ini.js", "scripts": { "eslint": "eslint", - "lint": "npm run eslint -- ini.js test/*.js", + "lint": "eslint \"**/*.js\"", "lintfix": "npm run lint -- --fix", "test": "tap", + "snap": "tap", "posttest": "npm run lint", "preversion": "npm test", "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags" + "prepublishOnly": "git push origin --follow-tags", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force" }, "devDependencies": { - "eslint": "^7.9.0", - "eslint-plugin-import": "^2.22.0", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-promise": "^4.2.1", - "eslint-plugin-standard": "^4.0.1", - "tap": "14" + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.2.2", + "tap": "^16.0.1" }, "license": "ISC", "files": [ - "ini.js" + "bin/", + "lib/" ], "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.2.2" } } diff --git a/node_modules/lru-cache/index.js b/node_modules/lru-cache/index.js index 978b8f4ee9595..2168fd3a67bb4 100644 --- a/node_modules/lru-cache/index.js +++ b/node_modules/lru-cache/index.js @@ -127,7 +127,7 @@ class LRUCache { throw new TypeError('cannot set sizeCalculation without setting maxSize') } if (typeof this.sizeCalculation !== 'function') { - throw new TypeError('sizeCalculating set to non-function') + throw new TypeError('sizeCalculation set to non-function') } } @@ -273,11 +273,18 @@ class LRUCache { this.sizes = new ZeroArray(this.max) this.removeItemSize = index => this.calculatedSize -= this.sizes[index] this.requireSize = (k, v, size, sizeCalculation) => { - if (sizeCalculation && !size) { - size = sizeCalculation(v, k) - } if (!isPosInt(size)) { - throw new TypeError('size must be positive integer') + if (sizeCalculation) { + if (typeof sizeCalculation !== 'function') { + throw new TypeError('sizeCalculation must be a function') + } + size = sizeCalculation(v, k) + if (!isPosInt(size)) { + throw new TypeError('sizeCalculation return invalid (expect positive integer)') + } + } else { + throw new TypeError('invalid size value (must be positive integer)') + } } return size } @@ -559,7 +566,7 @@ class LRUCache { if (this.isBackgroundFetch(v)) { return v } - const ac = new AbortController() + const ac = new AC() const fetchOpts = { signal: ac.signal, options, diff --git a/node_modules/lru-cache/package.json b/node_modules/lru-cache/package.json index 84d199c2b21b3..ca75abf004021 100644 --- a/node_modules/lru-cache/package.json +++ b/node_modules/lru-cache/package.json @@ -1,7 +1,7 @@ { "name": "lru-cache", "description": "A cache object that deletes the least-recently-used items.", - "version": "7.7.1", + "version": "7.7.3", "author": "Isaac Z. Schlueter ", "keywords": [ "mru", @@ -22,7 +22,7 @@ "devDependencies": { "@size-limit/preset-small-lib": "^7.0.8", "benchmark": "^2.1.4", - "clock-mock": "^1.0.3", + "clock-mock": "^1.0.4", "size-limit": "^7.0.8", "tap": "^15.1.6" }, diff --git a/node_modules/make-fetch-happen/package.json b/node_modules/make-fetch-happen/package.json index 0e147be69889d..720ba01f1b213 100644 --- a/node_modules/make-fetch-happen/package.json +++ b/node_modules/make-fetch-happen/package.json @@ -1,6 +1,6 @@ { "name": "make-fetch-happen", - "version": "10.1.1", + "version": "10.1.2", "description": "Opinionated, caching, retrying fetch client", "main": "lib/index.js", "files": [ @@ -51,11 +51,11 @@ "negotiator": "^0.6.3", "promise-retry": "^2.0.1", "socks-proxy-agent": "^6.1.1", - "ssri": "^8.0.1" + "ssri": "^9.0.0" }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.0", + "@npmcli/template-oss": "3.2.2", "mkdirp": "^1.0.4", "nock": "^13.2.4", "rimraf": "^3.0.2", @@ -73,6 +73,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.2.0" + "version": "3.2.2" } } diff --git a/node_modules/minimatch/LICENSE b/node_modules/minimatch/LICENSE index 19129e315fe59..9517b7d995bb0 100644 --- a/node_modules/minimatch/LICENSE +++ b/node_modules/minimatch/LICENSE @@ -1,6 +1,6 @@ The ISC License -Copyright (c) Isaac Z. Schlueter and Contributors +Copyright (c) 2011-2022 Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/node_modules/@npmcli/map-workspaces/node_modules/minimatch/lib/path.js b/node_modules/minimatch/lib/path.js similarity index 100% rename from node_modules/@npmcli/map-workspaces/node_modules/minimatch/lib/path.js rename to node_modules/minimatch/lib/path.js diff --git a/node_modules/minimatch/minimatch.js b/node_modules/minimatch/minimatch.js index fda45ade7cfc3..f3b491dd1073e 100644 --- a/node_modules/minimatch/minimatch.js +++ b/node_modules/minimatch/minimatch.js @@ -1,15 +1,24 @@ -module.exports = minimatch -minimatch.Minimatch = Minimatch +const minimatch = module.exports = (p, pattern, options = {}) => { + assertValidPattern(pattern) + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false + } -var path = (function () { try { return require('path') } catch (e) {}}()) || { - sep: '/' + return new Minimatch(pattern, options).match(p) } + +module.exports = minimatch + +const path = require('./lib/path.js') minimatch.sep = path.sep -var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} -var expand = require('brace-expansion') +const GLOBSTAR = Symbol('globstar **') +minimatch.GLOBSTAR = GLOBSTAR +const expand = require('brace-expansion') -var plTypes = { +const plTypes = { '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, '?': { open: '(?:', close: ')?' }, '+': { open: '(?:', close: ')+' }, @@ -19,215 +28,71 @@ var plTypes = { // any single thing other than / // don't need to escape / when using new RegExp() -var qmark = '[^/]' +const qmark = '[^/]' // * => any number of characters -var star = qmark + '*?' +const star = qmark + '*?' // ** when dots are allowed. Anything goes, except .. and . // not (^ or / followed by one or two dots followed by $ or /), // followed by anything, any number of times. -var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' +const twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' // not a ^ or / followed by a dot, // followed by anything, any number of times. -var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' +const twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' + +// "abc" -> { a:true, b:true, c:true } +const charSet = s => s.split('').reduce((set, c) => { + set[c] = true + return set +}, {}) // characters that need to be escaped in RegExp. -var reSpecials = charSet('().*{}+?[]^$\\!') +const reSpecials = charSet('().*{}+?[]^$\\!') -// "abc" -> { a:true, b:true, c:true } -function charSet (s) { - return s.split('').reduce(function (set, c) { - set[c] = true - return set - }, {}) -} +// characters that indicate we have to add the pattern start +const addPatternStartSet = charSet('[.(') // normalizes slashes. -var slashSplit = /\/+/ +const slashSplit = /\/+/ -minimatch.filter = filter -function filter (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) - } -} +minimatch.filter = (pattern, options = {}) => + (p, i, list) => minimatch(p, pattern, options) -function ext (a, b) { - b = b || {} - var t = {} - Object.keys(a).forEach(function (k) { - t[k] = a[k] - }) - Object.keys(b).forEach(function (k) { - t[k] = b[k] - }) +const ext = (a, b = {}) => { + const t = {} + Object.keys(a).forEach(k => t[k] = a[k]) + Object.keys(b).forEach(k => t[k] = b[k]) return t } -minimatch.defaults = function (def) { +minimatch.defaults = def => { if (!def || typeof def !== 'object' || !Object.keys(def).length) { return minimatch } - var orig = minimatch - - var m = function minimatch (p, pattern, options) { - return orig(p, pattern, ext(def, options)) - } - - m.Minimatch = function Minimatch (pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)) - } - m.Minimatch.defaults = function defaults (options) { - return orig.defaults(ext(def, options)).Minimatch - } - - m.filter = function filter (pattern, options) { - return orig.filter(pattern, ext(def, options)) - } - - m.defaults = function defaults (options) { - return orig.defaults(ext(def, options)) - } - - m.makeRe = function makeRe (pattern, options) { - return orig.makeRe(pattern, ext(def, options)) - } - - m.braceExpand = function braceExpand (pattern, options) { - return orig.braceExpand(pattern, ext(def, options)) - } + const orig = minimatch - m.match = function (list, pattern, options) { - return orig.match(list, pattern, ext(def, options)) + const m = (p, pattern, options) => orig(p, pattern, ext(def, options)) + m.Minimatch = class Minimatch extends orig.Minimatch { + constructor (pattern, options) { + super(pattern, ext(def, options)) + } } + m.Minimatch.defaults = options => orig.defaults(ext(def, options)).Minimatch + m.filter = (pattern, options) => orig.filter(pattern, ext(def, options)) + m.defaults = options => orig.defaults(ext(def, options)) + m.makeRe = (pattern, options) => orig.makeRe(pattern, ext(def, options)) + m.braceExpand = (pattern, options) => orig.braceExpand(pattern, ext(def, options)) + m.match = (list, pattern, options) => orig.match(list, pattern, ext(def, options)) return m } -Minimatch.defaults = function (def) { - return minimatch.defaults(def).Minimatch -} - -function minimatch (p, pattern, options) { - assertValidPattern(pattern) - - if (!options) options = {} - - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false - } - - return new Minimatch(pattern, options).match(p) -} - -function Minimatch (pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options) - } - - assertValidPattern(pattern) - - if (!options) options = {} - - pattern = pattern.trim() - - // windows support: need to use /, not \ - if (!options.allowWindowsEscape && path.sep !== '/') { - pattern = pattern.split(path.sep).join('/') - } - - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - this.partial = !!options.partial - - // make the set of regexps etc. - this.make() -} - -Minimatch.prototype.debug = function () {} - -Minimatch.prototype.make = make -function make () { - var pattern = this.pattern - var options = this.options - - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } - // step 1: figure out negation, etc. - this.parseNegate() - // step 2: expand braces - var set = this.globSet = this.braceExpand() - if (options.debug) this.debug = function debug() { console.error.apply(console, arguments) } - - this.debug(this.pattern, set) - - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(function (s) { - return s.split(slashSplit) - }) - - this.debug(this.pattern, set) - - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - this.debug(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return s.indexOf(false) === -1 - }) - - this.debug(this.pattern, set) - - this.set = set -} - -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - var negate = false - var options = this.options - var negateOffset = 0 - - if (options.nonegate) return - - for (var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === '!' - ; i++) { - negate = !negate - negateOffset++ - } - - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate -} // Brace expansion: // a{b,c}d -> abd acd @@ -239,24 +104,9 @@ function parseNegate () { // Invalid sets are not expanded. // a{2..}b -> a{2..}b // a{b}c -> a{b}c -minimatch.braceExpand = function (pattern, options) { - return braceExpand(pattern, options) -} - -Minimatch.prototype.braceExpand = braceExpand - -function braceExpand (pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options - } else { - options = {} - } - } - - pattern = typeof pattern === 'undefined' - ? this.pattern : pattern +minimatch.braceExpand = (pattern, options) => braceExpand(pattern, options) +const braceExpand = (pattern, options = {}) => { assertValidPattern(pattern) // Thanks to Yeting Li for @@ -269,8 +119,8 @@ function braceExpand (pattern, options) { return expand(pattern) } -var MAX_PATTERN_LENGTH = 1024 * 64 -var assertValidPattern = function (pattern) { +const MAX_PATTERN_LENGTH = 1024 * 64 +const assertValidPattern = pattern => { if (typeof pattern !== 'string') { throw new TypeError('invalid pattern') } @@ -291,657 +141,761 @@ var assertValidPattern = function (pattern) { // when it is the *only* thing in a path portion. Otherwise, any series // of * is equivalent to a single *. Globstar behavior is enabled by // default, and can be disabled by setting options.noglobstar. -Minimatch.prototype.parse = parse -var SUBPARSE = {} -function parse (pattern, isSub) { - assertValidPattern(pattern) +const SUBPARSE = Symbol('subparse') - var options = this.options +minimatch.makeRe = (pattern, options) => + new Minimatch(pattern, options || {}).makeRe() - // shortcuts - if (pattern === '**') { - if (!options.noglobstar) - return GLOBSTAR - else - pattern = '*' +minimatch.match = (list, pattern, options = {}) => { + const mm = new Minimatch(pattern, options) + list = list.filter(f => mm.match(f)) + if (mm.options.nonull && !list.length) { + list.push(pattern) } - if (pattern === '') return '' - - var re = '' - var hasMagic = !!options.nocase - var escaping = false - // ? => one single character - var patternListStack = [] - var negativeLists = [] - var stateChar - var inClass = false - var reClassStart = -1 - var classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - var patternStart = pattern.charAt(0) === '.' ? '' // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' - : '(?!\\.)' - var self = this - - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case '*': - re += star - hasMagic = true - break - case '?': - re += qmark - hasMagic = true - break - default: - re += '\\' + stateChar - break - } - self.debug('clearStateChar %j %j', stateChar, re) - stateChar = false + return list +} + +// replace stuff like \* with * +const globUnescape = s => s.replace(/\\(.)/g, '$1') +const regExpEscape = s => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') + +class Minimatch { + constructor (pattern, options) { + assertValidPattern(pattern) + + if (!options) options = {} + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + this.partial = !!options.partial + + // make the set of regexps etc. + this.make() + } + + debug () {} + + make () { + const pattern = this.pattern + const options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true + return } + if (!pattern) { + this.empty = true + return + } + + // step 1: figure out negation, etc. + this.parseNegate() + + // step 2: expand braces + let set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = (...args) => console.error(...args) + + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(s => s.split(slashSplit)) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map((s, si, set) => s.map(this.parse, this)) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(s => s.indexOf(false) === -1) + + this.debug(this.pattern, set) + + this.set = set } - for (var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c) + parseNegate () { + if (this.options.nonegate) return - // skip over any that are escaped. - if (escaping && reSpecials[c]) { - re += '\\' + c - escaping = false - continue + const pattern = this.pattern + let negate = false + let negateOffset = 0 + + for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) { + negate = !negate + negateOffset++ } - switch (c) { - /* istanbul ignore next */ - case '/': { - // completely not allowed, even escaped. - // Should already be path-split by now. - return false - } + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate + } - case '\\': - clearStateChar() - escaping = true - continue - - // the various stateChar values - // for the "extglob" stuff. - case '?': - case '*': - case '+': - case '@': - case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) - - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === '!' && i === classStart + 1) c = '^' - re += c - continue - } + // set partial to true to test if, for example, + // "/a/b" matches the start of "/*/b/*/d" + // Partial means, if you run out of file before you run + // out of pattern, then that's fine, as long as all + // the parts match. + matchOne (file, pattern, partial) { + var options = this.options - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - self.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - - case '(': - if (inClass) { - re += '(' - continue - } + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }) - if (!stateChar) { - re += '\\(' - continue - } + this.debug('matchOne', file.length, pattern.length) - patternListStack.push({ - type: stateChar, - start: i - 1, - reStart: re.length, - open: plTypes[stateChar].open, - close: plTypes[stateChar].close - }) - // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!(?:' : '(?:' - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue + for (var fi = 0, + pi = 0, + fl = file.length, + pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi++, pi++) { + this.debug('matchOne loop') + var p = pattern[pi] + var f = file[fi] - case ')': - if (inClass || !patternListStack.length) { - re += '\\)' - continue + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + /* istanbul ignore if */ + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + var pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) return false + } + return true } - clearStateChar() - hasMagic = true - var pl = patternListStack.pop() - // negation is (?:(?!js)[^/]*) - // The others are (?:) - re += pl.close - if (pl.type === '!') { - negativeLists.push(pl) + // ok, let's see if we can swallow whatever we can. + while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === '.' || swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr) + break + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr++ + } } - pl.reEnd = re.length - continue - - case '|': - if (inClass || !patternListStack.length || escaping) { - re += '\\|' - escaping = false - continue + + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + /* istanbul ignore if */ + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr) + if (fr === fl) return true } + return false + } - clearStateChar() - re += '|' - continue + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === 'string') { + hit = f === p + this.debug('string match', p, f, hit) + } else { + hit = f.match(p) + this.debug('pattern match', p, f, hit) + } - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() + if (!hit) return false + } - if (inClass) { - re += '\\' + c - continue - } + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else /* istanbul ignore else */ if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + return (fi === fl - 1) && (file[fi] === '') + } - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - - case ']': - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += '\\' + c - escaping = false - continue - } + // should be unreachable. + /* istanbul ignore next */ + throw new Error('wtf?') + } - // handle the case where we left a class open. - // "[z-a]" is valid, equivalent to "\[z-a\]" - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - var cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + cs + ']') - } catch (er) { - // not a valid class! - var sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' - hasMagic = hasMagic || sp[1] - inClass = false - continue + braceExpand () { + return braceExpand(this.pattern, this.options) + } + + parse (pattern, isSub) { + assertValidPattern(pattern) + + const options = this.options + + // shortcuts + if (pattern === '**') { + if (!options.noglobstar) + return GLOBSTAR + else + pattern = '*' + } + if (pattern === '') return '' + + let re = '' + let hasMagic = !!options.nocase + let escaping = false + // ? => one single character + const patternListStack = [] + const negativeLists = [] + let stateChar + let inClass = false + let reClassStart = -1 + let classStart = -1 + let cs + let pl + let sp + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + const patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' + : '(?!\\.)' + + const clearStateChar = () => { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star + hasMagic = true + break + case '?': + re += qmark + hasMagic = true + break + default: + re += '\\' + stateChar + break } + this.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } - // finish up the class. - hasMagic = true - inClass = false - re += c - continue + for (let i = 0, c; (i < pattern.length) && (c = pattern.charAt(i)); i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c) - default: - // swallow any state char that wasn't consumed - clearStateChar() + // skip over any that are escaped. + if (escaping) { + /* istanbul ignore next - completely not allowed, even escaped. */ + if (c === '/') { + return false + } - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === '^' && inClass)) { + if (reSpecials[c]) { re += '\\' } - re += c + escaping = false + continue + } - } // switch - } // for - - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - cs = pattern.substr(classStart + 1) - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] - hasMagic = hasMagic || sp[1] - } + switch (c) { + /* istanbul ignore next */ + case '/': { + // Should already be path-split by now. + return false + } - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + pl.open.length) - this.debug('setting tail', re, pl) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = '\\' - } + case '\\': + clearStateChar() + escaping = true + continue - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + '|' - }) - - this.debug('tail=%j\n %s', tail, tail, pl, re) - var t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type - - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail - } + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === '!' && i === classStart + 1) c = '^' + re += c + continue + } - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' - } + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + this.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case '(': + if (inClass) { + re += '(' + continue + } - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - var addPatternStart = false - switch (re.charAt(0)) { - case '[': case '.': case '(': addPatternStart = true - } + if (!stateChar) { + re += '\\(' + continue + } - // Hack to work around lack of negative lookbehind in JS - // A pattern like: *.!(x).!(y|z) needs to ensure that a name - // like 'a.xyz.yz' doesn't match. So, the first negative - // lookahead, has to look ALL the way ahead, to the end of - // the pattern. - for (var n = negativeLists.length - 1; n > -1; n--) { - var nl = negativeLists[n] - - var nlBefore = re.slice(0, nl.reStart) - var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) - var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) - var nlAfter = re.slice(nl.reEnd) - - nlLast += nlAfter - - // Handle nested stuff like *(*.js|!(*.json)), where open parens - // mean that we should *not* include the ) in the bit that is considered - // "after" the negated section. - var openParensBefore = nlBefore.split('(').length - 1 - var cleanAfter = nlAfter - for (i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') - } - nlAfter = cleanAfter + patternListStack.push({ + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }) + // negation is (?:(?!js)[^/]*) + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ')': + if (inClass || !patternListStack.length) { + re += '\\)' + continue + } - var dollar = '' - if (nlAfter === '' && isSub !== SUBPARSE) { - dollar = '$' - } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast - re = newRe - } + clearStateChar() + hasMagic = true + pl = patternListStack.pop() + // negation is (?:(?!js)[^/]*) + // The others are (?:) + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) + } + pl.reEnd = re.length + continue - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) { - re = '(?=.)' + re - } + case '|': + if (inClass || !patternListStack.length) { + re += '\\|' + continue + } - if (addPatternStart) { - re = patternStart + re - } + clearStateChar() + re += '|' + continue - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] - } + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar() - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } + if (inClass) { + re += '\\' + c + continue + } - var flags = options.nocase ? 'i' : '' - try { - var regExp = new RegExp('^' + re + '$', flags) - } catch (er) /* istanbul ignore next - should be impossible */ { - // If it was an invalid regular expression, then it can't match - // anything. This trick looks for a character after the end of - // the string, which is of course impossible, except in multi-line - // mode, but it's not a /m regex. - return new RegExp('$.') - } + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c + continue + } - regExp._glob = pattern - regExp._src = re + // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + cs + ']') + } catch (er) { + // not a valid class! + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' + hasMagic = hasMagic || sp[1] + inClass = false + continue + } - return regExp -} + // finish up the class. + hasMagic = true + inClass = false + re += c + continue -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() -} + default: + // swallow any state char that wasn't consumed + clearStateChar() -Minimatch.prototype.makeRe = makeRe -function makeRe () { - if (this.regexp || this.regexp === false) return this.regexp + if (reSpecials[c] && !(c === '^' && inClass)) { + re += '\\' + } - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - var set = this.set + re += c + break + + } // switch + } // for + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.substr(classStart + 1) + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + hasMagic = hasMagic || sp[1] + } - if (!set.length) { - this.regexp = false - return this.regexp - } - var options = this.options - - var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - var flags = options.nocase ? 'i' : '' - - var re = set.map(function (pattern) { - return pattern.map(function (p) { - return (p === GLOBSTAR) ? twoStar - : (typeof p === 'string') ? regExpEscape(p) - : p._src - }).join('\\\/') - }).join('|') - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = '^(?:' + re + ')$' - - // can match anything, as long as it's not this. - if (this.negate) re = '^(?!' + re + ').*$' - - try { - this.regexp = new RegExp(re, flags) - } catch (ex) /* istanbul ignore next - should be impossible */ { - this.regexp = false - } - return this.regexp -} + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + let tail + tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, (_, $1, $2) => { + /* istanbul ignore else - should already be done */ + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\' + } -minimatch.match = function (list, pattern, options) { - options = options || {} - var mm = new Minimatch(pattern, options) - list = list.filter(function (f) { - return mm.match(f) - }) - if (mm.options.nonull && !list.length) { - list.push(pattern) - } - return list -} + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|' + }) + + this.debug('tail=%j\n %s', tail, tail, pl, re) + const t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + t + '\\(' + tail + } -Minimatch.prototype.match = function match (f, partial) { - if (typeof partial === 'undefined') partial = this.partial - this.debug('match', f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === '' + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += '\\\\' + } - if (f === '/' && partial) return true + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + const addPatternStart = addPatternStartSet[re.charAt(0)] + + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (let n = negativeLists.length - 1; n > -1; n--) { + const nl = negativeLists[n] + + const nlBefore = re.slice(0, nl.reStart) + const nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + let nlAfter = re.slice(nl.reEnd) + const nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + nlAfter + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + const openParensBefore = nlBefore.split('(').length - 1 + let cleanAfter = nlAfter + for (let i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + } + nlAfter = cleanAfter - var options = this.options + const dollar = nlAfter === '' && isSub !== SUBPARSE ? '$' : '' + re = nlBefore + nlFirst + nlAfter + dollar + nlLast + } - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) + if (addPatternStart) { + re = patternStart + re + } - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] + } - var set = this.set - this.debug(this.pattern, 'set', set) + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } - // Find the basename of the path by looking for the last non-empty segment - var filename - var i - for (i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break + const flags = options.nocase ? 'i' : '' + try { + return Object.assign(new RegExp('^' + re + '$', flags), { + _glob: pattern, + _src: re, + }) + } catch (er) /* istanbul ignore next - should be impossible */ { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } } - for (i = 0; i < set.length; i++) { - var pattern = set[i] - var file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] + makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + const set = this.set + + if (!set.length) { + this.regexp = false + return this.regexp } - var hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate + const options = this.options + + const twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + const flags = options.nocase ? 'i' : '' + + // coalesce globstars and regexpify non-globstar patterns + // if it's the only item, then we just do one twoStar + // if it's the first, and there are more, prepend (\/|twoStar\/)? to next + // if it's the last, append (\/twoStar|) to previous + // if it's in the middle, append (\/|\/twoStar\/) to previous + // then filter out GLOBSTAR symbols + let re = set.map(pattern => { + pattern = pattern.map(p => + typeof p === 'string' ? regExpEscape(p) + : p === GLOBSTAR ? GLOBSTAR + : p._src + ).reduce((set, p) => { + if (!(set[set.length - 1] === GLOBSTAR && p === GLOBSTAR)) { + set.push(p) + } + return set + }, []) + pattern.forEach((p, i) => { + if (p !== GLOBSTAR || pattern[i-1] === GLOBSTAR) { + return + } + if (i === 0) { + if (pattern.length > 1) { + pattern[i+1] = '(?:\\\/|' + twoStar + '\\\/)?' + pattern[i+1] + } else { + pattern[i] = twoStar + } + } else if (i === pattern.length - 1) { + pattern[i-1] += '(?:\\\/|' + twoStar + ')?' + } else { + pattern[i-1] += '(?:\\\/|\\\/' + twoStar + '\\\/)' + pattern[i+1] + pattern[i+1] = GLOBSTAR + } + }) + return pattern.filter(p => p !== GLOBSTAR).join('/') + }).join('|') + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$' + + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$' + + try { + this.regexp = new RegExp(re, flags) + } catch (ex) /* istanbul ignore next - should be impossible */ { + this.regexp = false } + return this.regexp } - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate -} + match (f, partial = this.partial) { + this.debug('match', f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === '' -// set partial to true to test if, for example, -// "/a/b" matches the start of "/*/b/*/d" -// Partial means, if you run out of file before you run -// out of pattern, then that's fine, as long as all -// the parts match. -Minimatch.prototype.matchOne = function (file, pattern, partial) { - var options = this.options - - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) - - this.debug('matchOne', file.length, pattern.length) - - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] - - this.debug(pattern, p, f) - - // should be impossible. - // some invalid regexp stuff in the set. - /* istanbul ignore if */ - if (p === false) return false - - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true - } + if (f === '/' && partial) return true - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] + const options = this.options - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) + // windows: need to use /, not \ + if (path.sep !== '/') { + f = f.split(path.sep).join('/') + } - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, 'split', f) - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } - } + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - /* istanbul ignore if */ - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true - } - return false + const set = this.set + this.debug(this.pattern, 'set', set) + + // Find the basename of the path by looking for the last non-empty segment + let filename + for (let i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break } - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === 'string') { - hit = f === p - this.debug('string match', p, f, hit) - } else { - hit = f.match(p) - this.debug('pattern match', p, f, hit) + for (let i = 0; i < set.length; i++) { + const pattern = set[i] + let file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] + } + const hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } } - if (!hit) return false + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate } - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else /* istanbul ignore else */ if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - return (fi === fl - 1) && (file[fi] === '') + static defaults (def) { + return minimatch.defaults(def).Minimatch } - - // should be unreachable. - /* istanbul ignore next */ - throw new Error('wtf?') } -// replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, '$1') -} - -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') -} +minimatch.Minimatch = Minimatch diff --git a/node_modules/minimatch/package.json b/node_modules/minimatch/package.json index 566efdfe45cb8..2cc856968c0b2 100644 --- a/node_modules/minimatch/package.json +++ b/node_modules/minimatch/package.json @@ -2,10 +2,7 @@ "author": "Isaac Z. Schlueter (http://blog.izs.me)", "name": "minimatch", "description": "a glob matcher in javascript", - "version": "3.1.2", - "publishConfig": { - "tag": "v3-legacy" - }, + "version": "5.0.1", "repository": { "type": "git", "url": "git://github.com/isaacs/minimatch.git" @@ -13,21 +10,23 @@ "main": "minimatch.js", "scripts": { "test": "tap", + "snap": "tap", "preversion": "npm test", "postversion": "npm publish", - "postpublish": "git push origin --all; git push origin --tags" + "prepublishOnly": "git push origin --follow-tags" }, "engines": { - "node": "*" + "node": ">=10" }, "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "devDependencies": { "tap": "^15.1.6" }, "license": "ISC", "files": [ - "minimatch.js" + "minimatch.js", + "lib" ] } diff --git a/node_modules/npm-install-checks/index.js b/node_modules/npm-install-checks/lib/index.js similarity index 91% rename from node_modules/npm-install-checks/index.js rename to node_modules/npm-install-checks/lib/index.js index 732888ef57b8a..728e8cf3f8682 100644 --- a/node_modules/npm-install-checks/index.js +++ b/node_modules/npm-install-checks/lib/index.js @@ -1,4 +1,3 @@ -const {format} = require('util') const semver = require('semver') const checkEngine = (target, npmVer, nodeVer, force = false) => { @@ -16,7 +15,7 @@ const checkEngine = (target, npmVer, nodeVer, force = false) => { pkgid: target._id, current: { node: nodeVer, npm: npmVer }, required: eng, - code: 'EBADENGINE' + code: 'EBADENGINE', }) } } @@ -36,13 +35,13 @@ const checkPlatform = (target, force = false) => { pkgid: target._id, current: { os: platform, - cpu: arch + cpu: arch, }, required: { os: target.os, - cpu: target.cpu + cpu: target.cpu, }, - code: 'EBADPLATFORM' + code: 'EBADPLATFORM', }) } } @@ -62,7 +61,7 @@ const checkList = (value, list) => { const negate = entry.charAt(0) === '!' const test = negate ? entry.slice(1) : entry if (negate) { - negated ++ + negated++ if (value === test) { return false } @@ -75,5 +74,5 @@ const checkList = (value, list) => { module.exports = { checkEngine, - checkPlatform + checkPlatform, } diff --git a/node_modules/npm-install-checks/package.json b/node_modules/npm-install-checks/package.json index 0eb597ae83480..ce33718514b4a 100644 --- a/node_modules/npm-install-checks/package.json +++ b/node_modules/npm-install-checks/package.json @@ -1,23 +1,32 @@ { "name": "npm-install-checks", - "version": "4.0.0", + "version": "5.0.0", "description": "Check the engines and platform fields in package.json", - "main": "index.js", + "main": "lib/index.js", "dependencies": { "semver": "^7.1.1" }, "devDependencies": { - "tap": "^14.10.6" + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.2.2", + "tap": "^16.0.1" }, "scripts": { "test": "tap", "preversion": "npm test", "postversion": "npm publish", - "postpublish": "git push origin --follow-tags" + "postpublish": "git push origin --follow-tags", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "prepublishOnly": "git push origin --follow-tags", + "snap": "tap", + "posttest": "npm run lint" }, "repository": { "type": "git", - "url": "git://github.com/npm/npm-install-checks.git" + "url": "https://github.com/npm/npm-install-checks.git" }, "keywords": [ "npm,", @@ -25,9 +34,15 @@ ], "license": "BSD-2-Clause", "files": [ - "index.js" + "bin/", + "lib/" ], "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + }, + "author": "GitHub Inc.", + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.2.2" } } diff --git a/node_modules/npm-packlist/bin/index.js b/node_modules/npm-packlist/bin/index.js index a42f5b74ce80e..48a6b879aa823 100755 --- a/node_modules/npm-packlist/bin/index.js +++ b/node_modules/npm-packlist/bin/index.js @@ -1,4 +1,7 @@ #!/usr/bin/env node +'use strict' + +const packlist = require('../') const dirs = [] let doSort = false @@ -15,12 +18,22 @@ process.argv.slice(2).forEach(arg => { const sort = list => doSort ? list.sort((a, b) => a.localeCompare(b, 'en')) : list -const packlist = require('../') -if (!dirs.length) { - console.log(sort(packlist.sync({ path: process.cwd() })).join('\n')) -} else { - dirs.forEach(path => { - console.log(`> ${path}`) - console.log(sort(packlist.sync({ path })).join('\n')) - }) +const main = async () => { + if (!dirs.length) { + const results = await packlist({ path: process.cwd() }) + console.log(sort(results).join('\n')) + } else { + for (const dir of dirs) { + console.group(`> ${dir}`) + const results = await packlist({ path: dir }) + console.log(sort(results).join('\n')) + console.groupEnd() + } + } } + +// coverage disabled for catch handler because we don't need to test that +main().catch(/* istanbul ignore next */(err) => { + process.exitCode = 1 + console.error(err.stack) +}) diff --git a/node_modules/npm-packlist/lib/index.js b/node_modules/npm-packlist/lib/index.js index 1b67e4e71e04d..30d99dc873f26 100644 --- a/node_modules/npm-packlist/lib/index.js +++ b/node_modules/npm-packlist/lib/index.js @@ -7,11 +7,9 @@ const bundleWalk = require('npm-bundled') const BundleWalker = bundleWalk.BundleWalker -const BundleWalkerSync = bundleWalk.BundleWalkerSync const ignoreWalk = require('ignore-walk') const IgnoreWalker = ignoreWalk.Walker -const IgnoreWalkerSync = ignoreWalk.WalkerSync const rootBuiltinRules = Symbol('root-builtin-rules') const packageNecessaryRules = Symbol('package-necessary-rules') @@ -34,6 +32,24 @@ const packageMustHavesRE = new RegExp(`^(${packageMustHaveFileNames})(\\..*[^~$] const fs = require('fs') const glob = require('glob') +const pathHasPkg = (input) => { + if (!input.startsWith('node_modules/')) { + return false + } + + const segments = input.slice('node_modules/'.length).split('/', 2) + return segments[0].startsWith('@') + ? segments.length === 2 + : true +} + +const pkgFromPath = (input) => { + const segments = input.slice('node_modules/'.length).split('/', 2) + return segments[0].startsWith('@') + ? segments.join('/') + : segments[0] +} + const defaultRules = [ '.npmignore', '.gitignore', @@ -65,8 +81,7 @@ const defaultRules = [ // There may be others, but :?|<> are handled by node-tar const nameIsBadForWindows = file => /\*/.test(file) -// a decorator that applies our custom rules to an ignore walker -const npmWalker = Class => class Walker extends Class { +class Walker extends IgnoreWalker { constructor (opt) { opt = opt || {} @@ -90,7 +105,7 @@ const npmWalker = Class => class Walker extends Class { // hierarchy (ie, not in test/foo/node_modules/ or something). const followRe = /^(?:\/node_modules\/(?:@[^/]+\/[^/]+|[^/]+)\/)*\/node_modules(?:\/@[^/]+)?$/ const rootPath = opt.parent ? opt.parent.root : opt.path - const followTestPath = opt.path.replace(/\\/g, '/').substr(rootPath.length) + const followTestPath = opt.path.replace(/\\/g, '/').slice(rootPath.length) opt.follow = followRe.test(followTestPath) super(opt) @@ -224,7 +239,7 @@ const npmWalker = Class => class Walker extends Class { const patterns = Array.from(new Set(pkg.files)).reduce((set, pattern) => { const excl = pattern.match(/^!+/) if (excl) { - pattern = pattern.substr(excl[0].length) + pattern = pattern.slice(excl[0].length) } // strip off any / from the start of the pattern. /foo => foo pattern = pattern.replace(/^\/+/, '') @@ -248,8 +263,8 @@ const npmWalker = Class => class Walker extends Class { processResults(results) } } - const processResults = results => { - for (const { negate, fileList } of results) { + const processResults = processed => { + for (const { negate, fileList } of processed) { if (negate) { fileList.forEach(f => { f = f.replace(/\/+$/, '') @@ -283,11 +298,11 @@ const npmWalker = Class => class Walker extends Class { filterEntry (entry, partial) { // get the partial path from the root of the walk - const p = this.path.substr(this.root.length + 1) - const pkgre = /^node_modules\/(@[^/]+\/?[^/]+|[^/]+)(\/.*)?$/ + const p = this.path.slice(this.root.length + 1) const { isProject } = this - const pkg = isProject && pkgre.test(entry) ? - entry.replace(pkgre, '$1') : null + const pkg = isProject && pathHasPkg(entry) + ? pkgFromPath(entry) + : null const rootNM = isProject && entry === 'node_modules' const rootPJ = isProject && entry === 'package.json' @@ -399,11 +414,19 @@ const npmWalker = Class => class Walker extends Class { } sort (a, b) { - return sort(a, b) + // optimize for compressibility + // extname, then basename, then locale alphabetically + // https://twitter.com/isntitvacant/status/1131094910923231232 + const exta = path.extname(a).toLowerCase() + const extb = path.extname(b).toLowerCase() + const basea = path.basename(a).toLowerCase() + const baseb = path.basename(b).toLowerCase() + + return exta.localeCompare(extb, 'en') || + basea.localeCompare(baseb, 'en') || + a.localeCompare(b, 'en') } -} -class Walker extends npmWalker(IgnoreWalker) { globFiles (pattern, cb) { glob(pattern, { dot: true, cwd: this.path, nocase: true }, cb) } @@ -418,26 +441,6 @@ class Walker extends npmWalker(IgnoreWalker) { } } -class WalkerSync extends npmWalker(IgnoreWalkerSync) { - globFiles (pattern, cb) { - cb(null, glob.sync(pattern, { dot: true, cwd: this.path, nocase: true })) - } - - readPackageJson (entries) { - const p = this.path + '/package.json' - try { - this.onReadPackageJson(entries, null, fs.readFileSync(p)) - } catch (er) { - this.onReadPackageJson(entries, er) - } - } - - walker (entry, opt, then) { - new WalkerSync(this.walkerOpt(entry, opt)).start() - then() - } -} - const walk = (options, callback) => { options = options || {} const p = new Promise((resolve, reject) => { @@ -452,31 +455,5 @@ const walk = (options, callback) => { return callback ? p.then(res => callback(null, res), callback) : p } -const walkSync = options => { - options = options || {} - const bw = new BundleWalkerSync(options).start() - options.bundled = bw.result - options.packageJsonCache = bw.packageJsonCache - const walker = new WalkerSync(options) - walker.start() - return walker.result -} - -// optimize for compressibility -// extname, then basename, then locale alphabetically -// https://twitter.com/isntitvacant/status/1131094910923231232 -const sort = (a, b) => { - const exta = path.extname(a).toLowerCase() - const extb = path.extname(b).toLowerCase() - const basea = path.basename(a).toLowerCase() - const baseb = path.basename(b).toLowerCase() - - return exta.localeCompare(extb, 'en') || - basea.localeCompare(baseb, 'en') || - a.localeCompare(b, 'en') -} - module.exports = walk -walk.sync = walkSync walk.Walker = Walker -walk.WalkerSync = WalkerSync diff --git a/node_modules/npm-packlist/package.json b/node_modules/npm-packlist/package.json index ab270f60713b6..632524d789ca8 100644 --- a/node_modules/npm-packlist/package.json +++ b/node_modules/npm-packlist/package.json @@ -1,6 +1,6 @@ { "name": "npm-packlist", - "version": "4.0.0", + "version": "5.0.0", "description": "Get a list of the files to add from a folder into an npm package", "directories": { "test": "test" @@ -8,20 +8,21 @@ "main": "lib", "dependencies": { "glob": "^7.2.0", - "ignore-walk": "^4.0.1", + "ignore-walk": "^5.0.1", "npm-bundled": "^1.1.2", "npm-normalize-package-bin": "^1.0.1" }, "author": "GitHub Inc.", "license": "ISC", "files": [ - "bin", - "lib" + "bin/", + "lib/" ], "devDependencies": { - "@npmcli/template-oss": "^2.9.2", + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.2.2", "mutate-fs": "^2.1.1", - "tap": "^15.1.6" + "tap": "^16.0.1" }, "scripts": { "test": "tap", @@ -32,33 +33,29 @@ "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", "eslint": "eslint", - "lint": "eslint '**/*.js'", + "lint": "eslint \"**/*.js\"", "lintfix": "npm run lint -- --fix", "npmclilint": "npmcli-lint", - "postlint": "npm-template-check", - "template-copy": "npm-template-copy --force" + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force" }, "repository": { "type": "git", - "url": "git+https://github.com/npm/npm-packlist.git" + "url": "https://github.com/npm/npm-packlist.git" }, "tap": { "test-env": [ "LC_ALL=sk" - ], - "check-coverage": true, - "nyc-arg": [ - "--include=index.js", - "--include=bin/index.js" ] }, "bin": { "npm-packlist": "bin/index.js" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" }, "templateOSS": { - "version": "2.9.2" + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.2.2" } } diff --git a/node_modules/npm-pick-manifest/package.json b/node_modules/npm-pick-manifest/package.json index ece1d174dbc0c..79867d9cebaf2 100644 --- a/node_modules/npm-pick-manifest/package.json +++ b/node_modules/npm-pick-manifest/package.json @@ -1,26 +1,29 @@ { "name": "npm-pick-manifest", - "version": "7.0.0", + "version": "7.0.1", "description": "Resolves a matching manifest from a package metadata document according to standard npm semver resolution rules.", "main": "./lib", "files": [ - "bin", - "lib" + "bin/", + "lib/" ], "scripts": { "coverage": "tap", - "lint": "eslint '**/*.js'", + "lint": "eslint \"**/*.js\"", "test": "tap", "posttest": "npm run lint", "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", - "postlint": "npm-template-check", - "template-copy": "npm-template-copy --force", + "postlint": "template-oss-check", "lintfix": "npm run lint -- --fix", - "snap": "tap" + "snap": "tap", + "template-oss-apply": "template-oss-apply --force" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/npm-pick-manifest.git" }, - "repository": "https://github.com/npm/npm-pick-manifest", "keywords": [ "npm", "semver", @@ -29,22 +32,24 @@ "author": "GitHub Inc.", "license": "ISC", "dependencies": { - "npm-install-checks": "^4.0.0", + "npm-install-checks": "^5.0.0", "npm-normalize-package-bin": "^1.0.1", "npm-package-arg": "^9.0.0", "semver": "^7.3.5" }, "devDependencies": { - "@npmcli/template-oss": "^2.7.1", - "tap": "^15.1.6" + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.2.2", + "tap": "^16.0.1" }, "tap": { "check-coverage": true }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" }, "templateOSS": { - "version": "2.7.1" + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.2.2" } } diff --git a/node_modules/pacote/lib/bin.js b/node_modules/pacote/lib/bin.js index 369304adaa879..4a1f911e42bc5 100755 --- a/node_modules/pacote/lib/bin.js +++ b/node_modules/pacote/lib/bin.js @@ -110,7 +110,7 @@ const parseArg = arg => { const k = split.shift() const v = split.join('=') const no = /^no-/.test(k) && !v - const key = (no ? k.substr(3) : k) + const key = (no ? k.slice(3) : k) .replace(/^tag$/, 'defaultTag') .replace(/-([a-z])/g, (_, c) => c.toUpperCase()) const value = v ? v.replace(/^~/, process.env.HOME) : !no diff --git a/node_modules/pacote/lib/fetcher.js b/node_modules/pacote/lib/fetcher.js index 78b13a9637c4f..65e97e205204e 100644 --- a/node_modules/pacote/lib/fetcher.js +++ b/node_modules/pacote/lib/fetcher.js @@ -105,6 +105,9 @@ class FetcherBase { this[_readPackageJson] = readPackageJsonFast } + // config values: npmjs (default), never + this.replaceRegistryHost = opts.replaceRegistryHost === 'never' ? 'never' : 'npmjs' + this.defaultTag = opts.defaultTag || 'latest' this.registry = removeTrailingSlashes(opts.registry || 'https://registry.npmjs.org') @@ -325,18 +328,18 @@ class FetcherBase { } return this.resolve().then(() => retry(tryAgain => streamHandler(this[_istream](this[_tarballFromResolved]())) - .catch(er => { + .catch(streamErr => { // Most likely data integrity. A cache ENOENT error is unlikely // here, since we're definitely not reading from the cache, but it // IS possible that the fetch subsystem accessed the cache, and the // entry got blown away or something. Try one more time to be sure. - if (this.isRetriableError(er)) { + if (this.isRetriableError(streamErr)) { log.warn('tarball', `tarball data for ${ this.spec } (${this.integrity}) seems to be corrupted. Trying again.`) - return this.cleanupCached().then(() => tryAgain(er)) + return this.cleanupCached().then(() => tryAgain(streamErr)) } - throw er + throw streamErr }), { retries: 1, minTimeout: 0, maxTimeout: 0 })) } diff --git a/node_modules/pacote/lib/remote.js b/node_modules/pacote/lib/remote.js index 5cabfe4fcda44..3404ea9474944 100644 --- a/node_modules/pacote/lib/remote.js +++ b/node_modules/pacote/lib/remote.js @@ -13,7 +13,9 @@ class RemoteFetcher extends Fetcher { constructor (spec, opts) { super(spec, opts) this.resolved = this.spec.fetchSpec - if (magic.test(this.resolved) && !magic.test(this.registry + '/')) { + if (this.replaceRegistryHost === 'npmjs' + && magic.test(this.resolved) + && !magic.test(this.registry + '/')) { this.resolved = this.resolved.replace(magic, this.registry + '/') } diff --git a/node_modules/pacote/lib/util/trailing-slashes.js b/node_modules/pacote/lib/util/trailing-slashes.js index ff75dfd9c0fbc..c50cb6173b92e 100644 --- a/node_modules/pacote/lib/util/trailing-slashes.js +++ b/node_modules/pacote/lib/util/trailing-slashes.js @@ -2,7 +2,7 @@ const removeTrailingSlashes = (input) => { // in order to avoid regexp redos detection let output = input while (output.endsWith('/')) { - output = output.substr(0, output.length - 1) + output = output.slice(0, -1) } return output } diff --git a/node_modules/pacote/package.json b/node_modules/pacote/package.json index f49c23147a80c..af8166d4ea19e 100644 --- a/node_modules/pacote/package.json +++ b/node_modules/pacote/package.json @@ -1,6 +1,6 @@ { "name": "pacote", - "version": "13.0.5", + "version": "13.1.1", "description": "JavaScript package downloader", "author": "GitHub Inc.", "bin": { @@ -14,25 +14,28 @@ "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", - "lint": "eslint '**/*.js'", - "postlint": "npm-template-check", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", "lintfix": "npm run lint -- --fix", "posttest": "npm run lint", - "template-copy": "npm-template-copy --force" + "template-oss-apply": "template-oss-apply --force" }, "tap": { "timeout": 300, "coverage-map": "map.js" }, "devDependencies": { - "@npmcli/template-oss": "^2.9.2", + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.2.2", + "hosted-git-info": "^5.0.0", "mutate-fs": "^2.1.1", + "nock": "^13.2.4", "npm-registry-mock": "^1.3.1", - "tap": "^15.1.6" + "tap": "^16.0.1" }, "files": [ - "bin", - "lib" + "bin/", + "lib/" ], "keywords": [ "packages", @@ -42,7 +45,7 @@ "dependencies": { "@npmcli/git": "^3.0.0", "@npmcli/installed-package-contents": "^1.0.7", - "@npmcli/promise-spawn": "^1.2.0", + "@npmcli/promise-spawn": "^3.0.0", "@npmcli/run-script": "^3.0.1", "cacache": "^16.0.0", "chownr": "^2.0.0", @@ -51,7 +54,7 @@ "minipass": "^3.1.6", "mkdirp": "^1.0.4", "npm-package-arg": "^9.0.0", - "npm-packlist": "^4.0.0", + "npm-packlist": "^5.0.0", "npm-pick-manifest": "^7.0.0", "npm-registry-fetch": "^13.0.1", "proc-log": "^2.0.0", @@ -59,15 +62,19 @@ "read-package-json": "^5.0.0", "read-package-json-fast": "^2.0.3", "rimraf": "^3.0.2", - "ssri": "^8.0.1", + "ssri": "^9.0.0", "tar": "^6.1.11" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/pacote.git" }, - "repository": "git@github.com:npm/pacote", "templateOSS": { - "version": "2.9.2", + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.2.2", "windowsCI": false } } diff --git a/node_modules/read-cmd-shim/index.js b/node_modules/read-cmd-shim/lib/index.js similarity index 91% rename from node_modules/read-cmd-shim/index.js rename to node_modules/read-cmd-shim/lib/index.js index 4ac050fc3846e..782d4c36dced5 100644 --- a/node_modules/read-cmd-shim/index.js +++ b/node_modules/read-cmd-shim/lib/index.js @@ -1,6 +1,6 @@ const fs = require('fs') -const {promisify} = require('util') -const {readFileSync} = fs +const { promisify } = require('util') +const { readFileSync } = fs const readFile = promisify(fs.readFile) const extractPath = (path, cmdshimContents) => { @@ -53,7 +53,9 @@ const readCmdShim = path => { Error.captureStackTrace(er, readCmdShim) return readFile(path).then(contents => { const destination = extractPath(path, contents.toString()) - if (destination) return destination + if (destination) { + return destination + } return Promise.reject(notaShim(path, er)) }, readFileEr => Promise.reject(wrapError(readFileEr, er))) } @@ -61,7 +63,9 @@ const readCmdShim = path => { const readCmdShimSync = path => { const contents = readFileSync(path) const destination = extractPath(path, contents.toString()) - if (!destination) throw notaShim(path) + if (!destination) { + throw notaShim(path) + } return destination } diff --git a/node_modules/read-cmd-shim/package.json b/node_modules/read-cmd-shim/package.json index 2a76dc3b1632e..fee454f017c2f 100644 --- a/node_modules/read-cmd-shim/package.json +++ b/node_modules/read-cmd-shim/package.json @@ -1,29 +1,46 @@ { "name": "read-cmd-shim", - "version": "2.0.0", + "version": "3.0.0", "description": "Figure out what a cmd-shim is pointing at. This acts as the equivalent of fs.readlink.", - "main": "index.js", + "main": "lib/index.js", "devDependencies": { + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.2.2", "cmd-shim": "^4.0.0", "rimraf": "^3.0.0", - "tap": "^14.10.6" + "tap": "^16.0.1" }, "scripts": { - "preversion": "npm t", + "preversion": "npm test", "postversion": "npm publish", - "prepublishOnly": "git push --follow-tags", - "test": "tap" + "prepublishOnly": "git push origin --follow-tags", + "test": "tap", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "snap": "tap", + "posttest": "npm run lint" }, "tap": { "check-coverage": true }, "repository": { "type": "git", - "url": "git+https://github.com/npm/read-cmd-shim.git" + "url": "https://github.com/npm/read-cmd-shim.git" }, "license": "ISC", "homepage": "https://github.com/npm/read-cmd-shim#readme", "files": [ - "index.js" - ] + "bin/", + "lib/" + ], + "author": "GitHub Inc.", + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.2.2" + } } diff --git a/node_modules/semver/bin/semver.js b/node_modules/semver/bin/semver.js index 73fe29538ad57..779b8b0cdc2aa 100755 --- a/node_modules/semver/bin/semver.js +++ b/node_modules/semver/bin/semver.js @@ -27,10 +27,12 @@ const semver = require('../') let reverse = false -const options = {} +let options = {} const main = () => { - if (!argv.length) return help() + if (!argv.length) { + return help() + } while (argv.length) { let a = argv.shift() const indexOfEqualSign = a.indexOf('=') @@ -85,26 +87,31 @@ const main = () => { } } - const options = { loose: loose, includePrerelease: includePrerelease, rtl: rtl } + options = { loose: loose, includePrerelease: includePrerelease, rtl: rtl } versions = versions.map((v) => { return coerce ? (semver.coerce(v, options) || { version: v }).version : v }).filter((v) => { return semver.valid(v) }) - if (!versions.length) return fail() - if (inc && (versions.length !== 1 || range.length)) { return failInc() } + if (!versions.length) { + return fail() + } + if (inc && (versions.length !== 1 || range.length)) { + return failInc() + } for (let i = 0, l = range.length; i < l; i++) { versions = versions.filter((v) => { return semver.satisfies(v, range[i], options) }) - if (!versions.length) return fail() + if (!versions.length) { + return fail() + } } return success(versions) } - const failInc = () => { console.error('--inc can only be used on a single version with no range') fail() @@ -120,7 +127,9 @@ const success = () => { return semver.clean(v, options) }).map((v) => { return inc ? semver.inc(v, inc, options, identifier) : v - }).forEach((v, i, _) => { console.log(v) }) + }).forEach((v, i, _) => { + console.log(v) + }) } const help = () => console.log( diff --git a/node_modules/semver/classes/comparator.js b/node_modules/semver/classes/comparator.js index dbbef2d8fe20e..62cd204d9b796 100644 --- a/node_modules/semver/classes/comparator.js +++ b/node_modules/semver/classes/comparator.js @@ -4,6 +4,7 @@ class Comparator { static get ANY () { return ANY } + constructor (comp, options) { options = parseOptions(options) @@ -80,7 +81,7 @@ class Comparator { if (!options || typeof options !== 'object') { options = { loose: !!options, - includePrerelease: false + includePrerelease: false, } } @@ -128,7 +129,7 @@ class Comparator { module.exports = Comparator const parseOptions = require('../internal/parse-options') -const {re, t} = require('../internal/re') +const { re, t } = require('../internal/re') const cmp = require('../functions/cmp') const debug = require('../internal/debug') const SemVer = require('./semver') diff --git a/node_modules/semver/classes/index.js b/node_modules/semver/classes/index.js index 198b84d6645cf..5e3f5c9b19cef 100644 --- a/node_modules/semver/classes/index.js +++ b/node_modules/semver/classes/index.js @@ -1,5 +1,5 @@ module.exports = { SemVer: require('./semver.js'), Range: require('./range.js'), - Comparator: require('./comparator.js') + Comparator: require('./comparator.js'), } diff --git a/node_modules/semver/classes/range.js b/node_modules/semver/classes/range.js index aa04f6bff9446..7dc24bc714b02 100644 --- a/node_modules/semver/classes/range.js +++ b/node_modules/semver/classes/range.js @@ -29,9 +29,9 @@ class Range { // First, split based on boolean or || this.raw = range this.set = range - .split(/\s*\|\|\s*/) + .split('||') // map the range to a 2d array of comparators - .map(range => this.parseRange(range.trim())) + .map(r => this.parseRange(r.trim())) // throw out any comparator lists that are empty // this generally means that it was not a valid range, which is allowed // in loose mode, but will still throw if the WHOLE range is invalid. @@ -46,9 +46,9 @@ class Range { // keep the first one, in case they're all null sets const first = this.set[0] this.set = this.set.filter(c => !isNullSet(c[0])) - if (this.set.length === 0) + if (this.set.length === 0) { this.set = [first] - else if (this.set.length > 1) { + } else if (this.set.length > 1) { // if we have any that are *, then the range is just * for (const c of this.set) { if (c.length === 1 && isAny(c[0])) { @@ -84,8 +84,9 @@ class Range { const memoOpts = Object.keys(this.options).join(',') const memoKey = `parseRange:${memoOpts}:${range}` const cached = cache.get(memoKey) - if (cached) + if (cached) { return cached + } const loose = this.options.loose // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` @@ -94,7 +95,7 @@ class Range { debug('hyphen replace', range) // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) - debug('comparator trim', range, re[t.COMPARATORTRIM]) + debug('comparator trim', range) // `~ 1.2.3` => `~1.2.3` range = range.replace(re[t.TILDETRIM], tildeTrimReplace) @@ -108,30 +109,37 @@ class Range { // At this point, the range is completely trimmed and // ready to be split into comparators. - const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] - const rangeList = range + let rangeList = range .split(' ') .map(comp => parseComparator(comp, this.options)) .join(' ') .split(/\s+/) // >=0.0.0 is equivalent to * .map(comp => replaceGTE0(comp, this.options)) + + if (loose) { // in loose mode, throw out any that are not valid comparators - .filter(this.options.loose ? comp => !!comp.match(compRe) : () => true) - .map(comp => new Comparator(comp, this.options)) + rangeList = rangeList.filter(comp => { + debug('loose invalid filter', comp, this.options) + return !!comp.match(re[t.COMPARATORLOOSE]) + }) + } + debug('range list', rangeList) // if any comparators are the null set, then replace with JUST null set // if more than one comparator, remove any * comparators // also, don't include the same comparator more than once - const l = rangeList.length const rangeMap = new Map() - for (const comp of rangeList) { - if (isNullSet(comp)) + const comparators = rangeList.map(comp => new Comparator(comp, this.options)) + for (const comp of comparators) { + if (isNullSet(comp)) { return [comp] + } rangeMap.set(comp.value, comp) } - if (rangeMap.size > 1 && rangeMap.has('')) + if (rangeMap.size > 1 && rangeMap.has('')) { rangeMap.delete('') + } const result = [...rangeMap.values()] cache.set(memoKey, result) @@ -196,7 +204,7 @@ const { t, comparatorTrimReplace, tildeTrimReplace, - caretTrimReplace + caretTrimReplace, } = require('../internal/re') const isNullSet = c => c.value === '<0.0.0-0' @@ -245,8 +253,8 @@ const isX = id => !id || id.toLowerCase() === 'x' || id === '*' // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 const replaceTildes = (comp, options) => - comp.trim().split(/\s+/).map((comp) => { - return replaceTilde(comp, options) + comp.trim().split(/\s+/).map((c) => { + return replaceTilde(c, options) }).join(' ') const replaceTilde = (comp, options) => { @@ -284,8 +292,8 @@ const replaceTilde = (comp, options) => { // ^1.2.3 --> >=1.2.3 <2.0.0-0 // ^1.2.0 --> >=1.2.0 <2.0.0-0 const replaceCarets = (comp, options) => - comp.trim().split(/\s+/).map((comp) => { - return replaceCaret(comp, options) + comp.trim().split(/\s+/).map((c) => { + return replaceCaret(c, options) }).join(' ') const replaceCaret = (comp, options) => { @@ -343,8 +351,8 @@ const replaceCaret = (comp, options) => { const replaceXRanges = (comp, options) => { debug('replaceXRanges', comp, options) - return comp.split(/\s+/).map((comp) => { - return replaceXRange(comp, options) + return comp.split(/\s+/).map((c) => { + return replaceXRange(c, options) }).join(' ') } @@ -405,8 +413,9 @@ const replaceXRange = (comp, options) => { } } - if (gtlt === '<') + if (gtlt === '<') { pr = '-0' + } ret = `${gtlt + M}.${m}.${p}${pr}` } else if (xm) { diff --git a/node_modules/semver/functions/cmp.js b/node_modules/semver/functions/cmp.js index 3b89db779108a..40119094747dd 100644 --- a/node_modules/semver/functions/cmp.js +++ b/node_modules/semver/functions/cmp.js @@ -8,17 +8,21 @@ const lte = require('./lte') const cmp = (a, op, b, loose) => { switch (op) { case '===': - if (typeof a === 'object') + if (typeof a === 'object') { a = a.version - if (typeof b === 'object') + } + if (typeof b === 'object') { b = b.version + } return a === b case '!==': - if (typeof a === 'object') + if (typeof a === 'object') { a = a.version - if (typeof b === 'object') + } + if (typeof b === 'object') { b = b.version + } return a !== b case '': diff --git a/node_modules/semver/functions/coerce.js b/node_modules/semver/functions/coerce.js index 106ca71c9af92..2e01452fddad6 100644 --- a/node_modules/semver/functions/coerce.js +++ b/node_modules/semver/functions/coerce.js @@ -1,6 +1,6 @@ const SemVer = require('../classes/semver') const parse = require('./parse') -const {re, t} = require('../internal/re') +const { re, t } = require('../internal/re') const coerce = (version, options) => { if (version instanceof SemVer) { @@ -43,8 +43,9 @@ const coerce = (version, options) => { re[t.COERCERTL].lastIndex = -1 } - if (match === null) + if (match === null) { return null + } return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options) } diff --git a/node_modules/semver/functions/parse.js b/node_modules/semver/functions/parse.js index 11f20f03745ab..a66663aa5918f 100644 --- a/node_modules/semver/functions/parse.js +++ b/node_modules/semver/functions/parse.js @@ -1,4 +1,4 @@ -const {MAX_LENGTH} = require('../internal/constants') +const { MAX_LENGTH } = require('../internal/constants') const { re, t } = require('../internal/re') const SemVer = require('../classes/semver') diff --git a/node_modules/semver/internal/constants.js b/node_modules/semver/internal/constants.js index 49df215ad554d..4f0de59b56949 100644 --- a/node_modules/semver/internal/constants.js +++ b/node_modules/semver/internal/constants.js @@ -4,7 +4,7 @@ const SEMVER_SPEC_VERSION = '2.0.0' const MAX_LENGTH = 256 const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || - /* istanbul ignore next */ 9007199254740991 +/* istanbul ignore next */ 9007199254740991 // Max safe segment length for coercion. const MAX_SAFE_COMPONENT_LENGTH = 16 @@ -13,5 +13,5 @@ module.exports = { SEMVER_SPEC_VERSION, MAX_LENGTH, MAX_SAFE_INTEGER, - MAX_SAFE_COMPONENT_LENGTH + MAX_SAFE_COMPONENT_LENGTH, } diff --git a/node_modules/semver/internal/identifiers.js b/node_modules/semver/internal/identifiers.js index ed13094217520..e612d0a3d8361 100644 --- a/node_modules/semver/internal/identifiers.js +++ b/node_modules/semver/internal/identifiers.js @@ -19,5 +19,5 @@ const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) module.exports = { compareIdentifiers, - rcompareIdentifiers + rcompareIdentifiers, } diff --git a/node_modules/semver/internal/parse-options.js b/node_modules/semver/internal/parse-options.js index 42d2ebd6fa32f..bbd9ec77a3ff4 100644 --- a/node_modules/semver/internal/parse-options.js +++ b/node_modules/semver/internal/parse-options.js @@ -4,8 +4,8 @@ const opts = ['includePrerelease', 'loose', 'rtl'] const parseOptions = options => !options ? {} : typeof options !== 'object' ? { loose: true } - : opts.filter(k => options[k]).reduce((options, k) => { - options[k] = true - return options + : opts.filter(k => options[k]).reduce((o, k) => { + o[k] = true + return o }, {}) module.exports = parseOptions diff --git a/node_modules/semver/internal/re.js b/node_modules/semver/internal/re.js index 54d4176deaf23..ed88398a9dbf5 100644 --- a/node_modules/semver/internal/re.js +++ b/node_modules/semver/internal/re.js @@ -10,7 +10,7 @@ let R = 0 const createToken = (name, value, isGlobal) => { const index = R++ - debug(index, value) + debug(name, index, value) t[name] = index src[index] = value re[index] = new RegExp(value, isGlobal ? 'g' : undefined) @@ -178,5 +178,5 @@ createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + // Star ranges basically just allow anything at all. createToken('STAR', '(<|>)?=?\\s*\\*') // >=0.0.0 is like a star -createToken('GTE0', '^\\s*>=\\s*0\.0\.0\\s*$') -createToken('GTE0PRE', '^\\s*>=\\s*0\.0\.0-0\\s*$') +createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$') +createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$') diff --git a/node_modules/semver/node_modules/lru-cache/index.js b/node_modules/semver/node_modules/lru-cache/index.js deleted file mode 100644 index 573b6b85b9779..0000000000000 --- a/node_modules/semver/node_modules/lru-cache/index.js +++ /dev/null @@ -1,334 +0,0 @@ -'use strict' - -// A linked list to keep track of recently-used-ness -const Yallist = require('yallist') - -const MAX = Symbol('max') -const LENGTH = Symbol('length') -const LENGTH_CALCULATOR = Symbol('lengthCalculator') -const ALLOW_STALE = Symbol('allowStale') -const MAX_AGE = Symbol('maxAge') -const DISPOSE = Symbol('dispose') -const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet') -const LRU_LIST = Symbol('lruList') -const CACHE = Symbol('cache') -const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet') - -const naiveLength = () => 1 - -// lruList is a yallist where the head is the youngest -// item, and the tail is the oldest. the list contains the Hit -// objects as the entries. -// Each Hit object has a reference to its Yallist.Node. This -// never changes. -// -// cache is a Map (or PseudoMap) that matches the keys to -// the Yallist.Node object. -class LRUCache { - constructor (options) { - if (typeof options === 'number') - options = { max: options } - - if (!options) - options = {} - - if (options.max && (typeof options.max !== 'number' || options.max < 0)) - throw new TypeError('max must be a non-negative number') - // Kind of weird to have a default max of Infinity, but oh well. - const max = this[MAX] = options.max || Infinity - - const lc = options.length || naiveLength - this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc - this[ALLOW_STALE] = options.stale || false - if (options.maxAge && typeof options.maxAge !== 'number') - throw new TypeError('maxAge must be a number') - this[MAX_AGE] = options.maxAge || 0 - this[DISPOSE] = options.dispose - this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false - this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false - this.reset() - } - - // resize the cache when the max changes. - set max (mL) { - if (typeof mL !== 'number' || mL < 0) - throw new TypeError('max must be a non-negative number') - - this[MAX] = mL || Infinity - trim(this) - } - get max () { - return this[MAX] - } - - set allowStale (allowStale) { - this[ALLOW_STALE] = !!allowStale - } - get allowStale () { - return this[ALLOW_STALE] - } - - set maxAge (mA) { - if (typeof mA !== 'number') - throw new TypeError('maxAge must be a non-negative number') - - this[MAX_AGE] = mA - trim(this) - } - get maxAge () { - return this[MAX_AGE] - } - - // resize the cache when the lengthCalculator changes. - set lengthCalculator (lC) { - if (typeof lC !== 'function') - lC = naiveLength - - if (lC !== this[LENGTH_CALCULATOR]) { - this[LENGTH_CALCULATOR] = lC - this[LENGTH] = 0 - this[LRU_LIST].forEach(hit => { - hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key) - this[LENGTH] += hit.length - }) - } - trim(this) - } - get lengthCalculator () { return this[LENGTH_CALCULATOR] } - - get length () { return this[LENGTH] } - get itemCount () { return this[LRU_LIST].length } - - rforEach (fn, thisp) { - thisp = thisp || this - for (let walker = this[LRU_LIST].tail; walker !== null;) { - const prev = walker.prev - forEachStep(this, fn, walker, thisp) - walker = prev - } - } - - forEach (fn, thisp) { - thisp = thisp || this - for (let walker = this[LRU_LIST].head; walker !== null;) { - const next = walker.next - forEachStep(this, fn, walker, thisp) - walker = next - } - } - - keys () { - return this[LRU_LIST].toArray().map(k => k.key) - } - - values () { - return this[LRU_LIST].toArray().map(k => k.value) - } - - reset () { - if (this[DISPOSE] && - this[LRU_LIST] && - this[LRU_LIST].length) { - this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value)) - } - - this[CACHE] = new Map() // hash of items by key - this[LRU_LIST] = new Yallist() // list of items in order of use recency - this[LENGTH] = 0 // length of items in the list - } - - dump () { - return this[LRU_LIST].map(hit => - isStale(this, hit) ? false : { - k: hit.key, - v: hit.value, - e: hit.now + (hit.maxAge || 0) - }).toArray().filter(h => h) - } - - dumpLru () { - return this[LRU_LIST] - } - - set (key, value, maxAge) { - maxAge = maxAge || this[MAX_AGE] - - if (maxAge && typeof maxAge !== 'number') - throw new TypeError('maxAge must be a number') - - const now = maxAge ? Date.now() : 0 - const len = this[LENGTH_CALCULATOR](value, key) - - if (this[CACHE].has(key)) { - if (len > this[MAX]) { - del(this, this[CACHE].get(key)) - return false - } - - const node = this[CACHE].get(key) - const item = node.value - - // dispose of the old one before overwriting - // split out into 2 ifs for better coverage tracking - if (this[DISPOSE]) { - if (!this[NO_DISPOSE_ON_SET]) - this[DISPOSE](key, item.value) - } - - item.now = now - item.maxAge = maxAge - item.value = value - this[LENGTH] += len - item.length - item.length = len - this.get(key) - trim(this) - return true - } - - const hit = new Entry(key, value, len, now, maxAge) - - // oversized objects fall out of cache automatically. - if (hit.length > this[MAX]) { - if (this[DISPOSE]) - this[DISPOSE](key, value) - - return false - } - - this[LENGTH] += hit.length - this[LRU_LIST].unshift(hit) - this[CACHE].set(key, this[LRU_LIST].head) - trim(this) - return true - } - - has (key) { - if (!this[CACHE].has(key)) return false - const hit = this[CACHE].get(key).value - return !isStale(this, hit) - } - - get (key) { - return get(this, key, true) - } - - peek (key) { - return get(this, key, false) - } - - pop () { - const node = this[LRU_LIST].tail - if (!node) - return null - - del(this, node) - return node.value - } - - del (key) { - del(this, this[CACHE].get(key)) - } - - load (arr) { - // reset the cache - this.reset() - - const now = Date.now() - // A previous serialized cache has the most recent items first - for (let l = arr.length - 1; l >= 0; l--) { - const hit = arr[l] - const expiresAt = hit.e || 0 - if (expiresAt === 0) - // the item was created without expiration in a non aged cache - this.set(hit.k, hit.v) - else { - const maxAge = expiresAt - now - // dont add already expired items - if (maxAge > 0) { - this.set(hit.k, hit.v, maxAge) - } - } - } - } - - prune () { - this[CACHE].forEach((value, key) => get(this, key, false)) - } -} - -const get = (self, key, doUse) => { - const node = self[CACHE].get(key) - if (node) { - const hit = node.value - if (isStale(self, hit)) { - del(self, node) - if (!self[ALLOW_STALE]) - return undefined - } else { - if (doUse) { - if (self[UPDATE_AGE_ON_GET]) - node.value.now = Date.now() - self[LRU_LIST].unshiftNode(node) - } - } - return hit.value - } -} - -const isStale = (self, hit) => { - if (!hit || (!hit.maxAge && !self[MAX_AGE])) - return false - - const diff = Date.now() - hit.now - return hit.maxAge ? diff > hit.maxAge - : self[MAX_AGE] && (diff > self[MAX_AGE]) -} - -const trim = self => { - if (self[LENGTH] > self[MAX]) { - for (let walker = self[LRU_LIST].tail; - self[LENGTH] > self[MAX] && walker !== null;) { - // We know that we're about to delete this one, and also - // what the next least recently used key will be, so just - // go ahead and set it now. - const prev = walker.prev - del(self, walker) - walker = prev - } - } -} - -const del = (self, node) => { - if (node) { - const hit = node.value - if (self[DISPOSE]) - self[DISPOSE](hit.key, hit.value) - - self[LENGTH] -= hit.length - self[CACHE].delete(hit.key) - self[LRU_LIST].removeNode(node) - } -} - -class Entry { - constructor (key, value, length, now, maxAge) { - this.key = key - this.value = value - this.length = length - this.now = now - this.maxAge = maxAge || 0 - } -} - -const forEachStep = (self, fn, node, thisp) => { - let hit = node.value - if (isStale(self, hit)) { - del(self, node) - if (!self[ALLOW_STALE]) - hit = undefined - } - if (hit) - fn.call(thisp, hit.value, hit.key, self) -} - -module.exports = LRUCache diff --git a/node_modules/semver/node_modules/lru-cache/package.json b/node_modules/semver/node_modules/lru-cache/package.json deleted file mode 100644 index 43b7502c3e7c7..0000000000000 --- a/node_modules/semver/node_modules/lru-cache/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "lru-cache", - "description": "A cache object that deletes the least-recently-used items.", - "version": "6.0.0", - "author": "Isaac Z. Schlueter ", - "keywords": [ - "mru", - "lru", - "cache" - ], - "scripts": { - "test": "tap", - "snap": "tap", - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags" - }, - "main": "index.js", - "repository": "git://github.com/isaacs/node-lru-cache.git", - "devDependencies": { - "benchmark": "^2.1.4", - "tap": "^14.10.7" - }, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "files": [ - "index.js" - ], - "engines": { - "node": ">=10" - } -} diff --git a/node_modules/semver/package.json b/node_modules/semver/package.json index 4e1154195a5f1..b04e0d328268f 100644 --- a/node_modules/semver/package.json +++ b/node_modules/semver/package.json @@ -1,6 +1,6 @@ { "name": "semver", - "version": "7.3.5", + "version": "7.3.6", "description": "The semantic version parser used by npm.", "main": "index.js", "scripts": { @@ -8,34 +8,67 @@ "snap": "tap", "preversion": "npm test", "postversion": "npm publish", - "postpublish": "git push origin --follow-tags" + "postpublish": "git push origin --follow-tags", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "lintfix": "npm run lint -- --fix", + "prepublishOnly": "git push origin --follow-tags", + "posttest": "npm run lint", + "template-oss-apply": "template-oss-apply --force" }, "devDependencies": { - "tap": "^14.10.7" + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.2.2", + "tap": "^16.0.0" }, "license": "ISC", - "repository": "https://github.com/npm/node-semver", + "repository": { + "type": "git", + "url": "https://github.com/npm/node-semver.git" + }, "bin": { "semver": "bin/semver.js" }, "files": [ - "bin/**/*.js", - "range.bnf", - "classes/**/*.js", - "functions/**/*.js", - "internal/**/*.js", - "ranges/**/*.js", + "bin/", + "classes/", + "functions/", + "internal/", + "ranges/", "index.js", - "preload.js" + "preload.js", + "range.bnf" ], "tap": { "check-coverage": true, "coverage-map": "map.js" }, "engines": { - "node": ">=10" + "node": "^10.0.0 || ^12.0.0 || ^14.0.0 || >=16.0.0" }, "dependencies": { - "lru-cache": "^6.0.0" + "lru-cache": "^7.4.0" + }, + "author": "GitHub Inc.", + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.2.2", + "ciVersions": [ + "10.0.0", + "10.x", + "12.x", + "14.x", + "16.x" + ], + "distPaths": [ + "bin/", + "classes/", + "functions/", + "internal/", + "ranges/", + "index.js", + "preload.js", + "range.bnf" + ] } } diff --git a/node_modules/semver/ranges/min-version.js b/node_modules/semver/ranges/min-version.js index 2fac412914fe2..350e1f78368ea 100644 --- a/node_modules/semver/ranges/min-version.js +++ b/node_modules/semver/ranges/min-version.js @@ -47,8 +47,9 @@ const minVersion = (range, loose) => { throw new Error(`Unexpected operation: ${comparator.operator}`) } }) - if (setMin && (!minver || gt(minver, setMin))) + if (setMin && (!minver || gt(minver, setMin))) { minver = setMin + } } if (minver && range.test(minver)) { diff --git a/node_modules/semver/ranges/outside.js b/node_modules/semver/ranges/outside.js index 2a4b0a13f9e29..ae99b10a5b9e6 100644 --- a/node_modules/semver/ranges/outside.js +++ b/node_modules/semver/ranges/outside.js @@ -1,6 +1,6 @@ const SemVer = require('../classes/semver') const Comparator = require('../classes/comparator') -const {ANY} = Comparator +const { ANY } = Comparator const Range = require('../classes/range') const satisfies = require('../functions/satisfies') const gt = require('../functions/gt') diff --git a/node_modules/semver/ranges/simplify.js b/node_modules/semver/ranges/simplify.js index b792f97296454..618d5b6273551 100644 --- a/node_modules/semver/ranges/simplify.js +++ b/node_modules/semver/ranges/simplify.js @@ -5,38 +5,41 @@ const satisfies = require('../functions/satisfies.js') const compare = require('../functions/compare.js') module.exports = (versions, range, options) => { const set = [] - let min = null + let first = null let prev = null const v = versions.sort((a, b) => compare(a, b, options)) for (const version of v) { const included = satisfies(version, range, options) if (included) { prev = version - if (!min) - min = version + if (!first) { + first = version + } } else { if (prev) { - set.push([min, prev]) + set.push([first, prev]) } prev = null - min = null + first = null } } - if (min) - set.push([min, null]) + if (first) { + set.push([first, null]) + } const ranges = [] for (const [min, max] of set) { - if (min === max) + if (min === max) { ranges.push(min) - else if (!max && min === v[0]) + } else if (!max && min === v[0]) { ranges.push('*') - else if (!max) + } else if (!max) { ranges.push(`>=${min}`) - else if (min === v[0]) + } else if (min === v[0]) { ranges.push(`<=${max}`) - else + } else { ranges.push(`${min} - ${max}`) + } } const simplified = ranges.join(' || ') const original = typeof range.raw === 'string' ? range.raw : String(range) diff --git a/node_modules/semver/ranges/subset.js b/node_modules/semver/ranges/subset.js index 532fd1364ce75..e0dea43c2b6a8 100644 --- a/node_modules/semver/ranges/subset.js +++ b/node_modules/semver/ranges/subset.js @@ -41,8 +41,9 @@ const compare = require('../functions/compare.js') // - Else return true const subset = (sub, dom, options = {}) => { - if (sub === dom) + if (sub === dom) { return true + } sub = new Range(sub, options) dom = new Range(dom, options) @@ -52,73 +53,84 @@ const subset = (sub, dom, options = {}) => { for (const simpleDom of dom.set) { const isSub = simpleSubset(simpleSub, simpleDom, options) sawNonNull = sawNonNull || isSub !== null - if (isSub) + if (isSub) { continue OUTER + } } // the null set is a subset of everything, but null simple ranges in // a complex range should be ignored. so if we saw a non-null range, // then we know this isn't a subset, but if EVERY simple range was null, // then it is a subset. - if (sawNonNull) + if (sawNonNull) { return false + } } return true } const simpleSubset = (sub, dom, options) => { - if (sub === dom) + if (sub === dom) { return true + } if (sub.length === 1 && sub[0].semver === ANY) { - if (dom.length === 1 && dom[0].semver === ANY) + if (dom.length === 1 && dom[0].semver === ANY) { return true - else if (options.includePrerelease) - sub = [ new Comparator('>=0.0.0-0') ] - else - sub = [ new Comparator('>=0.0.0') ] + } else if (options.includePrerelease) { + sub = [new Comparator('>=0.0.0-0')] + } else { + sub = [new Comparator('>=0.0.0')] + } } if (dom.length === 1 && dom[0].semver === ANY) { - if (options.includePrerelease) + if (options.includePrerelease) { return true - else - dom = [ new Comparator('>=0.0.0') ] + } else { + dom = [new Comparator('>=0.0.0')] + } } const eqSet = new Set() let gt, lt for (const c of sub) { - if (c.operator === '>' || c.operator === '>=') + if (c.operator === '>' || c.operator === '>=') { gt = higherGT(gt, c, options) - else if (c.operator === '<' || c.operator === '<=') + } else if (c.operator === '<' || c.operator === '<=') { lt = lowerLT(lt, c, options) - else + } else { eqSet.add(c.semver) + } } - if (eqSet.size > 1) + if (eqSet.size > 1) { return null + } let gtltComp if (gt && lt) { gtltComp = compare(gt.semver, lt.semver, options) - if (gtltComp > 0) + if (gtltComp > 0) { return null - else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) + } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) { return null + } } // will iterate one or zero times for (const eq of eqSet) { - if (gt && !satisfies(eq, String(gt), options)) + if (gt && !satisfies(eq, String(gt), options)) { return null + } - if (lt && !satisfies(eq, String(lt), options)) + if (lt && !satisfies(eq, String(lt), options)) { return null + } for (const c of dom) { - if (!satisfies(eq, String(c), options)) + if (!satisfies(eq, String(c), options)) { return false + } } return true @@ -154,10 +166,12 @@ const simpleSubset = (sub, dom, options) => { } if (c.operator === '>' || c.operator === '>=') { higher = higherGT(gt, c, options) - if (higher === c && higher !== gt) + if (higher === c && higher !== gt) { return false - } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) + } + } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) { return false + } } if (lt) { if (needDomLTPre) { @@ -170,37 +184,44 @@ const simpleSubset = (sub, dom, options) => { } if (c.operator === '<' || c.operator === '<=') { lower = lowerLT(lt, c, options) - if (lower === c && lower !== lt) + if (lower === c && lower !== lt) { return false - } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) + } + } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) { return false + } } - if (!c.operator && (lt || gt) && gtltComp !== 0) + if (!c.operator && (lt || gt) && gtltComp !== 0) { return false + } } // if there was a < or >, and nothing in the dom, then must be false // UNLESS it was limited by another range in the other direction. // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 - if (gt && hasDomLT && !lt && gtltComp !== 0) + if (gt && hasDomLT && !lt && gtltComp !== 0) { return false + } - if (lt && hasDomGT && !gt && gtltComp !== 0) + if (lt && hasDomGT && !gt && gtltComp !== 0) { return false + } // we needed a prerelease range in a specific tuple, but didn't get one // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, // because it includes prereleases in the 1.2.3 tuple - if (needDomGTPre || needDomLTPre) + if (needDomGTPre || needDomLTPre) { return false + } return true } // >=1.2.3 is lower than >1.2.3 const higherGT = (a, b, options) => { - if (!a) + if (!a) { return b + } const comp = compare(a.semver, b.semver, options) return comp > 0 ? a : comp < 0 ? b @@ -210,8 +231,9 @@ const higherGT = (a, b, options) => { // <=1.2.3 is higher than <1.2.3 const lowerLT = (a, b, options) => { - if (!a) + if (!a) { return b + } const comp = compare(a.semver, b.semver, options) return comp < 0 ? a : comp > 0 ? b diff --git a/node_modules/ssri/LICENSE.md b/node_modules/ssri/LICENSE.md index 8d28acf866d93..e335388869f50 100644 --- a/node_modules/ssri/LICENSE.md +++ b/node_modules/ssri/LICENSE.md @@ -1,6 +1,6 @@ ISC License -Copyright (c) npm, Inc. +Copyright 2021 (c) npm, Inc. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the diff --git a/node_modules/ssri/index.js b/node_modules/ssri/lib/index.js similarity index 91% rename from node_modules/ssri/index.js rename to node_modules/ssri/lib/index.js index 2b309849c012a..e2732fd072b12 100644 --- a/node_modules/ssri/index.js +++ b/node_modules/ssri/lib/index.js @@ -19,7 +19,7 @@ const defaultOpts = { pickAlgorithm: getPrioritizedHash, sep: ' ', single: false, - strict: false + strict: false, } const ssriOpts = (opts = {}) => ({ ...defaultOpts, ...opts }) @@ -51,7 +51,7 @@ class IntegrityStream extends MiniPass { const { integrity, size, - options + options, } = { ...defaultOpts, ...this.opts } // For verification @@ -64,7 +64,9 @@ class IntegrityStream extends MiniPass { } emit (ev, data) { - if (ev === 'end') this[_onEnd]() + if (ev === 'end') { + this[_onEnd]() + } return super.emit(ev, data) } @@ -84,6 +86,7 @@ class IntegrityStream extends MiniPass { // Integrity verification mode const match = this.goodSri && newSri.match(this.sri, this.opts) if (typeof this.expectedSize === 'number' && this.size !== this.expectedSize) { + /* eslint-disable-next-line max-len */ const err = new Error(`stream size mismatch when checking ${this.sri}.\n Wanted: ${this.expectedSize}\n Found: ${this.size}`) err.code = 'EBADSIZE' err.found = this.size @@ -91,6 +94,7 @@ class IntegrityStream extends MiniPass { err.sri = this.sri this.emit('error', err) } else if (this.sri && !match) { + /* eslint-disable-next-line max-len */ const err = new Error(`${this.sri} integrity checksum failed when using ${this.algorithm}: wanted ${this.digests} but got ${newSri}. (${this.size} bytes)`) err.code = 'EINTEGRITY' err.found = newSri @@ -107,7 +111,10 @@ class IntegrityStream extends MiniPass { } class Hash { - get isHash () { return true } + get isHash () { + return true + } + constructor (hash, opts) { opts = ssriOpts(opts) const strict = !!opts.strict @@ -126,8 +133,12 @@ class Hash { ? STRICT_SRI_REGEX : SRI_REGEX ) - if (!match) { return } - if (strict && !SPEC_ALGORITHMS.some(a => a === match[1])) { return } + if (!match) { + return + } + if (strict && !SPEC_ALGORITHMS.some(a => a === match[1])) { + return + } this.algorithm = match[1] this.digest = match[2] @@ -175,7 +186,10 @@ class Hash { } class Integrity { - get isIntegrity () { return true } + get isIntegrity () { + return true + } + toJSON () { return this.toString() } @@ -255,7 +269,9 @@ class Integrity { module.exports.parse = parse function parse (sri, opts) { - if (!sri) return null + if (!sri) { + return null + } opts = ssriOpts(opts) if (typeof sri === 'string') { return _parse(sri, opts) @@ -278,7 +294,9 @@ function _parse (integrity, opts) { const hash = new Hash(string, opts) if (hash.algorithm && hash.digest) { const algo = hash.algorithm - if (!acc[algo]) { acc[algo] = [] } + if (!acc[algo]) { + acc[algo] = [] + } acc[algo].push(hash) } return acc @@ -324,9 +342,11 @@ function fromData (data, opts) { * just calculated with an algo did not have an algo or digest. */ if (hash.algorithm && hash.digest) { - const algo = hash.algorithm - if (!acc[algo]) { acc[algo] = [] } - acc[algo].push(hash) + const hashAlgo = hash.algorithm + if (!acc[hashAlgo]) { + acc[hashAlgo] = [] + } + acc[hashAlgo].push(hash) } return acc }, new Integrity()) @@ -341,7 +361,9 @@ function fromStream (stream, opts) { stream.on('error', reject) istream.on('error', reject) let sri - istream.on('integrity', s => { sri = s }) + istream.on('integrity', s => { + sri = s + }) istream.on('end', () => resolve(sri)) istream.on('data', () => {}) }) @@ -355,7 +377,7 @@ function checkData (data, sri, opts) { if (opts.error) { throw Object.assign( new Error('No valid integrity hashes to check against'), { - code: 'EINTEGRITY' + code: 'EINTEGRITY', } ) } else { @@ -369,6 +391,7 @@ function checkData (data, sri, opts) { if (match || !opts.error) { return match } else if (typeof opts.size === 'number' && (data.length !== opts.size)) { + /* eslint-disable-next-line max-len */ const err = new Error(`data size mismatch when checking ${sri}.\n Wanted: ${opts.size}\n Found: ${data.length}`) err.code = 'EBADSIZE' err.found = data.length @@ -376,6 +399,7 @@ function checkData (data, sri, opts) { err.sri = sri throw err } else { + /* eslint-disable-next-line max-len */ const err = new Error(`Integrity checksum failed when using ${algorithm}: Wanted ${sri}, but got ${newSri}. (${data.length} bytes)`) err.code = 'EINTEGRITY' err.found = newSri @@ -394,7 +418,7 @@ function checkStream (stream, sri, opts) { if (!sri || !Object.keys(sri).length) { return Promise.reject(Object.assign( new Error('No valid integrity hashes to check against'), { - code: 'EINTEGRITY' + code: 'EINTEGRITY', } )) } @@ -403,9 +427,11 @@ function checkStream (stream, sri, opts) { stream.pipe(checker) stream.on('error', reject) checker.on('error', reject) - let sri - checker.on('verified', s => { sri = s }) - checker.on('end', () => resolve(sri)) + let verified + checker.on('verified', s => { + verified = s + }) + checker.on('end', () => resolve(verified)) checker.on('data', () => {}) }) } @@ -439,15 +465,17 @@ function createIntegrity (opts) { * just calculated with an algo did not have an algo or digest. */ if (hash.algorithm && hash.digest) { - const algo = hash.algorithm - if (!acc[algo]) { acc[algo] = [] } - acc[algo].push(hash) + const hashAlgo = hash.algorithm + if (!acc[hashAlgo]) { + acc[hashAlgo] = [] + } + acc[hashAlgo].push(hash) } return acc }, new Integrity()) return integrity - } + }, } } @@ -460,10 +488,11 @@ const DEFAULT_PRIORITY = [ // for the algorithm, so we guesswork it based on the OpenSSL names. 'sha3', 'sha3-256', 'sha3-384', 'sha3-512', - 'sha3_256', 'sha3_384', 'sha3_512' + 'sha3_256', 'sha3_384', 'sha3_512', ].filter(algo => NODE_HASHES.has(algo)) function getPrioritizedHash (algo1, algo2) { + /* eslint-disable-next-line max-len */ return DEFAULT_PRIORITY.indexOf(algo1.toLowerCase()) >= DEFAULT_PRIORITY.indexOf(algo2.toLowerCase()) ? algo1 : algo2 diff --git a/node_modules/ssri/package.json b/node_modules/ssri/package.json index 4af1a3c4c2e4f..84448afc3cf04 100644 --- a/node_modules/ssri/package.json +++ b/node_modules/ssri/package.json @@ -1,23 +1,34 @@ { "name": "ssri", - "version": "8.0.1", + "version": "9.0.0", "description": "Standard Subresource Integrity library -- parses, serializes, generates, and verifies integrity metadata according to the SRI spec.", - "main": "index.js", - "files": [], + "main": "lib/index.js", + "files": [ + "bin/", + "lib/" + ], "scripts": { "prerelease": "npm t", "postrelease": "npm publish", - "prepublishOnly": "git push --follow-tags", + "prepublishOnly": "git push origin --follow-tags", "posttest": "npm run lint", - "release": "standard-version -s", "test": "tap", "coverage": "tap", - "lint": "standard" + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "preversion": "npm test", + "postversion": "npm publish", + "snap": "tap" }, "tap": { "check-coverage": true }, - "repository": "https://github.com/npm/ssri", + "repository": { + "type": "git", + "url": "https://github.com/npm/ssri.git" + }, "keywords": [ "w3c", "web", @@ -32,21 +43,21 @@ "sri generator", "html" ], - "author": { - "name": "Kat Marchán", - "email": "kzm@sykosomatic.org", - "twitter": "maybekatz" - }, + "author": "GitHub Inc.", "license": "ISC", "dependencies": { "minipass": "^3.1.1" }, "devDependencies": { - "standard": "^16.0.3", - "standard-version": "^9.1.0", - "tap": "^14.10.6" + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.2.2", + "tap": "^16.0.1" }, "engines": { - "node": ">= 8" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.2.2" } } diff --git a/node_modules/treeverse/index.js b/node_modules/treeverse/index.js deleted file mode 100644 index ca0229e02c90f..0000000000000 --- a/node_modules/treeverse/index.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - breadth: require('./lib/breadth.js'), - depth: require('./lib/depth.js'), -} diff --git a/node_modules/treeverse/lib/breadth.js b/node_modules/treeverse/lib/breadth.js index 56c02ec627c8c..6681f8cf7d623 100644 --- a/node_modules/treeverse/lib/breadth.js +++ b/node_modules/treeverse/lib/breadth.js @@ -28,27 +28,28 @@ const breadth = ({ return seen.get(tree) } - const visitNode = (tree) => { - if (seen.has(tree)) - return seen.get(tree) + const visitNode = (visitTree) => { + if (seen.has(visitTree)) { + return seen.get(visitTree) + } - seen.set(tree, null) - const res = visit ? visit(tree) : tree + seen.set(visitTree, null) + const res = visit ? visit(visitTree) : visitTree if (isPromise(res)) { - const fullResult = res.then(res => { - seen.set(tree, res) - return kidNodes(tree) + const fullResult = res.then(resThen => { + seen.set(visitTree, resThen) + return kidNodes(visitTree) }) - seen.set(tree, fullResult) + seen.set(visitTree, fullResult) return fullResult } else { - seen.set(tree, res) - return kidNodes(tree) + seen.set(visitTree, res) + return kidNodes(visitTree) } } - const kidNodes = (tree) => { - const kids = getChildren(tree, seen.get(tree)) + const kidNodes = (kidTree) => { + const kids = getChildren(kidTree, seen.get(kidTree)) return isPromise(kids) ? kids.then(processKids) : processKids(kids) } diff --git a/node_modules/treeverse/lib/depth-descent.js b/node_modules/treeverse/lib/depth-descent.js index 8ac3af014ebf9..361d6bf342f1b 100644 --- a/node_modules/treeverse/lib/depth-descent.js +++ b/node_modules/treeverse/lib/depth-descent.js @@ -49,27 +49,28 @@ const depth = ({ return seen.get(tree) } - const visitNode = (tree) => { - if (seen.has(tree)) - return seen.get(tree) + const visitNode = (visitTree) => { + if (seen.has(visitTree)) { + return seen.get(visitTree) + } - seen.set(tree, null) - const res = visit ? visit(tree) : tree + seen.set(visitTree, null) + const res = visit ? visit(visitTree) : visitTree if (isPromise(res)) { - const fullResult = res.then(res => { - seen.set(tree, res) - return kidNodes(tree) + const fullResult = res.then(resThen => { + seen.set(visitTree, resThen) + return kidNodes(visitTree) }) - seen.set(tree, fullResult) + seen.set(visitTree, fullResult) return fullResult } else { - seen.set(tree, res) - return kidNodes(tree) + seen.set(visitTree, res) + return kidNodes(visitTree) } } - const kidNodes = (tree) => { - const kids = getChildren(tree, seen.get(tree)) + const kidNodes = (kidTree) => { + const kids = getChildren(kidTree, seen.get(kidTree)) return isPromise(kids) ? kids.then(processKids) : processKids(kids) } diff --git a/node_modules/treeverse/lib/depth.js b/node_modules/treeverse/lib/depth.js index dbab1c28a2d15..ecd138811ae03 100644 --- a/node_modules/treeverse/lib/depth.js +++ b/node_modules/treeverse/lib/depth.js @@ -23,19 +23,21 @@ const depth = ({ getChildren, tree, }) => { - if (!leave) + if (!leave) { return depthDescent({ visit, filter, getChildren, tree }) + } - if (seen.has(tree)) + if (seen.has(tree)) { return seen.get(tree) + } seen.set(tree, null) const visitNode = () => { const res = visit ? visit(tree) : tree if (isPromise(res)) { - const fullResult = res.then(res => { - seen.set(tree, res) + const fullResult = res.then(resThen => { + seen.set(tree, resThen) return kidNodes() }) seen.set(tree, fullResult) @@ -51,9 +53,9 @@ const depth = ({ return isPromise(kids) ? kids.then(processKids) : processKids(kids) } - const processKids = kidNodes => { - const kids = (kidNodes || []).filter(filter).map(kid => - depth({visit, leave, filter, seen, getChildren, tree: kid})) + const processKids = nodes => { + const kids = (nodes || []).filter(filter).map(kid => + depth({ visit, leave, filter, seen, getChildren, tree: kid })) return kids.some(isPromise) ? Promise.all(kids).then(leaveNode) : leaveNode(kids) diff --git a/node_modules/treeverse/lib/index.js b/node_modules/treeverse/lib/index.js new file mode 100644 index 0000000000000..f8e631578bcc9 --- /dev/null +++ b/node_modules/treeverse/lib/index.js @@ -0,0 +1,4 @@ +module.exports = { + breadth: require('./breadth.js'), + depth: require('./depth.js'), +} diff --git a/node_modules/treeverse/package.json b/node_modules/treeverse/package.json index 337194cfde970..97269b335fc4b 100644 --- a/node_modules/treeverse/package.json +++ b/node_modules/treeverse/package.json @@ -1,37 +1,51 @@ { "name": "treeverse", - "version": "1.0.4", + "version": "2.0.0", "description": "Walk any kind of tree structure depth- or breadth-first. Supports promises and advanced map-reduce operations with a very small API.", - "author": "Isaac Z. Schlueter (https://izs.me)", + "author": "GitHub Inc.", "license": "ISC", "repository": { "type": "git", - "url": "git+https://github.com/npm/treeverse.git" + "url": "https://github.com/npm/treeverse.git" }, "scripts": { "test": "tap", "snap": "tap", "preversion": "npm test", "postversion": "npm publish", - "postpublish": "git push origin --follow-tags" + "postpublish": "git push origin --follow-tags", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "template-oss-apply": "template-oss-apply --force", + "lintfix": "npm run lint -- --fix", + "prepublishOnly": "git push origin --follow-tags", + "posttest": "npm run lint" }, "tap": { "100": true, - "coverage-map": "map.js" + "coverage-map": "test/coverage-map.js" }, "devDependencies": { - "tap": "^14.10.6", - "tcompare": "^2.3.0" + "@npmcli/eslint-config": "^3.0.1", + "@npmcli/template-oss": "3.2.2", + "tap": "^16.0.1" }, "files": [ - "index.js", + "bin/", "lib/" ], - "main": "index.js", + "main": "lib/index.js", "keywords": [ "tree", "traversal", "depth first search", "breadth first search" - ] + ], + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + }, + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "3.2.2" + } } diff --git a/package-lock.json b/package-lock.json index 6e7d2bb06ac7e..5ba283cdecff9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "npm", - "version": "8.5.5", + "version": "8.6.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "npm", - "version": "8.5.5", + "version": "8.6.0", "bundleDependencies": [ "@isaacs/string-locale-compare", "@npmcli/arborist", @@ -88,18 +88,18 @@ ], "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", - "@npmcli/arborist": "^5.0.3", + "@npmcli/arborist": "^5.0.4", "@npmcli/ci-detect": "^2.0.0", - "@npmcli/config": "^4.0.1", + "@npmcli/config": "^4.0.2", "@npmcli/fs": "^2.1.0", "@npmcli/map-workspaces": "^2.0.2", - "@npmcli/package-json": "^1.0.1", + "@npmcli/package-json": "^2.0.0", "@npmcli/run-script": "^3.0.1", "abbrev": "~1.1.1", "ansicolors": "~0.3.2", "ansistyles": "~0.1.3", "archy": "~1.0.0", - "cacache": "^16.0.3", + "cacache": "^16.0.4", "chalk": "^4.1.2", "chownr": "^2.0.0", "cli-columns": "^4.0.0", @@ -107,9 +107,9 @@ "columnify": "^1.6.0", "fastest-levenshtein": "^1.0.12", "glob": "^7.2.0", - "graceful-fs": "^4.2.9", + "graceful-fs": "^4.2.10", "hosted-git-info": "^5.0.0", - "ini": "^2.0.0", + "ini": "^3.0.0", "init-package-json": "^3.0.2", "is-cidr": "^4.0.2", "json-parse-even-better-errors": "^2.3.1", @@ -124,7 +124,7 @@ "libnpmsearch": "^5.0.2", "libnpmteam": "^4.0.2", "libnpmversion": "^3.0.1", - "make-fetch-happen": "^10.1.1", + "make-fetch-happen": "^10.1.2", "minipass": "^3.1.6", "minipass-pipeline": "^1.2.4", "mkdirp": "^1.0.4", @@ -133,15 +133,15 @@ "node-gyp": "^9.0.0", "nopt": "^5.0.0", "npm-audit-report": "^3.0.0", - "npm-install-checks": "^4.0.0", - "npm-package-arg": "^9.0.1", - "npm-pick-manifest": "^7.0.0", + "npm-install-checks": "^5.0.0", + "npm-package-arg": "^9.0.2", + "npm-pick-manifest": "^7.0.1", "npm-profile": "^6.0.2", "npm-registry-fetch": "^13.1.0", "npm-user-validate": "^1.0.1", "npmlog": "^6.0.1", "opener": "^1.5.2", - "pacote": "^13.0.5", + "pacote": "^13.1.1", "parse-conflict-json": "^2.0.2", "proc-log": "^2.0.1", "qrcode-terminal": "^0.12.0", @@ -150,12 +150,12 @@ "read-package-json-fast": "^2.0.3", "readdir-scoped-modules": "^1.1.0", "rimraf": "^3.0.2", - "semver": "^7.3.5", - "ssri": "^8.0.1", + "semver": "^7.3.6", + "ssri": "^9.0.0", "tar": "^6.1.11", "text-table": "~0.2.0", "tiny-relative-date": "^1.3.0", - "treeverse": "^1.0.4", + "treeverse": "^2.0.0", "validate-npm-package-name": "^4.0.0", "which": "^2.0.2", "write-file-atomic": "^4.0.1" @@ -166,11 +166,11 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "licensee": "^8.2.0", "nock": "^13.2.4", "spawk": "^1.7.1", - "tap": "^15.2.3" + "tap": "^16.0.1" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16" @@ -183,12 +183,13 @@ "@mdx-js/mdx": "^1.6.22", "@npmcli/eslint-config": "^3.0.1", "@npmcli/fs": "^2.1.0", - "@npmcli/promise-spawn": "^1.3.2", - "@npmcli/template-oss": "3.2.2", + "@npmcli/promise-spawn": "^3.0.0", + "@npmcli/template-oss": "3.3.2", "cmark-gfm": "^0.9.0", "jsdom": "^18.1.0", "marked-man": "^0.7.0", - "tap": "^15.2.3", + "tap": "^16.0.1", + "which": "^2.0.2", "yaml": "^1.10.0" }, "engines": { @@ -593,6 +594,17 @@ "license": "Python-2.0", "peer": true }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "peer": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "node_modules/@eslint/eslintrc/node_modules/globals": { "version": "13.13.0", "dev": true, @@ -620,6 +632,19 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "peer": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/@eslint/eslintrc/node_modules/type-fest": { "version": "0.20.2", "dev": true, @@ -651,6 +676,30 @@ "node": ">=10.10.0" } }, + "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "peer": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "peer": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/@humanwhocodes/object-schema": { "version": "1.2.1", "dev": true, @@ -809,12 +858,13 @@ } }, "node_modules/@npmcli/config": { - "version": "4.0.1", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/config/-/config-4.0.2.tgz", + "integrity": "sha512-UqD4h4LgyNOb7xRmAK7QXiMu0/k2x7wEzrEqXZ1wGIQVmCl3vamsAprDjAhi7IKlgRulg09hpwYs2/57OP22xw==", "inBundle": true, - "license": "ISC", "dependencies": { - "@npmcli/map-workspaces": "^2.0.1", - "ini": "^2.0.0", + "@npmcli/map-workspaces": "^2.0.2", + "ini": "^3.0.0", "mkdirp-infer-owner": "^2.0.0", "nopt": "^5.0.0", "proc-log": "^2.0.0", @@ -823,17 +873,18 @@ "walk-up-path": "^1.0.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/@npmcli/disparity-colors": { - "version": "1.0.1", - "license": "ISC", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/disparity-colors/-/disparity-colors-2.0.0.tgz", + "integrity": "sha512-FFXGrIjhvd2qSZ8iS0yDvbI7nbjdyT2VNO7wotosjYZM2p2r8PN3B7Om3M5NO9KqW/OVzfzLB3L0V5Vo5QXC7A==", "dependencies": { "ansi-styles": "^4.3.0" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/@npmcli/eslint-config": { @@ -869,12 +920,13 @@ } }, "node_modules/@npmcli/git": { - "version": "3.0.0", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-3.0.1.tgz", + "integrity": "sha512-UU85F/T+F1oVn3IsB/L6k9zXIMpXBuUBE25QDH0SsURwT6IOBqkC7M16uqo2vVZIyji3X1K4XH9luip7YekH1A==", "inBundle": true, - "license": "ISC", "dependencies": { - "@npmcli/promise-spawn": "^1.3.2", - "lru-cache": "^7.3.1", + "@npmcli/promise-spawn": "^3.0.0", + "lru-cache": "^7.4.4", "mkdirp": "^1.0.4", "npm-pick-manifest": "^7.0.0", "proc-log": "^2.0.0", @@ -884,7 +936,7 @@ "which": "^2.0.2" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/@npmcli/installed-package-contents": { @@ -916,28 +968,10 @@ "node": "^12.13.0 || ^14.15.0 || >=16" } }, - "node_modules/@npmcli/map-workspaces/node_modules/brace-expansion": { - "version": "2.0.1", - "inBundle": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/@npmcli/map-workspaces/node_modules/minimatch": { - "version": "5.0.1", - "inBundle": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/@npmcli/metavuln-calculator": { - "version": "3.0.1", - "license": "ISC", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@npmcli/metavuln-calculator/-/metavuln-calculator-3.1.0.tgz", + "integrity": "sha512-Q5fbQqGDlYqk7kWrbg6E2j/mtqQjZop0ZE6735wYA1tYNHguIDjAuWs+kFb5rJCkLIlXllfapvsyotYKiZOTBA==", "dependencies": { "cacache": "^16.0.0", "json-parse-even-better-errors": "^2.3.1", @@ -945,19 +979,20 @@ "semver": "^7.3.5" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/@npmcli/move-file": { - "version": "1.1.2", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-2.0.0.tgz", + "integrity": "sha512-UR6D5f4KEGWJV6BGPH3Qb2EtgH+t+1XQ1Tt85c7qicN6cezzuHPdZwwAxqZr4JLtnQu0LZsTza/5gmNmSl8XLg==", "inBundle": true, - "license": "MIT", "dependencies": { "mkdirp": "^1.0.4", "rimraf": "^3.0.2" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/@npmcli/name-from-folder": { @@ -966,52 +1001,64 @@ "license": "ISC" }, "node_modules/@npmcli/node-gyp": { - "version": "1.0.3", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-2.0.0.tgz", + "integrity": "sha512-doNI35wIe3bBaEgrlPfdJPaCpUR89pJWep4Hq3aRdh6gKazIVWfs0jHttvSSoq47ZXgC7h73kDsUl8AoIQUB+A==", "inBundle": true, - "license": "ISC" + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } }, "node_modules/@npmcli/package-json": { - "version": "1.0.1", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/package-json/-/package-json-2.0.0.tgz", + "integrity": "sha512-42jnZ6yl16GzjWSH7vtrmWyJDGVa/LXPdpN2rcUWolFjc9ON2N3uz0qdBbQACfmhuJZ2lbKYtmK5qx68ZPLHMA==", "inBundle": true, - "license": "ISC", "dependencies": { "json-parse-even-better-errors": "^2.3.1" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/@npmcli/promise-spawn": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-1.3.2.tgz", - "integrity": "sha512-QyAGYo/Fbj4MXeGdJcFzZ+FkDkomfRBrPM+9QYJSg+PxgAUL+LU3FneQk37rKR2/zjqkCV1BLHccX98wRXG3Sg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-3.0.0.tgz", + "integrity": "sha512-s9SgS+p3a9Eohe68cSI3fi+hpcZUmXq5P7w0kMlAsWVtR7XbK3ptkZqKT2cK1zLDObJ3sR+8P59sJE0w/KTL1g==", "inBundle": true, "dependencies": { "infer-owner": "^1.0.4" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/@npmcli/run-script": { - "version": "3.0.1", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-3.0.2.tgz", + "integrity": "sha512-vdjD/PMBl+OX9j9C9irx5sCCIKfp2PWkpPNH9zxvlJAfSZ3Qp5aU412v+O3PFJl3R1PFNwuyChCqHg4ma6ci2Q==", "inBundle": true, - "license": "ISC", "dependencies": { - "@npmcli/node-gyp": "^1.0.3", - "@npmcli/promise-spawn": "^1.3.2", + "@npmcli/node-gyp": "^2.0.0", + "@npmcli/promise-spawn": "^3.0.0", "node-gyp": "^9.0.0", "read-package-json-fast": "^2.0.3" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/@npmcli/template-oss": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/@npmcli/template-oss/-/template-oss-3.2.2.tgz", - "integrity": "sha512-jhqthwI5OvhXRuShc87gpDuu5JCbKT7ByEsXrYkW+aaRLvniGwiX/7GNjEPX2Jt7B+5lLG66MVqc+A8MMpdWSA==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/@npmcli/template-oss/-/template-oss-3.3.2.tgz", + "integrity": "sha512-dxuO704qWTeSt5ievjNRhOB7VB6Mqv66wCaazOksLlAs3CittiCG0P0YWKhXojptNrOET/mGj6ltZV/A/QdGfw==", "dev": true, "hasInstallScript": true, "dependencies": { "@npmcli/fs": "^2.0.1", "@npmcli/git": "^3.0.0", "@npmcli/map-workspaces": "^2.0.2", - "@npmcli/package-json": "^1.0.1", + "@npmcli/package-json": "^2.0.0", "diff": "^5.0.0", "handlebars": "^4.7.7", "hosted-git-info": "^5.0.0", @@ -1161,6 +1208,7 @@ "version": "6.12.6", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -1281,6 +1329,8 @@ "version": "0.2.4", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "safer-buffer": "~2.1.0" } @@ -1289,6 +1339,8 @@ "version": "1.0.0", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "engines": { "node": ">=0.8" } @@ -1310,6 +1362,8 @@ "version": "0.7.0", "dev": true, "license": "Apache-2.0", + "optional": true, + "peer": true, "engines": { "node": "*" } @@ -1317,7 +1371,9 @@ "node_modules/aws4": { "version": "1.11.0", "dev": true, - "license": "MIT" + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/babel-plugin-apply-mdx-type-prop": { "version": "1.6.22", @@ -1368,8 +1424,9 @@ }, "node_modules/balanced-match": { "version": "1.0.2", - "inBundle": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "inBundle": true }, "node_modules/base64-js": { "version": "1.5.1", @@ -1394,6 +1451,8 @@ "version": "1.0.2", "dev": true, "license": "BSD-3-Clause", + "optional": true, + "peer": true, "dependencies": { "tweetnacl": "^0.14.3" } @@ -1408,18 +1467,19 @@ } }, "node_modules/bin-links": { - "version": "3.0.0", - "license": "ISC", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/bin-links/-/bin-links-3.0.1.tgz", + "integrity": "sha512-9vx+ypzVhASvHTS6K+YSGf7nwQdANoz7v6MTC0aCtYnOEZ87YvMf81aY737EZnGZdpbRM3sfWjO9oWkKmuIvyQ==", "dependencies": { - "cmd-shim": "^4.0.1", + "cmd-shim": "^5.0.0", "mkdirp-infer-owner": "^2.0.0", "npm-normalize-package-bin": "^1.0.0", - "read-cmd-shim": "^2.0.0", + "read-cmd-shim": "^3.0.0", "rimraf": "^3.0.0", "write-file-atomic": "^4.0.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/binary-extensions": { @@ -1456,12 +1516,12 @@ } }, "node_modules/brace-expansion": { - "version": "1.1.11", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "inBundle": true, - "license": "MIT", "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" } }, "node_modules/braces": { @@ -1518,12 +1578,13 @@ } }, "node_modules/cacache": { - "version": "16.0.3", + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.0.4.tgz", + "integrity": "sha512-U0D4wF3/W8ZgK4qDA5fTtOVSr0gaDfd5aa7tUdAV0uukVWKsAIn6SzXQCoVlg7RWZiJa+bcsM3/pXLumGaL2Ug==", "inBundle": true, - "license": "ISC", "dependencies": { "@npmcli/fs": "^2.1.0", - "@npmcli/move-file": "^1.1.2", + "@npmcli/move-file": "^2.0.0", "chownr": "^2.0.0", "fs-minipass": "^2.1.0", "glob": "^7.2.0", @@ -1537,7 +1598,7 @@ "p-map": "^4.0.0", "promise-inflight": "^1.0.1", "rimraf": "^3.0.2", - "ssri": "^8.0.1", + "ssri": "^9.0.0", "tar": "^6.1.11", "unique-filename": "^1.1.1" }, @@ -1623,7 +1684,9 @@ "node_modules/caseless": { "version": "0.12.0", "dev": true, - "license": "Apache-2.0" + "license": "Apache-2.0", + "optional": true, + "peer": true }, "node_modules/ccount": { "version": "1.1.0", @@ -1782,13 +1845,14 @@ } }, "node_modules/cmd-shim": { - "version": "4.1.0", - "license": "ISC", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-5.0.0.tgz", + "integrity": "sha512-qkCtZ59BidfEwHltnJwkyVZn+XQojdAySM1D1gSeh11Z4pW1Kpolkyo53L5noc0nrxmIvyFwTmJRo4xs7FFLPw==", "dependencies": { "mkdirp-infer-owner": "^2.0.0" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/code-point-at": { @@ -1884,8 +1948,9 @@ }, "node_modules/concat-map": { "version": "0.0.1", - "inBundle": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "inBundle": true }, "node_modules/console-control-strings": { "version": "1.1.0", @@ -1922,6 +1987,8 @@ "version": "3.1.1", "dev": true, "license": "BSD-2-Clause", + "optional": true, + "peer": true, "dependencies": { "js-yaml": "^3.13.1", "lcov-parse": "^1.0.0", @@ -1974,6 +2041,8 @@ "version": "1.14.1", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "assert-plus": "^1.0.0" }, @@ -2143,9 +2212,10 @@ } }, "node_modules/dezalgo": { - "version": "1.0.3", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz", + "integrity": "sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==", "inBundle": true, - "license": "ISC", "dependencies": { "asap": "^2.0.0", "wrappy": "1" @@ -2196,6 +2266,8 @@ "version": "0.1.2", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" @@ -2469,6 +2541,30 @@ "eslint": ">=5.16.0" } }, + "node_modules/eslint-plugin-node/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "peer": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint-plugin-node/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "peer": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/eslint-plugin-node/node_modules/semver": { "version": "6.3.0", "dev": true, @@ -2530,6 +2626,17 @@ "license": "Python-2.0", "peer": true }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "peer": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "node_modules/eslint/node_modules/eslint-utils": { "version": "3.0.0", "dev": true, @@ -2596,6 +2703,19 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "peer": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/eslint/node_modules/type-fest": { "version": "0.20.2", "dev": true, @@ -2710,17 +2830,21 @@ "engines": [ "node >=0.6.0" ], - "license": "MIT" + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/fast-deep-equal": { "version": "3.1.3", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/fast-levenshtein": { "version": "2.0.6", @@ -2920,6 +3044,8 @@ "version": "0.6.1", "dev": true, "license": "Apache-2.0", + "optional": true, + "peer": true, "engines": { "node": "*" } @@ -3095,6 +3221,8 @@ "version": "0.1.7", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "assert-plus": "^1.0.0" } @@ -3134,6 +3262,28 @@ "node": ">= 6" } }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "inBundle": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "inBundle": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/globals": { "version": "11.12.0", "dev": true, @@ -3143,9 +3293,10 @@ } }, "node_modules/graceful-fs": { - "version": "4.2.9", - "inBundle": true, - "license": "ISC" + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "inBundle": true }, "node_modules/handlebars": { "version": "4.7.7", @@ -3181,6 +3332,8 @@ "version": "2.0.0", "dev": true, "license": "ISC", + "optional": true, + "peer": true, "engines": { "node": ">=4" } @@ -3189,6 +3342,8 @@ "version": "5.1.5", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "ajv": "^6.12.3", "har-schema": "^2.0.0" @@ -3424,6 +3579,8 @@ "version": "1.2.0", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "assert-plus": "^1.0.0", "jsprim": "^1.2.2", @@ -3496,14 +3653,15 @@ } }, "node_modules/ignore-walk": { - "version": "4.0.1", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-5.0.1.tgz", + "integrity": "sha512-yemi4pMf51WKT7khInJqAvsIGzoqYXblnsz0ql8tM+yi1EKYTY1evX4NAbJrLL/Aanr2HyZeluqU+Oi7MGHokw==", "inBundle": true, - "license": "ISC", "dependencies": { - "minimatch": "^3.0.4" + "minimatch": "^5.0.1" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/import-fresh": { @@ -3558,11 +3716,12 @@ "license": "ISC" }, "node_modules/ini": { - "version": "2.0.0", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-3.0.0.tgz", + "integrity": "sha512-TxYQaeNW/N8ymDvwAxPyRbhMBtnEwuvaTYpOQkFx1nSeusgezHniEc/l35Vo4iCq/mMiTJbpD7oYxN98hFlfmw==", "inBundle": true, - "license": "ISC", "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/init-package-json": { @@ -3955,7 +4114,9 @@ "node_modules/isstream": { "version": "0.1.2", "dev": true, - "license": "MIT" + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/istanbul-lib-coverage": { "version": "3.2.0", @@ -4103,7 +4264,9 @@ "node_modules/jsbn": { "version": "0.1.1", "dev": true, - "license": "MIT" + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/jsdom": { "version": "18.1.1", @@ -4185,12 +4348,15 @@ "node_modules/json-schema": { "version": "0.4.0", "dev": true, - "license": "(AFL-2.1 OR BSD-3-Clause)" + "license": "(AFL-2.1 OR BSD-3-Clause)", + "optional": true, + "peer": true }, "node_modules/json-schema-traverse": { "version": "0.4.1", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", @@ -4233,6 +4399,8 @@ "version": "1.4.2", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", @@ -4257,6 +4425,8 @@ "version": "1.0.0", "dev": true, "license": "BSD-3-Clause", + "optional": true, + "peer": true, "bin": { "lcov-parse": "bin/cli.js" } @@ -4420,14 +4590,17 @@ "version": "1.2.7", "dev": true, "license": "ISC", - "engines": { + "optional": true, + "peer": true, + "engines": { "node": ">=0.8.6" } }, "node_modules/lru-cache": { - "version": "7.7.1", + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.7.3.tgz", + "integrity": "sha512-WY9wjJNQt9+PZilnLbuFKM+SwDull9+6IAguOrarOMoOHTcJ9GnXSO11+Gw6c7xtDkBkthR57OZMtZKYr+1CEw==", "inBundle": true, - "license": "ISC", "engines": { "node": ">=12" } @@ -4462,9 +4635,9 @@ "peer": true }, "node_modules/make-fetch-happen": { - "version": "10.1.1", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.1.1.tgz", - "integrity": "sha512-3/mCljDQNjmrP7kl0vhS5WVlV+TvSKoZaFhdiYV7MOijEnrhrjaVnqbp/EY/7S+fhUB2KpH7j8c1iRsIOs+kjw==", + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.1.2.tgz", + "integrity": "sha512-GWMGiZsKVeJACQGJ1P3Z+iNec7pLsU6YW1q11eaPn3RR8nRXHppFWfP7Eu0//55JK3hSjrAQRl8sDa5uXpq1Ew==", "inBundle": true, "dependencies": { "agentkeepalive": "^4.2.1", @@ -4482,7 +4655,7 @@ "negotiator": "^0.6.3", "promise-retry": "^2.0.1", "socks-proxy-agent": "^6.1.1", - "ssri": "^8.0.1" + "ssri": "^9.0.0" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16.0.0" @@ -4604,14 +4777,15 @@ "license": "ISC" }, "node_modules/minimatch": { - "version": "3.1.2", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", "inBundle": true, - "license": "ISC", "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=10" } }, "node_modules/minimist": { @@ -4910,14 +5084,15 @@ } }, "node_modules/npm-install-checks": { - "version": "4.0.0", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-5.0.0.tgz", + "integrity": "sha512-65lUsMI8ztHCxFz5ckCEC44DRvEGdZX5usQFriauxHEwt7upv1FKaQEmAtU0YnOAdwuNWCmk64xYiQABNrEyLA==", "inBundle": true, - "license": "BSD-2-Clause", "dependencies": { "semver": "^7.1.1" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm-license-corrections": { @@ -4931,11 +5106,10 @@ "license": "ISC" }, "node_modules/npm-package-arg": { - "version": "9.0.1", + "version": "9.0.2", "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.0.2.tgz", "integrity": "sha512-v/miORuX8cndiOheW8p2moNuPJ7QhcFh9WGlTorruG8hXSA23vMTEp5hTCmDxic0nD8KHhj/NQgFuySD3GYY3g==", "inBundle": true, - "license": "ISC", "dependencies": { "hosted-git-info": "^5.0.0", "semver": "^7.3.5", @@ -4946,12 +5120,13 @@ } }, "node_modules/npm-packlist": { - "version": "4.0.0", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-5.0.0.tgz", + "integrity": "sha512-uU20UwM4Hogfab1Q7htJbhcyafM9lGHxOrDjkKvR2S3z7Ds0uRaESk0cXctczk+ABT4DZWNwjB10xlurFdEwZg==", "inBundle": true, - "license": "ISC", "dependencies": { "glob": "^7.2.0", - "ignore-walk": "^4.0.1", + "ignore-walk": "^5.0.1", "npm-bundled": "^1.1.2", "npm-normalize-package-bin": "^1.0.1" }, @@ -4959,21 +5134,22 @@ "npm-packlist": "bin/index.js" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm-pick-manifest": { - "version": "7.0.0", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-7.0.1.tgz", + "integrity": "sha512-IA8+tuv8KujbsbLQvselW2XQgmXWS47t3CB0ZrzsRZ82DbDfkcFunOaPm4X7qNuhMfq+FmV7hQT4iFVpHqV7mg==", "inBundle": true, - "license": "ISC", "dependencies": { - "npm-install-checks": "^4.0.0", + "npm-install-checks": "^5.0.0", "npm-normalize-package-bin": "^1.0.1", "npm-package-arg": "^9.0.0", "semver": "^7.3.5" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm-profile": { @@ -5172,6 +5348,8 @@ "version": "0.9.0", "dev": true, "license": "Apache-2.0", + "optional": true, + "peer": true, "engines": { "node": "*" } @@ -5308,13 +5486,14 @@ } }, "node_modules/pacote": { - "version": "13.0.5", + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.1.1.tgz", + "integrity": "sha512-MTT3k1OhUo+IpvoHGp25OwsRU0L+kJQM236OCywxvY4OIJ/YfloNW2/Yc3HMASH10BkfZaGMVK/pxybB7fWcLw==", "inBundle": true, - "license": "ISC", "dependencies": { "@npmcli/git": "^3.0.0", "@npmcli/installed-package-contents": "^1.0.7", - "@npmcli/promise-spawn": "^1.2.0", + "@npmcli/promise-spawn": "^3.0.0", "@npmcli/run-script": "^3.0.1", "cacache": "^16.0.0", "chownr": "^2.0.0", @@ -5323,7 +5502,7 @@ "minipass": "^3.1.6", "mkdirp": "^1.0.4", "npm-package-arg": "^9.0.0", - "npm-packlist": "^4.0.0", + "npm-packlist": "^5.0.0", "npm-pick-manifest": "^7.0.0", "npm-registry-fetch": "^13.0.1", "proc-log": "^2.0.0", @@ -5331,14 +5510,14 @@ "read-package-json": "^5.0.0", "read-package-json-fast": "^2.0.3", "rimraf": "^3.0.2", - "ssri": "^8.0.1", + "ssri": "^9.0.0", "tar": "^6.1.11" }, "bin": { "pacote": "lib/bin.js" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/parent-module": { @@ -5412,7 +5591,9 @@ "node_modules/performance-now": { "version": "2.1.0", "dev": true, - "license": "MIT" + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/picomatch": { "version": "2.3.1", @@ -5704,6 +5885,8 @@ "version": "6.5.3", "dev": true, "license": "BSD-3-Clause", + "optional": true, + "peer": true, "engines": { "node": ">=0.6" } @@ -5766,8 +5949,12 @@ } }, "node_modules/read-cmd-shim": { - "version": "2.0.0", - "license": "ISC" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-3.0.0.tgz", + "integrity": "sha512-KQDVjGqhZk92PPNRj9ZEXEuqg8bUobSKRw+q0YQ3TKI5xkce7bUJobL4Z/OtiEbAAv70yEpYIXp4iQ9L8oPVog==", + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } }, "node_modules/read-package-json": { "version": "5.0.0", @@ -5982,6 +6169,8 @@ "version": "2.88.2", "dev": true, "license": "Apache-2.0", + "optional": true, + "peer": true, "dependencies": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -6012,6 +6201,8 @@ "version": "2.3.3", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.6", @@ -6025,6 +6216,8 @@ "version": "2.5.0", "dev": true, "license": "BSD-3-Clause", + "optional": true, + "peer": true, "dependencies": { "psl": "^1.1.28", "punycode": "^2.1.1" @@ -6160,28 +6353,18 @@ } }, "node_modules/semver": { - "version": "7.3.5", + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.6.tgz", + "integrity": "sha512-HZWqcgwLsjaX1HBD31msI/rXktuIhS+lWvdE4kN9z+8IVT4Itc7vqU2WvYsyD6/sjYCt4dEKH/m1M3dwI9CC5w==", "inBundle": true, - "license": "ISC", "dependencies": { - "lru-cache": "^6.0.0" + "lru-cache": "^7.4.0" }, "bin": { "semver": "bin/semver.js" }, "engines": { - "node": ">=10" - } - }, - "node_modules/semver/node_modules/lru-cache": { - "version": "6.0.0", - "inBundle": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" + "node": "^10.0.0 || ^12.0.0 || ^14.0.0 || >=16.0.0" } }, "node_modules/set-blocking": { @@ -6422,6 +6605,8 @@ "version": "1.17.0", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -6443,14 +6628,15 @@ } }, "node_modules/ssri": { - "version": "8.0.1", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-9.0.0.tgz", + "integrity": "sha512-Y1Z6J8UYnexKFN1R/hxUaYoY2LVdKEzziPmVAFKiKX8fiwvCJTVzn/xYE9TEWod5OVyNfIHHuVfIEuBClL/uJQ==", "inBundle": true, - "license": "ISC", "dependencies": { "minipass": "^3.1.1" }, "engines": { - "node": ">= 8" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/stack-utils": { @@ -6589,9 +6775,9 @@ "license": "MIT" }, "node_modules/tap": { - "version": "15.2.3", - "resolved": "https://registry.npmjs.org/tap/-/tap-15.2.3.tgz", - "integrity": "sha512-EVbovHd/SdevGMUnkNU5JJqC1YC0hzaaZ2jnqs0fKHv9Oudx27qW3Xwox7A6TB92wvR0mqgQPr+Au2w56kD+aQ==", + "version": "16.0.1", + "resolved": "https://registry.npmjs.org/tap/-/tap-16.0.1.tgz", + "integrity": "sha512-y32sc4NFWzeOE1mrNvZoS1kRJADI8MCCSaatVBalCNVgusTf59h3t8mHZ3d0wSTQRs05JTOG52WC3KnWovhjPg==", "bundleDependencies": [ "ink", "treport", @@ -6604,7 +6790,6 @@ "@isaacs/import-jsx": "*", "@types/react": "*", "chokidar": "^3.3.0", - "coveralls": "^3.0.11", "findit": "^2.0.0", "foreground-child": "^2.0.0", "fs-exists-cached": "^1.0.0", @@ -6633,17 +6818,21 @@ "tap": "bin/run.js" }, "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/isaacs" }, "peerDependencies": { + "coveralls": "^3.1.1", "flow-remove-types": ">=2.112.0", "ts-node": ">=8.5.2", "typescript": ">=3.7.2" }, "peerDependenciesMeta": { + "coveralls": { + "optional": true + }, "flow-remove-types": { "optional": true }, @@ -6716,20 +6905,32 @@ "yaml": "^1.5.0" } }, + "node_modules/tap/node_modules/@ampproject/remapping": { + "version": "2.1.2", + "dev": true, + "inBundle": true, + "license": "Apache-2.0", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.0" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/tap/node_modules/@babel/code-frame": { - "version": "7.16.0", + "version": "7.16.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/highlight": "^7.16.0" + "@babel/highlight": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/tap/node_modules/@babel/compat-data": { - "version": "7.16.0", + "version": "7.17.7", "dev": true, "inBundle": true, "license": "MIT", @@ -6738,26 +6939,26 @@ } }, "node_modules/tap/node_modules/@babel/core": { - "version": "7.16.0", + "version": "7.17.8", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.16.0", - "@babel/generator": "^7.16.0", - "@babel/helper-compilation-targets": "^7.16.0", - "@babel/helper-module-transforms": "^7.16.0", - "@babel/helpers": "^7.16.0", - "@babel/parser": "^7.16.0", - "@babel/template": "^7.16.0", - "@babel/traverse": "^7.16.0", - "@babel/types": "^7.16.0", + "@ampproject/remapping": "^2.1.0", + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.17.7", + "@babel/helper-compilation-targets": "^7.17.7", + "@babel/helper-module-transforms": "^7.17.7", + "@babel/helpers": "^7.17.8", + "@babel/parser": "^7.17.8", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.17.3", + "@babel/types": "^7.17.0", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.1.2", - "semver": "^6.3.0", - "source-map": "^0.5.0" + "semver": "^6.3.0" }, "engines": { "node": ">=6.9.0" @@ -6768,12 +6969,12 @@ } }, "node_modules/tap/node_modules/@babel/generator": { - "version": "7.16.0", + "version": "7.17.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.16.0", + "@babel/types": "^7.17.0", "jsesc": "^2.5.1", "source-map": "^0.5.0" }, @@ -6782,25 +6983,25 @@ } }, "node_modules/tap/node_modules/@babel/helper-annotate-as-pure": { - "version": "7.16.0", + "version": "7.16.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/tap/node_modules/@babel/helper-compilation-targets": { - "version": "7.16.3", + "version": "7.17.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.16.0", - "@babel/helper-validator-option": "^7.14.5", + "@babel/compat-data": "^7.17.7", + "@babel/helper-validator-option": "^7.16.7", "browserslist": "^4.17.5", "semver": "^6.3.0" }, @@ -6811,149 +7012,122 @@ "@babel/core": "^7.0.0" } }, - "node_modules/tap/node_modules/@babel/helper-function-name": { - "version": "7.16.0", + "node_modules/tap/node_modules/@babel/helper-environment-visitor": { + "version": "7.16.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/helper-get-function-arity": "^7.16.0", - "@babel/template": "^7.16.0", - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/tap/node_modules/@babel/helper-get-function-arity": { - "version": "7.16.0", + "node_modules/tap/node_modules/@babel/helper-function-name": { + "version": "7.16.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.16.0" + "@babel/helper-get-function-arity": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/tap/node_modules/@babel/helper-hoist-variables": { - "version": "7.16.0", + "node_modules/tap/node_modules/@babel/helper-get-function-arity": { + "version": "7.16.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/tap/node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.16.0", + "node_modules/tap/node_modules/@babel/helper-hoist-variables": { + "version": "7.16.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/tap/node_modules/@babel/helper-module-imports": { - "version": "7.16.0", + "version": "7.16.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/tap/node_modules/@babel/helper-module-transforms": { - "version": "7.16.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "@babel/helper-module-imports": "^7.16.0", - "@babel/helper-replace-supers": "^7.16.0", - "@babel/helper-simple-access": "^7.16.0", - "@babel/helper-split-export-declaration": "^7.16.0", - "@babel/helper-validator-identifier": "^7.15.7", - "@babel/template": "^7.16.0", - "@babel/traverse": "^7.16.0", - "@babel/types": "^7.16.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/tap/node_modules/@babel/helper-optimise-call-expression": { - "version": "7.16.0", + "version": "7.17.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.16.0" + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-simple-access": "^7.17.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/helper-validator-identifier": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.17.3", + "@babel/types": "^7.17.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/tap/node_modules/@babel/helper-plugin-utils": { - "version": "7.14.5", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/tap/node_modules/@babel/helper-replace-supers": { - "version": "7.16.0", + "version": "7.16.7", "dev": true, "inBundle": true, "license": "MIT", - "dependencies": { - "@babel/helper-member-expression-to-functions": "^7.16.0", - "@babel/helper-optimise-call-expression": "^7.16.0", - "@babel/traverse": "^7.16.0", - "@babel/types": "^7.16.0" - }, "engines": { "node": ">=6.9.0" } }, "node_modules/tap/node_modules/@babel/helper-simple-access": { - "version": "7.16.0", + "version": "7.17.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.17.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/tap/node_modules/@babel/helper-split-export-declaration": { - "version": "7.16.0", + "version": "7.16.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/tap/node_modules/@babel/helper-validator-identifier": { - "version": "7.15.7", + "version": "7.16.7", "dev": true, "inBundle": true, "license": "MIT", @@ -6962,7 +7136,7 @@ } }, "node_modules/tap/node_modules/@babel/helper-validator-option": { - "version": "7.14.5", + "version": "7.16.7", "dev": true, "inBundle": true, "license": "MIT", @@ -6971,26 +7145,26 @@ } }, "node_modules/tap/node_modules/@babel/helpers": { - "version": "7.16.3", + "version": "7.17.8", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/template": "^7.16.0", - "@babel/traverse": "^7.16.3", - "@babel/types": "^7.16.0" + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.17.3", + "@babel/types": "^7.17.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/tap/node_modules/@babel/highlight": { - "version": "7.16.0", + "version": "7.16.10", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.15.7", + "@babel/helper-validator-identifier": "^7.16.7", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, @@ -6999,7 +7173,7 @@ } }, "node_modules/tap/node_modules/@babel/parser": { - "version": "7.16.3", + "version": "7.17.8", "dev": true, "inBundle": true, "license": "MIT", @@ -7011,16 +7185,16 @@ } }, "node_modules/tap/node_modules/@babel/plugin-proposal-object-rest-spread": { - "version": "7.16.0", + "version": "7.17.3", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.16.0", - "@babel/helper-compilation-targets": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5", + "@babel/compat-data": "^7.17.0", + "@babel/helper-compilation-targets": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.16.0" + "@babel/plugin-transform-parameters": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -7030,12 +7204,12 @@ } }, "node_modules/tap/node_modules/@babel/plugin-syntax-jsx": { - "version": "7.16.0", + "version": "7.16.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -7057,12 +7231,12 @@ } }, "node_modules/tap/node_modules/@babel/plugin-transform-destructuring": { - "version": "7.16.0", + "version": "7.17.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -7072,12 +7246,12 @@ } }, "node_modules/tap/node_modules/@babel/plugin-transform-parameters": { - "version": "7.16.3", + "version": "7.16.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -7087,16 +7261,16 @@ } }, "node_modules/tap/node_modules/@babel/plugin-transform-react-jsx": { - "version": "7.16.0", + "version": "7.17.3", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.16.0", - "@babel/helper-module-imports": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/plugin-syntax-jsx": "^7.16.0", - "@babel/types": "^7.16.0" + "@babel/helper-annotate-as-pure": "^7.16.7", + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/plugin-syntax-jsx": "^7.16.7", + "@babel/types": "^7.17.0" }, "engines": { "node": ">=6.9.0" @@ -7106,32 +7280,33 @@ } }, "node_modules/tap/node_modules/@babel/template": { - "version": "7.16.0", + "version": "7.16.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.16.0", - "@babel/parser": "^7.16.0", - "@babel/types": "^7.16.0" + "@babel/code-frame": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/tap/node_modules/@babel/traverse": { - "version": "7.16.3", + "version": "7.17.3", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.16.0", - "@babel/generator": "^7.16.0", - "@babel/helper-function-name": "^7.16.0", - "@babel/helper-hoist-variables": "^7.16.0", - "@babel/helper-split-export-declaration": "^7.16.0", - "@babel/parser": "^7.16.3", - "@babel/types": "^7.16.0", + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.17.3", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/parser": "^7.17.3", + "@babel/types": "^7.17.0", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -7140,12 +7315,12 @@ } }, "node_modules/tap/node_modules/@babel/types": { - "version": "7.16.0", + "version": "7.17.0", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.15.7", + "@babel/helper-validator-identifier": "^7.16.7", "to-fast-properties": "^2.0.0" }, "engines": { @@ -7172,37 +7347,29 @@ "node": ">=10" } }, - "node_modules/tap/node_modules/@isaacs/import-jsx/node_modules/caller-callsite": { - "version": "4.1.0", + "node_modules/tap/node_modules/@jridgewell/resolve-uri": { + "version": "3.0.5", "dev": true, "inBundle": true, "license": "MIT", - "dependencies": { - "callsites": "^3.1.0" - }, "engines": { - "node": ">=8" + "node": ">=6.0.0" } }, - "node_modules/tap/node_modules/@isaacs/import-jsx/node_modules/caller-path": { - "version": "3.0.1", + "node_modules/tap/node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.11", "dev": true, "inBundle": true, - "license": "MIT", - "dependencies": { - "caller-callsite": "^4.1.0" - }, - "engines": { - "node": ">=8" - } + "license": "MIT" }, - "node_modules/tap/node_modules/@isaacs/import-jsx/node_modules/callsites": { - "version": "3.1.0", + "node_modules/tap/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.4", "dev": true, "inBundle": true, "license": "MIT", - "engines": { - "node": ">=6" + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" } }, "node_modules/tap/node_modules/@types/prop-types": { @@ -7212,7 +7379,7 @@ "license": "MIT" }, "node_modules/tap/node_modules/@types/react": { - "version": "17.0.34", + "version": "17.0.41", "dev": true, "inBundle": true, "license": "MIT", @@ -7326,15 +7493,25 @@ } }, "node_modules/tap/node_modules/browserslist": { - "version": "4.17.6", + "version": "4.20.2", "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + } + ], "inBundle": true, "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001274", - "electron-to-chromium": "^1.3.886", + "caniuse-lite": "^1.0.30001317", + "electron-to-chromium": "^1.4.84", "escalade": "^3.1.1", - "node-releases": "^2.0.1", + "node-releases": "^2.0.2", "picocolors": "^1.0.0" }, "bin": { @@ -7342,22 +7519,57 @@ }, "engines": { "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/tap/node_modules/caller-callsite": { + "version": "4.1.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.1.0" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" + "engines": { + "node": ">=8" } }, - "node_modules/tap/node_modules/caniuse-lite": { - "version": "1.0.30001279", + "node_modules/tap/node_modules/caller-path": { + "version": "3.0.1", "dev": true, "inBundle": true, - "license": "CC-BY-4.0", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" + "license": "MIT", + "dependencies": { + "caller-callsite": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tap/node_modules/callsites": { + "version": "3.1.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=6" } }, + "node_modules/tap/node_modules/caniuse-lite": { + "version": "1.0.30001319", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + } + ], + "inBundle": true, + "license": "CC-BY-4.0" + }, "node_modules/tap/node_modules/cardinal": { "version": "2.1.1", "dev": true, @@ -7489,13 +7701,13 @@ } }, "node_modules/tap/node_modules/csstype": { - "version": "3.0.9", + "version": "3.0.11", "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/tap/node_modules/debug": { - "version": "4.3.2", + "version": "4.3.4", "dev": true, "inBundle": true, "license": "MIT", @@ -7512,7 +7724,7 @@ } }, "node_modules/tap/node_modules/electron-to-chromium": { - "version": "1.3.893", + "version": "1.4.89", "dev": true, "inBundle": true, "license": "ISC" @@ -7821,13 +8033,10 @@ } }, "node_modules/tap/node_modules/json5": { - "version": "2.2.0", + "version": "2.2.1", "dev": true, "inBundle": true, "license": "MIT", - "dependencies": { - "minimist": "^1.2.5" - }, "bin": { "json5": "lib/cli.js" }, @@ -7890,7 +8099,7 @@ } }, "node_modules/tap/node_modules/minimatch": { - "version": "3.0.4", + "version": "3.1.2", "dev": true, "inBundle": true, "license": "ISC", @@ -7901,12 +8110,6 @@ "node": "*" } }, - "node_modules/tap/node_modules/minimist": { - "version": "1.2.5", - "dev": true, - "inBundle": true, - "license": "MIT" - }, "node_modules/tap/node_modules/minipass": { "version": "3.1.6", "dev": true, @@ -7926,7 +8129,7 @@ "license": "MIT" }, "node_modules/tap/node_modules/node-releases": { - "version": "2.0.1", + "version": "2.0.2", "dev": true, "inBundle": true, "license": "MIT" @@ -8068,7 +8271,7 @@ } }, "node_modules/tap/node_modules/react-devtools-core": { - "version": "4.21.0", + "version": "4.24.1", "dev": true, "inBundle": true, "license": "MIT", @@ -8172,7 +8375,7 @@ "license": "MIT" }, "node_modules/tap/node_modules/signal-exit": { - "version": "3.0.6", + "version": "3.0.7", "dev": true, "inBundle": true, "license": "ISC" @@ -8521,7 +8724,7 @@ "license": "ISC" }, "node_modules/tap/node_modules/ws": { - "version": "7.5.5", + "version": "7.5.7", "dev": true, "inBundle": true, "license": "MIT", @@ -8647,6 +8850,28 @@ "node": ">=8" } }, + "node_modules/test-exclude/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/test-exclude/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/text-table": { "version": "0.2.0", "inBundle": true, @@ -8701,9 +8926,13 @@ } }, "node_modules/treeverse": { - "version": "1.0.4", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/treeverse/-/treeverse-2.0.0.tgz", + "integrity": "sha512-N5gJCkLu1aXccpOTtqV6ddSEi6ZmGkh3hjmbu1IjcavJK4qyOVQmi0myQKM7z5jVGmD68SJoliaVrMmVObhj6A==", "inBundle": true, - "license": "ISC" + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } }, "node_modules/trim": { "version": "0.0.1", @@ -8782,7 +9011,9 @@ "node_modules/tweetnacl": { "version": "0.14.5", "dev": true, - "license": "Unlicense" + "license": "Unlicense", + "optional": true, + "peer": true }, "node_modules/type-check": { "version": "0.4.0", @@ -9030,6 +9261,7 @@ "version": "4.4.1", "dev": true, "license": "BSD-2-Clause", + "peer": true, "dependencies": { "punycode": "^2.1.0" } @@ -9089,6 +9321,8 @@ "node >=0.6.0" ], "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", @@ -9221,8 +9455,9 @@ }, "node_modules/which": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "inBundle": true, - "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -9508,17 +9743,17 @@ }, "workspaces/arborist": { "name": "@npmcli/arborist", - "version": "5.0.3", + "version": "5.0.5", "license": "ISC", "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", "@npmcli/installed-package-contents": "^1.0.7", "@npmcli/map-workspaces": "^2.0.0", "@npmcli/metavuln-calculator": "^3.0.1", - "@npmcli/move-file": "^1.1.0", + "@npmcli/move-file": "^2.0.0", "@npmcli/name-from-folder": "^1.0.1", - "@npmcli/node-gyp": "^1.0.3", - "@npmcli/package-json": "^1.0.1", + "@npmcli/node-gyp": "^2.0.0", + "@npmcli/package-json": "^2.0.0", "@npmcli/run-script": "^3.0.0", "bin-links": "^3.0.0", "cacache": "^16.0.0", @@ -9528,7 +9763,7 @@ "mkdirp": "^1.0.4", "mkdirp-infer-owner": "^2.0.0", "nopt": "^5.0.0", - "npm-install-checks": "^4.0.0", + "npm-install-checks": "^5.0.0", "npm-package-arg": "^9.0.0", "npm-pick-manifest": "^7.0.0", "npm-registry-fetch": "^13.0.0", @@ -9542,8 +9777,8 @@ "readdir-scoped-modules": "^1.1.0", "rimraf": "^3.0.2", "semver": "^7.3.5", - "ssri": "^8.0.1", - "treeverse": "^1.0.4", + "ssri": "^9.0.0", + "treeverse": "^2.0.0", "walk-up-path": "^1.0.0" }, "bin": { @@ -9551,12 +9786,12 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "benchmark": "^2.1.4", "chalk": "^4.1.0", "minify-registry-metadata": "^2.1.0", "nock": "^13.2.0", - "tap": "^15.1.2", + "tap": "^16.0.1", "tcompare": "^5.0.6" }, "engines": { @@ -9574,9 +9809,9 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "nock": "^13.2.4", - "tap": "^15.1.0" + "tap": "^16.0.1" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16.0.0" @@ -9586,19 +9821,19 @@ "version": "4.0.2", "license": "ISC", "dependencies": { - "@npmcli/disparity-colors": "^1.0.1", + "@npmcli/disparity-colors": "^2.0.0", "@npmcli/installed-package-contents": "^1.0.7", "binary-extensions": "^2.2.0", "diff": "^5.0.0", - "minimatch": "^3.0.4", + "minimatch": "^5.0.1", "npm-package-arg": "^9.0.1", "pacote": "^13.0.5", "tar": "^6.1.0" }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", - "tap": "^15.0.9" + "@npmcli/template-oss": "3.3.2", + "tap": "^16.0.1" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16.0.0" @@ -9623,9 +9858,9 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "bin-links": "^3.0.0", - "tap": "^15.0.6" + "tap": "^16.0.1" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16.0.0" @@ -9639,8 +9874,8 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", - "tap": "^15.0.9" + "@npmcli/template-oss": "3.3.2", + "tap": "^16.0.1" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16.0.0" @@ -9655,9 +9890,9 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "nock": "^13.2.4", - "tap": "^15.1.0" + "tap": "^16.0.1" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16.0.0" @@ -9672,10 +9907,10 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "minipass": "^3.1.1", "nock": "^13.2.4", - "tap": "^15.0.0" + "tap": "^16.0.1" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16.0.0" @@ -9691,9 +9926,9 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "nock": "^13.0.7", - "tap": "^15.0.0" + "tap": "^16.0.1" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16.0.0" @@ -9707,15 +9942,15 @@ "npm-package-arg": "^9.0.1", "npm-registry-fetch": "^13.0.0", "semver": "^7.1.3", - "ssri": "^8.0.1" + "ssri": "^9.0.0" }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "libnpmpack": "^4.0.0", "lodash.clonedeep": "^4.5.0", "nock": "^13.2.4", - "tap": "^15" + "tap": "^16.0.1" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16.0.0" @@ -9729,9 +9964,9 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "nock": "^13.2.4", - "tap": "^15" + "tap": "^16.0.1" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16.0.0" @@ -9746,9 +9981,9 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "nock": "^13.2.4", - "tap": "^15" + "tap": "^16.0.1" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16.0.0" @@ -9767,9 +10002,9 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "require-inject": "^1.4.4", - "tap": "^15" + "tap": "^16.0.1" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16.0.0" @@ -10048,6 +10283,17 @@ "dev": true, "peer": true }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "peer": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "globals": { "version": "13.13.0", "dev": true, @@ -10064,6 +10310,16 @@ "argparse": "^2.0.1" } }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "peer": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, "type-fest": { "version": "0.20.2", "dev": true, @@ -10082,6 +10338,29 @@ "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", "minimatch": "^3.0.4" + }, + "dependencies": { + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "peer": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "peer": true, + "requires": { + "brace-expansion": "^1.1.7" + } + } } }, "@humanwhocodes/object-schema": { @@ -10187,12 +10466,12 @@ "@npmcli/installed-package-contents": "^1.0.7", "@npmcli/map-workspaces": "^2.0.0", "@npmcli/metavuln-calculator": "^3.0.1", - "@npmcli/move-file": "^1.1.0", + "@npmcli/move-file": "^2.0.0", "@npmcli/name-from-folder": "^1.0.1", - "@npmcli/node-gyp": "^1.0.3", - "@npmcli/package-json": "^1.0.1", + "@npmcli/node-gyp": "^2.0.0", + "@npmcli/package-json": "^2.0.0", "@npmcli/run-script": "^3.0.0", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "benchmark": "^2.1.4", "bin-links": "^3.0.0", "cacache": "^16.0.0", @@ -10205,7 +10484,7 @@ "mkdirp-infer-owner": "^2.0.0", "nock": "^13.2.0", "nopt": "^5.0.0", - "npm-install-checks": "^4.0.0", + "npm-install-checks": "^5.0.0", "npm-package-arg": "^9.0.0", "npm-pick-manifest": "^7.0.0", "npm-registry-fetch": "^13.0.0", @@ -10219,10 +10498,10 @@ "readdir-scoped-modules": "^1.1.0", "rimraf": "^3.0.2", "semver": "^7.3.5", - "ssri": "^8.0.1", - "tap": "^15.1.2", + "ssri": "^9.0.0", + "tap": "^16.0.1", "tcompare": "^5.0.6", - "treeverse": "^1.0.4", + "treeverse": "^2.0.0", "walk-up-path": "^1.0.0" } }, @@ -10230,10 +10509,12 @@ "version": "2.0.0" }, "@npmcli/config": { - "version": "4.0.1", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/config/-/config-4.0.2.tgz", + "integrity": "sha512-UqD4h4LgyNOb7xRmAK7QXiMu0/k2x7wEzrEqXZ1wGIQVmCl3vamsAprDjAhi7IKlgRulg09hpwYs2/57OP22xw==", "requires": { - "@npmcli/map-workspaces": "^2.0.1", - "ini": "^2.0.0", + "@npmcli/map-workspaces": "^2.0.2", + "ini": "^3.0.0", "mkdirp-infer-owner": "^2.0.0", "nopt": "^5.0.0", "proc-log": "^2.0.0", @@ -10243,7 +10524,9 @@ } }, "@npmcli/disparity-colors": { - "version": "1.0.1", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/disparity-colors/-/disparity-colors-2.0.0.tgz", + "integrity": "sha512-FFXGrIjhvd2qSZ8iS0yDvbI7nbjdyT2VNO7wotosjYZM2p2r8PN3B7Om3M5NO9KqW/OVzfzLB3L0V5Vo5QXC7A==", "requires": { "ansi-styles": "^4.3.0" } @@ -10267,10 +10550,12 @@ } }, "@npmcli/git": { - "version": "3.0.0", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-3.0.1.tgz", + "integrity": "sha512-UU85F/T+F1oVn3IsB/L6k9zXIMpXBuUBE25QDH0SsURwT6IOBqkC7M16uqo2vVZIyji3X1K4XH9luip7YekH1A==", "requires": { - "@npmcli/promise-spawn": "^1.3.2", - "lru-cache": "^7.3.1", + "@npmcli/promise-spawn": "^3.0.0", + "lru-cache": "^7.4.4", "mkdirp": "^1.0.4", "npm-pick-manifest": "^7.0.0", "proc-log": "^2.0.0", @@ -10294,24 +10579,12 @@ "glob": "^7.2.0", "minimatch": "^5.0.1", "read-package-json-fast": "^2.0.3" - }, - "dependencies": { - "brace-expansion": { - "version": "2.0.1", - "requires": { - "balanced-match": "^1.0.0" - } - }, - "minimatch": { - "version": "5.0.1", - "requires": { - "brace-expansion": "^2.0.1" - } - } } }, "@npmcli/metavuln-calculator": { - "version": "3.0.1", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@npmcli/metavuln-calculator/-/metavuln-calculator-3.1.0.tgz", + "integrity": "sha512-Q5fbQqGDlYqk7kWrbg6E2j/mtqQjZop0ZE6735wYA1tYNHguIDjAuWs+kFb5rJCkLIlXllfapvsyotYKiZOTBA==", "requires": { "cacache": "^16.0.0", "json-parse-even-better-errors": "^2.3.1", @@ -10320,7 +10593,9 @@ } }, "@npmcli/move-file": { - "version": "1.1.2", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-2.0.0.tgz", + "integrity": "sha512-UR6D5f4KEGWJV6BGPH3Qb2EtgH+t+1XQ1Tt85c7qicN6cezzuHPdZwwAxqZr4JLtnQu0LZsTza/5gmNmSl8XLg==", "requires": { "mkdirp": "^1.0.4", "rimraf": "^3.0.2" @@ -10330,41 +10605,47 @@ "version": "1.0.1" }, "@npmcli/node-gyp": { - "version": "1.0.3" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-2.0.0.tgz", + "integrity": "sha512-doNI35wIe3bBaEgrlPfdJPaCpUR89pJWep4Hq3aRdh6gKazIVWfs0jHttvSSoq47ZXgC7h73kDsUl8AoIQUB+A==" }, "@npmcli/package-json": { - "version": "1.0.1", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/package-json/-/package-json-2.0.0.tgz", + "integrity": "sha512-42jnZ6yl16GzjWSH7vtrmWyJDGVa/LXPdpN2rcUWolFjc9ON2N3uz0qdBbQACfmhuJZ2lbKYtmK5qx68ZPLHMA==", "requires": { "json-parse-even-better-errors": "^2.3.1" } }, "@npmcli/promise-spawn": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-1.3.2.tgz", - "integrity": "sha512-QyAGYo/Fbj4MXeGdJcFzZ+FkDkomfRBrPM+9QYJSg+PxgAUL+LU3FneQk37rKR2/zjqkCV1BLHccX98wRXG3Sg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-3.0.0.tgz", + "integrity": "sha512-s9SgS+p3a9Eohe68cSI3fi+hpcZUmXq5P7w0kMlAsWVtR7XbK3ptkZqKT2cK1zLDObJ3sR+8P59sJE0w/KTL1g==", "requires": { "infer-owner": "^1.0.4" } }, "@npmcli/run-script": { - "version": "3.0.1", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-3.0.2.tgz", + "integrity": "sha512-vdjD/PMBl+OX9j9C9irx5sCCIKfp2PWkpPNH9zxvlJAfSZ3Qp5aU412v+O3PFJl3R1PFNwuyChCqHg4ma6ci2Q==", "requires": { - "@npmcli/node-gyp": "^1.0.3", - "@npmcli/promise-spawn": "^1.3.2", + "@npmcli/node-gyp": "^2.0.0", + "@npmcli/promise-spawn": "^3.0.0", "node-gyp": "^9.0.0", "read-package-json-fast": "^2.0.3" } }, "@npmcli/template-oss": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/@npmcli/template-oss/-/template-oss-3.2.2.tgz", - "integrity": "sha512-jhqthwI5OvhXRuShc87gpDuu5JCbKT7ByEsXrYkW+aaRLvniGwiX/7GNjEPX2Jt7B+5lLG66MVqc+A8MMpdWSA==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/@npmcli/template-oss/-/template-oss-3.3.2.tgz", + "integrity": "sha512-dxuO704qWTeSt5ievjNRhOB7VB6Mqv66wCaazOksLlAs3CittiCG0P0YWKhXojptNrOET/mGj6ltZV/A/QdGfw==", "dev": true, "requires": { "@npmcli/fs": "^2.0.1", "@npmcli/git": "^3.0.0", "@npmcli/map-workspaces": "^2.0.2", - "@npmcli/package-json": "^1.0.1", + "@npmcli/package-json": "^2.0.0", "diff": "^5.0.0", "handlebars": "^4.7.7", "hosted-git-info": "^5.0.0", @@ -10463,6 +10744,7 @@ "ajv": { "version": "6.12.6", "dev": true, + "peer": true, "requires": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -10536,13 +10818,17 @@ "asn1": { "version": "0.2.4", "dev": true, + "optional": true, + "peer": true, "requires": { "safer-buffer": "~2.1.0" } }, "assert-plus": { "version": "1.0.0", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "async-hook-domain": { "version": "2.0.4", @@ -10554,11 +10840,15 @@ }, "aws-sign2": { "version": "0.7.0", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "aws4": { "version": "1.11.0", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "babel-plugin-apply-mdx-type-prop": { "version": "1.6.22", @@ -10592,7 +10882,9 @@ "dev": true }, "balanced-match": { - "version": "1.0.2" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "base64-js": { "version": "1.5.1", @@ -10601,6 +10893,8 @@ "bcrypt-pbkdf": { "version": "1.0.2", "dev": true, + "optional": true, + "peer": true, "requires": { "tweetnacl": "^0.14.3" } @@ -10614,12 +10908,14 @@ } }, "bin-links": { - "version": "3.0.0", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/bin-links/-/bin-links-3.0.1.tgz", + "integrity": "sha512-9vx+ypzVhASvHTS6K+YSGf7nwQdANoz7v6MTC0aCtYnOEZ87YvMf81aY737EZnGZdpbRM3sfWjO9oWkKmuIvyQ==", "requires": { - "cmd-shim": "^4.0.1", + "cmd-shim": "^5.0.0", "mkdirp-infer-owner": "^2.0.0", "npm-normalize-package-bin": "^1.0.0", - "read-cmd-shim": "^2.0.0", + "read-cmd-shim": "^3.0.0", "rimraf": "^3.0.0", "write-file-atomic": "^4.0.0" } @@ -10648,10 +10944,11 @@ } }, "brace-expansion": { - "version": "1.1.11", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" } }, "braces": { @@ -10686,10 +10983,12 @@ } }, "cacache": { - "version": "16.0.3", + "version": "16.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.0.4.tgz", + "integrity": "sha512-U0D4wF3/W8ZgK4qDA5fTtOVSr0gaDfd5aa7tUdAV0uukVWKsAIn6SzXQCoVlg7RWZiJa+bcsM3/pXLumGaL2Ug==", "requires": { "@npmcli/fs": "^2.1.0", - "@npmcli/move-file": "^1.1.2", + "@npmcli/move-file": "^2.0.0", "chownr": "^2.0.0", "fs-minipass": "^2.1.0", "glob": "^7.2.0", @@ -10703,7 +11002,7 @@ "p-map": "^4.0.0", "promise-inflight": "^1.0.1", "rimraf": "^3.0.2", - "ssri": "^8.0.1", + "ssri": "^9.0.0", "tar": "^6.1.11", "unique-filename": "^1.1.1" } @@ -10764,7 +11063,9 @@ }, "caseless": { "version": "0.12.0", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "ccount": { "version": "1.1.0", @@ -10851,7 +11152,9 @@ } }, "cmd-shim": { - "version": "4.1.0", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-5.0.0.tgz", + "integrity": "sha512-qkCtZ59BidfEwHltnJwkyVZn+XQojdAySM1D1gSeh11Z4pW1Kpolkyo53L5noc0nrxmIvyFwTmJRo4xs7FFLPw==", "requires": { "mkdirp-infer-owner": "^2.0.0" } @@ -10906,7 +11209,9 @@ "dev": true }, "concat-map": { - "version": "0.0.1" + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "console-control-strings": { "version": "1.1.0" @@ -10938,6 +11243,8 @@ "coveralls": { "version": "3.1.1", "dev": true, + "optional": true, + "peer": true, "requires": { "js-yaml": "^3.13.1", "lcov-parse": "^1.0.0", @@ -10975,6 +11282,8 @@ "dashdash": { "version": "1.14.1", "dev": true, + "optional": true, + "peer": true, "requires": { "assert-plus": "^1.0.0" } @@ -11073,7 +11382,9 @@ "dev": true }, "dezalgo": { - "version": "1.0.3", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz", + "integrity": "sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==", "requires": { "asap": "^2.0.0", "wrappy": "1" @@ -11092,12 +11403,13 @@ "@mdx-js/mdx": "^1.6.22", "@npmcli/eslint-config": "^3.0.1", "@npmcli/fs": "^2.1.0", - "@npmcli/promise-spawn": "^1.3.2", - "@npmcli/template-oss": "3.2.2", + "@npmcli/promise-spawn": "^3.0.0", + "@npmcli/template-oss": "3.3.2", "cmark-gfm": "^0.9.0", "jsdom": "^18.1.0", "marked-man": "^0.7.0", - "tap": "^15.2.3", + "tap": "^16.0.1", + "which": "^2.0.2", "yaml": "^1.10.0" } }, @@ -11119,6 +11431,8 @@ "ecc-jsbn": { "version": "0.1.2", "dev": true, + "optional": true, + "peer": true, "requires": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" @@ -11287,6 +11601,17 @@ "dev": true, "peer": true }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "peer": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "eslint-utils": { "version": "3.0.0", "dev": true, @@ -11326,6 +11651,16 @@ "argparse": "^2.0.1" } }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "peer": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, "type-fest": { "version": "0.20.2", "dev": true, @@ -11355,6 +11690,27 @@ "semver": "^6.1.0" }, "dependencies": { + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "peer": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "peer": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, "semver": { "version": "6.3.0", "dev": true, @@ -11450,15 +11806,19 @@ }, "extsprintf": { "version": "1.3.0", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "fast-deep-equal": { "version": "3.1.3", - "dev": true + "dev": true, + "peer": true }, "fast-json-stable-stringify": { "version": "2.1.0", - "dev": true + "dev": true, + "peer": true }, "fast-levenshtein": { "version": "2.0.6", @@ -11586,7 +11946,9 @@ }, "forever-agent": { "version": "0.6.1", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "form-data": { "version": "4.0.0", @@ -11687,6 +12049,8 @@ "getpass": { "version": "0.1.7", "dev": true, + "optional": true, + "peer": true, "requires": { "assert-plus": "^1.0.0" } @@ -11704,6 +12068,25 @@ "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" + }, + "dependencies": { + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + } } }, "glob-parent": { @@ -11718,7 +12101,9 @@ "dev": true }, "graceful-fs": { - "version": "4.2.9" + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" }, "handlebars": { "version": "4.7.7", @@ -11743,11 +12128,15 @@ }, "har-schema": { "version": "2.0.0", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "har-validator": { "version": "5.1.5", "dev": true, + "optional": true, + "peer": true, "requires": { "ajv": "^6.12.3", "har-schema": "^2.0.0" @@ -11890,6 +12279,8 @@ "http-signature": { "version": "1.2.0", "dev": true, + "optional": true, + "peer": true, "requires": { "assert-plus": "^1.0.0", "jsprim": "^1.2.2", @@ -11928,9 +12319,11 @@ "peer": true }, "ignore-walk": { - "version": "4.0.1", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-5.0.1.tgz", + "integrity": "sha512-yemi4pMf51WKT7khInJqAvsIGzoqYXblnsz0ql8tM+yi1EKYTY1evX4NAbJrLL/Aanr2HyZeluqU+Oi7MGHokw==", "requires": { - "minimatch": "^3.0.4" + "minimatch": "^5.0.1" } }, "import-fresh": { @@ -11962,7 +12355,9 @@ "version": "2.0.4" }, "ini": { - "version": "2.0.0" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-3.0.0.tgz", + "integrity": "sha512-TxYQaeNW/N8ymDvwAxPyRbhMBtnEwuvaTYpOQkFx1nSeusgezHniEc/l35Vo4iCq/mMiTJbpD7oYxN98hFlfmw==" }, "init-package-json": { "version": "3.0.2", @@ -12168,7 +12563,9 @@ }, "isstream": { "version": "0.1.2", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "istanbul-lib-coverage": { "version": "3.2.0", @@ -12272,7 +12669,9 @@ }, "jsbn": { "version": "0.1.1", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "jsdom": { "version": "18.1.1", @@ -12326,11 +12725,14 @@ }, "json-schema": { "version": "0.4.0", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "json-schema-traverse": { "version": "0.4.1", - "dev": true + "dev": true, + "peer": true }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", @@ -12354,6 +12756,8 @@ "jsprim": { "version": "1.4.2", "dev": true, + "optional": true, + "peer": true, "requires": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", @@ -12369,7 +12773,9 @@ }, "lcov-parse": { "version": "1.0.0", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "levn": { "version": "0.4.1", @@ -12384,28 +12790,28 @@ "version": "file:workspaces/libnpmaccess", "requires": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "aproba": "^2.0.0", "minipass": "^3.1.1", "nock": "^13.2.4", "npm-package-arg": "^9.0.1", "npm-registry-fetch": "^13.0.0", - "tap": "^15.1.0" + "tap": "^16.0.1" } }, "libnpmdiff": { "version": "file:workspaces/libnpmdiff", "requires": { - "@npmcli/disparity-colors": "^1.0.1", + "@npmcli/disparity-colors": "^2.0.0", "@npmcli/eslint-config": "^3.0.1", "@npmcli/installed-package-contents": "^1.0.7", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "binary-extensions": "^2.2.0", "diff": "^5.0.0", - "minimatch": "^3.0.4", + "minimatch": "^5.0.1", "npm-package-arg": "^9.0.1", "pacote": "^13.0.5", - "tap": "^15.0.9", + "tap": "^16.0.1", "tar": "^6.1.0" } }, @@ -12416,7 +12822,7 @@ "@npmcli/ci-detect": "^2.0.0", "@npmcli/eslint-config": "^3.0.1", "@npmcli/run-script": "^3.0.0", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "bin-links": "^3.0.0", "chalk": "^4.1.0", "mkdirp-infer-owner": "^2.0.0", @@ -12426,7 +12832,7 @@ "proc-log": "^2.0.0", "read": "^1.0.7", "read-package-json-fast": "^2.0.2", - "tap": "^15.0.6", + "tap": "^16.0.1", "walk-up-path": "^1.0.0" } }, @@ -12435,31 +12841,31 @@ "requires": { "@npmcli/arborist": "^5.0.0", "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", - "tap": "^15.0.9" + "@npmcli/template-oss": "3.3.2", + "tap": "^16.0.1" } }, "libnpmhook": { "version": "file:workspaces/libnpmhook", "requires": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "aproba": "^2.0.0", "nock": "^13.2.4", "npm-registry-fetch": "^13.0.0", - "tap": "^15.1.0" + "tap": "^16.0.1" } }, "libnpmorg": { "version": "file:workspaces/libnpmorg", "requires": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "aproba": "^2.0.0", "minipass": "^3.1.1", "nock": "^13.2.4", "npm-registry-fetch": "^13.0.0", - "tap": "^15.0.0" + "tap": "^16.0.1" } }, "libnpmpack": { @@ -12467,18 +12873,18 @@ "requires": { "@npmcli/eslint-config": "^3.0.1", "@npmcli/run-script": "^3.0.0", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "nock": "^13.0.7", "npm-package-arg": "^9.0.1", "pacote": "^13.0.5", - "tap": "^15.0.0" + "tap": "^16.0.1" } }, "libnpmpublish": { "version": "file:workspaces/libnpmpublish", "requires": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "libnpmpack": "^4.0.0", "lodash.clonedeep": "^4.5.0", "nock": "^13.2.4", @@ -12486,29 +12892,29 @@ "npm-package-arg": "^9.0.1", "npm-registry-fetch": "^13.0.0", "semver": "^7.1.3", - "ssri": "^8.0.1", - "tap": "^15" + "ssri": "^9.0.0", + "tap": "^16.0.1" } }, "libnpmsearch": { "version": "file:workspaces/libnpmsearch", "requires": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "nock": "^13.2.4", "npm-registry-fetch": "^13.0.0", - "tap": "^15" + "tap": "^16.0.1" } }, "libnpmteam": { "version": "file:workspaces/libnpmteam", "requires": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "aproba": "^2.0.0", "nock": "^13.2.4", "npm-registry-fetch": "^13.0.0", - "tap": "^15" + "tap": "^16.0.1" } }, "libnpmversion": { @@ -12517,13 +12923,13 @@ "@npmcli/eslint-config": "^3.0.1", "@npmcli/git": "^3.0.0", "@npmcli/run-script": "^3.0.0", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "json-parse-even-better-errors": "^2.3.1", "proc-log": "^2.0.0", "require-inject": "^1.4.4", "semver": "^7.3.5", "stringify-package": "^1.0.1", - "tap": "^15" + "tap": "^16.0.1" } }, "libtap": { @@ -12605,10 +13011,14 @@ }, "log-driver": { "version": "1.2.7", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "lru-cache": { - "version": "7.7.1" + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.7.3.tgz", + "integrity": "sha512-WY9wjJNQt9+PZilnLbuFKM+SwDull9+6IAguOrarOMoOHTcJ9GnXSO11+Gw6c7xtDkBkthR57OZMtZKYr+1CEw==" }, "make-dir": { "version": "3.1.0", @@ -12630,9 +13040,9 @@ "peer": true }, "make-fetch-happen": { - "version": "10.1.1", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.1.1.tgz", - "integrity": "sha512-3/mCljDQNjmrP7kl0vhS5WVlV+TvSKoZaFhdiYV7MOijEnrhrjaVnqbp/EY/7S+fhUB2KpH7j8c1iRsIOs+kjw==", + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.1.2.tgz", + "integrity": "sha512-GWMGiZsKVeJACQGJ1P3Z+iNec7pLsU6YW1q11eaPn3RR8nRXHppFWfP7Eu0//55JK3hSjrAQRl8sDa5uXpq1Ew==", "requires": { "agentkeepalive": "^4.2.1", "cacache": "^16.0.2", @@ -12649,7 +13059,7 @@ "negotiator": "^0.6.3", "promise-retry": "^2.0.1", "socks-proxy-agent": "^6.1.1", - "ssri": "^8.0.1" + "ssri": "^9.0.0" } }, "markdown-escapes": { @@ -12718,9 +13128,11 @@ "dev": true }, "minimatch": { - "version": "3.1.2", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", "requires": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" } }, "minimist": { @@ -12906,7 +13318,9 @@ } }, "npm-install-checks": { - "version": "4.0.0", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-5.0.0.tgz", + "integrity": "sha512-65lUsMI8ztHCxFz5ckCEC44DRvEGdZX5usQFriauxHEwt7upv1FKaQEmAtU0YnOAdwuNWCmk64xYiQABNrEyLA==", "requires": { "semver": "^7.1.1" } @@ -12919,7 +13333,7 @@ "version": "1.0.1" }, "npm-package-arg": { - "version": "9.0.1", + "version": "9.0.2", "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-9.0.2.tgz", "integrity": "sha512-v/miORuX8cndiOheW8p2moNuPJ7QhcFh9WGlTorruG8hXSA23vMTEp5hTCmDxic0nD8KHhj/NQgFuySD3GYY3g==", "requires": { @@ -12929,18 +13343,22 @@ } }, "npm-packlist": { - "version": "4.0.0", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-5.0.0.tgz", + "integrity": "sha512-uU20UwM4Hogfab1Q7htJbhcyafM9lGHxOrDjkKvR2S3z7Ds0uRaESk0cXctczk+ABT4DZWNwjB10xlurFdEwZg==", "requires": { "glob": "^7.2.0", - "ignore-walk": "^4.0.1", + "ignore-walk": "^5.0.1", "npm-bundled": "^1.1.2", "npm-normalize-package-bin": "^1.0.1" } }, "npm-pick-manifest": { - "version": "7.0.0", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-7.0.1.tgz", + "integrity": "sha512-IA8+tuv8KujbsbLQvselW2XQgmXWS47t3CB0ZrzsRZ82DbDfkcFunOaPm4X7qNuhMfq+FmV7hQT4iFVpHqV7mg==", "requires": { - "npm-install-checks": "^4.0.0", + "npm-install-checks": "^5.0.0", "npm-normalize-package-bin": "^1.0.1", "npm-package-arg": "^9.0.0", "semver": "^7.3.5" @@ -13074,7 +13492,9 @@ }, "oauth-sign": { "version": "0.9.0", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "object-assign": { "version": "4.1.1", @@ -13157,11 +13577,13 @@ } }, "pacote": { - "version": "13.0.5", + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-13.1.1.tgz", + "integrity": "sha512-MTT3k1OhUo+IpvoHGp25OwsRU0L+kJQM236OCywxvY4OIJ/YfloNW2/Yc3HMASH10BkfZaGMVK/pxybB7fWcLw==", "requires": { "@npmcli/git": "^3.0.0", "@npmcli/installed-package-contents": "^1.0.7", - "@npmcli/promise-spawn": "^1.2.0", + "@npmcli/promise-spawn": "^3.0.0", "@npmcli/run-script": "^3.0.1", "cacache": "^16.0.0", "chownr": "^2.0.0", @@ -13170,7 +13592,7 @@ "minipass": "^3.1.6", "mkdirp": "^1.0.4", "npm-package-arg": "^9.0.0", - "npm-packlist": "^4.0.0", + "npm-packlist": "^5.0.0", "npm-pick-manifest": "^7.0.0", "npm-registry-fetch": "^13.0.1", "proc-log": "^2.0.0", @@ -13178,7 +13600,7 @@ "read-package-json": "^5.0.0", "read-package-json-fast": "^2.0.3", "rimraf": "^3.0.2", - "ssri": "^8.0.1", + "ssri": "^9.0.0", "tar": "^6.1.11" } }, @@ -13227,7 +13649,9 @@ }, "performance-now": { "version": "2.1.0", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "picomatch": { "version": "2.3.1", @@ -13427,7 +13851,9 @@ }, "qs": { "version": "6.5.3", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "queue-microtask": { "version": "1.2.3", @@ -13460,7 +13886,9 @@ } }, "read-cmd-shim": { - "version": "2.0.0" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-3.0.0.tgz", + "integrity": "sha512-KQDVjGqhZk92PPNRj9ZEXEuqg8bUobSKRw+q0YQ3TKI5xkce7bUJobL4Z/OtiEbAAv70yEpYIXp4iQ9L8oPVog==" }, "read-package-json": { "version": "5.0.0", @@ -13613,6 +14041,8 @@ "request": { "version": "2.88.2", "dev": true, + "optional": true, + "peer": true, "requires": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -13639,6 +14069,8 @@ "form-data": { "version": "2.3.3", "dev": true, + "optional": true, + "peer": true, "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.6", @@ -13648,6 +14080,8 @@ "tough-cookie": { "version": "2.5.0", "dev": true, + "optional": true, + "peer": true, "requires": { "psl": "^1.1.28", "punycode": "^2.1.1" @@ -13715,17 +14149,11 @@ } }, "semver": { - "version": "7.3.5", + "version": "7.3.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.6.tgz", + "integrity": "sha512-HZWqcgwLsjaX1HBD31msI/rXktuIhS+lWvdE4kN9z+8IVT4Itc7vqU2WvYsyD6/sjYCt4dEKH/m1M3dwI9CC5w==", "requires": { - "lru-cache": "^6.0.0" - }, - "dependencies": { - "lru-cache": { - "version": "6.0.0", - "requires": { - "yallist": "^4.0.0" - } - } + "lru-cache": "^7.4.0" } }, "set-blocking": { @@ -13882,6 +14310,8 @@ "sshpk": { "version": "1.17.0", "dev": true, + "optional": true, + "peer": true, "requires": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -13895,7 +14325,9 @@ } }, "ssri": { - "version": "8.0.1", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-9.0.0.tgz", + "integrity": "sha512-Y1Z6J8UYnexKFN1R/hxUaYoY2LVdKEzziPmVAFKiKX8fiwvCJTVzn/xYE9TEWod5OVyNfIHHuVfIEuBClL/uJQ==", "requires": { "minipass": "^3.1.1" } @@ -13983,15 +14415,14 @@ "dev": true }, "tap": { - "version": "15.2.3", - "resolved": "https://registry.npmjs.org/tap/-/tap-15.2.3.tgz", - "integrity": "sha512-EVbovHd/SdevGMUnkNU5JJqC1YC0hzaaZ2jnqs0fKHv9Oudx27qW3Xwox7A6TB92wvR0mqgQPr+Au2w56kD+aQ==", + "version": "16.0.1", + "resolved": "https://registry.npmjs.org/tap/-/tap-16.0.1.tgz", + "integrity": "sha512-y32sc4NFWzeOE1mrNvZoS1kRJADI8MCCSaatVBalCNVgusTf59h3t8mHZ3d0wSTQRs05JTOG52WC3KnWovhjPg==", "dev": true, "requires": { "@isaacs/import-jsx": "*", "@types/react": "*", "chokidar": "^3.3.0", - "coveralls": "^3.0.11", "findit": "^2.0.0", "foreground-child": "^2.0.0", "fs-exists-cached": "^1.0.0", @@ -14017,220 +14448,209 @@ "which": "^2.0.2" }, "dependencies": { + "@ampproject/remapping": { + "version": "2.1.2", + "bundled": true, + "dev": true, + "requires": { + "@jridgewell/trace-mapping": "^0.3.0" + } + }, "@babel/code-frame": { - "version": "7.16.0", + "version": "7.16.7", "bundled": true, "dev": true, "requires": { - "@babel/highlight": "^7.16.0" + "@babel/highlight": "^7.16.7" } }, "@babel/compat-data": { - "version": "7.16.0", + "version": "7.17.7", "bundled": true, "dev": true }, "@babel/core": { - "version": "7.16.0", + "version": "7.17.8", "bundled": true, "dev": true, "requires": { - "@babel/code-frame": "^7.16.0", - "@babel/generator": "^7.16.0", - "@babel/helper-compilation-targets": "^7.16.0", - "@babel/helper-module-transforms": "^7.16.0", - "@babel/helpers": "^7.16.0", - "@babel/parser": "^7.16.0", - "@babel/template": "^7.16.0", - "@babel/traverse": "^7.16.0", - "@babel/types": "^7.16.0", + "@ampproject/remapping": "^2.1.0", + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.17.7", + "@babel/helper-compilation-targets": "^7.17.7", + "@babel/helper-module-transforms": "^7.17.7", + "@babel/helpers": "^7.17.8", + "@babel/parser": "^7.17.8", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.17.3", + "@babel/types": "^7.17.0", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.1.2", - "semver": "^6.3.0", - "source-map": "^0.5.0" + "semver": "^6.3.0" } }, "@babel/generator": { - "version": "7.16.0", + "version": "7.17.7", "bundled": true, "dev": true, "requires": { - "@babel/types": "^7.16.0", + "@babel/types": "^7.17.0", "jsesc": "^2.5.1", "source-map": "^0.5.0" } }, "@babel/helper-annotate-as-pure": { - "version": "7.16.0", + "version": "7.16.7", "bundled": true, "dev": true, "requires": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" } }, "@babel/helper-compilation-targets": { - "version": "7.16.3", + "version": "7.17.7", "bundled": true, "dev": true, "requires": { - "@babel/compat-data": "^7.16.0", - "@babel/helper-validator-option": "^7.14.5", + "@babel/compat-data": "^7.17.7", + "@babel/helper-validator-option": "^7.16.7", "browserslist": "^4.17.5", "semver": "^6.3.0" } }, - "@babel/helper-function-name": { - "version": "7.16.0", + "@babel/helper-environment-visitor": { + "version": "7.16.7", "bundled": true, "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.16.0", - "@babel/template": "^7.16.0", - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" } }, - "@babel/helper-get-function-arity": { - "version": "7.16.0", + "@babel/helper-function-name": { + "version": "7.16.7", "bundled": true, "dev": true, "requires": { - "@babel/types": "^7.16.0" + "@babel/helper-get-function-arity": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/types": "^7.16.7" } }, - "@babel/helper-hoist-variables": { - "version": "7.16.0", + "@babel/helper-get-function-arity": { + "version": "7.16.7", "bundled": true, "dev": true, "requires": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" } }, - "@babel/helper-member-expression-to-functions": { - "version": "7.16.0", + "@babel/helper-hoist-variables": { + "version": "7.16.7", "bundled": true, "dev": true, "requires": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" } }, "@babel/helper-module-imports": { - "version": "7.16.0", + "version": "7.16.7", "bundled": true, "dev": true, "requires": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" } }, "@babel/helper-module-transforms": { - "version": "7.16.0", - "bundled": true, - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.16.0", - "@babel/helper-replace-supers": "^7.16.0", - "@babel/helper-simple-access": "^7.16.0", - "@babel/helper-split-export-declaration": "^7.16.0", - "@babel/helper-validator-identifier": "^7.15.7", - "@babel/template": "^7.16.0", - "@babel/traverse": "^7.16.0", - "@babel/types": "^7.16.0" - } - }, - "@babel/helper-optimise-call-expression": { - "version": "7.16.0", + "version": "7.17.7", "bundled": true, "dev": true, "requires": { - "@babel/types": "^7.16.0" + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-simple-access": "^7.17.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/helper-validator-identifier": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.17.3", + "@babel/types": "^7.17.0" } }, "@babel/helper-plugin-utils": { - "version": "7.14.5", + "version": "7.16.7", "bundled": true, "dev": true }, - "@babel/helper-replace-supers": { - "version": "7.16.0", - "bundled": true, - "dev": true, - "requires": { - "@babel/helper-member-expression-to-functions": "^7.16.0", - "@babel/helper-optimise-call-expression": "^7.16.0", - "@babel/traverse": "^7.16.0", - "@babel/types": "^7.16.0" - } - }, "@babel/helper-simple-access": { - "version": "7.16.0", + "version": "7.17.7", "bundled": true, "dev": true, "requires": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.17.0" } }, "@babel/helper-split-export-declaration": { - "version": "7.16.0", + "version": "7.16.7", "bundled": true, "dev": true, "requires": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" } }, "@babel/helper-validator-identifier": { - "version": "7.15.7", + "version": "7.16.7", "bundled": true, "dev": true }, "@babel/helper-validator-option": { - "version": "7.14.5", + "version": "7.16.7", "bundled": true, "dev": true }, "@babel/helpers": { - "version": "7.16.3", + "version": "7.17.8", "bundled": true, "dev": true, "requires": { - "@babel/template": "^7.16.0", - "@babel/traverse": "^7.16.3", - "@babel/types": "^7.16.0" + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.17.3", + "@babel/types": "^7.17.0" } }, "@babel/highlight": { - "version": "7.16.0", + "version": "7.16.10", "bundled": true, "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.15.7", + "@babel/helper-validator-identifier": "^7.16.7", "chalk": "^2.0.0", "js-tokens": "^4.0.0" } }, "@babel/parser": { - "version": "7.16.3", + "version": "7.17.8", "bundled": true, "dev": true }, "@babel/plugin-proposal-object-rest-spread": { - "version": "7.16.0", + "version": "7.17.3", "bundled": true, "dev": true, "requires": { - "@babel/compat-data": "^7.16.0", - "@babel/helper-compilation-targets": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5", + "@babel/compat-data": "^7.17.0", + "@babel/helper-compilation-targets": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.16.0" + "@babel/plugin-transform-parameters": "^7.16.7" } }, "@babel/plugin-syntax-jsx": { - "version": "7.16.0", + "version": "7.16.7", "bundled": true, "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-syntax-object-rest-spread": { @@ -14242,65 +14662,66 @@ } }, "@babel/plugin-transform-destructuring": { - "version": "7.16.0", + "version": "7.17.7", "bundled": true, "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-transform-parameters": { - "version": "7.16.3", + "version": "7.16.7", "bundled": true, "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" } }, "@babel/plugin-transform-react-jsx": { - "version": "7.16.0", + "version": "7.17.3", "bundled": true, "dev": true, "requires": { - "@babel/helper-annotate-as-pure": "^7.16.0", - "@babel/helper-module-imports": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/plugin-syntax-jsx": "^7.16.0", - "@babel/types": "^7.16.0" + "@babel/helper-annotate-as-pure": "^7.16.7", + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/plugin-syntax-jsx": "^7.16.7", + "@babel/types": "^7.17.0" } }, "@babel/template": { - "version": "7.16.0", + "version": "7.16.7", "bundled": true, "dev": true, "requires": { - "@babel/code-frame": "^7.16.0", - "@babel/parser": "^7.16.0", - "@babel/types": "^7.16.0" + "@babel/code-frame": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7" } }, "@babel/traverse": { - "version": "7.16.3", + "version": "7.17.3", "bundled": true, "dev": true, "requires": { - "@babel/code-frame": "^7.16.0", - "@babel/generator": "^7.16.0", - "@babel/helper-function-name": "^7.16.0", - "@babel/helper-hoist-variables": "^7.16.0", - "@babel/helper-split-export-declaration": "^7.16.0", - "@babel/parser": "^7.16.3", - "@babel/types": "^7.16.0", + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.17.3", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/parser": "^7.17.3", + "@babel/types": "^7.17.0", "debug": "^4.1.0", "globals": "^11.1.0" } }, "@babel/types": { - "version": "7.16.0", + "version": "7.17.0", "bundled": true, "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.15.7", + "@babel/helper-validator-identifier": "^7.16.7", "to-fast-properties": "^2.0.0" } }, @@ -14318,29 +14739,25 @@ "make-dir": "^3.0.2", "resolve-from": "^3.0.0", "rimraf": "^3.0.0" - }, - "dependencies": { - "caller-callsite": { - "version": "4.1.0", - "bundled": true, - "dev": true, - "requires": { - "callsites": "^3.1.0" - } - }, - "caller-path": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "caller-callsite": "^4.1.0" - } - }, - "callsites": { - "version": "3.1.0", - "bundled": true, - "dev": true - } + } + }, + "@jridgewell/resolve-uri": { + "version": "3.0.5", + "bundled": true, + "dev": true + }, + "@jridgewell/sourcemap-codec": { + "version": "1.4.11", + "bundled": true, + "dev": true + }, + "@jridgewell/trace-mapping": { + "version": "0.3.4", + "bundled": true, + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" } }, "@types/prop-types": { @@ -14349,7 +14766,7 @@ "dev": true }, "@types/react": { - "version": "17.0.34", + "version": "17.0.41", "bundled": true, "dev": true, "requires": { @@ -14426,19 +14843,40 @@ } }, "browserslist": { - "version": "4.17.6", + "version": "4.20.2", "bundled": true, "dev": true, "requires": { - "caniuse-lite": "^1.0.30001274", - "electron-to-chromium": "^1.3.886", + "caniuse-lite": "^1.0.30001317", + "electron-to-chromium": "^1.4.84", "escalade": "^3.1.1", - "node-releases": "^2.0.1", + "node-releases": "^2.0.2", "picocolors": "^1.0.0" } }, + "caller-callsite": { + "version": "4.1.0", + "bundled": true, + "dev": true, + "requires": { + "callsites": "^3.1.0" + } + }, + "caller-path": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "caller-callsite": "^4.1.0" + } + }, + "callsites": { + "version": "3.1.0", + "bundled": true, + "dev": true + }, "caniuse-lite": { - "version": "1.0.30001279", + "version": "1.0.30001319", "bundled": true, "dev": true }, @@ -14533,12 +14971,12 @@ "dev": true }, "csstype": { - "version": "3.0.9", + "version": "3.0.11", "bundled": true, "dev": true }, "debug": { - "version": "4.3.2", + "version": "4.3.4", "bundled": true, "dev": true, "requires": { @@ -14546,7 +14984,7 @@ } }, "electron-to-chromium": { - "version": "1.3.893", + "version": "1.4.89", "bundled": true, "dev": true }, @@ -14745,12 +15183,9 @@ "dev": true }, "json5": { - "version": "2.2.0", + "version": "2.2.1", "bundled": true, - "dev": true, - "requires": { - "minimist": "^1.2.5" - } + "dev": true }, "locate-path": { "version": "5.0.0", @@ -14787,18 +15222,13 @@ "dev": true }, "minimatch": { - "version": "3.0.4", + "version": "3.1.2", "bundled": true, "dev": true, "requires": { "brace-expansion": "^1.1.7" } }, - "minimist": { - "version": "1.2.5", - "bundled": true, - "dev": true - }, "minipass": { "version": "3.1.6", "bundled": true, @@ -14813,7 +15243,7 @@ "dev": true }, "node-releases": { - "version": "2.0.1", + "version": "2.0.2", "bundled": true, "dev": true }, @@ -14902,7 +15332,7 @@ } }, "react-devtools-core": { - "version": "4.21.0", + "version": "4.24.1", "bundled": true, "dev": true, "requires": { @@ -14975,7 +15405,7 @@ "dev": true }, "signal-exit": { - "version": "3.0.6", + "version": "3.0.7", "bundled": true, "dev": true }, @@ -15216,7 +15646,7 @@ "dev": true }, "ws": { - "version": "7.5.5", + "version": "7.5.7", "bundled": true, "dev": true, "requires": {} @@ -15339,6 +15769,27 @@ "@istanbuljs/schema": "^0.1.2", "glob": "^7.1.4", "minimatch": "^3.0.4" + }, + "dependencies": { + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + } } }, "text-table": { @@ -15375,7 +15826,9 @@ } }, "treeverse": { - "version": "1.0.4" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/treeverse/-/treeverse-2.0.0.tgz", + "integrity": "sha512-N5gJCkLu1aXccpOTtqV6ddSEi6ZmGkh3hjmbu1IjcavJK4qyOVQmi0myQKM7z5jVGmD68SJoliaVrMmVObhj6A==" }, "trim": { "version": "0.0.1", @@ -15423,7 +15876,9 @@ }, "tweetnacl": { "version": "0.14.5", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "type-check": { "version": "0.4.0", @@ -15574,6 +16029,7 @@ "uri-js": { "version": "4.4.1", "dev": true, + "peer": true, "requires": { "punycode": "^2.1.0" } @@ -15615,6 +16071,8 @@ "verror": { "version": "1.10.0", "dev": true, + "optional": true, + "peer": true, "requires": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", @@ -15701,6 +16159,8 @@ }, "which": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "requires": { "isexe": "^2.0.0" } diff --git a/package.json b/package.json index 934c5d0ba00f2..277320d11feeb 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "8.5.5", + "version": "8.6.0", "name": "npm", "description": "a package manager for JavaScript", "workspaces": [ @@ -55,18 +55,18 @@ }, "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", - "@npmcli/arborist": "^5.0.3", + "@npmcli/arborist": "^5.0.4", "@npmcli/ci-detect": "^2.0.0", - "@npmcli/config": "^4.0.1", + "@npmcli/config": "^4.0.2", "@npmcli/fs": "^2.1.0", "@npmcli/map-workspaces": "^2.0.2", - "@npmcli/package-json": "^1.0.1", + "@npmcli/package-json": "^2.0.0", "@npmcli/run-script": "^3.0.1", "abbrev": "~1.1.1", "ansicolors": "~0.3.2", "ansistyles": "~0.1.3", "archy": "~1.0.0", - "cacache": "^16.0.3", + "cacache": "^16.0.4", "chalk": "^4.1.2", "chownr": "^2.0.0", "cli-columns": "^4.0.0", @@ -74,9 +74,9 @@ "columnify": "^1.6.0", "fastest-levenshtein": "^1.0.12", "glob": "^7.2.0", - "graceful-fs": "^4.2.9", + "graceful-fs": "^4.2.10", "hosted-git-info": "^5.0.0", - "ini": "^2.0.0", + "ini": "^3.0.0", "init-package-json": "^3.0.2", "is-cidr": "^4.0.2", "json-parse-even-better-errors": "^2.3.1", @@ -91,7 +91,7 @@ "libnpmsearch": "^5.0.2", "libnpmteam": "^4.0.2", "libnpmversion": "^3.0.1", - "make-fetch-happen": "^10.1.1", + "make-fetch-happen": "^10.1.2", "minipass": "^3.1.6", "minipass-pipeline": "^1.2.4", "mkdirp": "^1.0.4", @@ -100,15 +100,15 @@ "node-gyp": "^9.0.0", "nopt": "^5.0.0", "npm-audit-report": "^3.0.0", - "npm-install-checks": "^4.0.0", - "npm-package-arg": "^9.0.1", - "npm-pick-manifest": "^7.0.0", + "npm-install-checks": "^5.0.0", + "npm-package-arg": "^9.0.2", + "npm-pick-manifest": "^7.0.1", "npm-profile": "^6.0.2", "npm-registry-fetch": "^13.1.0", "npm-user-validate": "^1.0.1", "npmlog": "^6.0.1", "opener": "^1.5.2", - "pacote": "^13.0.5", + "pacote": "^13.1.1", "parse-conflict-json": "^2.0.2", "proc-log": "^2.0.1", "qrcode-terminal": "^0.12.0", @@ -117,12 +117,12 @@ "read-package-json-fast": "^2.0.3", "readdir-scoped-modules": "^1.1.0", "rimraf": "^3.0.2", - "semver": "^7.3.5", - "ssri": "^8.0.1", + "semver": "^7.3.6", + "ssri": "^9.0.0", "tar": "^6.1.11", "text-table": "~0.2.0", "tiny-relative-date": "^1.3.0", - "treeverse": "^1.0.4", + "treeverse": "^2.0.0", "validate-npm-package-name": "^4.0.0", "which": "^2.0.2", "write-file-atomic": "^4.0.1" @@ -203,15 +203,15 @@ ], "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "licensee": "^8.2.0", "nock": "^13.2.4", "spawk": "^1.7.1", - "tap": "^15.2.3" + "tap": "^16.0.1" }, "scripts": { "dumpconf": "env | grep npm | sort | uniq", - "preversion": "bash scripts/update-authors.sh && git add AUTHORS && git commit -m \"update AUTHORS\" || true", + "preversion": "bash scripts/update-authors.sh && git add AUTHORS && git commit -m \"chore: update AUTHORS\" || true", "licenses": "licensee --production --errors-only", "test": "tap", "test-all": "npm run test --if-present --workspaces --include-workspace-root", @@ -240,7 +240,7 @@ "templateOSS": { "rootRepo": false, "rootModule": false, - "version": "3.2.2" + "version": "3.3.2" }, "license": "Artistic-2.0", "engines": { diff --git a/scripts/changelog.js b/scripts/changelog.js index f0f46d8e8256a..0c50b562defd1 100644 --- a/scripts/changelog.js +++ b/scripts/changelog.js @@ -1,50 +1,216 @@ +/* eslint no-shadow:2 */ 'use strict' -const execSync = require('child_process').execSync +const { execSync } = require('child_process') +const semver = require('semver') +const fs = require('fs') +const config = require('@npmcli/template-oss') +const { resolve, relative } = require('path') -/* -Usage: +const exec = (...args) => execSync(...args).toString().trim() -node scripts/changelog.js [comittish] +const usage = () => ` + node ${relative(process.cwd(), __filename)} [--read|-r] [--write|-w] [tag] -Generates changelog entries in our format as best as its able based on -commits starting at comittish, or if that's not passed, latest. + Generates changelog entries in our format starting from the most recent tag. + By default this script will print the release notes to stdout. -Ordinarily this is run via the gen-changelog shell script, which appends -the result to the changelog. + [tag] (defaults to most recent tag) + A tag to generate release notes for. Helpful for testing this script against + old releases. Leave this empty to look for the most recent tag. -*/ + [--write|-w] (default: false) + When set it will update the changelog with the new release. + If a release with the same version already exists it will replace it, otherwise + it will prepend it to the file directly after the top level changelog title. + + [--read|-r] (default: false) + When set it will read the release notes for the [tag] from the CHANGELOG.md, + instead of fetching it. This is useful after release notes have been manually + edited and need to be pasted somewhere else. +` + +// this script assumes that the tags it looks for all start with this prefix +const TAG_PREFIX = 'v' + +// a naive implementation of console.log/group for indenting console +// output but keeping it in a buffer to be output to a file or console +const logger = (init) => { + let indent = 0 + const step = 2 + const buffer = [init] + return { + toString () { + return buffer.join('\n').trim() + }, + group (s) { + this.log(s) + indent += step + }, + groupEnd () { + indent -= step + }, + log (s) { + if (!s) { + buffer.push('') + } else { + buffer.push(s.split('\n').map((l) => ' '.repeat(indent) + l).join('\n')) + } + }, + } +} + +// some helpers for generating common parts +// of our markdown release notes +const RELEASE = { + sep: '\n\n', + heading: '## ', + // versions in titles must be prefixed with a v + versionRe: semver.src[11].replace(TAG_PREFIX + '?', TAG_PREFIX), + get h1 () { + return '# Changelog' + this.sep + }, + version (s) { + return s.startsWith(TAG_PREFIX) ? s : TAG_PREFIX + s + }, + date (d) { + return `(${d || exec('date +%Y-%m-%d')})` + }, + title (v, d) { + return `${this.heading}${this.version(v)} ${this.date(d)}` + }, +} + +// a map of all our changelog types that go into the release notes to be +// looked up by commit type and return the section title +const CHANGELOG = new Map( + config.changelogTypes.filter(c => !c.hidden).map((c) => [c.type, c.section])) + +const assertArgs = (args) => { + if (args.help) { + console.log(usage()) + return process.exit(0) + } + + if (args.unsafe) { + // just to make manual testing easier + return args + } + + // we dont need to be up to date to read from our local changelog + if (!args.read) { + exec(`git fetch ${args.remote}`) + const remoteBranch = `${args.remote}/${args.branch}` + const current = exec(`git rev-parse --abbrev-ref HEAD`) + + if (current !== args.branch) { + throw new Error(`Must be on branch "${args.branch}"`) + } + + const localLog = exec(`git log ${remoteBranch}..HEAD`).length > 0 + const remoteLog = exec(`git log HEAD..${remoteBranch}`).length > 0 + + if (current !== args.branch || localLog || remoteLog) { + throw new Error(`Must be in sync with "${remoteBranch}"`) + } + } + + return args +} const parseArgs = (argv) => { const result = { - releaseNotes: false, - branch: 'origin/latest', + tag: null, + file: resolve(__dirname, '..', 'CHANGELOG.md'), + branch: 'latest', + remote: 'origin', + type: 'md', // or 'gh' + write: false, + read: false, + help: false, + unsafe: false, } for (const arg of argv) { - if (arg === '--release-notes') { - result.releaseNotes = true - continue + if (arg.startsWith('--')) { + // dash to camel case. no value means boolean true + const [key, value = true] = arg.slice(2).split('=') + result[key.replace(/-([a-z])/g, (a) => a[1].toUpperCase())] = value + } else if (arg.startsWith('-')) { + // shorthands for read and write + const short = arg.slice(1) + const key = short === 'w' ? 'write' : short === 'r' ? 'read' : null + result[key] = true + } else { + // anything else without a -- or - is the tag + // force tag to start with a "v" + result.tag = arg.startsWith(TAG_PREFIX) ? arg : TAG_PREFIX + arg } - - result.branch = arg } - return result + // previous tag to requested tag OR most recent tag and everything after + // only matches tags prefixed with "v" since only the cli is prefixed with v + const getTag = (t = '') => exec(['git', 'describe', '--tags', '--abbrev=0', + `--match="${TAG_PREFIX}*" ${t}`].join(' ')) + + return assertArgs({ + ...result, + // if a tag is passed in get the previous tag to make a range between the two + // this is mostly for testing to generate release notes from old releases + startTag: result.tag ? getTag(`${result.tag}~1`) : getTag(), + endTag: result.tag || '', + }) } -const main = async () => { - const { branch, releaseNotes } = parseArgs(process.argv.slice(2)) +// find an entire section of a release from the changelog from a version +const findRelease = (args, version) => { + const changelog = fs.readFileSync(args.file, 'utf-8') + const escRegExp = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + + const titleSrc = (v) => [ + '^', + RELEASE.heading, + v ? escRegExp(v) : RELEASE.versionRe, + ' ', + escRegExp(RELEASE.date()).replace(/\d/g, '\\d'), + '$', + ].join('') - const log = execSync(`git log --reverse --pretty='format:%h' ${branch}...`) - .toString() - .split(/\n/) + const releaseSrc = [ + '(', + titleSrc(RELEASE.version(version)), + '[\\s\\S]*?', + RELEASE.sep, + ')', + titleSrc(), + ].join('') + + const [, release = ''] = changelog.match(new RegExp(releaseSrc, 'm')) || [] + return { + release: release.trim(), + changelog, + } +} + +const generateRelease = async (args) => { + const range = `${args.startTag}...${args.endTag}` + + const log = exec(`git log --reverse --pretty='format:%h' ${range}`) + .split('\n') + .filter(Boolean) + // prefix with underscore so its always a valid identifier + .map((sha) => `_${sha}: object (expression: "${sha}") { ...commitCredit }`) + + if (!log.length) { + throw new Error(`No commits found for "${range}"`) + } const query = ` fragment commitCredit on GitObject { ... on Commit { message url + abbreviatedOid authors (first:10) { nodes { user { @@ -67,65 +233,61 @@ const main = async () => { query { repository (owner:"npm", name:"cli") { - ${log.map((sha) => `_${sha}: object (expression: "${sha}") { - ...commitCredit - }`).join('\n')} + ${log} } } ` - const response = execSync(`gh api graphql -f query='${query}'`).toString() - const body = JSON.parse(response) + const res = JSON.parse(exec(`gh api graphql -f query='${query}'`)) - const output = { - Features: [], - 'Bug Fixes': [], - Documentation: [], - Dependencies: [], - } + // collect commits by valid changelog type + const commits = [...CHANGELOG.values()].reduce((acc, c) => { + acc[c] = [] + return acc + }, {}) + + const allCommits = Object.values(res.data.repository) - for (const [hash, data] of Object.entries(body.data.repository)) { - if (!data) { - console.error('no data for hash', hash) + for (const commit of allCommits) { + // get changelog type of commit or bail if there is not a valid one + const [, type] = /(^\w+)[\s(:]?/.exec(commit.message) || [] + const changelogType = CHANGELOG.get(type) + if (!changelogType) { continue } - const message = data.message.replace(/^\s+/gm, '') // remove leading spaces + const message = commit.message + .trim() // remove leading/trailing spaces .replace(/(\r?\n)+/gm, '\n') // replace multiple newlines with one .replace(/([^\s]+@\d+\.\d+\.\d+.*)/gm, '`$1`') // wrap package@version in backticks - const lines = message.split('\n') // the title is the first line of the commit, 'let' because we change it later - let title = lines.shift() - // the body is the rest of the commit with some normalization - const body = lines.join('\n') // re-join our normalized commit into a string - .split(/\n?\*/gm) // split on lines starting with a literal * - .filter((line) => line.trim().length > 0) // remove blank lines - .map((line) => { - const clean = line.replace(/\n/gm, ' ') // replace new lines for this bullet with spaces - return clean.startsWith('*') ? clean : `* ${clean}` // make sure the line starts with * - }) - .join('\n') // re-join with new lines + let [title, ...body] = message.split('\n') - const type = title.startsWith('feat') ? 'Features' - : title.startsWith('fix') ? 'Bug Fixes' - : title.startsWith('docs') ? 'Documentation' - : title.startsWith('deps') ? 'Dependencies' - : null - - const prs = data.associatedPullRequests.nodes.filter((pull) => pull.merged) + const prs = commit.associatedPullRequests.nodes.filter((pull) => pull.merged) for (const pr of prs) { title = title.replace(new RegExp(`\\s*\\(#${pr.number}\\)`, 'g'), '') } - const commit = { - hash: hash.slice(1), // remove leading _ - url: data.url, + body = body + .map((line) => line.trim()) // remove artificial line breaks + .filter(Boolean) // remove blank lines + .join('\n') // rejoin on new lines + .split(/^[*-]/gm) // split on lines starting with bullets + .map((line) => line.trim()) // remove spaces around bullets + .filter((line) => !title.includes(line)) // rm lines that exist in the title + // replace new lines for this bullet with spaces and re-bullet it + .map((line) => `* ${line.trim().replace(/\n/gm, ' ')}`) + .join('\n') // re-join with new lines + + commits[changelogType].push({ + hash: commit.abbreviatedOid, + url: commit.url, title, - type, + type: changelogType, body, prs, - credit: data.authors.nodes.map((author) => { + credit: commit.authors.nodes.map((author) => { if (author.user && author.user.login) { return { name: `@${author.user.login}`, @@ -140,20 +302,26 @@ const main = async () => { url: `mailto:${author.email}`, } }), - } + }) + } - if (commit.type) { - output[commit.type].push(commit) - } + if (!Object.values(commits).flat().length) { + const messages = allCommits.map((c) => c.message.trim().split('\n')[0]) + throw new Error(`No changelog commits found for "${range}":\n${messages.join('\n')}`) } - for (const key of Object.keys(output)) { - if (output[key].length > 0) { - const groupHeading = `### ${key}` - console.group(groupHeading) - console.log() // blank line after heading + // this doesnt work with majors but we dont do those very often + const semverBump = commits.Features.length ? 'minor' : 'patch' + const version = TAG_PREFIX + semver.parse(args.startTag).inc(semverBump).version + const date = args.endTag && exec(`git log -1 --date=short --format=%ad ${args.endTag}`) + + const output = logger(RELEASE.title(version, date) + '\n') - for (const commit of output[key]) { + for (const key of Object.keys(commits)) { + if (commits[key].length > 0) { + output.group(`### ${key}\n`) + + for (const commit of commits[key]) { let groupCommit = `* [\`${commit.hash}\`](${commit.url})` for (const pr of commit.prs) { groupCommit += ` [#${pr.number}](${pr.url})` @@ -161,24 +329,71 @@ const main = async () => { groupCommit += ` ${commit.title}` if (key !== 'Dependencies') { for (const user of commit.credit) { - if (releaseNotes) { + if (args.type === 'gh') { groupCommit += ` (${user.name})` } else { groupCommit += ` ([${user.name}](${user.url}))` } } } - console.group(groupCommit) + + output.group(groupCommit) if (commit.body && commit.body.length) { - console.log(commit.body) + output.log(commit.body) } - console.groupEnd(groupCommit) + output.groupEnd() } - console.log() // blank line at end of group - console.groupEnd(groupHeading) + output.log() + output.groupEnd() + } + } + + return { + version, + release: output.toString(), + } +} + +const main = async (argv) => { + const args = parseArgs(argv) + + if (args.read) { + // this reads the release notes for that version + let { release } = findRelease(args, args.endTag || args.startTag) + if (args.type === 'gh') { + // changelog was written in markdown so convert user links to gh release style + // XXX: this needs to be changed if the `generateRelease` format changes + release = release.replace(/\(\[(@[a-z\d-]+)\]\(https:\/\/github.com\/[a-z\d-]+\)\)/g, '($1)') } + return console.log(release) } + + // otherwise fetch the requested release from github + const { release, version } = await generateRelease(args) + + let msg = 'Edit release notes and run:\n' + msg += `git add CHANGELOG.md && git commit -m 'chore: changelog for ${version}'` + + if (args.write) { + const { release: existing, changelog } = findRelease(args, version) + fs.writeFileSync( + args.file, + existing + // replace existing release with the newly generated one + ? changelog.replace(existing, release) + // otherwise prepend a new release at the start of the changelog + : changelog.replace(RELEASE.h1, RELEASE.h1 + release + RELEASE.sep), + 'utf-8' + ) + return console.error([ + `Release notes for ${version} written to "./${relative(process.cwd(), args.file)}".`, + msg, + ].join('\n')) + } + + console.log(release) + console.error('\n' + msg) } -main() +main(process.argv.slice(2)) diff --git a/scripts/clean-old.sh b/scripts/clean-old.sh deleted file mode 100755 index 32a203e4a5f7e..0000000000000 --- a/scripts/clean-old.sh +++ /dev/null @@ -1,165 +0,0 @@ -#!/usr/bin/env bash - -# look for old 0.x cruft, and get rid of it. -# Should already be sitting in the npm folder. - -# This doesn't have to be quite as cross-platform as install.sh. -# There are some bash-isms, because maintaining *two* -# fully-portable posix/bourne sh scripts is too much for -# one project with a sane maintainer. - -# If readlink isn't available, then this is just too tricky. -# However, greadlink is fine, so Solaris can join the party, too. -readlink="readlink" -which $readlink >/dev/null 2>/dev/null -if [ $? -ne 0 ]; then - readlink="greadlink" - which $readlink >/dev/null 2>/dev/null - if [ $? -ne 0 ]; then - echo "Can't find the readlink or greadlink command. Aborting." - exit 1 - fi -fi - -if [ "x$npm_config_prefix" != "x" ]; then - PREFIXES=$npm_config_prefix -else - node="$NODE" - if [ "x$node" = "x" ]; then - node=`which node` - fi - if [ "x$node" = "x" ]; then - echo "Can't find node to determine prefix. Aborting." - exit 1 - fi - - - PREFIX=`dirname $node` - PREFIX=`dirname $PREFIX` - echo "cleanup prefix=$PREFIX" - PREFIXES=$PREFIX - - altprefix=`"$node" -e process.installPrefix` - if [ "x$altprefix" != "x" ] && [ "x$altprefix" != "x$PREFIX" ]; then - echo "altprefix=$altprefix" - PREFIXES="$PREFIX $altprefix" - fi -fi - -# now prefix is where npm would be rooted by default -# go hunting. - -packages= -for prefix in $PREFIXES; do - packages="$packages - "`ls "$prefix"/lib/node/.npm 2>/dev/null | grep -v .cache` -done - -packages=`echo $packages` - -filelist=() -fid=0 - -for prefix in $PREFIXES; do - # remove any links into the .npm dir, or links to - # version-named shims/symlinks. - for folder in share/man bin lib/node; do - find $prefix/$folder -type l | while read file; do - target=`$readlink $file | grep '/\.npm/'` - if [ "x$target" != "x" ]; then - # found one! - filelist[$fid]="$file" - let 'fid++' - # also remove any symlinks to this file. - base=`basename "$file"` - base=`echo "$base" | awk -F@ '{print $1}'` - if [ "x$base" != "x" ]; then - find "`dirname $file`" -type l -name "$base"'*' \ - | while read l; do - target=`$readlink "$l" | grep "$base"` - if [ "x$target" != "x" ]; then - filelist[$fid]="$1" - let 'fid++' - fi - done - fi - fi - done - - # Scour for shim files. These are relics of 0.2 npm installs. - # note: grep -r is not portable. - find $prefix/$folder -type f \ - | xargs grep -sl '// generated by npm' \ - | while read file; do - filelist[$fid]="$file" - let 'fid++' - done - done - - # now remove the package modules, and the .npm folder itself. - if [ "x$packages" != "x" ]; then - for pkg in $packages; do - filelist[$fid]="$prefix/lib/node/$pkg" - let 'fid++' - for i in $prefix/lib/node/$pkg\@*; do - filelist[$fid]="$i" - let 'fid++' - done - done - fi - - for folder in lib/node/.npm lib/npm share/npm; do - if [ -d $prefix/$folder ]; then - filelist[$fid]="$prefix/$folder" - let 'fid++' - fi - done -done - -# now actually clean, but only if there's anything TO clean -if [ "${#filelist[@]}" -gt 0 ]; then - echo "" - echo "This script will find and eliminate any shims, symbolic" - echo "links, and other cruft that was installed by npm 0.x." - echo "" - - if [ "x$packages" != "x" ]; then - echo "The following packages appear to have been installed with" - echo "an old version of npm, and will be removed forcibly:" - for pkg in $packages; do - echo " $pkg" - done - echo "Make a note of these. You may want to install them" - echo "with npm 1.0 when this process is completed." - echo "" - fi - - OK= - if [ "x$1" = "x-y" ]; then - OK="yes" - fi - - while [ "$OK" != "y" ] && [ "$OK" != "yes" ] && [ "$OK" != "no" ]; do - echo "Is this OK?" - echo " enter 'yes' or 'no'" - echo " or 'show' to see a list of files " - read OK - if [ "x$OK" = "xshow" ] || [ "x$OK" = "xs" ]; then - for i in "${filelist[@]}"; do - echo "$i" - done - fi - done - if [ "$OK" = "no" ]; then - echo "Aborting" - exit 1 - fi - for i in "${filelist[@]}"; do - rm -rf "$i" - done -fi - -echo "" -echo 'All clean!' - -exit 0 diff --git a/scripts/docs-build.js b/scripts/docs-build.js deleted file mode 100644 index c380b4b7653dc..0000000000000 --- a/scripts/docs-build.js +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env node - -var fs = require('fs') -var marked = require('marked-man') -var npm = require('../lib/npm.js') -var args = process.argv.slice(2) -var src = args[0] -var dest = args[1] || src - -fs.readFile(src, 'utf8', function (err, data) { - if (err) { - return console.log(err) - } - - function frontmatter (match, p1) { - const fm = { } - - p1.split(/\r?\n/).forEach((kv) => { - const result = kv.match(/^([^\s:]+):\s*(.*)/) - if (result) { - fm[result[1]] = result[2] - } - }) - - return `# ${fm.title}(${fm.section}) - ${fm.description}` - } - - function replacer (match, p1) { - return 'npm help ' + p1.replace(/npm /, '') - } - - var result = data.replace(/@VERSION@/g, npm.version) - .replace(/^$/gm, '') - .replace(/^---\n([\s\S]+\n)---/, frontmatter) - .replace(/\[([^\]]+)\]\(\/commands\/([^)]+)\)/g, replacer) - .replace(/\[([^\]]+)\]\(\/configuring-npm\/([^)]+)\)/g, replacer) - .replace(/\[([^\]]+)\]\(\/using-npm\/([^)]+)\)/g, replacer) - .trim() - - fs.writeFile(dest, marked(result), 'utf8', function (err) { - if (err) { - return console.log(err) - } - }) -}) diff --git a/scripts/maketest b/scripts/maketest deleted file mode 100755 index 4ef1e9266fb04..0000000000000 --- a/scripts/maketest +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env node -'use strict' -const loadFromDir = require('tacks/load-from-dir.js') - -process.exit(main(process.argv.slice(2))) - -function main (argv) { - if (argv.length !== 1) { - console.error('Usage: maketest ') - return 1 - } - const fixturedir = process.argv[2] - - console.log(generateFromDir(fixturedir)) - return 0 -} - -function indent (ind, str) { - return str.replace(/\n/g, '\n' + ind) -} - -function generateFromDir (dir) { - const tacks = loadFromDir(dir) - return `'use strict' -const path = require('path') -const test = require('tap').test -const Tacks = require('tacks') -const File = Tacks.File -const Symlink = Tacks.Symlink -const Dir = Tacks.Dir -const common = require('../common-tap.js') - -const basedir = path.join(__dirname, path.basename(__filename, '.js')) -const testdir = path.join(basedir, 'testdir') -const cachedir = path.join(basedir, 'cache') -const globaldir = path.join(basedir, 'global') -const tmpdir = path.join(basedir, 'tmp') - -const conf = { - cwd: testdir, - env: common.newEnv().extend({ - npm_config_cache: cachedir, - npm_config_tmp: tmpdir, - npm_config_prefix: globaldir, - npm_config_registry: common.registry, - npm_config_loglevel: 'warn' - }) -} - -const fixture = new Tacks(Dir({ - cache: Dir(), - global: Dir(), - tmp: Dir(), - testdir: ${indent(' ', tacks.fixture.toSource())} -})) - -function setup () { - cleanup() - fixture.create(basedir) -} - -function cleanup () { - fixture.remove(basedir) -} - -test('setup', t => { - setup() - return common.fakeRegistry.listen() -}) - -test('example', t => { - return common.npm(['install'], conf).then(([code, stdout, stderr]) => { - t.is(code, 0, 'command ran ok') - t.comment(stdout.trim()) - t.comment(stderr.trim()) - // your assertions here - }) -}) - -test('cleanup', t => { - common.fakeRegistry.close() - cleanup() - t.done() -})\n` -} diff --git a/scripts/pr b/scripts/pr deleted file mode 100755 index 30a3b05ffe3b1..0000000000000 --- a/scripts/pr +++ /dev/null @@ -1,167 +0,0 @@ -#!/usr/bin/env bash - -# Land a pull request -# Creates a PR-### branch, pulls the commits, opens up an interactive rebase to -# squash, and then annotates the commit with the changelog goobers -# -# Usage: -# pr [=origin] - -main () { - if [ "$1" = "finish" ]; then - shift - finish "$@" - return $? - fi - - local url="$(prurl "$@")" - local num=$(basename $url) - local prpath="${url#git@github.com:}" - local repo=${prpath%/pull/$num} - local prweb="https://github.com/$prpath" - local root="$(prroot "$url")" - local api="https://api.github.com/repos/${repo}/pulls/${num}" - local user=$(curl -s $api | json user.login) - local ref="$(prref "$url" "$root")" - local curhead="$(git show --no-patch --pretty=%H HEAD)" - local curbranch="$(git rev-parse --abbrev-ref HEAD)" - local cleanlines - IFS=$'\n' cleanlines=($(git status -s -uno)) - if [ ${#cleanlines[@]} -ne 0 ]; then - echo "working dir not clean" >&2 - IFS=$'\n' echo "${cleanlines[@]}" >&2 - echo "aborting PR merge" >&2 - fi - - # ok, ready to rock - branch=PR-$num - if [ "$curbranch" == "$branch" ]; then - echo "already on $branch, you're on your own" >&2 - return 1 - fi - - me=$(git config github.user || git config user.name) - if [ "$me" == "" ]; then - echo "run 'git config --add github.user '" >&2 - return 1 - fi - - exists=$(git show --no-patch --pretty=%H $branch 2>/dev/null) - if [ "$exists" == "" ]; then - git fetch origin pull/$num/head:$branch - git checkout $branch - else - git checkout $branch - git pull --rebase origin pull/$num/head - fi - - git rebase -i $curbranch # squash and test - - if [ $? -eq 0 ]; then - finish "${curbranch}" - else - echo "resolve conflicts and run: $0 finish "'"'${curbranch}'"' - fi -} - -# add the PR-URL to the last commit, after squashing -finish () { - if [ $# -eq 0 ]; then - echo "Usage: $0 finish (while on a PR-### branch)" >&2 - return 1 - fi - - local curbranch="$1" - local ref=$(cat .git/HEAD) - local prnum - case $ref in - "ref: refs/heads/PR-"*) - prnum=${ref#ref: refs/heads/PR-} - ;; - *) - echo "not on the PR-## branch any more!" >&2 - return 1 - ;; - esac - - local me=$(git config github.user || git config user.name) - if [ "$me" == "" ]; then - echo "run 'git config --add github.user '" >&2 - return 1 - fi - - set -x - - local url="$(prurl "$prnum")" - local num=$prnum - local prpath="${url#git@github.com:}" - local repo=${prpath%/pull/$num} - local prweb="https://github.com/$prpath" - local root="$(prroot "$url")" - - local api="https://api.github.com/repos/${repo}/pulls/${num}" - local user=$(curl -s $api | json user.login) - - local lastmsg="$(git log -1 --pretty=%B)" - local newmsg="${lastmsg} - -PR-URL: ${prweb} -Credit: @${user} -Close: #${num} -Reviewed-by: @${me} -" - git commit --amend -m "$newmsg" - git checkout $curbranch - git merge PR-${prnum} --ff-only - set +x -} - - -prurl () { - local url="$1" - if [ "$url" == "" ] && type pbpaste &>/dev/null; then - url="$(pbpaste)" - fi - if [[ "$url" =~ ^[0-9]+$ ]]; then - local us="$2" - if [ "$us" == "" ]; then - us="origin" - fi - local num="$url" - local o="$(git config --get remote.${us}.url)" - url="${o}" - url="${url#(git:\/\/|https:\/\/)}" - url="${url#git@}" - url="${url#github.com[:\/]}" - url="${url%.git}" - url="https://github.com/${url}/pull/$num" - fi - url=${url%/commits} - url=${url%/files} - url="$(echo $url | perl -p -e 's/#issuecomment-[0-9]+$//g')" - - local p='^https:\/\/github.com\/[^\/]+\/[^\/]+\/pull\/[0-9]+$' - if ! [[ "$url" =~ $p ]]; then - echo "Usage:" - echo " $0 " - echo " $0 [=origin]" - type pbpaste &>/dev/null && - echo "(will read url/id from clipboard if not specified)" - exit 1 - fi - url="${url/https:\/\/github\.com\//git@github.com:}" - echo "$url" -} - -prroot () { - local url="$1" - echo "${url/\/pull\/+([0-9])/}" -} - -prref () { - local url="$1" - local root="$2" - echo "refs${url:${#root}}/head" -} - -main "$@" diff --git a/scripts/relocate.sh b/scripts/relocate.sh deleted file mode 100755 index ff40f857a679e..0000000000000 --- a/scripts/relocate.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash - -# Change the cli shebang to point at the specified node -# Useful for when the program is moved around after install. -# Also used by the default 'make install' in node to point -# npm at the newly installed node, rather than the first one -# in the PATH, which would be the default otherwise. - -# bash /path/to/npm/scripts/relocate.sh $nodepath -# If $nodepath is blank, then it'll use /usr/bin/env - -dir="$(dirname "$(dirname "$0")")" -cli="$dir"/bin/npm-cli.js -tmp="$cli".tmp - -node="$1" -if [ "x$node" = "x" ]; then - node="/usr/bin/env node" -fi -node="#!$node" - -sed -e 1d "$cli" > "$tmp" -echo "$node" > "$cli" -cat "$tmp" >> "$cli" -rm "$tmp" -chmod ogu+x $cli diff --git a/tap-snapshots/test/lib/commands/audit.js.test.cjs b/tap-snapshots/test/lib/commands/audit.js.test.cjs new file mode 100644 index 0000000000000..d98c16f7905a5 --- /dev/null +++ b/tap-snapshots/test/lib/commands/audit.js.test.cjs @@ -0,0 +1,111 @@ +/* IMPORTANT + * This snapshot file is auto-generated, but designed for humans. + * It should be checked into source control and tracked carefully. + * Re-generate by setting TAP_SNAPSHOT=1 and running tests. + * Make sure to inspect the output below. Do not ignore changes! + */ +'use strict' +exports[`test/lib/commands/audit.js TAP audit fix > lockfile has test-dep-a@1.0.1 1`] = ` +{ + "name": "test-dep", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "test-dep", + "version": "1.0.0", + "dependencies": { + "test-dep-a": "*" + } + }, + "node_modules/test-dep-a": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/test-dep-a/-/test-dep-a-1.0.1.tgz" + } + }, + "dependencies": { + "test-dep-a": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/test-dep-a/-/test-dep-a-1.0.1.tgz" + } + } +} + +` + +exports[`test/lib/commands/audit.js TAP audit fix > must match snapshot 1`] = ` + +added 1 package, and audited 2 packages in xxx + +found 0 vulnerabilities +` + +exports[`test/lib/commands/audit.js TAP json audit > must match snapshot 1`] = ` +{ + "auditReportVersion": 2, + "vulnerabilities": { + "test-dep-a": { + "name": "test-dep-a", + "severity": "high", + "isDirect": true, + "via": [ + { + "source": 100, + "name": "test-dep-a", + "dependency": "test-dep-a", + "title": "Test advisory 100", + "url": "https://github.com/advisories/GHSA-100", + "severity": "high", + "cwe": [ + "cwe-0" + ], + "cvss": { + "score": 0 + }, + "range": "*" + } + ], + "effects": [], + "range": "*", + "nodes": [ + "node_modules/test-dep-a" + ], + "fixAvailable": false + } + }, + "metadata": { + "vulnerabilities": { + "info": 0, + "low": 0, + "moderate": 0, + "high": 1, + "critical": 0, + "total": 1 + }, + "dependencies": { + "prod": 2, + "dev": 0, + "optional": 0, + "peer": 0, + "peerOptional": 0, + "total": 1 + } + } +} +` + +exports[`test/lib/commands/audit.js TAP normal audit > must match snapshot 1`] = ` +# npm audit report + +test-dep-a * +Severity: high +Test advisory 100 - https://github.com/advisories/GHSA-100 +No fix available +node_modules/test-dep-a + +1 high severity vulnerability + +Some issues need review, and may require choosing +a different dependency. +` diff --git a/tap-snapshots/test/lib/load-all-commands.js.test.cjs b/tap-snapshots/test/lib/load-all-commands.js.test.cjs index 0ad87b945fce7..cd8b0592c36e8 100644 --- a/tap-snapshots/test/lib/load-all-commands.js.test.cjs +++ b/tap-snapshots/test/lib/load-all-commands.js.test.cjs @@ -161,7 +161,6 @@ npm dedupe Options: [--global-style] [--legacy-bundling] [--strict-peer-deps] [--no-package-lock] -[-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle] [--omit [--omit ...]] [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run] [-w|--workspace [-w|--workspace ...]] diff --git a/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs b/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs index d7c43080298eb..91f0d782878a3 100644 --- a/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs +++ b/tap-snapshots/test/lib/utils/config/definitions.js.test.cjs @@ -795,6 +795,8 @@ This option can be used when it's desirable to optionally run a script when it's present and fail if the script fails. This is useful, for example, when running scripts that may only apply for some builds in an otherwise generic CI setup. + +This value is not exported to the environment for child processes. ` exports[`test/lib/utils/config/definitions.js TAP > config description for ignore-scripts 1`] = ` @@ -848,6 +850,8 @@ Include the workspace root when workspaces are enabled for a command. When false, specifying individual workspaces via the \`workspace\` config, or all workspaces via the \`workspaces\` flag, will cause npm to operate only on the specified workspaces, and not on the root project. + +This value is not exported to the environment for child processes. ` exports[`test/lib/utils/config/definitions.js TAP > config description for init-author-email 1`] = ` @@ -1424,8 +1428,7 @@ The base URL of the npm registry. exports[`test/lib/utils/config/definitions.js TAP > config description for save 1`] = ` #### \`save\` -* Default: \`true\` unless when using \`npm update\` or \`npm dedupe\` where it - defaults to \`false\` +* Default: \`true\` unless when using \`npm update\` where it defaults to \`false\` * Type: Boolean Save installed packages to a \`package.json\` file as dependencies. diff --git a/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs b/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs index 2647bc31bcdb8..7b13c34daf682 100644 --- a/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs +++ b/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs @@ -636,6 +636,8 @@ it's present and fail if the script fails. This is useful, for example, when running scripts that may only apply for some builds in an otherwise generic CI setup. +This value is not exported to the environment for child processes. + @@ -693,6 +695,8 @@ When false, specifying individual workspaces via the \`workspace\` config, or all workspaces via the \`workspaces\` flag, will cause npm to operate only on the specified workspaces, and not on the root project. +This value is not exported to the environment for child processes. + @@ -1217,8 +1221,7 @@ The base URL of the npm registry. #### \`save\` -* Default: \`true\` unless when using \`npm update\` or \`npm dedupe\` where it - defaults to \`false\` +* Default: \`true\` unless when using \`npm update\` where it defaults to \`false\` * Type: Boolean Save installed packages to a \`package.json\` file as dependencies. diff --git a/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs b/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs index e6afc973ab10e..fef4cc65edc65 100644 --- a/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs +++ b/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs @@ -293,7 +293,6 @@ All commands: Options: [--global-style] [--legacy-bundling] [--strict-peer-deps] [--no-package-lock] - [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle] [--omit [--omit ...]] [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run] [-w|--workspace [-w|--workspace ...]] diff --git a/test/fixtures/mock-npm.js b/test/fixtures/mock-npm.js index 13f8a0ea01c7e..07e4cb8283b4c 100644 --- a/test/fixtures/mock-npm.js +++ b/test/fixtures/mock-npm.js @@ -83,6 +83,10 @@ const LoadMockNpm = async (t, { const { Npm, ...rest } = RealMockNpm(t, mocks) + // We want to fail fast when writing tests. Default this to 0 unless it was + // explicitly set in a test. + config = { 'fetch-retries': 0, ...config } + if (!init && load) { throw new Error('cant `load` without `init`') } diff --git a/test/fixtures/mock-registry.js b/test/fixtures/mock-registry.js new file mode 100644 index 0000000000000..1cbe7b52dbe4e --- /dev/null +++ b/test/fixtures/mock-registry.js @@ -0,0 +1,136 @@ +/* + * Mock registry class + * + * This should end up as the centralized place where we generate test fixtures + * for tests against any registry data. + */ +const pacote = require('pacote') +class MockRegistry { + #tap + #nock + #registry + #authorization + + constructor (opts) { + if (!opts.registry) { + throw new Error('mock registry requires a registry value') + } + this.#registry = (new URL(opts.registry)).origin + this.#authorization = opts.authorization + // Required for this.package + this.#tap = opts.tap + } + + get nock () { + if (!this.#nock) { + if (!this.#tap) { + throw new Error('cannot mock packages without a tap fixture') + } + const tnock = require('./tnock.js') + const reqheaders = {} + if (this.#authorization) { + reqheaders.authorization = `Bearer ${this.#authorization}` + } + this.#nock = tnock(this.#tap, this.#registry, { reqheaders }) + } + return this.#nock + } + + set nock (nock) { + this.#nock = nock + } + + async whoami ({ username }) { + this.nock.get('/-/whoami').reply(200, { username }) + } + + advisory (advisory = {}) { + const id = advisory.id || parseInt(Math.random() * 1000000) + return { + id, + url: `https://github.com/advisories/GHSA-${id}`, + title: `Test advisory ${id}`, + severity: 'high', + vulnerable_versions: '*', + cwe: [ + 'cwe-0', + ], + cvss: { + score: 0, + }, + ...advisory, + } + } + + async package ({ manifest, times = 1, query, tarballs }) { + let nock = this.nock + nock = nock.get(`/${manifest.name}`).times(times) + if (query) { + nock = nock.query(query) + } + nock = nock.reply(200, manifest) + if (tarballs) { + for (const version in tarballs) { + // for (const version in manifest.versions) { + const packument = manifest.versions[version] + const dist = new URL(packument.dist.tarball) + const tarball = await pacote.tarball(tarballs[version]) + nock.get(dist.pathname).reply(200, tarball) + } + } + this.nock = nock + } + + // the last packument in the packuments array will be tagged as latest + manifest ({ name = 'test-package', packuments } = {}) { + packuments = this.packuments(packuments, name) + const latest = packuments.slice(-1)[0] + const manifest = { + _id: `${name}@${latest.version}`, + _rev: '00-testdeadbeef', + name, + description: 'test package mock manifest', + dependencies: {}, + versions: {}, + time: {}, + 'dist-tags': { latest: latest.version }, + ...latest, + } + + for (const packument of packuments) { + manifest.versions[packument.version] = { + _id: `${name}@${packument.version}`, + name, + description: 'test package mock manifest', + dependencies: {}, + dist: { + tarball: `${this.#registry}/${name}/-/${name}-${packument.version}.tgz`, + }, + ...packument, + } + manifest.time[packument.version] = new Date() + } + + return manifest + } + + packuments (packuments = ['1.0.0'], name) { + return packuments.map(p => this.packument(p, name)) + } + + // Generate packument from shorthand + packument (packument, name = 'test-package') { + if (!packument.version) { + packument = { version: packument } + } + return { + name, + version: '1.0.0', + description: 'mocked test package', + dependencies: {}, + ...packument, + } + } +} + +module.exports = MockRegistry diff --git a/test/lib/auth/sso.js b/test/lib/auth/sso.js index 473c8cc241467..eab51f06c0ab2 100644 --- a/test/lib/auth/sso.js +++ b/test/lib/auth/sso.js @@ -29,16 +29,6 @@ const sso = t.mock('../../../lib/auth/sso.js', { ) } }, - '../../../lib/utils/otplease.js': (opts, fn) => { - if (opts) { - return fn({ ...opts, otp: '1234' }) - } else { - throw Object.assign( - new Error('failed retrieving otp'), - { code: 'ERROR' } - ) - } - }, }) const npm = { @@ -75,7 +65,6 @@ t.test('simple login', async (t) => { opts, { creds: {}, - otp: '1234', registry: 'https://registry.npmjs.org/', scope: '', ssoType: 'oauth', diff --git a/test/lib/commands/audit.js b/test/lib/commands/audit.js index 05f268d6bcd0e..1afb8d333b7ce 100644 --- a/test/lib/commands/audit.js +++ b/test/lib/commands/audit.js @@ -1,139 +1,156 @@ const t = require('tap') -const { load: _loadMockNpm } = require('../../fixtures/mock-npm') -t.test('should audit using Arborist', async t => { - let ARB_ARGS = null - let AUDIT_CALLED = false - let REIFY_FINISH_CALLED = false - let AUDIT_REPORT_CALLED = false - let ARB_OBJ = null +const { load: loadMockNpm } = require('../../fixtures/mock-npm') +const MockRegistry = require('../../fixtures/mock-registry.js') +const util = require('util') +const zlib = require('zlib') +const gzip = util.promisify(zlib.gzip) +const path = require('path') +const fs = require('fs') - const loadMockNpm = (t) => _loadMockNpm(t, { - mocks: { - 'npm-audit-report': () => { - AUDIT_REPORT_CALLED = true - return { - report: 'there are vulnerabilities', - exitCode: 0, - } +t.cleanSnapshot = str => str.replace(/packages in [0-9]+[a-z]+/g, 'packages in xxx') + +const tree = { + 'package.json': JSON.stringify({ + name: 'test-dep', + version: '1.0.0', + dependencies: { + 'test-dep-a': '*', + }, + }), + 'package-lock.json': JSON.stringify({ + name: 'test-dep', + version: '1.0.0', + lockfileVersion: 2, + requires: true, + packages: { + '': { + xname: 'scratch', + version: '1.0.0', + dependencies: { + 'test-dep-a': '*', + }, + devDependencies: {}, }, - '@npmcli/arborist': function (args) { - ARB_ARGS = args - ARB_OBJ = this - this.audit = () => { - AUDIT_CALLED = true - this.auditReport = {} - } + 'node_modules/test-dep-a': { + name: 'test-dep-a', + version: '1.0.0', }, - '../../lib/utils/reify-finish.js': (npm, arb) => { - if (arb !== ARB_OBJ) { - throw new Error('got wrong object passed to reify-output') - } - - REIFY_FINISH_CALLED = true + }, + dependencies: { + 'test-dep-a': { + version: '1.0.0', }, }, - }) + }), + 'test-dep-a': { + 'package.json': JSON.stringify({ + name: 'test-dep-a', + version: '1.0.1', + }), + 'fixed.txt': 'fixed test-dep-a', + }, +} - t.test('audit', async t => { - const { npm, outputs } = await loadMockNpm(t) - await npm.exec('audit', []) - t.match(ARB_ARGS, { audit: true, path: npm.prefix }) - t.equal(AUDIT_CALLED, true, 'called audit') - t.equal(AUDIT_REPORT_CALLED, true, 'called audit report') - t.match(outputs, [['there are vulnerabilities']]) +t.test('normal audit', async t => { + const { npm, joinedOutput } = await loadMockNpm(t, { + prefixDir: tree, + }) + const registry = new MockRegistry({ + tap: t, + registry: npm.config.get('registry'), }) - t.test('audit fix', async t => { - const { npm } = await loadMockNpm(t) - await npm.exec('audit', ['fix']) - t.equal(REIFY_FINISH_CALLED, true, 'called reify output') + const manifest = registry.manifest({ + name: 'test-dep-a', + packuments: [{ version: '1.0.0' }, { version: '1.0.1' }], }) + await registry.package({ manifest }) + const advisory = registry.advisory({ id: 100 }) + const bulkBody = await gzip(JSON.stringify({ 'test-dep-a': ['1.0.0'] })) + registry.nock.post('/-/npm/v1/security/advisories/bulk', bulkBody) + .reply(200, { + 'test-dep-a': [advisory], + }) + + await npm.exec('audit', []) + t.ok(process.exitCode, 'would have exited uncleanly') + process.exitCode = 0 + t.matchSnapshot(joinedOutput()) }) -t.test('should audit - json', async t => { - t.plan(1) - const { npm } = await _loadMockNpm(t, { - mocks: { - 'npm-audit-report': (_, opts) => { - t.match(opts.reporter, 'json') - return { - report: 'there are vulnerabilities', - exitCode: 0, - } - }, - '@npmcli/arborist': function () { - this.audit = () => { - this.auditReport = {} - } - }, - '../../lib/utils/reify-output.js': () => {}, - }, +t.test('json audit', async t => { + const { npm, joinedOutput } = await loadMockNpm(t, { + prefixDir: tree, config: { json: true, }, }) + const registry = new MockRegistry({ + tap: t, + registry: npm.config.get('registry'), + }) + + const manifest = registry.manifest({ + name: 'test-dep-a', + packuments: [{ version: '1.0.0' }, { version: '1.0.1' }], + }) + await registry.package({ manifest }) + const advisory = registry.advisory({ id: 100 }) + const bulkBody = await gzip(JSON.stringify({ 'test-dep-a': ['1.0.0'] })) + registry.nock.post('/-/npm/v1/security/advisories/bulk', bulkBody) + .reply(200, { + 'test-dep-a': [advisory], + }) + await npm.exec('audit', []) + t.ok(process.exitCode, 'would have exited uncleanly') + process.exitCode = 0 + t.matchSnapshot(joinedOutput()) }) -t.test('report endpoint error', async t => { - const loadMockNpm = (t, options) => _loadMockNpm(t, { - mocks: { - 'npm-audit-report': () => { - throw new Error('should not call audit report when there are errors') - }, - '@npmcli/arborist': function () { - this.audit = () => { - this.auditReport = { - error: { - message: 'hello, this didnt work', - method: 'POST', - uri: 'https://example.com/', - headers: { - head: ['ers'], - }, - statusCode: 420, - body: 'this is a string', - }, - } - } - }, - '../../lib/utils/reify-output.js': () => {}, - }, - ...options, +t.test('audit fix', async t => { + const { npm, joinedOutput } = await loadMockNpm(t, { + prefixDir: tree, }) - - t.test('json=false', async t => { - const { npm, outputs, logs } = await loadMockNpm(t, { config: { json: false } }) - await t.rejects(npm.exec('audit', []), 'audit endpoint returned an error') - t.match(logs.warn, [['audit', 'hello, this didnt work']]) - t.strictSame(outputs, [['this is a string']]) + const registry = new MockRegistry({ + tap: t, + registry: npm.config.get('registry'), }) - - t.test('json=true', async t => { - const { npm, outputs, logs } = await loadMockNpm(t, { config: { json: true } }) - await t.rejects(npm.exec('audit', []), 'audit endpoint returned an error') - t.match(logs.warn, [['audit', 'hello, this didnt work']]) - t.strictSame(outputs, [[ - '{\n' + - ' "message": "hello, this didnt work",\n' + - ' "method": "POST",\n' + - ' "uri": "https://example.com/",\n' + - ' "headers": {\n' + - ' "head": [\n' + - ' "ers"\n' + - ' ]\n' + - ' },\n' + - ' "statusCode": 420,\n' + - ' "body": "this is a string"\n' + - '}', - ], - ]) + const manifest = registry.manifest({ + name: 'test-dep-a', + packuments: [{ version: '1.0.0' }, { version: '1.0.1' }], + }) + await registry.package({ + manifest, + tarballs: { + '1.0.1': path.join(npm.prefix, 'test-dep-a'), + }, }) + const advisory = registry.advisory({ id: 100, vulnerable_versions: '1.0.0' }) + // Can't validate this request body because it changes with each node + // version/npm version and nock's body validation is not async, while + // zlib.gunzip is + registry.nock.post('/-/npm/v1/security/advisories/bulk') + .reply(200, { // first audit + 'test-dep-a': [advisory], + }) + .post('/-/npm/v1/security/advisories/bulk') + .reply(200, { // after fix + 'test-dep-a': [advisory], + }) + await npm.exec('audit', ['fix']) + t.matchSnapshot(joinedOutput()) + const pkg = fs.readFileSync(path.join(npm.prefix, 'package-lock.json'), 'utf8') + t.matchSnapshot(pkg, 'lockfile has test-dep-a@1.0.1') + t.ok( + fs.existsSync(path.join(npm.prefix, 'node_modules', 'test-dep-a', 'fixed.txt')), + 'has test-dep-a@1.0.1 on disk' + ) }) t.test('completion', async t => { - const { npm } = await _loadMockNpm(t) + const { npm } = await loadMockNpm(t) const audit = await npm.cmd('audit') t.test('fix', async t => { await t.resolveMatch( diff --git a/test/lib/commands/completion.js b/test/lib/commands/completion.js index d4e6f1199c457..6cc1677552e8a 100644 --- a/test/lib/commands/completion.js +++ b/test/lib/commands/completion.js @@ -6,20 +6,19 @@ const completionScript = fs .readFileSync(path.resolve(__dirname, '../../../lib/utils/completion.sh'), { encoding: 'utf8' }) .replace(/^#!.*?\n/, '') -const { load: _loadMockNpm } = require('../../fixtures/mock-npm') +const { load: loadMockNpm } = require('../../fixtures/mock-npm') const mockGlobals = require('../../fixtures/mock-globals') const loadMockCompletion = async (t, o = {}) => { - const { globals, windows, ...options } = o + const { globals = {}, windows, ...options } = o let resetGlobals = {} - if (globals) { - resetGlobals = mockGlobals(t, globals).reset - } - const res = await _loadMockNpm(t, { - mocks: { - '../../lib/utils/is-windows.js': { isWindowsShell: !!windows }, - ...options.mocks, - }, + resetGlobals = mockGlobals(t, { + 'process.platform': windows ? 'win32' : 'posix', + 'process.env.term': 'notcygwin', + 'process.env.msystem': 'nogmingw', + ...globals, + }).reset + const res = await loadMockNpm(t, { ...options, }) const completion = await res.npm.cmd('completion') diff --git a/test/lib/commands/dedupe.js b/test/lib/commands/dedupe.js index bf6964081ca79..0ca51245cc818 100644 --- a/test/lib/commands/dedupe.js +++ b/test/lib/commands/dedupe.js @@ -1,5 +1,9 @@ const t = require('tap') +const path = require('path') +const fs = require('fs') + const { load: loadMockNpm } = require('../../fixtures/mock-npm') +const MockRegistry = require('../../fixtures/mock-registry.js') t.test('should throw in global mode', async (t) => { const { npm } = await loadMockNpm(t, { @@ -14,45 +18,79 @@ t.test('should throw in global mode', async (t) => { ) }) -t.test('should remove dupes using Arborist', async (t) => { - t.plan(5) - const { npm } = await loadMockNpm(t, { - mocks: { - '@npmcli/arborist': function (args) { - t.ok(args, 'gets options object') - t.ok(args.path, 'gets path option') - t.ok(args.dryRun, 'gets dryRun from user') - this.dedupe = () => { - t.ok(true, 'dedupe is called') - } - }, - '../../lib/utils/reify-finish.js': (npm, arb) => { - t.ok(arb, 'gets arborist tree') +const treeWithDupes = { + 'package.json': JSON.stringify({ + name: 'test-top', + version: '1.0.0', + dependencies: { + 'test-dep-a': '*', + 'test-dep-b': '*', + }, + }), + node_modules: { + 'test-dep-a': { + 'package.json': JSON.stringify({ + name: 'test-dep-a', + version: '1.0.1', + dependencies: { 'test-sub': '*' }, + }), + node_modules: { + 'test-sub': { + 'package.json': JSON.stringify({ + name: 'test-sub', + version: '1.0.0', + }), + }, }, }, - config: { - 'dry-run': 'true', + 'test-dep-b': { + 'package.json': JSON.stringify({ + name: 'test-dep-b', + version: '1.0.0', + dependencies: { 'test-sub': '*' }, + }), + node_modules: { + 'test-sub': { + 'package.json': JSON.stringify({ + name: 'test-sub', + version: '1.0.0', + }), + }, + }, }, + }, +} + +t.test('dedupe', async (t) => { + const { npm, joinedOutput } = await loadMockNpm(t, { + prefixDir: treeWithDupes, + }) + const registry = new MockRegistry({ + tap: t, + registry: npm.config.get('registry'), + }) + const manifestSub = registry.manifest({ + name: 'test-sub', + packuments: [{ version: '1.0.0' }], }) - await npm.exec('dedupe', []) -}) -t.test('should remove dupes using Arborist - no arguments', async (t) => { - t.plan(2) - const { npm } = await loadMockNpm(t, { - mocks: { - '@npmcli/arborist': function (args) { - t.ok(args.dryRun, 'gets dryRun from config') - t.ok(args.save, 'gets user-set save value from config') - this.dedupe = () => {} - }, - '../../lib/utils/reify-output.js': () => {}, - '../../lib/utils/reify-finish.js': () => {}, - }, - config: { - 'dry-run': true, - save: true, + await registry.package({ + manifest: manifestSub, + tarballs: { + '1.0.0': path.join(npm.prefix, 'node_modules', 'test-dep-a', 'node_modules', 'test-sub'), }, }) await npm.exec('dedupe', []) + t.match(joinedOutput(), /added 1 package, and removed 2 packages/) + t.ok( + fs.existsSync(path.join(npm.prefix, 'node_modules', 'test-sub')), + 'test-sub was hoisted' + ) + t.notOk( + fs.existsSync(path.join(npm.prefix, 'node_modules', 'test-dep-a', 'node_modules', 'test-sub')), + 'test-dep-a/test-sub was removed' + ) + t.notOk( + fs.existsSync(path.join(npm.prefix, 'node_modules', 'test-dep-b', 'node_modules', 'test-sub')), + 'test-dep-b/test-sub was removed') }) diff --git a/test/lib/commands/deprecate.js b/test/lib/commands/deprecate.js index 180629a7488f9..37a407c3b6a1a 100644 --- a/test/lib/commands/deprecate.js +++ b/test/lib/commands/deprecate.js @@ -19,7 +19,6 @@ npmFetch.json = async (uri, opts) => { const Deprecate = t.mock('../../../lib/commands/deprecate.js', { '../../../lib/utils/get-identity.js': async () => getIdentityImpl(), - '../../../lib/utils/otplease.js': async (opts, fn) => fn(opts), libnpmaccess: { lsPackages: async () => ({ foo: 'write', bar: 'write', baz: 'write', buzz: 'read' }), }, diff --git a/test/lib/commands/find-dupes.js b/test/lib/commands/find-dupes.js index 06bd097b6ca59..228ac662b4454 100644 --- a/test/lib/commands/find-dupes.js +++ b/test/lib/commands/find-dupes.js @@ -1,28 +1,84 @@ const t = require('tap') +const path = require('path') +const fs = require('fs') const { load: loadMockNpm } = require('../../fixtures/mock-npm') +const MockRegistry = require('../../fixtures/mock-registry.js') -t.test('should run dedupe in dryRun mode', async (t) => { - t.plan(5) - const { npm } = await loadMockNpm(t, { - mocks: { - '@npmcli/arborist': function (args) { - t.ok(args, 'gets options object') - t.ok(args.path, 'gets path option') - t.ok(args.dryRun, 'is called in dryRun mode') - this.dedupe = () => { - t.ok(true, 'dedupe is called') - } +const treeWithDupes = { + 'package.json': JSON.stringify({ + name: 'test-top', + version: '1.0.0', + dependencies: { + 'test-dep-a': '*', + 'test-dep-b': '*', + }, + }), + node_modules: { + 'test-dep-a': { + 'package.json': JSON.stringify({ + name: 'test-dep-a', + version: '1.0.1', + dependencies: { 'test-sub': '*' }, + }), + node_modules: { + 'test-sub': { + 'package.json': JSON.stringify({ + name: 'test-sub', + version: '1.0.0', + }), + }, }, - '../../lib/utils/reify-finish.js': (npm, arb) => { - t.ok(arb, 'gets arborist tree') + }, + 'test-dep-b': { + 'package.json': JSON.stringify({ + name: 'test-dep-b', + version: '1.0.0', + dependencies: { 'test-sub': '*' }, + }), + node_modules: { + 'test-sub': { + 'package.json': JSON.stringify({ + name: 'test-sub', + version: '1.0.0', + }), + }, }, }, + }, +} + +t.test('should run dedupe in dryRun mode', async (t) => { + const { npm, joinedOutput } = await loadMockNpm(t, { + prefixDir: treeWithDupes, config: { // explicitly set to false so we can be 100% sure it's always true when it // hits arborist 'dry-run': false, }, }) + const registry = new MockRegistry({ + tap: t, + registry: npm.config.get('registry'), + }) + + const manifestSub = registry.manifest({ + name: 'test-sub', + manifests: [{ name: 'test-sub', version: '1.0.0' }], + }) + + await registry.package({ manifest: manifestSub }) await npm.exec('find-dupes', []) + t.match(joinedOutput(), /added 1 package, and removed 2 packages/) + t.notOk( + fs.existsSync(path.join(npm.prefix, 'node_modules', 'test-sub')), + 'test-sub was not hoisted' + ) + t.ok( + fs.existsSync(path.join(npm.prefix, 'node_modules', 'test-dep-a', 'node_modules', 'test-sub')), + 'test-dep-a/test-sub was not removed' + ) + t.ok( + fs.existsSync(path.join(npm.prefix, 'node_modules', 'test-dep-b', 'node_modules', 'test-sub')), + 'test-dep-b/test-sub was not removed') }) diff --git a/test/lib/commands/hook.js b/test/lib/commands/hook.js index 60a59a3fe7a3b..95bac83d7b6eb 100644 --- a/test/lib/commands/hook.js +++ b/test/lib/commands/hook.js @@ -63,7 +63,6 @@ const libnpmhook = { } const Hook = t.mock('../../../lib/commands/hook.js', { - '../../../lib/utils/otplease.js': async (opts, fn) => fn(opts), libnpmhook, }) const hook = new Hook(npm) diff --git a/test/lib/commands/org.js b/test/lib/commands/org.js index 3ae951dd5c453..cd25fc23aa334 100644 --- a/test/lib/commands/org.js +++ b/test/lib/commands/org.js @@ -43,7 +43,6 @@ const libnpmorg = { } const Org = t.mock('../../../lib/commands/org.js', { - '../../../lib/utils/otplease.js': async (opts, fn) => fn(opts), libnpmorg, }) const org = new Org(npm) diff --git a/test/lib/commands/owner.js b/test/lib/commands/owner.js index 83f4d880f74ad..eadfa2bf08b56 100644 --- a/test/lib/commands/owner.js +++ b/test/lib/commands/owner.js @@ -21,7 +21,6 @@ const mocks = { 'proc-log': log, 'npm-registry-fetch': npmFetch, pacote, - '../../../lib/utils/otplease.js': async (opts, fn) => fn({ otp: '123456', opts }), '../../../lib/utils/read-package-name.js': async (prefix) => { readPackageNamePrefix = prefix return readPackageNameResponse @@ -193,7 +192,6 @@ t.test('owner add ', async t => { _rev: '1-foobaaa1', maintainers: npmcliMaintainers, }, - otp: '123456', spec: { name: '@npmcli/map-workspaces', }, @@ -507,7 +505,6 @@ t.test('owner rm ', async t => { body: { _rev: '1-foobaaa1', }, - otp: '123456', spec: { name: '@npmcli/map-workspaces', }, diff --git a/test/lib/commands/profile.js b/test/lib/commands/profile.js index 82ac495420928..da32d4300840a 100644 --- a/test/lib/commands/profile.js +++ b/test/lib/commands/profile.js @@ -41,10 +41,6 @@ const mocks = { .join('\n') } }, - '../../../lib/utils/pulse-till-done.js': { - withPromise: async a => a, - }, - '../../../lib/utils/otplease.js': async (opts, fn) => fn(opts), '../../../lib/utils/read-user-info.js': { async password () {}, async otp () {}, diff --git a/test/lib/commands/team.js b/test/lib/commands/team.js index 592dbc3a0ec2e..792418788bcd1 100644 --- a/test/lib/commands/team.js +++ b/test/lib/commands/team.js @@ -22,7 +22,6 @@ const npm = mockNpm({ const mocks = { libnpmteam, 'cli-columns': a => a.join(' '), - '../../../lib/utils/otplease.js': async (opts, fn) => fn(opts), } t.afterEach(() => { diff --git a/test/lib/commands/token.js b/test/lib/commands/token.js index 65a094a0bca24..c32c0b74a96f4 100644 --- a/test/lib/commands/token.js +++ b/test/lib/commands/token.js @@ -10,9 +10,6 @@ const npm = { } const mockToken = (otherMocks) => t.mock('../../../lib/commands/token.js', { - '../../../lib/utils/otplease.js': (opts, fn) => { - return Promise.resolve().then(() => fn(opts)) - }, '../../../lib/utils/read-user-info.js': mocks.readUserInfo, 'npm-profile': mocks.profile, ...otherMocks, diff --git a/test/lib/commands/unpublish.js b/test/lib/commands/unpublish.js index 71be4a5d6908d..829d41c5bb875 100644 --- a/test/lib/commands/unpublish.js +++ b/test/lib/commands/unpublish.js @@ -1,36 +1,7 @@ const t = require('tap') const { load: loadMockNpm } = require('../../fixtures/mock-npm') -const tnock = require('../../fixtures/tnock.js') - -const pkgManifest = (name, version = '1.0.0') => { - return { - _id: `${name}@${version}`, - _rev: '00-testdeadbeef', - name, - versions: { - '1.0.0': { - name, - version: '1.0.0', - dist: { - tarball: `https://registry.npmjs.org/${name}/-/${name}-1.0.0.tgz`, - }, - }, - [version]: { - name, - version: version, - dist: { - tarball: `https://registry.npmjs.org/${name}/-/${name}-${version}.tgz`, - }, - }, - }, - time: { - '1.0.0': new Date(), - [version]: new Date(), - }, - 'dist-tags': { latest: version }, - } -} +const MockRegistry = require('../../fixtures/mock-registry.js') const user = 'test-user' const pkg = 'test-package' const auth = { '//registry.npmjs.org/:_authToken': 'test-auth-token' } @@ -49,12 +20,14 @@ t.test('no args --force success', async t => { }, }) - const manifest = pkgManifest(pkg) - tnock(t, npm.config.get('registry'), - { reqheaders: { authorization: 'Bearer test-auth-token' } }) - .get(`/${pkg}?write=true`).reply(200, manifest) - .delete(`/${pkg}/-rev/${manifest._rev}`).reply(201) - + const registry = new MockRegistry({ + tap: t, + registry: npm.config.get('registry'), + authorization: 'test-auth-token', + }) + const manifest = registry.manifest({ name: pkg }) + await registry.package({ manifest, query: { write: true } }) + registry.nock.delete(`/${pkg}/-rev/${manifest._rev}`).reply(201) await npm.exec('unpublish', []) t.equal(joinedOutput(), '- test-package@1.0.0') }) @@ -116,14 +89,20 @@ t.test('unpublish @version not the last version', async t => { ...auth, }, }) - const manifest = pkgManifest(pkg, '1.0.1') - tnock(t, npm.config.get('registry'), - { reqheaders: { authorization: 'Bearer test-auth-token' } }) - .get(`/${pkg}?write=true`).times(3).reply(200, manifest) - .put(`/${pkg}/-rev/${manifest._rev}`, body => { - // sets latest and deletes version 1.0.1 - return body['dist-tags'].latest === '1.0.0' && body.versions['1.0.1'] === undefined - }).reply(201) + const registry = new MockRegistry({ + tap: t, + registry: npm.config.get('registry'), + authorization: 'test-auth-token', + }) + const manifest = registry.manifest({ + name: pkg, + packuments: ['1.0.0', '1.0.1'], + }) + await registry.package({ manifest, query: { write: true }, times: 3 }) + registry.nock.put(`/${pkg}/-rev/${manifest._rev}`, body => { + // sets latest and deletes version 1.0.1 + return body['dist-tags'].latest === '1.0.0' && body.versions['1.0.1'] === undefined + }).reply(201) .intercept(`/${pkg}/-/${pkg}-1.0.1.tgz/-rev/${manifest._rev}`, 'DELETE').reply(201) await npm.exec('unpublish', ['test-package@1.0.1']) @@ -136,10 +115,13 @@ t.test('unpublish @version last version', async t => { ...auth, }, }) - const manifest = pkgManifest(pkg) - tnock(t, npm.config.get('registry'), - { reqheaders: { authorization: 'Bearer test-auth-token' } }) - .get(`/${pkg}?write=true`).reply(200, manifest) + const registry = new MockRegistry({ + tap: t, + registry: npm.config.get('registry'), + authorization: 'test-auth-token', + }) + const manifest = registry.manifest({ name: pkg }) + await registry.package({ manifest, query: { write: true } }) await t.rejects( npm.exec('unpublish', ['test-package@1.0.0']), @@ -159,13 +141,14 @@ t.test('no version found in package.json', async t => { }, null, 2), }, }) - - const manifest = pkgManifest(pkg) - - tnock(t, npm.config.get('registry'), - { reqheaders: { authorization: 'Bearer test-auth-token' } }) - .get(`/${pkg}?write=true`).reply(200, manifest) - .delete(`/${pkg}/-rev/${manifest._rev}`).reply(201) + const registry = new MockRegistry({ + tap: t, + registry: npm.config.get('registry'), + authorization: 'test-auth-token', + }) + const manifest = registry.manifest({ name: pkg }) + await registry.package({ manifest, query: { write: true } }) + registry.nock.delete(`/${pkg}/-rev/${manifest._rev}`).reply(201) await npm.exec('unpublish', []) t.equal(joinedOutput(), '- test-package') @@ -178,11 +161,14 @@ t.test('unpublish --force no version set', async t => { ...auth, }, }) - const manifest = pkgManifest(pkg) - tnock(t, npm.config.get('registry'), - { reqheaders: { authorization: 'Bearer test-auth-token' } }) - .get(`/${pkg}?write=true`).times(2).reply(200, manifest) - .delete(`/${pkg}/-rev/${manifest._rev}`).reply(201) + const registry = new MockRegistry({ + tap: t, + registry: npm.config.get('registry'), + authorization: 'test-auth-token', + }) + const manifest = registry.manifest({ name: pkg }) + await registry.package({ manifest, query: { write: true }, times: 2 }) + registry.nock.delete(`/${pkg}/-rev/${manifest._rev}`).reply(201) await npm.exec('unpublish', ['test-package']) t.equal(joinedOutput(), '- test-package') @@ -196,14 +182,20 @@ t.test('silent', async t => { ...auth, }, }) - const manifest = pkgManifest(pkg, '1.0.1') - tnock(t, npm.config.get('registry'), - { reqheaders: { authorization: 'Bearer test-auth-token' } }) - .get(`/${pkg}?write=true`).times(3).reply(200, manifest) - .put(`/${pkg}/-rev/${manifest._rev}`, body => { - // sets latest and deletes version 1.0.1 - return body['dist-tags'].latest === '1.0.0' && body.versions['1.0.1'] === undefined - }).reply(201) + const registry = new MockRegistry({ + tap: t, + registry: npm.config.get('registry'), + authorization: 'test-auth-token', + }) + const manifest = registry.manifest({ + name: pkg, + packuments: ['1.0.0', '1.0.1'], + }) + await registry.package({ manifest, query: { write: true }, times: 3 }) + registry.nock.put(`/${pkg}/-rev/${manifest._rev}`, body => { + // sets latest and deletes version 1.0.1 + return body['dist-tags'].latest === '1.0.0' && body.versions['1.0.1'] === undefined + }).reply(201) .delete(`/${pkg}/-/${pkg}-1.0.1.tgz/-rev/${manifest._rev}`).reply(201) await npm.exec('unpublish', ['test-package@1.0.1']) @@ -261,16 +253,19 @@ t.test('workspaces', async t => { }, prefixDir, }) - const manifestA = pkgManifest('workspace-a') - const manifestB = pkgManifest('workspace-b') - const manifestN = pkgManifest('workspace-n') - tnock(t, npm.config.get('registry'), - { reqheaders: { authorization: 'Bearer test-auth-token' } }) - .get('/workspace-a?write=true').times(2).reply(200, manifestA) - .delete(`/workspace-a/-rev/${manifestA._rev}`).reply(201) - .get('/workspace-b?write=true').times(2).reply(200, manifestB) + const registry = new MockRegistry({ + tap: t, + registry: npm.config.get('registry'), + authorization: 'test-auth-token', + }) + const manifestA = registry.manifest({ name: 'workspace-a' }) + const manifestB = registry.manifest({ name: 'workspace-b' }) + const manifestN = registry.manifest({ name: 'workspace-n' }) + await registry.package({ manifest: manifestA, query: { write: true }, times: 2 }) + await registry.package({ manifest: manifestB, query: { write: true }, times: 2 }) + await registry.package({ manifest: manifestN, query: { write: true }, times: 2 }) + registry.nock.delete(`/workspace-a/-rev/${manifestA._rev}`).reply(201) .delete(`/workspace-b/-rev/${manifestB._rev}`).reply(201) - .get('/workspace-n?write=true').times(2).reply(200, manifestN) .delete(`/workspace-n/-rev/${manifestN._rev}`).reply(201) await npm.exec('unpublish', []) @@ -286,11 +281,14 @@ t.test('workspaces', async t => { }, prefixDir, }) - const manifestA = pkgManifest('workspace-a') - tnock(t, npm.config.get('registry'), - { reqheaders: { authorization: 'Bearer test-auth-token' } }) - .get('/workspace-a?write=true').times(2).reply(200, manifestA) - .delete(`/workspace-a/-rev/${manifestA._rev}`).reply(201) + const registry = new MockRegistry({ + tap: t, + registry: npm.config.get('registry'), + authorization: 'test-auth-token', + }) + const manifestA = registry.manifest({ name: 'workspace-a' }) + await registry.package({ manifest: manifestA, query: { write: true }, times: 2 }) + registry.nock.delete(`/workspace-a/-rev/${manifestA._rev}`).reply(201) await npm.exec('unpublish', []) t.equal(joinedOutput(), '- workspace-a') @@ -304,11 +302,16 @@ t.test('dryRun with spec', async t => { ...auth, }, }) - - const manifest = pkgManifest(pkg, '1.0.1') - tnock(t, npm.config.get('registry'), - { reqheaders: { authorization: 'Bearer test-auth-token' } }) - .get(`/${pkg}?write=true`).reply(200, manifest) + const registry = new MockRegistry({ + tap: t, + registry: npm.config.get('registry'), + authorization: 'test-auth-token', + }) + const manifest = registry.manifest({ + name: pkg, + packuments: ['1.0.0', '1.0.1'], + }) + await registry.package({ manifest, query: { write: true } }) await npm.exec('unpublish', ['test-package@1.0.1']) t.equal(joinedOutput(), '- test-package@1.0.1') @@ -338,7 +341,6 @@ t.test('publishConfig no spec', async t => { const { joinedOutput, npm } = await loadMockNpm(t, { config: { force: true, - 'fetch-retries': 0, '//other.registry.npmjs.org/:_authToken': 'test-other-token', }, prefixDir: { @@ -352,11 +354,14 @@ t.test('publishConfig no spec', async t => { }, }) - const manifest = pkgManifest(pkg) - tnock(t, alternateRegistry, - { reqheaders: { authorization: 'Bearer test-other-token' } }) - .get(`/${pkg}?write=true`).reply(200, manifest) - .delete(`/${pkg}/-rev/${manifest._rev}`).reply(201) + const registry = new MockRegistry({ + tap: t, + registry: alternateRegistry, + authorization: 'test-other-token', + }) + const manifest = registry.manifest({ name: pkg }) + await registry.package({ manifest, query: { write: true } }) + registry.nock.delete(`/${pkg}/-rev/${manifest._rev}`).reply(201) await npm.exec('unpublish', []) t.equal(joinedOutput(), '- test-package@1.0.0') }) @@ -366,7 +371,6 @@ t.test('publishConfig with spec', async t => { const { joinedOutput, npm } = await loadMockNpm(t, { config: { force: true, - 'fetch-retries': 0, '//other.registry.npmjs.org/:_authToken': 'test-other-token', }, prefixDir: { @@ -380,11 +384,14 @@ t.test('publishConfig with spec', async t => { }, }) - const manifest = pkgManifest(pkg) - tnock(t, alternateRegistry, - { reqheaders: { authorization: 'Bearer test-other-token' } }) - .get(`/${pkg}?write=true`).reply(200, manifest) - .delete(`/${pkg}/-rev/${manifest._rev}`).reply(201) + const registry = new MockRegistry({ + tap: t, + registry: alternateRegistry, + authorization: 'test-other-token', + }) + const manifest = registry.manifest({ name: pkg }) + await registry.package({ manifest, query: { write: true }, times: 2 }) + registry.nock.delete(`/${pkg}/-rev/${manifest._rev}`).reply(201) await npm.exec('unpublish', ['test-package']) t.equal(joinedOutput(), '- test-package') }) @@ -406,12 +413,18 @@ t.test('completion', async t => { } t.test('completing with multiple versions from the registry', async t => { - const manifest = pkgManifest(pkg, '1.0.1') - tnock(t, npm.config.get('registry'), - { reqheaders: { authorization: 'Bearer test-auth-token' } }) - .get('/-/whoami').reply(200, { username: user }) + const registry = new MockRegistry({ + tap: t, + registry: npm.config.get('registry'), + authorization: 'test-auth-token', + }) + const manifest = registry.manifest({ + name: pkg, + packuments: ['1.0.0', '1.0.1'], + }) + await registry.package({ manifest, query: { write: true } }) + registry.nock.get('/-/whoami').reply(200, { username: user }) .get('/-/org/test-user/package?format=cli').reply(200, { [pkg]: 'write' }) - .get(`/${pkg}?write=true`).reply(200, manifest) await testComp(t, { argv: ['npm', 'unpublish'], @@ -424,13 +437,16 @@ t.test('completion', async t => { }) t.test('no versions retrieved', async t => { - const manifest = pkgManifest(pkg) + const registry = new MockRegistry({ + tap: t, + registry: npm.config.get('registry'), + authorization: 'test-auth-token', + }) + const manifest = registry.manifest({ name: pkg }) manifest.versions = {} - tnock(t, npm.config.get('registry'), - { reqheaders: { authorization: 'Bearer test-auth-token' } }) - .get('/-/whoami').reply(200, { username: user }) + await registry.package({ manifest, query: { write: true } }) + registry.nock.get('/-/whoami').reply(200, { username: user }) .get('/-/org/test-user/package?format=cli').reply(200, { [pkg]: 'write' }) - .get(`/${pkg}?write=true`).reply(200, manifest) await testComp(t, { argv: ['npm', 'unpublish'], @@ -443,9 +459,12 @@ t.test('completion', async t => { }) t.test('packages starting with same letters', async t => { - tnock(t, npm.config.get('registry'), - { reqheaders: { authorization: 'Bearer test-auth-token' } }) - .get('/-/whoami').reply(200, { username: user }) + const registry = new MockRegistry({ + tap: t, + registry: npm.config.get('registry'), + authorization: 'test-auth-token', + }) + registry.nock.get('/-/whoami').reply(200, { username: user }) .get('/-/org/test-user/package?format=cli').reply(200, { [pkg]: 'write', [`${pkg}a`]: 'write', @@ -464,10 +483,13 @@ t.test('completion', async t => { }) t.test('no packages retrieved', async t => { - tnock(t, npm.config.get('registry'), - { reqheaders: { authorization: 'Bearer test-auth-token' } }) - .get('/-/whoami').reply(200, { username: user }) - .get('/-/org/test-user/package?format=cli').reply(200, {}) + const registry = new MockRegistry({ + tap: t, + registry: npm.config.get('registry'), + authorization: 'test-auth-token', + }) + registry.nock.get('/-/whoami').reply(200, { username: user }) + registry.nock.get('/-/org/test-user/package?format=cli').reply(200, {}) await testComp(t, { argv: ['npm', 'unpublish'], @@ -478,9 +500,12 @@ t.test('completion', async t => { }) t.test('no pkg name to complete', async t => { - tnock(t, npm.config.get('registry'), - { reqheaders: { authorization: 'Bearer test-auth-token' } }) - .get('/-/whoami').reply(200, { username: user }) + const registry = new MockRegistry({ + tap: t, + registry: npm.config.get('registry'), + authorization: 'test-auth-token', + }) + registry.nock.get('/-/whoami').reply(200, { username: user }) .get('/-/org/test-user/package?format=cli').reply(200, { [pkg]: 'write', [`${pkg}a`]: 'write', @@ -495,9 +520,12 @@ t.test('completion', async t => { }) t.test('no pkg names retrieved from user account', async t => { - tnock(t, npm.config.get('registry'), - { reqheaders: { authorization: 'Bearer test-auth-token' } }) - .get('/-/whoami').reply(200, { username: user }) + const registry = new MockRegistry({ + tap: t, + registry: npm.config.get('registry'), + authorization: 'test-auth-token', + }) + registry.nock.get('/-/whoami').reply(200, { username: user }) .get('/-/org/test-user/package?format=cli').reply(200, null) await testComp(t, { @@ -509,9 +537,12 @@ t.test('completion', async t => { }) t.test('logged out user', async t => { - tnock(t, npm.config.get('registry'), - { reqheaders: { authorization: 'Bearer test-auth-token' } }) - .get('/-/whoami').reply(404) + const registry = new MockRegistry({ + tap: t, + registry: npm.config.get('registry'), + authorization: 'test-auth-token', + }) + registry.nock.get('/-/whoami').reply(404) await testComp(t, { argv: ['npm', 'unpublish'], diff --git a/test/lib/commands/whoami.js b/test/lib/commands/whoami.js index 66c3f0c6b30bf..f483bd46d5c4b 100644 --- a/test/lib/commands/whoami.js +++ b/test/lib/commands/whoami.js @@ -1,24 +1,35 @@ const t = require('tap') -const { load: _loadMockNpm } = require('../../fixtures/mock-npm') +const { load: loadMockNpm } = require('../../fixtures/mock-npm') +const MockRegistry = require('../../fixtures/mock-registry.js') const username = 'foo' -const loadMockNpm = (t, options) => _loadMockNpm(t, { - mocks: { - '../../lib/utils/get-identity.js': () => Promise.resolve(username), - }, - ...options, -}) +const auth = { '//registry.npmjs.org/:_authToken': 'test-auth-token' } t.test('npm whoami', async (t) => { - const { npm, joinedOutput } = await loadMockNpm(t) + const { npm, joinedOutput } = await loadMockNpm(t, { config: auth }) + const registry = new MockRegistry({ + tap: t, + registry: npm.config.get('registry'), + authorization: 'test-auth-token', + }) + registry.whoami({ username }) await npm.exec('whoami', []) t.equal(joinedOutput(), username, 'should print username') }) t.test('npm whoami --json', async (t) => { const { npm, joinedOutput } = await loadMockNpm(t, { - config: { json: true }, + config: { + json: true, + ...auth, + }, + }) + const registry = new MockRegistry({ + tap: t, + registry: npm.config.get('registry'), + authorization: 'test-auth-token', }) + registry.whoami({ username }) await npm.exec('whoami', []) t.equal(JSON.parse(joinedOutput()), username, 'should print username') }) diff --git a/test/lib/npm.js b/test/lib/npm.js index 998e96314d2b4..1966ca9600088 100644 --- a/test/lib/npm.js +++ b/test/lib/npm.js @@ -609,16 +609,14 @@ t.test('implicit workspace rejection', async t => { workspaces: ['./packages/a'], }), }, - globals: { + globals: ({ prefix }) => ({ + 'process.cwd': () => join(prefix, 'packages', 'a'), 'process.argv': [ process.execPath, process.argv[1], '--color', 'false', '--workspace', './packages/a', ], - }, - config: ({ prefix }) => ({ - workspace: { value: [join(prefix, 'packages', 'a')], where: 'default' }, }), }) await t.rejects( @@ -646,16 +644,13 @@ t.test('implicit workspace accept', async t => { }), }, globals: ({ prefix }) => ({ - 'process.cwd': () => prefix, + 'process.cwd': () => join(prefix, 'packages', 'a'), 'process.argv': [ process.execPath, process.argv[1], '--color', 'false', ], }), - config: ({ prefix }) => ({ - workspace: { value: [join(prefix, 'packages', 'a')], where: 'default' }, - }), }) await t.rejects(mock.npm.exec('org', []), /.*Usage/) }) diff --git a/test/lib/workspaces/get-workspaces.js b/test/lib/workspaces/get-workspaces.js index 0d1bba3144d83..4e48b1c4b7707 100644 --- a/test/lib/workspaces/get-workspaces.js +++ b/test/lib/workspaces/get-workspaces.js @@ -17,67 +17,67 @@ const clean = (res, path) => { return cleaned } -t.test('get-workspaces', async t => { - const path = t.testdir({ - packages: { - a: { - 'package.json': JSON.stringify({ - name: 'a', - version: '1.0.0', - scripts: { glorp: 'echo a doing the glerp glop' }, - }), - }, - b: { - 'package.json': JSON.stringify({ - name: 'b', - version: '2.0.0', - scripts: { glorp: 'echo b doing the glerp glop' }, - }), - }, - c: { - 'package.json': JSON.stringify({ - name: 'c', - version: '1.0.0', - scripts: { - test: 'exit 0', - posttest: 'echo posttest', - lorem: 'echo c lorem', - }, - }), - }, - d: { - 'package.json': JSON.stringify({ - name: 'd', - version: '1.0.0', - scripts: { - test: 'exit 0', - posttest: 'echo posttest', - }, - }), - }, - e: { - 'package.json': JSON.stringify({ - name: 'e', - scripts: { test: 'exit 0', start: 'echo start something' }, - }), - }, - noscripts: { - 'package.json': JSON.stringify({ - name: 'noscripts', - version: '1.0.0', - }), - }, +const path = t.testdir({ + packages: { + a: { + 'package.json': JSON.stringify({ + name: 'a', + version: '1.0.0', + scripts: { glorp: 'echo a doing the glerp glop' }, + }), }, - 'package.json': JSON.stringify({ - name: 'x', - version: '1.2.3', - workspaces: ['packages/*'], - }), - }) + b: { + 'package.json': JSON.stringify({ + name: 'b', + version: '2.0.0', + scripts: { glorp: 'echo b doing the glerp glop' }, + }), + }, + c: { + 'package.json': JSON.stringify({ + name: 'c', + version: '1.0.0', + scripts: { + test: 'exit 0', + posttest: 'echo posttest', + lorem: 'echo c lorem', + }, + }), + }, + d: { + 'package.json': JSON.stringify({ + name: 'd', + version: '1.0.0', + scripts: { + test: 'exit 0', + posttest: 'echo posttest', + }, + }), + }, + e: { + 'package.json': JSON.stringify({ + name: 'e', + scripts: { test: 'exit 0', start: 'echo start something' }, + }), + }, + noscripts: { + 'package.json': JSON.stringify({ + name: 'noscripts', + version: '1.0.0', + }), + }, + }, + 'package.json': JSON.stringify({ + name: 'x', + version: '1.2.3', + workspaces: ['packages/*'], + }), +}) - let workspaces +let workspaces - workspaces = await getWorkspaces(['a', 'b'], { path }) +t.test('filter by package name', async t => { + workspaces = await getWorkspaces(['a', 'b'], { path, relativeFrom: path }) t.same( clean(workspaces, path), new Map(Object.entries({ @@ -86,8 +86,11 @@ t.test('get-workspaces', async t => { })), 'should filter by package name' ) +}) - workspaces = await getWorkspaces(['a', 'b'], { path, includeWorkspaceRoot: true }) +t.test('include workspace root', async t => { + workspaces = await getWorkspaces(['a', 'b'], + { path, includeWorkspaceRoot: true, relativeFrom: path }) t.same( clean(workspaces, path), new Map(Object.entries({ @@ -97,8 +100,10 @@ t.test('get-workspaces', async t => { })), 'include rootspace root' ) +}) - workspaces = await getWorkspaces(['./packages/c'], { path }) +t.test('filter by package directory', async t => { + workspaces = await getWorkspaces(['./packages/c'], { path, relativeFrom: path }) t.same( clean(workspaces, path), new Map(Object.entries({ @@ -106,8 +111,10 @@ t.test('get-workspaces', async t => { })), 'should filter by package directory' ) +}) - workspaces = await getWorkspaces(['packages/c'], { path }) +t.test('filter by rel package directory', async t => { + workspaces = await getWorkspaces(['packages/c'], { path, relativeFrom: path }) t.same( clean(workspaces, path), new Map(Object.entries({ @@ -115,8 +122,10 @@ t.test('get-workspaces', async t => { })), 'should filter by rel package directory' ) +}) - workspaces = await getWorkspaces([resolve(path, 'packages/c')], { path }) +t.test('filter by absolute package directory', async t => { + workspaces = await getWorkspaces([resolve(path, 'packages/c')], { path, relativeFrom: path }) t.same( clean(workspaces, path), new Map(Object.entries({ @@ -124,8 +133,10 @@ t.test('get-workspaces', async t => { })), 'should filter by absolute package directory' ) +}) - workspaces = await getWorkspaces(['packages'], { path }) +t.test('filter by parent directory name', async t => { + workspaces = await getWorkspaces(['packages'], { path, relativeFrom: path }) t.same( clean(workspaces, path), new Map(Object.entries({ @@ -138,8 +149,10 @@ t.test('get-workspaces', async t => { })), 'should filter by parent directory name' ) +}) - workspaces = await getWorkspaces(['./packages/'], { path }) +t.test('filter by parent directory path', async t => { + workspaces = await getWorkspaces(['./packages/'], { path, relativeFrom: path }) t.same( clean(workspaces, path), new Map(Object.entries({ @@ -152,8 +165,10 @@ t.test('get-workspaces', async t => { })), 'should filter by parent directory path' ) +}) - workspaces = await getWorkspaces([resolve(path, './packages')], { path }) +t.test('filter by absolute parent directory path', async t => { + workspaces = await getWorkspaces([resolve(path, './packages')], { path, relativeFrom: path }) t.same( clean(workspaces, path), new Map(Object.entries({ @@ -166,8 +181,10 @@ t.test('get-workspaces', async t => { })), 'should filter by absolute parent directory path' ) +}) - workspaces = await getWorkspaces([], { path }) +t.test('no filter set', async t => { + workspaces = await getWorkspaces([], { path, relativeFrom: path }) t.same( clean(workspaces, path), new Map(Object.entries({ @@ -180,32 +197,26 @@ t.test('get-workspaces', async t => { })), 'should return all workspaces if no filter set' ) +}) - try { - await getWorkspaces(['missing'], { path }) - throw new Error('missed throw') - } catch (err) { - t.match( - err, - /No workspaces found/, - 'should throw no workspaces found error' - ) - } +t.test('missing workspace', async t => { + await t.rejects( + getWorkspaces(['missing'], { path, relativeFrom: path }), + /No workspaces found/, + 'should throw no workspaces found error' + ) +}) +t.test('no workspaces configured', async t => { const unconfiguredWorkspaces = t.testdir({ 'package.json': JSON.stringify({ name: 'no-configured-workspaces', version: '1.0.0', }), }) - try { - await getWorkspaces([], { path: unconfiguredWorkspaces }) - throw new Error('missed throw') - } catch (err) { - t.match( - err, - /No workspaces found/, - 'should throw no workspaces found error' - ) - } + await t.rejects( + getWorkspaces([], { path: unconfiguredWorkspaces, relativeFrom: path }), + /No workspaces found/, + 'should throw no workspaces found error' + ) }) diff --git a/workspaces/arborist/CHANGELOG.md b/workspaces/arborist/CHANGELOG.md index a5e6b09519a00..e254d8f2606e8 100644 --- a/workspaces/arborist/CHANGELOG.md +++ b/workspaces/arborist/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +### [5.0.5](https://github.com/npm/cli/compare/arborist-v5.0.4...arborist-v5.0.5) (2022-04-06) + + +### Bug Fixes + +* replace deprecated String.prototype.substr() ([#4667](https://github.com/npm/cli/issues/4667)) ([e3da5df](https://github.com/npm/cli/commit/e3da5df4152fbe547f7871547165328e1bf06262)) +* update readme badges ([#4658](https://github.com/npm/cli/issues/4658)) ([2829cb2](https://github.com/npm/cli/commit/2829cb28a432b5ff7beeeb3bf3e7e2e174c1121d)) + + +### Dependencies + +* @npmcli/arborist@5.0.4 ([679e569](https://github.com/npm/cli/commit/679e569d5778aef312b37c1ba3bda0171366c9fb)) +* @npmcli/move-file@2.0.0 ([e9b25cd](https://github.com/npm/cli/commit/e9b25cd66bef17e807a84e7b10384f5f4d0064b7)) +* @npmcli/node-gyp@2.0.0 ([0e87cac](https://github.com/npm/cli/commit/0e87cac8b6f09692f6bd1bf086aadbe323d127b5)) +* @npmcli/package-json@2.0.0 ([4a9a705](https://github.com/npm/cli/commit/4a9a705de6992a3e9eefecc6c0cf8da45a527c7a)) +* npm-install-checks@5.0.0 ([ad99360](https://github.com/npm/cli/commit/ad9936063f20829eb9d5358d056593883f17a57b)) +* ssri@9.0.0 ([a2781a3](https://github.com/npm/cli/commit/a2781a367d62328d7f870de878f1b63d66593f4f)) +* treeverse@2.0.0 ([1a90b9e](https://github.com/npm/cli/commit/1a90b9e9ebe98cce83591e11312aaf41c830f835)) + ### [5.0.4](https://github.com/npm/cli/compare/arborist-v5.0.3...arborist-v5.0.4) (2022-03-31) diff --git a/workspaces/arborist/README.md b/workspaces/arborist/README.md index ee79a3bf2f7ae..e4a58239a0e08 100644 --- a/workspaces/arborist/README.md +++ b/workspaces/arborist/README.md @@ -1,5 +1,9 @@ # @npmcli/arborist +[![npm version](https://img.shields.io/npm/v/@npmcli/arborist.svg)](https://npm.im/@npmcli/arborist) +[![license](https://img.shields.io/npm/l/@npmcli/arborist.svg)](https://npm.im/@npmcli/arborist) +[![CI - @npmcli/arborist](https://github.com/npm/cli/actions/workflows/ci-npmcli-arborist.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-npmcli-arborist.yml) + Inspect and manage `node_modules` trees. ![a tree with the word ARBORIST superimposed on it](https://raw.githubusercontent.com/npm/arborist/main/docs/logo.svg?sanitize=true) diff --git a/workspaces/arborist/lib/retire-path.js b/workspaces/arborist/lib/retire-path.js index 5d583b151440d..0c7a4a319e279 100644 --- a/workspaces/arborist/lib/retire-path.js +++ b/workspaces/arborist/lib/retire-path.js @@ -7,7 +7,7 @@ const pathSafeHash = s => .update(s) .digest('base64') .replace(/[^a-zA-Z0-9]+/g, '') - .substr(0, 8) + .slice(0, 8) const retirePath = from => { const d = dirname(from) diff --git a/workspaces/arborist/lib/shrinkwrap.js b/workspaces/arborist/lib/shrinkwrap.js index ead9aed36492f..ab6c91935c78e 100644 --- a/workspaces/arborist/lib/shrinkwrap.js +++ b/workspaces/arborist/lib/shrinkwrap.js @@ -807,7 +807,7 @@ class Shrinkwrap { const pathFixed = !resolved ? null : !/^file:/.test(resolved) ? resolved // resolve onto the metadata path - : `file:${resolve(this.path, resolved.substr(5))}` + : `file:${resolve(this.path, resolved.slice(5))}` // if we have one, only set the other if it matches // otherwise it could be for a completely different thing. @@ -1056,7 +1056,7 @@ class Shrinkwrap { // turn absolute file: paths into relative paths from the node // this especially shows up with workspace edges when the root // node is also a workspace in the set. - const p = resolve(node.realpath, spec.substr('file:'.length)) + const p = resolve(node.realpath, spec.slice('file:'.length)) set[k] = `file:${relpath(node.realpath, p)}` } else { set[k] = spec diff --git a/workspaces/arborist/lib/version-from-tgz.js b/workspaces/arborist/lib/version-from-tgz.js index cdb59b7d4dcad..be4405cee998f 100644 --- a/workspaces/arborist/lib/version-from-tgz.js +++ b/workspaces/arborist/lib/version-from-tgz.js @@ -16,7 +16,7 @@ module.exports = (name, tgz) => { // basename checking. Note that registries can // be mounted below the root url, so /a/b/-/x/y/foo/-/foo-1.2.3.tgz // is a potential option. - const tfsplit = u.path.substr(1).split('/-/') + const tfsplit = u.path.slice(1).split('/-/') if (tfsplit.length > 1) { const afterTF = tfsplit.pop() if (afterTF === base) { diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json index 8913b4449e238..a936a3b01d96f 100644 --- a/workspaces/arborist/package.json +++ b/workspaces/arborist/package.json @@ -1,16 +1,16 @@ { "name": "@npmcli/arborist", - "version": "5.0.4", + "version": "5.0.5", "description": "Manage node_modules trees", "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", "@npmcli/installed-package-contents": "^1.0.7", "@npmcli/map-workspaces": "^2.0.0", "@npmcli/metavuln-calculator": "^3.0.1", - "@npmcli/move-file": "^1.1.0", + "@npmcli/move-file": "^2.0.0", "@npmcli/name-from-folder": "^1.0.1", - "@npmcli/node-gyp": "^1.0.3", - "@npmcli/package-json": "^1.0.1", + "@npmcli/node-gyp": "^2.0.0", + "@npmcli/package-json": "^2.0.0", "@npmcli/run-script": "^3.0.0", "bin-links": "^3.0.0", "cacache": "^16.0.0", @@ -20,7 +20,7 @@ "mkdirp": "^1.0.4", "mkdirp-infer-owner": "^2.0.0", "nopt": "^5.0.0", - "npm-install-checks": "^4.0.0", + "npm-install-checks": "^5.0.0", "npm-package-arg": "^9.0.0", "npm-pick-manifest": "^7.0.0", "npm-registry-fetch": "^13.0.0", @@ -34,18 +34,18 @@ "readdir-scoped-modules": "^1.1.0", "rimraf": "^3.0.2", "semver": "^7.3.5", - "ssri": "^8.0.1", - "treeverse": "^1.0.4", + "ssri": "^9.0.0", + "treeverse": "^2.0.0", "walk-up-path": "^1.0.0" }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "benchmark": "^2.1.4", "chalk": "^4.1.0", "minify-registry-metadata": "^2.1.0", "nock": "^13.2.0", - "tap": "^15.1.2", + "tap": "^16.0.1", "tcompare": "^5.0.6" }, "scripts": { @@ -101,6 +101,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.2.2" + "version": "3.3.2" } } diff --git a/workspaces/arborist/scripts/benchmark.js b/workspaces/arborist/scripts/benchmark.js index 3f6be3ec7a4aa..f6b2b02942981 100644 --- a/workspaces/arborist/scripts/benchmark.js +++ b/workspaces/arborist/scripts/benchmark.js @@ -63,13 +63,13 @@ Options: for (let i = 2; i < process.argv.length; i++) { const arg = process.argv[i] if (/^--previous=/.test(arg)) { - options.previous = arg.substr('--previous='.length) + options.previous = arg.slice('--previous='.length) } else if (/^--warn-range=[0-9]+/.test(arg)) { - options.warnRange = +arg.substr('--warn-range='.length) + options.warnRange = +arg.slice('--warn-range='.length) } else if (/^--cache=/.test(arg)) { - options.cache = resolve(arg.substr('--cache='.length)) + options.cache = resolve(arg.slice('--cache='.length)) } else if (/^--save=/.test(arg)) { - const save = arg.substr('--save='.length) + const save = arg.slice('--save='.length) if (/[/\\]|^\.\.?$/.test(save)) { throw new Error('save cannot have slashes or be . or ..') } diff --git a/workspaces/arborist/tap-snapshots/test/audit-report.js.test.cjs b/workspaces/arborist/tap-snapshots/test/audit-report.js.test.cjs index 3fe331a3e8fb5..91d7ecffceaeb 100644 --- a/workspaces/arborist/tap-snapshots/test/audit-report.js.test.cjs +++ b/workspaces/arborist/tap-snapshots/test/audit-report.js.test.cjs @@ -1627,6 +1627,8 @@ Object { "severity": "moderate", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "acorn", "id": undefined, "name": "acorn", @@ -1652,6 +1654,8 @@ Object { "severity": "high", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "js-yaml", "id": undefined, "name": "js-yaml", @@ -1664,6 +1668,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "js-yaml", "id": undefined, "name": "js-yaml", @@ -1689,6 +1695,8 @@ Object { "severity": "high", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "lodash", "id": undefined, "name": "lodash", @@ -1701,6 +1709,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "lodash", "id": undefined, "name": "lodash", @@ -1713,6 +1723,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "lodash", "id": undefined, "name": "lodash", @@ -1740,6 +1752,8 @@ Object { "severity": "low", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "minimist", "id": undefined, "name": "minimist", @@ -2075,6 +2089,8 @@ Object { "severity": "critical", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -2087,6 +2103,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -2099,6 +2117,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -2111,6 +2131,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -2123,6 +2145,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -2156,6 +2180,8 @@ Object { "severity": "low", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "kind-of", "id": undefined, "name": "kind-of", @@ -2181,6 +2207,8 @@ Object { "severity": "high", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "lodash", "id": undefined, "name": "lodash", @@ -2193,6 +2221,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "lodash", "id": undefined, "name": "lodash", @@ -2205,6 +2235,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "lodash", "id": undefined, "name": "lodash", @@ -2236,6 +2268,8 @@ Object { "severity": "low", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "mem", "id": undefined, "name": "mem", @@ -2269,6 +2303,8 @@ Object { "severity": "low", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "minimist", "id": undefined, "name": "minimist", @@ -2294,6 +2330,8 @@ Object { "severity": "high", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "mixin-deep", "id": undefined, "name": "mixin-deep", @@ -2403,6 +2441,8 @@ Object { "severity": "high", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "set-value", "id": undefined, "name": "set-value", @@ -2471,6 +2511,8 @@ Object { "severity": "low", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "yargs-parser", "id": undefined, "name": "yargs-parser", @@ -2526,6 +2568,8 @@ Object { "severity": "critical", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -2538,6 +2582,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -2550,6 +2596,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -2562,6 +2610,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -2574,6 +2624,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -2606,6 +2658,8 @@ Object { "severity": "low", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "minimist", "id": undefined, "name": "minimist", @@ -2682,6 +2736,8 @@ Object { "severity": "critical", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -2694,6 +2750,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -2706,6 +2764,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -2718,6 +2778,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -2730,6 +2792,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -2763,6 +2827,8 @@ Object { "severity": "low", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "kind-of", "id": undefined, "name": "kind-of", @@ -2788,6 +2854,8 @@ Object { "severity": "high", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "lodash", "id": undefined, "name": "lodash", @@ -2800,6 +2868,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "lodash", "id": undefined, "name": "lodash", @@ -2812,6 +2882,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "lodash", "id": undefined, "name": "lodash", @@ -2843,6 +2915,8 @@ Object { "severity": "low", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "mem", "id": undefined, "name": "mem", @@ -2876,6 +2950,8 @@ Object { "severity": "low", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "minimist", "id": undefined, "name": "minimist", @@ -2901,6 +2977,8 @@ Object { "severity": "high", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "mixin-deep", "id": undefined, "name": "mixin-deep", @@ -3010,6 +3088,8 @@ Object { "severity": "high", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "set-value", "id": undefined, "name": "set-value", @@ -3078,6 +3158,8 @@ Object { "severity": "low", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "yargs-parser", "id": undefined, "name": "yargs-parser", @@ -3133,6 +3215,8 @@ Object { "severity": "critical", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -3145,6 +3229,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -3157,6 +3243,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -3169,6 +3257,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -3181,6 +3271,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -3213,6 +3305,8 @@ Object { "severity": "low", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "minimist", "id": undefined, "name": "minimist", @@ -3309,6 +3403,8 @@ Object { "severity": "critical", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -3321,6 +3417,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -3333,6 +3431,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -3345,6 +3445,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -3357,6 +3459,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -3390,6 +3494,8 @@ Object { "severity": "low", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "kind-of", "id": undefined, "name": "kind-of", @@ -3415,6 +3521,8 @@ Object { "severity": "high", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "lodash", "id": undefined, "name": "lodash", @@ -3427,6 +3535,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "lodash", "id": undefined, "name": "lodash", @@ -3439,6 +3549,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "lodash", "id": undefined, "name": "lodash", @@ -3470,6 +3582,8 @@ Object { "severity": "low", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "mem", "id": undefined, "name": "mem", @@ -3502,6 +3616,8 @@ Object { "severity": "low", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "minimist", "id": undefined, "name": "minimist", @@ -3527,6 +3643,8 @@ Object { "severity": "high", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "mixin-deep", "id": undefined, "name": "mixin-deep", @@ -3631,6 +3749,8 @@ Object { "severity": "high", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "set-value", "id": undefined, "name": "set-value", @@ -3699,6 +3819,8 @@ Object { "severity": "low", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "yargs-parser", "id": undefined, "name": "yargs-parser", @@ -3750,6 +3872,8 @@ Object { "severity": "critical", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -3762,6 +3886,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -3774,6 +3900,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -3786,6 +3914,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -3798,6 +3928,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "handlebars", "id": undefined, "name": "handlebars", @@ -3831,6 +3963,8 @@ Object { "severity": "low", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "kind-of", "id": undefined, "name": "kind-of", @@ -3856,6 +3990,8 @@ Object { "severity": "high", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "lodash", "id": undefined, "name": "lodash", @@ -3868,6 +4004,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "lodash", "id": undefined, "name": "lodash", @@ -3880,6 +4018,8 @@ Object { "vulnerableVersions": undefined, }, Object { + "cvss": undefined, + "cwe": undefined, "dependency": "lodash", "id": undefined, "name": "lodash", @@ -3911,6 +4051,8 @@ Object { "severity": "low", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "mem", "id": undefined, "name": "mem", @@ -3943,6 +4085,8 @@ Object { "severity": "low", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "minimist", "id": undefined, "name": "minimist", @@ -3968,6 +4112,8 @@ Object { "severity": "high", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "mixin-deep", "id": undefined, "name": "mixin-deep", @@ -4072,6 +4218,8 @@ Object { "severity": "high", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "set-value", "id": undefined, "name": "set-value", @@ -4140,6 +4288,8 @@ Object { "severity": "low", "via": Array [ Object { + "cvss": undefined, + "cwe": undefined, "dependency": "yargs-parser", "id": undefined, "name": "yargs-parser", diff --git a/workspaces/arborist/test/arborist/load-actual.js b/workspaces/arborist/test/arborist/load-actual.js index ae8c5f80f81ad..8b84bb330ad25 100644 --- a/workspaces/arborist/test/arborist/load-actual.js +++ b/workspaces/arborist/test/arborist/load-actual.js @@ -14,7 +14,7 @@ const { // strip the fixtures path off of the trees in snapshots const pp = path => path && - normalizePath(path).substr(normalizePath(fixtures).length + 1) + normalizePath(path).slice(normalizePath(fixtures).length + 1) const defixture = obj => { if (obj instanceof Set) { return new Set([...obj].map(defixture)) diff --git a/workspaces/libnpmaccess/README.md b/workspaces/libnpmaccess/README.md index c079344597968..3e35562cfddbc 100644 --- a/workspaces/libnpmaccess/README.md +++ b/workspaces/libnpmaccess/README.md @@ -2,8 +2,7 @@ [![npm version](https://img.shields.io/npm/v/libnpmaccess.svg)](https://npm.im/libnpmaccess) [![license](https://img.shields.io/npm/l/libnpmaccess.svg)](https://npm.im/libnpmaccess) -[![GitHub Actions](https://github.com/npm/libnpmaccess/workflows/Node%20CI/badge.svg)](https://github.com/npm/libnpmaccess/actions?query=workflow%3A%22Node+CI%22) -[![Coverage Status](https://coveralls.io/repos/github/npm/libnpmaccess/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmaccess?branch=latest) +[![CI - libnpmaccess](https://github.com/npm/cli/actions/workflows/ci-libnpmaccess.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-libnpmaccess.yml) [`libnpmaccess`](https://github.com/npm/libnpmaccess) is a Node.js library that provides programmatic access to the guts of the npm CLI's `npm diff --git a/workspaces/libnpmaccess/package.json b/workspaces/libnpmaccess/package.json index 68ac1c28902f7..c9068f1a4fb3b 100644 --- a/workspaces/libnpmaccess/package.json +++ b/workspaces/libnpmaccess/package.json @@ -20,9 +20,9 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "nock": "^13.2.4", - "tap": "^15.1.0" + "tap": "^16.0.1" }, "repository": { "type": "git", @@ -49,6 +49,6 @@ ], "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.2.2" + "version": "3.3.2" } } diff --git a/workspaces/libnpmdiff/README.md b/workspaces/libnpmdiff/README.md index 6c60f714bb776..b8eb083bdded7 100644 --- a/workspaces/libnpmdiff/README.md +++ b/workspaces/libnpmdiff/README.md @@ -2,9 +2,7 @@ [![npm version](https://img.shields.io/npm/v/libnpmdiff.svg)](https://npm.im/libnpmdiff) [![license](https://img.shields.io/npm/l/libnpmdiff.svg)](https://npm.im/libnpmdiff) -[![GitHub Actions](https://github.com/npm/libnpmdiff/workflows/node-ci/badge.svg)](https://github.com/npm/libnpmdiff/actions?query=workflow%3Anode-ci) -[![Coverage Status](https://coveralls.io/repos/github/npm/libnpmdiff/badge.svg?branch=main)](https://coveralls.io/github/npm/libnpmdiff?branch=main) - +[![CI - libnpmdiff](https://github.com/npm/cli/actions/workflows/ci-libnpmdiff.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-libnpmdiff.yml) The registry diff lib. ## Table of Contents diff --git a/workspaces/libnpmdiff/lib/should-print-patch.js b/workspaces/libnpmdiff/lib/should-print-patch.js index a954811407d4f..f8277a809eef6 100644 --- a/workspaces/libnpmdiff/lib/should-print-patch.js +++ b/workspaces/libnpmdiff/lib/should-print-patch.js @@ -14,7 +14,7 @@ const shouldPrintPatch = (path, opts = {}) => { filename.startsWith('.') ? filename : extname(filename) - ).substr(1) + ).slice(1) return !binaryExtensions.includes(extension) } diff --git a/workspaces/libnpmdiff/package.json b/workspaces/libnpmdiff/package.json index eeddaf09fdc77..1aa12815f06e9 100644 --- a/workspaces/libnpmdiff/package.json +++ b/workspaces/libnpmdiff/package.json @@ -49,21 +49,21 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", - "tap": "^15.0.9" + "@npmcli/template-oss": "3.3.2", + "tap": "^16.0.1" }, "dependencies": { - "@npmcli/disparity-colors": "^1.0.1", + "@npmcli/disparity-colors": "^2.0.0", "@npmcli/installed-package-contents": "^1.0.7", "binary-extensions": "^2.2.0", "diff": "^5.0.0", - "minimatch": "^3.0.4", + "minimatch": "^5.0.1", "npm-package-arg": "^9.0.1", "pacote": "^13.0.5", "tar": "^6.1.0" }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.2.2" + "version": "3.3.2" } } diff --git a/workspaces/libnpmexec/README.md b/workspaces/libnpmexec/README.md index 74d6f5211e61d..dc79d12cffc45 100644 --- a/workspaces/libnpmexec/README.md +++ b/workspaces/libnpmexec/README.md @@ -2,8 +2,7 @@ [![npm version](https://img.shields.io/npm/v/libnpmexec.svg)](https://npm.im/libnpmexec) [![license](https://img.shields.io/npm/l/libnpmexec.svg)](https://npm.im/libnpmexec) -[![GitHub Actions](https://github.com/npm/libnpmexec/workflows/node-ci/badge.svg)](https://github.com/npm/libnpmexec/actions?query=workflow%3Anode-ci) -[![Coverage Status](https://coveralls.io/repos/github/npm/libnpmexec/badge.svg?branch=main)](https://coveralls.io/github/npm/libnpmexec?branch=main) +[![CI - libnpmexec](https://github.com/npm/cli/actions/workflows/ci-libnpmexec.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-libnpmexec.yml) The `npm exec` (`npx`) Programmatic API diff --git a/workspaces/libnpmexec/package.json b/workspaces/libnpmexec/package.json index 7245f15b2ed91..0c945e1558f61 100644 --- a/workspaces/libnpmexec/package.json +++ b/workspaces/libnpmexec/package.json @@ -51,9 +51,9 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "bin-links": "^3.0.0", - "tap": "^15.0.6" + "tap": "^16.0.1" }, "dependencies": { "@npmcli/arborist": "^5.0.0", @@ -71,6 +71,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.2.2" + "version": "3.3.2" } } diff --git a/workspaces/libnpmfund/README.md b/workspaces/libnpmfund/README.md index 8ab663f634d6f..6072b11d9dee7 100644 --- a/workspaces/libnpmfund/README.md +++ b/workspaces/libnpmfund/README.md @@ -2,8 +2,7 @@ [![npm version](https://img.shields.io/npm/v/libnpmfund.svg)](https://npm.im/libnpmfund) [![license](https://img.shields.io/npm/l/libnpmfund.svg)](https://npm.im/libnpmfund) -[![GitHub Actions](https://github.com/npm/libnpmfund/workflows/node-ci/badge.svg)](https://github.com/npm/libnpmfund/actions?query=workflow%3Anode-ci) -[![Coverage Status](https://coveralls.io/repos/github/npm/libnpmfund/badge.svg?branch=master)](https://coveralls.io/github/npm/libnpmfund?branch=master) +[![CI - libnpmfund](https://github.com/npm/cli/actions/workflows/ci-libnpmfund.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-libnpmfund.yml) [`libnpmfund`](https://github.com/npm/libnpmfund) is a Node.js library for retrieving **funding** information for packages installed using diff --git a/workspaces/libnpmfund/package.json b/workspaces/libnpmfund/package.json index ddc95f2f0a3b7..e5e3f7349ee15 100644 --- a/workspaces/libnpmfund/package.json +++ b/workspaces/libnpmfund/package.json @@ -48,8 +48,8 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", - "tap": "^15.0.9" + "@npmcli/template-oss": "3.3.2", + "tap": "^16.0.1" }, "dependencies": { "@npmcli/arborist": "^5.0.0" @@ -59,6 +59,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.2.2" + "version": "3.3.2" } } diff --git a/workspaces/libnpmhook/README.md b/workspaces/libnpmhook/README.md index ce6e8c1a51989..309f8041da08b 100644 --- a/workspaces/libnpmhook/README.md +++ b/workspaces/libnpmhook/README.md @@ -2,7 +2,7 @@ [![npm version](https://img.shields.io/npm/v/libnpmhook.svg)](https://npm.im/libnpmhook) [![license](https://img.shields.io/npm/l/libnpmhook.svg)](https://npm.im/libnpmhook) -[![Coverage Status](https://coveralls.io/repos/github/npm/libnpmhook/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmhook?branch=latest) +[![CI - libnpmhook](https://github.com/npm/cli/actions/workflows/ci-libnpmhook.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-libnpmhook.yml) [`libnpmhook`](https://github.com/npm/libnpmhook) is a Node.js library for programmatically managing the npm registry's server-side hooks. diff --git a/workspaces/libnpmhook/lib/index.js b/workspaces/libnpmhook/lib/index.js index 7cd18261d8482..091cdc49a80d1 100644 --- a/workspaces/libnpmhook/lib/index.js +++ b/workspaces/libnpmhook/lib/index.js @@ -13,7 +13,7 @@ cmd.add = (name, endpoint, secret, opts = {}) => { } if (name[0] === '~') { type = 'owner' - name = name.substr(1) + name = name.slice(1) } return fetch.json('/-/npm/v1/hooks/hook', { ...opts, diff --git a/workspaces/libnpmhook/package.json b/workspaces/libnpmhook/package.json index 4071d38ee5250..e6200a97fe585 100644 --- a/workspaces/libnpmhook/package.json +++ b/workspaces/libnpmhook/package.json @@ -43,15 +43,15 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "nock": "^13.2.4", - "tap": "^15.1.0" + "tap": "^16.0.1" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16.0.0" }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.2.2" + "version": "3.3.2" } } diff --git a/workspaces/libnpmorg/README.md b/workspaces/libnpmorg/README.md index b2e1ed589b8e9..d5165523eec98 100644 --- a/workspaces/libnpmorg/README.md +++ b/workspaces/libnpmorg/README.md @@ -2,8 +2,7 @@ [![npm version](https://img.shields.io/npm/v/libnpmorg.svg)](https://npm.im/libnpmorg) [![license](https://img.shields.io/npm/l/libnpmorg.svg)](https://npm.im/libnpmorg) -[![GitHub Actions](https://github.com/npm/libnpmorg/workflows/Node%20CI/badge.svg)](https://github.com/npm/libnpmorg/workflows/Node%20CI/badge.svg) -[![Coverage Status](https://coveralls.io/repos/github/npm/libnpmorg/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmorg?branch=latest) +[![CI - libnpmorg](https://github.com/npm/cli/actions/workflows/ci-libnpmorg.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-libnpmorg.yml) [`libnpmorg`](https://github.com/npm/libnpmorg) is a Node.js library for programmatically accessing the [npm Org membership diff --git a/workspaces/libnpmorg/package.json b/workspaces/libnpmorg/package.json index 58ca5ec42e3af..c88bd77d4dc1a 100644 --- a/workspaces/libnpmorg/package.json +++ b/workspaces/libnpmorg/package.json @@ -34,10 +34,10 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "minipass": "^3.1.1", "nock": "^13.2.4", - "tap": "^15.0.0" + "tap": "^16.0.1" }, "repository": { "type": "git", @@ -55,6 +55,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.2.2" + "version": "3.3.2" } } diff --git a/workspaces/libnpmpack/README.md b/workspaces/libnpmpack/README.md index 74b4934b0b719..e3ed416a781ab 100644 --- a/workspaces/libnpmpack/README.md +++ b/workspaces/libnpmpack/README.md @@ -2,8 +2,7 @@ [![npm version](https://img.shields.io/npm/v/libnpmpack.svg)](https://npm.im/libnpmpack) [![license](https://img.shields.io/npm/l/libnpmpack.svg)](https://npm.im/libnpmpack) -[![GitHub Actions](https://github.com/npm/libnpmpack/workflows/Node%20CI/badge.svg)](https://github.com/npm/libnpmpack/actions?query=workflow%3A%22Node+CI%22) -[![Coverage Status](https://coveralls.io/repos/github/npm/libnpmpack/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmpack?branch=latest) +[![CI - libnpmpack](https://github.com/npm/cli/actions/workflows/ci-libnpmpack.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-libnpmpack.yml) [`libnpmpack`](https://github.com/npm/libnpmpack) is a Node.js library for programmatically packing tarballs from a local directory or from a registry or github spec. If packing from a local source, `libnpmpack` will also run the `prepack` and `postpack` lifecycles. diff --git a/workspaces/libnpmpack/package.json b/workspaces/libnpmpack/package.json index 4ee093c74d616..ccb99e3c94fb2 100644 --- a/workspaces/libnpmpack/package.json +++ b/workspaces/libnpmpack/package.json @@ -29,9 +29,9 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "nock": "^13.0.7", - "tap": "^15.0.0" + "tap": "^16.0.1" }, "repository": { "type": "git", @@ -50,6 +50,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.2.2" + "version": "3.3.2" } } diff --git a/workspaces/libnpmpublish/README.md b/workspaces/libnpmpublish/README.md index 0da46e89d3b05..85fb73e52fdbe 100644 --- a/workspaces/libnpmpublish/README.md +++ b/workspaces/libnpmpublish/README.md @@ -1,5 +1,9 @@ # libnpmpublish +[![npm version](https://img.shields.io/npm/v/libnpmpublish.svg)](https://npm.im/libnpmpublish) +[![license](https://img.shields.io/npm/l/libnpmpublish.svg)](https://npm.im/libnpmpublish) +[![CI - libnpmpublish](https://github.com/npm/cli/actions/workflows/ci-libnpmpublish.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-libnpmpublish.yml) + [`libnpmpublish`](https://github.com/npm/libnpmpublish) is a Node.js library for programmatically publishing and unpublishing npm packages. Give it a manifest as an object and a tarball as a Buffer, and it'll put them on diff --git a/workspaces/libnpmpublish/lib/unpublish.js b/workspaces/libnpmpublish/lib/unpublish.js index 7fbeea503a337..91f5252aa33fc 100644 --- a/workspaces/libnpmpublish/lib/unpublish.js +++ b/workspaces/libnpmpublish/lib/unpublish.js @@ -82,7 +82,7 @@ const unpublish = async (spec, opts) => { ...opts, query: { write: true }, }) - const tarballUrl = new URL(dist.tarball).pathname.substr(1) + const tarballUrl = new URL(dist.tarball).pathname.slice(1) await npmFetch(`${tarballUrl}/-rev/${_rev}`, { ...opts, method: 'DELETE', diff --git a/workspaces/libnpmpublish/package.json b/workspaces/libnpmpublish/package.json index bb911039e309c..389a4083d44d0 100644 --- a/workspaces/libnpmpublish/package.json +++ b/workspaces/libnpmpublish/package.json @@ -31,11 +31,11 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "libnpmpack": "^4.0.0", "lodash.clonedeep": "^4.5.0", "nock": "^13.2.4", - "tap": "^15" + "tap": "^16.0.1" }, "repository": { "type": "git", @@ -49,13 +49,13 @@ "npm-package-arg": "^9.0.1", "npm-registry-fetch": "^13.0.0", "semver": "^7.1.3", - "ssri": "^8.0.1" + "ssri": "^9.0.0" }, "engines": { "node": "^12.13.0 || ^14.15.0 || >=16.0.0" }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.2.2" + "version": "3.3.2" } } diff --git a/workspaces/libnpmsearch/README.md b/workspaces/libnpmsearch/README.md index 31f44fe247923..86d75b16a433e 100644 --- a/workspaces/libnpmsearch/README.md +++ b/workspaces/libnpmsearch/README.md @@ -2,7 +2,7 @@ [![npm version](https://img.shields.io/npm/v/libnpmsearch.svg)](https://npm.im/libnpmsearch) [![license](https://img.shields.io/npm/l/libnpmsearch.svg)](https://npm.im/libnpmsearch) -[![Coverage Status](https://coveralls.io/repos/github/npm/libnpmsearch/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmsearch?branch=latest) +[![CI - libnpmsearch](https://github.com/npm/cli/actions/workflows/ci-libnpmsearch.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-libnpmsearch.yml) [`libnpmsearch`](https://github.com/npm/libnpmsearch) is a Node.js library for programmatically accessing the npm search endpoint. It does **not** support diff --git a/workspaces/libnpmsearch/package.json b/workspaces/libnpmsearch/package.json index 7bf69ecb8af45..2e5af3eaa60de 100644 --- a/workspaces/libnpmsearch/package.json +++ b/workspaces/libnpmsearch/package.json @@ -32,9 +32,9 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "nock": "^13.2.4", - "tap": "^15" + "tap": "^16.0.1" }, "repository": { "type": "git", @@ -51,6 +51,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.2.2" + "version": "3.3.2" } } diff --git a/workspaces/libnpmteam/README.md b/workspaces/libnpmteam/README.md index 603cf6622cd49..97323f82a646f 100644 --- a/workspaces/libnpmteam/README.md +++ b/workspaces/libnpmteam/README.md @@ -2,8 +2,7 @@ [![npm version](https://img.shields.io/npm/v/libnpmteam.svg)](https://npm.im/libnpmteam) [![license](https://img.shields.io/npm/l/libnpmteam.svg)](https://npm.im/libnpmteam) -[![GitHub Actions](https://github.com/npm/libnpmteam/workflows/Node%20CI/badge.svg)](https://github.com/npm/libnpmteam/workflows/Node%20CI/badge.svg) -[![Coverage Status](https://coveralls.io/repos/github/npm/libnpmteam/badge.svg?branch=latest)](https://coveralls.io/github/npm/libnpmteam?branch=latest) +[![CI - libnpmteam](https://github.com/npm/cli/actions/workflows/ci-libnpmteam.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-libnpmteam.yml) [`libnpmteam`](https://github.com/npm/libnpmteam) is a Node.js library that provides programmatic access to the guts of the npm CLI's `npm diff --git a/workspaces/libnpmteam/package.json b/workspaces/libnpmteam/package.json index 7f8ee98f2868d..f92c875fe0897 100644 --- a/workspaces/libnpmteam/package.json +++ b/workspaces/libnpmteam/package.json @@ -19,9 +19,9 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "nock": "^13.2.4", - "tap": "^15" + "tap": "^16.0.1" }, "repository": { "type": "git", @@ -45,6 +45,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.2.2" + "version": "3.3.2" } } diff --git a/workspaces/libnpmversion/README.md b/workspaces/libnpmversion/README.md index 165d16a2b607c..ac9ee50ae35d9 100644 --- a/workspaces/libnpmversion/README.md +++ b/workspaces/libnpmversion/README.md @@ -1,5 +1,9 @@ # libnpmversion +[![npm version](https://img.shields.io/npm/v/libnpmversion.svg)](https://npm.im/libnpmversion) +[![license](https://img.shields.io/npm/l/libnpmversion.svg)](https://npm.im/libnpmversion) +[![CI - libnpmversion](https://github.com/npm/cli/actions/workflows/ci-libnpmversion.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-libnpmversion.yml) + Library to do the things that 'npm version' does. ## USAGE diff --git a/workspaces/libnpmversion/package.json b/workspaces/libnpmversion/package.json index 2a3a7716a13e2..2702dd16df2c8 100644 --- a/workspaces/libnpmversion/package.json +++ b/workspaces/libnpmversion/package.json @@ -32,9 +32,9 @@ }, "devDependencies": { "@npmcli/eslint-config": "^3.0.1", - "@npmcli/template-oss": "3.2.2", + "@npmcli/template-oss": "3.3.2", "require-inject": "^1.4.4", - "tap": "^15" + "tap": "^16.0.1" }, "dependencies": { "@npmcli/git": "^3.0.0", @@ -49,6 +49,6 @@ }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "3.2.2" + "version": "3.3.2" } }