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/cli
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v9.6.4
Choose a base ref
...
head repository: npm/cli
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v9.6.5
Choose a head ref

Commits on Apr 12, 2023

  1. fix: move to private attributes where possible

    _loadError and _valid still have some magic to them
    wraithgar committed Apr 12, 2023
    Copy the full SHA
    667cff5 View commit details
  2. fix: save raw data to file, not parsed data

    When ${X} values are read from an rc file, those values should be written back as-is when config is re-saved
    
    Fixes #6183
    wraithgar committed Apr 12, 2023
    Copy the full SHA
    c7fe1c7 View commit details
  3. Copy the full SHA
    a98358b View commit details
  4. chore: cleanup node integration workflow

    * treats all failures in nightly nodejs as warnings
    * retry flaky tests to see if they'll pass
    nlf authored and wraithgar committed Apr 12, 2023
    Copy the full SHA
    742b630 View commit details

Commits on Apr 17, 2023

  1. Copy the full SHA
    14c498d View commit details
  2. Copy the full SHA
    b5af015 View commit details
  3. Copy the full SHA
    2780714 View commit details
  4. Copy the full SHA
    2472205 View commit details
  5. deps: read@2.1.0

    wraithgar committed Apr 17, 2023
    Copy the full SHA
    acb9120 View commit details
  6. deps: ssri@10.0.3

    wraithgar committed Apr 17, 2023
    Copy the full SHA
    201aa5a View commit details
  7. deps: minimatch@7.4.6

    wraithgar committed Apr 17, 2023
    Copy the full SHA
    b39d54e View commit details
  8. deps: minipass@4.2.8

    wraithgar committed Apr 17, 2023
    Copy the full SHA
    5933841 View commit details
  9. deps: ini@4.1.0

    wraithgar committed Apr 17, 2023
    Copy the full SHA
    2c80b1e View commit details
  10. deps: walk-up-path@3.0.1

    wraithgar committed Apr 17, 2023
    Copy the full SHA
    357cc29 View commit details
  11. deps: minipass-fetch@3.0.2

    wraithgar committed Apr 17, 2023
    Copy the full SHA
    e49844e View commit details
  12. deps: semver@7.5.0

    wraithgar committed Apr 17, 2023
    Copy the full SHA
    3fa9542 View commit details

Commits on Apr 18, 2023

  1. docs: fix npm cache folder location for windows (#6329)

    The default npm install folder for windows is located at %AppData%\npm
    The default npm cache folder for windows is located at %LocalAppData%\npm-cache
    charlie-wong authored Apr 18, 2023
    Copy the full SHA
    997bcdf View commit details
  2. Copy the full SHA
    f4e73ab View commit details
  3. Copy the full SHA
    82879f6 View commit details
  4. Copy the full SHA
    dbe2776 View commit details
  5. deps: sigstore@1.3.0 (#6372)

    Signed-off-by: Brian DeHamer <bdehamer@github.com>
    bdehamer authored Apr 18, 2023
    Copy the full SHA
    fae5e00 View commit details

Commits on Apr 19, 2023

  1. Copy the full SHA
    31214a6 View commit details
  2. Copy the full SHA
    82c1582 View commit details
  3. Copy the full SHA
    33dc428 View commit details
  4. Copy the full SHA
    f7762e5 View commit details
  5. 1
    Copy the full SHA
    adddd7a View commit details
  6. Copy the full SHA
    c29ac09 View commit details
  7. chore: release 9.6.5

    github-actions[bot] authored and wraithgar committed Apr 19, 2023
    Copy the full SHA
    c7f4b35 View commit details
Showing with 1,563 additions and 2,752 deletions.
  1. +18 −17 .github/workflows/node-integration.yml
  2. +1 −1 .github/workflows/release.yml
  3. +7 −7 .release-please-manifest.json
  4. +1 −0 AUTHORS
  5. +36 −0 CHANGELOG.md
  6. +2 −3 DEPENDENCIES.md
  7. +1 −1 docs/lib/content/commands/npm-config.md
  8. +1 −1 docs/lib/content/configuring-npm/folders.md
  9. +2 −1 lib/commands/audit.js
  10. +1 −2 lib/commands/cache.js
  11. +17 −3 lib/commands/ci.js
  12. +7 −1 lib/commands/config.js
  13. +1 −1 lib/commands/dedupe.js
  14. +2 −1 lib/commands/diff.js
  15. +2 −2 lib/commands/explain.js
  16. +3 −2 lib/commands/fund.js
  17. +2 −1 lib/commands/install.js
  18. +4 −1 lib/commands/link.js
  19. +3 −3 lib/commands/ls.js
  20. +1 −2 lib/commands/outdated.js
  21. +1 −1 lib/commands/prune.js
  22. +2 −1 lib/commands/query.js
  23. +2 −2 lib/commands/rebuild.js
  24. +1 −1 lib/commands/shrinkwrap.js
  25. +1 −1 lib/commands/uninstall.js
  26. +2 −2 lib/commands/update.js
  27. +0 −5 lib/npm.js
  28. +0 −2 lib/package-url-cmd.js
  29. +1 −1 lib/utils/completion/installed-deep.js
  30. +2 −1 lib/utils/config/definitions.js
  31. +42 −46 lib/utils/update-notifier.js
  32. +1 −1 lib/workspaces/update-workspaces.js
  33. +1 −1 mock-registry/lib/index.js
  34. +1 −0 node_modules/.gitignore
  35. +2 −2 node_modules/@npmcli/metavuln-calculator/lib/advisory.js
  36. +5 −4 node_modules/@npmcli/metavuln-calculator/package.json
  37. +21 −0 node_modules/@tufjs/canonical-json/LICENSE
  38. +64 −0 node_modules/@tufjs/canonical-json/lib/index.js
  39. +39 −0 node_modules/@tufjs/canonical-json/package.json
  40. +2 −2 node_modules/@tufjs/models/dist/metadata.js
  41. +0 −62 node_modules/@tufjs/models/dist/utils/json.js
  42. +2 −2 node_modules/@tufjs/models/dist/utils/verify.js
  43. +5 −4 node_modules/@tufjs/models/package.json
  44. +81 −34 node_modules/ini/lib/ini.js
  45. +12 −8 node_modules/ini/package.json
  46. +25 −0 node_modules/make-fetch-happen/lib/cache/entry.js
  47. +2 −0 node_modules/make-fetch-happen/lib/options.js
  48. +4 −3 node_modules/make-fetch-happen/package.json
  49. +0 −300 node_modules/minimatch/dist/cjs/_parse.js
  50. +0 −14 node_modules/minimatch/dist/cjs/assert-valid-pattern.js
  51. +0 −4 node_modules/minimatch/dist/cjs/extglob.js
  52. +0 −650 node_modules/minimatch/dist/cjs/parse.js
  53. +0 −296 node_modules/minimatch/dist/mjs/_parse.js
  54. +0 −10 node_modules/minimatch/dist/mjs/assert-valid-pattern.js
  55. +0 −3 node_modules/minimatch/dist/mjs/extglob.js
  56. +0 −646 node_modules/minimatch/dist/mjs/parse.js
  57. +4 −1 node_modules/minimatch/package.json
  58. +14 −2 node_modules/minipass-fetch/lib/index.js
  59. +1 −0 node_modules/minipass-fetch/lib/request.js
  60. +4 −3 node_modules/minipass-fetch/package.json
  61. +4 −1 node_modules/minipass/package.json
  62. +4 −0 node_modules/normalize-package-data/AUTHORS
  63. +1 −1 node_modules/npm-install-checks/lib/index.js
  64. +4 −3 node_modules/npm-install-checks/package.json
  65. +2 −1 node_modules/npm-registry-fetch/lib/clean-url.js
  66. +4 −5 node_modules/npm-registry-fetch/package.json
  67. +3 −3 node_modules/read/lib/read.js
  68. +4 −3 node_modules/read/package.json
  69. +16 −2 node_modules/semver/bin/semver.js
  70. +37 −33 node_modules/semver/classes/comparator.js
  71. +6 −2 node_modules/semver/classes/range.js
  72. +27 −14 node_modules/semver/classes/semver.js
  73. +48 −17 node_modules/semver/functions/diff.js
  74. +3 −2 node_modules/semver/functions/inc.js
  75. +5 −22 node_modules/semver/functions/parse.js
  76. +1 −0 node_modules/semver/index.js
  77. +15 −2 node_modules/semver/internal/constants.js
  78. +14 −10 node_modules/semver/internal/parse-options.js
  79. +7 −6 node_modules/semver/package.json
  80. +1 −1 node_modules/semver/ranges/intersects.js
  81. +6 −3 node_modules/semver/ranges/subset.js
  82. +2 −2 node_modules/sigstore/dist/ca/index.js
  83. +13 −1 node_modules/sigstore/dist/ca/verify/signer.js
  84. +145 −0 node_modules/sigstore/dist/config.js
  85. 0 node_modules/sigstore/dist/{client → external}/error.js
  86. 0 node_modules/sigstore/dist/{client → external}/fulcio.js
  87. +3 −1 node_modules/sigstore/dist/{client → external}/index.js
  88. 0 node_modules/sigstore/dist/{client → external}/rekor.js
  89. +11 −1 node_modules/sigstore/dist/identity/ci.js
  90. +29 −12 node_modules/sigstore/dist/sigstore-utils.js
  91. +24 −111 node_modules/sigstore/dist/sigstore.js
  92. +6 −7 node_modules/sigstore/dist/tlog/index.js
  93. +13 −6 node_modules/sigstore/dist/tuf/index.js
  94. +16 −11 node_modules/sigstore/dist/tuf/target.js
  95. +1 −4 node_modules/sigstore/dist/types/sigstore/index.js
  96. +3 −0 node_modules/sigstore/dist/x509/ext.js
  97. +3 −2 node_modules/sigstore/package.json
  98. +65 −17 node_modules/ssri/lib/index.js
  99. +1 −1 node_modules/ssri/package.json
  100. +17 −13 node_modules/tuf-js/dist/updater.js
  101. +14 −0 node_modules/tuf-js/dist/utils/url.js
  102. +5 −5 node_modules/tuf-js/package.json
  103. +18 −0 node_modules/walk-up-path/dist/cjs/index.js
  104. +3 −0 node_modules/walk-up-path/dist/cjs/package.json
  105. +14 −0 node_modules/walk-up-path/dist/mjs/index.js
  106. +3 −0 node_modules/walk-up-path/dist/mjs/package.json
  107. +0 −11 node_modules/walk-up-path/index.js
  108. +52 −8 node_modules/walk-up-path/package.json
  109. +126 −80 package-lock.json
  110. +16 −16 package.json
  111. +2 −13 scripts/npm-cli-repos.txt
  112. +4 −1 scripts/resetdeps.js
  113. +1 −1 scripts/template-oss/_job-release-integration.yml
  114. +18 −17 scripts/template-oss/node-integration.yml
  115. +28 −0 scripts/update-cli-repos.js
  116. +0 −2 smoke-tests/tap-snapshots/test/index.js.test.cjs
  117. +50 −0 smoke-tests/test/index.js
  118. +2 −11 tap-snapshots/test/lib/docs.js.test.cjs
  119. +1 −1 tap-snapshots/test/lib/utils/error-message.js.test.cjs
  120. +1 −1 test/lib/cli.js
  121. +2 −2 test/lib/commands/config.js
  122. +1 −0 test/lib/utils/completion/installed-deep.js
  123. +1 −1 test/lib/utils/exit-handler.js
  124. +3 −3 test/lib/utils/replace-info.js
  125. +11 −0 workspaces/arborist/CHANGELOG.md
  126. +1 −0 workspaces/arborist/lib/arborist/index.js
  127. +1 −1 workspaces/arborist/lib/arborist/load-actual.js
  128. +1 −2 workspaces/arborist/lib/arborist/reify.js
  129. +1 −1 workspaces/arborist/lib/node.js
  130. +2 −2 workspaces/arborist/package.json
  131. +13 −0 workspaces/config/CHANGELOG.md
  132. +68 −69 workspaces/config/lib/index.js
  133. +3 −3 workspaces/config/package.json
  134. +23 −0 workspaces/config/test/index.js
  135. +6 −0 workspaces/libnpmdiff/CHANGELOG.md
  136. +2 −2 workspaces/libnpmdiff/package.json
  137. +12 −0 workspaces/libnpmexec/CHANGELOG.md
  138. +1 −1 workspaces/libnpmexec/lib/file-exists.js
  139. +14 −6 workspaces/libnpmexec/lib/index.js
  140. +3 −3 workspaces/libnpmexec/package.json
  141. +6 −0 workspaces/libnpmfund/CHANGELOG.md
  142. +2 −2 workspaces/libnpmfund/package.json
  143. +6 −0 workspaces/libnpmpack/CHANGELOG.md
  144. +2 −2 workspaces/libnpmpack/package.json
35 changes: 18 additions & 17 deletions .github/workflows/node-integration.yml
Original file line number Diff line number Diff line change
@@ -335,7 +335,7 @@ jobs:
}
}
const env = { ...meta.envVar }
const env = { ...meta.envVar, NODE_VERSION }
matrix.push({
package,
version: context.version,
@@ -455,28 +455,28 @@ jobs:
rm -f .taprc.bak
fi
commandCount=$(echo '${{ toJSON(matrix.commands) }}' | jq -r 'length')
if [[ $commandCount -eq 1 ]]; then
COMMAND=$(echo '${{ toJSON(matrix.commands) }}' | jq -r '.[0]')
$COMMAND
STEPEXIT=$?
if [[ $STEPEXIT -ne 0 ]]; then
if [[ "${{ matrix.flaky }}" == "true" || "${{ matrix.knownFailure }}" == "true" ]]; then
echo "::warning ::$COMMAND failed, exit $STEPEXIT"
exit 0
fi
fi
exit $STEPEXIT
fi
for row in $(echo '${{ toJSON(matrix.commands) }}' | jq -r '.[] | @base64'); do
FAILCOUNT=0
COMMAND=$(echo "$row" | base64 --decode)
echo "::group::$COMMAND"
$COMMAND
STEPEXIT=$?
if [[ $STEPEXIT -ne 0 ]]; then
if [[ "${{ matrix.flaky }}" == "true" || "${{ matrix.knownFailure }}" == "true" ]]; then
FAILCOUNT=1
if [[ "${{ matrix.knownFailure }}" == "true" || "$NODE_VERSION" == "nightly" ]]; then
echo "::warning ::$COMMAND failed, exit: $STEPEXIT"
elif [[ "${{ matrix.flaky }}" ]]; then
while [[ $STEPEXIT -ne 0 && $FAILCOUNT -lt 3 ]]; do
$COMMAND
STEPEXIT=$?
if [[ $STEPEXIT -ne 0 ]]; then
((FAILCOUNT=FAILCOUNT+1))
fi
done
if [[ $STEPEXIT -ne 0 ]]; then
echo "::warning ::$COMMAND still failing after $FAILCOUNT attempts, exit: $STEPEXIT"
fi
else
FINALEXIT=$STEPEXIT
echo "::error ::$COMMAND failed, exit: $STEPEXIT"
@@ -486,9 +486,10 @@ jobs:
done
exit $FINALEXIT
- name: Set conclusion
env: ${{ matrix.env }}
run: |
EXIT=1
if [[ "${{ steps.command.outcome }}" == "success" || "${{ matrix.flaky }}" == "true" || "${{ matrix.knownFailure }}" == "true" ]]; then
if [[ "${{ steps.command.outcome }}" == "success" || "${{ matrix.flaky }}" == "true" || "${{ matrix.knownFailure }}" == "true" || $NODE_VERSION == "nightly"]]; then
EXIT=0
fi
exit $EXIT
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -315,7 +315,7 @@ jobs:
matrix:
nodeVersion:
- 18
- 19
- 20
- nightly
uses: ./.github/workflows/node-integration.yml
with:
14 changes: 7 additions & 7 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
".": "9.6.4",
"workspaces/arborist": "6.2.7",
".": "9.6.5",
"workspaces/arborist": "6.2.8",
"workspaces/libnpmaccess": "7.0.2",
"workspaces/libnpmdiff": "5.0.15",
"workspaces/libnpmexec": "5.0.15",
"workspaces/libnpmfund": "4.0.15",
"workspaces/libnpmdiff": "5.0.16",
"workspaces/libnpmexec": "5.0.16",
"workspaces/libnpmfund": "4.0.16",
"workspaces/libnpmhook": "9.0.3",
"workspaces/libnpmorg": "5.0.3",
"workspaces/libnpmpack": "5.0.15",
"workspaces/libnpmpack": "5.0.16",
"workspaces/libnpmpublish": "7.1.3",
"workspaces/libnpmsearch": "6.0.2",
"workspaces/libnpmteam": "5.0.3",
"workspaces/libnpmversion": "4.0.2",
"workspaces/config": "6.1.5"
"workspaces/config": "6.1.6"
}
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -879,3 +879,4 @@ David Tanner <darthtanner@gmail.com>
Jeff Mealo <jeffreymealo@gmail.com>
Kevin Rouchut <kevin.rouchut@gmail.com>
Stafford Williams <staff0rd@users.noreply.github.com>
CharlieWONG <charlie-wong@outlook.com>
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
# Changelog

## [9.6.5](https://github.com/npm/cli/compare/v9.6.4...v9.6.5) (2023-04-19)

### Bug Fixes

* [`33dc428`](https://github.com/npm/cli/commit/33dc4285fd8c698c539faae10fe1bf76ceedb6b1) [#6374](https://github.com/npm/cli/pull/6374) account for npx package-name with no spec (@wraithgar)
* [`82879f6`](https://github.com/npm/cli/commit/82879f69c72681f636be73d13c4464e35f258954) [#6225](https://github.com/npm/cli/pull/6225) lazy loading of arborist and pacote (#6225) (@wraithgar)
* [`f4e73ab`](https://github.com/npm/cli/commit/f4e73ab87e0aa1e214f978d4723e85ee2cfdd9c8) [#6322](https://github.com/npm/cli/pull/6322) remove incompatible params from ci (#6322) (@wraithgar)
* [`c7fe1c7`](https://github.com/npm/cli/commit/c7fe1c70eef49fa666f9f25ec941afa8b6acbf05) [#6328](https://github.com/npm/cli/pull/6328) save raw data to file, not parsed data (@wraithgar)

### Documentation

* [`31214a6`](https://github.com/npm/cli/commit/31214a6d9e9d4e973f5a5462543ea1d91d7bbf65) [#6381](https://github.com/npm/cli/pull/6381) Update description for publish --provenance flag (#6381) (@feelepxyz)
* [`997bcdf`](https://github.com/npm/cli/commit/997bcdf8d4fd3e5ecdd224060fb166b43c3ffb19) [#6329](https://github.com/npm/cli/pull/6329) fix npm cache folder location for windows (#6329) (@charlie-wong)

### Dependencies

* [`fae5e00`](https://github.com/npm/cli/commit/fae5e0063215e97ee18a60f8136a06045d621ec2) [#6372](https://github.com/npm/cli/pull/6372) `sigstore@1.3.0` (#6372)
* [`3fa9542`](https://github.com/npm/cli/commit/3fa9542d7f3c0123cb3c49a40f6d5b7bc8d857a5) [#6363](https://github.com/npm/cli/pull/6363) `semver@7.5.0`
* [`e49844e`](https://github.com/npm/cli/commit/e49844e1c6943be193d8f700d85dac4ddaa91967) [#6363](https://github.com/npm/cli/pull/6363) `minipass-fetch@3.0.2`
* [`357cc29`](https://github.com/npm/cli/commit/357cc29a335e684391c7b840019223e555919406) [#6363](https://github.com/npm/cli/pull/6363) `walk-up-path@3.0.1`
* [`2c80b1e`](https://github.com/npm/cli/commit/2c80b1ede7b6a3c49b3255e171759d30913f0c74) [#6363](https://github.com/npm/cli/pull/6363) `ini@4.1.0`
* [`5933841`](https://github.com/npm/cli/commit/593384149feea848c60b2e6524d1cc1730a35798) [#6363](https://github.com/npm/cli/pull/6363) `minipass@4.2.8`
* [`b39d54e`](https://github.com/npm/cli/commit/b39d54e877e992a583f0d8185da1c3773737801d) [#6363](https://github.com/npm/cli/pull/6363) `minimatch@7.4.6`
* [`201aa5a`](https://github.com/npm/cli/commit/201aa5adcdfcb65ff215c4440244978c44c3ed8b) [#6363](https://github.com/npm/cli/pull/6363) `ssri@10.0.3`
* [`acb9120`](https://github.com/npm/cli/commit/acb912089c02c34f73a7d1e431bce563da98777f) [#6363](https://github.com/npm/cli/pull/6363) `read@2.1.0`
* [`2472205`](https://github.com/npm/cli/commit/247220552bc19a5751542289605f38ab9b74e124) [#6363](https://github.com/npm/cli/pull/6363) `npm-registry-fetch@14.0.4`
* [`2780714`](https://github.com/npm/cli/commit/278071456b3f90e1d3e46857679f547fa98781f0) [#6363](https://github.com/npm/cli/pull/6363) `npm-install-checks@6.1.1`
* [`b5af015`](https://github.com/npm/cli/commit/b5af015e63c75b33184ae329a27e994d6ef94506) [#6363](https://github.com/npm/cli/pull/6363) `make-fetch-happen@11.1.0`
* [`14c498d`](https://github.com/npm/cli/commit/14c498d7dbc13e0bc0f1d9438c0f7f1abd7f98d8) [#6363](https://github.com/npm/cli/pull/6363) `@npmcli/metavuln-calculator@5.0.1`
* [Workspace](https://github.com/npm/cli/releases/tag/arborist-v6.2.8): `@npmcli/arborist@6.2.8`
* [Workspace](https://github.com/npm/cli/releases/tag/config-v6.1.6): `@npmcli/config@6.1.6`
* [Workspace](https://github.com/npm/cli/releases/tag/libnpmdiff-v5.0.16): `libnpmdiff@5.0.16`
* [Workspace](https://github.com/npm/cli/releases/tag/libnpmexec-v5.0.16): `libnpmexec@5.0.16`
* [Workspace](https://github.com/npm/cli/releases/tag/libnpmfund-v4.0.16): `libnpmfund@4.0.16`
* [Workspace](https://github.com/npm/cli/releases/tag/libnpmpack-v5.0.16): `libnpmpack@5.0.16`

## [9.6.4](https://github.com/npm/cli/compare/v9.6.3...v9.6.4) (2023-04-05)

### Documentation
5 changes: 2 additions & 3 deletions DEPENDENCIES.md
Original file line number Diff line number Diff line change
@@ -136,7 +136,6 @@ graph LR;
npm-->read;
npm-->semver;
npm-->ssri;
npm-->treeverse;
npm-->validate-npm-package-name;
npm-->write-file-atomic;
npm-bundled-->npm-normalize-package-bin;
@@ -184,7 +183,6 @@ graph LR;
npmcli-arborist-->read-package-json-fast;
npmcli-arborist-->semver;
npmcli-arborist-->ssri;
npmcli-arborist-->treeverse;
npmcli-config-->ini;
npmcli-config-->nopt;
npmcli-config-->npmcli-eslint-config["@npmcli/eslint-config"];
@@ -772,6 +770,7 @@ graph LR;
tuf-js-->make-fetch-happen;
tuf-js-->tufjs-models["@tufjs/models"];
tufjs-models-->minimatch;
tufjs-models-->tufjs-canonical-json["@tufjs/canonical-json"];
unique-filename-->unique-slug;
unique-slug-->imurmurhash;
validate-npm-package-license-->spdx-correct;
@@ -800,4 +799,4 @@ packages higher up the chain.
- @npmcli/git, make-fetch-happen, @npmcli/config, init-package-json
- @npmcli/installed-package-contents, @npmcli/map-workspaces, cacache, npm-pick-manifest, @npmcli/run-script, read-package-json, promzard
- @npmcli/docs, @npmcli/fs, npm-bundled, read-package-json-fast, unique-filename, npm-install-checks, npm-package-arg, npm-packlist, normalize-package-data, @npmcli/package-json, bin-links, nopt, npmlog, parse-conflict-json, read
- @npmcli/eslint-config, @npmcli/template-oss, ignore-walk, semver, npm-normalize-package-bin, @npmcli/name-from-folder, json-parse-even-better-errors, fs-minipass, ssri, unique-slug, @npmcli/promise-spawn, hosted-git-info, proc-log, validate-npm-package-name, @npmcli/node-gyp, minipass-fetch, @npmcli/query, cmd-shim, read-cmd-shim, write-file-atomic, abbrev, are-we-there-yet, gauge, treeverse, minify-registry-metadata, ini, @npmcli/disparity-colors, mute-stream, npm-audit-report, npm-user-validate
- @npmcli/eslint-config, @npmcli/template-oss, ignore-walk, semver, npm-normalize-package-bin, @npmcli/name-from-folder, json-parse-even-better-errors, fs-minipass, ssri, unique-slug, @npmcli/promise-spawn, hosted-git-info, proc-log, validate-npm-package-name, @npmcli/node-gyp, minipass-fetch, @npmcli/query, cmd-shim, read-cmd-shim, write-file-atomic, abbrev, are-we-there-yet, gauge, minify-registry-metadata, ini, @npmcli/disparity-colors, mute-stream, npm-audit-report, npm-user-validate
2 changes: 1 addition & 1 deletion docs/lib/content/commands/npm-config.md
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ npm set key=value [key=value...]

Sets each of the config keys to the value provided.

If value is omitted, then it sets it to an empty string.
If value is omitted, the key will be removed from your config file entirely.

Note: for backwards compatibility, `npm config set key value` is supported
as an alias for `npm config set key=value`.
2 changes: 1 addition & 1 deletion docs/lib/content/configuring-npm/folders.md
Original file line number Diff line number Diff line change
@@ -72,7 +72,7 @@ Man pages are not installed on Windows systems.
#### Cache

See [`npm cache`](/commands/npm-cache). Cache files are stored in `~/.npm` on Posix, or
`%AppData%/npm-cache` on Windows.
`%LocalAppData%/npm-cache` on Windows.

This is controlled by the [`cache` config](/using-npm/config#cache) param.

3 changes: 2 additions & 1 deletion lib/commands/audit.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const Arborist = require('@npmcli/arborist')
const auditReport = require('npm-audit-report')
const fetch = require('npm-registry-fetch')
const localeCompare = require('@isaacs/string-locale-compare')('en')
@@ -413,6 +412,7 @@ class Audit extends ArboristWorkspaceCmd {

async auditAdvisories (args) {
const reporter = this.npm.config.get('json') ? 'json' : 'detail'
const Arborist = require('@npmcli/arborist')
const opts = {
...this.npm.flatOptions,
audit: true,
@@ -445,6 +445,7 @@ class Audit extends ArboristWorkspaceCmd {
}

log.verbose('loading installed dependencies')
const Arborist = require('@npmcli/arborist')
const opts = {
...this.npm.flatOptions,
path: this.npm.prefix,
3 changes: 1 addition & 2 deletions lib/commands/cache.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const cacache = require('cacache')
const Arborist = require('@npmcli/arborist')
const pacote = require('pacote')
const fs = require('fs/promises')
const { join } = require('path')
@@ -162,7 +161,7 @@ class Cache extends BaseCommand {
return pacote.tarball.stream(spec, stream => {
stream.resume()
return stream.promise()
}, { ...this.npm.flatOptions, Arborist })
}, { ...this.npm.flatOptions })
}))
}

20 changes: 17 additions & 3 deletions lib/commands/ci.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
const Arborist = require('@npmcli/arborist')
const reifyFinish = require('../utils/reify-finish.js')
const runScript = require('@npmcli/run-script')
const fs = require('fs/promises')
const log = require('../utils/log-shim.js')
const validateLockfile = require('../utils/validate-lockfile.js')

const ArboristWorkspaceCmd = require('../arborist-cmd.js')
const Install = require('./install.js')

class CI extends ArboristWorkspaceCmd {
static description = 'Clean install a project'
static name = 'ci'

static params = Install.params
// These are in the order they will show up in when running "-h"
static params = [
'install-strategy',
'legacy-bundling',
'global-style',
'omit',
'strict-peer-deps',
'package-lock',
'foreground-scripts',
'ignore-scripts',
'audit',
'bin-links',
'fund',
'dry-run',
...super.params,
]

async exec () {
if (this.npm.global) {
@@ -22,6 +35,7 @@ class CI extends ArboristWorkspaceCmd {
}

const where = this.npm.prefix
const Arborist = require('@npmcli/arborist')
const opts = {
...this.npm.flatOptions,
packageLock: true, // npm ci should never skip lock files
8 changes: 7 additions & 1 deletion lib/commands/config.js
Original file line number Diff line number Diff line change
@@ -163,7 +163,13 @@ class Config extends BaseCommand {
`The \`${baseKey}\` option is deprecated, and can not be set in this way${deprecated}`
)
}
this.npm.config.set(key, val || '', where)

if (val === '') {
this.npm.config.delete(key, where)
} else {
this.npm.config.set(key, val, where)
}

if (!this.npm.config.validate(where)) {
log.warn('config', 'omitting invalid config values')
}
2 changes: 1 addition & 1 deletion lib/commands/dedupe.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// dedupe duplicated packages, or find them in the tree
const Arborist = require('@npmcli/arborist')
const reifyFinish = require('../utils/reify-finish.js')

const ArboristWorkspaceCmd = require('../arborist-cmd.js')
@@ -31,6 +30,7 @@ class Dedupe extends ArboristWorkspaceCmd {

const dryRun = this.npm.config.get('dry-run')
const where = this.npm.prefix
const Arborist = require('@npmcli/arborist')
const opts = {
...this.npm.flatOptions,
path: where,
3 changes: 2 additions & 1 deletion lib/commands/diff.js
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@ const { resolve } = require('path')
const semver = require('semver')
const libnpmdiff = require('libnpmdiff')
const npa = require('npm-package-arg')
const Arborist = require('@npmcli/arborist')
const pacote = require('pacote')
const pickManifest = require('npm-pick-manifest')
const log = require('../utils/log-shim')
@@ -146,6 +145,7 @@ class Diff extends BaseCommand {
if (spec.registry) {
let actualTree
let node
const Arborist = require('@npmcli/arborist')
try {
const opts = {
...this.npm.flatOptions,
@@ -257,6 +257,7 @@ class Diff extends BaseCommand {

async findVersionsByPackageName (specs) {
let actualTree
const Arborist = require('@npmcli/arborist')
try {
const opts = {
...this.npm.flatOptions,
4 changes: 2 additions & 2 deletions lib/commands/explain.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
const { explainNode } = require('../utils/explain-dep.js')
const completion = require('../utils/completion/installed-deep.js')
const Arborist = require('@npmcli/arborist')
const npa = require('npm-package-arg')
const semver = require('semver')
const { relative, resolve } = require('path')
@@ -21,6 +19,7 @@ class Explain extends ArboristWorkspaceCmd {
// TODO
/* istanbul ignore next */
async completion (opts) {
const completion = require('../utils/completion/installed-deep.js')
return completion(this.npm, opts)
}

@@ -29,6 +28,7 @@ class Explain extends ArboristWorkspaceCmd {
throw this.usageError()
}

const Arborist = require('@npmcli/arborist')
const arb = new Arborist({ path: this.npm.prefix, ...this.npm.flatOptions })
const tree = await arb.loadActual()

5 changes: 3 additions & 2 deletions lib/commands/fund.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
const archy = require('archy')
const Arborist = require('@npmcli/arborist')
const pacote = require('pacote')
const semver = require('semver')
const npa = require('npm-package-arg')
const { depth } = require('treeverse')
const { readTree: getFundingInfo, normalizeFunding, isValidFunding } = require('libnpmfund')

const completion = require('../utils/completion/installed-deep.js')
const openUrl = require('../utils/open-url.js')
const ArboristWorkspaceCmd = require('../arborist-cmd.js')

@@ -39,6 +37,7 @@ class Fund extends ArboristWorkspaceCmd {
// TODO
/* istanbul ignore next */
async completion (opts) {
const completion = require('../utils/completion/installed-deep.js')
return completion(this.npm, opts)
}

@@ -64,6 +63,7 @@ class Fund extends ArboristWorkspaceCmd {
}

const where = this.npm.prefix
const Arborist = require('@npmcli/arborist')
const arb = new Arborist({ ...this.npm.flatOptions, path: where })
const tree = await arb.loadActual()

@@ -80,6 +80,7 @@ class Fund extends ArboristWorkspaceCmd {
// TODO: add !workspacesEnabled option handling to libnpmfund
const fundingInfo = getFundingInfo(tree, {
...this.flatOptions,
Arborist,
workspaces: this.workspaceNames,
})

Loading