Skip to content

Commit a59ade6

Browse files
npm-robotdanielleadams
authored andcommitted
deps: upgrade npm to 8.3.1
PR-URL: #41503 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruy Adorno <ruyadorno@github.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
1 parent 2bea4bd commit a59ade6

File tree

144 files changed

+2113
-755
lines changed

Some content is hidden

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

144 files changed

+2113
-755
lines changed

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

Lines 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 lang="bash"><code>npm@8.3.0 /path/to/npm
163+
<pre lang="bash"><code>npm@8.3.1 /path/to/npm
164164
└─┬ init-package-json@0.0.4
165165
└── promzard@0.1.5
166166
</code></pre>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ <h2 id="table-of-contents">Table of contents</h2>
149149
<pre lang="bash"><code>npm &lt;command&gt; [args]
150150
</code></pre>
151151
<h3 id="version">Version</h3>
152-
<p>8.3.0</p>
152+
<p>8.3.1</p>
153153
<h3 id="description">Description</h3>
154154
<p>npm is the package manager for the Node JavaScript platform. It puts
155155
modules in place so that node can find them, and manages dependency

deps/npm/lib/commands/unpublish.js

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,22 @@ const log = require('../utils/log-shim')
99
const otplease = require('../utils/otplease.js')
1010
const getIdentity = require('../utils/get-identity.js')
1111

12+
const LAST_REMAINING_VERSION_ERROR = 'Refusing to delete the last version of the package. ' +
13+
'It will block from republishing a new version for 24 hours.\n' +
14+
'Run with --force to do this.'
15+
1216
const BaseCommand = require('../base-command.js')
1317
class Unpublish extends BaseCommand {
1418
static description = 'Remove a package from the registry'
1519
static name = 'unpublish'
1620
static params = ['dry-run', 'force', 'workspace', 'workspaces']
1721
static usage = ['[<@scope>/]<pkg>[@<version>]']
1822

23+
async getKeysOfVersions (name, opts) {
24+
const json = await npmFetch.json(npa(name).escapedName, opts)
25+
return Object.keys(json.versions)
26+
}
27+
1928
async completion (args) {
2029
const { partialWord, conf } = args
2130

@@ -44,8 +53,7 @@ class Unpublish extends BaseCommand {
4453
return pkgs
4554
}
4655

47-
const json = await npmFetch.json(npa(pkgs[0]).escapedName, opts)
48-
const versions = Object.keys(json.versions)
56+
const versions = await this.getKeysOfVersions(pkgs[0], opts)
4957
if (!versions.length) {
5058
return pkgs
5159
} else {
@@ -97,12 +105,26 @@ class Unpublish extends BaseCommand {
97105
const { name, version, publishConfig } = manifest
98106
const pkgJsonSpec = npa.resolve(name, version)
99107
const optsWithPub = { ...opts, publishConfig }
108+
109+
const versions = await this.getKeysOfVersions(name, optsWithPub)
110+
if (versions.length === 1 && !force) {
111+
throw this.usageError(
112+
LAST_REMAINING_VERSION_ERROR
113+
)
114+
}
115+
100116
if (!dryRun) {
101117
await otplease(opts, opts => libunpub(pkgJsonSpec, optsWithPub))
102118
}
103119
pkgName = name
104120
pkgVersion = version ? `@${version}` : ''
105121
} else {
122+
const versions = await this.getKeysOfVersions(spec.name, opts)
123+
if (versions.length === 1 && !force) {
124+
throw this.usageError(
125+
LAST_REMAINING_VERSION_ERROR
126+
)
127+
}
106128
if (!dryRun) {
107129
await otplease(opts, opts => libunpub(spec, opts))
108130
}

deps/npm/man/man1/npm-access.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "NPM\-ACCESS" "1" "December 2021" "" ""
1+
.TH "NPM\-ACCESS" "1" "January 2022" "" ""
22
.SH "NAME"
33
\fBnpm-access\fR \- Set access level on published packages
44
.SS Synopsis

deps/npm/man/man1/npm-adduser.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "NPM\-ADDUSER" "1" "December 2021" "" ""
1+
.TH "NPM\-ADDUSER" "1" "January 2022" "" ""
22
.SH "NAME"
33
\fBnpm-adduser\fR \- Add a registry user account
44
.SS Synopsis

deps/npm/man/man1/npm-audit.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "NPM\-AUDIT" "1" "December 2021" "" ""
1+
.TH "NPM\-AUDIT" "1" "January 2022" "" ""
22
.SH "NAME"
33
\fBnpm-audit\fR \- Run a security audit
44
.SS Synopsis

deps/npm/man/man1/npm-bin.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "NPM\-BIN" "1" "December 2021" "" ""
1+
.TH "NPM\-BIN" "1" "January 2022" "" ""
22
.SH "NAME"
33
\fBnpm-bin\fR \- Display npm bin folder
44
.SS Synopsis

deps/npm/man/man1/npm-bugs.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "NPM\-BUGS" "1" "December 2021" "" ""
1+
.TH "NPM\-BUGS" "1" "January 2022" "" ""
22
.SH "NAME"
33
\fBnpm-bugs\fR \- Report bugs for a package in a web browser
44
.SS Synopsis

deps/npm/man/man1/npm-cache.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "NPM\-CACHE" "1" "December 2021" "" ""
1+
.TH "NPM\-CACHE" "1" "January 2022" "" ""
22
.SH "NAME"
33
\fBnpm-cache\fR \- Manipulates packages cache
44
.SS Synopsis

deps/npm/man/man1/npm-ci.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "NPM\-CI" "1" "December 2021" "" ""
1+
.TH "NPM\-CI" "1" "January 2022" "" ""
22
.SH "NAME"
33
\fBnpm-ci\fR \- Install a project with a clean slate
44
.SS Synopsis

0 commit comments

Comments
 (0)