Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
npm-robot authored and targos committed Jan 16, 2022
1 parent abbfed8 commit f5b8aee
Show file tree
Hide file tree
Showing 144 changed files with 2,113 additions and 755 deletions.
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm-ls.html
Expand Up @@ -160,7 +160,7 @@ <h3 id="description">Description</h3>
the results to only the paths to the packages named. Note that nested
packages will <em>also</em> show the paths to the specified packages. For
example, running <code>npm ls promzard</code> in npm's source tree will show:</p>
<pre lang="bash"><code>npm@8.3.0 /path/to/npm
<pre lang="bash"><code>npm@8.3.1 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
</code></pre>
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm.html
Expand Up @@ -149,7 +149,7 @@ <h2 id="table-of-contents">Table of contents</h2>
<pre lang="bash"><code>npm &lt;command&gt; [args]
</code></pre>
<h3 id="version">Version</h3>
<p>8.3.0</p>
<p>8.3.1</p>
<h3 id="description">Description</h3>
<p>npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
Expand Down
26 changes: 24 additions & 2 deletions deps/npm/lib/commands/unpublish.js
Expand Up @@ -9,13 +9,22 @@ const log = require('../utils/log-shim')
const otplease = require('../utils/otplease.js')
const getIdentity = require('../utils/get-identity.js')

const LAST_REMAINING_VERSION_ERROR = 'Refusing to delete the last version of the package. ' +
'It will block from republishing a new version for 24 hours.\n' +
'Run with --force to do this.'

const BaseCommand = require('../base-command.js')
class Unpublish extends BaseCommand {
static description = 'Remove a package from the registry'
static name = 'unpublish'
static params = ['dry-run', 'force', 'workspace', 'workspaces']
static usage = ['[<@scope>/]<pkg>[@<version>]']

async getKeysOfVersions (name, opts) {
const json = await npmFetch.json(npa(name).escapedName, opts)
return Object.keys(json.versions)
}

async completion (args) {
const { partialWord, conf } = args

Expand Down Expand Up @@ -44,8 +53,7 @@ class Unpublish extends BaseCommand {
return pkgs
}

const json = await npmFetch.json(npa(pkgs[0]).escapedName, opts)
const versions = Object.keys(json.versions)
const versions = await this.getKeysOfVersions(pkgs[0], opts)
if (!versions.length) {
return pkgs
} else {
Expand Down Expand Up @@ -97,12 +105,26 @@ class Unpublish extends BaseCommand {
const { name, version, publishConfig } = manifest
const pkgJsonSpec = npa.resolve(name, version)
const optsWithPub = { ...opts, publishConfig }

const versions = await this.getKeysOfVersions(name, optsWithPub)
if (versions.length === 1 && !force) {
throw this.usageError(
LAST_REMAINING_VERSION_ERROR
)
}

if (!dryRun) {
await otplease(opts, opts => libunpub(pkgJsonSpec, optsWithPub))
}
pkgName = name
pkgVersion = version ? `@${version}` : ''
} else {
const versions = await this.getKeysOfVersions(spec.name, opts)
if (versions.length === 1 && !force) {
throw this.usageError(
LAST_REMAINING_VERSION_ERROR
)
}
if (!dryRun) {
await otplease(opts, opts => libunpub(spec, opts))
}
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-access.1
@@ -1,4 +1,4 @@
.TH "NPM\-ACCESS" "1" "December 2021" "" ""
.TH "NPM\-ACCESS" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-access\fR \- Set access level on published packages
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-adduser.1
@@ -1,4 +1,4 @@
.TH "NPM\-ADDUSER" "1" "December 2021" "" ""
.TH "NPM\-ADDUSER" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-adduser\fR \- Add a registry user account
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-audit.1
@@ -1,4 +1,4 @@
.TH "NPM\-AUDIT" "1" "December 2021" "" ""
.TH "NPM\-AUDIT" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-audit\fR \- Run a security audit
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-bin.1
@@ -1,4 +1,4 @@
.TH "NPM\-BIN" "1" "December 2021" "" ""
.TH "NPM\-BIN" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-bin\fR \- Display npm bin folder
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-bugs.1
@@ -1,4 +1,4 @@
.TH "NPM\-BUGS" "1" "December 2021" "" ""
.TH "NPM\-BUGS" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-bugs\fR \- Report bugs for a package in a web browser
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-cache.1
@@ -1,4 +1,4 @@
.TH "NPM\-CACHE" "1" "December 2021" "" ""
.TH "NPM\-CACHE" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-cache\fR \- Manipulates packages cache
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-ci.1
@@ -1,4 +1,4 @@
.TH "NPM\-CI" "1" "December 2021" "" ""
.TH "NPM\-CI" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-ci\fR \- Install a project with a clean slate
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-completion.1
@@ -1,4 +1,4 @@
.TH "NPM\-COMPLETION" "1" "December 2021" "" ""
.TH "NPM\-COMPLETION" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-completion\fR \- Tab Completion for npm
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-config.1
@@ -1,4 +1,4 @@
.TH "NPM\-CONFIG" "1" "December 2021" "" ""
.TH "NPM\-CONFIG" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-config\fR \- Manage the npm configuration files
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-dedupe.1
@@ -1,4 +1,4 @@
.TH "NPM\-DEDUPE" "1" "December 2021" "" ""
.TH "NPM\-DEDUPE" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-dedupe\fR \- Reduce duplication in the package tree
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-deprecate.1
@@ -1,4 +1,4 @@
.TH "NPM\-DEPRECATE" "1" "December 2021" "" ""
.TH "NPM\-DEPRECATE" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-deprecate\fR \- Deprecate a version of a package
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-diff.1
@@ -1,4 +1,4 @@
.TH "NPM\-DIFF" "1" "December 2021" "" ""
.TH "NPM\-DIFF" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-diff\fR \- The registry diff command
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-dist-tag.1
@@ -1,4 +1,4 @@
.TH "NPM\-DIST\-TAG" "1" "December 2021" "" ""
.TH "NPM\-DIST\-TAG" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-dist-tag\fR \- Modify package distribution tags
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-docs.1
@@ -1,4 +1,4 @@
.TH "NPM\-DOCS" "1" "December 2021" "" ""
.TH "NPM\-DOCS" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-docs\fR \- Open documentation for a package in a web browser
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-doctor.1
@@ -1,4 +1,4 @@
.TH "NPM\-DOCTOR" "1" "December 2021" "" ""
.TH "NPM\-DOCTOR" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-doctor\fR \- Check your npm environment
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-edit.1
@@ -1,4 +1,4 @@
.TH "NPM\-EDIT" "1" "December 2021" "" ""
.TH "NPM\-EDIT" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-edit\fR \- Edit an installed package
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-exec.1
@@ -1,4 +1,4 @@
.TH "NPM\-EXEC" "1" "December 2021" "" ""
.TH "NPM\-EXEC" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-exec\fR \- Run a command from a local or remote npm package
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-explain.1
@@ -1,4 +1,4 @@
.TH "NPM\-EXPLAIN" "1" "December 2021" "" ""
.TH "NPM\-EXPLAIN" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-explain\fR \- Explain installed packages
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-explore.1
@@ -1,4 +1,4 @@
.TH "NPM\-EXPLORE" "1" "December 2021" "" ""
.TH "NPM\-EXPLORE" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-explore\fR \- Browse an installed package
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-find-dupes.1
@@ -1,4 +1,4 @@
.TH "NPM\-FIND\-DUPES" "1" "December 2021" "" ""
.TH "NPM\-FIND\-DUPES" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-find-dupes\fR \- Find duplication in the package tree
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-fund.1
@@ -1,4 +1,4 @@
.TH "NPM\-FUND" "1" "December 2021" "" ""
.TH "NPM\-FUND" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-fund\fR \- Retrieve funding information
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-help-search.1
@@ -1,4 +1,4 @@
.TH "NPM\-HELP\-SEARCH" "1" "December 2021" "" ""
.TH "NPM\-HELP\-SEARCH" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-help-search\fR \- Search npm help documentation
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-help.1
@@ -1,4 +1,4 @@
.TH "NPM\-HELP" "1" "December 2021" "" ""
.TH "NPM\-HELP" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-help\fR \- Get help on npm
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-hook.1
@@ -1,4 +1,4 @@
.TH "NPM\-HOOK" "1" "December 2021" "" ""
.TH "NPM\-HOOK" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-hook\fR \- Manage registry hooks
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-init.1
@@ -1,4 +1,4 @@
.TH "NPM\-INIT" "1" "December 2021" "" ""
.TH "NPM\-INIT" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-init\fR \- Create a package\.json file
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-install-ci-test.1
@@ -1,4 +1,4 @@
.TH "NPM\-INSTALL\-CI\-TEST" "1" "December 2021" "" ""
.TH "NPM\-INSTALL\-CI\-TEST" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-install-ci-test\fR \- Install a project with a clean slate and run tests
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-install-test.1
@@ -1,4 +1,4 @@
.TH "NPM\-INSTALL\-TEST" "1" "December 2021" "" ""
.TH "NPM\-INSTALL\-TEST" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-install-test\fR \- Install package(s) and run tests
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-install.1
@@ -1,4 +1,4 @@
.TH "NPM\-INSTALL" "1" "December 2021" "" ""
.TH "NPM\-INSTALL" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-install\fR \- Install a package
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-link.1
@@ -1,4 +1,4 @@
.TH "NPM\-LINK" "1" "December 2021" "" ""
.TH "NPM\-LINK" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-link\fR \- Symlink a package folder
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-logout.1
@@ -1,4 +1,4 @@
.TH "NPM\-LOGOUT" "1" "December 2021" "" ""
.TH "NPM\-LOGOUT" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-logout\fR \- Log out of the registry
.SS Synopsis
Expand Down
4 changes: 2 additions & 2 deletions deps/npm/man/man1/npm-ls.1
@@ -1,4 +1,4 @@
.TH "NPM\-LS" "1" "December 2021" "" ""
.TH "NPM\-LS" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-ls\fR \- List installed packages
.SS Synopsis
Expand Down Expand Up @@ -26,7 +26,7 @@ example, running \fBnpm ls promzard\fP in npm's source tree will show:
.P
.RS 2
.nf
npm@8\.3\.0 /path/to/npm
npm@8\.3\.1 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.fi
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-org.1
@@ -1,4 +1,4 @@
.TH "NPM\-ORG" "1" "December 2021" "" ""
.TH "NPM\-ORG" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-org\fR \- Manage orgs
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-outdated.1
@@ -1,4 +1,4 @@
.TH "NPM\-OUTDATED" "1" "December 2021" "" ""
.TH "NPM\-OUTDATED" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-outdated\fR \- Check for outdated packages
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-owner.1
@@ -1,4 +1,4 @@
.TH "NPM\-OWNER" "1" "December 2021" "" ""
.TH "NPM\-OWNER" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-owner\fR \- Manage package owners
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-pack.1
@@ -1,4 +1,4 @@
.TH "NPM\-PACK" "1" "December 2021" "" ""
.TH "NPM\-PACK" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-pack\fR \- Create a tarball from a package
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-ping.1
@@ -1,4 +1,4 @@
.TH "NPM\-PING" "1" "December 2021" "" ""
.TH "NPM\-PING" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-ping\fR \- Ping npm registry
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-pkg.1
@@ -1,4 +1,4 @@
.TH "NPM\-PKG" "1" "December 2021" "" ""
.TH "NPM\-PKG" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-pkg\fR \- Manages your package\.json
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-prefix.1
@@ -1,4 +1,4 @@
.TH "NPM\-PREFIX" "1" "December 2021" "" ""
.TH "NPM\-PREFIX" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-prefix\fR \- Display prefix
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-profile.1
@@ -1,4 +1,4 @@
.TH "NPM\-PROFILE" "1" "December 2021" "" ""
.TH "NPM\-PROFILE" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-profile\fR \- Change settings on your registry profile
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-prune.1
@@ -1,4 +1,4 @@
.TH "NPM\-PRUNE" "1" "December 2021" "" ""
.TH "NPM\-PRUNE" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-prune\fR \- Remove extraneous packages
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-publish.1
@@ -1,4 +1,4 @@
.TH "NPM\-PUBLISH" "1" "December 2021" "" ""
.TH "NPM\-PUBLISH" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-publish\fR \- Publish a package
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-rebuild.1
@@ -1,4 +1,4 @@
.TH "NPM\-REBUILD" "1" "December 2021" "" ""
.TH "NPM\-REBUILD" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-rebuild\fR \- Rebuild a package
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-repo.1
@@ -1,4 +1,4 @@
.TH "NPM\-REPO" "1" "December 2021" "" ""
.TH "NPM\-REPO" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-repo\fR \- Open package repository page in the browser
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-restart.1
@@ -1,4 +1,4 @@
.TH "NPM\-RESTART" "1" "December 2021" "" ""
.TH "NPM\-RESTART" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-restart\fR \- Restart a package
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-root.1
@@ -1,4 +1,4 @@
.TH "NPM\-ROOT" "1" "December 2021" "" ""
.TH "NPM\-ROOT" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-root\fR \- Display npm root
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-run-script.1
@@ -1,4 +1,4 @@
.TH "NPM\-RUN\-SCRIPT" "1" "December 2021" "" ""
.TH "NPM\-RUN\-SCRIPT" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-run-script\fR \- Run arbitrary package scripts
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-search.1
@@ -1,4 +1,4 @@
.TH "NPM\-SEARCH" "1" "December 2021" "" ""
.TH "NPM\-SEARCH" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-search\fR \- Search for packages
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-set-script.1
@@ -1,4 +1,4 @@
.TH "NPM\-SET\-SCRIPT" "1" "December 2021" "" ""
.TH "NPM\-SET\-SCRIPT" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-set-script\fR \- Set tasks in the scripts section of package\.json
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-shrinkwrap.1
@@ -1,4 +1,4 @@
.TH "NPM\-SHRINKWRAP" "1" "December 2021" "" ""
.TH "NPM\-SHRINKWRAP" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-shrinkwrap\fR \- Lock down dependency versions for publication
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-star.1
@@ -1,4 +1,4 @@
.TH "NPM\-STAR" "1" "December 2021" "" ""
.TH "NPM\-STAR" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-star\fR \- Mark your favorite packages
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-stars.1
@@ -1,4 +1,4 @@
.TH "NPM\-STARS" "1" "December 2021" "" ""
.TH "NPM\-STARS" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-stars\fR \- View packages marked as favorites
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-start.1
@@ -1,4 +1,4 @@
.TH "NPM\-START" "1" "December 2021" "" ""
.TH "NPM\-START" "1" "January 2022" "" ""
.SH "NAME"
\fBnpm-start\fR \- Start a package
.SS Synopsis
Expand Down

0 comments on commit f5b8aee

Please sign in to comment.