Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit eaeb870

Browse filesBrowse files
npm-cli-botjuanarbol
authored andcommitted
deps: upgrade npm to 9.3.1
PR-URL: #46242 Reviewed-By: Ruy Adorno <ruyadorno@google.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent cde5960 commit eaeb870
Copy full SHA for eaeb870

File tree

Expand file treeCollapse file tree

11 files changed

+61
-19
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

11 files changed

+61
-19
lines changed
Open diff view settings
Collapse file

‎deps/npm/docs/content/commands/npm-ls.md‎

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 numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ packages will *also* show the paths to the specified packages. For
2727
example, running `npm ls promzard` in npm's source tree will show:
2828

2929
```bash
30-
npm@9.3.0 /path/to/npm
30+
npm@9.3.1 /path/to/npm
3131
└─┬ init-package-json@0.0.4
3232
└── promzard@0.1.5
3333
```
Collapse file

‎deps/npm/docs/content/commands/npm.md‎

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 numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Note: This command is unaware of workspaces.
1414

1515
### Version
1616

17-
9.3.0
17+
9.3.1
1818

1919
### Description
2020

Collapse file

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

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 numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ <h3 id="description">Description</h3>
160160
the results to only the paths to the packages named. Note that nested
161161
packages will <em>also</em> show the paths to the specified packages. For
162162
example, running <code>npm ls promzard</code> in npm's source tree will show:</p>
163-
<pre><code class="language-bash">npm@9.3.0 /path/to/npm
163+
<pre><code class="language-bash">npm@9.3.1 /path/to/npm
164164
└─┬ init-package-json@0.0.4
165165
└── promzard@0.1.5
166166
</code></pre>
Collapse file

‎deps/npm/docs/output/commands/npm.html‎

Copy file name to clipboardExpand all lines: deps/npm/docs/output/commands/npm.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ <h2 id="table-of-contents">Table of contents</h2>
150150
</code></pre>
151151
<p>Note: This command is unaware of workspaces.</p>
152152
<h3 id="version">Version</h3>
153-
<p>9.3.0</p>
153+
<p>9.3.1</p>
154154
<h3 id="description">Description</h3>
155155
<p>npm is the package manager for the Node JavaScript platform. It puts
156156
modules in place so that node can find them, and manages dependency
Collapse file

‎deps/npm/lib/commands/ci.js‎

Copy file name to clipboardExpand all lines: deps/npm/lib/commands/ci.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class CI extends ArboristWorkspaceCmd {
6767
const path = `${where}/node_modules`
6868
// get the list of entries so we can skip the glob for performance
6969
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 })))
7171
})
7272

7373
await arb.reify(opts)
Collapse file

‎deps/npm/lib/commands/deprecate.js‎

Copy file name to clipboardExpand all lines: deps/npm/lib/commands/deprecate.js
+13-11Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,21 @@ class Deprecate extends BaseCommand {
5252
query: { write: true },
5353
})
5454

55-
Object.keys(packument.versions)
55+
const versions = Object.keys(packument.versions)
5656
.filter(v => semver.satisfies(v, spec, { includePrerelease: true }))
57-
.forEach(v => {
58-
packument.versions[v].deprecated = msg
59-
})
6057

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+
}
6870
}
6971
}
7072

Collapse file

‎deps/npm/man/man1/npm-ls.1‎

Copy file name to clipboardExpand all lines: deps/npm/man/man1/npm-ls.1
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Positional arguments are \fBname@version-range\fR identifiers, which will limit
2020
.P
2121
.RS 2
2222
.nf
23-
npm@9.3.0 /path/to/npm
23+
npm@9.3.1 /path/to/npm
2424
└─┬ init-package-json@0.0.4
2525
└── promzard@0.1.5
2626
.fi
Collapse file

‎deps/npm/man/man1/npm.1‎

Copy file name to clipboardExpand all lines: deps/npm/man/man1/npm.1
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ npm
1212
Note: This command is unaware of workspaces.
1313
.SS "Version"
1414
.P
15-
9.3.0
15+
9.3.1
1616
.SS "Description"
1717
.P
1818
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

‎deps/npm/package.json‎

Copy file name to clipboardExpand all lines: deps/npm/package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "9.3.0",
2+
"version": "9.3.1",
33
"name": "npm",
44
"description": "a package manager for JavaScript",
55
"workspaces": [
Collapse file

‎deps/npm/test/lib/commands/ci.js‎

Copy file name to clipboardExpand all lines: deps/npm/test/lib/commands/ci.js
+24Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,30 @@ t.test('reifies, audits, removes node_modules', async t => {
7979
t.equal(fs.existsSync(nmAbbrev), true, 'installs abbrev')
8080
})
8181

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+
82106
t.test('--no-audit and --ignore-scripts', async t => {
83107
const { npm, joinedOutput, registry } = await loadMockNpm(t, {
84108
config: {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.