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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 34 additions & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 91 additions & 6 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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>

0 commit comments

Comments
 (0)