pax_global_header 0000666 0000000 0000000 00000000064 15147116470 0014520 g ustar 00root root 0000000 0000000 52 comment=f270dcf377e893ff0b473d5bc4680e81ad55fd26
npm-minipass-fetch-f270dcf/ 0000775 0000000 0000000 00000000000 15147116470 0015717 5 ustar 00root root 0000000 0000000 npm-minipass-fetch-f270dcf/.commitlintrc.js 0000664 0000000 0000000 00000000566 15147116470 0021046 0 ustar 00root root 0000000 0000000 /* This file is automatically added by @npmcli/template-oss. Do not edit. */
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [2, 'always', ['feat', 'fix', 'docs', 'deps', 'chore']],
'header-max-length': [2, 'always', 80],
'subject-case': [0],
'body-max-line-length': [0],
'footer-max-line-length': [0],
},
}
npm-minipass-fetch-f270dcf/.eslintrc.js 0000664 0000000 0000000 00000000623 15147116470 0020157 0 ustar 00root root 0000000 0000000 /* This file is automatically added by @npmcli/template-oss. Do not edit. */
'use strict'
const { readdirSync: readdir } = require('fs')
const localConfigs = readdir(__dirname)
.filter((file) => file.startsWith('.eslintrc.local.'))
.map((file) => `./${file}`)
module.exports = {
root: true,
ignorePatterns: [
'tap-testdir*/',
],
extends: [
'@npmcli',
...localConfigs,
],
}
npm-minipass-fetch-f270dcf/.github/ 0000775 0000000 0000000 00000000000 15147116470 0017257 5 ustar 00root root 0000000 0000000 npm-minipass-fetch-f270dcf/.github/CODEOWNERS 0000664 0000000 0000000 00000000132 15147116470 0020646 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
* @npm/cli-team
npm-minipass-fetch-f270dcf/.github/ISSUE_TEMPLATE/ 0000775 0000000 0000000 00000000000 15147116470 0021442 5 ustar 00root root 0000000 0000000 npm-minipass-fetch-f270dcf/.github/ISSUE_TEMPLATE/bug.yml 0000664 0000000 0000000 00000002655 15147116470 0022752 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: Bug
description: File a bug/issue
title: "[BUG]
"
labels: [ Bug, Needs Triage ]
body:
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please [search here](./issues) to see if an issue already exists for your problem.
options:
- label: I have searched the existing issues
required: true
- type: textarea
attributes:
label: Current Behavior
description: A clear & concise description of what you're experiencing.
validations:
required: false
- type: textarea
attributes:
label: Expected Behavior
description: A clear & concise description of what you expected to happen.
validations:
required: false
- type: textarea
attributes:
label: Steps To Reproduce
description: Steps to reproduce the behavior.
value: |
1. In this environment...
2. With this config...
3. Run '...'
4. See error...
validations:
required: false
- type: textarea
attributes:
label: Environment
description: |
examples:
- **npm**: 7.6.3
- **Node**: 13.14.0
- **OS**: Ubuntu 20.04
- **platform**: Macbook Pro
value: |
- npm:
- Node:
- OS:
- platform:
validations:
required: false
npm-minipass-fetch-f270dcf/.github/ISSUE_TEMPLATE/config.yml 0000664 0000000 0000000 00000000145 15147116470 0023432 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
blank_issues_enabled: true
npm-minipass-fetch-f270dcf/.github/actions/ 0000775 0000000 0000000 00000000000 15147116470 0020717 5 ustar 00root root 0000000 0000000 npm-minipass-fetch-f270dcf/.github/actions/create-check/ 0000775 0000000 0000000 00000000000 15147116470 0023235 5 ustar 00root root 0000000 0000000 npm-minipass-fetch-f270dcf/.github/actions/create-check/action.yml 0000664 0000000 0000000 00000002720 15147116470 0025236 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: 'Create Check'
inputs:
name:
required: true
token:
required: true
sha:
required: true
check-name:
default: ''
outputs:
check-id:
value: ${{ steps.create-check.outputs.check_id }}
runs:
using: "composite"
steps:
- name: Get Workflow Job
uses: actions/github-script@v7
id: workflow
env:
JOB_NAME: "${{ inputs.name }}"
SHA: "${{ inputs.sha }}"
with:
result-encoding: string
script: |
const { repo: { owner, repo}, runId, serverUrl } = context
const { JOB_NAME, SHA } = process.env
const job = await github.rest.actions.listJobsForWorkflowRun({
owner,
repo,
run_id: runId,
per_page: 100
}).then(r => r.data.jobs.find(j => j.name.endsWith(JOB_NAME)))
return [
`This check is assosciated with ${serverUrl}/${owner}/${repo}/commit/${SHA}.`,
'Run logs:',
job?.html_url || `could not be found for a job ending with: "${JOB_NAME}"`,
].join(' ')
- name: Create Check
uses: LouisBrunner/checks-action@v1.6.0
id: create-check
with:
token: ${{ inputs.token }}
sha: ${{ inputs.sha }}
status: in_progress
name: ${{ inputs.check-name || inputs.name }}
output: |
{"summary":"${{ steps.workflow.outputs.result }}"}
npm-minipass-fetch-f270dcf/.github/actions/install-latest-npm/ 0000775 0000000 0000000 00000000000 15147116470 0024447 5 ustar 00root root 0000000 0000000 npm-minipass-fetch-f270dcf/.github/actions/install-latest-npm/action.yml 0000664 0000000 0000000 00000003406 15147116470 0026452 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: 'Install Latest npm'
description: 'Install the latest version of npm compatible with the Node version'
inputs:
node:
description: 'Current Node version'
required: true
runs:
using: "composite"
steps:
# node 10/12/14 ship with npm@6, which is known to fail when updating itself in windows
- name: Update Windows npm
if: |
runner.os == 'Windows' && (
startsWith(inputs.node, 'v10.') ||
startsWith(inputs.node, 'v12.') ||
startsWith(inputs.node, 'v14.')
)
shell: cmd
run: |
curl -sO https://registry.npmjs.org/npm/-/npm-7.5.4.tgz
tar xf npm-7.5.4.tgz
cd package
node lib/npm.js install --no-fund --no-audit -g ..\npm-7.5.4.tgz
cd ..
rmdir /s /q package
- name: Install Latest npm
shell: bash
env:
NODE_VERSION: ${{ inputs.node }}
working-directory: ${{ runner.temp }}
run: |
MATCH=""
SPECS=("latest" "next-10" "next-9" "next-8" "next-7" "next-6")
echo "node@$NODE_VERSION"
for SPEC in ${SPECS[@]}; do
ENGINES=$(npm view npm@$SPEC --json | jq -r '.engines.node')
echo "Checking if node@$NODE_VERSION satisfies npm@$SPEC ($ENGINES)"
if npx semver -r "$ENGINES" "$NODE_VERSION" > /dev/null; then
MATCH=$SPEC
echo "Found compatible version: npm@$MATCH"
break
fi
done
if [ -z $MATCH ]; then
echo "Could not find a compatible version of npm for node@$NODE_VERSION"
exit 1
fi
npm i --prefer-online --no-fund --no-audit -g npm@$MATCH
- name: npm Version
shell: bash
run: npm -v
npm-minipass-fetch-f270dcf/.github/dependabot.yml 0000664 0000000 0000000 00000000656 15147116470 0022116 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
version: 2
updates:
- package-ecosystem: npm
directory: /
schedule:
interval: daily
target-branch: "main"
allow:
- dependency-type: direct
versioning-strategy: increase-if-necessary
commit-message:
prefix: deps
prefix-development: chore
labels:
- "Dependencies"
open-pull-requests-limit: 10
npm-minipass-fetch-f270dcf/.github/matchers/ 0000775 0000000 0000000 00000000000 15147116470 0021065 5 ustar 00root root 0000000 0000000 npm-minipass-fetch-f270dcf/.github/matchers/tap.json 0000664 0000000 0000000 00000001204 15147116470 0022541 0 ustar 00root root 0000000 0000000 {
"//@npmcli/template-oss": "This file is automatically added by @npmcli/template-oss. Do not edit.",
"problemMatcher": [
{
"owner": "tap",
"pattern": [
{
"regexp": "^\\s*not ok \\d+ - (.*)",
"message": 1
},
{
"regexp": "^\\s*---"
},
{
"regexp": "^\\s*at:"
},
{
"regexp": "^\\s*line:\\s*(\\d+)",
"line": 1
},
{
"regexp": "^\\s*column:\\s*(\\d+)",
"column": 1
},
{
"regexp": "^\\s*file:\\s*(.*)",
"file": 1
}
]
}
]
}
npm-minipass-fetch-f270dcf/.github/settings.yml 0000664 0000000 0000000 00000001377 15147116470 0021652 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
repository:
allow_merge_commit: false
allow_rebase_merge: true
allow_squash_merge: true
squash_merge_commit_title: PR_TITLE
squash_merge_commit_message: PR_BODY
delete_branch_on_merge: true
enable_automated_security_fixes: true
enable_vulnerability_alerts: true
branches:
- name: main
protection:
required_status_checks: null
enforce_admins: true
block_creations: true
required_pull_request_reviews:
required_approving_review_count: 1
require_code_owner_reviews: true
require_last_push_approval: true
dismiss_stale_reviews: true
restrictions:
apps: []
users: []
teams: [ "cli-team" ]
npm-minipass-fetch-f270dcf/.github/workflows/ 0000775 0000000 0000000 00000000000 15147116470 0021314 5 ustar 00root root 0000000 0000000 npm-minipass-fetch-f270dcf/.github/workflows/audit.yml 0000664 0000000 0000000 00000002275 15147116470 0023153 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: Audit
on:
workflow_dispatch:
schedule:
# "At 08:00 UTC (01:00 PT) on Monday" https://crontab.guru/#0_8_*_*_1
- cron: "0 8 * * 1"
permissions:
contents: read
jobs:
audit:
name: Audit Dependencies
if: github.repository_owner == 'npm'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v4
id: node
with:
node-version: 22.x
check-latest: contains('22.x', '.x')
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund --package-lock
- name: Run Production Audit
run: npm audit --omit=dev
- name: Run Full Audit
run: npm audit --audit-level=none
npm-minipass-fetch-f270dcf/.github/workflows/ci-release.yml 0000664 0000000 0000000 00000010707 15147116470 0024055 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: CI - Release
on:
workflow_dispatch:
inputs:
ref:
required: true
type: string
default: main
workflow_call:
inputs:
ref:
required: true
type: string
check-sha:
required: true
type: string
permissions:
contents: read
checks: write
jobs:
lint-all:
name: Lint All
if: github.repository_owner == 'npm'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Create Check
id: create-check
if: ${{ inputs.check-sha }}
uses: ./.github/actions/create-check
with:
name: "Lint All"
token: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ inputs.check-sha }}
- name: Setup Node
uses: actions/setup-node@v4
id: node
with:
node-version: 22.x
check-latest: contains('22.x', '.x')
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Lint
run: npm run lint --ignore-scripts
- name: Post Lint
run: npm run postlint --ignore-scripts
- name: Conclude Check
uses: LouisBrunner/checks-action@v1.6.0
if: steps.create-check.outputs.check-id && always()
with:
token: ${{ secrets.GITHUB_TOKEN }}
conclusion: ${{ job.status }}
check_id: ${{ steps.create-check.outputs.check-id }}
test-all:
name: Test All - ${{ matrix.platform.name }} - ${{ matrix.node-version }}
if: github.repository_owner == 'npm'
strategy:
fail-fast: false
matrix:
platform:
- name: Linux
os: ubuntu-latest
shell: bash
- name: macOS
os: macos-latest
shell: bash
- name: macOS
os: macos-13
shell: bash
- name: Windows
os: windows-latest
shell: cmd
node-version:
- 20.17.0
- 20.x
- 22.9.0
- 22.x
exclude:
- platform: { name: macOS, os: macos-13, shell: bash }
node-version: 20.17.0
- platform: { name: macOS, os: macos-13, shell: bash }
node-version: 20.x
- platform: { name: macOS, os: macos-13, shell: bash }
node-version: 22.9.0
- platform: { name: macOS, os: macos-13, shell: bash }
node-version: 22.x
runs-on: ${{ matrix.platform.os }}
defaults:
run:
shell: ${{ matrix.platform.shell }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Create Check
id: create-check
if: ${{ inputs.check-sha }}
uses: ./.github/actions/create-check
with:
name: "Test All - ${{ matrix.platform.name }} - ${{ matrix.node-version }}"
token: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ inputs.check-sha }}
- name: Setup Node
uses: actions/setup-node@v4
id: node
with:
node-version: ${{ matrix.node-version }}
check-latest: contains(matrix.node-version, '.x')
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Add Problem Matcher
run: echo "::add-matcher::.github/matchers/tap.json"
- name: Test
run: npm test --ignore-scripts
- name: Conclude Check
uses: LouisBrunner/checks-action@v1.6.0
if: steps.create-check.outputs.check-id && always()
with:
token: ${{ secrets.GITHUB_TOKEN }}
conclusion: ${{ job.status }}
check_id: ${{ steps.create-check.outputs.check-id }}
npm-minipass-fetch-f270dcf/.github/workflows/ci.yml 0000664 0000000 0000000 00000006141 15147116470 0022434 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
schedule:
# "At 09:00 UTC (02:00 PT) on Monday" https://crontab.guru/#0_9_*_*_1
- cron: "0 9 * * 1"
permissions:
contents: read
jobs:
lint:
name: Lint
if: github.repository_owner == 'npm'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v4
id: node
with:
node-version: 22.x
check-latest: contains('22.x', '.x')
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Lint
run: npm run lint --ignore-scripts
- name: Post Lint
run: npm run postlint --ignore-scripts
test:
name: Test - ${{ matrix.platform.name }} - ${{ matrix.node-version }}
if: github.repository_owner == 'npm'
strategy:
fail-fast: false
matrix:
platform:
- name: Linux
os: ubuntu-latest
shell: bash
- name: macOS
os: macos-latest
shell: bash
- name: macOS
os: macos-13
shell: bash
- name: Windows
os: windows-latest
shell: cmd
node-version:
- 20.17.0
- 20.x
- 22.9.0
- 22.x
exclude:
- platform: { name: macOS, os: macos-13, shell: bash }
node-version: 20.17.0
- platform: { name: macOS, os: macos-13, shell: bash }
node-version: 20.x
- platform: { name: macOS, os: macos-13, shell: bash }
node-version: 22.9.0
- platform: { name: macOS, os: macos-13, shell: bash }
node-version: 22.x
runs-on: ${{ matrix.platform.os }}
defaults:
run:
shell: ${{ matrix.platform.shell }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v4
id: node
with:
node-version: ${{ matrix.node-version }}
check-latest: contains(matrix.node-version, '.x')
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Add Problem Matcher
run: echo "::add-matcher::.github/matchers/tap.json"
- name: Test
run: npm test --ignore-scripts
npm-minipass-fetch-f270dcf/.github/workflows/codeql-analysis.yml 0000664 0000000 0000000 00000001606 15147116470 0025132 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: CodeQL
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
# "At 10:00 UTC (03:00 PT) on Monday" https://crontab.guru/#0_10_*_*_1
- cron: "0 10 * * 1"
permissions:
contents: read
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: javascript
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
npm-minipass-fetch-f270dcf/.github/workflows/post-dependabot.yml 0000664 0000000 0000000 00000012004 15147116470 0025124 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: Post Dependabot
on: pull_request
permissions:
contents: write
jobs:
template-oss:
name: template-oss
if: github.repository_owner == 'npm' && github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v4
id: node
with:
node-version: 22.x
check-latest: contains('22.x', '.x')
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Fetch Dependabot Metadata
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
# Dependabot can update multiple directories so we output which directory
# it is acting on so we can run the command for the correct root or workspace
- name: Get Dependabot Directory
if: contains(steps.metadata.outputs.dependency-names, '@npmcli/template-oss')
id: flags
run: |
dependabot_dir="${{ steps.metadata.outputs.directory }}"
if [[ "$dependabot_dir" == "/" || "$dependabot_dir" == "/main" ]]; then
echo "workspace=-iwr" >> $GITHUB_OUTPUT
else
# strip leading slash from directory so it works as a
# a path to the workspace flag
echo "workspace=--workspace ${dependabot_dir#/}" >> $GITHUB_OUTPUT
fi
- name: Apply Changes
if: steps.flags.outputs.workspace
id: apply
run: |
npm run template-oss-apply ${{ steps.flags.outputs.workspace }}
if [[ `git status --porcelain` ]]; then
echo "changes=true" >> $GITHUB_OUTPUT
fi
# This only sets the conventional commit prefix. This workflow can't reliably determine
# what the breaking change is though. If a BREAKING CHANGE message is required then
# this PR check will fail and the commit will be amended with stafftools
if [[ "${{ steps.metadata.outputs.update-type }}" == "version-update:semver-major" ]]; then
prefix='feat!'
else
prefix='chore'
fi
echo "message=$prefix: postinstall for dependabot template-oss PR" >> $GITHUB_OUTPUT
# This step will fail if template-oss has made any workflow updates. It is impossible
# for a workflow to update other workflows. In the case it does fail, we continue
# and then try to apply only a portion of the changes in the next step
- name: Push All Changes
if: steps.apply.outputs.changes
id: push
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git commit -am "${{ steps.apply.outputs.message }}"
git push
# If the previous step failed, then reset the commit and remove any workflow changes
# and attempt to commit and push again. This is helpful because we will have a commit
# with the correct prefix that we can then --amend with @npmcli/stafftools later.
- name: Push All Changes Except Workflows
if: steps.apply.outputs.changes && steps.push.outcome == 'failure'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git reset HEAD~
git checkout HEAD -- .github/workflows/
git clean -fd .github/workflows/
git commit -am "${{ steps.apply.outputs.message }}"
git push
# Check if all the necessary template-oss changes were applied. Since we continued
# on errors in one of the previous steps, this check will fail if our follow up
# only applied a portion of the changes and we need to followup manually.
#
# Note that this used to run `lint` and `postlint` but that will fail this action
# if we've also shipped any linting changes separate from template-oss. We do
# linting in another action, so we want to fail this one only if there are
# template-oss changes that could not be applied.
- name: Check Changes
if: steps.apply.outputs.changes
run: |
npm exec --offline ${{ steps.flags.outputs.workspace }} -- template-oss-check
- name: Fail on Breaking Change
if: steps.apply.outputs.changes && startsWith(steps.apply.outputs.message, 'feat!')
run: |
echo "This PR has a breaking change. Run 'npx -p @npmcli/stafftools gh template-oss-fix'"
echo "for more information on how to fix this with a BREAKING CHANGE footer."
exit 1
npm-minipass-fetch-f270dcf/.github/workflows/pull-request.yml 0000664 0000000 0000000 00000002737 15147116470 0024512 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: Pull Request
on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize
permissions:
contents: read
jobs:
commitlint:
name: Lint Commits
if: github.repository_owner == 'npm'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v4
id: node
with:
node-version: 22.x
check-latest: contains('22.x', '.x')
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Run Commitlint on Commits
id: commit
continue-on-error: true
run: npx --offline commitlint -V --from 'origin/${{ github.base_ref }}' --to ${{ github.event.pull_request.head.sha }}
- name: Run Commitlint on PR Title
if: steps.commit.outcome == 'failure'
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: echo "$PR_TITLE" | npx --offline commitlint -V
npm-minipass-fetch-f270dcf/.github/workflows/release-integration.yml 0000664 0000000 0000000 00000004163 15147116470 0026004 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: Release Integration
on:
workflow_dispatch:
inputs:
releases:
required: true
type: string
description: 'A json array of releases. Required fields: publish: tagName, publishTag. publish check: pkgName, version'
workflow_call:
inputs:
releases:
required: true
type: string
description: 'A json array of releases. Required fields: publish: tagName, publishTag. publish check: pkgName, version'
secrets:
PUBLISH_TOKEN:
required: true
permissions:
contents: read
id-token: write
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
defaults:
run:
shell: bash
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ fromJSON(inputs.releases)[0].tagName }}
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v4
id: node
with:
node-version: 22.x
check-latest: contains('22.x', '.x')
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Set npm authToken
run: npm config set '//registry.npmjs.org/:_authToken'=\${PUBLISH_TOKEN}
- name: Publish
env:
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
RELEASES: ${{ inputs.releases }}
run: |
EXIT_CODE=0
for release in $(echo $RELEASES | jq -r '.[] | @base64'); do
PUBLISH_TAG=$(echo "$release" | base64 --decode | jq -r .publishTag)
npm publish --provenance --tag="$PUBLISH_TAG"
STATUS=$?
if [[ "$STATUS" -eq 1 ]]; then
EXIT_CODE=$STATUS
fi
done
exit $EXIT_CODE
npm-minipass-fetch-f270dcf/.github/workflows/release.yml 0000664 0000000 0000000 00000026106 15147116470 0023464 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
name: Release
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
checks: write
jobs:
release:
outputs:
pr: ${{ steps.release.outputs.pr }}
pr-branch: ${{ steps.release.outputs.pr-branch }}
pr-number: ${{ steps.release.outputs.pr-number }}
pr-sha: ${{ steps.release.outputs.pr-sha }}
releases: ${{ steps.release.outputs.releases }}
comment-id: ${{ steps.create-comment.outputs.comment-id || steps.update-comment.outputs.comment-id }}
check-id: ${{ steps.create-check.outputs.check-id }}
name: Release
if: github.repository_owner == 'npm'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v4
id: node
with:
node-version: 22.x
check-latest: contains('22.x', '.x')
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Release Please
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx --offline template-oss-release-please --branch="${{ github.ref_name }}" --backport="" --defaultTag="latest"
- name: Create Release Manager Comment Text
if: steps.release.outputs.pr-number
uses: actions/github-script@v7
id: comment-text
with:
result-encoding: string
script: |
const { runId, repo: { owner, repo } } = context
const { data: workflow } = await github.rest.actions.getWorkflowRun({ owner, repo, run_id: runId })
return['## Release Manager', `Release workflow run: ${workflow.html_url}`].join('\n\n')
- name: Find Release Manager Comment
uses: peter-evans/find-comment@v2
if: steps.release.outputs.pr-number
id: found-comment
with:
issue-number: ${{ steps.release.outputs.pr-number }}
comment-author: 'github-actions[bot]'
body-includes: '## Release Manager'
- name: Create Release Manager Comment
id: create-comment
if: steps.release.outputs.pr-number && !steps.found-comment.outputs.comment-id
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ steps.release.outputs.pr-number }}
body: ${{ steps.comment-text.outputs.result }}
- name: Update Release Manager Comment
id: update-comment
if: steps.release.outputs.pr-number && steps.found-comment.outputs.comment-id
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ steps.found-comment.outputs.comment-id }}
body: ${{ steps.comment-text.outputs.result }}
edit-mode: 'replace'
- name: Create Check
id: create-check
uses: ./.github/actions/create-check
if: steps.release.outputs.pr-sha
with:
name: "Release"
token: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ steps.release.outputs.pr-sha }}
update:
needs: release
outputs:
sha: ${{ steps.commit.outputs.sha }}
check-id: ${{ steps.create-check.outputs.check-id }}
name: Update - Release
if: github.repository_owner == 'npm' && needs.release.outputs.pr
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ needs.release.outputs.pr-branch }}
- name: Setup Git User
run: |
git config --global user.email "npm-cli+bot@github.com"
git config --global user.name "npm CLI robot"
- name: Setup Node
uses: actions/setup-node@v4
id: node
with:
node-version: 22.x
check-latest: contains('22.x', '.x')
- name: Install Latest npm
uses: ./.github/actions/install-latest-npm
with:
node: ${{ steps.node.outputs.node-version }}
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Create Release Manager Checklist Text
id: comment-text
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm exec --offline -- template-oss-release-manager --pr="${{ needs.release.outputs.pr-number }}" --backport="" --defaultTag="latest" --publish
- name: Append Release Manager Comment
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ needs.release.outputs.comment-id }}
body: ${{ steps.comment-text.outputs.result }}
edit-mode: 'append'
- name: Run Post Pull Request Actions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run rp-pull-request --ignore-scripts --if-present -- --pr="${{ needs.release.outputs.pr-number }}" --commentId="${{ needs.release.outputs.comment-id }}"
- name: Commit
id: commit
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git commit --all --amend --no-edit || true
git push --force-with-lease
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: Create Check
id: create-check
uses: ./.github/actions/create-check
with:
name: "Update - Release"
check-name: "Release"
token: ${{ secrets.GITHUB_TOKEN }}
sha: ${{ steps.commit.outputs.sha }}
- name: Conclude Check
uses: LouisBrunner/checks-action@v1.6.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
conclusion: ${{ job.status }}
check_id: ${{ needs.release.outputs.check-id }}
ci:
name: CI - Release
needs: [ release, update ]
if: needs.release.outputs.pr
uses: ./.github/workflows/ci-release.yml
with:
ref: ${{ needs.release.outputs.pr-branch }}
check-sha: ${{ needs.update.outputs.sha }}
post-ci:
needs: [ release, update, ci ]
name: Post CI - Release
if: github.repository_owner == 'npm' && needs.release.outputs.pr && always()
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Get CI Conclusion
id: conclusion
run: |
result=""
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
result="failure"
elif [[ "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
result="cancelled"
else
result="success"
fi
echo "result=$result" >> $GITHUB_OUTPUT
- name: Conclude Check
uses: LouisBrunner/checks-action@v1.6.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
conclusion: ${{ steps.conclusion.outputs.result }}
check_id: ${{ needs.update.outputs.check-id }}
post-release:
needs: release
outputs:
comment-id: ${{ steps.create-comment.outputs.comment-id }}
name: Post Release - Release
if: github.repository_owner == 'npm' && needs.release.outputs.releases
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Create Release PR Comment Text
id: comment-text
uses: actions/github-script@v7
env:
RELEASES: ${{ needs.release.outputs.releases }}
with:
result-encoding: string
script: |
const releases = JSON.parse(process.env.RELEASES)
const { runId, repo: { owner, repo } } = context
const issue_number = releases[0].prNumber
const runUrl = `https://github.com/${owner}/${repo}/actions/runs/${runId}`
return [
'## Release Workflow\n',
...releases.map(r => `- \`${r.pkgName}@${r.version}\` ${r.url}`),
`- Workflow run: :arrows_counterclockwise: ${runUrl}`,
].join('\n')
- name: Create Release PR Comment
id: create-comment
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ fromJSON(needs.release.outputs.releases)[0].prNumber }}
body: ${{ steps.comment-text.outputs.result }}
release-integration:
needs: release
name: Release Integration
if: needs.release.outputs.releases
uses: ./.github/workflows/release-integration.yml
permissions:
contents: read
id-token: write
secrets:
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
with:
releases: ${{ needs.release.outputs.releases }}
post-release-integration:
needs: [ release, release-integration, post-release ]
name: Post Release Integration - Release
if: github.repository_owner == 'npm' && needs.release.outputs.releases && always()
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Get Post Release Conclusion
id: conclusion
run: |
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
result="x"
elif [[ "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
result="heavy_multiplication_x"
else
result="white_check_mark"
fi
echo "result=$result" >> $GITHUB_OUTPUT
- name: Find Release PR Comment
uses: peter-evans/find-comment@v2
id: found-comment
with:
issue-number: ${{ fromJSON(needs.release.outputs.releases)[0].prNumber }}
comment-author: 'github-actions[bot]'
body-includes: '## Release Workflow'
- name: Create Release PR Comment Text
id: comment-text
if: steps.found-comment.outputs.comment-id
uses: actions/github-script@v7
env:
RESULT: ${{ steps.conclusion.outputs.result }}
BODY: ${{ steps.found-comment.outputs.comment-body }}
with:
result-encoding: string
script: |
const { RESULT, BODY } = process.env
const body = [BODY.replace(/(Workflow run: :)[a-z_]+(:)/, `$1${RESULT}$2`)]
if (RESULT !== 'white_check_mark') {
body.push(':rotating_light::rotating_light::rotating_light:')
body.push([
'@npm/cli-team: The post-release workflow failed for this release.',
'Manual steps may need to be taken after examining the workflow output.'
].join(' '))
body.push(':rotating_light::rotating_light::rotating_light:')
}
return body.join('\n\n').trim()
- name: Update Release PR Comment
if: steps.comment-text.outputs.result
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ steps.found-comment.outputs.comment-id }}
body: ${{ steps.comment-text.outputs.result }}
edit-mode: 'replace'
npm-minipass-fetch-f270dcf/.gitignore 0000664 0000000 0000000 00000001050 15147116470 0017703 0 ustar 00root root 0000000 0000000 # This file is automatically added by @npmcli/template-oss. Do not edit.
# ignore everything in the root
/*
!**/.gitignore
!/.commitlintrc.js
!/.eslint.config.js
!/.eslintrc.js
!/.eslintrc.local.*
!/.git-blame-ignore-revs
!/.github/
!/.gitignore
!/.npmrc
!/.prettierignore
!/.prettierrc.js
!/.release-please-manifest.json
!/bin/
!/CHANGELOG*
!/CODE_OF_CONDUCT.md
!/CONTRIBUTING.md
!/docs/
!/lib/
!/LICENSE*
!/map.js
!/package.json
!/README*
!/release-please-config.json
!/scripts/
!/SECURITY.md
!/tap-snapshots/
!/test/
!/tsconfig.json
tap-testdir*/
npm-minipass-fetch-f270dcf/.npmrc 0000664 0000000 0000000 00000000135 15147116470 0017036 0 ustar 00root root 0000000 0000000 ; This file is automatically added by @npmcli/template-oss. Do not edit.
package-lock=false
npm-minipass-fetch-f270dcf/.release-please-manifest.json 0000664 0000000 0000000 00000000023 15147116470 0023356 0 ustar 00root root 0000000 0000000 {
".": "5.0.2"
}
npm-minipass-fetch-f270dcf/CHANGELOG.md 0000664 0000000 0000000 00000025677 15147116470 0017551 0 ustar 00root root 0000000 0000000 # Changelog
## [5.0.2](https://github.com/npm/minipass-fetch/compare/v5.0.1...v5.0.2) (2026-02-23)
### Bug Fixes
* [`2eba115`](https://github.com/npm/minipass-fetch/commit/2eba11567031e7f68db856076ed532785430ff74) use iconvLite directly for charset conversion (@wraithgar)
### Dependencies
* [`1a404dd`](https://github.com/npm/minipass-fetch/commit/1a404dd0bd0739445d04fe96e35912e12a26a684) add `iconv-lite@0.7.2`
* [`420afb2`](https://github.com/npm/minipass-fetch/commit/420afb217fea7fafa3f154a5902a9248d2be1bb1) remove encoding
## [5.0.1](https://github.com/npm/minipass-fetch/compare/v5.0.0...v5.0.1) (2026-02-02)
### Bug Fixes
* [`3eb015c`](https://github.com/npm/minipass-fetch/commit/3eb015cccfac4fdb6d60fde9717aba293e3897dc) [#180](https://github.com/npm/minipass-fetch/pull/180) use new minipass-sized correctly (#180) (@wraithgar)
### Dependencies
* [`041730e`](https://github.com/npm/minipass-fetch/commit/041730ebda948dc060d8583b9e57c0df4b4003fa) [#178](https://github.com/npm/minipass-fetch/pull/178) `minipass-sized@2.0.0` (#178)
## [5.0.0](https://github.com/npm/minipass-fetch/compare/v4.0.1...v5.0.0) (2025-10-22)
### ⚠️ BREAKING CHANGES
* `minipass-fetch` now supports node `^20.17.0 || >=22.9.0`
### Bug Fixes
* [`c43be28`](https://github.com/npm/minipass-fetch/commit/c43be280321648ebcaea20638549961c5d7ec06e) [#174](https://github.com/npm/minipass-fetch/pull/174) regenerate cert for test fixtures (@owlstronaut)
* [`9016609`](https://github.com/npm/minipass-fetch/commit/901660916c6a75fa6ad3ce53b8b4eebd368eab23) [#172](https://github.com/npm/minipass-fetch/pull/172) align to npm 11 node engine range (#172) (@owlstronaut)
### Chores
* [`425aa2f`](https://github.com/npm/minipass-fetch/commit/425aa2fbe981a422415d4bc2ef0fa47c29477041) [#171](https://github.com/npm/minipass-fetch/pull/171) bumping @npmcli/template-oss from 4.23.3 to 4.24.3 (#171) (@owlstronaut)
## [4.0.1](https://github.com/npm/minipass-fetch/compare/v4.0.0...v4.0.1) (2025-02-26)
### Bug Fixes
* [`f33ade0`](https://github.com/npm/minipass-fetch/commit/f33ade0260605b49057e01ef19dc3caa1a6a1c45) [#167](https://github.com/npm/minipass-fetch/pull/167) avoid deadlock in deflate-encoded responses (#167) (@liath)
## [4.0.0](https://github.com/npm/minipass-fetch/compare/v3.0.5...v4.0.0) (2024-09-05)
### ⚠️ BREAKING CHANGES
* `minipass-fetch` now supports node `^18.17.0 || >=20.5.0`
### Bug Fixes
* [`1ce7c52`](https://github.com/npm/minipass-fetch/commit/1ce7c521ca6a895d7c7dda2adcce76d94ff10df0) [#161](https://github.com/npm/minipass-fetch/pull/161) align to npm 10 node engine range (@hashtagchris)
### Dependencies
* [`fddb214`](https://github.com/npm/minipass-fetch/commit/fddb214b731b6ae9c2c7da637c4596b15bdc965d) [#164](https://github.com/npm/minipass-fetch/pull/164) bump minizlib from 2.1.2 to 3.0.1 (@dependabot[bot])
### Chores
* [`f59d139`](https://github.com/npm/minipass-fetch/commit/f59d13935232e4b51475c35cc725bbbfb68af1a0) [#160](https://github.com/npm/minipass-fetch/pull/160) bump @npmcli/eslint-config from 4.0.5 to 5.0.0 (@dependabot[bot])
* [`8e696c6`](https://github.com/npm/minipass-fetch/commit/8e696c65d764dcb8522ead4485a4fdbf915d443b) [#161](https://github.com/npm/minipass-fetch/pull/161) run template-oss-apply (@hashtagchris)
* [`4a7fb89`](https://github.com/npm/minipass-fetch/commit/4a7fb89d3fd2e8477a854946e36ea129d18f1ceb) [#149](https://github.com/npm/minipass-fetch/pull/149) tests NODE_TLS_REJECT_UNAUTHORIZED (#149) (@reggi)
* [`7f99262`](https://github.com/npm/minipass-fetch/commit/7f99262467913f2fdd08387759b2a396516f4bed) [#163](https://github.com/npm/minipass-fetch/pull/163) postinstall for dependabot template-oss PR (@hashtagchris)
* [`21fcdc0`](https://github.com/npm/minipass-fetch/commit/21fcdc095ce1c808a70309f04016d554fade3308) [#163](https://github.com/npm/minipass-fetch/pull/163) bump @npmcli/template-oss from 4.22.0 to 4.23.3 (@dependabot[bot])
## [3.0.5](https://github.com/npm/minipass-fetch/compare/v3.0.4...v3.0.5) (2024-05-04)
### Bug Fixes
* [`980a276`](https://github.com/npm/minipass-fetch/commit/980a276b21681ca73a33679166e6ef3bb9cdf55a) [#147](https://github.com/npm/minipass-fetch/pull/147) linting: no-unused-vars (@lukekarrys)
### Chores
* [`52b1ea3`](https://github.com/npm/minipass-fetch/commit/52b1ea3e4f82ec163aefecca5796bc8db7ae8a31) [#147](https://github.com/npm/minipass-fetch/pull/147) bump @npmcli/template-oss to 4.22.0 (@lukekarrys)
* [`272e06e`](https://github.com/npm/minipass-fetch/commit/272e06e73fcd566c0446b3e235a996bb269c7e09) [#138](https://github.com/npm/minipass-fetch/pull/138) tests: correctly remove srl files when updating tls fixtures (#138) (@lukekarrys)
* [`250e493`](https://github.com/npm/minipass-fetch/commit/250e4936ea43cecb3d283183a49ca651cc6558d7) [#117](https://github.com/npm/minipass-fetch/pull/117) fix tests for node 20 (@lukekarrys)
* [`c5d7e43`](https://github.com/npm/minipass-fetch/commit/c5d7e4393aaa11e891b9616d633e988057990fd2) [#147](https://github.com/npm/minipass-fetch/pull/147) postinstall for dependabot template-oss PR (@lukekarrys)
* [`765e4f4`](https://github.com/npm/minipass-fetch/commit/765e4f4edcabd43590184ad47f91838ddb3871fd) [#145](https://github.com/npm/minipass-fetch/pull/145) bump @npmcli/template-oss from 4.21.3 to 4.21.4 (@dependabot[bot])
## [3.0.4](https://github.com/npm/minipass-fetch/compare/v3.0.3...v3.0.4) (2023-08-14)
### Dependencies
* [`69e9e53`](https://github.com/npm/minipass-fetch/commit/69e9e534a7e44897baa33a29f68276767b1ab805) [#114](https://github.com/npm/minipass-fetch/pull/114) bump minipass from 5.0.0 to 7.0.3
## [3.0.3](https://github.com/npm/minipass-fetch/compare/v3.0.2...v3.0.3) (2023-04-26)
### Dependencies
* [`7b5c016`](https://github.com/npm/minipass-fetch/commit/7b5c016c94a2ded9070f8a781895244fecb354c0) [#96](https://github.com/npm/minipass-fetch/pull/96) bump minipass from 4.2.7 to 5.0.0 (#96)
## [3.0.2](https://github.com/npm/minipass-fetch/compare/v3.0.1...v3.0.2) (2023-04-13)
### Bug Fixes
* [`3c40fdc`](https://github.com/npm/minipass-fetch/commit/3c40fdc8f179182bf9142b96e072a07bc9df746a) handle invalid redirect header in a response (#100) (@wraithgar, Mohammad macbook)
* [`cc962bc`](https://github.com/npm/minipass-fetch/commit/cc962bc03337d2f189a72e5a521b85289398f45d) Support longer timeouts - Inform http/tls timeout of chosen timeout (@josh-hemphill)
## [3.0.1](https://github.com/npm/minipass-fetch/compare/v3.0.0...v3.0.1) (2022-12-07)
### Dependencies
* [`1bb15fc`](https://github.com/npm/minipass-fetch/commit/1bb15fc33e873a29adb02149ee017b2c25c8a831) [#87](https://github.com/npm/minipass-fetch/pull/87) bump minipass from 3.3.6 to 4.0.0
## [3.0.0](https://github.com/npm/minipass-fetch/compare/v2.1.2...v3.0.0) (2022-10-10)
### ⚠️ BREAKING CHANGES
* `minipass-fetch` is now compatible with the following semver range for node: `^14.17.0 || ^16.13.0 || >=18.0.0`
### Features
* [`144dc38`](https://github.com/npm/minipass-fetch/commit/144dc38eb2e3be72ed916d426fc0063bd6cfacd4) [#74](https://github.com/npm/minipass-fetch/pull/74) postinstall for dependabot template-oss PR (@lukekarrys)
## [2.1.2](https://github.com/npm/minipass-fetch/compare/v2.1.1...v2.1.2) (2022-08-22)
### Bug Fixes
* **json:** don't catch body errors ([#64](https://github.com/npm/minipass-fetch/issues/64)) ([9658a0a](https://github.com/npm/minipass-fetch/commit/9658a0a60349b38e62011a22ab6e9079c4319e98))
## [2.1.1](https://github.com/npm/minipass-fetch/compare/v2.1.0...v2.1.1) (2022-08-17)
### Bug Fixes
* linting ([d2045cb](https://github.com/npm/minipass-fetch/commit/d2045cb25afb77e8c8f5c7551209922a16d5b215))
## [2.1.0](https://github.com/npm/minipass-fetch/compare/v2.0.3...v2.1.0) (2022-03-24)
### Features
* expose AbortError directly ([ed9d420](https://github.com/npm/minipass-fetch/commit/ed9d42026676a32e126e867186e2578e78e963f4))
### Bug Fixes
* do not setup the response timeout if the stream has already ended ([#53](https://github.com/npm/minipass-fetch/issues/53)) ([0feea3c](https://github.com/npm/minipass-fetch/commit/0feea3cf399b6a1888f3cf3292a12675c2306b4d))
### [2.0.3](https://www.github.com/npm/minipass-fetch/compare/v2.0.2...v2.0.3) (2022-03-08)
### Bug Fixes
* strip authorization and cookie headers on redirect to new host ([#45](https://www.github.com/npm/minipass-fetch/issues/45)) ([50d919a](https://www.github.com/npm/minipass-fetch/commit/50d919aafce3b95a8237a6e2dc93ae7e4215650f))
### [2.0.2](https://www.github.com/npm/minipass-fetch/compare/v2.0.1...v2.0.2) (2022-03-02)
### Bug Fixes
* pass search params as part of path string ([#40](https://www.github.com/npm/minipass-fetch/issues/40)) ([404ad4c](https://www.github.com/npm/minipass-fetch/commit/404ad4cf1a2c21563205bee21ca1ef785b31c72f))
### [2.0.1](https://www.github.com/npm/minipass-fetch/compare/v2.0.0...v2.0.1) (2022-03-01)
### Bug Fixes
* [#18](https://www.github.com/npm/minipass-fetch/issues/18) ([3a11fe4](https://www.github.com/npm/minipass-fetch/commit/3a11fe4c18587b61d4e212d332338bd3427f5894))
* Handle data: URIs more consistently ([#19](https://www.github.com/npm/minipass-fetch/issues/19)) ([3a11fe4](https://www.github.com/npm/minipass-fetch/commit/3a11fe4c18587b61d4e212d332338bd3427f5894)), closes [#18](https://www.github.com/npm/minipass-fetch/issues/18)
### Dependencies
* update encoding requirement from ^0.1.12 to ^0.1.13 ([#34](https://www.github.com/npm/minipass-fetch/issues/34)) ([65602ff](https://www.github.com/npm/minipass-fetch/commit/65602ffed38947efb13e907a165ebde22423cac9))
## [2.0.0](https://www.github.com/npm/minipass-fetch/compare/v1.4.1...v2.0.0) (2022-02-24)
### ⚠ BREAKING CHANGES
* this removes the (hopefully) unused feature that arbitrary strings are allowed as URLs in the Request constructor. we now require that URLs are valid and absolute.
* this drops support for node versions older than 12 LTS
### Bug Fixes
* check for existence of unref before calling ([05fb45b](https://www.github.com/npm/minipass-fetch/commit/05fb45b2289045899b8e762e0f16ff9dd6bbd767)), closes [#13](https://www.github.com/npm/minipass-fetch/issues/13)
* ensure we abort a request that emits error on the response body ([#25](https://www.github.com/npm/minipass-fetch/issues/25)) ([5565cde](https://www.github.com/npm/minipass-fetch/commit/5565cdef3cbcd0bc286794c42695f5ec2da83264))
* implement @npmcli/template-oss ([#26](https://www.github.com/npm/minipass-fetch/issues/26)) ([df5e1d2](https://www.github.com/npm/minipass-fetch/commit/df5e1d281372f88ecb8435aaec8ffa1712546390))
* use URL constructor instead of url.parse() ([#33](https://www.github.com/npm/minipass-fetch/issues/33)) ([f96f3b1](https://www.github.com/npm/minipass-fetch/commit/f96f3b13e68f3851fd9fadb762c58f441a4c3f48))
### Dependencies
* update minipass requirement from ^3.1.0 to ^3.1.6 ([#30](https://www.github.com/npm/minipass-fetch/issues/30)) ([4ce93e5](https://www.github.com/npm/minipass-fetch/commit/4ce93e5dd28b56457721454bea63f3c37b0d50d3))
* update minizlib requirement from ^2.0.0 to ^2.1.2 ([#29](https://www.github.com/npm/minipass-fetch/issues/29)) ([44e8701](https://www.github.com/npm/minipass-fetch/commit/44e8701d6c142223f6abe54c42f6e5a3d43707d7))
npm-minipass-fetch-f270dcf/CODE_OF_CONDUCT.md 0000664 0000000 0000000 00000000507 15147116470 0020520 0 ustar 00root root 0000000 0000000
All interactions in this repo are covered by the [npm Code of
Conduct](https://docs.npmjs.com/policies/conduct)
The npm cli team may, at its own discretion, moderate, remove, or edit
any interactions such as pull requests, issues, and comments.
npm-minipass-fetch-f270dcf/CONTRIBUTING.md 0000664 0000000 0000000 00000005133 15147116470 0020152 0 ustar 00root root 0000000 0000000
# Contributing
## Code of Conduct
All interactions in the **npm** organization on GitHub are considered to be covered by our standard [Code of Conduct](https://docs.npmjs.com/policies/conduct).
## Reporting Bugs
Before submitting a new bug report please search for an existing or similar report.
Use one of our existing issue templates if you believe you've come across a unique problem.
Duplicate issues, or issues that don't use one of our templates may get closed without a response.
## Pull Request Conventions
### Commits
We use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
When opening a pull request please be sure that either the pull request title, or each commit in the pull request, has one of the following prefixes:
- `feat`: For when introducing a new feature. The result will be a new semver minor version of the package when it is next published.
- `fix`: For bug fixes. The result will be a new semver patch version of the package when it is next published.
- `docs`: For documentation updates. The result will be a new semver patch version of the package when it is next published.
- `chore`: For changes that do not affect the published module. Often these are changes to tests. The result will be *no* change to the version of the package when it is next published (as the commit does not affect the published version).
### Test Coverage
Pull requests made against this repo will run `npm test` automatically. Please make sure tests pass locally before submitting a PR.
Every new feature or bug fix should come with a corresponding test or tests that validate the solutions. Testing also reports on code coverage and will fail if code coverage drops.
### Linting
Linting is also done automatically once tests pass. `npm run lintfix` will fix most linting errors automatically.
Please make sure linting passes before submitting a PR.
## What _not_ to contribute?
### Dependencies
It should be noted that our team does not accept third-party dependency updates/PRs. If you submit a PR trying to update our dependencies we will close it with or without a reference to these contribution guidelines.
### Tools/Automation
Our core team is responsible for the maintenance of the tooling/automation in this project and we ask contributors to not make changes to these when contributing (e.g. `.github/*`, `.eslintrc.json`, `.licensee.json`). Most of those files also have a header at the top to remind folks they are automatically generated. Pull requests that alter these will not be accepted.
npm-minipass-fetch-f270dcf/LICENSE 0000664 0000000 0000000 00000002434 15147116470 0016727 0 ustar 00root root 0000000 0000000 The MIT License (MIT)
Copyright (c) Isaac Z. Schlueter and Contributors
Copyright (c) 2016 David Frank
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---
Note: This is a derivative work based on "node-fetch" by David Frank,
modified and distributed under the terms of the MIT license above.
https://github.com/bitinn/node-fetch
npm-minipass-fetch-f270dcf/README.md 0000664 0000000 0000000 00000001734 15147116470 0017203 0 ustar 00root root 0000000 0000000 # minipass-fetch
An implementation of window.fetch in Node.js using Minipass streams
This is a fork (or more precisely, a reimplementation) of
[node-fetch](http://npm.im/node-fetch). All streams have been replaced
with [minipass streams](http://npm.im/minipass).
The goal of this module is to stay in sync with the API presented by
`node-fetch`, with the exception of the streaming interface provided.
## Why
Minipass streams are faster and more deterministic in their timing contract
than node-core streams, making them a better fit for many server-side use
cases.
## API
See [node-fetch](http://npm.im/node-fetch)
Differences from `node-fetch` (and, by extension, from the WhatWG Fetch
specification):
- Returns [minipass](http://npm.im/minipass) streams instead of node-core
streams.
- Supports the full set of [TLS Options that may be provided to
`https.request()`](https://nodejs.org/api/https.html#https_https_request_options_callback)
when making `https` requests.
npm-minipass-fetch-f270dcf/SECURITY.md 0000664 0000000 0000000 00000002320 15147116470 0017505 0 ustar 00root root 0000000 0000000
GitHub takes the security of our software products and services seriously, including the open source code repositories managed through our GitHub organizations, such as [GitHub](https://github.com/GitHub).
If you believe you have found a security vulnerability in this GitHub-owned open source repository, you can report it to us in one of two ways.
If the vulnerability you have found is *not* [in scope for the GitHub Bug Bounty Program](https://bounty.github.com/#scope) or if you do not wish to be considered for a bounty reward, please report the issue to us directly through [opensource-security@github.com](mailto:opensource-security@github.com).
If the vulnerability you have found is [in scope for the GitHub Bug Bounty Program](https://bounty.github.com/#scope) and you would like for your finding to be considered for a bounty reward, please submit the vulnerability to us through [HackerOne](https://hackerone.com/github) in order to be eligible to receive a bounty award.
**Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.**
Thanks for helping make GitHub safe for everyone.
npm-minipass-fetch-f270dcf/lib/ 0000775 0000000 0000000 00000000000 15147116470 0016465 5 ustar 00root root 0000000 0000000 npm-minipass-fetch-f270dcf/lib/abort-error.js 0000664 0000000 0000000 00000000552 15147116470 0021263 0 ustar 00root root 0000000 0000000 'use strict'
class AbortError extends Error {
constructor (message) {
super(message)
this.code = 'FETCH_ABORTED'
this.type = 'aborted'
Error.captureStackTrace(this, this.constructor)
}
get name () {
return 'AbortError'
}
// don't allow name to be overridden, but don't throw either
set name (s) {}
}
module.exports = AbortError
npm-minipass-fetch-f270dcf/lib/blob.js 0000664 0000000 0000000 00000004436 15147116470 0017750 0 ustar 00root root 0000000 0000000 'use strict'
const { Minipass } = require('minipass')
const TYPE = Symbol('type')
const BUFFER = Symbol('buffer')
class Blob {
constructor (blobParts, options) {
this[TYPE] = ''
const buffers = []
let size = 0
if (blobParts) {
const a = blobParts
const length = Number(a.length)
for (let i = 0; i < length; i++) {
const element = a[i]
const buffer = element instanceof Buffer ? element
: ArrayBuffer.isView(element)
? Buffer.from(element.buffer, element.byteOffset, element.byteLength)
: element instanceof ArrayBuffer ? Buffer.from(element)
: element instanceof Blob ? element[BUFFER]
: typeof element === 'string' ? Buffer.from(element)
: Buffer.from(String(element))
size += buffer.length
buffers.push(buffer)
}
}
this[BUFFER] = Buffer.concat(buffers, size)
const type = options && options.type !== undefined
&& String(options.type).toLowerCase()
if (type && !/[^\u0020-\u007E]/.test(type)) {
this[TYPE] = type
}
}
get size () {
return this[BUFFER].length
}
get type () {
return this[TYPE]
}
text () {
return Promise.resolve(this[BUFFER].toString())
}
arrayBuffer () {
const buf = this[BUFFER]
const off = buf.byteOffset
const len = buf.byteLength
const ab = buf.buffer.slice(off, off + len)
return Promise.resolve(ab)
}
stream () {
return new Minipass().end(this[BUFFER])
}
slice (start, end, type) {
const size = this.size
const relativeStart = start === undefined ? 0
: start < 0 ? Math.max(size + start, 0)
: Math.min(start, size)
const relativeEnd = end === undefined ? size
: end < 0 ? Math.max(size + end, 0)
: Math.min(end, size)
const span = Math.max(relativeEnd - relativeStart, 0)
const buffer = this[BUFFER]
const slicedBuffer = buffer.slice(
relativeStart,
relativeStart + span
)
const blob = new Blob([], { type })
blob[BUFFER] = slicedBuffer
return blob
}
get [Symbol.toStringTag] () {
return 'Blob'
}
static get BUFFER () {
return BUFFER
}
}
Object.defineProperties(Blob.prototype, {
size: { enumerable: true },
type: { enumerable: true },
})
module.exports = Blob
npm-minipass-fetch-f270dcf/lib/body.js 0000664 0000000 0000000 00000025273 15147116470 0017771 0 ustar 00root root 0000000 0000000 'use strict'
const { Minipass } = require('minipass')
const { MinipassSized } = require('minipass-sized')
const Blob = require('./blob.js')
const { BUFFER } = Blob
const FetchError = require('./fetch-error.js')
// optional dependency on 'iconv-lite'
let decode
try {
decode = require('iconv-lite').decode
} catch (e) {
// defer error until textConverted is called
}
const INTERNALS = Symbol('Body internals')
const CONSUME_BODY = Symbol('consumeBody')
class Body {
constructor (bodyArg, options = {}) {
const { size = 0, timeout = 0 } = options
const body = bodyArg === undefined || bodyArg === null ? null
: isURLSearchParams(bodyArg) ? Buffer.from(bodyArg.toString())
: isBlob(bodyArg) ? bodyArg
: Buffer.isBuffer(bodyArg) ? bodyArg
: Object.prototype.toString.call(bodyArg) === '[object ArrayBuffer]'
? Buffer.from(bodyArg)
: ArrayBuffer.isView(bodyArg)
? Buffer.from(bodyArg.buffer, bodyArg.byteOffset, bodyArg.byteLength)
: Minipass.isStream(bodyArg) ? bodyArg
: Buffer.from(String(bodyArg))
this[INTERNALS] = {
body,
disturbed: false,
error: null,
}
this.size = size
this.timeout = timeout
if (Minipass.isStream(body)) {
body.on('error', er => {
const error = er.name === 'AbortError' ? er
: new FetchError(`Invalid response while trying to fetch ${
this.url}: ${er.message}`, 'system', er)
this[INTERNALS].error = error
})
}
}
get body () {
return this[INTERNALS].body
}
get bodyUsed () {
return this[INTERNALS].disturbed
}
arrayBuffer () {
return this[CONSUME_BODY]().then(buf =>
buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength))
}
blob () {
const ct = this.headers && this.headers.get('content-type') || ''
return this[CONSUME_BODY]().then(buf => Object.assign(
new Blob([], { type: ct.toLowerCase() }),
{ [BUFFER]: buf }
))
}
async json () {
const buf = await this[CONSUME_BODY]()
try {
return JSON.parse(buf.toString())
} catch (er) {
throw new FetchError(
`invalid json response body at ${this.url} reason: ${er.message}`,
'invalid-json'
)
}
}
text () {
return this[CONSUME_BODY]().then(buf => buf.toString())
}
buffer () {
return this[CONSUME_BODY]()
}
textConverted () {
/* istanbul ignore if */
if (typeof decode !== 'function') {
throw new Error('The package `iconv-lite` must be installed to use the textConverted() function')
}
return this[CONSUME_BODY]().then(buf => convertBody(buf, this.headers))
}
[CONSUME_BODY] () {
if (this[INTERNALS].disturbed) {
return Promise.reject(new TypeError(`body used already for: ${
this.url}`))
}
this[INTERNALS].disturbed = true
if (this[INTERNALS].error) {
return Promise.reject(this[INTERNALS].error)
}
// body is null
if (this.body === null) {
return Promise.resolve(Buffer.alloc(0))
}
if (Buffer.isBuffer(this.body)) {
return Promise.resolve(this.body)
}
const upstream = isBlob(this.body) ? this.body.stream() : this.body
/* istanbul ignore if: should never happen */
if (!Minipass.isStream(upstream)) {
return Promise.resolve(Buffer.alloc(0))
}
const stream = this.size && upstream instanceof MinipassSized ? upstream
: !this.size && upstream instanceof Minipass &&
!(upstream instanceof MinipassSized) ? upstream
: this.size ? new MinipassSized({ size: this.size })
: new Minipass()
// allow timeout on slow response body, but only if the stream is still writable. this
// makes the timeout center on the socket stream from lib/index.js rather than the
// intermediary minipass stream we create to receive the data
const resTimeout = this.timeout && stream.writable ? setTimeout(() => {
stream.emit('error', new FetchError(
`Response timeout while trying to fetch ${
this.url} (over ${this.timeout}ms)`, 'body-timeout'))
}, this.timeout) : null
// do not keep the process open just for this timeout, even
// though we expect it'll get cleared eventually.
if (resTimeout && resTimeout.unref) {
resTimeout.unref()
}
// do the pipe in the promise, because the pipe() can send too much
// data through right away and upset the MP Sized object
return new Promise((resolve) => {
// if the stream is some other kind of stream, then pipe through a MP
// so we can collect it more easily.
if (stream !== upstream) {
upstream.on('error', er => stream.emit('error', er))
upstream.pipe(stream)
}
resolve()
}).then(() => stream.concat()).then(buf => {
clearTimeout(resTimeout)
return buf
}).catch(er => {
clearTimeout(resTimeout)
// request was aborted, reject with this Error
if (er.name === 'AbortError' || er.name === 'FetchError') {
throw er
} else if (er.name === 'RangeError') {
throw new FetchError(`Could not create Buffer from response body for ${
this.url}: ${er.message}`, 'system', er)
} else {
// other errors, such as incorrect content-encoding or content-length
throw new FetchError(`Invalid response body while trying to fetch ${
this.url}: ${er.message}`, 'system', er)
}
})
}
static clone (instance) {
if (instance.bodyUsed) {
throw new Error('cannot clone body after it is used')
}
const body = instance.body
// check that body is a stream and not form-data object
// NB: can't clone the form-data object without having it as a dependency
if (Minipass.isStream(body) && typeof body.getBoundary !== 'function') {
// create a dedicated tee stream so that we don't lose data
// potentially sitting in the body stream's buffer by writing it
// immediately to p1 and not having it for p2.
const tee = new Minipass()
const p1 = new Minipass()
const p2 = new Minipass()
tee.on('error', er => {
p1.emit('error', er)
p2.emit('error', er)
})
body.on('error', er => tee.emit('error', er))
tee.pipe(p1)
tee.pipe(p2)
body.pipe(tee)
// set instance body to one fork, return the other
instance[INTERNALS].body = p1
return p2
} else {
return instance.body
}
}
static extractContentType (body) {
return body === null || body === undefined ? null
: typeof body === 'string' ? 'text/plain;charset=UTF-8'
: isURLSearchParams(body)
? 'application/x-www-form-urlencoded;charset=UTF-8'
: isBlob(body) ? body.type || null
: Buffer.isBuffer(body) ? null
: Object.prototype.toString.call(body) === '[object ArrayBuffer]' ? null
: ArrayBuffer.isView(body) ? null
: typeof body.getBoundary === 'function'
? `multipart/form-data;boundary=${body.getBoundary()}`
: Minipass.isStream(body) ? null
: 'text/plain;charset=UTF-8'
}
static getTotalBytes (instance) {
const { body } = instance
return (body === null || body === undefined) ? 0
: isBlob(body) ? body.size
: Buffer.isBuffer(body) ? body.length
: body && typeof body.getLengthSync === 'function' && (
// detect form data input from form-data module
body._lengthRetrievers &&
/* istanbul ignore next */ body._lengthRetrievers.length === 0 || // 1.x
body.hasKnownLength && body.hasKnownLength()) // 2.x
? body.getLengthSync()
: null
}
static writeToStream (dest, instance) {
const { body } = instance
if (body === null || body === undefined) {
dest.end()
} else if (Buffer.isBuffer(body) || typeof body === 'string') {
dest.end(body)
} else {
// body is stream or blob
const stream = isBlob(body) ? body.stream() : body
stream.on('error', er => dest.emit('error', er)).pipe(dest)
}
return dest
}
}
Object.defineProperties(Body.prototype, {
body: { enumerable: true },
bodyUsed: { enumerable: true },
arrayBuffer: { enumerable: true },
blob: { enumerable: true },
json: { enumerable: true },
text: { enumerable: true },
})
const isURLSearchParams = obj =>
// Duck-typing as a necessary condition.
(typeof obj !== 'object' ||
typeof obj.append !== 'function' ||
typeof obj.delete !== 'function' ||
typeof obj.get !== 'function' ||
typeof obj.getAll !== 'function' ||
typeof obj.has !== 'function' ||
typeof obj.set !== 'function') ? false
// Brand-checking and more duck-typing as optional condition.
: obj.constructor.name === 'URLSearchParams' ||
Object.prototype.toString.call(obj) === '[object URLSearchParams]' ||
typeof obj.sort === 'function'
const isBlob = obj =>
typeof obj === 'object' &&
typeof obj.arrayBuffer === 'function' &&
typeof obj.type === 'string' &&
typeof obj.stream === 'function' &&
typeof obj.constructor === 'function' &&
typeof obj.constructor.name === 'string' &&
/^(Blob|File)$/.test(obj.constructor.name) &&
/^(Blob|File)$/.test(obj[Symbol.toStringTag])
const convertBody = (buffer, headers) => {
const ct = headers && headers.get('content-type')
let charset = 'utf-8'
let res
// header
if (ct) {
res = /charset=([^;]*)/i.exec(ct)
}
// no charset in content type, peek at response body for at most 1024 bytes
const str = buffer.slice(0, 1024).toString()
// html5
if (!res && str) {
res = /