Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 85206b7

Browse filesBrowse files
npm-robotBethGriggs
authored andcommitted
deps: upgrade npm to 7.24.0
PR-URL: #40167 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 0254b4b commit 85206b7
Copy full SHA for 85206b7

File tree

Expand file treeCollapse file tree

28 files changed

+429
-181
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

28 files changed

+429
-181
lines changed
Open diff view settings
Collapse file

‎deps/npm/docs/content/using-npm/scripts.md‎

Copy file name to clipboardExpand all lines: deps/npm/docs/content/using-npm/scripts.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ package.json file, then your package scripts would have the
259259
in your code with `process.env.npm_package_name` and
260260
`process.env.npm_package_version`, and so on for other fields.
261261

262-
See [`package-json.md`](/using-npm/package-json) for more on package configs.
262+
See [`package-json.md`](/configuring-npm/package-json) for more on package configs.
263263

264264
#### current lifecycle event
265265

Collapse file

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

Copy file name to clipboardExpand all lines: deps/npm/docs/output/commands/npm-ls.html
+1-1Lines 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.23.0 /path/to/npm
162+
<pre lang="bash"><code>npm@7.24.0 /path/to/npm
163163
└─┬ init-package-json@0.0.4
164164
└── promzard@0.1.5
165165
</code></pre>
Collapse file

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

Copy file name to clipboardExpand all lines: deps/npm/docs/output/commands/npm.html
+1-1Lines 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.23.0</p>
151+
<p>7.24.0</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
Collapse file

‎deps/npm/docs/output/using-npm/scripts.html‎

Copy file name to clipboardExpand all lines: deps/npm/docs/output/using-npm/scripts.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ <h4 id="packagejson-vars">package.json vars</h4>
379379
<code>npm_package_version</code> set to “1.2.5”. You can access these variables
380380
in your code with <code>process.env.npm_package_name</code> and
381381
<code>process.env.npm_package_version</code>, and so on for other fields.</p>
382-
<p>See <a href="../using-npm/package-json.html"><code>package-json.md</code></a> for more on package configs.</p>
382+
<p>See <a href="../configuring-npm/package-json.html"><code>package-json.md</code></a> for more on package configs.</p>
383383
<h4 id="current-lifecycle-event">current lifecycle event</h4>
384384
<p>Lastly, the <code>npm_lifecycle_event</code> environment variable is set to
385385
whichever stage of the cycle is being executed. So, you could have a
Collapse file

‎deps/npm/lib/install.js‎

Copy file name to clipboardExpand all lines: deps/npm/lib/install.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ class Install extends ArboristWorkspaceCmd {
135135
// be very strict about engines when trying to update npm itself
136136
const npmInstall = args.find(arg => arg.startsWith('npm@') || arg === 'npm')
137137
if (isGlobalInstall && npmInstall) {
138-
const npmManifest = await pacote.manifest(npmInstall)
138+
const npmOptions = this.npm.flatOptions
139+
const npmManifest = await pacote.manifest(npmInstall, npmOptions)
139140
try {
140141
checks.checkEngine(npmManifest, npmManifest.version, process.version)
141142
} catch (e) {
Collapse file

‎deps/npm/lib/search/format-package-stream.js‎

Copy file name to clipboardExpand all lines: deps/npm/lib/search/format-package-stream.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class JSONOutputStream extends Minipass {
4242
}
4343

4444
end () {
45-
super.write(this._didFirst ? ']\n' : '\n]\n')
45+
super.write(this._didFirst ? ']\n' : '\n[]\n')
4646
super.end()
4747
}
4848
}
Collapse file

‎deps/npm/lib/utils/config/definitions.js‎

Copy file name to clipboardExpand all lines: deps/npm/lib/utils/config/definitions.js
+11-1Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2053,10 +2053,14 @@ define('user-agent', {
20532053
.replace(/\{workspaces\}/gi, inWorkspaces)
20542054
.replace(/\{ci\}/gi, ciName ? `ci/${ciName}` : '')
20552055
.trim()
2056+
2057+
// We can't clobber the original or else subsequent flattening will fail
2058+
// (i.e. when we change the underlying config values)
2059+
// obj[key] = flatOptions.userAgent
2060+
20562061
// user-agent is a unique kind of config item that gets set from a template
20572062
// and ends up translated. Because of this, the normal "should we set this
20582063
// to process.env also doesn't work
2059-
obj[key] = flatOptions.userAgent
20602064
process.env.npm_config_user_agent = flatOptions.userAgent
20612065
},
20622066
})
@@ -2140,6 +2144,9 @@ define('workspace', {
21402144
a workspace which does not yet exist, to create the folder and set it
21412145
up as a brand new workspace within the project.
21422146
`,
2147+
flatten: (key, obj, flatOptions) => {
2148+
definitions['user-agent'].flatten('user-agent', obj, flatOptions)
2149+
},
21432150
})
21442151

21452152
define('workspaces', {
@@ -2151,6 +2158,9 @@ define('workspaces', {
21512158
Enable running a command in the context of **all** the configured
21522159
workspaces.
21532160
`,
2161+
flatten: (key, obj, flatOptions) => {
2162+
definitions['user-agent'].flatten('user-agent', obj, flatOptions)
2163+
},
21542164
})
21552165

21562166
define('yes', {
Collapse file

‎deps/npm/lib/utils/did-you-mean.js‎

Copy file name to clipboardExpand all lines: deps/npm/lib/utils/did-you-mean.js
+15-14Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,26 @@ const readJson = require('read-package-json-fast')
33
const { cmdList } = require('./cmd-list.js')
44

55
const didYouMean = async (npm, path, scmd) => {
6-
const bestCmd = cmdList
6+
let best = cmdList
77
.filter(cmd => distance(scmd, cmd) < scmd.length * 0.4 && scmd !== cmd)
88
.map(str => ` npm ${str} # ${npm.commands[str].description}`)
99

10-
const pkg = await readJson(`${path}/package.json`)
11-
const { scripts } = pkg
1210
// We would already be suggesting this in `npm x` so omit them here
1311
const runScripts = ['stop', 'start', 'test', 'restart']
14-
const bestRun = Object.keys(scripts || {})
15-
.filter(cmd => distance(scmd, cmd) < scmd.length * 0.4 &&
16-
!runScripts.includes(cmd))
17-
.map(str => ` npm run ${str} # run the "${str}" package script`)
18-
19-
const { bin } = pkg
20-
const bestBin = Object.keys(bin || {})
21-
.filter(cmd => distance(scmd, cmd) < scmd.length * 0.4)
22-
.map(str => ` npm exec ${str} # run the "${str}" command from either this or a remote npm package`)
23-
24-
const best = [...bestCmd, ...bestRun, ...bestBin]
12+
try {
13+
const { bin, scripts } = await readJson(`${path}/package.json`)
14+
best = best.concat(
15+
Object.keys(scripts || {})
16+
.filter(cmd => distance(scmd, cmd) < scmd.length * 0.4 &&
17+
!runScripts.includes(cmd))
18+
.map(str => ` npm run ${str} # run the "${str}" package script`),
19+
Object.keys(bin || {})
20+
.filter(cmd => distance(scmd, cmd) < scmd.length * 0.4)
21+
.map(str => ` npm exec ${str} # run the "${str}" command from either this or a remote npm package`)
22+
)
23+
} catch (_) {
24+
// gracefully ignore not being in a folder w/ a package.json
25+
}
2526

2627
if (best.length === 0)
2728
return ''
Collapse file

‎deps/npm/lib/utils/error-message.js‎

Copy file name to clipboardExpand all lines: deps/npm/lib/utils/error-message.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ module.exports = (er, npm) => {
367367
detail.push(['signal', er.signal])
368368

369369
if (er.cmd && Array.isArray(er.args))
370-
detail.push(['command', ...[er.cmd, ...er.args]])
370+
detail.push(['command', ...[er.cmd, ...er.args.map(replaceInfo)]])
371371

372372
if (er.stdout)
373373
detail.push(['', er.stdout.trim()])
Collapse file

‎deps/npm/lib/view.js‎

Copy file name to clipboardExpand all lines: deps/npm/lib/view.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ class View extends BaseCommand {
336336
email: color.cyan(manifest._npmUser.email),
337337
}),
338338
modified: !packument.time ? undefined
339-
: color.yellow(relativeDate(packument.time[packument.version])),
339+
: color.yellow(relativeDate(packument.time[manifest.version])),
340340
maintainers: (packument.maintainers || []).map((u) => unparsePerson({
341341
name: color.yellow(u.name),
342342
email: color.cyan(u.email),

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.