diff --git a/package.json b/package.json index 421426898..7a3217d93 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "bugs": "https://github.com/oclif/core/issues", "dependencies": { "@oclif/linewrap": "^1.0.0", - "chalk": "^2.4.2", + "chalk": "^4.1.0", "clean-stack": "^3.0.0", "cli-ux": "^5.1.0", "debug": "^4.1.1", @@ -85,7 +85,7 @@ "lint": "eslint . --ext .ts --config .eslintrc", "posttest": "yarn lint", "prepack": "yarn run build", - "test": "mocha --forbid-only \"test/**/*.test.ts\"", + "test": "mocha --forbid-only \"test/**/*.test.ts\" --no-color", "version": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md", "pretest": "yarn build --noEmit && tsc -p test --noEmit" }, diff --git a/src/errors/errors/cli.ts b/src/errors/errors/cli.ts index 8b267a23f..46473ac6e 100644 --- a/src/errors/errors/cli.ts +++ b/src/errors/errors/cli.ts @@ -1,6 +1,6 @@ // tslint:disable no-implicit-dependencies -import Chalk from 'chalk' +import * as Chalk from 'chalk' import Clean = require('clean-stack') import Indent = require('indent-string') import * as Wrap from 'wrap-ansi' diff --git a/src/help/command.ts b/src/help/command.ts index 6a2fdac0c..62dbad64d 100644 --- a/src/help/command.ts +++ b/src/help/command.ts @@ -1,5 +1,5 @@ import * as Config from '../config' -import chalk from 'chalk' +import * as Chalk from 'chalk' import indent = require('indent-string') import stripAnsi = require('strip-ansi') @@ -10,13 +10,13 @@ import {castArray, compact, sortBy, template} from './util' const { underline, bold, -} = chalk +} = Chalk let { dim, -} = chalk +} = Chalk if (process.env.ConEmuANSI === 'ON') { - dim = chalk.gray + dim = Chalk.gray } const wrap = require('wrap-ansi') diff --git a/src/help/index.ts b/src/help/index.ts index 281285a5e..cf062dd5c 100644 --- a/src/help/index.ts +++ b/src/help/index.ts @@ -1,6 +1,6 @@ import * as Config from '../config' import {error} from '../errors' -import chalk from 'chalk' +import * as Chalk from 'chalk' import indent = require('indent-string') import stripAnsi = require('strip-ansi') @@ -14,7 +14,7 @@ import {getHelpClass} from './util' const wrap = require('wrap-ansi') const { bold, -} = chalk +} = Chalk export interface HelpOptions { all?: boolean; diff --git a/src/help/root.ts b/src/help/root.ts index 9121ea976..502d8dba7 100644 --- a/src/help/root.ts +++ b/src/help/root.ts @@ -1,5 +1,5 @@ import * as Config from '../config' -import chalk from 'chalk' +import * as Chalk from 'chalk' import indent = require('indent-string') import stripAnsi = require('strip-ansi') @@ -9,7 +9,7 @@ import {compact, template} from './util' const wrap = require('wrap-ansi') const { bold, -} = chalk +} = Chalk export default class RootHelp { render: (input: string) => string diff --git a/src/parser/help.ts b/src/parser/help.ts index 7239e0ca9..744067b47 100644 --- a/src/parser/help.ts +++ b/src/parser/help.ts @@ -1,4 +1,4 @@ -import Chalk from 'chalk' +import * as Chalk from 'chalk' import Deps from './deps' import {IFlag} from './flags' diff --git a/test/parser/help.test.ts b/test/parser/help.test.ts index 92b372cc8..a621a48d5 100644 --- a/test/parser/help.test.ts +++ b/test/parser/help.test.ts @@ -1,11 +1,8 @@ import {expect} from 'chai' -import chalk from 'chalk' import * as flags from '../../src/parser/flags' import {flagUsages} from '../../src/parser/help' -chalk.enabled = false - describe('flagUsage', () => { it('shows usages', () => { const f = [ diff --git a/test/parser/parse.test.ts b/test/parser/parse.test.ts index f9fd4dfd9..bf402262e 100644 --- a/test/parser/parse.test.ts +++ b/test/parser/parse.test.ts @@ -1,11 +1,8 @@ /* eslint-disable max-nested-callbacks */ import {expect} from 'chai' -import chalk from 'chalk' import {flags, parse} from '../../src/parser' -chalk.enabled = false - describe('parse', () => { it('--bool', () => { const out = parse(['--bool'], {