refactor: clean up old ansi-colors castings

This has been fixed in https://github.com/doowb/ansi-colors/pull/44
This commit is contained in:
Alan Agius 2022-06-28 10:51:29 +00:00 committed by Charles
parent e17015ceff
commit a69000407c
6 changed files with 6 additions and 12 deletions

View File

@ -45,8 +45,7 @@ export function removeColor(text: string): string {
}
// Create a separate instance to prevent unintended global changes to the color configuration
// Create function is not defined in the typings. See: https://github.com/doowb/ansi-colors/pull/44
const colors = (ansiColors as AnsiColors & { create: () => AnsiColors }).create();
const colors = ansiColors.create();
colors.enabled = supportColor();
export { colors };

View File

@ -71,8 +71,7 @@ interface BarInfo {
}
// Create a separate instance to prevent unintended global changes to the color configuration
// Create function is not defined in the typings. See: https://github.com/doowb/ansi-colors/pull/44
const colors = (ansiColors as typeof ansiColors & { create: () => typeof ansiColors }).create();
const colors = ansiColors.create();
async function _executeTarget(
parentLogger: logging.Logger,

View File

@ -111,8 +111,7 @@ export async function main({
);
// Create a separate instance to prevent unintended global changes to the color configuration
// Create function is not defined in the typings. See: https://github.com/doowb/ansi-colors/pull/44
const colors = (ansiColors as typeof ansiColors & { create: () => typeof ansiColors }).create();
const colors = ansiColors.create();
// Log to console.
logger.pipe(filter((entry) => entry.level != 'debug' || argv['verbose'])).subscribe((entry) => {

View File

@ -45,8 +45,7 @@ export function removeColor(text: string): string {
}
// Create a separate instance to prevent unintended global changes to the color configuration
// Create function is not defined in the typings. See: https://github.com/doowb/ansi-colors/pull/44
const colors = (ansiColors as AnsiColors & { create: () => AnsiColors }).create();
const colors = ansiColors.create();
colors.enabled = supportColor();
export { colors };

View File

@ -117,8 +117,7 @@ export async function main({
const { cliOptions, schematicOptions, _ } = parseArgs(args);
// Create a separate instance to prevent unintended global changes to the color configuration
// Create function is not defined in the typings. See: https://github.com/doowb/ansi-colors/pull/44
const colors = (ansiColors as typeof ansiColors & { create: () => typeof ansiColors }).create();
const colors = ansiColors.create();
/** Create the DevKit Logger used through the CLI. */
const logger = createConsoleLogger(!!cliOptions.verbose, stdout, stderr, {

View File

@ -27,8 +27,7 @@ export type ProcessOutput = {
function _exec(options: ExecOptions, cmd: string, args: string[]): Promise<ProcessOutput> {
// Create a separate instance to prevent unintended global changes to the color configuration
// Create function is not defined in the typings. See: https://github.com/doowb/ansi-colors/pull/44
const colors = (ansiColors as typeof ansiColors & { create: () => typeof ansiColors }).create();
const colors = ansiColors.create();
let stdout = '';
let stderr = '';