Skip to content

Commit

Permalink
fix: genericized help
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed May 9, 2018
1 parent 844853a commit 0f54d7d
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 117 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@heroku-cli/color": "^1.1.3",
"@oclif/command": "^1.4.21",
"chalk": "^2.4.1",
"cli-ux": "^4.0.0",
"cli-ux": "^4.0.1",
"debug": "^3.1.0",
"fs-extra": "^6.0.0",
"http-call": "^5.1.2",
Expand All @@ -20,21 +20,21 @@
},
"devDependencies": {
"@oclif/config": "^1.6.17",
"@oclif/dev-cli": "^1.13.18",
"@oclif/errors": "^1.0.9",
"@oclif/dev-cli": "^1.13.19",
"@oclif/errors": "^1.0.10",
"@oclif/plugin-help": "^1.2.10",
"@oclif/test": "^1.0.6",
"@oclif/tslint": "^1.1.1",
"@types/chai": "^4.1.3",
"@types/fs-extra": "^5.0.2",
"@types/load-json-file": "^2.0.7",
"@types/mocha": "^5.2.0",
"@types/node": "^10.0.4",
"@types/node": "^10.0.6",
"@types/semver": "^5.5.0",
"@types/supports-color": "^5.3.0",
"chai": "^4.1.2",
"concurrently": "^3.5.1",
"fancy-test": "^1.0.6",
"fancy-test": "^1.0.8",
"globby": "^8.0.1",
"mocha": "^5.1.1",
"ts-node": "6.0.3",
Expand Down
11 changes: 0 additions & 11 deletions src/commands/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,6 @@ export default class PluginsIndex extends Command {
static description = 'list installed plugins'
static examples = ['$ <%- config.bin %> plugins']

// static examples = [`<%
// let examplePlugins = {
// 'heroku-ci': {version: '1.8.0'},
// 'heroku-cli-status': {version: '3.0.10', type: 'link'},
// 'heroku-fork': {version: '4.1.22'}
// }
// const examplePluginsHelp = Object.entries(examplePlugins).map(([name, p]) => \` \${name} \${p.version}\`).join('\n')
// %>$ <%- config.bin %> plugins
// <%- examplePluginsHelp %>
// `]

plugins = new Plugins(this.config)

async run() {
Expand Down
14 changes: 1 addition & 13 deletions src/commands/plugins/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,10 @@ import cli from 'cli-ux'

import Plugins from '../../plugins'

// let examplePlugin = 'heroku-production-status'
// let bin = 'heroku'
// const g = global as any
// if (g.oclif && g.oclif.config) {
// const config = g.oclif.config
// bin = config.bin
// let pjson = config.pjson.oclif || config.pjson['cli-engine']
// if (pjson.help && pjson.help.plugins) {
// examplePlugin = Object.keys(pjson.help.plugins)[0]
// }
// }

export default class PluginsInstall extends Command {
static description = 'installs a plugin into the CLI'
static usage = 'plugins:install PLUGIN...'
static examples = ['$ <%= config.bin %> plugins:install <%- config.pjson.oclif.examplePlugin || "heroku-production-status" %> ']
static examples = ['$ <%= config.bin %> plugins:install <%- config.pjson.oclif.examplePlugin || "myplugin" %> ']
static strict = false
static args = [{name: 'plugin', description: 'plugin to install', required: true}]
static aliases = ['plugins:add']
Expand Down
4 changes: 2 additions & 2 deletions src/commands/plugins/link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import Plugins from '../../plugins'

export default class PluginsLink extends Command {
static description = 'links a plugin into the CLI for development'
static usage = 'plugins:install PLUGIN...'
static examples = ['$ <%= config.bin %> plugins:install <%- config.pjson.oclif.examplePlugin || "heroku-production-status" %> ']
static usage = 'plugins:link PLUGIN'
static examples = ['$ <%= config.bin %> plugins:link <%- config.pjson.oclif.examplePlugin || "myplugin" %> ']
static args = [{name: 'path', description: 'path to plugin', required: true, default: '.'}]

plugins = new Plugins(this.config)
Expand Down
14 changes: 1 addition & 13 deletions src/commands/plugins/uninstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,12 @@ import cli from 'cli-ux'

import Plugins from '../../plugins'

let examplePlugin = 'heroku-production-status'
let bin = 'heroku'
const g = global as any
if (g.oclif && g.oclif.config) {
const config = g.oclif.config
bin = config.bin
let pjson = config.pjson.oclif || config.pjson['cli-engine']
if (pjson.help && pjson.help.plugins) {
examplePlugin = Object.keys(pjson.help.plugins)[0]
}
}

export default class PluginsUninstall extends Command {
static description = 'removes a plugin from the CLI'
static usage = 'plugins:uninstall PLUGIN...'
static help = `
Example:
$ ${bin} plugins:uninstall ${examplePlugin}
$ <%- config.bin %> plugins:uninstall <%- config.pjson.oclif.examplePlugin || "myplugin" %>
`
static variableArgs = true
static args = [{name: 'plugin', description: 'plugin to uninstall', required: true}]
Expand Down
112 changes: 39 additions & 73 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@
dependencies:
debug "^3.1.0"

"@oclif/dev-cli@^1.13.18":
version "1.13.18"
resolved "https://registry.yarnpkg.com/@oclif/dev-cli/-/dev-cli-1.13.18.tgz#d39c69245c6df1debe3a37c34fa715a5cfc6a48c"
"@oclif/dev-cli@^1.13.19":
version "1.13.19"
resolved "https://registry.yarnpkg.com/@oclif/dev-cli/-/dev-cli-1.13.19.tgz#da43d784d5a3a97922533ab4a9bb3f7c2435d6d0"
dependencies:
"@oclif/command" "^1.4.20"
"@oclif/command" "^1.4.21"
"@oclif/config" "^1.6.17"
"@oclif/errors" "^1.0.8"
"@oclif/errors" "^1.0.9"
"@oclif/plugin-help" "^1.2.10"
cli-ux "^3.4.1"
cli-ux "^4.0.0"
debug "^3.1.0"
fs-extra "^6.0.0"
lodash "^4.17.10"
Expand All @@ -75,6 +75,16 @@
require-resolve "^0.0.2"
tslib "^1.9.0"

"@oclif/errors@^1.0.10":
version "1.0.10"
resolved "https://registry.yarnpkg.com/@oclif/errors/-/errors-1.0.10.tgz#ad57a0158f279ef11e175179995a6281a181b275"
dependencies:
clean-stack "^1.3.0"
fs-extra "^6.0.0"
indent-string "^3.2.0"
strip-ansi "^4.0.0"
wrap-ansi "^3.0.1"

"@oclif/errors@^1.0.8":
version "1.0.8"
resolved "https://registry.yarnpkg.com/@oclif/errors/-/errors-1.0.8.tgz#2f8239267506bb7c3f5fd776144c2686e5b7fff7"
Expand Down Expand Up @@ -156,9 +166,9 @@
version "9.6.5"
resolved "https://registry.yarnpkg.com/@types/node/-/node-9.6.5.tgz#ee700810fdf49ac1c399fc5980b7559b3e5a381d"

"@types/node@^10.0.4":
version "10.0.4"
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.0.4.tgz#130598ee56e9a1210a53f557d64935571f05390d"
"@types/node@^10.0.6":
version "10.0.6"
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.0.6.tgz#c0bce8e539bf34c1b850c13ff46bead2fecc2e58"

"@types/semver@^5.5.0":
version "5.5.0"
Expand All @@ -168,7 +178,7 @@
version "5.3.0"
resolved "https://registry.yarnpkg.com/@types/supports-color/-/supports-color-5.3.0.tgz#eb6a52e9531fb3ebcd401cec774d1bdfb571f793"

ansi-escapes@^3.0.0, ansi-escapes@^3.1.0:
ansi-escapes@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.1.0.tgz#f73207bb81207d75fd6c83f125af26eea378ca30"

Expand Down Expand Up @@ -198,10 +208,6 @@ ansi-styles@^3.2.0, ansi-styles@^3.2.1:
dependencies:
color-convert "^1.9.0"

ansicolors@~0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/ansicolors/-/ansicolors-0.2.1.tgz#be089599097b74a5c9c4a84a0cdbcdb62bd87aef"

ansicolors@~0.3.2:
version "0.3.2"
resolved "https://registry.yarnpkg.com/ansicolors/-/ansicolors-0.3.2.tgz#665597de86a9ffe3aa9bfbe6cae5c6ea426b4979"
Expand Down Expand Up @@ -333,13 +339,6 @@ call-me-maybe@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b"

cardinal@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/cardinal/-/cardinal-1.0.0.tgz#50e21c1b0aa37729f9377def196b5a9cec932ee9"
dependencies:
ansicolors "~0.2.1"
redeyed "~1.0.0"

cardinal@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/cardinal/-/cardinal-2.0.1.tgz#2431630e6c006253b803967249b2d72e50d1985d"
Expand Down Expand Up @@ -415,28 +414,28 @@ clean-stack@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-1.3.0.tgz#9e821501ae979986c46b1d66d2d432db2fd4ae31"

cli-ux@^3.4.1:
version "3.4.1"
resolved "https://registry.yarnpkg.com/cli-ux/-/cli-ux-3.4.1.tgz#bfa17e75cd1a60547a11c515166117b05ea89cdd"
cli-ux@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/cli-ux/-/cli-ux-4.0.0.tgz#8c68b3761332f3714ef3bdf517b5aacda53486b4"
dependencies:
"@oclif/linewrap" "^1.0.0"
"@oclif/screen" "^1.0.2"
ansi-styles "^3.2.1"
cardinal "^1.0.0"
chalk "^2.4.0"
cardinal "^2.0.0"
chalk "^2.4.1"
clean-stack "^1.3.0"
extract-stack "^1.0.0"
fs-extra "^5.0.0"
fs-extra "^6.0.0"
indent-string "^3.2.0"
lodash "^4.17.5"
password-prompt "^1.0.4"
lodash "^4.17.10"
password-prompt "^1.0.5"
semver "^5.5.0"
strip-ansi "^4.0.0"
supports-color "^5.4.0"

cli-ux@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/cli-ux/-/cli-ux-4.0.0.tgz#8c68b3761332f3714ef3bdf517b5aacda53486b4"
cli-ux@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/cli-ux/-/cli-ux-4.0.1.tgz#100f863fc5738db85f031d261276c6c688ef9e81"
dependencies:
"@oclif/linewrap" "^1.0.0"
"@oclif/screen" "^1.0.2"
Expand Down Expand Up @@ -515,14 +514,6 @@ core-util-is@~1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"

cross-spawn@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449"
dependencies:
lru-cache "^4.0.1"
shebang-command "^1.2.0"
which "^1.2.9"

cross-spawn@^6.0.0, cross-spawn@^6.0.5:
version "6.0.5"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
Expand Down Expand Up @@ -620,10 +611,6 @@ esprima@^4.0.0, esprima@~4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804"

esprima@~3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.0.0.tgz#53cf247acda77313e551c3aa2e73342d3fb4f7d9"

esutils@^1.1.6:
version "1.1.6"
resolved "https://registry.yarnpkg.com/esutils/-/esutils-1.1.6.tgz#c01ccaa9ae4b897c6d0c3e210ae52f3c7a844375"
Expand Down Expand Up @@ -693,6 +680,13 @@ fancy-test@^1.0.6:
lodash "^4.17.10"
stdout-stderr "^0.1.9"

fancy-test@^1.0.8:
version "1.0.8"
resolved "https://registry.yarnpkg.com/fancy-test/-/fancy-test-1.0.8.tgz#d66a5ffab73a0792bf3c8404812c5a774f0e3180"
dependencies:
lodash "^4.17.10"
stdout-stderr "^0.1.9"

fast-glob@^2.0.2:
version "2.2.0"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-2.2.0.tgz#e9d032a69b86bef46fc03d935408f02fb211d9fc"
Expand Down Expand Up @@ -1143,17 +1137,10 @@ lodash@^4.17.10:
version "4.17.10"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7"

lodash@^4.17.5, lodash@^4.5.1:
lodash@^4.5.1:
version "4.17.5"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511"

lru-cache@^4.0.1:
version "4.1.2"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.2.tgz#45234b2e6e2f2b33da125624c4664929a0224c3f"
dependencies:
pseudomap "^1.0.2"
yallist "^2.1.2"

make-dir@^1.0.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.2.0.tgz#6d6a49eead4aae296c53bbf3a1a008bd6c89469b"
Expand Down Expand Up @@ -1340,13 +1327,6 @@ pascalcase@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14"

password-prompt@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/password-prompt/-/password-prompt-1.0.4.tgz#933bac8db3528fcb27e9fdbc0a6592adcbdb5ed9"
dependencies:
ansi-escapes "^3.0.0"
cross-spawn "^5.1.0"

password-prompt@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/password-prompt/-/password-prompt-1.0.5.tgz#d2f2effd89bf26d359c87a4678339804ce782b87"
Expand Down Expand Up @@ -1406,10 +1386,6 @@ process-nextick-args@~2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa"

pseudomap@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"

pump@^1.0.0:
version "1.0.3"
resolved "https://registry.yarnpkg.com/pump/-/pump-1.0.3.tgz#5dfe8311c33bbf6fc18261f9f34702c47c08a954"
Expand Down Expand Up @@ -1447,12 +1423,6 @@ readable-stream@^2.0.0, readable-stream@^2.3.5:
string_decoder "~1.1.1"
util-deprecate "~1.0.1"

redeyed@~1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/redeyed/-/redeyed-1.0.1.tgz#e96c193b40c0816b00aec842698e61185e55498a"
dependencies:
esprima "~3.0.0"

redeyed@~2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/redeyed/-/redeyed-2.0.0.tgz#e7ae722cd4ce4dbc537cb5810fef3de2ac76ff12"
Expand Down Expand Up @@ -1961,10 +1931,6 @@ xtend@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"

yallist@^2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"

yarn@^1.6.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/yarn/-/yarn-1.6.0.tgz#9cec6f7986dc237d39ec705ce74d95155fe55d4b"
Expand Down

0 comments on commit 0f54d7d

Please sign in to comment.