Skip to content

Commit d16e862

Browse files
ruyadornocodebytere
authored andcommitted
deps: upgrade npm to 7.0.13
PR-URL: #36202 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 0fbade3 commit d16e862

25 files changed

+489
-90
lines changed

deps/npm/AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -734,3 +734,4 @@ Jason Attwood <jason_attwood@hotmail.co.uk>
734734
Vlad GURDIGA <gurdiga@gmail.com>
735735
Sébastien Puech <s.puech@tricentis.com>
736736
Jannis Hell <Primajin@users.noreply.github.com>
737+
Hollow Man <hollowman@hollowman.ml>

deps/npm/CHANGELOG.md

+32
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,35 @@
1+
## 7.0.13 (2020-11-20)
2+
3+
### BUG FIXES
4+
* [`5fc56b6db`](https://github.com/npm/cli/commit/5fc56b6dbcc7d7d1463a761abb67d2fc16ad3657)
5+
[npm/statusboard#174](https://github.com/npm/statusboard/issues/174)
6+
[#2204](https://github.com/npm/cli/issues/2204)
7+
fix npm unstar command
8+
([@ruyadorno](https://github.com/ruyadorno))
9+
* [`7842b4d4d`](https://github.com/npm/cli/commit/7842b4d4dca1e076b0d26d554f9dce67484cd7be)
10+
[npm/statusboard#182](https://github.com/npm/statusboard/issues/182)
11+
[#2205](https://github.com/npm/cli/issues/2205)
12+
fix npm version usage output
13+
([@ruyadorno](https://github.com/ruyadorno))
14+
* [`a0adbf9f8`](https://github.com/npm/cli/commit/a0adbf9f8f77531fcf81ae31bbc7102698765ee3)
15+
[#2206](https://github.com/npm/cli/issues/2206)
16+
[#2213](https://github.com/npm/cli/issues/2213)
17+
fix: fix flatOptions usage in npm init
18+
([@ruyadorno](https://github.com/ruyadorno))
19+
20+
### DEPENDENCIES
21+
22+
* [`3daaf000a`](https://github.com/npm/cli/commit/3daaf000aee0ba81af855977d7011850e79099e6)
23+
`@npmcli/arborist@1.0.12`
24+
- fixes some windows specific bugs in how paths are handled and compared
25+
26+
### DOCUMENTATION
27+
28+
* [`084a7b6ad`](https://github.com/npm/cli/commit/084a7b6ad6eaf9f2d92eb05da93e745f5357cce2)
29+
[#2210](https://github.com/npm/cli/issues/2210)
30+
docs: Fix typo
31+
([@HollowMan6](https://github.com/HollowMan6))
32+
133
## 7.0.12 (2020-11-17)
234

335
### BUG FIXES

deps/npm/docs/content/commands/npm-explain.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ node_modules/nyc/node_modules/find-up
5656
#### json
5757

5858
* Default: false
59-
* Type: Bolean
59+
* Type: Boolean
6060

6161
Show information in JSON format.
6262

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ <h3 id="configuration">Configuration</h3>
183183
<h4 id="json">json</h4>
184184
<ul>
185185
<li>Default: false</li>
186-
<li>Type: Bolean</li>
186+
<li>Type: Boolean</li>
187187
</ul>
188188
<p>Show information in JSON format.</p>
189189
<h3 id="see-also">See Also</h3>

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ <h3 id="description">Description</h3>
156156
limit the results to only the paths to the packages named. Note that
157157
nested packages will <em>also</em> show the paths to the specified packages.
158158
For example, running <code>npm ls promzard</code> in npm’s source tree will show:</p>
159-
<pre lang="bash"><code> npm@7.0.12 /path/to/npm
159+
<pre lang="bash"><code> npm@7.0.13 /path/to/npm
160160
└─┬ init-package-json@0.0.4
161161
└── promzard@0.1.5
162162
</code></pre>

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

+1-1
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.0.12</p>
151+
<p>7.0.13</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/init.js

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ const init = async args => {
4343
}
4444
}
4545
npm.config.set('package', [])
46-
npm.flatOptions = { ...npm.flatOptions, package: [] }
4746
return new Promise((res, rej) => {
4847
npm.commands.exec([packageName, ...args.slice(1)], er => er ? rej(er) : res())
4948
})

deps/npm/lib/star.js

+61-59
Original file line numberDiff line numberDiff line change
@@ -3,73 +3,75 @@
33
const fetch = require('npm-registry-fetch')
44
const log = require('npmlog')
55
const npa = require('npm-package-arg')
6+
67
const npm = require('./npm.js')
78
const output = require('./utils/output.js')
8-
const usage = require('./utils/usage.js')
9-
const getItentity = require('./utils/get-identity')
9+
const usageUtil = require('./utils/usage.js')
10+
const getIdentity = require('./utils/get-identity')
11+
const completion = require('./utils/completion/none.js')
1012

11-
star.usage = usage(
13+
const usage = usageUtil(
1214
'star',
1315
'npm star [<pkg>...]\n' +
1416
'npm unstar [<pkg>...]'
1517
)
1618

17-
star.completion = function (opts, cb) {
18-
// FIXME: there used to be registry completion here, but it stopped making
19-
// sense somewhere around 50,000 packages on the registry
20-
cb()
21-
}
19+
const cmd = (args, cb) => star(args).then(() => cb()).catch(cb)
20+
21+
const star = async args => {
22+
if (!args.length)
23+
throw new Error(usage)
24+
25+
// if we're unstarring, then show an empty star image
26+
// otherwise, show the full star image
27+
const { unicode } = npm.flatOptions
28+
const unstar = npm.config.get('star.unstar')
29+
const full = unicode ? '\u2605 ' : '(*)'
30+
const empty = unicode ? '\u2606 ' : '( )'
31+
const show = unstar ? empty : full
32+
33+
const pkgs = args.map(npa)
34+
for (const pkg of pkgs) {
35+
const [username, fullData] = await Promise.all([
36+
getIdentity(npm.flatOptions),
37+
fetch.json(pkg.escapedName, {
38+
...npm.flatOptions,
39+
spec: pkg,
40+
query: { write: true },
41+
preferOnline: true,
42+
}),
43+
])
2244

23-
module.exports = star
24-
function star (args, cb) {
25-
const opts = npm.flatOptions
26-
return Promise.resolve().then(() => {
27-
if (!args.length)
28-
throw new Error(star.usage)
29-
// if we're unstarring, then show an empty star image
30-
// otherwise, show the full star image
31-
const unstar = /^un/.test(npm.command)
32-
const full = opts.unicode ? '\u2605 ' : '(*)'
33-
const empty = opts.unicode ? '\u2606 ' : '( )'
34-
const show = unstar ? empty : full
35-
return Promise.all(args.map(npa).map(pkg => {
36-
return Promise.all([
37-
getItentity(opts),
38-
fetch.json(pkg.escapedName, {
39-
...opts,
40-
spec: pkg,
41-
query: { write: true },
42-
preferOnline: true,
43-
}),
44-
]).then(([username, fullData]) => {
45-
if (!username)
46-
throw new Error('You need to be logged in!')
47-
const body = {
48-
_id: fullData._id,
49-
_rev: fullData._rev,
50-
users: fullData.users || {},
51-
}
45+
if (!username)
46+
throw new Error('You need to be logged in!')
5247

53-
if (!unstar) {
54-
log.info('star', 'starring', body._id)
55-
body.users[username] = true
56-
log.verbose('star', 'starring', body)
57-
} else {
58-
delete body.users[username]
59-
log.info('star', 'unstarring', body._id)
60-
log.verbose('star', 'unstarring', body)
61-
}
62-
return fetch.json(pkg.escapedName, {
63-
...opts,
64-
spec: pkg,
65-
method: 'PUT',
66-
body,
67-
})
68-
}).then(data => {
69-
output(show + ' ' + pkg.name)
70-
log.verbose('star', data)
71-
return data
72-
})
73-
}))
74-
}).then(() => cb(), cb)
48+
const body = {
49+
_id: fullData._id,
50+
_rev: fullData._rev,
51+
users: fullData.users || {},
52+
}
53+
54+
if (!unstar) {
55+
log.info('star', 'starring', body._id)
56+
body.users[username] = true
57+
log.verbose('star', 'starring', body)
58+
} else {
59+
delete body.users[username]
60+
log.info('unstar', 'unstarring', body._id)
61+
log.verbose('unstar', 'unstarring', body)
62+
}
63+
64+
const data = await fetch.json(pkg.escapedName, {
65+
...npm.flatOptions,
66+
spec: pkg,
67+
method: 'PUT',
68+
body,
69+
})
70+
71+
output(show + ' ' + pkg.name)
72+
log.verbose('star', data)
73+
return data
74+
}
7575
}
76+
77+
module.exports = Object.assign(cmd, { completion, usage })

deps/npm/lib/unstar.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const { usage, completion } = require('./star.js')
2+
const npm = require('./npm.js')
3+
4+
const unstar = (args, cb) => {
5+
npm.config.set('star.unstar', true)
6+
return npm.commands.star(args, cb)
7+
}
8+
9+
module.exports = Object.assign(unstar, { usage, completion })

deps/npm/lib/utils/cmd-list.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const shorthands = {
1212
c: 'config',
1313
s: 'search',
1414
se: 'search',
15-
unstar: 'star', // same function
1615
tst: 'test',
1716
t: 'test',
1817
ddp: 'dedupe',
@@ -88,6 +87,7 @@ const cmdList = [
8887
'publish',
8988
'star',
9089
'stars',
90+
'unstar',
9191
'adduser',
9292
'login', // This is an alias for `adduser` but it can be confusing
9393
'logout',

deps/npm/lib/version.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict'
2+
13
const libversion = require('libnpmversion')
24
const npm = require('./npm.js')
35
const output = require('./utils/output.js')
@@ -42,7 +44,7 @@ const version = async args => {
4244
path: npm.prefix,
4345
}))
4446
default:
45-
throw version.usage
47+
throw usage
4648
}
4749
}
4850

deps/npm/man/man1/npm-explain.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ node_modules/nyc/node_modules/find\-up
5858
.IP \(bu 2
5959
Default: false
6060
.IP \(bu 2
61-
Type: Bolean
61+
Type: Boolean
6262

6363
.RE
6464
.P

deps/npm/man/man1/npm-ls.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ For example, running \fBnpm ls promzard\fP in npm's source tree will show:
2222
.P
2323
.RS 2
2424
.nf
25-
npm@7\.0\.12 /path/to/npm
25+
npm@7\.0\.13 /path/to/npm
2626
└─┬ init\-package\-json@0\.0\.4
2727
└── promzard@0\.1\.5
2828
.fi

deps/npm/man/man1/npm.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ npm <command> [args]
1010
.RE
1111
.SS Version
1212
.P
13-
7\.0\.12
13+
7\.0\.13
1414
.SS Description
1515
.P
1616
npm is the package manager for the Node JavaScript platform\. It puts

deps/npm/node_modules/@npmcli/arborist/lib/arborist/load-actual.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deps/npm/node_modules/@npmcli/arborist/lib/dep-valid.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deps/npm/node_modules/@npmcli/arborist/lib/node.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deps/npm/node_modules/@npmcli/arborist/lib/yarn-lock.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deps/npm/node_modules/@npmcli/arborist/package.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deps/npm/package.json

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "7.0.12",
2+
"version": "7.0.13",
33
"name": "npm",
44
"description": "a package manager for JavaScript",
55
"keywords": [
@@ -42,7 +42,7 @@
4242
"./package.json": "./package.json"
4343
},
4444
"dependencies": {
45-
"@npmcli/arborist": "^1.0.11",
45+
"@npmcli/arborist": "^1.0.12",
4646
"@npmcli/ci-detect": "^1.2.0",
4747
"@npmcli/config": "^1.2.1",
4848
"@npmcli/run-script": "^1.8.0",
@@ -204,12 +204,10 @@
204204
"sudotest:nocleanup": "sudo NO_TEST_CLEANUP=1 npm run test --",
205205
"posttest": "npm run lint",
206206
"eslint": "eslint",
207-
"lint": "npm run eslint -- \"lib/**/*.js\"",
208-
"linttest": "npm run eslint -- test/lib test/bin --fix",
207+
"lint": "npm run eslint -- test/lib test/bin \"lib/**/*.js\"",
209208
"lintfix": "npm run lint -- --fix",
210209
"prelint": "rimraf test/npm_cache*",
211-
"resetdeps": "bash scripts/resetdeps.sh",
212-
"prepublishOnly": "npm run lint && npm run linttest"
210+
"resetdeps": "bash scripts/resetdeps.sh"
213211
},
214212
"//": [
215213
"XXX temporarily only run unit tests while v7 beta is in progress",

0 commit comments

Comments
 (0)