Skip to content

Commit

Permalink
refactor(@angular-devkit/core): remove deprecated terminal utils
Browse files Browse the repository at this point in the history
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
  • Loading branch information
alan-agius4 committed Sep 10, 2020
1 parent f31f853 commit 6d43e32
Show file tree
Hide file tree
Showing 15 changed files with 1 addition and 530 deletions.
81 changes: 0 additions & 81 deletions etc/api/angular_devkit/core/src/_golden-api.d.ts
Expand Up @@ -80,28 +80,6 @@ export declare class BaseException extends Error {

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

export declare const bgBlack: (x: string) => string;

export declare const bgBlue: (x: string) => string;

export declare const bgCyan: (x: string) => string;

export declare const bgGreen: (x: string) => string;

export declare const bgMagenta: (x: string) => string;

export declare const bgRed: (x: string) => string;

export declare const bgWhite: (x: string) => string;

export declare const bgYellow: (x: string) => string;

export declare const black: (x: string) => string;

export declare const blue: (x: string) => string;

export declare const bold: (x: string) => string;

export declare function buildJsonPointer(fragments: string[]): JsonPointer;

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

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

export declare namespace colors {
const reset: (x: string) => string;
const bold: (x: string) => string;
const dim: (x: string) => string;
const italic: (x: string) => string;
const underline: (x: string) => string;
const inverse: (x: string) => string;
const hidden: (x: string) => string;
const strikethrough: (x: string) => string;
const black: (x: string) => string;
const red: (x: string) => string;
const green: (x: string) => string;
const yellow: (x: string) => string;
const blue: (x: string) => string;
const magenta: (x: string) => string;
const cyan: (x: string) => string;
const white: (x: string) => string;
const grey: (x: string) => string;
const gray: (x: string) => string;
const bgBlack: (x: string) => string;
const bgRed: (x: string) => string;
const bgGreen: (x: string) => string;
const bgYellow: (x: string) => string;
const bgBlue: (x: string) => string;
const bgMagenta: (x: string) => string;
const bgCyan: (x: string) => string;
const bgWhite: (x: string) => string;
}

export declare class ContentHasMutatedException extends BaseException {
constructor(path: string);
}
Expand Down Expand Up @@ -232,8 +181,6 @@ export interface CustomDimensionsAndMetricsOptions {
metrics?: (boolean | number | string)[];
}

export declare const cyan: (x: string) => string;

export declare function dasherize(str: string): string;

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

export declare const dim: (x: string) => string;

export declare function dirname(path: Path): Path;

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

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

export declare const gray: (x: string) => string;

export declare const green: (x: string) => string;

export declare const grey: (x: string) => string;

export declare const hidden: (x: string) => string;

export interface Host<StatsT extends object = {}> extends ReadonlyHost<StatsT> {
delete(path: Path): Observable<void>;
rename(from: Path, to: Path): Observable<void>;
Expand Down Expand Up @@ -365,8 +302,6 @@ export declare class InvalidUpdateRecordException extends BaseException {
constructor();
}

export declare const inverse: (x: string) => string;

export declare function isAbsolute(p: Path): boolean;

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

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

export declare const italic: (x: string) => string;

export declare function join(p1: Path, ...others: string[]): Path;

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

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

export declare const magenta: (x: string) => string;

export declare function mapObject<T, V>(obj: {
[k: string]: T;
}, mapper: (k: string, v: T) => V): {
Expand Down Expand Up @@ -810,8 +741,6 @@ export declare function readWorkspace(path: string, host: WorkspaceHost, format?
workspace: WorkspaceDefinition;
}>;

export declare const red: (x: string) => string;

export interface ReferenceResolver<ContextT> {
(ref: string, context?: ContextT): {
context?: ContextT;
Expand All @@ -837,8 +766,6 @@ export interface RequiredValidatorError extends SchemaValidatorErrorBase {
};
}

export declare const reset: (x: string) => string;

export declare function resetNormalizeCache(): void;

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

export declare const strikethrough: (x: string) => string;

export declare function stringToFileBuffer(str: string): FileBuffer;

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

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

export declare const underline: (x: string) => string;

export declare function underscore(str: string): string;

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

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

export declare const white: (x: string) => string;

export declare type WindowsPath = string & {
__PRIVATE_DEVKIT_WINDOWS_PATH: void;
};
Expand All @@ -1220,5 +1141,3 @@ export interface WorkspaceHost {
}

export declare function writeWorkspace(workspace: WorkspaceDefinition, host: WorkspaceHost, path?: string, format?: WorkspaceFormat): Promise<void>;

export declare const yellow: (x: string) => string;
4 changes: 1 addition & 3 deletions packages/angular_devkit/core/BUILD.bazel
Expand Up @@ -29,9 +29,7 @@ ts_library(
include = ["**/*.json"],
# NB: we need to exclude the nested node_modules that is laid out by yarn workspaces
exclude = ["node_modules/**"],
) + [
"//packages/angular_devkit/core/third_party/github.com/chalk/supports-color",
],
),
module_name = "@angular-devkit/core",
module_root = "src/index.d.ts",
# The attribute below is needed in g3 to turn off strict typechecking
Expand Down
5 changes: 0 additions & 5 deletions packages/angular_devkit/core/src/_golden-api.ts
Expand Up @@ -27,11 +27,6 @@ export * from './logger/null-logger';
export * from './logger/transform-logger';
// End logging namespace

// Start terminal namespace
export * from './terminal/text';
export * from './terminal/colors';
// End terminal namespace

// Start utils namespace
export * from './utils/literals';
export * from './utils/strings';
Expand Down
4 changes: 0 additions & 4 deletions packages/angular_devkit/core/src/index.ts
Expand Up @@ -9,17 +9,13 @@ import * as analytics from './analytics';
import * as experimental from './experimental';
import * as json from './json/index';
import * as logging from './logger/index';
import * as ɵterminal from './terminal/index';
import * as workspaces from './workspace';

export * from './exception/exception';
export * from './json/index';
export * from './utils/index';
export * from './virtual-fs/index';

/** @deprecated since version 8 - Instead use other 3rd party libraries like `colors` and `chalk`. */
export const terminal = ɵterminal;

export {
analytics,
experimental,
Expand Down
108 changes: 0 additions & 108 deletions packages/angular_devkit/core/src/terminal/caps.ts

This file was deleted.

0 comments on commit 6d43e32

Please sign in to comment.