From 79968559a90a07ff491e9e421f0c2ebc3f0c7c28 Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdxcode@users.noreply.github.com> Date: Fri, 14 Sep 2018 01:31:42 -0700 Subject: [PATCH] fix: updated deps --- .circleci/config.yml | 6 +-- .circleci/greenkeeper | 25 ------------ package.json | 4 +- src/errors/cli.ts | 4 +- src/handle.ts | 4 +- test/handle.test.ts | 94 +++++++++++++++++++++---------------------- test/warn.test.ts | 20 ++++----- yarn.lock | 23 ++++++----- 8 files changed, 78 insertions(+), 102 deletions(-) delete mode 100755 .circleci/greenkeeper diff --git a/.circleci/config.yml b/.circleci/config.yml index 44014b4..3cd7f15 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,8 +13,8 @@ jobs: keys: - v1-yarn-{{checksum ".circleci/config.yml"}}-{{ checksum "yarn.lock"}} - v1-yarn-{{checksum ".circleci/config.yml"}} - - run: .circleci/greenkeeper - - run: yarn add -D nyc@11 @oclif/nyc-config@0 + - run: yarn + - run: yarn add -D nyc@13 @oclif/nyc-config@1 - run: | $NYC yarn test $NYC report --reporter text-lcov > coverage.lcov @@ -29,7 +29,7 @@ jobs: - add_ssh_keys - checkout - restore_cache: *restore_cache - - run: yarn global add @oclif/semantic-release@1 semantic-release@12 + - run: yarn global add @oclif/semantic-release@3 semantic-release@15 - run: yarn --frozen-lockfile - run: | export PATH=/usr/local/share/.config/yarn/global/node_modules/.bin:$PATH diff --git a/.circleci/greenkeeper b/.circleci/greenkeeper deleted file mode 100755 index bf73a3e..0000000 --- a/.circleci/greenkeeper +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -PATH=/usr/local/share/.config/yarn/global/node_modules/.bin:$PATH - -if [[ "$CIRCLE_BRANCH" != greenkeeper/* ]]; then - yarn - # yarn check - exit 0 -fi - -if [[ ! -z "$GIT_EMAIL" ]] & [[ ! -z "$GIT_USERNAME" ]]; then - git config --global push.default simple - git config --global user.email "$GIT_EMAIL" - git config --global user.name "$GIT_USERNAME" -fi - -if [[ ! -x "$(command -v greenkeeper-lockfile-update)" ]]; then - yarn global add greenkeeper-lockfile@1 -fi - -greenkeeper-lockfile-update -yarn -greenkeeper-lockfile-upload diff --git a/package.json b/package.json index 9646b61..d86c5bb 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "wrap-ansi": "^4.0.0" }, "devDependencies": { - "@oclif/tslint": "^2.0.0", + "@oclif/tslint": "^3.1.0", "@types/chai": "^4.1.4", "@types/clean-stack": "^1.3.0", "@types/fs-extra": "^5.0.4", @@ -23,7 +23,7 @@ "@types/wrap-ansi": "^3.0.0", "chai": "^4.1.2", "chalk": "^2.4.1", - "fancy-test": "^1.4.0", + "fancy-test": "^1.4.1", "mocha": "^5.2.0", "ts-node": "^7.0.1", "tslint": "^5.11.0", diff --git a/src/errors/cli.ts b/src/errors/cli.ts index fa292ba..43d38ec 100644 --- a/src/errors/cli.ts +++ b/src/errors/cli.ts @@ -45,7 +45,7 @@ export class CLIError extends Error { protected get bang() { let red: typeof Chalk.red = ((s: string) => s) as any - try {red = require('chalk').red} catch {} + try { red = require('chalk').red } catch {} return red(process.platform === 'win32' ? '»' : '›') } } @@ -59,7 +59,7 @@ export namespace CLIError { protected get bang() { let yellow: typeof Chalk.yellow = ((s: string) => s) as any - try {yellow = require('chalk').yellow} catch {} + try { yellow = require('chalk').yellow } catch {} return yellow(process.platform === 'win32' ? '»' : '›') } } diff --git a/src/handle.ts b/src/handle.ts index e336018..b09006a 100644 --- a/src/handle.ts +++ b/src/handle.ts @@ -16,8 +16,8 @@ export const handle = (err: any) => { if (config.errorLogger && err.code !== 'EEXIT') { config.errorLogger.log(stack) config.errorLogger.flush() - .then(() => process.exit(exitCode)) - .catch(console.error) + .then(() => process.exit(exitCode)) + .catch(console.error) } else process.exit(exitCode) } catch (e) { console.error(err.stack) diff --git a/test/handle.test.ts b/test/handle.test.ts index 17ff317..1b85c73 100644 --- a/test/handle.test.ts +++ b/test/handle.test.ts @@ -19,61 +19,61 @@ describe('handle', () => { }) fancy - .stderr() - .finally(() => delete process.exitCode) - .it('displays an error from root handle module', ctx => { - require('../handle')(new Error('x')) - expect(ctx.stderr).to.contain('Error: x') - expect(process.exitCode).to.equal(1) - }) + .stderr() + .finally(() => delete process.exitCode) + .it('displays an error from root handle module', ctx => { + require('../handle')(new Error('x')) + expect(ctx.stderr).to.contain('Error: x') + expect(process.exitCode).to.equal(1) + }) fancy - .stderr() - .finally(() => delete process.exitCode) - .it('shows an unhandled error', ctx => { - handle(new Error('x')) - expect(ctx.stderr).to.contain('Error: x') - expect(process.exitCode).to.equal(1) - }) + .stderr() + .finally(() => delete process.exitCode) + .it('shows an unhandled error', ctx => { + handle(new Error('x')) + expect(ctx.stderr).to.contain('Error: x') + expect(process.exitCode).to.equal(1) + }) fancy - .stderr() - .finally(() => delete process.exitCode) - .it('handles a badly formed error object', () => { - handle({status: 400}) - expect(process.exitCode).to.equal(1) - }) + .stderr() + .finally(() => delete process.exitCode) + .it('handles a badly formed error object', () => { + handle({status: 400}) + expect(process.exitCode).to.equal(1) + }) fancy - .stderr() - .finally(() => delete process.exitCode) - .it('shows a cli error', ctx => { - handle(new CLIError('x')) - expect(ctx.stderr).to.equal(` ${x} Error: x\n`) - expect(process.exitCode).to.equal(2) - }) + .stderr() + .finally(() => delete process.exitCode) + .it('shows a cli error', ctx => { + handle(new CLIError('x')) + expect(ctx.stderr).to.equal(` ${x} Error: x\n`) + expect(process.exitCode).to.equal(2) + }) fancy - .stdout() - .stderr() - .finally(() => delete process.exitCode) - .it('hides an exit error', ctx => { - handle(new ExitError()) - expect(ctx.stdout).to.equal('') - expect(ctx.stderr).to.equal('') - expect(process.exitCode).to.equal(0) - }) + .stdout() + .stderr() + .finally(() => delete process.exitCode) + .it('hides an exit error', ctx => { + handle(new ExitError()) + expect(ctx.stdout).to.equal('') + expect(ctx.stderr).to.equal('') + expect(process.exitCode).to.equal(0) + }) fancy - .stderr() - .do(() => config.errlog = errlog) - .finally(() => config.errlog = undefined) - .finally(() => delete process.exitCode) - .it('logs when errlog is set', async ctx => { - handle(new CLIError('uh oh!')) - expect(ctx.stderr).to.equal(` ${x} Error: uh oh!\n`) - await config.errorLogger!.flush() - expect(fs.readFileSync(errlog, 'utf8')).to.contain('Error: uh oh!') - expect(process.exitCode).to.equal(2) - }) + .stderr() + .do(() => config.errlog = errlog) + .finally(() => config.errlog = undefined) + .finally(() => delete process.exitCode) + .it('logs when errlog is set', async ctx => { + handle(new CLIError('uh oh!')) + expect(ctx.stderr).to.equal(` ${x} Error: uh oh!\n`) + await config.errorLogger!.flush() + expect(fs.readFileSync(errlog, 'utf8')).to.contain('Error: uh oh!') + expect(process.exitCode).to.equal(2) + }) }) diff --git a/test/warn.test.ts b/test/warn.test.ts index 2b32c76..da2e48b 100644 --- a/test/warn.test.ts +++ b/test/warn.test.ts @@ -8,14 +8,14 @@ const errlog = path.join(__dirname, '../tmp/mytest/warn.log') describe('warn', () => { fancy - .stderr() - .do(() => config.errlog = errlog) - .finally(() => config.errlog = undefined) - .it('warns', async ctx => { - warn('foo!') - expect(ctx.stderr).to.contain('Warning: foo!') - expect(process.exitCode).to.be.undefined - await config.errorLogger!.flush() - expect(fs.readFileSync(errlog, 'utf8')).to.contain('Warning: foo!') - }) + .stderr() + .do(() => config.errlog = errlog) + .finally(() => config.errlog = undefined) + .it('warns', async ctx => { + warn('foo!') + expect(ctx.stderr).to.contain('Warning: foo!') + expect(process.exitCode).to.be.undefined + await config.errorLogger!.flush() + expect(fs.readFileSync(errlog, 'utf8')).to.contain('Warning: foo!') + }) }) diff --git a/yarn.lock b/yarn.lock index 0789239..d5ffa92 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19,10 +19,11 @@ reflect-metadata "^0.1.12" tslib "^1.8.1" -"@oclif/tslint@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@oclif/tslint/-/tslint-2.0.0.tgz#6eb3a43cc288e0e8d84bc0808c3fbcba00d00ea6" +"@oclif/tslint@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@oclif/tslint/-/tslint-3.1.0.tgz#4beea4ddeeb9e8964f4c9d15d25349db799311a6" dependencies: + tslint-eslint-rules "^5.4.0" tslint-xo "^0.9.0" "@types/chai@^4.1.4": @@ -238,9 +239,9 @@ esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" -fancy-test@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/fancy-test/-/fancy-test-1.4.0.tgz#93e8b1904afbcefb496f58a05f6d2d99fc9c4acc" +fancy-test@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/fancy-test/-/fancy-test-1.4.1.tgz#c87267e01c71185ef4cd5a9cf508eb7e3adbdc94" dependencies: "@types/chai" "^4.1.4" "@types/lodash" "^4.14.116" @@ -248,7 +249,7 @@ fancy-test@^1.4.0: "@types/nock" "^9.3.0" "@types/node" "^10.9.4" "@types/sinon" "^5.0.2" - lodash "^4.17.10" + lodash "^4.17.11" mock-stdin "^0.3.1" stdout-stderr "^0.1.9" @@ -349,9 +350,9 @@ jsonfile@^4.0.0: optionalDependencies: graceful-fs "^4.1.6" -lodash@^4.17.10: - version "4.17.10" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" +lodash@^4.17.11: + version "4.17.11" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" make-error@^1.1.1: version "1.3.4" @@ -513,7 +514,7 @@ tslint-consistent-codestyle@^1.11.0: tslib "^1.7.1" tsutils "^2.27.0" -tslint-eslint-rules@^5.3.1: +tslint-eslint-rules@^5.3.1, tslint-eslint-rules@^5.4.0: version "5.4.0" resolved "https://registry.yarnpkg.com/tslint-eslint-rules/-/tslint-eslint-rules-5.4.0.tgz#e488cc9181bf193fe5cd7bfca213a7695f1737b5" dependencies: