Skip to content

Commit 4551d14

Browse files
ruyadornotargos
authored andcommitted
deps: upgrade npm to 7.5.1
PR-URL: #37177 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
1 parent a26dfb3 commit 4551d14

Some content is hidden

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

104 files changed

+1027
-198
lines changed

deps/npm/AUTHORS

+2
Original file line numberDiff line numberDiff line change
@@ -748,3 +748,5 @@ Jeff Griffiths <jeff@eko-recordings.ca>
748748
Michael Garvin <gar+gh@danger.computer>
749749
Gar <gar+gh@danger.computer>
750750
dr-js <dr@dr.run>
751+
Pavan Bellamkonda <31280326+pavanbellamkonda@users.noreply.github.com>
752+
Alexander Riccio <test35965@gmail.com>

deps/npm/CHANGELOG.md

+42
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
1+
## v7.5.1 (2021-02-01
2+
3+
### BUG FIXES
4+
5+
* [`0ea134e41`](https://github.com/npm/cli/commit/0ea134e4190f322138299c51672eab5387ec41bb)
6+
[#2587](https://github.com/npm/cli/issues/2587)
7+
pass all settings through to pacote.packument, fixes #2060
8+
([@nlf](https://github.com/nlf))
9+
* [`8c5ca2f51`](https://github.com/npm/cli/commit/8c5ca2f516f5ac87f3bbd7f1fd95c0b283a21f14)
10+
Add test for npm-usage.js, and fix 'npm --long' output
11+
([@isaacs](https://github.com/isaacs))
12+
13+
### DEPENDENCIES
14+
15+
* [`7e4e88e93`](https://github.com/npm/cli/commit/7e4e88e938323e34a2a41176472d8e43e84bd4dd)
16+
`@npmcli/arborist@2.1.1`, `pacote@11.2.4`
17+
* Properly raise ERESOLVE errors on root dev dependencies
18+
* Ignore ERESOLVE errors when performing git dep 'prepare' scripts
19+
* Always reinstall packages that are explicitly requested
20+
* fix global update all so it actually updates things
21+
* Install bins properly when global root is a link
22+
([@isaacs](https://github.com/isaacs))
23+
24+
### DOCUMENTATION
25+
26+
* [`23dac2fef`](https://github.com/npm/cli/commit/23dac2feff1d02193791c7e39d9e93bc9bf8e624)
27+
[#2557](https://github.com/npm/cli/issues/2557)
28+
npm team revamp
29+
([@ruyadorno](https://github.com/ruyadorno))
30+
* [`dd05ba0c0`](https://github.com/npm/cli/commit/dd05ba0c0b2f4c70eb8558c0ecc54889efbe98f5)
31+
[#2572](https://github.com/npm/cli/issues/2572)
32+
add note about `--force` overriding peer dependencies
33+
([@isaacs](https://github.com/isaacs))
34+
* [`e27639780`](https://github.com/npm/cli/commit/e276397809aceb01cc468e02a83bc6f2265376d9)
35+
[#2584](https://github.com/npm/cli/issues/2584)
36+
Fixed the spelling of contributor as it was written as conributor
37+
([@pavanbellamkonda](https://github.com/pavanbellamkonda))
38+
* [`13a5e3178`](https://github.com/npm/cli/commit/13a5e31781cdaa37d3f007e1c8583c7cb591c62a)
39+
[#2502](https://github.com/npm/cli/issues/2502)
40+
elaborate that npm help uses browser
41+
([@ariccio](https://github.com/ariccio))
42+
143
## v7.5.0 (2021-01-28)
244

345
### FEATURES

deps/npm/CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ $ cd ./npm && npm install
2929
$ npm run test
3030
```
3131

32-
**5. Open a [Pull Request](https://github.com/npm/cli/pulls) for your work & become the newest conributor to `npm`! 🎉**
32+
**5. Open a [Pull Request](https://github.com/npm/cli/pulls) for your work & become the newest contributor to `npm`! 🎉**
3333

3434
## Test Coverage
3535

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

+56-12
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ npm team add <scope:team> <user>
1414
npm team rm <scope:team> <user>
1515

1616
npm team ls <scope>|<scope:team>
17-
18-
npm team edit <scope:team>
1917
```
2018

2119
### Description
@@ -24,31 +22,76 @@ Used to manage teams in organizations, and change team memberships. Does not
2422
handle permissions for packages.
2523

2624
Teams must always be fully qualified with the organization/scope they belong to
27-
when operating on them, separated by a colon (`:`). That is, if you have a `wombats` team in a `wisdom` organization, you must always refer to that team as `wisdom:wombats` in these commands.
25+
when operating on them, separated by a colon (`:`). That is, if you have a
26+
`newteam` team in an `org` organization, you must always refer to that team
27+
as `@org:newteam` in these commands.
2828

29-
If you have two-factor authentication enabled in `auth-and-writes` mode, then you can provide a code from your authenticator with `[--otp <otpcode>]`. If you don't include this then you will be prompted.
29+
If you have two-factor authentication enabled in `auth-and-writes` mode, then
30+
you can provide a code from your authenticator with `[--otp <otpcode>]`.
31+
If you don't include this then you will be prompted.
3032

3133
* create / destroy:
32-
Create a new team, or destroy an existing one. Note: You cannot remove the `developers` team, <a href="https://docs.npmjs.com/about-developers-team" target="_blank">learn more.</a>
33-
* add / rm:
34-
Add a user to an existing team, or remove a user from a team they belong to.
34+
Create a new team, or destroy an existing one. Note: You cannot remove the
35+
`developers` team, <a href="https://docs.npmjs.com/about-developers-team" target="_blank">learn more.</a>
36+
37+
Here's how to create a new team `newteam` under the `org` org:
38+
39+
```bash
40+
npm team create @org:newteam
41+
```
42+
43+
You should see a confirming message such as: `+@org:newteam` once the new
44+
team has been created.
45+
46+
* add:
47+
Add a user to an existing team.
48+
49+
Adding a new user `username` to a team named `newteam` under the `org` org:
50+
51+
```bash
52+
npm team add @org:newteam username
53+
```
54+
55+
On success, you should see a message: `username added to @org:newteam`
56+
57+
* rm:
58+
Using `npm team rm` you can also remove users from a team they belong to.
59+
60+
Here's an example removing user `username` from `newteam` team
61+
in `org` organization:
62+
63+
```bash
64+
npm team rm @org:newteam username
65+
```
66+
67+
Once the user is removed a confirmation message is displayed:
68+
`username removed from @org:newteam`
3569

3670
* ls:
3771
If performed on an organization name, will return a list of existing teams
3872
under that organization. If performed on a team, it will instead return a list
3973
of all users belonging to that particular team.
4074

41-
* edit:
42-
Edit a current team.
75+
Here's an example of how to list all teams from an org named `org`:
76+
77+
```bash
78+
npm team ls @org
79+
```
80+
81+
Example listing all members of a team named `newteam`:
82+
83+
```bash
84+
npm team ls @org:newteam
85+
```
4386

4487
### Details
4588

4689
`npm team` always operates directly on the current registry, configurable from
4790
the command line using `--registry=<registry url>`.
4891

49-
In order to create teams and manage team membership, you must be a *team admin*
50-
under the given organization. Listing teams and team memberships may be done by
51-
any member of the organizations.
92+
You must be a *team admin* to create teams and manage team membership, under
93+
the given organization. Listing teams and team memberships may be done by
94+
any member of the organization.
5295

5396
Organization creation and management of team admins and *organization* members
5497
is done through the website, not the npm CLI.
@@ -59,4 +102,5 @@ use the `npm access` command to grant or revoke the appropriate permissions.
59102
### See Also
60103

61104
* [npm access](/commands/npm-access)
105+
* [npm config](/commands/npm-config)
62106
* [npm registry](/using-npm/registry)

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

+1
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@ mistakes, unnecessary performance degradation, and malicious input.
472472
range (including SemVer-major changes).
473473
* Allow a module to be installed as a direct dependency of itself.
474474
* Allow unpublishing all versions of a published package.
475+
* Allow conflicting peerDependencies to be installed in the root project.
475476

476477
If you don't have a clear idea of what you want to do, it is strongly
477478
recommended that you do not use this option!

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>npm@7.5.0 /path/to/npm
162+
<pre lang="bash"><code>npm@7.5.1 /path/to/npm
163163
└─┬ init-package-json@0.0.4
164164
└── promzard@0.1.5
165165
</code></pre>

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

+39-14
Original file line numberDiff line numberDiff line change
@@ -152,48 +152,73 @@ <h2 id="table-of-contents">Table of contents</h2>
152152
npm team rm &lt;scope:team&gt; &lt;user&gt;
153153

154154
npm team ls &lt;scope&gt;|&lt;scope:team&gt;
155-
156-
npm team edit &lt;scope:team&gt;
157155
</code></pre>
158156
<h3 id="description">Description</h3>
159157
<p>Used to manage teams in organizations, and change team memberships. Does not
160158
handle permissions for packages.</p>
161159
<p>Teams must always be fully qualified with the organization/scope they belong to
162-
when operating on them, separated by a colon (<code>:</code>). That is, if you have a <code>wombats</code> team in a <code>wisdom</code> organization, you must always refer to that team as <code>wisdom:wombats</code> in these commands.</p>
163-
<p>If you have two-factor authentication enabled in <code>auth-and-writes</code> mode, then you can provide a code from your authenticator with <code>[--otp &lt;otpcode&gt;]</code>. If you don’t include this then you will be prompted.</p>
160+
when operating on them, separated by a colon (<code>:</code>). That is, if you have a
161+
<code>newteam</code> team in an <code>org</code> organization, you must always refer to that team
162+
as <code>@org:newteam</code> in these commands.</p>
163+
<p>If you have two-factor authentication enabled in <code>auth-and-writes</code> mode, then
164+
you can provide a code from your authenticator with <code>[--otp &lt;otpcode&gt;]</code>.
165+
If you don’t include this then you will be prompted.</p>
164166
<ul>
165167
<li>
166168
<p>create / destroy:
167-
Create a new team, or destroy an existing one. Note: You cannot remove the <code>developers</code> team, <!-- raw HTML omitted -->learn more.<!-- raw HTML omitted --></p>
169+
Create a new team, or destroy an existing one. Note: You cannot remove the
170+
<code>developers</code> team, <!-- raw HTML omitted -->learn more.<!-- raw HTML omitted --></p>
171+
<p>Here’s how to create a new team <code>newteam</code> under the <code>org</code> org:</p>
172+
<pre lang="bash"><code>npm team create @org:newteam
173+
</code></pre>
174+
<p>You should see a confirming message such as: <code>+@org:newteam</code> once the new
175+
team has been created.</p>
176+
</li>
177+
<li>
178+
<p>add:
179+
Add a user to an existing team.</p>
180+
<p>Adding a new user <code>username</code> to a team named <code>newteam</code> under the <code>org</code> org:</p>
181+
<pre lang="bash"><code>npm team add @org:newteam username
182+
</code></pre>
183+
<p>On success, you should see a message: <code>username added to @org:newteam</code></p>
168184
</li>
169185
<li>
170-
<p>add / rm:
171-
Add a user to an existing team, or remove a user from a team they belong to.</p>
186+
<p>rm:
187+
Using <code>npm team rm</code> you can also remove users from a team they belong to.</p>
188+
<p>Here’s an example removing user <code>username</code> from <code>newteam</code> team
189+
in <code>org</code> organization:</p>
190+
<pre lang="bash"><code>npm team rm @org:newteam username
191+
</code></pre>
192+
<p>Once the user is removed a confirmation message is displayed:
193+
<code>username removed from @org:newteam</code></p>
172194
</li>
173195
<li>
174196
<p>ls:
175197
If performed on an organization name, will return a list of existing teams
176198
under that organization. If performed on a team, it will instead return a list
177199
of all users belonging to that particular team.</p>
178-
</li>
179-
<li>
180-
<p>edit:
181-
Edit a current team.</p>
200+
<p>Here’s an example of how to list all teams from an org named <code>org</code>:</p>
201+
<pre lang="bash"><code>npm team ls @org
202+
</code></pre>
203+
<p>Example listing all members of a team named <code>newteam</code>:</p>
204+
<pre lang="bash"><code>npm team ls @org:newteam
205+
</code></pre>
182206
</li>
183207
</ul>
184208
<h3 id="details">Details</h3>
185209
<p><code>npm team</code> always operates directly on the current registry, configurable from
186210
the command line using <code>--registry=&lt;registry url&gt;</code>.</p>
187-
<p>In order to create teams and manage team membership, you must be a <em>team admin</em>
188-
under the given organization. Listing teams and team memberships may be done by
189-
any member of the organizations.</p>
211+
<p>You must be a <em>team admin</em> to create teams and manage team membership, under
212+
the given organization. Listing teams and team memberships may be done by
213+
any member of the organization.</p>
190214
<p>Organization creation and management of team admins and <em>organization</em> members
191215
is done through the website, not the npm CLI.</p>
192216
<p>To use teams to manage permissions on packages belonging to your organization,
193217
use the <code>npm access</code> command to grant or revoke the appropriate permissions.</p>
194218
<h3 id="see-also">See Also</h3>
195219
<ul>
196220
<li><a href="../commands/npm-access.html">npm access</a></li>
221+
<li><a href="../commands/npm-config.html">npm config</a></li>
197222
<li><a href="../using-npm/registry.html">npm registry</a></li>
198223
</ul>
199224
</div>

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.5.0</p>
151+
<p>7.5.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/config.html

+1
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,7 @@ <h4 id="force">force</h4>
534534
range (including SemVer-major changes).</li>
535535
<li>Allow a module to be installed as a direct dependency of itself.</li>
536536
<li>Allow unpublishing all versions of a published package.</li>
537+
<li>Allow conflicting peerDependencies to be installed in the root project.</li>
537538
</ul>
538539
<p>If you don’t have a clear idea of what you want to do, it is strongly
539540
recommended that you do not use this option!</p>

deps/npm/lib/access.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const output = require('./utils/output.js')
88
const otplease = require('./utils/otplease.js')
99
const usageUtil = require('./utils/usage.js')
1010
const getIdentity = require('./utils/get-identity.js')
11-
const { prefix } = npm
1211

1312
const usage = usageUtil(
1413
'npm access',
@@ -165,7 +164,7 @@ const getPackage = async (name, requireScope) => {
165164
return name.trim()
166165
else {
167166
try {
168-
const pkg = await readPackageJson(path.resolve(prefix, 'package.json'))
167+
const pkg = await readPackageJson(path.resolve(npm.prefix, 'package.json'))
169168
name = pkg.name
170169
} catch (err) {
171170
if (err.code === 'ENOENT') {

deps/npm/lib/ci.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ const Arborist = require('@npmcli/arborist')
33
const rimraf = util.promisify(require('rimraf'))
44
const reifyFinish = require('./utils/reify-finish.js')
55
const runScript = require('@npmcli/run-script')
6+
const fs = require('fs')
7+
const readdir = util.promisify(fs.readdir)
68

79
const log = require('npmlog')
810
const npm = require('./npm.js')
@@ -13,6 +15,16 @@ const completion = require('./utils/completion/none.js')
1315

1416
const cmd = (args, cb) => ci().then(() => cb()).catch(cb)
1517

18+
const removeNodeModules = async where => {
19+
const rimrafOpts = { glob: false }
20+
process.emit('time', 'npm-ci:rm')
21+
const path = `${where}/node_modules`
22+
// get the list of entries so we can skip the glob for performance
23+
const entries = await readdir(path, null).catch(er => [])
24+
await Promise.all(entries.map(f => rimraf(`${path}/${f}`, rimrafOpts)))
25+
process.emit('timeEnd', 'npm-ci:rm')
26+
}
27+
1628
const ci = async () => {
1729
if (npm.flatOptions.global) {
1830
const err = new Error('`npm ci` does not work for global packages')
@@ -33,7 +45,7 @@ const ci = async () => {
3345
'later to generate a package-lock.json file, then try again.'
3446
throw new Error(msg)
3547
}),
36-
rimraf(`${where}/node_modules/*`, { glob: { dot: true, nosort: true, silent: true } }),
48+
removeNodeModules(where),
3749
])
3850
// npm ci should never modify the lockfile or package.json
3951
await arb.reify({ ...npm.flatOptions, save: false })

deps/npm/lib/help-search.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,11 @@ const searchFiles = async (args, data, files) => {
135135

136136
// coverage is ignored here because the contents of results are
137137
// nondeterministic due to either glob or readFiles or Object.entries
138-
return results.sort((a, b) =>
138+
return results.sort(/* istanbul ignore next */ (a, b) =>
139139
a.found.length > b.found.length ? -1
140140
: a.found.length < b.found.length ? 1
141141
: a.totalHits > b.totalHits ? -1
142142
: a.totalHits < b.totalHits ? 1
143-
/* istanbul ignore next */
144143
: a.lines.length > b.lines.length ? -1
145144
: a.lines.length < b.lines.length ? 1
146145
: 0).slice(0, 10)

deps/npm/lib/outdated.js

+1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ async function outdated_ (tree, deps, opts) {
108108

109109
async function getPackument (spec) {
110110
const packument = await pacote.packument(spec, {
111+
...npm.flatOptions,
111112
fullMetadata: npm.flatOptions.long,
112113
preferOnline: true,
113114
})

deps/npm/lib/utils/ansi-trim.js

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
function ansiTrim (str) {
2-
var r = new RegExp('\x1b(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|' +
3-
'\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)', 'g')
4-
return str.replace(r, '')
5-
}
6-
7-
module.exports = ansiTrim
1+
const r = new RegExp('\x1b(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|' +
2+
'\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)', 'g')
3+
module.exports = str => str.replace(r, '')

0 commit comments

Comments
 (0)