Skip to content

Commit f3d6700

Browse files
ruyadornotargos
authored andcommitted
deps: upgrade npm to 7.6.0
PR-URL: #37559 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
1 parent 725d48a commit f3d6700

File tree

187 files changed

+819
-1812
lines changed

Some content is hidden

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

187 files changed

+819
-1812
lines changed

deps/npm/.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ node_modules/npm-registry-mock
1616

1717
# don't need these in the npm package.
1818
html/*.png
19+
docs/nav.yml
1920

2021
# don't ignore .npmignore files
2122
# these are used in some tests.

deps/npm/AUTHORS

+2
Original file line numberDiff line numberDiff line change
@@ -753,3 +753,5 @@ Alexander Riccio <test35965@gmail.com>
753753
RA80533 <32469082+RA80533@users.noreply.github.com>
754754
Ikko Ashimine <eltociear@gmail.com>
755755
MrBrain295 <66077254+MrBrain295@users.noreply.github.com>
756+
kumavis <aaron@kumavis.me>
757+
Christof Lemke <christoflemke@github.com>

deps/npm/CHANGELOG.md

+34-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,37 @@
1-
## v7.5.6 (2021-02-22
1+
## v7.6.0 (2021-02-25)
2+
3+
### FEATURES
4+
5+
* [`983d218f7`](https://github.com/npm/cli/commit/983d218f7e68e3c7866f2efa23ea2aff7ff3881e)
6+
[#2750](https://github.com/npm/cli/issues/2750)
7+
feat(explain): mark when dependency is bundled
8+
([@kumavis](https://github.com/kumavis))
9+
10+
### DEPENDENCIES
11+
12+
* [`b9fa7e32a`](https://github.com/npm/cli/commit/b9fa7e32a63a3dc3a4865865c4ca737c862b9cf2)
13+
chore(package-lock): resetdeps and `eslint@7.20.0`
14+
([@wraithgar](https://github.com/wraithgar))
15+
* [`28d036ae9`](https://github.com/npm/cli/commit/28d036ae9179f742bd0518e558a54f014a7a895e)
16+
`arborist@2.2.5`
17+
* fix: hidden lockfiles were not respected on Node v10.0-10.12
18+
19+
### DOCUMENTATION
20+
21+
* [`ba1adef42`](https://github.com/npm/cli/commit/ba1adef4292123e87e26b59e0c6fd6f5ff1fe775)
22+
[#2760](https://github.com/npm/cli/issues/2760)
23+
chore(docs): capitalize all Instaces of "package"
24+
([@MrBrain295](https://github.com/MrBrain295))
25+
* [`8bfa05fa1`](https://github.com/npm/cli/commit/8bfa05fa1dfd4a64381c7ec750df6d174724e8c1)
26+
[#2775](https://github.com/npm/cli/issues/2775)
27+
chore(docs): add navigation configuration
28+
([@ethomson](https://github.com/ethomson))
29+
* [`238e474a4`](https://github.com/npm/cli/commit/238e474a48ddecc33c76eb3d2c4d0642cfe8829a)
30+
[#2778](https://github.com/npm/cli/issues/2778)
31+
chore(docs):update unpublish cooldown
32+
([@christoflemke](https://github.com/christoflemke))
33+
34+
## v7.5.6 (2021-02-22)
235

336
### BUG FIXES
437

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ versions then the registry will remove the root package entry entirely.
4242
Even if you unpublish a package version, that specific name and version
4343
combination can never be reused. In order to publish the package again,
4444
you must use a new version number. If you unpublish the entire package,
45-
you may not publish any new versions of that package until 24 hours have
45+
you may not publish any new versions of that package until 28 days have
4646
passed.
4747

4848
### See Also

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ You can use `npm init` in the root of your package in order to get you
9393
started with a pretty basic package.json file. See [`npm
9494
init`](/commands/npm-init) for more info.
9595

96-
### Keeping files *out* of your package
96+
### Keeping files *out* of your Package
9797

9898
Use a `.npmignore` file to keep stuff out of your package. If there's no
9999
`.npmignore` file, but there *is* a `.gitignore` file, then npm will ignore
@@ -210,7 +210,7 @@ and then follow the prompts.
210210

211211
This is documented better in [npm adduser](/commands/npm-adduser).
212212

213-
### Publish your package
213+
### Publish your Package
214214

215215
This part's easy. In the root of your folder, do this:
216216

deps/npm/docs/dockhand.js

+91-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ const template = fs.readFileSync('template.html').toString();
1919

2020
const run = async function() {
2121
try {
22-
await walk(inputRoot);
22+
const navPaths = await getNavigationPaths();
23+
const fsPaths = await renderFilesystemPaths();
24+
25+
if (!ensureNavigationComplete(navPaths, fsPaths)) {
26+
process.exit(1);
27+
}
2328
}
2429
catch (error) {
2530
console.error(error);
@@ -28,7 +33,85 @@ const run = async function() {
2833

2934
run();
3035

31-
async function walk(root, dirRelative) {
36+
function ensureNavigationComplete(navPaths, fsPaths) {
37+
const unmatchedNav = { }, unmatchedFs = { };
38+
39+
for (const navPath of navPaths) {
40+
unmatchedNav[navPath] = true;
41+
}
42+
43+
for (let fsPath of fsPaths) {
44+
fsPath = '/' + fsPath.replace(/\.md$/, "");
45+
46+
if (unmatchedNav[fsPath]) {
47+
delete unmatchedNav[fsPath];
48+
}
49+
else {
50+
unmatchedFs[fsPath] = true;
51+
}
52+
}
53+
54+
const missingNav = Object.keys(unmatchedNav).sort();
55+
const missingFs = Object.keys(unmatchedFs).sort()
56+
57+
if (missingNav.length > 0 || missingFs.length > 0) {
58+
let message = "Error: documentation navigation (nav.yml) does not match filesystem.\n";
59+
60+
if (missingNav.length > 0) {
61+
message += "\nThe following path(s) exist on disk but are not present in nav.yml:\n\n";
62+
63+
for (const nav of missingNav) {
64+
message += ` ${nav}\n`;
65+
}
66+
}
67+
68+
if (missingNav.length > 0 && missingFs.length > 0) {
69+
message += "\nThe following path(s) exist in nav.yml but are not present on disk:\n\n";
70+
71+
for (const fs of missingFs) {
72+
message += ` ${fs}\n`;
73+
}
74+
}
75+
76+
message += "\nUpdate nav.yml to ensure that all files are listed in the appropriate place.";
77+
78+
console.error(message);
79+
80+
return false;
81+
}
82+
83+
return true;
84+
}
85+
86+
function getNavigationPaths() {
87+
const navFilename = path.join(docsRoot, 'nav.yml');
88+
const nav = yaml.parse(fs.readFileSync(navFilename).toString(), 'utf8');
89+
90+
return walkNavigation(nav);
91+
}
92+
93+
function walkNavigation(entries) {
94+
const paths = [ ]
95+
96+
for (const entry of entries) {
97+
if (entry.children) {
98+
paths.push(... walkNavigation(entry.children));
99+
}
100+
else {
101+
paths.push(entry.url);
102+
}
103+
}
104+
105+
return paths;
106+
}
107+
108+
async function renderFilesystemPaths() {
109+
return await walkFilesystem(inputRoot);
110+
}
111+
112+
async function walkFilesystem(root, dirRelative) {
113+
const paths = [ ]
114+
32115
const dirPath = dirRelative ? path.join(root, dirRelative) : root;
33116
const children = fs.readdirSync(dirPath);
34117

@@ -37,15 +120,18 @@ async function walk(root, dirRelative) {
37120
const childPath = path.join(root, childRelative);
38121

39122
if (fs.lstatSync(childPath).isDirectory()) {
40-
await walk(root, childRelative);
123+
paths.push(... await walkFilesystem(root, childRelative));
41124
}
42125
else {
43-
await translate(childRelative);
126+
await renderFile(childRelative);
127+
paths.push(childRelative);
44128
}
45129
}
130+
131+
return paths;
46132
}
47133

48-
async function translate(childPath) {
134+
async function renderFile(childPath) {
49135
const inputPath = path.join(inputRoot, childPath);
50136

51137
if (!inputPath.match(/\.md$/)) {
@@ -119,7 +205,6 @@ async function translate(childPath) {
119205
console.log(`warning: unknown token '${token}' in ${inputPath}`);
120206
return '';
121207
}
122-
console.log(key);
123208
return key;
124209
});
125210

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

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ <h3 id="description">Description</h3>
166166
<p>Even if you unpublish a package version, that specific name and version
167167
combination can never be reused. In order to publish the package again,
168168
you must use a new version number. If you unpublish the entire package,
169-
you may not publish any new versions of that package until 24 hours have
169+
you may not publish any new versions of that package until 28 days have
170170
passed.</p>
171171
<h3 id="see-also">See Also</h3>
172172
<ul>

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.6</p>
151+
<p>7.6.0</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/developers.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ <h1 id="developers">developers</h1>
141141

142142
<section id="table_of_contents">
143143
<h2 id="table-of-contents">Table of contents</h2>
144-
<div id="_table_of_contents"><ul><li><a href="#description">Description</a></li><li><a href="#about-these-documents">About These Documents</a></li><li><a href="#what-is-a-package">What is a Package</a></li><li><a href="#the-packagejson-file">The package.json File</a></li><li><a href="#keeping-files-out-of-your-package">Keeping files <em>out</em> of your package</a></li><ul><li><a href="#testing-whether-your-npmignore-or-files-config-works">Testing whether your <code>.npmignore</code> or <code>files</code> config works</a></li></ul><li><a href="#link-packages">Link Packages</a></li><li><a href="#before-publishing-make-sure-your-package-installs-and-works">Before Publishing: Make Sure Your Package Installs and Works</a></li><li><a href="#create-a-user-account">Create a User Account</a></li><li><a href="#publish-your-package">Publish your package</a></li><li><a href="#brag-about-it">Brag about it</a></li><li><a href="#see-also">See also</a></li></ul></div>
144+
<div id="_table_of_contents"><ul><li><a href="#description">Description</a></li><li><a href="#about-these-documents">About These Documents</a></li><li><a href="#what-is-a-package">What is a Package</a></li><li><a href="#the-packagejson-file">The package.json File</a></li><li><a href="#keeping-files-out-of-your-package">Keeping files <em>out</em> of your Package</a></li><ul><li><a href="#testing-whether-your-npmignore-or-files-config-works">Testing whether your <code>.npmignore</code> or <code>files</code> config works</a></li></ul><li><a href="#link-packages">Link Packages</a></li><li><a href="#before-publishing-make-sure-your-package-installs-and-works">Before Publishing: Make Sure Your Package Installs and Works</a></li><li><a href="#create-a-user-account">Create a User Account</a></li><li><a href="#publish-your-package">Publish your Package</a></li><li><a href="#brag-about-it">Brag about it</a></li><li><a href="#see-also">See also</a></li></ul></div>
145145
</section>
146146

147147
<div id="_content"><h3 id="description">Description</h3>
@@ -223,7 +223,7 @@ <h3 id="the-packagejson-file">The package.json File</h3>
223223
</ul>
224224
<p>You can use <code>npm init</code> in the root of your package in order to get you
225225
started with a pretty basic package.json file. See <a href="../commands/npm-init.html"><code>npm init</code></a> for more info.</p>
226-
<h3 id="keeping-files-out-of-your-package">Keeping files <em>out</em> of your package</h3>
226+
<h3 id="keeping-files-out-of-your-package">Keeping files <em>out</em> of your Package</h3>
227227
<p>Use a <code>.npmignore</code> file to keep stuff out of your package. If there’s no
228228
<code>.npmignore</code> file, but there <em>is</em> a <code>.gitignore</code> file, then npm will ignore
229229
the stuff matched by the <code>.gitignore</code> file. If you <em>want</em> to include
@@ -310,7 +310,7 @@ <h3 id="create-a-user-account">Create a User Account</h3>
310310
</code></pre>
311311
<p>and then follow the prompts.</p>
312312
<p>This is documented better in <a href="../commands/npm-adduser.html">npm adduser</a>.</p>
313-
<h3 id="publish-your-package">Publish your package</h3>
313+
<h3 id="publish-your-package">Publish your Package</h3>
314314
<p>This part’s easy. In the root of your folder, do this:</p>
315315
<pre lang="bash"><code>npm publish
316316
</code></pre>

deps/npm/lib/access.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,17 @@ const access = async ([cmd, ...args], cb) => {
5959
return fn(args, { ...npm.flatOptions })
6060
}
6161

62-
const completion = function (opts, cb) {
63-
var argv = opts.conf.argv.remain
62+
const completion = async (opts) => {
63+
const argv = opts.conf.argv.remain
6464
if (argv.length === 2)
65-
return cb(null, subcommands)
65+
return subcommands
6666

6767
switch (argv[2]) {
6868
case 'grant':
6969
if (argv.length === 3)
70-
return cb(null, ['read-only', 'read-write'])
70+
return ['read-only', 'read-write']
7171
else
72-
return cb(null, [])
72+
return []
7373

7474
case 'public':
7575
case 'restricted':
@@ -79,9 +79,9 @@ const completion = function (opts, cb) {
7979
case '2fa-required':
8080
case '2fa-not-required':
8181
case 'revoke':
82-
return cb(null, [])
82+
return []
8383
default:
84-
return cb(new Error(argv[2] + ' not recognized'))
84+
throw new Error(argv[2] + ' not recognized')
8585
}
8686
}
8787

deps/npm/lib/adduser.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ const usage = usageUtil(
1515
'npm adduser [--registry=url] [--scope=@orgname] [--always-auth]'
1616
)
1717

18-
const completion = require('./utils/completion/none.js')
19-
2018
const cmd = (args, cb) => adduser(args).then(() => cb()).catch(cb)
2119

2220
const getRegistry = ({ scope, registry }) => {
@@ -74,4 +72,4 @@ const adduser = async (args) => {
7472
output(message)
7573
}
7674

77-
module.exports = Object.assign(cmd, { completion, usage })
75+
module.exports = Object.assign(cmd, { usage })

deps/npm/lib/audit.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ const usage = usageUtil(
3838
'[--force|--package-lock-only|--dry-run|--production|--only=(dev|prod)]'
3939
)
4040

41-
const completion = (opts, cb) => {
41+
const completion = async (opts) => {
4242
const argv = opts.conf.argv.remain
4343

4444
if (argv.length === 2)
45-
return cb(null, ['fix'])
45+
return ['fix']
4646

4747
switch (argv[2]) {
4848
case 'fix':
49-
return cb(null, [])
49+
return []
5050
default:
51-
return cb(new Error(argv[2] + ' not recognized'))
51+
throw new Error(argv[2] + ' not recognized')
5252
}
5353
}
5454

deps/npm/lib/bin.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
const npm = require('./npm.js')
22
const output = require('./utils/output.js')
33
const usageUtil = require('./utils/usage.js')
4-
const completion = require('./utils/completion/none.js')
54
const PATH = require('./utils/path.js')
65
const cmd = (args, cb) => bin(args).then(() => cb()).catch(cb)
76
const usage = usageUtil('bin', 'npm bin [-g]')
@@ -11,4 +10,4 @@ const bin = async (args, cb) => {
1110
if (npm.flatOptions.global && !PATH.includes(b))
1211
console.error('(not in PATH env variable)')
1312
}
14-
module.exports = Object.assign(cmd, { usage, completion })
13+
module.exports = Object.assign(cmd, { usage })

deps/npm/lib/bugs.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const npm = require('./npm.js')
77
const hostedFromMani = require('./utils/hosted-git-info-from-manifest.js')
88

99
const usage = usageUtil('bugs', 'npm bugs [<pkgname>]')
10-
const completion = require('./utils/completion/none.js')
1110

1211
const cmd = (args, cb) => bugs(args).then(() => cb()).catch(cb)
1312

@@ -44,4 +43,4 @@ const getBugs = async pkg => {
4443
await openUrl(url, `${mani.name} bug list available at the following URL`)
4544
}
4645

47-
module.exports = Object.assign(cmd, { usage, completion })
46+
module.exports = Object.assign(cmd, { usage })

deps/npm/lib/cache.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ const usage = usageUtil('cache',
1919
'\nnpm cache verify'
2020
)
2121

22-
const completion = (opts, cb) => {
22+
const completion = async (opts) => {
2323
const argv = opts.conf.argv.remain
2424
if (argv.length === 2)
25-
return cb(null, ['add', 'clean', 'verify'])
25+
return ['add', 'clean', 'verify']
2626

2727
// TODO - eventually...
2828
switch (argv[2]) {
2929
case 'verify':
3030
case 'clean':
3131
case 'add':
32-
return cb(null, [])
32+
return []
3333
}
3434
}
3535

deps/npm/lib/ci.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const npm = require('./npm.js')
1111
const usageUtil = require('./utils/usage.js')
1212

1313
const usage = usageUtil('ci', 'npm ci')
14-
const completion = require('./utils/completion/none.js')
1514

1615
const cmd = (args, cb) => ci().then(() => cb()).catch(cb)
1716

@@ -76,4 +75,4 @@ const ci = async () => {
7675
await reifyFinish(arb)
7776
}
7877

79-
module.exports = Object.assign(cmd, { completion, usage })
78+
module.exports = Object.assign(cmd, {usage})

0 commit comments

Comments
 (0)