diff --git a/dev-infra/build-worker.js b/dev-infra/build-worker.js index 84cb6bd41e..1595a4bc4c 100644 --- a/dev-infra/build-worker.js +++ b/dev-infra/build-worker.js @@ -1,11 +1,9 @@ 'use strict'; -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - var tslib = require('tslib'); var fs = require('fs'); var path = require('path'); -var chalk = _interopDefault(require('chalk')); +var chalk = require('chalk'); require('inquirer'); var child_process = require('child_process'); var semver = require('semver'); @@ -470,12 +468,7 @@ function gitOutputAsArray(gitCommandResult) { * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ -/** Reexport of chalk colors for convenient access. */ -var red = chalk.red; -var green = chalk.green; var yellow = chalk.yellow; -var bold = chalk.bold; -var blue = chalk.blue; /** * Supported levels for logging functions. * diff --git a/dev-infra/ng-dev.js b/dev-infra/ng-dev.js index 692a5300fe..4089067483 100755 --- a/dev-infra/ng-dev.js +++ b/dev-infra/ng-dev.js @@ -5,7 +5,7 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau var yargs = require('yargs'); var tslib = require('tslib'); -var chalk = _interopDefault(require('chalk')); +var chalk = require('chalk'); var fs = require('fs'); var inquirer = require('inquirer'); var path = require('path'); diff --git a/dev-infra/utils/console.ts b/dev-infra/utils/console.ts index 456d580e5b..b6d9035178 100644 --- a/dev-infra/utils/console.ts +++ b/dev-infra/utils/console.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import chalk from 'chalk'; +import * as chalk from 'chalk'; import {writeFileSync} from 'fs'; import {prompt} from 'inquirer'; import {join} from 'path'; @@ -15,11 +15,11 @@ import {Arguments} from 'yargs'; import {GitClient} from './git/index'; /** Reexport of chalk colors for convenient access. */ -export const red: typeof chalk = chalk.red; -export const green: typeof chalk = chalk.green; -export const yellow: typeof chalk = chalk.yellow; -export const bold: typeof chalk = chalk.bold; -export const blue: typeof chalk = chalk.blue; +export const red = chalk.red; +export const green = chalk.green; +export const yellow = chalk.yellow; +export const bold = chalk.bold; +export const blue = chalk.blue; /** Prompts the user with a confirmation question and a specified message. */ export async function promptConfirm(message: string, defaultValue = false): Promise { diff --git a/package.json b/package.json index 3e572f58b0..4b7928b304 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,7 @@ "bluebird": "^3.7.2", "brotli": "^1.3.2", "canonical-path": "1.0.0", - "chalk": "^2.3.1", + "chalk": "^4.1.0", "chokidar": "^3.5.1", "convert-source-map": "^1.5.1", "core-js": "^2.4.1", diff --git a/tools/size-tracking/index.ts b/tools/size-tracking/index.ts index cd8c61b21a..de7143ce01 100644 --- a/tools/size-tracking/index.ts +++ b/tools/size-tracking/index.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import chalk from 'chalk'; +import * as chalk from 'chalk'; import {readFileSync, writeFileSync} from 'fs'; import {compareFileSizeData} from './file_size_compare'; diff --git a/yarn.lock b/yarn.lock index 6b5300c46d..a3677b2830 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3309,7 +3309,7 @@ chainsaw@~0.1.0: dependencies: traverse ">=0.3.0 <0.4" -chalk@2.x, chalk@^2.0.0, chalk@^2.0.1, chalk@^2.3.0, chalk@^2.3.1, chalk@^2.4.1, chalk@^2.4.2: +chalk@2.x, chalk@^2.0.0, chalk@^2.0.1, chalk@^2.3.0, chalk@^2.4.1, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==