Skip to content

Commit 3a1d952

Browse files
npm-robotdanielleadams
authored andcommitted
deps: upgrade npm to 8.2.0
PR-URL: #41065 Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent d6d1d66 commit 3a1d952

File tree

287 files changed

+5105
-5604
lines changed

Some content is hidden

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

287 files changed

+5105
-5604
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -1014,8 +1014,8 @@ Ideal if all users are on npm version 7 and higher.
10141014
* Type: "silent", "error", "warn", "notice", "http", "timing", "info",
10151015
"verbose", or "silly"
10161016

1017-
What level of logs to report. On failure, *all* logs are written to
1018-
`npm-debug.log` in the current working directory.
1017+
What level of logs to report. All logs are written to a debug log, with the
1018+
path to that file printed if the execution of a command fails.
10191019

10201020
Any logs of a higher level than the setting are shown. The default is
10211021
"notice".
@@ -1387,7 +1387,7 @@ Save installed packages to a package.json file as `optionalDependencies`.
13871387
* Default: false
13881388
* Type: Boolean
13891389

1390-
Save installed packages. to a package.json file as `peerDependencies`
1390+
Save installed packages to a package.json file as `peerDependencies`
13911391

13921392
<!-- automatically generated, do not edit manually -->
13931393
<!-- see lib/utils/config/definitions.js -->
+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
title: Logging
3+
section: 7
4+
description: Why, What & How we Log
5+
---
6+
7+
### Description
8+
9+
The `npm` CLI has various mechanisms for showing different levels of information back to end-users for certain commands, configurations & environments.
10+
11+
### Setting Log Levels
12+
13+
#### `loglevel`
14+
15+
`loglevel` is a global argument/config that can be set to determine the type of information to be displayed.
16+
17+
The default value of `loglevel` is `"notice"` but there are several levels/types of logs available, including:
18+
19+
- `"silent"`
20+
- `"error"`
21+
- `"warn"`
22+
- `"notice"`
23+
- `"http"`
24+
- `"timing"`
25+
- `"info"`
26+
- `"verbose"`
27+
- `"silly"`
28+
29+
All logs pertaining to a level proceeding the current setting will be shown.
30+
31+
All logs are written to a debug log, with the path to that file printed if the execution of a command fails.
32+
33+
##### Aliases
34+
35+
The log levels listed above have various corresponding aliases, including:
36+
37+
- `-d`: `--loglevel info`
38+
- `--dd`: `--loglevel verbose`
39+
- `--verbose`: `--loglevel verbose`
40+
- `--ddd`: `--loglevel silly`
41+
- `-q`: `--loglevel warn`
42+
- `--quiet`: `--loglevel warn`
43+
- `-s`: `--loglevel silent`
44+
- `--silent`: `--loglevel silent`
45+
46+
#### `foreground-scripts`
47+
48+
The `npm` CLI began hiding the output of lifecycle scripts for `npm install` as of `v7`. Notably, this means you will not see logs/output from packages that may be using "install scripts" to display information back to you or from your own project's scripts defined in `package.json`. If you'd like to change this behavior & log this output you can set `foreground-scripts` to `true`.
49+
50+
### Registry Response Headers
51+
52+
#### `npm-notice`
53+
54+
The `npm` CLI reads from & logs any `npm-notice` headers that are returned from the configured registry. This mechanism can be used by third-party registries to provide useful information when network-dependent requests occur.
55+
56+
This header is not cached, and will not be logged if the request is served from the cache.
57+
58+
### See also
59+
60+
* [config](/using-npm/config)

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

+1-1
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`](/configuring-npm/package-json) for more on package configs.
262+
See [`package.json`](/configuring-npm/package-json) for more on package configs.
263263

264264
#### current lifecycle event
265265

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: Working with workspaces
88

99
**Workspaces** is a generic term that refers to the set of features in the
1010
npm cli that provides support to managing multiple packages from your local
11-
files system from within a singular top-level, root package.
11+
file system from within a singular top-level, root package.
1212

1313
This set of features makes up for a much more streamlined workflow handling
1414
linked packages from the local file system. Automating the linking process

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ <h3 id="description">Description</h3>
160160
the results to only the paths to the packages named. Note that nested
161161
packages will <em>also</em> show the paths to the specified packages. For
162162
example, running <code>npm ls promzard</code> in npm's source tree will show:</p>
163-
<pre lang="bash"><code>npm@8.1.4 /path/to/npm
163+
<pre lang="bash"><code>npm@8.2.0 /path/to/npm
164164
165165
166166
</code></pre>

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ <h2 id="table-of-contents">Table of contents</h2>
149149
<pre lang="bash"><code>npm &lt;command&gt; [args]
150150
</code></pre>
151151
<h3 id="version">Version</h3>
152-
<p>8.1.4</p>
152+
<p>8.2.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

deps/npm/docs/output/using-npm/config.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -962,8 +962,8 @@ <h4 id="loglevel"><code>loglevel</code></h4>
962962
<li>Type: "silent", "error", "warn", "notice", "http", "timing", "info",
963963
"verbose", or "silly"</li>
964964
</ul>
965-
<p>What level of logs to report. On failure, <em>all</em> logs are written to
966-
<code>npm-debug.log</code> in the current working directory.</p>
965+
<p>What level of logs to report. All logs are written to a debug log, with the
966+
path to that file printed if the execution of a command fails.</p>
967967
<p>Any logs of a higher level than the setting are shown. The default is
968968
"notice".</p>
969969
<p>See also the <code>foreground-scripts</code> config.</p>
@@ -1259,7 +1259,7 @@ <h4 id="save-peer"><code>save-peer</code></h4>
12591259
<li>Default: false</li>
12601260
<li>Type: Boolean</li>
12611261
</ul>
1262-
<p>Save installed packages. to a package.json file as <code>peerDependencies</code></p>
1262+
<p>Save installed packages to a package.json file as <code>peerDependencies</code></p>
12631263
<!-- raw HTML omitted -->
12641264
<!-- raw HTML omitted -->
12651265
<h4 id="save-prefix"><code>save-prefix</code></h4>
+203
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
<!DOCTYPE html><html><head>
2+
<meta charset="utf-8">
3+
<title>Logging</title>
4+
<style>
5+
body {
6+
background-color: #ffffff;
7+
color: #24292e;
8+
9+
margin: 0;
10+
11+
line-height: 1.5;
12+
13+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
14+
}
15+
#rainbar {
16+
height: 10px;
17+
background-image: linear-gradient(139deg, #fb8817, #ff4b01, #c12127, #e02aff);
18+
}
19+
20+
a {
21+
text-decoration: none;
22+
color: #0366d6;
23+
}
24+
a:hover {
25+
text-decoration: underline;
26+
}
27+
28+
pre {
29+
margin: 1em 0px;
30+
padding: 1em;
31+
border: solid 1px #e1e4e8;
32+
border-radius: 6px;
33+
34+
display: block;
35+
overflow: auto;
36+
37+
white-space: pre;
38+
39+
background-color: #f6f8fa;
40+
color: #393a34;
41+
}
42+
code {
43+
font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;
44+
font-size: 85%;
45+
padding: 0.2em 0.4em;
46+
background-color: #f6f8fa;
47+
color: #393a34;
48+
}
49+
pre > code {
50+
padding: 0;
51+
background-color: inherit;
52+
color: inherit;
53+
}
54+
h1, h2, h3 {
55+
font-weight: 600;
56+
}
57+
58+
#logobar {
59+
background-color: #333333;
60+
margin: 0 auto;
61+
padding: 1em 4em;
62+
}
63+
#logobar .logo {
64+
float: left;
65+
}
66+
#logobar .title {
67+
font-weight: 600;
68+
color: #dddddd;
69+
float: left;
70+
margin: 5px 0 0 1em;
71+
}
72+
#logobar:after {
73+
content: "";
74+
display: block;
75+
clear: both;
76+
}
77+
78+
#content {
79+
margin: 0 auto;
80+
padding: 0 4em;
81+
}
82+
83+
#table_of_contents > h2 {
84+
font-size: 1.17em;
85+
}
86+
#table_of_contents ul:first-child {
87+
border: solid 1px #e1e4e8;
88+
border-radius: 6px;
89+
padding: 1em;
90+
background-color: #f6f8fa;
91+
color: #393a34;
92+
}
93+
#table_of_contents ul {
94+
list-style-type: none;
95+
padding-left: 1.5em;
96+
}
97+
#table_of_contents li {
98+
font-size: 0.9em;
99+
}
100+
#table_of_contents li a {
101+
color: #000000;
102+
}
103+
104+
header.title {
105+
border-bottom: solid 1px #e1e4e8;
106+
}
107+
header.title > h1 {
108+
margin-bottom: 0.25em;
109+
}
110+
header.title > .description {
111+
display: block;
112+
margin-bottom: 0.5em;
113+
line-height: 1;
114+
}
115+
116+
footer#edit {
117+
border-top: solid 1px #e1e4e8;
118+
margin: 3em 0 4em 0;
119+
padding-top: 2em;
120+
}
121+
</style>
122+
</head>
123+
<body>
124+
<div id="banner">
125+
<div id="rainbar"></div>
126+
<div id="logobar">
127+
<svg class="logo" role="img" height="32" width="32" viewBox="0 0 700 700">
128+
<polygon fill="#cb0000" points="0,700 700,700 700,0 0,0"></polygon>
129+
<polygon fill="#ffffff" points="150,550 350,550 350,250 450,250 450,550 550,550 550,150 150,150"></polygon>
130+
</svg>
131+
<div class="title">
132+
npm command-line interface
133+
</div>
134+
</div>
135+
</div>
136+
137+
<section id="content">
138+
<header class="title">
139+
<h1 id="logging">Logging</h1>
140+
<span class="description">Why, What &amp; How we Log</span>
141+
</header>
142+
143+
<section id="table_of_contents">
144+
<h2 id="table-of-contents">Table of contents</h2>
145+
<div id="_table_of_contents"><ul><li><a href="#description">Description</a></li><li><a href="#setting-log-levels">Setting Log Levels</a></li><ul><li><a href="#loglevel"><code>loglevel</code></a></li><ul><li><a href="#aliases">Aliases</a></li></ul><li><a href="#foreground-scripts"><code>foreground-scripts</code></a></li></ul><li><a href="#registry-response-headers">Registry Response Headers</a></li><ul><li><a href="#npm-notice"><code>npm-notice</code></a></li></ul><li><a href="#see-also">See also</a></li></ul></div>
146+
</section>
147+
148+
<div id="_content"><h3 id="description">Description</h3>
149+
<p>The <code>npm</code> CLI has various mechanisms for showing different levels of information back to end-users for certain commands, configurations &amp; environments.</p>
150+
<h3 id="setting-log-levels">Setting Log Levels</h3>
151+
<h4 id="loglevel"><code>loglevel</code></h4>
152+
<p><code>loglevel</code> is a global argument/config that can be set to determine the type of information to be displayed.</p>
153+
<p>The default value of <code>loglevel</code> is <code>"notice"</code> but there are several levels/types of logs available, including:</p>
154+
<ul>
155+
<li><code>"silent"</code></li>
156+
<li><code>"error"</code></li>
157+
<li><code>"warn"</code></li>
158+
<li><code>"notice"</code></li>
159+
<li><code>"http"</code></li>
160+
<li><code>"timing"</code></li>
161+
<li><code>"info"</code></li>
162+
<li><code>"verbose"</code></li>
163+
<li><code>"silly"</code></li>
164+
</ul>
165+
<p>All logs pertaining to a level proceeding the current setting will be shown.</p>
166+
<p>All logs are written to a debug log, with the path to that file printed if the execution of a command fails.</p>
167+
<h5 id="aliases">Aliases</h5>
168+
<p>The log levels listed above have various corresponding aliases, including:</p>
169+
<ul>
170+
<li><code>-d</code>: <code>--loglevel info</code></li>
171+
<li><code>--dd</code>: <code>--loglevel verbose</code></li>
172+
<li><code>--verbose</code>: <code>--loglevel verbose</code></li>
173+
<li><code>--ddd</code>: <code>--loglevel silly</code></li>
174+
<li><code>-q</code>: <code>--loglevel warn</code></li>
175+
<li><code>--quiet</code>: <code>--loglevel warn</code></li>
176+
<li><code>-s</code>: <code>--loglevel silent</code></li>
177+
<li><code>--silent</code>: <code>--loglevel silent</code></li>
178+
</ul>
179+
<h4 id="foreground-scripts"><code>foreground-scripts</code></h4>
180+
<p>The <code>npm</code> CLI began hiding the output of lifecycle scripts for <code>npm install</code> as of <code>v7</code>. Notably, this means you will not see logs/output from packages that may be using "install scripts" to display information back to you or from your own project's scripts defined in <code>package.json</code>. If you'd like to change this behavior &amp; log this output you can set <code>foreground-scripts</code> to <code>true</code>.</p>
181+
<h3 id="registry-response-headers">Registry Response Headers</h3>
182+
<h4 id="npm-notice"><code>npm-notice</code></h4>
183+
<p>The <code>npm</code> CLI reads from &amp; logs any <code>npm-notice</code> headers that are returned from the configured registry. This mechanism can be used by third-party registries to provide useful information when network-dependent requests occur.</p>
184+
<p>This header is not cached, and will not be logged if the request is served from the cache.</p>
185+
<h3 id="see-also">See also</h3>
186+
<ul>
187+
<li><a href="../using-npm/config.html">config</a></li>
188+
</ul>
189+
</div>
190+
191+
<footer id="edit">
192+
<a href="https://github.com/npm/cli/edit/latest/docs/content/using-npm/logging.md">
193+
<svg role="img" viewBox="0 0 16 16" width="16" height="16" fill="currentcolor" style="vertical-align: text-bottom; margin-right: 0.3em;">
194+
<path fill-rule="evenodd" d="M11.013 1.427a1.75 1.75 0 012.474 0l1.086 1.086a1.75 1.75 0 010 2.474l-8.61 8.61c-.21.21-.47.364-.756.445l-3.251.93a.75.75 0 01-.927-.928l.929-3.25a1.75 1.75 0 01.445-.758l8.61-8.61zm1.414 1.06a.25.25 0 00-.354 0L10.811 3.75l1.439 1.44 1.263-1.263a.25.25 0 000-.354l-1.086-1.086zM11.189 6.25L9.75 4.81l-6.286 6.287a.25.25 0 00-.064.108l-.558 1.953 1.953-.558a.249.249 0 00.108-.064l6.286-6.286z"></path>
195+
</svg>
196+
Edit this page on GitHub
197+
</a>
198+
</footer>
199+
</section>
200+
201+
202+
203+
</body></html>

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ <h4 id="packagejson-vars">package.json vars</h4>
380380
<code>npm_package_version</code> set to "1.2.5". You can access these variables
381381
in your code with <code>process.env.npm_package_name</code> and
382382
<code>process.env.npm_package_version</code>, and so on for other fields.</p>
383-
<p>See <a href="../configuring-npm/package-json.html"><code>package-json.md</code></a> for more on package configs.</p>
383+
<p>See <a href="../configuring-npm/package-json.html"><code>package.json</code></a> for more on package configs.</p>
384384
<h4 id="current-lifecycle-event">current lifecycle event</h4>
385385
<p>Lastly, the <code>npm_lifecycle_event</code> environment variable is set to
386386
whichever stage of the cycle is being executed. So, you could have a

deps/npm/docs/output/using-npm/workspaces.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
<div id="_content"><h3 id="description">Description</h3>
149149
<p><strong>Workspaces</strong> is a generic term that refers to the set of features in the
150150
npm cli that provides support to managing multiple packages from your local
151-
files system from within a singular top-level, root package.</p>
151+
file system from within a singular top-level, root package.</p>
152152
<p>This set of features makes up for a much more streamlined workflow handling
153153
linked packages from the local file system. Automating the linking process
154154
as part of <code>npm install</code> and avoiding manually having to use <code>npm link</code> in

deps/npm/lib/auth/legacy.js

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
const log = require('npmlog')
21
const profile = require('npm-profile')
3-
2+
const log = require('../utils/log-shim')
43
const openUrl = require('../utils/open-url.js')
54
const read = require('../utils/read-user-info.js')
65

76
const loginPrompter = async (creds) => {
8-
const opts = { log: log }
9-
10-
creds.username = await read.username('Username:', creds.username, opts)
7+
creds.username = await read.username('Username:', creds.username)
118
creds.password = await read.password('Password:', creds.password)
12-
creds.email = await read.email('Email: (this IS public) ', creds.email, opts)
9+
creds.email = await read.email('Email: (this IS public) ', creds.email)
1310

1411
return creds
1512
}
@@ -19,7 +16,7 @@ const login = async (npm, opts) => {
1916

2017
const requestOTP = async () => {
2118
const otp = await read.otp(
22-
'Enter one-time password from your authenticator app: '
19+
'Enter one-time password: '
2320
)
2421

2522
return profile.loginCouch(

deps/npm/lib/auth/sso.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77
// CLI, we can remove this, and fold the lib/auth/legacy.js back into
88
// lib/adduser.js
99

10-
const log = require('npmlog')
1110
const profile = require('npm-profile')
1211
const npmFetch = require('npm-registry-fetch')
13-
12+
const log = require('../utils/log-shim')
1413
const openUrl = require('../utils/open-url.js')
1514
const otplease = require('../utils/otplease.js')
1615

0 commit comments

Comments
 (0)