Skip to content

Commit bef9eb6

Browse files
authored
Merge branch 'nodejs:main' into fix-duration-ms
2 parents bc76d98 + beb0520 commit bef9eb6

File tree

243 files changed

+3086
-1479
lines changed

Some content is hidden

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

243 files changed

+3086
-1479
lines changed

AUTHORS

+2
Original file line numberDiff line numberDiff line change
@@ -3512,5 +3512,7 @@ Wing <[email protected]>
35123512
35133513
Jeff Dickey <[email protected]>
35143514
Matías Zúñiga <[email protected]>
3515+
3516+
Brian Evans <[email protected]>
35153517

35163518
# Generated by tools/update-authors.mjs

deps/corepack/CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## [0.14.0](https://github.com/nodejs/corepack/compare/v0.13.0...v0.14.0) (2022-09-02)
4+
5+
6+
### Features
7+
8+
* add `COREPACK_ENABLE_STRICT` env variable ([#167](https://github.com/nodejs/corepack/issues/167)) ([92b52f6](https://github.com/nodejs/corepack/commit/92b52f6b4918aff968c0942b89fc722ebf57bce2))
9+
* update package manager versions ([#170](https://github.com/nodejs/corepack/issues/170)) ([6f70bfc](https://github.com/nodejs/corepack/commit/6f70bfc4b6a8a57cccb1ff9cbf2f49240648f1ed))
10+
11+
12+
### Bug Fixes
13+
14+
* handle tags including numbers in `prepare` command ([#165](https://github.com/nodejs/corepack/issues/165)) ([5a0727b](https://github.com/nodejs/corepack/commit/5a0727b43976e0dc299151876c0dde2c4a85174d))
15+
316
## [0.13.0](https://github.com/nodejs/corepack/compare/v0.12.3...v0.13.0) (2022-08-19)
417

518

deps/corepack/README.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,18 @@ This command will retrieve the given package manager from the specified archive
111111

112112
## Environment Variables
113113

114-
- `COREPACK_ENABLE_NETWORK` can be set to `0` to prevent Corepack from accessing the network (in which case you'll be responsible for hydrating the package manager versions that will be required for the projects you'll run, using `corepack hydrate`).
115-
116114
- `COREPACK_DEFAULT_TO_LATEST` can be set to `0` in order to instruct Corepack
117115
not to lookup on the remote registry for the latest version of the selected
118116
package manager.
119117

118+
- `COREPACK_ENABLE_NETWORK` can be set to `0` to prevent Corepack from accessing
119+
the network (in which case you'll be responsible for hydrating the package
120+
manager versions that will be required for the projects you'll run, using
121+
`corepack hydrate`).
122+
123+
- `COREPACK_ENABLE_STRICT` can be set to `0` to prevent Corepack from checking
124+
if the package manager corresponds to the one defined for the current project.
125+
120126
- `COREPACK_HOME` can be set in order to define where Corepack should install
121127
the package managers. By default it is set to `%LOCALAPPDATA%\node\corepack`
122128
on Windows, and to `$HOME/.cache/node/corepack` everywhere else.

deps/corepack/dist/corepack.js

+59-36
Large diffs are not rendered by default.

deps/corepack/dist/vendors-_yarn_berry_cache_proxy-agent-npm-5_0_0-41772f4b01-9_zip_node_modules_proxy-agent_index_js.js

+24-24
Large diffs are not rendered by default.

deps/corepack/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "corepack",
3-
"version": "0.13.0",
3+
"version": "0.14.0",
44
"homepage": "https://github.com/nodejs/corepack#readme",
55
"bugs": {
66
"url": "https://github.com/nodejs/corepack/issues"
@@ -10,13 +10,13 @@
1010
"url": "https://github.com/nodejs/corepack.git"
1111
},
1212
"license": "MIT",
13-
"packageManager": "[email protected].14+sha224.d3bee29dce07417588d640327d44f1e0b8182c240bc2beb0b81ccf6e",
13+
"packageManager": "[email protected].15+sha224.7fa5c1d1875b041cea8fcbf9a364667e398825364bf5c5c8cd5f6601",
1414
"devDependencies": {
1515
"@babel/core": "^7.14.3",
1616
"@babel/plugin-transform-modules-commonjs": "^7.14.0",
1717
"@babel/preset-typescript": "^7.13.0",
1818
"@types/debug": "^4.1.5",
19-
"@types/jest": "^28.0.0",
19+
"@types/jest": "^29.0.0",
2020
"@types/node": "^18.0.0",
2121
"@types/semver": "^7.1.0",
2222
"@types/tar": "^6.0.0",
@@ -31,7 +31,7 @@
3131
"debug": "^4.1.1",
3232
"eslint": "^8.0.0",
3333
"eslint-plugin-arca": "^0.15.0",
34-
"jest": "^28.0.0",
34+
"jest": "^29.0.0",
3535
"nock": "^13.0.4",
3636
"proxy-agent": "^5.0.0",
3737
"semver": "^7.1.3",

deps/npm/docs/content/commands/npm-access.md

+6-7
Original file line numberDiff line numberDiff line change
@@ -35,29 +35,28 @@ For all of the subcommands, `npm access` will perform actions on the packages
3535
in the current working directory if no package name is passed to the
3636
subcommand.
3737
38-
* public / restricted:
38+
* public / restricted (deprecated):
3939
Set a package to be either publicly accessible or restricted.
4040
41-
* grant / revoke:
41+
* grant / revoke (deprecated):
4242
Add or remove the ability of users and teams to have read-only or read-write
4343
access to a package.
4444
45-
* 2fa-required / 2fa-not-required:
45+
* 2fa-required / 2fa-not-required (deprecated):
4646
Configure whether a package requires that anyone publishing it have two-factor
4747
authentication enabled on their account.
4848
49-
* ls-packages:
49+
* ls-packages (deprecated):
5050
Show all of the packages a user or a team is able to access, along with the
5151
access level, except for read-only public packages (it won't print the whole
5252
registry listing)
5353
54-
* ls-collaborators:
54+
* ls-collaborators (deprecated):
5555
Show all of the access privileges for a package. Will only show permissions
5656
for packages to which you have at least read access. If `<user>` is passed in,
5757
the list is filtered only to teams _that_ user happens to belong to.
5858
59-
* edit:
60-
Set the access privileges for a package at once using `$EDITOR`.
59+
* edit (not implemented)
6160
6261
### Details
6362

deps/npm/docs/content/commands/npm-query.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,4 +232,4 @@ This value is not exported to the environment for child processes.
232232
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
233233
## See Also
234234

235-
* [dependency selector](/using-npm/dependency-selector)
235+
* [dependency selectors](/using-npm/dependency-selectors)

deps/npm/docs/content/configuring-npm/npmrc.md

+28
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,34 @@ consistent across updates. Set fields in here using the `./configure`
9191
script that comes with npm. This is primarily for distribution maintainers
9292
to override default configs in a standard and consistent manner.
9393

94+
### Auth related configuration
95+
96+
The settings `_auth`, `_authToken`, `username` and `_password` must all be
97+
scoped to a specific registry. This ensures that `npm` will never send
98+
credentials to the wrong host.
99+
100+
In order to scope these values, they must be prefixed by a URI fragment.
101+
If the credential is meant for any request to a registry on a single host,
102+
the scope may look like `//registry.npmjs.org/:`. If it must be scoped to a
103+
specific path on the host that path may also be provided, such as
104+
`//my-custom-registry.org/unique/path:`.
105+
106+
```
107+
; bad config
108+
_authToken=MYTOKEN
109+
110+
; good config
111+
@myorg:registry=https://somewhere-else.com/myorg
112+
@another:registry=https://somewhere-else.com/another
113+
//registry.npmjs.org/:_authToken=MYTOKEN
114+
; would apply to both @myorg and @another
115+
; //somewhere-else.com/:_authToken=MYTOKEN
116+
; would apply only to @myorg
117+
//somewhere-else.com/myorg/:_authToken=MYTOKEN1
118+
; would apply only to @another
119+
//somewhere-else.com/another/:_authToken=MYTOKEN2
120+
```
121+
94122
### See also
95123

96124
* [npm folders](/configuring-npm/folders)

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ const arb = new Arborist({})
144144

145145
```js
146146
// root-level
147-
arb.loadActual((tree) => {
147+
arb.loadActual().then(async (tree) => {
148148
// query all production dependencies
149149
const results = await tree.querySelectorAll('.prod')
150150
console.log(results)
@@ -153,7 +153,7 @@ arb.loadActual((tree) => {
153153

154154
```js
155155
// iterative
156-
arb.loadActual((tree) => {
156+
arb.loadActual().then(async (tree) => {
157157
// query for the deduped version of react
158158
const results = await tree.querySelectorAll('#react:not(:deduped)')
159159
// query the deduped react for git deps

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

+6-7
Original file line numberDiff line numberDiff line change
@@ -169,34 +169,33 @@ <h3 id="description">Description</h3>
169169
subcommand.</p>
170170
<ul>
171171
<li>
172-
<p>public / restricted:
172+
<p>public / restricted (deprecated):
173173
Set a package to be either publicly accessible or restricted.</p>
174174
</li>
175175
<li>
176-
<p>grant / revoke:
176+
<p>grant / revoke (deprecated):
177177
Add or remove the ability of users and teams to have read-only or read-write
178178
access to a package.</p>
179179
</li>
180180
<li>
181-
<p>2fa-required / 2fa-not-required:
181+
<p>2fa-required / 2fa-not-required (deprecated):
182182
Configure whether a package requires that anyone publishing it have two-factor
183183
authentication enabled on their account.</p>
184184
</li>
185185
<li>
186-
<p>ls-packages:
186+
<p>ls-packages (deprecated):
187187
Show all of the packages a user or a team is able to access, along with the
188188
access level, except for read-only public packages (it won't print the whole
189189
registry listing)</p>
190190
</li>
191191
<li>
192-
<p>ls-collaborators:
192+
<p>ls-collaborators (deprecated):
193193
Show all of the access privileges for a package. Will only show permissions
194194
for packages to which you have at least read access. If <code>&lt;user&gt;</code> is passed in,
195195
the list is filtered only to teams <em>that</em> user happens to belong to.</p>
196196
</li>
197197
<li>
198-
<p>edit:
199-
Set the access privileges for a package at once using <code>$EDITOR</code>.</p>
198+
<p>edit (not implemented)</p>
200199
</li>
201200
</ul>
202201
<h3 id="details">Details</h3>

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

+1-1
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.18.0 /path/to/npm
169+
<pre lang="bash"><code>npm@8.19.1 /path/to/npm
170170
171171
172172
</code></pre>

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ <h4 id="include-workspace-root"><code>include-workspace-root</code></h4>
344344
<!-- raw HTML omitted -->
345345
<h2 id="see-also">See Also</h2>
346346
<ul>
347-
<li><a href="../using-npm/dependency-selector.html">dependency selector</a></li>
347+
<li><a href="../using-npm/dependency-selectors.html">dependency selectors</a></li>
348348
</ul>
349349
</div>
350350

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
<!-- raw HTML omitted -->
150150
<!-- raw HTML omitted -->
151151
<h3 id="version">Version</h3>
152-
<p>8.18.0</p>
152+
<p>8.19.1</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/configuring-npm/npmrc.html

+24-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ <h1 id="npmrc">npmrc</h1>
142142

143143
<section id="table_of_contents">
144144
<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="#files">Files</a></li><ul><li><a href="#comments">Comments</a></li><li><a href="#per-project-config-file">Per-project config file</a></li><li><a href="#per-user-config-file">Per-user config file</a></li><li><a href="#global-config-file">Global config file</a></li><li><a href="#built-in-config-file">Built-in config file</a></li></ul><li><a href="#see-also">See also</a></li></ul></div>
145+
<div id="_table_of_contents"><ul><li><a href="#description">Description</a></li><li><a href="#files">Files</a></li><ul><li><a href="#comments">Comments</a></li><li><a href="#per-project-config-file">Per-project config file</a></li><li><a href="#per-user-config-file">Per-user config file</a></li><li><a href="#global-config-file">Global config file</a></li><li><a href="#built-in-config-file">Built-in config file</a></li></ul><li><a href="#auth-related-configuration">Auth related configuration</a></li><li><a href="#see-also">See also</a></li></ul></div>
146146
</section>
147147

148148
<div id="_content"><h3 id="description">Description</h3>
@@ -204,6 +204,29 @@ <h4 id="built-in-config-file">Built-in config file</h4>
204204
consistent across updates. Set fields in here using the <code>./configure</code>
205205
script that comes with npm. This is primarily for distribution maintainers
206206
to override default configs in a standard and consistent manner.</p>
207+
<h3 id="auth-related-configuration">Auth related configuration</h3>
208+
<p>The settings <code>_auth</code>, <code>_authToken</code>, <code>username</code> and <code>_password</code> must all be
209+
scoped to a specific registry. This ensures that <code>npm</code> will never send
210+
credentials to the wrong host.</p>
211+
<p>In order to scope these values, they must be prefixed by a URI fragment.
212+
If the credential is meant for any request to a registry on a single host,
213+
the scope may look like <code>//registry.npmjs.org/:</code>. If it must be scoped to a
214+
specific path on the host that path may also be provided, such as
215+
<code>//my-custom-registry.org/unique/path:</code>.</p>
216+
<pre><code>; bad config
217+
_authToken=MYTOKEN
218+
219+
; good config
220+
@myorg:registry=https://somewhere-else.com/myorg
221+
@another:registry=https://somewhere-else.com/another
222+
//registry.npmjs.org/:_authToken=MYTOKEN
223+
; would apply to both @myorg and @another
224+
; //somewhere-else.com/:_authToken=MYTOKEN
225+
; would apply only to @myorg
226+
//somewhere-else.com/myorg/:_authToken=MYTOKEN1
227+
; would apply only to @another
228+
//somewhere-else.com/another/:_authToken=MYTOKEN2
229+
</code></pre>
207230
<h3 id="see-also">See also</h3>
208231
<ul>
209232
<li><a href="../configuring-npm/folders.html">npm folders</a></li>

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -264,14 +264,14 @@ <h3 id="programmatic-usage">Programmatic Usage</h3>
264264
const arb = new Arborist({})
265265
</code></pre>
266266
<pre lang="js"><code>// root-level
267-
arb.loadActual((tree) =&gt; {
267+
arb.loadActual().then(async (tree) =&gt; {
268268
// query all production dependencies
269269
const results = await tree.querySelectorAll('.prod')
270270
console.log(results)
271271
})
272272
</code></pre>
273273
<pre lang="js"><code>// iterative
274-
arb.loadActual((tree) =&gt; {
274+
arb.loadActual().then(async (tree) =&gt; {
275275
// query for the deduped version of react
276276
const results = await tree.querySelectorAll('#react:not(:deduped)')
277277
// query the deduped react for git deps

deps/npm/lib/commands/access.js

+15-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const readPackageJson = require('read-package-json-fast')
55

66
const otplease = require('../utils/otplease.js')
77
const getIdentity = require('../utils/get-identity.js')
8+
const log = require('../utils/log-shim.js')
89
const BaseCommand = require('../base-command.js')
910

1011
const subcommands = [
@@ -19,6 +20,15 @@ const subcommands = [
1920
'2fa-not-required',
2021
]
2122

23+
const deprecated = [
24+
'2fa-not-required',
25+
'2fa-required',
26+
'ls-collaborators',
27+
'ls-packages',
28+
'public',
29+
'restricted',
30+
]
31+
2232
class Access extends BaseCommand {
2333
static description = 'Set access level on published packages'
2434
static name = 'access'
@@ -78,6 +88,10 @@ class Access extends BaseCommand {
7888
throw this.usageError(`${cmd} is not a recognized subcommand.`)
7989
}
8090

91+
if (deprecated.includes(cmd)) {
92+
log.warn('access', `${cmd} subcommand will be removed in the next version of npm`)
93+
}
94+
8195
return this[cmd](args, {
8296
...this.npm.flatOptions,
8397
})
@@ -175,7 +189,7 @@ class Access extends BaseCommand {
175189
}
176190

177191
async edit () {
178-
throw new Error('edit subcommand is not implemented yet')
192+
throw new Error('edit subcommand is not implemented')
179193
}
180194

181195
modifyPackage (pkg, opts, fn, requireScope = true) {

deps/npm/lib/commands/audit.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,12 @@ class VerifySignatures {
178178
let name = edge.name
179179
try {
180180
name = npa(edge.spec).subSpec.name
181-
} catch (_) {
181+
} catch {
182+
// leave it as edge.name
182183
}
183184
try {
184185
return npa(`${name}@${edge.spec}`)
185-
} catch (_) {
186+
} catch {
186187
// Skip packages with invalid spec
187188
}
188189
}

deps/npm/lib/commands/edit.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,16 @@ class Edit extends BaseCommand {
5858
}
5959
const [bin, ...args] = this.npm.config.get('editor').split(/\s+/)
6060
const editor = cp.spawn(bin, [...args, dir], { stdio: 'inherit' })
61-
editor.on('exit', (code) => {
61+
editor.on('exit', async (code) => {
6262
if (code) {
6363
return reject(new Error(`editor process exited with code: ${code}`))
6464
}
65-
this.npm.exec('rebuild', [dir]).catch(reject).then(resolve)
65+
try {
66+
await this.npm.exec('rebuild', [dir])
67+
} catch (err) {
68+
reject(err)
69+
}
70+
resolve()
6671
})
6772
})
6873
})

0 commit comments

Comments
 (0)