GeezerVison is showing github.com — deps: upgrade npm to 9.3.1 · nodejs/node@6cd7057
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: deps/npm/docs/content/commands/npm-ls.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -27,7 +27,7 @@ packages will *also* show the paths to the specified packages. For | 27 | 27 | example, running `npm ls promzard` in npm's source tree will show: | 28 | 28 |
| 29 | 29 | ```bash | 30 | | - | | 30 | + | 31 | 31 | | 32 | 32 | | 33 | 33 | ``` | |
Collapse file Copy file name to clipboardExpand all lines: deps/npm/docs/content/commands/npm.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -14,7 +14,7 @@ Note: This command is unaware of workspaces. | 14 | 14 |
| 15 | 15 | ### Version | 16 | 16 |
| 17 | | -9.3.0 | | 17 | +9.3.1 | 18 | 18 |
| 19 | 19 | ### Description | 20 | 20 |
| |
Collapse file Copy file name to clipboardExpand all lines: deps/npm/docs/output/commands/npm-ls.html +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -160,7 +160,7 @@ <h3 id="description">Description</h3> | 160 | 160 | the results to only the paths to the packages named. Note that nested | 161 | 161 | packages will <em>also</em> show the paths to the specified packages. For | 162 | 162 | example, running <code>npm ls promzard</code> in npm's source tree will show:</p> | 163 | | - | | 163 | + | 164 | 164 | | 165 | 165 | | 166 | 166 | </code></pre> | |
Collapse file Copy file name to clipboardExpand all lines: deps/npm/docs/output/commands/npm.html +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -150,7 +150,7 @@ <h2 id="table-of-contents">Table of contents</h2> | 150 | 150 | </code></pre> | 151 | 151 | <p>Note: This command is unaware of workspaces.</p> | 152 | 152 | <h3 id="version">Version</h3> | 153 | | -<p>9.3.0</p> | | 153 | +<p>9.3.1</p> | 154 | 154 | <h3 id="description">Description</h3> | 155 | 155 | <p>npm is the package manager for the Node JavaScript platform. It puts | 156 | 156 | modules in place so that node can find them, and manages dependency | |
Collapse file Copy file name to clipboardExpand all lines: deps/npm/lib/commands/ci.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -67,7 +67,7 @@ class CI extends ArboristWorkspaceCmd { | 67 | 67 | const path = `${where}/node_modules` | 68 | 68 | // get the list of entries so we can skip the glob for performance | 69 | 69 | const entries = await fs.readdir(path, null).catch(er => []) | 70 | | - return Promise.all(entries.map(f => fs.rm(`${path}/${f}`, { force: true }))) | | 70 | + return Promise.all(entries.map(f => fs.rm(`${path}/${f}`, { force: true, recursive: true }))) | 71 | 71 | }) | 72 | 72 |
| 73 | 73 | await arb.reify(opts) | |
Collapse file Copy file name to clipboardExpand all lines: deps/npm/lib/commands/deprecate.js +13-11Lines changed: 13 additions & 11 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -52,19 +52,21 @@ class Deprecate extends BaseCommand { | 52 | 52 | query: { write: true }, | 53 | 53 | }) | 54 | 54 |
| 55 | | - Object.keys(packument.versions) | | 55 | + const versions = Object.keys(packument.versions) | 56 | 56 | .filter(v => semver.satisfies(v, spec, { includePrerelease: true })) | 57 | | - .forEach(v => { | 58 | | - packument.versions[v].deprecated = msg | 59 | | - }) | 60 | 57 |
| 61 | | - return otplease(this.npm, this.npm.flatOptions, opts => fetch(uri, { | 62 | | - ...opts, | 63 | | - spec: p, | 64 | | - method: 'PUT', | 65 | | - body: packument, | 66 | | - ignoreBody: true, | 67 | | - })) | | 58 | + if (versions.length) { | | 59 | + for (const v of versions) { | | 60 | + packument.versions[v].deprecated = msg | | 61 | + } | | 62 | + return otplease(this.npm, this.npm.flatOptions, opts => fetch(uri, { | | 63 | + ...opts, | | 64 | + spec: p, | | 65 | + method: 'PUT', | | 66 | + body: packument, | | 67 | + ignoreBody: true, | | 68 | + })) | | 69 | + } | 68 | 70 | } | 69 | 71 | } | 70 | 72 |
| |
Collapse file Copy file name to clipboardExpand all lines: deps/npm/man/man1/npm-ls.1 +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -20,7 +20,7 @@ Positional arguments are \fBname@version-range\fR identifiers, which will limit | 20 | 20 | .P | 21 | 21 | .RS 2 | 22 | 22 | .nf | 23 | | - | | 23 | + | 24 | 24 | | 25 | 25 | | 26 | 26 | .fi | |
Collapse file Copy file name to clipboardExpand all lines: deps/npm/man/man1/npm.1 +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 12 | 12 | Note: This command is unaware of workspaces. | 13 | 13 | .SS "Version" | 14 | 14 | .P | 15 | | -9.3.0 | | 15 | +9.3.1 | 16 | 16 | .SS "Description" | 17 | 17 | .P | 18 | 18 | npm is the package manager for the Node JavaScript platform. It puts modules in place so that node can find them, and manages dependency conflicts intelligently. | |
Collapse file Copy file name to clipboardExpand all lines: deps/npm/package.json +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | { | 2 | | - "version": "9.3.0", | | 2 | + "version": "9.3.1", | 3 | 3 | "name": "npm", | 4 | 4 | "description": "a package manager for JavaScript", | 5 | 5 | "workspaces": [ | |
Collapse file Copy file name to clipboardExpand all lines: deps/npm/test/lib/commands/ci.js +24Lines changed: 24 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -79,6 +79,30 @@ t.test('reifies, audits, removes node_modules', async t => { | 79 | 79 | t.equal(fs.existsSync(nmAbbrev), true, 'installs abbrev') | 80 | 80 | }) | 81 | 81 |
| | 82 | +t.test('reifies, audits, removes node_modules on repeat run', async t => { | | 83 | + const { npm, joinedOutput, registry } = await loadMockNpm(t, { | | 84 | + prefixDir: { | | 85 | + abbrev: abbrev, | | 86 | + 'package.json': JSON.stringify(packageJson), | | 87 | + 'package-lock.json': JSON.stringify(packageLock), | | 88 | + node_modules: { test: 'test file that will be removed' }, | | 89 | + }, | | 90 | + }) | | 91 | + const manifest = registry.manifest({ name: 'abbrev' }) | | 92 | + await registry.tarball({ | | 93 | + manifest: manifest.versions['1.0.0'], | | 94 | + tarball: path.join(npm.prefix, 'abbrev'), | | 95 | + }) | | 96 | + registry.nock.post('/-/npm/v1/security/advisories/bulk').reply(200, {}) | | 97 | + await npm.exec('ci', []) | | 98 | + await npm.exec('ci', []) | | 99 | + t.match(joinedOutput(), 'added 1 package, and audited 2 packages in') | | 100 | + const nmTest = path.join(npm.prefix, 'node_modules', 'test') | | 101 | + t.equal(fs.existsSync(nmTest), false, 'existing node_modules is removed') | | 102 | + const nmAbbrev = path.join(npm.prefix, 'node_modules', 'abbrev') | | 103 | + t.equal(fs.existsSync(nmAbbrev), true, 'installs abbrev') | | 104 | +}) | | 105 | + | 82 | 106 | t.test('--no-audit and --ignore-scripts', async t => { | 83 | 107 | const { npm, joinedOutput, registry } = await loadMockNpm(t, { | 84 | 108 | config: { | |
|