Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: upgrade npm to 7.20.1 #39490

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion deps/npm/docs/content/commands/npm-pkg.md
Expand Up @@ -16,7 +16,7 @@ npm pkg delete <field> [.<subfield> ...]

A command that automates the management of `package.json` files.
`npm pkg` provide 3 different sub commands that allow you to modify or retrieve
values for given object keys in your `packge.json`.
values for given object keys in your `package.json`.

The syntax to retrieve and set fields is a dot separated representation of
the nested object properties to be found within your `package.json`, it's the
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/content/commands/npm-unpublish.md
Expand Up @@ -7,7 +7,7 @@ description: Remove a package from the registry
### Synopsis

To learn more about how the npm registry treats unpublish, see our <a
href="https://www.npmjs.com/policies/unpublish" target="_blank"
href="https://docs.npmjs.com/policies/unpublish" target="_blank"
rel="noopener noreferrer"> unpublish policies</a>

#### Unpublishing a single version of a package
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/content/commands/npm.md
Expand Up @@ -31,7 +31,7 @@ Run `npm help` to get a list of available commands.
npm comes preconfigured to use npm's public registry at
https://registry.npmjs.org by default. Use of the npm public registry is
subject to terms of use available at
https://www.npmjs.com/policies/terms.
https://docs.npmjs.com/policies/terms.

You can configure npm to use any compatible registry you like, and even
run your own registry. Use of someone else's registry is governed by
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/content/using-npm/registry.md
Expand Up @@ -12,7 +12,7 @@ package info.

npm is configured to use the **npm public registry** at
<https://registry.npmjs.org> by default. Use of the npm public registry is
subject to terms of use available at <https://www.npmjs.com/policies/terms>.
subject to terms of use available at <https://docs.npmjs.com/policies/terms>.

You can configure npm to use any compatible registry you like, and even run
your own registry. Use of someone else's registry may be governed by their
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm-ls.html
Expand Up @@ -159,7 +159,7 @@ <h3 id="description">Description</h3>
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.20.0 /path/to/npm
<pre lang="bash"><code>npm@7.20.1 /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-pkg.html
Expand Up @@ -152,7 +152,7 @@ <h2 id="table-of-contents">Table of contents</h2>
<h3 id="description">Description</h3>
<p>A command that automates the management of <code>package.json</code> files.
<code>npm pkg</code> provide 3 different sub commands that allow you to modify or retrieve
values for given object keys in your <code>packge.json</code>.</p>
values for given object keys in your <code>package.json</code>.</p>
<p>The syntax to retrieve and set fields is a dot separated representation of
the nested object properties to be found within your <code>package.json</code>, it’s the
same notation used in <a href="../commands/npm-view.html"><code>npm view</code></a> to retrieve information
Expand Down
4 changes: 2 additions & 2 deletions deps/npm/docs/output/commands/npm.html
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.20.0</p>
<p>7.20.1</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 All @@ -161,7 +161,7 @@ <h3 id="important">Important</h3>
<p>npm comes preconfigured to use npm’s public registry at
<a href="https://registry.npmjs.org">https://registry.npmjs.org</a> by default. Use of the npm public registry is
subject to terms of use available at
<a href="https://www.npmjs.com/policies/terms">https://www.npmjs.com/policies/terms</a>.</p>
<a href="https://docs.npmjs.com/policies/terms">https://docs.npmjs.com/policies/terms</a>.</p>
<p>You can configure npm to use any compatible registry you like, and even
run your own registry. Use of someone else’s registry is governed by
their terms of use.</p>
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/using-npm/registry.html
Expand Up @@ -150,7 +150,7 @@ <h2 id="table-of-contents">Table of contents</h2>
package info.</p>
<p>npm is configured to use the <strong>npm public registry</strong> at
<a href="https://registry.npmjs.org">https://registry.npmjs.org</a> by default. Use of the npm public registry is
subject to terms of use available at <a href="https://www.npmjs.com/policies/terms">https://www.npmjs.com/policies/terms</a>.</p>
subject to terms of use available at <a href="https://docs.npmjs.com/policies/terms">https://docs.npmjs.com/policies/terms</a>.</p>
<p>You can configure npm to use any compatible registry you like, and even run
your own registry. Use of someone else’s registry may be governed by their
terms of use.</p>
Expand Down
4 changes: 1 addition & 3 deletions deps/npm/lib/exec.js
Expand Up @@ -68,7 +68,6 @@ class Exec extends BaseCommand {
async _exec (_args, { locationMsg, path, runPath }) {
const args = [..._args]
const call = this.npm.config.get('call')
const color = this.npm.config.get('color')
const {
flatOptions,
localBin,
Expand All @@ -87,7 +86,6 @@ class Exec extends BaseCommand {
...flatOptions,
args,
call,
color,
localBin,
locationMsg,
log,
Expand All @@ -103,7 +101,7 @@ class Exec extends BaseCommand {

async _execWorkspaces (args, filters) {
await this.setWorkspaces(filters)
const color = this.npm.config.get('color')
const color = this.npm.color

for (const path of this.workspacePaths) {
const locationMsg = await getLocationMsg({ color, path })
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/lib/fund.js
Expand Up @@ -109,7 +109,7 @@ class Fund extends ArboristWorkspaceCmd {
}

printHuman (fundingInfo) {
const color = !!this.npm.color
const color = this.npm.color
const unicode = this.npm.config.get('unicode')
const seenUrls = new Map()

Expand Down
2 changes: 1 addition & 1 deletion deps/npm/lib/ls.js
Expand Up @@ -67,7 +67,7 @@ class LS extends ArboristWorkspaceCmd {

async ls (args) {
const all = this.npm.config.get('all')
const color = !!this.npm.color
const color = this.npm.color
const depth = this.npm.config.get('depth')
const dev = this.npm.config.get('dev')
const development = this.npm.config.get('development')
Expand Down
8 changes: 7 additions & 1 deletion deps/npm/lib/npm.js
Expand Up @@ -232,7 +232,7 @@ const npm = module.exports = new class extends EventEmitter {
process.emit('timeEnd', 'npm:load:setTitle')

process.emit('time', 'npm:load:setupLog')
this.color = setupLog(this.config)
setupLog(this.config)
process.emit('timeEnd', 'npm:load:setupLog')
process.env.COLOR = this.color ? '1' : '0'

Expand Down Expand Up @@ -261,6 +261,12 @@ const npm = module.exports = new class extends EventEmitter {
return flat
}

get color () {
// This is a special derived value that takes into consideration not only
// the config, but whether or not we are operating in a tty.
return this.flatOptions.color
}

get lockfileVersion () {
return 2
}
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/lib/run-script.js
Expand Up @@ -137,7 +137,7 @@ class RunScript extends BaseCommand {
path = path || this.npm.localPrefix
const { scripts, name, _id } = await rpj(`${path}/package.json`)
const pkgid = _id || name
const color = !!this.npm.color
const color = this.npm.color

if (!scripts)
return []
Expand Down
3 changes: 3 additions & 0 deletions deps/npm/lib/utils/config/definitions.js
Expand Up @@ -438,6 +438,9 @@ define('cidr', {
flatten,
})

// This should never be directly used, the flattened value is the derived value
// and is sent to other modules, and is also exposed as `npm.color` for use
// inside npm itself.
define('color', {
default: !process.env.NO_COLOR || process.env.NO_COLOR === '0',
usage: '--color|--no-color|--color always',
Expand Down
19 changes: 10 additions & 9 deletions deps/npm/lib/utils/exit-handler.js
Expand Up @@ -52,16 +52,17 @@ process.on('exit', code => {

if (!code)
npm.log.info('ok')
else {
else
npm.log.verbose('code', code)
if (!exitHandlerCalled) {
npm.log.error('', 'Exit handler never called!')
console.error('')
npm.log.error('', 'This is an error with npm itself. Please report this error at:')
npm.log.error('', ' <https://github.com/npm/cli/issues>')
// TODO this doesn't have an npm.config.loaded guard
writeLogFile()
}

if (!exitHandlerCalled) {
process.exitCode = code || 1
npm.log.error('', 'Exit handler never called!')
console.error('')
npm.log.error('', 'This is an error with npm itself. Please report this error at:')
npm.log.error('', ' <https://github.com/npm/cli/issues>')
// TODO this doesn't have an npm.config.loaded guard
writeLogFile()
}
// In timing mode we always write the log file
if (npm.config.loaded && npm.config.get('timing') && !wroteLogFile)
Expand Down
3 changes: 1 addition & 2 deletions deps/npm/lib/utils/setup-log.js
Expand Up @@ -18,6 +18,7 @@ module.exports = (config) => {
const stderrTTY = process.stderr.isTTY
const dumbTerm = process.env.TERM === 'dumb'
const stderrNotDumb = stderrTTY && !dumbTerm
// this logic is duplicated in the config 'color' flattener
const enableColorStderr = color === 'always' ? true
: color === false ? false
: stderrTTY
Expand Down Expand Up @@ -58,6 +59,4 @@ module.exports = (config) => {
log.enableProgress()
else
log.disableProgress()

return enableColorStdout
}
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-ls.1
Expand Up @@ -26,7 +26,7 @@ example, running \fBnpm ls promzard\fP in npm's source tree will show:
.P
.RS 2
.nf
npm@7\.20\.0 /path/to/npm
npm@7\.20\.1 /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-pkg.1
Expand Up @@ -14,7 +14,7 @@ npm pkg delete <field> [\.<subfield> \.\.\.]
.P
A command that automates the management of \fBpackage\.json\fP files\.
\fBnpm pkg\fP provide 3 different sub commands that allow you to modify or retrieve
values for given object keys in your \fBpackge\.json\fP\|\.
values for given object keys in your \fBpackage\.json\fP\|\.
.P
The syntax to retrieve and set fields is a dot separated representation of
the nested object properties to be found within your \fBpackage\.json\fP, it's the
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-unpublish.1
Expand Up @@ -4,7 +4,7 @@
.SS Synopsis
.P
To learn more about how the npm registry treats unpublish, see our <a
href="https://www\.npmjs\.com/policies/unpublish" target="_blank"
href="https://docs\.npmjs\.com/policies/unpublish" target="_blank"
rel="noopener noreferrer"> unpublish policies</a>
.SS Unpublishing a single version of a package
.P
Expand Down
4 changes: 2 additions & 2 deletions deps/npm/man/man1/npm.1
Expand Up @@ -10,7 +10,7 @@ npm <command> [args]
.RE
.SS Version
.P
7\.20\.0
7\.20\.1
.SS Description
.P
npm is the package manager for the Node JavaScript platform\. It puts
Expand All @@ -27,7 +27,7 @@ Run \fBnpm help\fP to get a list of available commands\.
npm comes preconfigured to use npm's public registry at
https://registry\.npmjs\.org by default\. Use of the npm public registry is
subject to terms of use available at
https://www\.npmjs\.com/policies/terms\.
https://docs\.npmjs\.com/policies/terms\.
.P
You can configure npm to use any compatible registry you like, and even
run your own registry\. Use of someone else's registry is governed by
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man7/registry.7
Expand Up @@ -9,7 +9,7 @@ package info\.
.P
npm is configured to use the \fBnpm public registry\fR at
https://registry\.npmjs\.org by default\. Use of the npm public registry is
subject to terms of use available at https://www\.npmjs\.com/policies/terms\|\.
subject to terms of use available at https://docs\.npmjs\.com/policies/terms\|\.
.P
You can configure npm to use any compatible registry you like, and even run
your own registry\. Use of someone else's registry may be governed by their
Expand Down
15 changes: 15 additions & 0 deletions deps/npm/node_modules/color-support/LICENSE

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