Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/angular_devkit/architect_cli/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ ts_project(
deps = [
":node_modules/@angular-devkit/architect",
":node_modules/@angular-devkit/core",
":node_modules/ansi-colors",
":node_modules/yargs-parser",
"//:node_modules/@types/node",
"//:node_modules/@types/yargs-parser",
Expand Down
17 changes: 7 additions & 10 deletions packages/angular_devkit/architect_cli/bin/architect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { Architect } from '@angular-devkit/architect';
import { WorkspaceNodeModulesArchitectHost } from '@angular-devkit/architect/node';
import { JsonValue, json, logging, schema, tags, workspaces } from '@angular-devkit/core';
import { NodeJsSyncHost, createConsoleLogger } from '@angular-devkit/core/node';
import * as ansiColors from 'ansi-colors';
import { existsSync } from 'node:fs';
import * as path from 'node:path';
import { styleText } from 'node:util';
import yargsParser, { camelCase, decamelize } from 'yargs-parser';

function findUp(names: string | string[], from: string) {
Expand Down Expand Up @@ -58,9 +58,6 @@ function usage(logger: logging.Logger, exitCode = 0): never {
return process.exit(exitCode);
}

// Create a separate instance to prevent unintended global changes to the color configuration
const colors = ansiColors.create();

async function _executeTarget(
parentLogger: logging.Logger,
workspace: workspaces.WorkspaceDefinition,
Expand Down Expand Up @@ -100,9 +97,9 @@ async function _executeTarget(
try {
const result = await run.lastOutput;
if (result.success) {
parentLogger.info(colors.green('SUCCESS'));
parentLogger.info(styleText(['green'], 'SUCCESS'));
} else {
parentLogger.info(colors.red('FAILURE'));
parentLogger.info(styleText(['red'], 'FAILURE'));
}
parentLogger.info('Result: ' + JSON.stringify({ ...result, info: undefined }, null, 4));

Expand All @@ -114,7 +111,7 @@ async function _executeTarget(

return result.success ? 0 : 1;
} catch (err) {
parentLogger.info(colors.red('ERROR'));
parentLogger.info(styleText(['red'], 'ERROR'));
parentLogger.info('\nLogs:');
logs.forEach((l) => parentLogger.next(l));

Expand All @@ -141,9 +138,9 @@ async function main(args: string[]): Promise<number> {
const logger = createConsoleLogger(argv['verbose'], process.stdout, process.stderr, {
info: (s) => s,
debug: (s) => s,
warn: (s) => colors.bold.yellow(s),
error: (s) => colors.bold.red(s),
fatal: (s) => colors.bold.red(s),
warn: (s) => styleText(['yellow', 'bold'], s),
error: (s) => styleText(['red', 'bold'], s),
fatal: (s) => styleText(['red', 'bold'], s),
});

// Check the target.
Expand Down
1 change: 0 additions & 1 deletion packages/angular_devkit/architect_cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"dependencies": {
"@angular-devkit/architect": "workspace:0.0.0-EXPERIMENTAL-PLACEHOLDER",
"@angular-devkit/core": "workspace:0.0.0-PLACEHOLDER",
"ansi-colors": "4.1.3",
"yargs-parser": "22.0.0"
}
}
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.