Skip to content

Commit e25dc8e

Browse files
npm-robottargos
authored andcommitted
deps: upgrade npm to 7.21.1
PR-URL: #39904 Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 259e0cf commit e25dc8e

Some content is hidden

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

48 files changed

+2261
-955
lines changed

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

+13
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,19 @@ will default the `start` command to `node server.js`. `prestart` and
203203
* `test`
204204
* `posttest`
205205

206+
#### A Note on a lack of [`npm uninstall`](/commands/npm-uninstall) scripts
207+
208+
While npm v6 had `uninstall` lifecycle scripts, npm v7 does not. Removal of a package can happen for a wide variety of reasons, and there's no clear way to currently give the script enough context to be useful.
209+
210+
Reasons for a package removal include:
211+
212+
* a user directly uninstalled this package
213+
* a user uninstalled a dependant package and so this dependency is being uninstalled
214+
* a user uninstalled a dependant package but another package also depends on this version
215+
* this version has been merged as a duplicate with another version
216+
* etc.
217+
218+
Due to the lack of necessary context, `uninstall` lifecycle scripts are not implemented and will not function.
206219

207220
### User
208221

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

+1-1
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>[email protected].0 /path/to/npm
162+
<pre lang="bash"><code>[email protected].1 /path/to/npm
163163
164164
165165
</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.21.0</p>
151+
<p>7.21.1</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/docs/output/using-npm/scripts.html

+12-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ <h1 id="scripts">scripts</h1>
141141

142142
<section id="table_of_contents">
143143
<h2 id="table-of-contents">Table of contents</h2>
144-
<div id="_table_of_contents"><ul><li><a href="#description">Description</a></li><li><a href="#pre--post-scripts">Pre &amp; Post Scripts</a></li><li><a href="#life-cycle-scripts">Life Cycle Scripts</a></li><ul><li><a href="#prepare-and-prepublish">Prepare and Prepublish</a></li></ul><li><a href="#life-cycle-operation-order">Life Cycle Operation Order</a></li><ul><li><a href="#npm-cache-add"><a href="../commands/npm-cache.html"><code>npm cache add</code></a></a></li><li><a href="#npm-ci"><a href="../commands/npm-ci.html"><code>npm ci</code></a></a></li><li><a href="#npm-diff"><a href="../commands/npm-diff.html"><code>npm diff</code></a></a></li><li><a href="#npm-install"><a href="../commands/npm-install.html"><code>npm install</code></a></a></li><li><a href="#npm-pack"><a href="../commands/npm-pack.html"><code>npm pack</code></a></a></li><li><a href="#npm-publish"><a href="../commands/npm-publish.html"><code>npm publish</code></a></a></li><li><a href="#npm-rebuild"><a href="../commands/npm-rebuild.html"><code>npm rebuild</code></a></a></li><li><a href="#npm-restart"><a href="../commands/npm-restart.html"><code>npm restart</code></a></a></li><li><a href="#npm-run-user-defined"><a href="../commands/npm-run-script.html"><code>npm run &lt;user defined&gt;</code></a></a></li><li><a href="#npm-start"><a href="../commands/npm-start.html"><code>npm start</code></a></a></li><li><a href="#npm-stop"><a href="../commands/npm-stop.html"><code>npm stop</code></a></a></li><li><a href="#npm-test"><a href="../commands/npm-test.html"><code>npm test</code></a></a></li></ul><li><a href="#user">User</a></li><li><a href="#environment">Environment</a></li><ul><li><a href="#path">path</a></li><li><a href="#packagejson-vars">package.json vars</a></li><li><a href="#current-lifecycle-event">current lifecycle event</a></li></ul><li><a href="#examples">Examples</a></li><li><a href="#exiting">Exiting</a></li><li><a href="#best-practices">Best Practices</a></li><li><a href="#see-also">See Also</a></li></ul></div>
144+
<div id="_table_of_contents"><ul><li><a href="#description">Description</a></li><li><a href="#pre--post-scripts">Pre &amp; Post Scripts</a></li><li><a href="#life-cycle-scripts">Life Cycle Scripts</a></li><ul><li><a href="#prepare-and-prepublish">Prepare and Prepublish</a></li></ul><li><a href="#life-cycle-operation-order">Life Cycle Operation Order</a></li><ul><li><a href="#npm-cache-add"><a href="../commands/npm-cache.html"><code>npm cache add</code></a></a></li><li><a href="#npm-ci"><a href="../commands/npm-ci.html"><code>npm ci</code></a></a></li><li><a href="#npm-diff"><a href="../commands/npm-diff.html"><code>npm diff</code></a></a></li><li><a href="#npm-install"><a href="../commands/npm-install.html"><code>npm install</code></a></a></li><li><a href="#npm-pack"><a href="../commands/npm-pack.html"><code>npm pack</code></a></a></li><li><a href="#npm-publish"><a href="../commands/npm-publish.html"><code>npm publish</code></a></a></li><li><a href="#npm-rebuild"><a href="../commands/npm-rebuild.html"><code>npm rebuild</code></a></a></li><li><a href="#npm-restart"><a href="../commands/npm-restart.html"><code>npm restart</code></a></a></li><li><a href="#npm-run-user-defined"><a href="../commands/npm-run-script.html"><code>npm run &lt;user defined&gt;</code></a></a></li><li><a href="#npm-start"><a href="../commands/npm-start.html"><code>npm start</code></a></a></li><li><a href="#npm-stop"><a href="../commands/npm-stop.html"><code>npm stop</code></a></a></li><li><a href="#npm-test"><a href="../commands/npm-test.html"><code>npm test</code></a></a></li><li><a href="#a-note-on-a-lack-of-npm-uninstall-scripts">A Note on a lack of <a href="../commands/npm-uninstall.html"><code>npm uninstall</code></a> scripts</a></li></ul><li><a href="#user">User</a></li><li><a href="#environment">Environment</a></li><ul><li><a href="#path">path</a></li><li><a href="#packagejson-vars">package.json vars</a></li><li><a href="#current-lifecycle-event">current lifecycle event</a></li></ul><li><a href="#examples">Examples</a></li><li><a href="#exiting">Exiting</a></li><li><a href="#best-practices">Best Practices</a></li><li><a href="#see-also">See Also</a></li></ul></div>
145145
</section>
146146

147147
<div id="_content"><h3 id="description">Description</h3>
@@ -337,6 +337,17 @@ <h4 id="npm-test"><a href="../commands/npm-test.html"><code>npm test</code></a><
337337
<li><code>test</code></li>
338338
<li><code>posttest</code></li>
339339
</ul>
340+
<h4 id="a-note-on-a-lack-of-npm-uninstall-scripts">A Note on a lack of <a href="../commands/npm-uninstall.html"><code>npm uninstall</code></a> scripts</h4>
341+
<p>While npm v6 had <code>uninstall</code> lifecycle scripts, npm v7 does not. Removal of a package can happen for a wide variety of reasons, and there’s no clear way to currently give the script enough context to be useful.</p>
342+
<p>Reasons for a package removal include:</p>
343+
<ul>
344+
<li>a user directly uninstalled this package</li>
345+
<li>a user uninstalled a dependant package and so this dependency is being uninstalled</li>
346+
<li>a user uninstalled a dependant package but another package also depends on this version</li>
347+
<li>this version has been merged as a duplicate with another version</li>
348+
<li>etc.</li>
349+
</ul>
350+
<p>Due to the lack of necessary context, <code>uninstall</code> lifecycle scripts are not implemented and will not function.</p>
340351
<h3 id="user">User</h3>
341352
<p>When npm is run as root, scripts are always run with the effective uid
342353
and gid of the working directory owner.</p>

deps/npm/lib/config.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class Config extends BaseCommand {
121121
break
122122
case 'list':
123123
case 'ls':
124-
await (this.npm.config.get('json') ? this.listJson() : this.list())
124+
await (this.npm.flatOptions.json ? this.listJson() : this.list())
125125
break
126126
case 'edit':
127127
await this.edit()
@@ -138,7 +138,7 @@ class Config extends BaseCommand {
138138
if (!args.length)
139139
throw this.usageError()
140140

141-
const where = this.npm.config.get('location')
141+
const where = this.npm.flatOptions.location
142142
for (const [key, val] of Object.entries(keyValues(args))) {
143143
this.npm.log.info('config', 'set %j %j', key, val)
144144
this.npm.config.set(key, val || '', where)
@@ -168,15 +168,15 @@ class Config extends BaseCommand {
168168
if (!keys.length)
169169
throw this.usageError()
170170

171-
const where = this.npm.config.get('location')
171+
const where = this.npm.flatOptions.location
172172
for (const key of keys)
173173
this.npm.config.delete(key, where)
174174
await this.npm.config.save(where)
175175
}
176176

177177
async edit () {
178-
const e = this.npm.config.get('editor')
179-
const where = this.npm.config.get('location')
178+
const e = this.npm.flatOptions.editor
179+
const where = this.npm.flatOptions.location
180180
const file = this.npm.config.data.get(where).source
181181

182182
// save first, just to make sure it's synced up
@@ -232,6 +232,7 @@ ${defData}
232232

233233
async list () {
234234
const msg = []
235+
// long does not have a flattener
235236
const long = this.npm.config.get('long')
236237
for (const [where, { data, source }] of this.npm.config.data.entries()) {
237238
if (where === 'default' && !long)

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

+19-11
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,11 @@ define('global', {
804804
* bin files are linked to \`{prefix}/bin\`
805805
* man pages are linked to \`{prefix}/share/man\`
806806
`,
807-
flatten,
807+
flatten: (key, obj, flatOptions) => {
808+
flatten(key, obj, flatOptions)
809+
if (flatOptions.global)
810+
flatOptions.location = 'global'
811+
},
808812
})
809813

810814
define('global-style', {
@@ -1131,14 +1135,10 @@ define('location', {
11311135
description: `
11321136
When passed to \`npm config\` this refers to which config file to use.
11331137
`,
1134-
// NOTE: the flattener here deliberately does not alter the value of global
1135-
// for now, this is to avoid inadvertently causing any breakage. the value of
1136-
// global, however, does modify this flag.
1137-
flatten (key, obj, flatOptions) {
1138-
// if global is set, we override ourselves
1139-
if (obj.global)
1140-
obj.location = 'global'
1141-
flatOptions.location = obj.location
1138+
flatten: (key, obj, flatOptions) => {
1139+
flatten(key, obj, flatOptions)
1140+
if (flatOptions.global)
1141+
flatOptions.location = 'global'
11421142
},
11431143
})
11441144

@@ -1359,7 +1359,11 @@ define('package-lock', {
13591359
modules will also be disabled. To remove extraneous modules with
13601360
package-locks disabled use \`npm prune\`.
13611361
`,
1362-
flatten,
1362+
flatten: (key, obj, flatOptions) => {
1363+
flatten(key, obj, flatOptions)
1364+
if (flatOptions.packageLockOnly)
1365+
flatOptions.packageLock = true
1366+
},
13631367
})
13641368

13651369
define('package-lock-only', {
@@ -1375,7 +1379,11 @@ define('package-lock-only', {
13751379
For \`list\` this means the output will be based on the tree described by the
13761380
\`package-lock.json\`, rather than the contents of \`node_modules\`.
13771381
`,
1378-
flatten,
1382+
flatten: (key, obj, flatOptions) => {
1383+
flatten(key, obj, flatOptions)
1384+
if (flatOptions.packageLockOnly)
1385+
flatOptions.packageLock = true
1386+
},
13791387
})
13801388

13811389
define('pack-destination', {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ example, running \fBnpm ls promzard\fP in npm's source tree will show:
2626
.P
2727
.RS 2
2828
.nf
29-
npm@7\.21\.0 /path/to/npm
29+
npm@7\.21\.1 /path/to/npm
3030
└─┬ init\-package\-json@0\.0\.4
3131
└── promzard@0\.1\.5
3232
.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\.21\.0
13+
7\.21\.1
1414
.SS Description
1515
.P
1616
npm is the package manager for the Node JavaScript platform\. It puts

deps/npm/man/man7/scripts.7

+20
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,26 @@ will default the \fBstart\fP command to \fBnode server\.js\fP\|\. \fBprestart\f
290290
\fBposttest\fP
291291

292292
.RE
293+
.SS A Note on a lack of npm help \fBuninstall\fP scripts
294+
.P
295+
While npm v6 had \fBuninstall\fP lifecycle scripts, npm v7 does not\. Removal of a package can happen for a wide variety of reasons, and there's no clear way to currently give the script enough context to be useful\.
296+
.P
297+
Reasons for a package removal include:
298+
.RS 0
299+
.IP \(bu 2
300+
a user directly uninstalled this package
301+
.IP \(bu 2
302+
a user uninstalled a dependant package and so this dependency is being uninstalled
303+
.IP \(bu 2
304+
a user uninstalled a dependant package but another package also depends on this version
305+
.IP \(bu 2
306+
this version has been merged as a duplicate with another version
307+
.IP \(bu 2
308+
etc\.
309+
310+
.RE
311+
.P
312+
Due to the lack of necessary context, \fBuninstall\fP lifecycle scripts are not implemented and will not function\.
293313
.SS User
294314
.P
295315
When npm is run as root, scripts are always run with the effective uid

deps/npm/node_modules/@gar/promisify/index.js

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

deps/npm/node_modules/@gar/promisify/package.json

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

deps/npm/node_modules/@npmcli/fs/LICENSE.md

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

deps/npm/node_modules/@npmcli/fs/lib/common/file-url-to-path/index.js

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

0 commit comments

Comments
 (0)