File tree Expand file tree Collapse file tree 5 files changed +29
-13
lines changed
Expand file tree Collapse file tree 5 files changed +29
-13
lines changed Original file line number Diff line number Diff line change 3131 "@rollup/plugin-json" : " ^4.0.0" ,
3232 "@rollup/plugin-node-resolve" : " ^9.0.0" ,
3333 "ajv" : " ^6.12.3" ,
34+ "ansi-colors" : " ^4.1.1" ,
3435 "autoprefixer" : " ^9.6.5" ,
3536 "browserslist" : " ^4.7.0" ,
36- "chalk" : " ^4.0.0" ,
3737 "chokidar" : " ^3.2.1" ,
3838 "commander" : " ^6.0.0" ,
3939 "cssnano-preset-default" : " ^4.0.7" ,
Original file line number Diff line number Diff line change 11import { ParsedConfiguration } from '@angular/compiler-cli' ;
2- import * as chalk from 'chalk ' ;
2+ import { colors } from '../../utils/color ' ;
33import { Transform , transformFromPromise } from '../../graph/transform' ;
44import { isEntryPoint , EntryPointNode } from '../nodes' ;
55import { initializeTsConfig } from '../../ts/tsconfig' ;
@@ -18,7 +18,7 @@ export const initTsConfigTransformFactory = (defaultTsConfig: ParsedConfiguratio
1818 'Read more here: https://v9.angular.io/guide/ivy#maintaining-library-compatibility\n' +
1919 '******************************************************************************' ;
2020
21- msg ( chalk . yellow ( ivyMsg ) ) ;
21+ msg ( colors . yellow ( ivyMsg ) ) ;
2222 }
2323
2424 return graph ;
Original file line number Diff line number Diff line change 1+ import * as ansiColors from 'ansi-colors' ;
2+ import { WriteStream } from 'tty' ;
3+
4+ type AnsiColors = typeof ansiColors ;
5+
6+ // Typings do not contain the function call (added in Node.js v9.9.0)
7+ const supportsColor =
8+ process . stdout instanceof WriteStream &&
9+ ( ( process . stdout as unknown ) as { getColorDepth ( ) : number } ) . getColorDepth ( ) > 1 ;
10+
11+ // Create a separate instance to prevent unintended global changes to the color configuration
12+ // Create function is not defined in the typings. See: https://github.com/doowb/ansi-colors/pull/44
13+ const colors = ( ansiColors as AnsiColors & { create : ( ) => AnsiColors } ) . create ( ) ;
14+ colors . enabled = supportsColor ;
15+
16+ export { colors } ;
Original file line number Diff line number Diff line change 1- import * as chalk from 'chalk ' ;
1+ import { colors } from './color ' ;
22
33export const error = ( err : string | Error ) => {
44 if ( err instanceof Error ) {
5- console . error ( chalk . red ( 'ERROR: ' + err . message ) ) ;
5+ console . error ( colors . red ( 'ERROR: ' + err . message ) ) ;
66
77 if ( process . env . DEBUG ) {
8- console . error ( chalk . red ( err . stack ) + '\n' ) ;
8+ console . error ( colors . red ( err . stack ) + '\n' ) ;
99 }
1010 } else {
11- console . error ( chalk . red ( err ) ) ;
11+ console . error ( colors . red ( err ) ) ;
1212 }
1313} ;
1414
1515export const warn = ( msg : string ) => {
16- console . warn ( chalk . yellow ( 'WARNING: ' + msg ) ) ;
16+ console . warn ( colors . yellow ( 'WARNING: ' + msg ) ) ;
1717} ;
1818
1919export const success = ( msg : string ) => {
20- console . log ( chalk . green ( msg ) ) ;
20+ console . log ( colors . green ( msg ) ) ;
2121} ;
2222
2323export const info = ( msg : string ) => {
24- console . log ( chalk . blue ( msg ) ) ;
24+ console . log ( colors . blue ( msg ) ) ;
2525} ;
2626
2727export const msg = ( msg : string ) => {
28- console . log ( chalk . white ( msg ) ) ;
28+ console . log ( colors . white ( msg ) ) ;
2929} ;
3030
3131export const debug = ( msg : string ) => {
3232 if ( process . env . DEBUG ) {
33- console . log ( chalk . inverse . cyan ( `[debug] ${ msg } ` ) ) ;
33+ console . log ( colors . inverse . cyan ( `[debug] ${ msg } ` ) ) ;
3434 }
3535} ;
Original file line number Diff line number Diff line change @@ -538,7 +538,7 @@ alphanum-sort@^1.0.0:
538538 resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3"
539539 integrity sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=
540540
541- 541+ [email protected] , ansi-colors@^4.1.1 :
542542 version "4.1.1"
543543 resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348"
544544 integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==
You can’t perform that action at this time.
0 commit comments