From 6d43e320b64318931f531e964275bf508f78dd3d Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Wed, 9 Sep 2020 13:37:18 +0200 Subject: [PATCH] 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 --- .../angular_devkit/core/src/_golden-api.d.ts | 81 ---------- packages/angular_devkit/core/BUILD.bazel | 4 +- .../angular_devkit/core/src/_golden-api.ts | 5 - packages/angular_devkit/core/src/index.ts | 4 - .../angular_devkit/core/src/terminal/caps.ts | 108 ------------- .../core/src/terminal/colors.ts | 76 --------- .../angular_devkit/core/src/terminal/index.ts | 10 -- .../angular_devkit/core/src/terminal/text.ts | 41 ----- .../chalk/supports-color/BUILD.bazel | 15 -- .../chalk/supports-color/LOCAL_MODS.md | 3 - .../github.com/chalk/supports-color/index.js | 146 ------------------ .../github.com/chalk/supports-color/license | 9 -- .../sindresorhus/has-flag/BUILD.bazel | 12 -- .../github.com/sindresorhus/has-flag/index.js | 8 - .../github.com/sindresorhus/has-flag/license | 9 -- 15 files changed, 1 insertion(+), 530 deletions(-) delete mode 100644 packages/angular_devkit/core/src/terminal/caps.ts delete mode 100644 packages/angular_devkit/core/src/terminal/colors.ts delete mode 100644 packages/angular_devkit/core/src/terminal/index.ts delete mode 100644 packages/angular_devkit/core/src/terminal/text.ts delete mode 100644 packages/angular_devkit/core/third_party/github.com/chalk/supports-color/BUILD.bazel delete mode 100644 packages/angular_devkit/core/third_party/github.com/chalk/supports-color/LOCAL_MODS.md delete mode 100644 packages/angular_devkit/core/third_party/github.com/chalk/supports-color/index.js delete mode 100644 packages/angular_devkit/core/third_party/github.com/chalk/supports-color/license delete mode 100644 packages/angular_devkit/core/third_party/github.com/sindresorhus/has-flag/BUILD.bazel delete mode 100644 packages/angular_devkit/core/third_party/github.com/sindresorhus/has-flag/index.js delete mode 100644 packages/angular_devkit/core/third_party/github.com/sindresorhus/has-flag/license diff --git a/etc/api/angular_devkit/core/src/_golden-api.d.ts b/etc/api/angular_devkit/core/src/_golden-api.d.ts index 8e7ab502f46b..b5c94fcc4210 100644 --- a/etc/api/angular_devkit/core/src/_golden-api.d.ts +++ b/etc/api/angular_devkit/core/src/_golden-api.d.ts @@ -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; @@ -116,35 +94,6 @@ export declare function classify(str: string): string; export declare function clean(array: Array): Array; -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); } @@ -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; @@ -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 { @@ -306,14 +251,6 @@ export declare function getSystemPath(path: Path): string; export declare function getTypesOfSchema(schema: JsonSchema): Set; -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 extends ReadonlyHost { delete(path: Path): Observable; rename(from: Path, to: Path): Observable; @@ -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; @@ -377,8 +312,6 @@ export declare function isObservable(obj: any | Observable): obj is Observa export declare function isPromise(obj: any): obj is Promise; -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; @@ -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(obj: { [k: string]: T; }, mapper: (k: string, v: T) => V): { @@ -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 { (ref: string, context?: ContextT): { context?: ContextT; @@ -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; @@ -1010,8 +937,6 @@ export declare type Stats = 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; @@ -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 { @@ -1197,8 +1120,6 @@ export declare function visitJson(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; }; @@ -1220,5 +1141,3 @@ export interface WorkspaceHost { } export declare function writeWorkspace(workspace: WorkspaceDefinition, host: WorkspaceHost, path?: string, format?: WorkspaceFormat): Promise; - -export declare const yellow: (x: string) => string; diff --git a/packages/angular_devkit/core/BUILD.bazel b/packages/angular_devkit/core/BUILD.bazel index 9e0af038e44a..7e26ecdb4fc2 100644 --- a/packages/angular_devkit/core/BUILD.bazel +++ b/packages/angular_devkit/core/BUILD.bazel @@ -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 diff --git a/packages/angular_devkit/core/src/_golden-api.ts b/packages/angular_devkit/core/src/_golden-api.ts index fdf4f57ece18..0c8c1c52f68d 100644 --- a/packages/angular_devkit/core/src/_golden-api.ts +++ b/packages/angular_devkit/core/src/_golden-api.ts @@ -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'; diff --git a/packages/angular_devkit/core/src/index.ts b/packages/angular_devkit/core/src/index.ts index b30525e2d2fb..2df15fc70f9f 100644 --- a/packages/angular_devkit/core/src/index.ts +++ b/packages/angular_devkit/core/src/index.ts @@ -9,7 +9,6 @@ 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'; @@ -17,9 +16,6 @@ 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, diff --git a/packages/angular_devkit/core/src/terminal/caps.ts b/packages/angular_devkit/core/src/terminal/caps.ts deleted file mode 100644 index 3ed01e89638a..000000000000 --- a/packages/angular_devkit/core/src/terminal/caps.ts +++ /dev/null @@ -1,108 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -import ReadableStream = NodeJS.ReadableStream; -import WriteStream = NodeJS.WriteStream; -const supportsColor = require('../../third_party/github.com/chalk/supports-color'); - -/** - * Node specific stuff. - */ -declare const process: { - env: { [name: string]: string }; - platform: string; - versions: { - node: string; - }; - - stdin: ReadableStream; - stdout: WriteStream; - stderr: WriteStream; -}; -declare const os: { - release: () => string; -}; - - -const streamMap = new WeakMap<{}, StreamCapabilities>(); - - -export interface StreamCapabilities { - readable: boolean; - writable: boolean; - - /** - * Supports text. This should be true for any streams. - */ - text: boolean; - - /** - * Supports colors (16 colors). - */ - colors: boolean; - - /** - * Supports 256 colors. - */ - color256: boolean; - - /** - * Supports 16 millions (3x8-bit channels) colors. - */ - color16m: boolean; - - /** - * Height of the terminal. If the stream is not tied to a terminal, will be null. - */ - rows: number | null; - - /** - * Width of the terminal. If the stream is not tied to a terminal, will be null. - */ - columns: number | null; -} - -function _getRows() { - return typeof process == 'object' && process.stdout.rows || null; -} -function _getColumns() { - return typeof process == 'object' && process.stdout.columns || null; -} - - -function _createCapabilities( - stream: NodeJS.WriteStream, - isTerminalStream: boolean, - level: 0|1|2|3 = supportsColor.stdout.level, -): StreamCapabilities { - return { - readable: stream.readable, - writable: stream.writable, - text: true, - - colors: level > 0, - color256: level > 1, - color16m: level > 2, - - rows: isTerminalStream ? _getRows() : null, - columns: isTerminalStream ? _getColumns() : null, - }; -} - - -export function getCapabilities( - stream: NodeJS.WriteStream, - isTerminalStream = !!stream.isTTY, -): StreamCapabilities { - let maybeCaps = streamMap.get(stream); - if (!maybeCaps) { - maybeCaps = _createCapabilities(stream, isTerminalStream); - streamMap.set(stream, maybeCaps); - } - - return maybeCaps; -} diff --git a/packages/angular_devkit/core/src/terminal/colors.ts b/packages/angular_devkit/core/src/terminal/colors.ts deleted file mode 100644 index 1494ec04bcb6..000000000000 --- a/packages/angular_devkit/core/src/terminal/colors.ts +++ /dev/null @@ -1,76 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -import { mapObject } from '../utils/object'; - -const kColors = { - modifiers: { - reset: [0, 0], - bold: [1, 22], // 21 isn't widely supported and 22 does the same thing - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29], - }, - colors: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], - gray: [90, 39], - }, - bgColors: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49], - }, -}; -const kColorFunctions = mapObject(kColors, (_, v) => { - return mapObject(v, (_, vv) => (x: string) => `\u001b[${vv[0]}m${x}\u001b[${vv[1]}m`); -}); - -export namespace colors { - export const reset = kColorFunctions.modifiers.reset; - export const bold = kColorFunctions.modifiers.bold; - export const dim = kColorFunctions.modifiers.dim; - export const italic = kColorFunctions.modifiers.italic; - export const underline = kColorFunctions.modifiers.underline; - export const inverse = kColorFunctions.modifiers.inverse; - export const hidden = kColorFunctions.modifiers.hidden; - export const strikethrough = kColorFunctions.modifiers.strikethrough; - - export const black = kColorFunctions.colors.black; - export const red = kColorFunctions.colors.red; - export const green = kColorFunctions.colors.green; - export const yellow = kColorFunctions.colors.yellow; - export const blue = kColorFunctions.colors.blue; - export const magenta = kColorFunctions.colors.magenta; - export const cyan = kColorFunctions.colors.cyan; - export const white = kColorFunctions.colors.white; - export const grey = kColorFunctions.colors.gray; - export const gray = kColorFunctions.colors.gray; - - export const bgBlack = kColorFunctions.bgColors.bgBlack; - export const bgRed = kColorFunctions.bgColors.bgRed; - export const bgGreen = kColorFunctions.bgColors.bgGreen; - export const bgYellow = kColorFunctions.bgColors.bgYellow; - export const bgBlue = kColorFunctions.bgColors.bgBlue; - export const bgMagenta = kColorFunctions.bgColors.bgMagenta; - export const bgCyan = kColorFunctions.bgColors.bgCyan; - export const bgWhite = kColorFunctions.bgColors.bgWhite; -} diff --git a/packages/angular_devkit/core/src/terminal/index.ts b/packages/angular_devkit/core/src/terminal/index.ts deleted file mode 100644 index d853f3c1c9bb..000000000000 --- a/packages/angular_devkit/core/src/terminal/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -export * from './text'; -export * from './caps'; -export * from './colors'; diff --git a/packages/angular_devkit/core/src/terminal/text.ts b/packages/angular_devkit/core/src/terminal/text.ts deleted file mode 100644 index 57d847ee8cb1..000000000000 --- a/packages/angular_devkit/core/src/terminal/text.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -import * as caps from './caps'; -import { colors } from './colors'; - -const supportColors: boolean = typeof process === 'object' ? caps.getCapabilities(process.stdout).colors : false; -const identityFn = (x: string) => x; - -export const reset = supportColors ? colors.reset : identityFn; -export const bold = supportColors ? colors.bold : identityFn; -export const dim = supportColors ? colors.dim : identityFn; -export const italic = supportColors ? colors.italic : identityFn; -export const underline = supportColors ? colors.underline : identityFn; -export const inverse = supportColors ? colors.inverse : identityFn; -export const hidden = supportColors ? colors.hidden : identityFn; -export const strikethrough = supportColors ? colors.strikethrough : identityFn; - -export const black = supportColors ? colors.black : identityFn; -export const red = supportColors ? colors.red : identityFn; -export const green = supportColors ? colors.green : identityFn; -export const yellow = supportColors ? colors.yellow : identityFn; -export const blue = supportColors ? colors.blue : identityFn; -export const magenta = supportColors ? colors.magenta : identityFn; -export const cyan = supportColors ? colors.cyan : identityFn; -export const white = supportColors ? colors.white : identityFn; -export const grey = supportColors ? colors.gray : identityFn; -export const gray = supportColors ? colors.gray : identityFn; - -export const bgBlack = supportColors ? colors.bgBlack : identityFn; -export const bgRed = supportColors ? colors.bgRed : identityFn; -export const bgGreen = supportColors ? colors.bgGreen : identityFn; -export const bgYellow = supportColors ? colors.bgYellow : identityFn; -export const bgBlue = supportColors ? colors.bgBlue : identityFn; -export const bgMagenta = supportColors ? colors.bgMagenta : identityFn; -export const bgCyan = supportColors ? colors.bgCyan : identityFn; -export const bgWhite = supportColors ? colors.bgWhite : identityFn; diff --git a/packages/angular_devkit/core/third_party/github.com/chalk/supports-color/BUILD.bazel b/packages/angular_devkit/core/third_party/github.com/chalk/supports-color/BUILD.bazel deleted file mode 100644 index a20ce77d2e17..000000000000 --- a/packages/angular_devkit/core/third_party/github.com/chalk/supports-color/BUILD.bazel +++ /dev/null @@ -1,15 +0,0 @@ -# TODO(alexeagle): move this file to /third_party so Bazel can enforce the licensing -licenses(["notice"]) - -# Downloaded from: https://github.com/chalk/supports-color/tree/17e9579fec886a1058553b6f7529f05e4f7a90dc -# Timestamp: 2019 Feb 14 -exports_files(["license"]) - -filegroup( - name = "supports-color", - srcs = [ - "index.js", - "//packages/angular_devkit/core/third_party/github.com/sindresorhus/has-flag", - ], - visibility = ["//:__subpackages__"], -) diff --git a/packages/angular_devkit/core/third_party/github.com/chalk/supports-color/LOCAL_MODS.md b/packages/angular_devkit/core/third_party/github.com/chalk/supports-color/LOCAL_MODS.md deleted file mode 100644 index 76d5851aa34f..000000000000 --- a/packages/angular_devkit/core/third_party/github.com/chalk/supports-color/LOCAL_MODS.md +++ /dev/null @@ -1,3 +0,0 @@ -* Added check for `env.MSYSTEM` in windows case, see https://github.com/angular/angular-cli/commit/b8d4e19fc4209ff6a52b6e6a151927f6fe34b60e -* require the locally vendored has-flag rather than npm package -* support browser runtimes by mocking out the process object if it doesn't exist diff --git a/packages/angular_devkit/core/third_party/github.com/chalk/supports-color/index.js b/packages/angular_devkit/core/third_party/github.com/chalk/supports-color/index.js deleted file mode 100644 index 06e16d0b740e..000000000000 --- a/packages/angular_devkit/core/third_party/github.com/chalk/supports-color/index.js +++ /dev/null @@ -1,146 +0,0 @@ -'use strict'; -const os = require('os'); -// LOCAL MOD: import the dependency from local vendored location -const hasFlag = require('../../sindresorhus/has-flag'); - -// LOCAL MOD: support loading this file in a browser -const {env, versions, stdout, stderr, platform} = typeof process == 'object' ? process : { - platform: '', - env: {}, - versions: {node: ''}, -}; - -let forceColor; -if (hasFlag('no-color') || - hasFlag('no-colors') || - hasFlag('color=false') || - hasFlag('color=never')) { - forceColor = 0; -} else if (hasFlag('color') || - hasFlag('colors') || - hasFlag('color=true') || - hasFlag('color=always')) { - forceColor = 1; -} -if ('FORCE_COLOR' in env) { - if (env.FORCE_COLOR === true || env.FORCE_COLOR === 'true') { - forceColor = 1; - } else if (env.FORCE_COLOR === false || env.FORCE_COLOR === 'false') { - forceColor = 0; - } else { - forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); - } -} - -function translateLevel(level) { - if (level === 0) { - return false; - } - - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; -} - -function supportsColor(stream) { - if (forceColor === 0) { - return 0; - } - - if (hasFlag('color=16m') || - hasFlag('color=full') || - hasFlag('color=truecolor')) { - return 3; - } - - if (hasFlag('color=256')) { - return 2; - } - - // LOCAL MOD: support mingw - if (stream && !stream.isTTY && forceColor === undefined && !env.MSYSTEM) { - return 0; - } - - const min = forceColor || 0; - - if (env.TERM === 'dumb') { - return min; - } - - // LOCAL MOD: support mingw - if (platform.startsWith('win32') && !env.MSYSTEM) { - // Node.js 7.5.0 is the first version of Node.js to include a patch to - // libuv that enables 256 color output on Windows. Anything earlier and it - // won't work. However, here we target Node.js 8 at minimum as it is an LTS - // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows - // release that supports 256 colors. Windows 10 build 14931 is the first release - // that supports 16m/TrueColor. - const osRelease = os.release().split('.'); - if ( - Number(versions.node.split('.')[0]) >= 8 && - Number(osRelease[0]) >= 10 && - Number(osRelease[2]) >= 10586 - ) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; - } - - return 1; - } - - if ('CI' in env) { - if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') { - return 1; - } - - return min; - } - - if ('TEAMCITY_VERSION' in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; - } - - if (env.COLORTERM === 'truecolor') { - return 3; - } - - if ('TERM_PROGRAM' in env) { - const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); - - switch (env.TERM_PROGRAM) { - case 'iTerm.app': - return version >= 3 ? 3 : 2; - case 'Apple_Terminal': - return 2; - // No default - } - } - - if (/-256(color)?$/i.test(env.TERM)) { - return 2; - } - - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { - return 1; - } - - if ('COLORTERM' in env) { - return 1; - } - - return min; -} - -function getSupportLevel(stream) { - const level = supportsColor(stream); - return translateLevel(level); -} - -module.exports = { - supportsColor: getSupportLevel, - stdout: getSupportLevel(stdout), - stderr: getSupportLevel(stderr) -}; diff --git a/packages/angular_devkit/core/third_party/github.com/chalk/supports-color/license b/packages/angular_devkit/core/third_party/github.com/chalk/supports-color/license deleted file mode 100644 index e7af2f77107d..000000000000 --- a/packages/angular_devkit/core/third_party/github.com/chalk/supports-color/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/angular_devkit/core/third_party/github.com/sindresorhus/has-flag/BUILD.bazel b/packages/angular_devkit/core/third_party/github.com/sindresorhus/has-flag/BUILD.bazel deleted file mode 100644 index f84eb4fcf292..000000000000 --- a/packages/angular_devkit/core/third_party/github.com/sindresorhus/has-flag/BUILD.bazel +++ /dev/null @@ -1,12 +0,0 @@ -# TODO(alexeagle): move this file to /third_party so Bazel can enforce the licensing -licenses(["notice"]) - -# Downloaded from: https://github.com/sindresorhus/has-flag/tree/a6208ceaf26b5e58dbd29cb4f9e62ad02034104d -# Timestamp: 2019 Feb 14 -exports_files(["license"]) - -filegroup( - name = "has-flag", - srcs = ["index.js"], - visibility = ["//:__subpackages__"], -) diff --git a/packages/angular_devkit/core/third_party/github.com/sindresorhus/has-flag/index.js b/packages/angular_devkit/core/third_party/github.com/sindresorhus/has-flag/index.js deleted file mode 100644 index 6a1a0e847022..000000000000 --- a/packages/angular_devkit/core/third_party/github.com/sindresorhus/has-flag/index.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; -module.exports = (flag, argv) => { - argv = argv || process.argv; - const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); - const pos = argv.indexOf(prefix + flag); - const terminatorPos = argv.indexOf('--'); - return pos !== -1 && (terminatorPos === -1 || pos < terminatorPos); -}; diff --git a/packages/angular_devkit/core/third_party/github.com/sindresorhus/has-flag/license b/packages/angular_devkit/core/third_party/github.com/sindresorhus/has-flag/license deleted file mode 100644 index e7af2f77107d..000000000000 --- a/packages/angular_devkit/core/third_party/github.com/sindresorhus/has-flag/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.