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

Commits on Oct 3, 2023

  1. chore: filter node prs by base branch

    This is a fix to allow multiple Node PRs to be open.
    Previously the script would attempt to edit an existing PR but
    PRs to different branches were getting incorrectly edited.
    lukekarrys committed Oct 3, 2023
    Copy the full SHA
    83bcb1c View commit details
  2. Copy the full SHA
    2e4b4ad View commit details

Commits on Oct 6, 2023

  1. Copy the full SHA
    0cfe9de View commit details

Commits on Oct 9, 2023

  1. Copy the full SHA
    6af582f View commit details
  2. deps: ci-info@3.9.0

    wraithgar committed Oct 9, 2023
    Copy the full SHA
    fca804a View commit details
  3. Copy the full SHA
    e0163c6 View commit details
  4. Copy the full SHA
    03f3d2e View commit details
  5. Copy the full SHA
    14d31fd View commit details
  6. deps: minipass@7.0.4

    wraithgar committed Oct 9, 2023
    1
    Copy the full SHA
    61c3ee9 View commit details
  7. Copy the full SHA
    ee6892e View commit details
  8. Copy the full SHA
    e6b0be7 View commit details
  9. Copy the full SHA
    337c903 View commit details
  10. chore: cleanup release please config

    We have decided in the future we will always bring npm and workspaces
    in and out of prerelease at the same time. Therefore we will only need
    the top-level prelease config for release-please
    lukekarrys committed Oct 9, 2023
    Copy the full SHA
    97d6771 View commit details
  11. chore: correct publish script tag/version logic

    The publish script will now never attempt to publish a package that already exists.
    The tag to publish to is now only figured out after determining if the package already exists on the registry instead of before.
    This also added a confirmation prompt with a full table of name/version/tag of everything that will be published
    lukekarrys committed Oct 9, 2023
    Copy the full SHA
    ed8c553 View commit details

Commits on Oct 12, 2023

  1. Copy the full SHA
    ef69d36 View commit details
  2. Copy the full SHA
    8423d4f View commit details
  3. Copy the full SHA
    5b6172f View commit details
  4. Copy the full SHA
    3a927ee View commit details
  5. Copy the full SHA
    fcc9e40 View commit details
  6. deps: bin-links@4.0.3

    wraithgar committed Oct 12, 2023
    Copy the full SHA
    b405da1 View commit details

Commits on Oct 16, 2023

  1. Copy the full SHA
    35c92fe View commit details

Commits on Oct 17, 2023

  1. Copy the full SHA
    5508fe1 View commit details
  2. Copy the full SHA
    92cd4ad View commit details

Commits on Oct 18, 2023

  1. Copy the full SHA
    5142735 View commit details
  2. Copy the full SHA
    96e1637 View commit details
  3. chore(deps): bump @babel/traverse (#6916)

    Bumps  and [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse). These dependencies needed to be updated together.
    
    Updates `@babel/traverse` from 7.22.8 to 7.23.2
    - [Release notes](https://github.com/babel/babel/releases)
    - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
    - [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)
    
    Updates `@babel/traverse` from 7.21.5 to 7.23.2
    - [Release notes](https://github.com/babel/babel/releases)
    - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
    - [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)
    
    ---
    updated-dependencies:
    - dependency-name: "@babel/traverse"
      dependency-type: indirect
    - dependency-name: "@babel/traverse"
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Oct 18, 2023
    1
    Copy the full SHA
    724658f View commit details
  4. chore: release 10.2.1

    github-actions[bot] authored and wraithgar committed Oct 18, 2023
    1
    Copy the full SHA
    94f535b View commit details
Showing with 931 additions and 623 deletions.
  1. +2 −2 .release-please-manifest.json
  2. +4 −0 AUTHORS
  3. +30 −0 CHANGELOG.md
  4. +23 −8 docs/lib/content/commands/npm-rebuild.md
  5. +0 −2 docs/lib/content/using-npm/scripts.md
  6. +1 −1 lib/commands/audit.js
  7. +8 −4 lib/commands/logout.js
  8. +1 −5 lib/utils/queryable.js
  9. +5 −0 mock-registry/lib/index.js
  10. +5 −1 node_modules/@npmcli/agent/node_modules/https-proxy-agent/dist/index.js
  11. +4 −1 node_modules/@npmcli/agent/node_modules/https-proxy-agent/dist/parse-proxy-response.js
  12. +1 −1 node_modules/@npmcli/agent/node_modules/https-proxy-agent/package.json
  13. +2 −1 node_modules/@npmcli/agent/node_modules/socks-proxy-agent/dist/index.js
  14. +5 −5 node_modules/@npmcli/agent/node_modules/socks-proxy-agent/package.json
  15. +10 −8 node_modules/are-we-there-yet/lib/tracker-base.js
  16. +90 −94 node_modules/are-we-there-yet/lib/tracker-group.js
  17. +24 −22 node_modules/are-we-there-yet/lib/tracker-stream.js
  18. +26 −24 node_modules/are-we-there-yet/lib/tracker.js
  19. +5 −4 node_modules/are-we-there-yet/package.json
  20. +22 −21 node_modules/bin-links/lib/link-mans.js
  21. +3 −3 node_modules/bin-links/package.json
  22. +1 −1 node_modules/ci-info/LICENSE
  23. +4 −4 node_modules/ci-info/package.json
  24. +6 −3 node_modules/ci-info/vendors.json
  25. +10 −2 node_modules/cmd-shim/lib/index.js
  26. +4 −3 node_modules/cmd-shim/package.json
  27. +3 −3 node_modules/is-core-module/core.json
  28. +5 −5 node_modules/is-core-module/package.json
  29. +0 −3 node_modules/node-gyp/node_modules/cacache/node_modules/minipass/dist/cjs/package.json
  30. 0 node_modules/node-gyp/node_modules/cacache/node_modules/minipass/dist/{cjs → commonjs}/index.js
  31. +1 −0 node_modules/node-gyp/node_modules/cacache/node_modules/minipass/dist/commonjs/package.json
  32. 0 node_modules/node-gyp/node_modules/cacache/node_modules/minipass/dist/{mjs → esm}/index.js
  33. +1 −0 node_modules/node-gyp/node_modules/cacache/node_modules/minipass/dist/esm/package.json
  34. +0 −3 node_modules/node-gyp/node_modules/cacache/node_modules/minipass/dist/mjs/package.json
  35. +33 −33 node_modules/node-gyp/node_modules/cacache/node_modules/minipass/package.json
  36. +3 −1 node_modules/npm-install-checks/lib/index.js
  37. +3 −3 node_modules/npm-install-checks/package.json
  38. +50 −14 node_modules/npm-registry-fetch/lib/auth.js
  39. +2 −0 node_modules/npm-registry-fetch/lib/index.js
  40. +4 −10 node_modules/npm-registry-fetch/package.json
  41. +1 −1 node_modules/readable-stream/lib/stream/promises.js
  42. +4 −2 node_modules/readable-stream/package.json
  43. +6 −0 node_modules/spdx-license-ids/deprecated.json
  44. +62 −0 node_modules/spdx-license-ids/index.json
  45. +3 −3 node_modules/spdx-license-ids/package.json
  46. +178 −105 package-lock.json
  47. +5 −5 package.json
  48. +2 −16 release-please-config.json
  49. +1 −0 scripts/create-node-pr.js
  50. +65 −43 scripts/publish.js
  51. +4 −6 scripts/resetdeps.js
  52. +8 −2 scripts/util.js
  53. +4 −0 tap-snapshots/test/lib/commands/view.js.test.cjs
  54. +6 −6 test/lib/commands/audit.js
  55. +98 −114 test/lib/commands/logout.js
  56. +44 −0 test/lib/commands/pkg.js
  57. +6 −0 test/lib/commands/view.js
  58. +11 −0 workspaces/config/CHANGELOG.md
  59. +5 −8 workspaces/config/README.md
  60. +16 −16 workspaces/config/lib/index.js
  61. +1 −1 workspaces/config/package.json
4 changes: 2 additions & 2 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
".": "10.2.0",
".": "10.2.1",
"workspaces/arborist": "7.2.0",
"workspaces/libnpmaccess": "8.0.1",
"workspaces/libnpmdiff": "6.0.2",
@@ -12,5 +12,5 @@
"workspaces/libnpmsearch": "7.0.0",
"workspaces/libnpmteam": "6.0.0",
"workspaces/libnpmversion": "5.0.0",
"workspaces/config": "8.0.0"
"workspaces/config": "8.0.1"
}
4 changes: 4 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -901,3 +901,7 @@ Yuku Kotani <poyo0315@gmail.com>
Vlad-Ștefan Harbuz <291640+vladh@users.noreply.github.com>
siemhesda <143130929+siemhesda@users.noreply.github.com>
Carl <carl@carlfoster.io>
jpg619 <141764922+jpg619@users.noreply.github.com>
Frazer Smith <frazer.dev@outlook.com>
Aaron <2738518+NeonArray@users.noreply.github.com>
Wes Todd <wes@wesleytodd.com>
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# Changelog

## [10.2.1](https://github.com/npm/cli/compare/v10.2.0...v10.2.1) (2023-10-18)

### Bug Fixes

* [`35c92fe`](https://github.com/npm/cli/commit/35c92fec3d053d303cc8057faa0ff4fe6e7cdc8a) [#6902](https://github.com/npm/cli/pull/6902) Add check to pkg command to deal with empty values (#6902) (@NeonArray)
* [`5b6172f`](https://github.com/npm/cli/commit/5b6172f01c88b73e83a75a508bbdcad92231ead5) [#6895](https://github.com/npm/cli/pull/6895) logout from custom registry (@wraithgar)
* [`8423d4f`](https://github.com/npm/cli/commit/8423d4f133a40c8ceb0e1a75d23aa95fbf4f5b65) [#6895](https://github.com/npm/cli/pull/6895) delete auth from proper location on logout (@wraithgar)
* [`0cfe9de`](https://github.com/npm/cli/commit/0cfe9de1c74b20d3e04ecc26ccf594196d101afe) [#6873](https://github.com/npm/cli/pull/6873) audit: spelling error in message (#6873) (@Fdawgs)

### Documentation

* [`5142735`](https://github.com/npm/cli/commit/5142735c462e285a7a7d9bcbd562885c6ef96c96) [#6894](https://github.com/npm/cli/pull/6894) update npm build description (#6894) (@siemhesda)
* [`2e4b4ad`](https://github.com/npm/cli/commit/2e4b4ad8bef158def1b2302846ab294fe7a83de4) [#6861](https://github.com/npm/cli/pull/6861) npm publish content modification (#6861) (@jpg619)

### Dependencies

* [`96e1637`](https://github.com/npm/cli/commit/96e1637117b6614b5ad861d86d828746d5db356c) [#6915](https://github.com/npm/cli/pull/6915) `cmd-shim@6.0.2` (#6915)
* [`b405da1`](https://github.com/npm/cli/commit/b405da1672e05d55bd22e476091891c443bcbeab) [#6899](https://github.com/npm/cli/pull/6899) `bin-links@4.0.3`
* [`ef69d36`](https://github.com/npm/cli/commit/ef69d362fa81640ac3ca60a6e01921c17f7a76cb) [#6895](https://github.com/npm/cli/pull/6895) `npm-registry-fetch@16.1.0`
* [`337c903`](https://github.com/npm/cli/commit/337c9038605b97431e06d2f470229f4370703b13) [#6882](https://github.com/npm/cli/pull/6882) `spdx-license-ids@3.0.16`
* [`e6b0be7`](https://github.com/npm/cli/commit/e6b0be7d3b3cd7f66612f9adb6c4de829335b607) [#6882](https://github.com/npm/cli/pull/6882) `socks-proxy-agent@8.0.2`
* [`ee6892e`](https://github.com/npm/cli/commit/ee6892e69079b07c0a8747d873018819a97e3877) [#6882](https://github.com/npm/cli/pull/6882) `readable-stream@4.4.2`
* [`61c3ee9`](https://github.com/npm/cli/commit/61c3ee9a073528b30676ec66fdd29788ea7be09d) [#6882](https://github.com/npm/cli/pull/6882) `minipass@7.0.4`
* [`14d31fd`](https://github.com/npm/cli/commit/14d31fdcc747f420158d254d0ac258a848bc888c) [#6882](https://github.com/npm/cli/pull/6882) `is-core-module@2.13.0`
* [`03f3d2e`](https://github.com/npm/cli/commit/03f3d2e1d13cd12f23a946cfb9065b8e8fbe129b) [#6882](https://github.com/npm/cli/pull/6882) `https-proxy-agent@7.0.2`
* [`e0163c6`](https://github.com/npm/cli/commit/e0163c6787f3877c3ad6c84d8af44378f7eed23b) [#6882](https://github.com/npm/cli/pull/6882) `are-we-there-yet@4.0.1`
* [`fca804a`](https://github.com/npm/cli/commit/fca804adec57e176bb2a2e60bf84df44e661478f) [#6882](https://github.com/npm/cli/pull/6882) `ci-info@3.9.0`
* [`6af582f`](https://github.com/npm/cli/commit/6af582f23bf046a224d5679e917977f0bb3f95e3) [#6882](https://github.com/npm/cli/pull/6882) `npm-install-checks@6.3.0`
* [Workspace](https://github.com/npm/cli/releases/tag/config-v8.0.1): `@npmcli/config@8.0.1`

## [10.2.0](https://github.com/npm/cli/compare/v10.1.0...v10.2.0) (2023-10-02)

### Features
31 changes: 23 additions & 8 deletions docs/lib/content/commands/npm-rebuild.md
Original file line number Diff line number Diff line change
@@ -10,14 +10,29 @@ description: Rebuild a package

### Description

This command runs the `npm build` command on the matched folders. This is
useful when you install a new version of node, and must recompile all your
C++ addons with the new binary. It is also useful when installing with
`--ignore-scripts` and `--no-bin-links`, to explicitly choose which
packages to build and/or link bins.

If one or more package specs are provided, then only packages with a
name and version matching one of the specifiers will be rebuilt.
This command does the following:

1. Execute lifecycle scripts (`preinstall`, `install`, `postinstall`, `prepare`)
2. Links bins depending on whether bin links are enabled

This command is particularly useful in scenarios including but not limited to:

1. Installing a new version of **node.js**, where you need to recompile all your C++ add-ons with the updated binary.
2. Installing with `--ignore-scripts` and `--no-bin-links`, to explicitly choose which packages to build and/or link bins.

If one or more package specs are provided, then only packages with a name and version matching one of the specifiers will be rebuilt.

Usually, you should not need to run `npm rebuild` as it is already done for you as part of npm install (unless you suppressed these steps with `--ignore-scripts` or `--no-bin-links`).

If there is a `binding.gyp` file in the root of your package, then npm will use a default install hook:

```
"scripts": {
"install": "node-gyp rebuild"
}
```

This default behavior is suppressed if the `package.json` has its own `install` or `preinstall` scripts. It is also suppressed if the package specifies `"gypfile": false`

### Configuration

2 changes: 0 additions & 2 deletions docs/lib/content/using-npm/scripts.md
Original file line number Diff line number Diff line change
@@ -159,8 +159,6 @@ These are run from the scripts of `<pkg-name>`
* `publish`
* `postpublish`

`prepare` will not run during `--dry-run`

#### [`npm rebuild`](/commands/npm-rebuild)

* `preinstall`
2 changes: 1 addition & 1 deletion lib/commands/audit.js
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@ class VerifySignatures {
// Didn't find any dependencies that could be verified, e.g. only local
// deps, missing version, not on a registry etc.
if (!this.auditedWithKeysCount) {
throw new Error('found no dependencies to audit that where installed from ' +
throw new Error('found no dependencies to audit that were installed from ' +
'a supported registry')
}

12 changes: 8 additions & 4 deletions lib/commands/logout.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const getAuth = require('npm-registry-fetch/lib/auth.js')
const npmFetch = require('npm-registry-fetch')
const { getAuth } = npmFetch
const log = require('../utils/log-shim')
const BaseCommand = require('../base-command.js')

@@ -19,10 +19,14 @@ class Logout extends BaseCommand {

const auth = getAuth(reg, this.npm.flatOptions)

const level = this.npm.config.find(`${auth.regKey}:${auth.authKey}`)

// find the config level and only delete from there
if (auth.token) {
log.verbose('logout', `clearing token for ${reg}`)
await npmFetch(`/-/user/token/${encodeURIComponent(auth.token)}`, {
...this.npm.flatOptions,
registry: reg,
method: 'DELETE',
ignoreBody: true,
})
@@ -34,12 +38,12 @@ class Logout extends BaseCommand {
}

if (scope) {
this.npm.config.delete(regRef, 'user')
this.npm.config.delete(regRef, level)
}

this.npm.config.clearCredentialsByURI(reg)
this.npm.config.clearCredentialsByURI(reg, level)

await this.npm.config.save('user')
await this.npm.config.save(level)
}
}
module.exports = Logout
6 changes: 1 addition & 5 deletions lib/utils/queryable.js
Original file line number Diff line number Diff line change
@@ -111,13 +111,9 @@ const getter = ({ data, key }) => {
}, {})
return _data
} else {
// if can't find any more values, it means it's just over
// and there's nothing to return
if (!_data[k]) {
if (!Object.hasOwn(_data, k)) {
return undefined
}

// otherwise sets the next value
_data = _data[k]
}

5 changes: 5 additions & 0 deletions mock-registry/lib/index.js
Original file line number Diff line number Diff line change
@@ -252,6 +252,11 @@ class MockRegistry {
.reply(200, { token })
}

logout (token) {
this.nock = this.nock.delete(this.fullPath(`/-/user/token/${encodeURIComponent(token)}`))
.reply(200, { ok: true })
}

// team can be a team or a username
getPackages ({ user, team, packages = {}, times = 1, responseCode = 200 }) {
let uri
Original file line number Diff line number Diff line change
@@ -81,7 +81,11 @@ class HttpsProxyAgent extends agent_base_1.Agent {
let socket;
if (proxy.protocol === 'https:') {
debug('Creating `tls.Socket`: %o', this.connectOpts);
socket = tls.connect(this.connectOpts);
const servername = this.connectOpts.servername || this.connectOpts.host;
socket = tls.connect({
...this.connectOpts,
servername: servername && net.isIP(servername) ? undefined : servername
});
}
else {
debug('Creating `net.Socket`: %o', this.connectOpts);
Original file line number Diff line number Diff line change
@@ -47,7 +47,10 @@ function parseProxyResponse(socket) {
read();
return;
}
const headerParts = buffered.slice(0, endOfHeaders).toString('ascii').split('\r\n');
const headerParts = buffered
.slice(0, endOfHeaders)
.toString('ascii')
.split('\r\n');
const firstLine = headerParts.shift();
if (!firstLine) {
socket.destroy();
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "https-proxy-agent",
"version": "7.0.1",
"version": "7.0.2",
"description": "An HTTP(s) proxy `http.Agent` implementation for HTTPS",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Original file line number Diff line number Diff line change
@@ -33,6 +33,7 @@ const debug_1 = __importDefault(require("debug"));
const dns = __importStar(require("dns"));
const net = __importStar(require("net"));
const tls = __importStar(require("tls"));
const url_1 = require("url");
const debug = (0, debug_1.default)('socks-proxy-agent');
function parseSocksURL(url) {
let lookup = false;
@@ -88,7 +89,7 @@ function parseSocksURL(url) {
class SocksProxyAgent extends agent_base_1.Agent {
constructor(uri, opts) {
super(opts);
const url = typeof uri === 'string' ? new URL(uri) : uri;
const url = typeof uri === 'string' ? new url_1.URL(uri) : uri;
const { proxy, lookup } = parseSocksURL(url);
this.shouldLookup = lookup;
this.proxy = proxy;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "socks-proxy-agent",
"version": "8.0.1",
"version": "8.0.2",
"description": "A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -107,7 +107,7 @@
"socks5h"
],
"dependencies": {
"agent-base": "^7.0.1",
"agent-base": "^7.0.2",
"debug": "^4.3.4",
"socks": "^2.7.1"
},
@@ -117,16 +117,16 @@
"@types/dns2": "^2.0.3",
"@types/jest": "^29.5.1",
"@types/node": "^14.18.45",
"async-listen": "^2.1.0",
"async-listen": "^3.0.0",
"async-retry": "^1.3.3",
"cacheable-lookup": "^6.1.0",
"dns2": "^2.1.0",
"jest": "^29.5.0",
"socksv5": "github:TooTallNate/socksv5#fix/dstSock-close-event",
"ts-jest": "^29.1.0",
"typescript": "^5.0.4",
"tsconfig": "0.0.0",
"proxy": "2.0.1"
"proxy": "2.1.1",
"tsconfig": "0.0.0"
},
"engines": {
"node": ">= 14"
18 changes: 10 additions & 8 deletions node_modules/are-we-there-yet/lib/tracker-base.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
'use strict'
var EventEmitter = require('events').EventEmitter
var util = require('util')
const EventEmitter = require('events')

var trackerId = 0
var TrackerBase = module.exports = function (name) {
EventEmitter.call(this)
this.id = ++trackerId
this.name = name
let trackerId = 0
class TrackerBase extends EventEmitter {
constructor (name) {
super()
this.id = ++trackerId
this.name = name
}
}
util.inherits(TrackerBase, EventEmitter)

module.exports = TrackerBase
Loading