Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: npm/pacote
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7cedb6b5dbd68920d376a5ce6e9025679a78c384
Choose a base ref
...
head repository: npm/pacote
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5cdbfd1f482a41addabcf9b018aa5ce953fe47b6
Choose a head ref
Loading
Showing with 5,646 additions and 11,467 deletions.
  1. +10 −0 .commitlintrc.js
  2. +17 −0 .eslintrc.js
  3. +3 −0 .github/CODEOWNERS
  4. +54 −0 .github/ISSUE_TEMPLATE/bug.yml
  5. +3 −0 .github/ISSUE_TEMPLATE/config.yml
  6. +18 −0 .github/dependabot.yml
  7. +32 −0 .github/matchers/tap.json
  8. +27 −2 .github/settings.yml
  9. +39 −0 .github/workflows/audit.yml
  10. +211 −0 .github/workflows/ci-release.yml
  11. +92 −30 .github/workflows/ci.yml
  12. +36 −0 .github/workflows/codeql-analysis.yml
  13. +121 −0 .github/workflows/post-dependabot.yml
  14. +50 −0 .github/workflows/pull-request.yml
  15. +397 −0 .github/workflows/release.yml
  16. +27 −21 .gitignore
  17. +3 −0 .npmrc
  18. +3 −0 .release-please-manifest.json
  19. +354 −0 CHANGELOG.md
  20. +7 −0 CODE_OF_CONDUCT.md
  21. +50 −0 CONTRIBUTING.md
  22. +34 −8 README.md
  23. +13 −0 SECURITY.md
  24. +25 −16 lib/bin.js
  25. +32 −38 lib/dir.js
  26. +142 −113 lib/fetcher.js
  27. +22 −19 lib/file.js
  28. +73 −45 lib/git.js
  29. +11 −0 lib/index.js
  30. +249 −85 lib/registry.js
  31. +28 −14 lib/remote.js
  32. +5 −2 lib/util/cache-dir.js
  33. +4 −3 lib/util/is-package-bin.js
  34. +1 −2 lib/util/npm.js
  35. +0 −21 lib/util/proc-log.js
  36. +31 −0 lib/util/tar-create-options.js
  37. +10 −0 lib/util/trailing-slashes.js
  38. +0 −1 map.js
  39. +0 −10,194 package-lock.json
  40. +54 −32 package.json
  41. +37 −0 release-please-config.json
  42. +0 −130 tap-snapshots/test-file.js-TAP.test.js
  43. +147 −9 tap-snapshots/{test-bin.js-TAP.test.js → test/bin.js.test.cjs}
  44. +9 −9 tap-snapshots/{test-dir.js-TAP.test.js → test/dir.js.test.cjs}
  45. +10 −0 tap-snapshots/{test-fetcher.js-fake-sudo-TAP.test.js → test/fetcher.js-fake-sudo.test.cjs}
  46. +10 −0 tap-snapshots/{test-fetcher.js-TAP.test.js → test/fetcher.js.test.cjs}
  47. +304 −0 tap-snapshots/test/file.js.test.cjs
  48. 0 tap-snapshots/{test-index.js-TAP.test.js → test/index.js.test.cjs}
  49. 0 tap-snapshots/{test-remote.js-TAP.test.js → test/remote.js.test.cjs}
  50. +2 −2 tap-snapshots/{test-util-npm.js-TAP.test.js → test/util/npm.js.test.cjs}
  51. +20 −23 test/bin.js
  52. +52 −23 test/dir.js
  53. +179 −162 test/fetcher.js
  54. +31 −10 test/file.js
  55. +0 −61 test/fixtures/abbrev-manifest-full.json
  56. +28 −16 test/fixtures/abbrev/abbrev.js
  57. +29 −0 test/fixtures/npm-mock.js
  58. +2 −1 test/fixtures/prepare-script/prepare.js
  59. +98 −0 test/fixtures/sigstore/invalid-attestations.json
  60. +98 −0 test/fixtures/sigstore/malformed-subject-attestations.json
  61. +98 −0 test/fixtures/sigstore/mismatched-keyid-attestations.json
  62. +98 −0 test/fixtures/sigstore/mismatched-subject-digest-attestations.json
  63. +98 −0 test/fixtures/sigstore/mismatched-subject-name-attestations.json
  64. +98 −0 test/fixtures/sigstore/no-keyid-attestations.json
  65. +98 −0 test/fixtures/sigstore/unsupported-attestations.json
  66. +98 −0 test/fixtures/sigstore/valid-attestations.json
  67. +14 −0 test/fixtures/tnock.js
  68. +372 −241 test/git.js
  69. +19 −9 test/index.js
  70. +1,149 −50 test/registry.js
  71. +97 −47 test/remote.js
  72. +15 −5 test/util/add-git-sha.js
  73. +12 −6 test/util/cache-dir.js
  74. +4 −4 test/util/is-package-bin.js
  75. +3 −2 test/util/npm.js
  76. +0 −11 test/util/proc-log.js
  77. +29 −0 test/util/tar-create-options.js
10 changes: 10 additions & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* 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, 'always', ['lower-case', 'sentence-case', 'start-case']],
},
}
17 changes: 17 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* 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,
extends: [
'@npmcli',
...localConfigs,
],
}
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This file is automatically added by @npmcli/template-oss. Do not edit.

* @npm/cli-team
54 changes: 54 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# This file is automatically added by @npmcli/template-oss. Do not edit.

name: Bug
description: File a bug/issue
title: "[BUG] <title>"
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
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This file is automatically added by @npmcli/template-oss. Do not edit.

blank_issues_enabled: true
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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"
32 changes: 32 additions & 0 deletions .github/matchers/tap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"//@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
}
]
}
]
}
29 changes: 27 additions & 2 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
---
_extends: 'open-source-project-boilerplate'
# 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" ]
39 changes: 39 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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"

jobs:
audit:
name: Audit Dependencies
if: github.repository_owner == 'npm'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v3
- 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@v3
with:
node-version: 18.x
- name: Install npm@latest
run: npm i --prefer-online --no-fund --no-audit -g npm@latest
- name: npm Version
run: npm -v
- 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
Loading