From 459846e2d7a73c2f8506c4e6322b1ca9946cc5dc Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdxcode@users.noreply.github.com> Date: Tue, 22 May 2018 17:35:46 -0700 Subject: [PATCH] fix: added stub for certs:auto:wait --- packages/heroku-cli-plugin-certs/package.json | 1 + .../src/commands/certs/auto/wait.ts | 14 ++++++ .../src/commands/hello.ts | 31 ------------ .../test/commands/hello.test.ts | 16 ++----- packages/heroku-cli-plugin-certs/yarn.lock | 48 ++++++++++++++++++- 5 files changed, 65 insertions(+), 45 deletions(-) create mode 100644 packages/heroku-cli-plugin-certs/src/commands/certs/auto/wait.ts delete mode 100644 packages/heroku-cli-plugin-certs/src/commands/hello.ts diff --git a/packages/heroku-cli-plugin-certs/package.json b/packages/heroku-cli-plugin-certs/package.json index 544db10ed1..dd3c4838a4 100644 --- a/packages/heroku-cli-plugin-certs/package.json +++ b/packages/heroku-cli-plugin-certs/package.json @@ -4,6 +4,7 @@ "author": "Jeff Dickey @jdxcode", "bugs": "https://github.com/heroku/heroku-cli-plugin-certs/issues", "dependencies": { + "@heroku-cli/command": "^8.1.18", "@oclif/command": "^1", "@oclif/config": "^1", "tslib": "^1" diff --git a/packages/heroku-cli-plugin-certs/src/commands/certs/auto/wait.ts b/packages/heroku-cli-plugin-certs/src/commands/certs/auto/wait.ts new file mode 100644 index 0000000000..236a391da1 --- /dev/null +++ b/packages/heroku-cli-plugin-certs/src/commands/certs/auto/wait.ts @@ -0,0 +1,14 @@ +import {Command, flags} from '@oclif/command' + +export default class CertsAutoWait extends Command { + static description = 'waits for the certificate to be activated' + static hidden = true + + static flags = { + help: flags.help({char: 'h'}), + } + + async run() { + this.parse(CertsAutoWait) + } +} diff --git a/packages/heroku-cli-plugin-certs/src/commands/hello.ts b/packages/heroku-cli-plugin-certs/src/commands/hello.ts deleted file mode 100644 index c0413e6973..0000000000 --- a/packages/heroku-cli-plugin-certs/src/commands/hello.ts +++ /dev/null @@ -1,31 +0,0 @@ -import {Command, flags} from '@oclif/command' - -export default class Hello extends Command { - static description = 'describe the command here' - - static examples = [ - `$ oclif-example hello -hello world from ./src/hello.ts! -`, - ] - - static flags = { - help: flags.help({char: 'h'}), - // flag with a value (-n, --name=VALUE) - name: flags.string({char: 'n', description: 'name to print'}), - // flag with no value (-f, --force) - force: flags.boolean({char: 'f'}), - } - - static args = [{name: 'file'}] - - async run() { - const {args, flags} = this.parse(Hello) - - const name = flags.name || 'world' - this.log(`hello ${name} from ./src/commands/hello.ts`) - if (args.file && flags.force) { - this.log(`you input --force and --file: ${args.file}`) - } - } -} diff --git a/packages/heroku-cli-plugin-certs/test/commands/hello.test.ts b/packages/heroku-cli-plugin-certs/test/commands/hello.test.ts index 5d22255c27..3bae54ed84 100644 --- a/packages/heroku-cli-plugin-certs/test/commands/hello.test.ts +++ b/packages/heroku-cli-plugin-certs/test/commands/hello.test.ts @@ -1,17 +1,7 @@ -import {expect, test} from '@oclif/test' +import {test} from '@oclif/test' -describe('hello', () => { +describe('certs:auto:wait', () => { test .stdout() - .command(['hello']) - .it('runs hello', ctx => { - expect(ctx.stdout).to.contain('hello world') - }) - - test - .stdout() - .command(['hello', '--name', 'jeff']) - .it('runs hello --name jeff', ctx => { - expect(ctx.stdout).to.contain('hello jeff') - }) + .it('runs certs:auto:wait', () => { }) }) diff --git a/packages/heroku-cli-plugin-certs/yarn.lock b/packages/heroku-cli-plugin-certs/yarn.lock index 5c5011dd3c..e15d5c3da6 100644 --- a/packages/heroku-cli-plugin-certs/yarn.lock +++ b/packages/heroku-cli-plugin-certs/yarn.lock @@ -18,6 +18,28 @@ reflect-metadata "^0.1.12" tslib "^1.8.1" +"@heroku-cli/color@^1.1.5": + version "1.1.5" + resolved "https://registry.yarnpkg.com/@heroku-cli/color/-/color-1.1.5.tgz#d98781513f8daebb21aaaf54c9e8d497db3efcfb" + dependencies: + ansi-styles "^3.2.1" + chalk "^2.4.1" + strip-ansi "^4.0.0" + supports-color "^5.4.0" + +"@heroku-cli/command@^8.1.18": + version "8.1.18" + resolved "https://registry.yarnpkg.com/@heroku-cli/command/-/command-8.1.18.tgz#aef5e327ebfd05f0f236730ffc578db8f1183fe0" + dependencies: + "@heroku-cli/color" "^1.1.5" + "@oclif/errors" "^1.1.1" + cli-ux "^4.3.0" + debug "^3.1.0" + heroku-client "^3.0.6" + http-call "^5.1.2" + netrc-parser "^3.1.4" + opn "^5.3.0" + "@mrmlnc/readdir-enhanced@^2.2.1": version "2.2.1" resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde" @@ -961,6 +983,13 @@ he@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" +heroku-client@^3.0.6: + version "3.0.6" + resolved "https://registry.yarnpkg.com/heroku-client/-/heroku-client-3.0.6.tgz#bf603716a9d469682d4f7f80489276d82b896305" + dependencies: + is-retry-allowed "^1.0.0" + tunnel-agent "^0.6.0" + hosted-git-info@^2.1.4: version "2.6.0" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.6.0.tgz#23235b29ab230c576aab0d4f13fc046b0b038222" @@ -1138,7 +1167,7 @@ is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" -is-retry-allowed@^1.1.0: +is-retry-allowed@^1.0.0, is-retry-allowed@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34" @@ -1154,6 +1183,10 @@ is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" +is-wsl@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" + isarray@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" @@ -1478,6 +1511,13 @@ nanomatch@^1.2.9: snapdragon "^0.8.1" to-regex "^3.0.1" +netrc-parser@^3.1.4: + version "3.1.5" + resolved "https://registry.yarnpkg.com/netrc-parser/-/netrc-parser-3.1.5.tgz#77937b6feb27f8dda143d38fac6bbdbcafd480a7" + dependencies: + debug "^3.1.0" + execa "^0.10.0" + nice-try@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.4.tgz#d93962f6c52f2c1558c0fbda6d512819f1efe1c4" @@ -1563,6 +1603,12 @@ once@^1.3.0, once@^1.3.1, once@^1.4.0: dependencies: wrappy "1" +opn@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/opn/-/opn-5.3.0.tgz#64871565c863875f052cfdf53d3e3cb5adb53b1c" + dependencies: + is-wsl "^1.1.0" + optimist@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686"