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 bce8041

Browse filesBrowse files
npm-cli-botruyadorno
authored andcommitted
deps: upgrade npm to 8.18.0
PR-URL: #44263 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 8cfc8b0 commit bce8041
Copy full SHA for bce8041

File tree

Expand file treeCollapse file tree

59 files changed

+663
-152
lines changed
Open diff view settings
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree

59 files changed

+663
-152
lines changed
Open diff view settings
Collapse file

‎deps/npm/docs/content/configuring-npm/package-json.md‎

Copy file name to clipboardExpand all lines: deps/npm/docs/content/configuring-npm/package-json.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ be found or fails to install, then you may put it in the
873873
`optionalDependencies` object. This is a map of package name to version or
874874
url, just like the `dependencies` object. The difference is that build
875875
failures do not cause installation to fail. Running `npm install
876-
--no-optional` will prevent these dependencies from being installed.
876+
--omit=optional` will prevent these dependencies from being installed.
877877

878878
It is still your program's responsibility to handle the lack of the
879879
dependency. For example, something like this:
Collapse file

‎deps/npm/docs/content/using-npm/dependency-selectors.md‎

Copy file name to clipboardExpand all lines: deps/npm/docs/content/using-npm/dependency-selectors.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ The [`npm query`](/commands/npm-query) commmand exposes a new dependency selecto
5454
- [`:private`](https://docs.npmjs.com/cli/v8/configuring-npm/package-json#private) when a dependency is private
5555
- `:link` when a dependency is linked (for instance, workspaces or packages manually [`linked`](https://docs.npmjs.com/cli/v8/commands/npm-link)
5656
- `:deduped` when a dependency has been deduped (note that this does *not* always mean the dependency has been hoisted to the root of node_modules)
57-
- `:override` when a dependency is an override (not implemented yet)
57+
- `:overridden` when a dependency has been overridden
5858
- `:extraneous` when a dependency exists but is not defined as a dependency of any node
5959
- `:invalid` when a dependency version is out of its ancestors specified range
6060
- `:missing` when a dependency is not found on disk
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
@@ -166,7 +166,7 @@ <h3 id="description">Description</h3>
166166
the results to only the paths to the packages named. Note that nested
167167
packages will <em>also</em> show the paths to the specified packages. For
168168
example, running <code>npm ls promzard</code> in npm's source tree will show:</p>
169-
<pre lang="bash"><code>npm@8.17.0 /path/to/npm
169+
<pre lang="bash"><code>npm@8.18.0 /path/to/npm
170170
└─┬ init-package-json@0.0.4
171171
└── promzard@0.1.5
172172
</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
@@ -149,7 +149,7 @@ <h2 id="table-of-contents">Table of contents</h2>
149149
<!-- raw HTML omitted -->
150150
<!-- raw HTML omitted -->
151151
<h3 id="version">Version</h3>
152-
<p>8.17.0</p>
152+
<p>8.18.0</p>
153153
<h3 id="description">Description</h3>
154154
<p>npm is the package manager for the Node JavaScript platform. It puts
155155
modules in place so that node can find them, and manages dependency
Collapse file

‎deps/npm/docs/output/configuring-npm/package-json.html‎

Copy file name to clipboardExpand all lines: deps/npm/docs/output/configuring-npm/package-json.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ <h3 id="optionaldependencies">optionalDependencies</h3>
803803
be found or fails to install, then you may put it in the
804804
<code>optionalDependencies</code> object. This is a map of package name to version or
805805
url, just like the <code>dependencies</code> object. The difference is that build
806-
failures do not cause installation to fail. Running <code>npm install --no-optional</code> will prevent these dependencies from being installed.</p>
806+
failures do not cause installation to fail. Running <code>npm install --omit=optional</code> will prevent these dependencies from being installed.</p>
807807
<p>It is still your program's responsibility to handle the lack of the
808808
dependency. For example, something like this:</p>
809809
<pre lang="js"><code>try {
Collapse file

‎deps/npm/docs/output/using-npm/dependency-selectors.html‎

Copy file name to clipboardExpand all lines: deps/npm/docs/output/using-npm/dependency-selectors.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ <h4 id="pseudo-selectors">Pseudo Selectors</h4>
194194
<li><a href="https://docs.npmjs.com/cli/v8/configuring-npm/package-json#private"><code>:private</code></a> when a dependency is private</li>
195195
<li><code>:link</code> when a dependency is linked (for instance, workspaces or packages manually <a href="https://docs.npmjs.com/cli/v8/commands/npm-link"><code>linked</code></a></li>
196196
<li><code>:deduped</code> when a dependency has been deduped (note that this does <em>not</em> always mean the dependency has been hoisted to the root of node_modules)</li>
197-
<li><code>:override</code> when a dependency is an override (not implemented yet)</li>
197+
<li><code>:overridden</code> when a dependency has been overridden</li>
198198
<li><code>:extraneous</code> when a dependency exists but is not defined as a dependency of any node</li>
199199
<li><code>:invalid</code> when a dependency version is out of its ancestors specified range</li>
200200
<li><code>:missing</code> when a dependency is not found on disk</li>
Collapse file

‎deps/npm/lib/commands/explain.js‎

Copy file name to clipboardExpand all lines: deps/npm/lib/commands/explain.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class Explain extends ArboristWorkspaceCmd {
5959

6060
const expls = []
6161
for (const node of nodes) {
62-
const { extraneous, dev, optional, devOptional, peer, inBundle } = node
62+
const { extraneous, dev, optional, devOptional, peer, inBundle, overridden } = node
6363
const expl = node.explain()
6464
if (extraneous) {
6565
expl.extraneous = true
@@ -69,6 +69,7 @@ class Explain extends ArboristWorkspaceCmd {
6969
expl.devOptional = devOptional
7070
expl.peer = peer
7171
expl.bundled = inBundle
72+
expl.overridden = overridden
7273
}
7374
expls.push(expl)
7475
}
Collapse file

‎deps/npm/lib/commands/ls.js‎

Copy file name to clipboardExpand all lines: deps/npm/lib/commands/ls.js
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,11 @@ const getHumanOutputItem = (node, { args, color, global, long }) => {
329329
? ' ' + (color ? chalk.green.bgBlack('extraneous') : 'extraneous')
330330
: ''
331331
) +
332+
(
333+
node.overridden
334+
? ' ' + (color ? chalk.gray('overridden') : 'overridden')
335+
: ''
336+
) +
332337
(isGitNode(node) ? ` (${node.resolved})` : '') +
333338
(node.isLink ? ` -> ${relativePrefix}${targetLocation}` : '') +
334339
(long ? `${EOL}${node.package.description || ''}` : '')
@@ -347,6 +352,13 @@ const getJsonOutputItem = (node, { global, long }) => {
347352
item.resolved = node.resolved
348353
}
349354

355+
// if the node is the project root, do not add the overridden flag. the project root can't be
356+
// overridden anyway, and if we add the flag it causes undesirable behavior when `npm ls --json`
357+
// is ran in an empty directory since we end up printing an object with only an overridden prop
358+
if (!node.isProjectRoot) {
359+
item.overridden = node.overridden
360+
}
361+
350362
item[_name] = node.name
351363

352364
// special formatting for top-level package name
@@ -555,6 +567,7 @@ const parseableOutput = ({ global, long, seenNodes }) => {
555567
out += node.path !== node.realpath ? `:${node.realpath}` : ''
556568
out += isExtraneous(node, { global }) ? ':EXTRANEOUS' : ''
557569
out += node[_invalid] ? ':INVALID' : ''
570+
out += node.overridden ? ':OVERRIDDEN' : ''
558571
}
559572
out += EOL
560573
}
Collapse file

‎deps/npm/lib/commands/query.js‎

Copy file name to clipboardExpand all lines: deps/npm/lib/commands/query.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class QuerySelectorItem {
2020
this.dev = node.target.dev
2121
this.inBundle = node.target.inBundle
2222
this.deduped = this.from.length > 1
23+
this.overridden = node.overridden
2324
for (const edge of node.target.edgesIn) {
2425
this.from.push(edge.from.location)
2526
}
Collapse file

‎deps/npm/lib/utils/explain-dep.js‎

Copy file name to clipboardExpand all lines: deps/npm/lib/utils/explain-dep.js
+14-3Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const nocolor = {
88
magenta: s => s,
99
blue: s => s,
1010
green: s => s,
11+
gray: s => s,
1112
}
1213

1314
const { relative } = require('path')
@@ -18,13 +19,14 @@ const explainNode = (node, depth, color) =>
1819
explainLinksIn(node, depth, color)
1920

2021
const colorType = (type, color) => {
21-
const { red, yellow, cyan, magenta, blue, green } = color ? chalk : nocolor
22+
const { red, yellow, cyan, magenta, blue, green, gray } = color ? chalk : nocolor
2223
const style = type === 'extraneous' ? red
2324
: type === 'dev' ? yellow
2425
: type === 'optional' ? cyan
2526
: type === 'peer' ? magenta
2627
: type === 'bundled' ? blue
2728
: type === 'workspace' ? green
29+
: type === 'overridden' ? gray
2830
: /* istanbul ignore next */ s => s
2931
return style(type)
3032
}
@@ -40,6 +42,7 @@ const printNode = (node, color) => {
4042
peer,
4143
bundled,
4244
isWorkspace,
45+
overridden,
4346
} = node
4447
const { bold, dim, green } = color ? chalk : nocolor
4548
const extra = []
@@ -63,6 +66,10 @@ const printNode = (node, color) => {
6366
extra.push(' ' + bold(colorType('bundled', color)))
6467
}
6568

69+
if (overridden) {
70+
extra.push(' ' + bold(colorType('overridden', color)))
71+
}
72+
6673
const pkgid = isWorkspace
6774
? green(`${name}@${version}`)
6875
: `${bold(name)}@${bold(version)}`
@@ -112,11 +119,15 @@ const explainDependents = ({ name, dependents }, depth, color) => {
112119
return str.split('\n').join('\n ')
113120
}
114121

115-
const explainEdge = ({ name, type, bundled, from, spec }, depth, color) => {
122+
const explainEdge = ({ name, type, bundled, from, spec, rawSpec, overridden }, depth, color) => {
116123
const { bold } = color ? chalk : nocolor
117-
const dep = type === 'workspace'
124+
let dep = type === 'workspace'
118125
? bold(relative(from.location, spec.slice('file:'.length)))
119126
: `${bold(name)}@"${bold(spec)}"`
127+
if (overridden) {
128+
dep = `${colorType('overridden', color)} ${dep} (was "${rawSpec}")`
129+
}
130+
120131
const fromMsg = ` from ${explainFrom(from, depth, color)}`
121132

122133
return (type === 'prod' ? '' : `${colorType(type, color)} `) +

0 commit comments

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