Skip to content

Commit 6d43e32

Browse files
committed
refactor(@angular-devkit/core): remove deprecated terminal utils
BREAKING CHANGE: Deprecated `@angular-devkit/core` terminal API has been removed. Use 3rd party packages like chalk, colors or ansi-colors instead. **Note:** this changes doesn't effect application developers
1 parent f31f853 commit 6d43e32

File tree

15 files changed

+1
-530
lines changed

15 files changed

+1
-530
lines changed

etc/api/angular_devkit/core/src/_golden-api.d.ts

-81
Original file line numberDiff line numberDiff line change
@@ -80,28 +80,6 @@ export declare class BaseException extends Error {
8080

8181
export declare function basename(path: Path): PathFragment;
8282

83-
export declare const bgBlack: (x: string) => string;
84-
85-
export declare const bgBlue: (x: string) => string;
86-
87-
export declare const bgCyan: (x: string) => string;
88-
89-
export declare const bgGreen: (x: string) => string;
90-
91-
export declare const bgMagenta: (x: string) => string;
92-
93-
export declare const bgRed: (x: string) => string;
94-
95-
export declare const bgWhite: (x: string) => string;
96-
97-
export declare const bgYellow: (x: string) => string;
98-
99-
export declare const black: (x: string) => string;
100-
101-
export declare const blue: (x: string) => string;
102-
103-
export declare const bold: (x: string) => string;
104-
10583
export declare function buildJsonPointer(fragments: string[]): JsonPointer;
10684

10785
export declare function camelize(str: string): string;
@@ -116,35 +94,6 @@ export declare function classify(str: string): string;
11694

11795
export declare function clean<T>(array: Array<T | undefined>): Array<T>;
11896

119-
export declare namespace colors {
120-
const reset: (x: string) => string;
121-
const bold: (x: string) => string;
122-
const dim: (x: string) => string;
123-
const italic: (x: string) => string;
124-
const underline: (x: string) => string;
125-
const inverse: (x: string) => string;
126-
const hidden: (x: string) => string;
127-
const strikethrough: (x: string) => string;
128-
const black: (x: string) => string;
129-
const red: (x: string) => string;
130-
const green: (x: string) => string;
131-
const yellow: (x: string) => string;
132-
const blue: (x: string) => string;
133-
const magenta: (x: string) => string;
134-
const cyan: (x: string) => string;
135-
const white: (x: string) => string;
136-
const grey: (x: string) => string;
137-
const gray: (x: string) => string;
138-
const bgBlack: (x: string) => string;
139-
const bgRed: (x: string) => string;
140-
const bgGreen: (x: string) => string;
141-
const bgYellow: (x: string) => string;
142-
const bgBlue: (x: string) => string;
143-
const bgMagenta: (x: string) => string;
144-
const bgCyan: (x: string) => string;
145-
const bgWhite: (x: string) => string;
146-
}
147-
14897
export declare class ContentHasMutatedException extends BaseException {
14998
constructor(path: string);
15099
}
@@ -232,8 +181,6 @@ export interface CustomDimensionsAndMetricsOptions {
232181
metrics?: (boolean | number | string)[];
233182
}
234183

235-
export declare const cyan: (x: string) => string;
236-
237184
export declare function dasherize(str: string): string;
238185

239186
export declare function decamelize(str: string): string;
@@ -246,8 +193,6 @@ export declare class DependencyNotFoundException extends BaseException {
246193
constructor();
247194
}
248195

249-
export declare const dim: (x: string) => string;
250-
251196
export declare function dirname(path: Path): Path;
252197

253198
export declare class Empty implements ReadonlyHost {
@@ -306,14 +251,6 @@ export declare function getSystemPath(path: Path): string;
306251

307252
export declare function getTypesOfSchema(schema: JsonSchema): Set<string>;
308253

309-
export declare const gray: (x: string) => string;
310-
311-
export declare const green: (x: string) => string;
312-
313-
export declare const grey: (x: string) => string;
314-
315-
export declare const hidden: (x: string) => string;
316-
317254
export interface Host<StatsT extends object = {}> extends ReadonlyHost<StatsT> {
318255
delete(path: Path): Observable<void>;
319256
rename(from: Path, to: Path): Observable<void>;
@@ -365,8 +302,6 @@ export declare class InvalidUpdateRecordException extends BaseException {
365302
constructor();
366303
}
367304

368-
export declare const inverse: (x: string) => string;
369-
370305
export declare function isAbsolute(p: Path): boolean;
371306

372307
export declare function isJsonArray(value: JsonValue): value is JsonArray;
@@ -377,8 +312,6 @@ export declare function isObservable(obj: any | Observable<any>): obj is Observa
377312

378313
export declare function isPromise(obj: any): obj is Promise<any>;
379314

380-
export declare const italic: (x: string) => string;
381-
382315
export declare function join(p1: Path, ...others: string[]): Path;
383316

384317
export declare function joinJsonPointer(root: JsonPointer, ...others: string[]): JsonPointer;
@@ -586,8 +519,6 @@ export declare class LoggingAnalytics implements Analytics {
586519

587520
export declare type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'fatal';
588521

589-
export declare const magenta: (x: string) => string;
590-
591522
export declare function mapObject<T, V>(obj: {
592523
[k: string]: T;
593524
}, mapper: (k: string, v: T) => V): {
@@ -810,8 +741,6 @@ export declare function readWorkspace(path: string, host: WorkspaceHost, format?
810741
workspace: WorkspaceDefinition;
811742
}>;
812743

813-
export declare const red: (x: string) => string;
814-
815744
export interface ReferenceResolver<ContextT> {
816745
(ref: string, context?: ContextT): {
817746
context?: ContextT;
@@ -837,8 +766,6 @@ export interface RequiredValidatorError extends SchemaValidatorErrorBase {
837766
};
838767
}
839768

840-
export declare const reset: (x: string) => string;
841-
842769
export declare function resetNormalizeCache(): void;
843770

844771
export declare function resolve(p1: Path, p2: Path): Path;
@@ -1010,8 +937,6 @@ export declare type Stats<T extends object = {}> = T & {
1010937
readonly birthtime: Date;
1011938
};
1012939

1013-
export declare const strikethrough: (x: string) => string;
1014-
1015940
export declare function stringToFileBuffer(str: string): FileBuffer;
1016941

1017942
export declare function stripIndent(strings: TemplateStringsArray, ...values: any[]): string;
@@ -1171,8 +1096,6 @@ export declare class TransformLogger extends Logger {
11711096

11721097
export declare function trimNewlines(strings: TemplateStringsArray, ...values: any[]): string;
11731098

1174-
export declare const underline: (x: string) => string;
1175-
11761099
export declare function underscore(str: string): string;
11771100

11781101
export declare class UnexpectedEndOfInputException extends JsonException {
@@ -1197,8 +1120,6 @@ export declare function visitJson<ContextT>(json: JsonValue, visitor: JsonVisito
11971120

11981121
export declare function visitJsonSchema(schema: JsonSchema, visitor: JsonSchemaVisitor): void;
11991122

1200-
export declare const white: (x: string) => string;
1201-
12021123
export declare type WindowsPath = string & {
12031124
__PRIVATE_DEVKIT_WINDOWS_PATH: void;
12041125
};
@@ -1220,5 +1141,3 @@ export interface WorkspaceHost {
12201141
}
12211142

12221143
export declare function writeWorkspace(workspace: WorkspaceDefinition, host: WorkspaceHost, path?: string, format?: WorkspaceFormat): Promise<void>;
1223-
1224-
export declare const yellow: (x: string) => string;

packages/angular_devkit/core/BUILD.bazel

+1-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ ts_library(
2929
include = ["**/*.json"],
3030
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
3131
exclude = ["node_modules/**"],
32-
) + [
33-
"//packages/angular_devkit/core/third_party/github.com/chalk/supports-color",
34-
],
32+
),
3533
module_name = "@angular-devkit/core",
3634
module_root = "src/index.d.ts",
3735
# The attribute below is needed in g3 to turn off strict typechecking

packages/angular_devkit/core/src/_golden-api.ts

-5
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ export * from './logger/null-logger';
2727
export * from './logger/transform-logger';
2828
// End logging namespace
2929

30-
// Start terminal namespace
31-
export * from './terminal/text';
32-
export * from './terminal/colors';
33-
// End terminal namespace
34-
3530
// Start utils namespace
3631
export * from './utils/literals';
3732
export * from './utils/strings';

packages/angular_devkit/core/src/index.ts

-4
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,13 @@ import * as analytics from './analytics';
99
import * as experimental from './experimental';
1010
import * as json from './json/index';
1111
import * as logging from './logger/index';
12-
import * as ɵterminal from './terminal/index';
1312
import * as workspaces from './workspace';
1413

1514
export * from './exception/exception';
1615
export * from './json/index';
1716
export * from './utils/index';
1817
export * from './virtual-fs/index';
1918

20-
/** @deprecated since version 8 - Instead use other 3rd party libraries like `colors` and `chalk`. */
21-
export const terminal = ɵterminal;
22-
2319
export {
2420
analytics,
2521
experimental,

packages/angular_devkit/core/src/terminal/caps.ts

-108
This file was deleted.

0 commit comments

Comments
 (0)