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: libnpmexec-v5.0.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: libnpmexec-v5.0.1
Choose a head ref
  • 6 commits
  • 40 files changed
  • 6 contributors

Commits on Oct 26, 2022

  1. feat: sort and quote yarn lock keys according to yarn rules (#5751)

    Co-authored-by: shalvah <diakon.ng@gmail.com>
    wraithgar and shalvah authored Oct 26, 2022
    Copy the full SHA
    3dd8d68 View commit details
  2. Copy the full SHA
    b5fadd0 View commit details
  3. deps: npm-packlist@7.0.2 (#5754)

    nlf authored Oct 26, 2022
    Copy the full SHA
    32bdd68 View commit details
  4. Copy the full SHA
    5625274 View commit details
  5. Copy the full SHA
    de6618e View commit details
  6. chore: release 9.0.1

    github-actions[bot] authored and nlf committed Oct 26, 2022
    Copy the full SHA
    ca93f3e View commit details
Showing with 5,695 additions and 5,635 deletions.
  1. +7 −7 .release-please-manifest.json
  2. +18 −0 CHANGELOG.md
  3. +2 −4 DEPENDENCIES.md
  4. +1 −1 lib/commands/init.js
  5. +5 −5 node_modules/@npmcli/git/package.json
  6. +4 −4 node_modules/@npmcli/installed-package-contents/package.json
  7. +10 −23 node_modules/@npmcli/promise-spawn/lib/index.js
  8. +4 −7 node_modules/@npmcli/promise-spawn/package.json
  9. +4 −4 node_modules/@npmcli/run-script/package.json
  10. +3 −77 node_modules/hosted-git-info/lib/from-url.js
  11. +7 −9 node_modules/hosted-git-info/lib/index.js
  12. +79 −0 node_modules/hosted-git-info/lib/parse-url.js
  13. +9 −0 node_modules/hosted-git-info/lib/protocols.js
  14. +4 −4 node_modules/hosted-git-info/package.json
  15. +7 −2 node_modules/npm-packlist/lib/index.js
  16. +3 −3 node_modules/npm-packlist/package.json
  17. +6 −6 node_modules/pacote/package.json
  18. +48 −51 package-lock.json
  19. +9 −9 package.json
  20. +1 −1 smoke-tests/package.json
  21. +0 −27 smoke-tests/tap-snapshots/test/index.js.test.cjs
  22. +10 −0 workspaces/arborist/CHANGELOG.md
  23. +41 −13 workspaces/arborist/lib/yarn-lock.js
  24. +1 −1 workspaces/arborist/package.json
  25. +7 −8 workspaces/arborist/tap-snapshots/test/arborist/rebuild.js.test.cjs
  26. +8 −8 workspaces/arborist/tap-snapshots/test/arborist/reify.js.test.cjs
  27. +2,564 −2,564 workspaces/arborist/tap-snapshots/test/shrinkwrap.js.test.cjs
  28. +2,785 −2,782 workspaces/arborist/tap-snapshots/test/yarn-lock.js.test.cjs
  29. +3 −0 workspaces/arborist/test/fixtures/yarn-stuff/yarn.lock
  30. +5 −5 workspaces/arborist/test/yarn-lock.js
  31. +6 −0 workspaces/libnpmdiff/CHANGELOG.md
  32. +2 −2 workspaces/libnpmdiff/package.json
  33. +6 −0 workspaces/libnpmexec/CHANGELOG.md
  34. +2 −2 workspaces/libnpmexec/package.json
  35. +6 −0 workspaces/libnpmfund/CHANGELOG.md
  36. +2 −2 workspaces/libnpmfund/package.json
  37. +6 −0 workspaces/libnpmpack/CHANGELOG.md
  38. +2 −2 workspaces/libnpmpack/package.json
  39. +6 −0 workspaces/libnpmpublish/CHANGELOG.md
  40. +2 −2 workspaces/libnpmpublish/package.json
14 changes: 7 additions & 7 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
".": "9.0.0",
"workspaces/arborist": "6.0.0",
".": "9.0.1",
"workspaces/arborist": "6.1.0",
"workspaces/libnpmaccess": "7.0.0",
"workspaces/libnpmdiff": "5.0.0",
"workspaces/libnpmexec": "5.0.0",
"workspaces/libnpmfund": "4.0.0",
"workspaces/libnpmdiff": "5.0.1",
"workspaces/libnpmexec": "5.0.1",
"workspaces/libnpmfund": "4.0.1",
"workspaces/libnpmhook": "9.0.0",
"workspaces/libnpmorg": "5.0.0",
"workspaces/libnpmpack": "5.0.0",
"workspaces/libnpmpublish": "7.0.0",
"workspaces/libnpmpack": "5.0.1",
"workspaces/libnpmpublish": "7.0.1",
"workspaces/libnpmsearch": "6.0.0",
"workspaces/libnpmteam": "5.0.0",
"workspaces/libnpmversion": "4.0.0"
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## [9.0.1](https://github.com/npm/cli/compare/v9.0.0...v9.0.1) (2022-10-26)

### Documentation

* [`b5fadd0`](https://github.com/npm/cli/commit/b5fadd0cec392f4bf6d60fa1358f96400be94667) [#5742](https://github.com/npm/cli/pull/5742) Better npx link (#5742) (@mrienstra)

### Dependencies

* [`de6618e`](https://github.com/npm/cli/commit/de6618e93182ba00b4be516db1efb3c51efa17ba) [#5757](https://github.com/npm/cli/pull/5757) `@npmcli/promise-spawn@5.0.0` (#5757)
* [`5625274`](https://github.com/npm/cli/commit/562527456d3862d871d042fa4ff6e38354e320ea) [#5755](https://github.com/npm/cli/pull/5755) `hosted-git-info@6.1.0` (#5755)
* [`32bdd68`](https://github.com/npm/cli/commit/32bdd686ccf826050075e770ffddf7401efa79c9) [#5754](https://github.com/npm/cli/pull/5754) `npm-packlist@7.0.2` (#5754)
* [Workspace](https://github.com/npm/cli/compare/arborist-v6.0.0...arborist-v6.1.0): `@npmcli/arborist@6.1.0`
* [Workspace](https://github.com/npm/cli/compare/libnpmdiff-v5.0.0...libnpmdiff-v5.0.1): `libnpmdiff@5.0.1`
* [Workspace](https://github.com/npm/cli/compare/libnpmexec-v5.0.0...libnpmexec-v5.0.1): `libnpmexec@5.0.1`
* [Workspace](https://github.com/npm/cli/compare/libnpmfund-v4.0.0...libnpmfund-v4.0.1): `libnpmfund@4.0.1`
* [Workspace](https://github.com/npm/cli/compare/libnpmpack-v5.0.0...libnpmpack-v5.0.1): `libnpmpack@5.0.1`
* [Workspace](https://github.com/npm/cli/compare/libnpmpublish-v7.0.0...libnpmpublish-v7.0.1): `libnpmpublish@7.0.1`

## [9.0.0](https://github.com/npm/cli/compare/v9.0.0-pre.6...v9.0.0) (2022-10-19)

### Features
6 changes: 2 additions & 4 deletions DEPENDENCIES.md
Original file line number Diff line number Diff line change
@@ -207,7 +207,6 @@ graph LR;
npmcli-metavuln-calculator-->pacote;
npmcli-metavuln-calculator-->semver;
npmcli-package-json-->json-parse-even-better-errors;
npmcli-promise-spawn-->infer-owner;
npmcli-run-script-->npmcli-node-gyp["@npmcli/node-gyp"];
npmcli-run-script-->npmcli-promise-spawn["@npmcli/promise-spawn"];
npmcli-run-script-->read-package-json-fast;
@@ -870,7 +869,6 @@ graph LR;
npmcli-move-file-->mkdirp;
npmcli-move-file-->rimraf;
npmcli-package-json-->json-parse-even-better-errors;
npmcli-promise-spawn-->infer-owner;
npmcli-query-->postcss-selector-parser;
npmcli-run-script-->node-gyp;
npmcli-run-script-->npmcli-node-gyp["@npmcli/node-gyp"];
@@ -1102,5 +1100,5 @@ packages higher up the chain.
- npm-registry-fetch, libnpmversion
- @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, readdir-scoped-modules, promzard
- @npmcli/docs, npm-bundled, read-package-json-fast, @npmcli/fs, unique-filename, @npmcli/promise-spawn, npm-install-checks, npm-package-arg, npm-packlist, normalize-package-data, @npmcli/package-json, bin-links, nopt, npmlog, parse-conflict-json, dezalgo, read
- ignore-walk, @npmcli/eslint-config, @npmcli/template-oss, npm-normalize-package-bin, @npmcli/name-from-folder, json-parse-even-better-errors, semver, @npmcli/move-file, fs-minipass, ssri, unique-slug, infer-owner, 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, wrappy, treeverse, minify-registry-metadata, @npmcli/disparity-colors, @npmcli/ci-detect, mute-stream, ini, npm-audit-report, npm-user-validate
- @npmcli/docs, npm-bundled, read-package-json-fast, @npmcli/fs, unique-filename, npm-install-checks, npm-package-arg, npm-packlist, normalize-package-data, @npmcli/package-json, bin-links, nopt, npmlog, parse-conflict-json, dezalgo, read
- ignore-walk, @npmcli/eslint-config, @npmcli/template-oss, npm-normalize-package-bin, @npmcli/name-from-folder, json-parse-even-better-errors, semver, @npmcli/move-file, 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, wrappy, treeverse, minify-registry-metadata, @npmcli/disparity-colors, @npmcli/ci-detect, mute-stream, ini, npm-audit-report, npm-user-validate
2 changes: 1 addition & 1 deletion lib/commands/init.js
Original file line number Diff line number Diff line change
@@ -103,7 +103,7 @@ class Init extends BaseCommand {
throw Object.assign(new Error(
'Unrecognized initializer: ' + initerName +
'\nFor more package binary executing power check out `npx`:' +
'\nhttps://www.npmjs.com/package/npx'
'\nhttps://docs.npmjs.com/cli/commands/npx'
), { code: 'EUNSUPPORTED' })
}
}
10 changes: 5 additions & 5 deletions node_modules/@npmcli/git/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@npmcli/git",
"version": "4.0.1",
"version": "4.0.2",
"main": "lib/index.js",
"files": [
"bin/",
@@ -32,14 +32,14 @@
},
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.5.1",
"npm-package-arg": "^9.1.0",
"@npmcli/template-oss": "4.7.1",
"npm-package-arg": "^10.0.0",
"rimraf": "^3.0.2",
"slash": "^3.0.0",
"tap": "^16.0.1"
},
"dependencies": {
"@npmcli/promise-spawn": "^4.0.0",
"@npmcli/promise-spawn": "^5.0.0",
"lru-cache": "^7.4.4",
"mkdirp": "^1.0.4",
"npm-pick-manifest": "^8.0.0",
@@ -55,6 +55,6 @@
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"windowsCI": false,
"version": "4.5.1"
"version": "4.7.1"
}
}
8 changes: 4 additions & 4 deletions node_modules/@npmcli/installed-package-contents/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@npmcli/installed-package-contents",
"version": "2.0.0",
"version": "2.0.1",
"description": "Get the list of files installed in a package in node_modules, including bundled dependencies",
"author": "GitHub Inc.",
"main": "lib/index.js",
"bin": {
"installed-package-contents": "index.js"
"installed-package-contents": "lib/index.js"
},
"license": "ISC",
"scripts": {
@@ -19,7 +19,7 @@
},
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.5.1",
"@npmcli/template-oss": "4.6.2",
"mkdirp": "^1.0.4",
"require-inject": "^1.4.4",
"tap": "^16.3.0"
@@ -41,7 +41,7 @@
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.5.1"
"version": "4.6.2"
},
"tap": {
"nyc-arg": [
33 changes: 10 additions & 23 deletions node_modules/@npmcli/promise-spawn/lib/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const { spawn } = require('child_process')
const inferOwner = require('infer-owner')

const isPipe = (stdio = 'pipe', fd) =>
stdio === 'pipe' || stdio === null ? true
@@ -8,28 +7,6 @@ const isPipe = (stdio = 'pipe', fd) =>

// 'extra' object is for decorating the error a bit more
const promiseSpawn = (cmd, args, opts = {}, extra = {}) => {
const cwd = opts.cwd || process.cwd()
const isRoot = process.getuid && process.getuid() === 0
const { uid, gid } = isRoot ? inferOwner.sync(cwd) : {}
return promiseSpawnUid(cmd, args, {
...opts,
cwd,
uid,
gid,
}, extra)
}

const stdioResult = (stdout, stderr, { stdioString, stdio }) =>
stdioString ? {
stdout: isPipe(stdio, 1) ? Buffer.concat(stdout).toString() : null,
stderr: isPipe(stdio, 2) ? Buffer.concat(stderr).toString() : null,
}
: {
stdout: isPipe(stdio, 1) ? Buffer.concat(stdout) : null,
stderr: isPipe(stdio, 2) ? Buffer.concat(stderr) : null,
}

const promiseSpawnUid = (cmd, args, opts, extra) => {
let proc
const p = new Promise((res, rej) => {
proc = spawn(cmd, args, opts)
@@ -72,4 +49,14 @@ const promiseSpawnUid = (cmd, args, opts, extra) => {
return p
}

const stdioResult = (stdout, stderr, { stdioString, stdio }) =>
stdioString ? {
stdout: isPipe(stdio, 1) ? Buffer.concat(stdout).toString().trim() : null,
stderr: isPipe(stdio, 2) ? Buffer.concat(stderr).toString().trim() : null,
}
: {
stdout: isPipe(stdio, 1) ? Buffer.concat(stdout) : null,
stderr: isPipe(stdio, 2) ? Buffer.concat(stderr) : null,
}

module.exports = promiseSpawn
11 changes: 4 additions & 7 deletions node_modules/@npmcli/promise-spawn/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@npmcli/promise-spawn",
"version": "4.0.0",
"version": "5.0.0",
"files": [
"bin/",
"lib/"
@@ -31,8 +31,8 @@
]
},
"devDependencies": {
"@npmcli/eslint-config": "^3.0.1",
"@npmcli/template-oss": "4.5.1",
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.7.1",
"minipass": "^3.1.1",
"tap": "^16.0.1"
},
@@ -41,9 +41,6 @@
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.5.1"
},
"dependencies": {
"infer-owner": "^1.0.4"
"version": "4.7.1"
}
}
8 changes: 4 additions & 4 deletions node_modules/@npmcli/run-script/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@npmcli/run-script",
"version": "5.0.0",
"version": "5.0.1",
"description": "Run a lifecycle script for a package (descendant of npm-lifecycle)",
"author": "GitHub Inc.",
"license": "ISC",
@@ -16,14 +16,14 @@
},
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.5.1",
"@npmcli/template-oss": "4.7.1",
"minipass": "^3.1.6",
"require-inject": "^1.4.4",
"tap": "^16.0.1"
},
"dependencies": {
"@npmcli/node-gyp": "^3.0.0",
"@npmcli/promise-spawn": "^4.0.0",
"@npmcli/promise-spawn": "^5.0.0",
"node-gyp": "^9.0.0",
"read-package-json-fast": "^3.0.0",
"which": "^2.0.2"
@@ -42,7 +42,7 @@
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.5.1"
"version": "4.7.1"
},
"tap": {
"nyc-arg": [
80 changes: 3 additions & 77 deletions node_modules/hosted-git-info/lib/from-url.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,6 @@
'use strict'

const url = require('url')

const safeUrl = (u) => {
try {
return new url.URL(u)
} catch {
// this fn should never throw
}
}

const lastIndexOfBefore = (str, char, beforeChar) => {
const startPosition = str.indexOf(beforeChar)
return str.lastIndexOf(char, startPosition > -1 ? startPosition : Infinity)
}

// accepts input like git:github.com:user/repo and inserts the // after the first :
const correctProtocol = (arg, protocols) => {
const firstColon = arg.indexOf(':')
const proto = arg.slice(0, firstColon + 1)
if (Object.prototype.hasOwnProperty.call(protocols, proto)) {
return arg
}

const firstAt = arg.indexOf('@')
if (firstAt > -1) {
if (firstAt > firstColon) {
return `git+ssh://${arg}`
} else {
return arg
}
}

const doubleSlash = arg.indexOf('//')
if (doubleSlash === firstColon + 1) {
return arg
}

return `${arg.slice(0, firstColon + 1)}//${arg.slice(firstColon + 1)}`
}
const parseUrl = require('./parse-url')

// look for github shorthand inputs, such as npm/cli
const isGitHubShorthand = (arg) => {
@@ -71,49 +33,13 @@ const isGitHubShorthand = (arg) => {
secondSlashOnlyAfterHash
}

// attempt to correct an scp style url so that it will parse with `new URL()`
const correctUrl = (giturl) => {
// ignore @ that come after the first hash since the denotes the start
// of a committish which can contain @ characters
const firstAt = lastIndexOfBefore(giturl, '@', '#')
// ignore colons that come after the hash since that could include colons such as:
// git@github.com:user/package-2#semver:^1.0.0
const lastColonBeforeHash = lastIndexOfBefore(giturl, ':', '#')

if (lastColonBeforeHash > firstAt) {
// the last : comes after the first @ (or there is no @)
// like it would in:
// proto://hostname.com:user/repo
// username@hostname.com:user/repo
// :password@hostname.com:user/repo
// username:password@hostname.com:user/repo
// proto://username@hostname.com:user/repo
// proto://:password@hostname.com:user/repo
// proto://username:password@hostname.com:user/repo
// then we replace the last : with a / to create a valid path
giturl = giturl.slice(0, lastColonBeforeHash) + '/' + giturl.slice(lastColonBeforeHash + 1)
}

if (lastIndexOfBefore(giturl, ':', '#') === -1 && giturl.indexOf('//') === -1) {
// we have no : at all
// as it would be in:
// username@hostname.com/user/repo
// then we prepend a protocol
giturl = `git+ssh://${giturl}`
}

return giturl
}

module.exports = (giturl, opts, { gitHosts, protocols }) => {
if (!giturl) {
return
}

const correctedUrl = isGitHubShorthand(giturl)
? `github:${giturl}`
: correctProtocol(giturl, protocols)
const parsed = safeUrl(correctedUrl) || safeUrl(correctUrl(correctedUrl))
const correctedUrl = isGitHubShorthand(giturl) ? `github:${giturl}` : giturl
const parsed = parseUrl(correctedUrl, protocols)
if (!parsed) {
return
}
16 changes: 7 additions & 9 deletions node_modules/hosted-git-info/lib/index.js
Original file line number Diff line number Diff line change
@@ -3,6 +3,8 @@
const LRU = require('lru-cache')
const hosts = require('./hosts.js')
const fromUrl = require('./from-url.js')
const parseUrl = require('./parse-url.js')
const getProtocols = require('./protocols.js')

const cache = new LRU({ max: 1000 })

@@ -20,15 +22,7 @@ class GitHost {
}

static #gitHosts = { byShortcut: {}, byDomain: {} }
static #protocols = {
'git+ssh:': { name: 'sshurl' },
'ssh:': { name: 'sshurl' },
'git+https:': { name: 'https', auth: true },
'git:': { auth: true },
'http:': { auth: true },
'https:': { auth: true },
'git+http:': { auth: true },
}
static #protocols = getProtocols()

static addHost (name, host) {
GitHost.#gitHosts[name] = host
@@ -55,6 +49,10 @@ class GitHost {
return cache.get(key)
}

static parseUrl (url) {
return parseUrl(url)
}

#fill (template, opts) {
if (typeof template !== 'function') {
return null
Loading