Skip to content

Commit

Permalink
deps: upgrade npm to 7.0.13
Browse files Browse the repository at this point in the history
PR-URL: #36202
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
ruyadorno authored and codebytere committed Nov 24, 2020
1 parent 0fbade3 commit d16e862
Show file tree
Hide file tree
Showing 25 changed files with 489 additions and 90 deletions.
1 change: 1 addition & 0 deletions deps/npm/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -734,3 +734,4 @@ Jason Attwood <jason_attwood@hotmail.co.uk>
Vlad GURDIGA <gurdiga@gmail.com>
Sébastien Puech <s.puech@tricentis.com>
Jannis Hell <Primajin@users.noreply.github.com>
Hollow Man <hollowman@hollowman.ml>
32 changes: 32 additions & 0 deletions deps/npm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
## 7.0.13 (2020-11-20)

### BUG FIXES
* [`5fc56b6db`](https://github.com/npm/cli/commit/5fc56b6dbcc7d7d1463a761abb67d2fc16ad3657)
[npm/statusboard#174](https://github.com/npm/statusboard/issues/174)
[#2204](https://github.com/npm/cli/issues/2204)
fix npm unstar command
([@ruyadorno](https://github.com/ruyadorno))
* [`7842b4d4d`](https://github.com/npm/cli/commit/7842b4d4dca1e076b0d26d554f9dce67484cd7be)
[npm/statusboard#182](https://github.com/npm/statusboard/issues/182)
[#2205](https://github.com/npm/cli/issues/2205)
fix npm version usage output
([@ruyadorno](https://github.com/ruyadorno))
* [`a0adbf9f8`](https://github.com/npm/cli/commit/a0adbf9f8f77531fcf81ae31bbc7102698765ee3)
[#2206](https://github.com/npm/cli/issues/2206)
[#2213](https://github.com/npm/cli/issues/2213)
fix: fix flatOptions usage in npm init
([@ruyadorno](https://github.com/ruyadorno))

### DEPENDENCIES

* [`3daaf000a`](https://github.com/npm/cli/commit/3daaf000aee0ba81af855977d7011850e79099e6)
`@npmcli/arborist@1.0.12`
- fixes some windows specific bugs in how paths are handled and compared

### DOCUMENTATION

* [`084a7b6ad`](https://github.com/npm/cli/commit/084a7b6ad6eaf9f2d92eb05da93e745f5357cce2)
[#2210](https://github.com/npm/cli/issues/2210)
docs: Fix typo
([@HollowMan6](https://github.com/HollowMan6))

## 7.0.12 (2020-11-17)

### BUG FIXES
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/content/commands/npm-explain.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ node_modules/nyc/node_modules/find-up
#### json

* Default: false
* Type: Bolean
* Type: Boolean

Show information in JSON format.

Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm-explain.html
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ <h3 id="configuration">Configuration</h3>
<h4 id="json">json</h4>
<ul>
<li>Default: false</li>
<li>Type: Bolean</li>
<li>Type: Boolean</li>
</ul>
<p>Show information in JSON format.</p>
<h3 id="see-also">See Also</h3>
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm-ls.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ <h3 id="description">Description</h3>
limit the results to only the paths to the packages named. Note that
nested packages will <em>also</em> show the paths to the specified packages.
For example, running <code>npm ls promzard</code> in npm’s source tree will show:</p>
<pre lang="bash"><code> npm@7.0.12 /path/to/npm
<pre lang="bash"><code> npm@7.0.13 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
</code></pre>
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ <h2 id="table-of-contents">Table of contents</h2>
<pre lang="bash"><code>npm &lt;command&gt; [args]
</code></pre>
<h3 id="version">Version</h3>
<p>7.0.12</p>
<p>7.0.13</p>
<h3 id="description">Description</h3>
<p>npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
Expand Down
1 change: 0 additions & 1 deletion deps/npm/lib/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ const init = async args => {
}
}
npm.config.set('package', [])
npm.flatOptions = { ...npm.flatOptions, package: [] }
return new Promise((res, rej) => {
npm.commands.exec([packageName, ...args.slice(1)], er => er ? rej(er) : res())
})
Expand Down
120 changes: 61 additions & 59 deletions deps/npm/lib/star.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,73 +3,75 @@
const fetch = require('npm-registry-fetch')
const log = require('npmlog')
const npa = require('npm-package-arg')

const npm = require('./npm.js')
const output = require('./utils/output.js')
const usage = require('./utils/usage.js')
const getItentity = require('./utils/get-identity')
const usageUtil = require('./utils/usage.js')
const getIdentity = require('./utils/get-identity')
const completion = require('./utils/completion/none.js')

star.usage = usage(
const usage = usageUtil(
'star',
'npm star [<pkg>...]\n' +
'npm unstar [<pkg>...]'
)

star.completion = function (opts, cb) {
// FIXME: there used to be registry completion here, but it stopped making
// sense somewhere around 50,000 packages on the registry
cb()
}
const cmd = (args, cb) => star(args).then(() => cb()).catch(cb)

const star = async args => {
if (!args.length)
throw new Error(usage)

// if we're unstarring, then show an empty star image
// otherwise, show the full star image
const { unicode } = npm.flatOptions
const unstar = npm.config.get('star.unstar')
const full = unicode ? '\u2605 ' : '(*)'
const empty = unicode ? '\u2606 ' : '( )'
const show = unstar ? empty : full

const pkgs = args.map(npa)
for (const pkg of pkgs) {
const [username, fullData] = await Promise.all([
getIdentity(npm.flatOptions),
fetch.json(pkg.escapedName, {
...npm.flatOptions,
spec: pkg,
query: { write: true },
preferOnline: true,
}),
])

module.exports = star
function star (args, cb) {
const opts = npm.flatOptions
return Promise.resolve().then(() => {
if (!args.length)
throw new Error(star.usage)
// if we're unstarring, then show an empty star image
// otherwise, show the full star image
const unstar = /^un/.test(npm.command)
const full = opts.unicode ? '\u2605 ' : '(*)'
const empty = opts.unicode ? '\u2606 ' : '( )'
const show = unstar ? empty : full
return Promise.all(args.map(npa).map(pkg => {
return Promise.all([
getItentity(opts),
fetch.json(pkg.escapedName, {
...opts,
spec: pkg,
query: { write: true },
preferOnline: true,
}),
]).then(([username, fullData]) => {
if (!username)
throw new Error('You need to be logged in!')
const body = {
_id: fullData._id,
_rev: fullData._rev,
users: fullData.users || {},
}
if (!username)
throw new Error('You need to be logged in!')

if (!unstar) {
log.info('star', 'starring', body._id)
body.users[username] = true
log.verbose('star', 'starring', body)
} else {
delete body.users[username]
log.info('star', 'unstarring', body._id)
log.verbose('star', 'unstarring', body)
}
return fetch.json(pkg.escapedName, {
...opts,
spec: pkg,
method: 'PUT',
body,
})
}).then(data => {
output(show + ' ' + pkg.name)
log.verbose('star', data)
return data
})
}))
}).then(() => cb(), cb)
const body = {
_id: fullData._id,
_rev: fullData._rev,
users: fullData.users || {},
}

if (!unstar) {
log.info('star', 'starring', body._id)
body.users[username] = true
log.verbose('star', 'starring', body)
} else {
delete body.users[username]
log.info('unstar', 'unstarring', body._id)
log.verbose('unstar', 'unstarring', body)
}

const data = await fetch.json(pkg.escapedName, {
...npm.flatOptions,
spec: pkg,
method: 'PUT',
body,
})

output(show + ' ' + pkg.name)
log.verbose('star', data)
return data
}
}

module.exports = Object.assign(cmd, { completion, usage })
9 changes: 9 additions & 0 deletions deps/npm/lib/unstar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const { usage, completion } = require('./star.js')
const npm = require('./npm.js')

const unstar = (args, cb) => {
npm.config.set('star.unstar', true)
return npm.commands.star(args, cb)
}

module.exports = Object.assign(unstar, { usage, completion })
2 changes: 1 addition & 1 deletion deps/npm/lib/utils/cmd-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const shorthands = {
c: 'config',
s: 'search',
se: 'search',
unstar: 'star', // same function
tst: 'test',
t: 'test',
ddp: 'dedupe',
Expand Down Expand Up @@ -88,6 +87,7 @@ const cmdList = [
'publish',
'star',
'stars',
'unstar',
'adduser',
'login', // This is an alias for `adduser` but it can be confusing
'logout',
Expand Down
4 changes: 3 additions & 1 deletion deps/npm/lib/version.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

const libversion = require('libnpmversion')
const npm = require('./npm.js')
const output = require('./utils/output.js')
Expand Down Expand Up @@ -42,7 +44,7 @@ const version = async args => {
path: npm.prefix,
}))
default:
throw version.usage
throw usage
}
}

Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-explain.1
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ node_modules/nyc/node_modules/find\-up
.IP \(bu 2
Default: false
.IP \(bu 2
Type: Bolean
Type: Boolean

.RE
.P
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-ls.1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ For example, running \fBnpm ls promzard\fP in npm's source tree will show:
.P
.RS 2
.nf
npm@7\.0\.12 /path/to/npm
npm@7\.0\.13 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.fi
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm.1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ npm <command> [args]
.RE
.SS Version
.P
7\.0\.12
7\.0\.13
.SS Description
.P
npm is the package manager for the Node JavaScript platform\. It puts
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion deps/npm/node_modules/@npmcli/arborist/lib/dep-valid.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions deps/npm/node_modules/@npmcli/arborist/lib/node.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion deps/npm/node_modules/@npmcli/arborist/lib/yarn-lock.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions deps/npm/node_modules/@npmcli/arborist/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 4 additions & 6 deletions deps/npm/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "7.0.12",
"version": "7.0.13",
"name": "npm",
"description": "a package manager for JavaScript",
"keywords": [
Expand Down Expand Up @@ -42,7 +42,7 @@
"./package.json": "./package.json"
},
"dependencies": {
"@npmcli/arborist": "^1.0.11",
"@npmcli/arborist": "^1.0.12",
"@npmcli/ci-detect": "^1.2.0",
"@npmcli/config": "^1.2.1",
"@npmcli/run-script": "^1.8.0",
Expand Down Expand Up @@ -204,12 +204,10 @@
"sudotest:nocleanup": "sudo NO_TEST_CLEANUP=1 npm run test --",
"posttest": "npm run lint",
"eslint": "eslint",
"lint": "npm run eslint -- \"lib/**/*.js\"",
"linttest": "npm run eslint -- test/lib test/bin --fix",
"lint": "npm run eslint -- test/lib test/bin \"lib/**/*.js\"",
"lintfix": "npm run lint -- --fix",
"prelint": "rimraf test/npm_cache*",
"resetdeps": "bash scripts/resetdeps.sh",
"prepublishOnly": "npm run lint && npm run linttest"
"resetdeps": "bash scripts/resetdeps.sh"
},
"//": [
"XXX temporarily only run unit tests while v7 beta is in progress",
Expand Down
Loading

0 comments on commit d16e862

Please sign in to comment.