summaryrefslogtreecommitdiff
path: root/deps/npm/lib/commands
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/lib/commands')
-rw-r--r--deps/npm/lib/commands/cache.js6
-rw-r--r--deps/npm/lib/commands/deprecate.js2
-rw-r--r--deps/npm/lib/commands/dist-tag.js8
-rw-r--r--deps/npm/lib/commands/explain.js2
-rw-r--r--deps/npm/lib/commands/fund.js2
-rw-r--r--deps/npm/lib/commands/init.js4
-rw-r--r--deps/npm/lib/commands/install.js13
-rw-r--r--deps/npm/lib/commands/link.js3
-rw-r--r--deps/npm/lib/commands/ls.js2
-rw-r--r--deps/npm/lib/commands/outdated.js2
-rw-r--r--deps/npm/lib/commands/owner.js6
-rw-r--r--deps/npm/lib/commands/pack.js2
-rw-r--r--deps/npm/lib/commands/publish.js2
-rw-r--r--deps/npm/lib/commands/rebuild.js2
-rw-r--r--deps/npm/lib/commands/star.js2
-rw-r--r--deps/npm/lib/commands/unpublish.js2
-rw-r--r--deps/npm/lib/commands/view.js11
17 files changed, 32 insertions, 39 deletions
diff --git a/deps/npm/lib/commands/cache.js b/deps/npm/lib/commands/cache.js
index 862f346adb..bc52889c00 100644
--- a/deps/npm/lib/commands/cache.js
+++ b/deps/npm/lib/commands/cache.js
@@ -68,11 +68,7 @@ class Cache extends BaseCommand {
static name = 'cache'
static params = ['cache']
static usage = [
- 'add <tarball file>',
- 'add <folder>',
- 'add <tarball url>',
- 'add <git url>',
- 'add <name>@<version>',
+ 'add <package-spec>',
'clean [<key>]',
'ls [<name>@<version>]',
'verify',
diff --git a/deps/npm/lib/commands/deprecate.js b/deps/npm/lib/commands/deprecate.js
index 0ae88f1921..862c214dbe 100644
--- a/deps/npm/lib/commands/deprecate.js
+++ b/deps/npm/lib/commands/deprecate.js
@@ -9,7 +9,7 @@ const BaseCommand = require('../base-command.js')
class Deprecate extends BaseCommand {
static description = 'Deprecate a version of a package'
static name = 'deprecate'
- static usage = ['<pkg>[@<version>] <message>']
+ static usage = ['<package-spec> <message>']
static params = [
'registry',
'otp',
diff --git a/deps/npm/lib/commands/dist-tag.js b/deps/npm/lib/commands/dist-tag.js
index a207e422cb..e74a3f1d43 100644
--- a/deps/npm/lib/commands/dist-tag.js
+++ b/deps/npm/lib/commands/dist-tag.js
@@ -12,9 +12,9 @@ class DistTag extends BaseCommand {
static params = ['workspace', 'workspaces', 'include-workspace-root']
static name = 'dist-tag'
static usage = [
- 'add <pkg>@<version> [<tag>]',
- 'rm <pkg> <tag>',
- 'ls [<pkg>]',
+ 'add <package-spec (with version)> [<tag>]',
+ 'rm <package-spec> <tag>',
+ 'ls [<package-spec>]',
]
static ignoreImplicitWorkspace = false
@@ -90,7 +90,7 @@ class DistTag extends BaseCommand {
log.verbose('dist-tag add', defaultTag, 'to', spec.name + '@' + version)
if (!spec.name || !version || !defaultTag) {
- throw this.usageError()
+ throw this.usageError('must provide a spec with a name and version, and a tag to add')
}
const t = defaultTag.trim()
diff --git a/deps/npm/lib/commands/explain.js b/deps/npm/lib/commands/explain.js
index ca6ee7540b..c0ef04548a 100644
--- a/deps/npm/lib/commands/explain.js
+++ b/deps/npm/lib/commands/explain.js
@@ -10,7 +10,7 @@ const ArboristWorkspaceCmd = require('../arborist-cmd.js')
class Explain extends ArboristWorkspaceCmd {
static description = 'Explain installed packages'
static name = 'explain'
- static usage = ['<folder | specifier>']
+ static usage = ['<package-spec>']
static params = [
'json',
'workspace',
diff --git a/deps/npm/lib/commands/fund.js b/deps/npm/lib/commands/fund.js
index 09ca81653b..9690cbc32e 100644
--- a/deps/npm/lib/commands/fund.js
+++ b/deps/npm/lib/commands/fund.js
@@ -20,7 +20,7 @@ class Fund extends ArboristWorkspaceCmd {
static description = 'Retrieve funding information'
static name = 'fund'
static params = ['json', 'browser', 'unicode', 'workspace', 'which']
- static usage = ['[[<@scope>/]<pkg>]']
+ static usage = ['[<package-spec>]']
// TODO
/* istanbul ignore next */
diff --git a/deps/npm/lib/commands/init.js b/deps/npm/lib/commands/init.js
index 4c299e6513..b8b6bd5d53 100644
--- a/deps/npm/lib/commands/init.js
+++ b/deps/npm/lib/commands/init.js
@@ -18,6 +18,7 @@ class Init extends BaseCommand {
static params = [
'yes',
'force',
+ 'scope',
'workspace',
'workspaces',
'workspaces-update',
@@ -26,9 +27,8 @@ class Init extends BaseCommand {
static name = 'init'
static usage = [
- '[--force|-f|--yes|-y|--scope]',
+ '<package-spec> (same as `npx <package-spec>)',
'<@scope> (same as `npx <@scope>/create`)',
- '[<@scope>/]<name> (same as `npx [<@scope>/]create-<name>`)',
]
static ignoreImplicitWorkspace = false
diff --git a/deps/npm/lib/commands/install.js b/deps/npm/lib/commands/install.js
index 4cda364483..ecc0727a2e 100644
--- a/deps/npm/lib/commands/install.js
+++ b/deps/npm/lib/commands/install.js
@@ -34,18 +34,7 @@ class Install extends ArboristWorkspaceCmd {
...super.params,
]
- static usage = [
- '[<@scope>/]<pkg>',
- '[<@scope>/]<pkg>@<tag>',
- '[<@scope>/]<pkg>@<version>',
- '[<@scope>/]<pkg>@<version range>',
- '<alias>@npm:<name>',
- '<folder>',
- '<tarball file>',
- '<tarball url>',
- '<git:// url>',
- '<github username>/<github project>',
- ]
+ static usage = ['[<package-spec> ...]']
async completion (opts) {
const { partialWord } = opts
diff --git a/deps/npm/lib/commands/link.js b/deps/npm/lib/commands/link.js
index 80a60d36e3..b0b889ea78 100644
--- a/deps/npm/lib/commands/link.js
+++ b/deps/npm/lib/commands/link.js
@@ -15,8 +15,7 @@ class Link extends ArboristWorkspaceCmd {
static description = 'Symlink a package folder'
static name = 'link'
static usage = [
- '(in package dir)',
- '[<@scope>/]<pkg>[@<version>]',
+ '[<package-spec>]',
]
static params = [
diff --git a/deps/npm/lib/commands/ls.js b/deps/npm/lib/commands/ls.js
index cfd9cb5a50..d3932072b7 100644
--- a/deps/npm/lib/commands/ls.js
+++ b/deps/npm/lib/commands/ls.js
@@ -27,7 +27,7 @@ const localeCompare = require('@isaacs/string-locale-compare')('en')
class LS extends ArboristWorkspaceCmd {
static description = 'List installed packages'
static name = 'ls'
- static usage = ['[[<@scope>/]<pkg> ...]']
+ static usage = ['<package-spec>']
static params = [
'all',
'json',
diff --git a/deps/npm/lib/commands/outdated.js b/deps/npm/lib/commands/outdated.js
index 081e75a2c6..042b776f71 100644
--- a/deps/npm/lib/commands/outdated.js
+++ b/deps/npm/lib/commands/outdated.js
@@ -15,7 +15,7 @@ const ArboristWorkspaceCmd = require('../arborist-cmd.js')
class Outdated extends ArboristWorkspaceCmd {
static description = 'Check for outdated packages'
static name = 'outdated'
- static usage = ['[[<@scope>/]<pkg> ...]']
+ static usage = ['[<package-spec> ...]']
static params = [
'all',
'json',
diff --git a/deps/npm/lib/commands/owner.js b/deps/npm/lib/commands/owner.js
index 4797e9c7ec..732bb40a30 100644
--- a/deps/npm/lib/commands/owner.js
+++ b/deps/npm/lib/commands/owner.js
@@ -27,9 +27,9 @@ class Owner extends BaseCommand {
]
static usage = [
- 'add <user> [<@scope>/]<pkg>',
- 'rm <user> [<@scope>/]<pkg>',
- 'ls [<@scope>/]<pkg>',
+ 'add <user> <package-spec>',
+ 'rm <user> <package-spec>',
+ 'ls <package-spec>',
]
static ignoreImplicitWorkspace = false
diff --git a/deps/npm/lib/commands/pack.js b/deps/npm/lib/commands/pack.js
index 8190ceecaf..c6a7480464 100644
--- a/deps/npm/lib/commands/pack.js
+++ b/deps/npm/lib/commands/pack.js
@@ -17,7 +17,7 @@ class Pack extends BaseCommand {
'include-workspace-root',
]
- static usage = ['[[<@scope>/]<pkg>...]']
+ static usage = ['<package-spec>']
static ignoreImplicitWorkspace = false
async exec (args) {
diff --git a/deps/npm/lib/commands/publish.js b/deps/npm/lib/commands/publish.js
index da6437fa9c..579f5d6e74 100644
--- a/deps/npm/lib/commands/publish.js
+++ b/deps/npm/lib/commands/publish.js
@@ -37,7 +37,7 @@ class Publish extends BaseCommand {
'include-workspace-root',
]
- static usage = ['[<folder>]']
+ static usage = ['<package-spec>']
static ignoreImplicitWorkspace = false
async exec (args) {
diff --git a/deps/npm/lib/commands/rebuild.js b/deps/npm/lib/commands/rebuild.js
index 3e6046d8df..d06313ce48 100644
--- a/deps/npm/lib/commands/rebuild.js
+++ b/deps/npm/lib/commands/rebuild.js
@@ -16,7 +16,7 @@ class Rebuild extends ArboristWorkspaceCmd {
...super.params,
]
- static usage = ['[[<@scope>/]<name>[@<version>] ...]']
+ static usage = ['[<package-spec>] ...]']
// TODO
/* istanbul ignore next */
diff --git a/deps/npm/lib/commands/star.js b/deps/npm/lib/commands/star.js
index 7b76be3c16..20039bf893 100644
--- a/deps/npm/lib/commands/star.js
+++ b/deps/npm/lib/commands/star.js
@@ -7,7 +7,7 @@ const BaseCommand = require('../base-command.js')
class Star extends BaseCommand {
static description = 'Mark your favorite packages'
static name = 'star'
- static usage = ['[<pkg>...]']
+ static usage = ['[<package-spec>...]']
static params = [
'registry',
'unicode',
diff --git a/deps/npm/lib/commands/unpublish.js b/deps/npm/lib/commands/unpublish.js
index f27be2e41c..ab929d98ca 100644
--- a/deps/npm/lib/commands/unpublish.js
+++ b/deps/npm/lib/commands/unpublish.js
@@ -20,7 +20,7 @@ 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>]']
+ static usage = ['[<package-spec>]']
static ignoreImplicitWorkspace = false
async getKeysOfVersions (name, opts) {
diff --git a/deps/npm/lib/commands/view.js b/deps/npm/lib/commands/view.js
index efb298a03b..3b8524ad3f 100644
--- a/deps/npm/lib/commands/view.js
+++ b/deps/npm/lib/commands/view.js
@@ -33,7 +33,7 @@ class View extends BaseCommand {
static ignoreImplicitWorkspace = false
- static usage = ['[<@scope>/]<pkg>[@<version>] [<field>[.subfield]...]']
+ static usage = ['[<package-spec>] [<field>[.subfield]...]']
async completion (opts) {
if (opts.conf.argv.remain.length <= 2) {
@@ -236,6 +236,15 @@ class View extends BaseCommand {
}
})
+ // No data has been pushed because no data is matching the specified version
+ if (data.length === 0 && version !== 'latest') {
+ const er = new Error(`No match found for version ${version}`)
+ er.statusCode = 404
+ er.code = 'E404'
+ er.pkgid = `${pckmnt._id}@${version}`
+ throw er
+ }
+
if (
!this.npm.config.get('json') &&
args.length === 1 &&