diff --git a/bin/weex.js b/bin/weex.js index 1b9187a..f4884fb 100755 --- a/bin/weex.js +++ b/bin/weex.js @@ -3,7 +3,7 @@ // first, do a sniff test to ensure our dependencies are met const sniff = require('../lib/sniff') -const colors = require('colors') +const colors = require('@colors/colors') // check the node version if (!sniff.isNewEnough) { @@ -16,4 +16,4 @@ require('../lib/cli')(process.argv); process.on('SIGINT', function () { process.exit(); -}); \ No newline at end of file +}); diff --git a/lib/cli.js b/lib/cli.js index 46605c0..e69188f 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -3,7 +3,7 @@ const debug = require('debug')('weex:cli'); const pkg = require('../package.json'); -const colors = require('colors/safe'); +const colors = require('@colors/colors/safe'); const semver = require('semver'); const spawn = require('cross-spawn'); const path = require('path'); diff --git a/lib/utils.js b/lib/utils.js index 2699fa0..6a0e6b2 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -3,7 +3,7 @@ const debug = require('debug')('weex:cli'); const fse = require('fs-extra'); const path = require('path'); -const colors = require('colors'); +const colors = require('@colors/colors'); const onExist = require('on-exit'); const trash = require('./trash'); const installer = require('./installer'); @@ -181,4 +181,4 @@ module.exports = { readJson, install, confirm -} \ No newline at end of file +} diff --git a/package.json b/package.json index 1c65384..dce6be2 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "author": "Mario ", "license": "MIT", "dependencies": { - "colors": "^1.3.0", + "@colors/colors": "^1.3.0", "cross-spawn": "^6.0.5", "debug": "^3.1.0", "fs-extra": "^6.0.1", @@ -37,6 +37,7 @@ "yargs-parser": "^10.1.0" }, "devDependencies": { + "co": "^4.6.0", "eslint": "^5.11.1", "eslint-plugin-node": "^8.0.0", "jest": "^23.6.0", diff --git a/packages/@weex/core/src/extensions/logger-extension.test.ts b/packages/@weex/core/src/extensions/logger-extension.test.ts index c908c45..b7beabf 100644 --- a/packages/@weex/core/src/extensions/logger-extension.test.ts +++ b/packages/@weex/core/src/extensions/logger-extension.test.ts @@ -35,7 +35,7 @@ test('spin', () => { expect(typeof logger.spin).toBe('function') }) -test('colors', () => { +test('@colors/colors', () => { expect(typeof logger.colors.highlight).toBe('function') expect(typeof logger.colors.info).toBe('function') expect(typeof logger.colors.warning).toBe('function') diff --git a/packages/@weex/core/src/toolbox/installer-tools.ts b/packages/@weex/core/src/toolbox/installer-tools.ts index b587ac0..1d1df7a 100644 --- a/packages/@weex/core/src/toolbox/installer-tools.ts +++ b/packages/@weex/core/src/toolbox/installer-tools.ts @@ -1,6 +1,6 @@ import { fs } from './fs-tools' import * as path from 'path' -import * as importedColors from 'colors/safe' +import * as importedColors from '@colors/colors/safe' import { InstallerOption } from './installer-types' import * as childProcess from 'child_process' import * as npmii from 'npminstall' diff --git a/packages/@weex/core/src/toolbox/logger-tools.test.ts b/packages/@weex/core/src/toolbox/logger-tools.test.ts index 247ebed..b09d466 100644 --- a/packages/@weex/core/src/toolbox/logger-tools.test.ts +++ b/packages/@weex/core/src/toolbox/logger-tools.test.ts @@ -55,7 +55,7 @@ test('progress', () => { expect(typeof progress.setTemplate).toBe('function') }) -test('colors', () => { +test('@colors/colors', () => { expect(typeof logger.colors.highlight).toBe('function') expect(typeof logger.colors.info).toBe('function') expect(typeof logger.colors.warning).toBe('function') diff --git a/packages/@weex/core/src/toolbox/logger-tools.ts b/packages/@weex/core/src/toolbox/logger-tools.ts index 94131e7..b7b7093 100644 --- a/packages/@weex/core/src/toolbox/logger-tools.ts +++ b/packages/@weex/core/src/toolbox/logger-tools.ts @@ -1,5 +1,5 @@ import * as CLITable from 'cli-table2' -import * as importedColors from 'colors/safe' +import * as importedColors from '@colors/colors/safe' import * as Gauge from 'gauge' import { commandInfo } from './meta-tools' import { Toolbox } from '../core/toolbox' diff --git a/packages/@weex/plugins/doctor/src/doctor.ts b/packages/@weex/plugins/doctor/src/doctor.ts index 45488a6..60a3445 100644 --- a/packages/@weex/plugins/doctor/src/doctor.ts +++ b/packages/@weex/plugins/doctor/src/doctor.ts @@ -18,7 +18,7 @@ import { AndroidWorkflow, AndroidValidator } from './android/android-workflow' import { IOSWorkflow, IOSValidator } from './ios/ios-workflow' import { isWindows } from '@weex-cli/utils/lib/platform/platform' -import * as colors from 'colors' +import * as colors from '@colors/colors' export const enum ValidationType { missing, diff --git a/packages/@weex/plugins/plugin/src/plugin.ts b/packages/@weex/plugins/plugin/src/plugin.ts index e059009..edff400 100644 --- a/packages/@weex/plugins/plugin/src/plugin.ts +++ b/packages/@weex/plugins/plugin/src/plugin.ts @@ -20,7 +20,7 @@ import * as fse from 'fs-extra' import * as path from 'path' import * as xcode from 'xcode' import * as merge from 'merge' -import * as colors from 'colors' +import * as colors from '@colors/colors' import * as plist from 'plist' import * as EventEmitter from 'events' import { LOGLEVEL } from './log-types' diff --git a/scripts/verifyCommitMessage.js b/scripts/verifyCommitMessage.js index 91ae334..6763c59 100644 --- a/scripts/verifyCommitMessage.js +++ b/scripts/verifyCommitMessage.js @@ -1,5 +1,5 @@ -const colors = require('colors') // eslint-disable-line +const colors = require('@colors/colors') // eslint-disable-line const msgPath = process.env.GIT_PARAMS const msg = require('fs').readFileSync(msgPath, 'utf-8').trim()