Skip to content

Commit 2d0c366

Browse files
committed
build: remove repo root usage of ansi-colors
The `scripts/devkit-admin.mts` infrastructure script has been migrated to use the native Node.js `styleText` API. This removes the last non-package usage of the `ansi-colors` package and allows the root level dependency to be removed.
1 parent 281c69e commit 2d0c366

File tree

5 files changed

+5
-9
lines changed

5 files changed

+5
-9
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@
9696
"@typescript-eslint/eslint-plugin": "8.48.0",
9797
"@typescript-eslint/parser": "8.48.0",
9898
"ajv": "8.17.1",
99-
"ansi-colors": "4.1.3",
10099
"buffer": "6.0.3",
101100
"esbuild": "0.27.0",
102101
"esbuild-wasm": "0.27.0",

packages/angular_devkit/architect_cli/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ts_project(
2323
"//:node_modules/@types/node",
2424
"//:node_modules/@types/progress",
2525
"//:node_modules/@types/yargs-parser",
26-
"//:node_modules/ansi-colors",
26+
":node_modules/ansi-colors",
2727
"//:node_modules/yargs-parser",
2828
],
2929
)

packages/angular_devkit/schematics_cli/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ ts_project(
5050
":node_modules/@inquirer/prompts",
5151
"//:node_modules/@types/node",
5252
"//:node_modules/@types/yargs-parser",
53-
"//:node_modules/ansi-colors",
53+
":node_modules/ansi-colors",
5454
"//:node_modules/yargs-parser",
5555
],
5656
)

pnpm-lock.yaml

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/devkit-admin.mts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* found in the LICENSE file at https://angular.dev/license
88
*/
99

10-
import colors from 'ansi-colors';
1110
import path from 'node:path';
11+
import { styleText } from 'node:util';
1212
import yargsParser from 'yargs-parser';
1313

1414
const args = yargsParser(process.argv.slice(2), {
@@ -26,11 +26,11 @@ process.chdir(path.join(scriptDir, '..'));
2626
const originalConsole = { ...console };
2727
console.warn = function (...args) {
2828
const [m, ...rest] = args;
29-
originalConsole.warn(colors.yellow(m), ...rest);
29+
originalConsole.warn(styleText(['yellow'], m), ...rest);
3030
};
3131
console.error = function (...args) {
3232
const [m, ...rest] = args;
33-
originalConsole.error(colors.red(m), ...rest);
33+
originalConsole.error(styleText(['red'], m), ...rest);
3434
};
3535

3636
try {

0 commit comments

Comments
 (0)