Skip to content

Commit d6c9f4b

Browse files
committed
deps: upgrade npm to 7.6.2
1 parent e2f5bb7 commit d6c9f4b

File tree

152 files changed

+1772
-1397
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+1772
-1397
lines changed

deps/npm/AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,3 +757,4 @@ kumavis <aaron@kumavis.me>
757757
Christof Lemke <christoflemke@github.com>
758758
Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
759759
Bjørn Johansen <bjjohans@microsoft.com>
760+
Fraqe <f@fraqe.ca>

deps/npm/CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1+
## v7.6.2 (2021-03-09)
2+
3+
### BUG FIXES
4+
5+
* [`e0a3a5218`](https://github.com/npm/cli/commit/e0a3a5218cac7ca5850930aaaad8a939ddf75d4d)
6+
[#2831](https://github.com/npm/cli/issues/2831)
7+
Fix cb() never called in search with --json option
8+
([@fraqe](https://github.com/fraqe))
9+
* [`85a8694dd`](https://github.com/npm/cli/commit/85a8694dd9b4a924a474ba75261914511a216868)
10+
[#2795](https://github.com/npm/cli/issues/2795)
11+
fix(npm.output): make output go through npm.output
12+
([@wraithgar](https://github.com/wraithgar))
13+
* [`9fe0df5b5`](https://github.com/npm/cli/commit/9fe0df5b5d7606e5841288d9931be6c04767c9ca)
14+
[#2821](https://github.com/npm/cli/issues/2821)
15+
fix(usage): clean up usage declarations
16+
([@wraithgar](https://github.com/wraithgar))
17+
18+
### DEPENDENCIES
19+
20+
* [`7f470b5c2`](https://github.com/npm/cli/commit/7f470b5c25d544e36d97b28e28ae20dfa1d4ab31)
21+
`@npmcli/arborist@2.2.7`
22+
* fix(install): Do not revert a file: dep to version on bare name re-install
23+
* [`e9b7fc275`](https://github.com/npm/cli/commit/e9b7fc275a0bdf8f00dbcf5dd2283675776fc459)
24+
`libnpmdiff@2.0.4`
25+
* fix(diff): Gracefully handle packages with prepare script
26+
* [`c7314aa62`](https://github.com/npm/cli/commit/c7314aa62195b7f0d8886776692e8a2c892413ed)
27+
`byte-size@7.0.1`
28+
* [`864f48d43`](https://github.com/npm/cli/commit/864f48d4327269f521161cf89888ea2b6db5fdab)
29+
`pacote@11.3.0`
30+
131
## v7.6.1 (2021-03-04)
232

333
### BUG FIXES

deps/npm/docs/output/commands/npm-ls.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ <h3 id="description">Description</h3>
159159
the results to only the paths to the packages named. Note that nested
160160
packages will <em>also</em> show the paths to the specified packages. For
161161
example, running <code>npm ls promzard</code> in npm’s source tree will show:</p>
162-
<pre lang="bash"><code>npm@7.6.1 /path/to/npm
162+
<pre lang="bash"><code>npm@7.6.2 /path/to/npm
163163
└─┬ init-package-json@0.0.4
164164
└── promzard@0.1.5
165165
</code></pre>

deps/npm/docs/output/commands/npm.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ <h2 id="table-of-contents">Table of contents</h2>
148148
<pre lang="bash"><code>npm &lt;command&gt; [args]
149149
</code></pre>
150150
<h3 id="version">Version</h3>
151-
<p>7.6.1</p>
151+
<p>7.6.2</p>
152152
<h3 id="description">Description</h3>
153153
<p>npm is the package manager for the Node JavaScript platform. It puts
154154
modules in place so that node can find them, and manages dependency

deps/npm/lib/access.js

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ const path = require('path')
33
const libaccess = require('libnpmaccess')
44
const readPackageJson = require('read-package-json-fast')
55

6-
const output = require('./utils/output.js')
76
const otplease = require('./utils/otplease.js')
8-
const usageUtil = require('./utils/usage.js')
97
const getIdentity = require('./utils/get-identity.js')
8+
const BaseCommand = require('./base-command.js')
109

1110
const subcommands = [
1211
'public',
@@ -20,24 +19,23 @@ const subcommands = [
2019
'2fa-not-required',
2120
]
2221

23-
class Access {
24-
constructor (npm) {
25-
this.npm = npm
22+
class Access extends BaseCommand {
23+
static get name () {
24+
return 'access'
2625
}
2726

28-
get usage () {
29-
return usageUtil(
30-
'access',
31-
'npm access public [<package>]\n' +
32-
'npm access restricted [<package>]\n' +
33-
'npm access grant <read-only|read-write> <scope:team> [<package>]\n' +
34-
'npm access revoke <scope:team> [<package>]\n' +
35-
'npm access 2fa-required [<package>]\n' +
36-
'npm access 2fa-not-required [<package>]\n' +
37-
'npm access ls-packages [<user>|<scope>|<scope:team>]\n' +
38-
'npm access ls-collaborators [<package> [<user>]]\n' +
39-
'npm access edit [<package>]'
40-
)
27+
static get usage () {
28+
return [
29+
'public [<package>]',
30+
'restricted [<package>]',
31+
'grant <read-only|read-write> <scope:team> [<package>]',
32+
'revoke <scope:team> [<package>]',
33+
'2fa-required [<package>]',
34+
'2fa-not-required [<package>]',
35+
'ls-packages [<user>|<scope>|<scope:team>]',
36+
'ls-collaborators [<package> [<user>]]',
37+
'edit [<package>]',
38+
]
4139
}
4240

4341
async completion (opts) {
@@ -67,12 +65,7 @@ class Access {
6765
}
6866

6967
exec (args, cb) {
70-
this.access(args)
71-
.then(x => cb(null, x))
72-
.catch(err => err.code === 'EUSAGE'
73-
? cb(err.message)
74-
: cb(err)
75-
)
68+
this.access(args).then(() => cb()).catch(cb)
7669
}
7770

7871
async access ([cmd, ...args]) {
@@ -157,7 +150,7 @@ class Access {
157150
const pkgs = await libaccess.lsPackages(owner, opts)
158151

159152
// TODO - print these out nicely (breaking change)
160-
output(JSON.stringify(pkgs, null, 2))
153+
this.npm.output(JSON.stringify(pkgs, null, 2))
161154
}
162155

163156
get ['ls-collaborators'] () {
@@ -169,7 +162,7 @@ class Access {
169162
const collabs = await libaccess.lsCollaborators(pkgName, usr, opts)
170163

171164
// TODO - print these out nicely (breaking change)
172-
output(JSON.stringify(collabs, null, 2))
165+
this.npm.output(JSON.stringify(collabs, null, 2))
173166
}
174167

175168
async edit () {
@@ -203,12 +196,6 @@ class Access {
203196
return name
204197
}
205198
}
206-
207-
usageError (msg) {
208-
return Object.assign(new Error(`\nUsage: ${msg}\n\n` + this.usage), {
209-
code: 'EUSAGE',
210-
})
211-
}
212199
}
213200

214201
module.exports = Access

deps/npm/lib/adduser.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,20 @@
11
const log = require('npmlog')
2-
const output = require('./utils/output.js')
3-
const usageUtil = require('./utils/usage.js')
42
const replaceInfo = require('./utils/replace-info.js')
3+
const BaseCommand = require('./base-command.js')
54
const authTypes = {
65
legacy: require('./auth/legacy.js'),
76
oauth: require('./auth/oauth.js'),
87
saml: require('./auth/saml.js'),
98
sso: require('./auth/sso.js'),
109
}
1110

12-
class AddUser {
13-
constructor (npm) {
14-
this.npm = npm
11+
class AddUser extends BaseCommand {
12+
static get name () {
13+
return 'adduser'
1514
}
1615

17-
/* istanbul ignore next - see test/lib/load-all-commands.js */
18-
get usage () {
19-
return usageUtil(
20-
'adduser',
21-
'npm adduser [--registry=url] [--scope=@orgname] [--always-auth]'
22-
)
16+
static get usage () {
17+
return ['[--registry=url] [--scope=@orgname] [--always-auth]']
2318
}
2419

2520
exec (args, cb) {
@@ -49,7 +44,7 @@ class AddUser {
4944
scope,
5045
})
5146

52-
output(message)
47+
this.npm.output(message)
5348
}
5449

5550
getRegistry ({ scope, registry }) {

deps/npm/lib/audit.js

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
const Arborist = require('@npmcli/arborist')
22
const auditReport = require('npm-audit-report')
3-
const output = require('./utils/output.js')
43
const reifyFinish = require('./utils/reify-finish.js')
54
const auditError = require('./utils/audit-error.js')
6-
const usageUtil = require('./utils/usage.js')
5+
const BaseCommand = require('./base-command.js')
76

8-
class Audit {
9-
constructor (npm) {
10-
this.npm = npm
7+
class Audit extends BaseCommand {
8+
/* istanbul ignore next - see test/lib/load-all-commands.js */
9+
static get name () {
10+
return 'audit'
1111
}
1212

1313
/* istanbul ignore next - see test/lib/load-all-commands.js */
14-
get usage () {
15-
return usageUtil(
16-
'audit',
17-
'npm audit [--json] [--production]' +
18-
'\nnpm audit fix ' +
19-
'[--force|--package-lock-only|--dry-run|--production|--only=(dev|prod)]'
20-
)
14+
static get usage () {
15+
return [
16+
'[--json] [--production]',
17+
'fix [--force|--package-lock-only|--dry-run|--production|--only=(dev|prod)]',
18+
]
2119
}
2220

2321
async completion (opts) {
@@ -57,7 +55,7 @@ class Audit {
5755
reporter,
5856
})
5957
process.exitCode = process.exitCode || result.exitCode
60-
output(result.report)
58+
this.npm.output(result.report)
6159
}
6260
}
6361
}

deps/npm/lib/base-command.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Base class for npm.commands[cmd]
2+
const usageUtil = require('./utils/usage.js')
3+
4+
class BaseCommand {
5+
constructor (npm) {
6+
this.npm = npm
7+
}
8+
9+
get usage () {
10+
let usage = `npm ${this.constructor.name}\n\n`
11+
if (this.constructor.description)
12+
usage = `${usage}${this.constructor.description}\n\n`
13+
14+
usage = `${usage}Usage:\n`
15+
if (!this.constructor.usage)
16+
usage = `${usage}npm ${this.constructor.name}`
17+
else
18+
usage = `${usage}${this.constructor.usage.map(u => `npm ${this.constructor.name} ${u}`).join('\n')}`
19+
20+
// Mostly this just appends aliases, this could be more clear
21+
usage = usageUtil(this.constructor.name, usage)
22+
usage = `${usage}\n\nRun "npm ${this.constructor.name} help" for more info`
23+
return usage
24+
}
25+
26+
usageError (msg) {
27+
if (!msg) {
28+
return Object.assign(new Error(`\nUsage: ${this.usage}`), {
29+
code: 'EUSAGE',
30+
})
31+
}
32+
33+
return Object.assign(new Error(`\nUsage: ${msg}\n\n${this.usage}`), {
34+
code: 'EUSAGE',
35+
})
36+
}
37+
}
38+
module.exports = BaseCommand

deps/npm/lib/bin.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
const output = require('./utils/output.js')
21
const envPath = require('./utils/path.js')
3-
const usageUtil = require('./utils/usage.js')
2+
const BaseCommand = require('./base-command.js')
43

5-
class Bin {
6-
constructor (npm) {
7-
this.npm = npm
4+
class Bin extends BaseCommand {
5+
static get name () {
6+
return 'bin'
87
}
98

10-
/* istanbul ignore next - see test/lib/load-all-commands.js */
11-
get usage () {
12-
return usageUtil('bin', 'npm bin [-g]')
9+
static get usage () {
10+
return ['[-g]']
1311
}
1412

1513
exec (args, cb) {
@@ -18,7 +16,7 @@ class Bin {
1816

1917
async bin (args) {
2018
const b = this.npm.bin
21-
output(b)
19+
this.npm.output(b)
2220
if (this.npm.flatOptions.global && !envPath.includes(b))
2321
console.error('(not in PATH env variable)')
2422
}

deps/npm/lib/bugs.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
const log = require('npmlog')
22
const pacote = require('pacote')
33
const openUrl = require('./utils/open-url.js')
4-
const usageUtil = require('./utils/usage.js')
54
const hostedFromMani = require('./utils/hosted-git-info-from-manifest.js')
5+
const BaseCommand = require('./base-command.js')
66

7-
class Bugs {
8-
constructor (npm) {
9-
this.npm = npm
7+
class Bugs extends BaseCommand {
8+
static get name () {
9+
return 'bugs'
1010
}
1111

12-
/* istanbul ignore next - see test/lib/load-all-commands.js */
13-
get usage () {
14-
return usageUtil('bugs', 'npm bugs [<pkgname>]')
12+
static get usage () {
13+
return ['[<pkgname>]']
1514
}
1615

1716
exec (args, cb) {

0 commit comments

Comments
 (0)