@@ -19,7 +19,7 @@ import { getAgent } from '../lib/http-agent.js'
19
19
import {
20
20
NETLIFY_CYAN ,
21
21
USER_AGENT ,
22
- chalk ,
22
+ ansis ,
23
23
logAndThrowError ,
24
24
exit ,
25
25
getToken ,
@@ -28,7 +28,7 @@ import {
28
28
normalizeConfig ,
29
29
padLeft ,
30
30
pollForToken ,
31
- sortOptions ,
31
+ compareOptions ,
32
32
warn ,
33
33
logError ,
34
34
} from '../utils/command-helpers.js'
@@ -107,7 +107,7 @@ async function selectWorkspace(project: Project, filter?: string): Promise<strin
107
107
108
108
if ( ! selected ) {
109
109
log ( )
110
- log ( chalk . cyan ( `We've detected multiple sites inside your repository` ) )
110
+ log ( ansis . cyan ( `We've detected multiple sites inside your repository` ) )
111
111
112
112
if ( isCI ) {
113
113
throw new Error (
@@ -129,7 +129,7 @@ async function selectWorkspace(project: Project, filter?: string): Promise<strin
129
129
( project . workspace ?. packages || [ ] )
130
130
. filter ( ( pkg ) => pkg . path . includes ( input ) )
131
131
. map ( ( pkg ) => ( {
132
- name : `${ pkg . name ? `${ chalk . bold ( pkg . name ) } ` : '' } ${ pkg . path } ${ chalk . dim (
132
+ name : `${ pkg . name ? `${ ansis . bold ( pkg . name ) } ` : '' } ${ pkg . path } ${ ansis . dim (
133
133
`--filter ${ pkg . name || pkg . path } ` ,
134
134
) } `,
135
135
value : pkg . path ,
@@ -286,7 +286,7 @@ export default class BaseCommand extends Command {
286
286
287
287
if ( description ) {
288
288
const pad = termWidth + HELP_SEPARATOR_WIDTH
289
- const fullText = `${ bang } ${ term . padEnd ( pad - ( isCommand ? 2 : 0 ) ) } ${ chalk . grey ( description ) } `
289
+ const fullText = `${ bang } ${ term . padEnd ( pad - ( isCommand ? 2 : 0 ) ) } ${ ansis . gray ( description ) } `
290
290
return helper . wrap ( fullText , helpWidth - HELP_INDENT_WIDTH , pad )
291
291
}
292
292
@@ -303,34 +303,34 @@ export default class BaseCommand extends Command {
303
303
304
304
// on the parent help command the version should be displayed
305
305
if ( this . name ( ) === 'netlify' ) {
306
- output = [ ...output , chalk . bold ( 'VERSION' ) , formatHelpList ( [ formatItem ( USER_AGENT ) ] ) , '' ]
306
+ output = [ ...output , ansis . bold ( 'VERSION' ) , formatHelpList ( [ formatItem ( USER_AGENT ) ] ) , '' ]
307
307
}
308
308
309
309
// Usage
310
- output = [ ...output , chalk . bold ( 'USAGE' ) , helper . commandUsage ( command ) , '' ]
310
+ output = [ ...output , ansis . bold ( 'USAGE' ) , helper . commandUsage ( command ) , '' ]
311
311
312
312
// Arguments
313
313
const argumentList = helper
314
314
. visibleArguments ( command )
315
315
. map ( ( argument ) => formatItem ( helper . argumentTerm ( argument ) , helper . argumentDescription ( argument ) ) )
316
316
if ( argumentList . length !== 0 ) {
317
- output = [ ...output , chalk . bold ( 'ARGUMENTS' ) , formatHelpList ( argumentList ) , '' ]
317
+ output = [ ...output , ansis . bold ( 'ARGUMENTS' ) , formatHelpList ( argumentList ) , '' ]
318
318
}
319
319
320
320
if ( command . #noBaseOptions === false ) {
321
321
// Options
322
322
const optionList = helper
323
323
. visibleOptions ( command )
324
- . sort ( sortOptions )
324
+ . sort ( compareOptions )
325
325
. map ( ( option ) => formatItem ( helper . optionTerm ( option ) , helper . optionDescription ( option ) ) )
326
326
if ( optionList . length !== 0 ) {
327
- output = [ ...output , chalk . bold ( 'OPTIONS' ) , formatHelpList ( optionList ) , '' ]
327
+ output = [ ...output , ansis . bold ( 'OPTIONS' ) , formatHelpList ( optionList ) , '' ]
328
328
}
329
329
}
330
330
331
331
// Description
332
332
if ( commandDescription . length !== 0 ) {
333
- output = [ ...output , chalk . bold ( 'DESCRIPTION' ) , formatHelpList ( commandDescription ) , '' ]
333
+ output = [ ...output , ansis . bold ( 'DESCRIPTION' ) , formatHelpList ( commandDescription ) , '' ]
334
334
}
335
335
336
336
// Aliases
@@ -339,13 +339,13 @@ export default class BaseCommand extends Command {
339
339
if ( command . _aliases . length !== 0 ) {
340
340
// @ts -expect-error TS(2551) FIXME: Property '_aliases' does not exist on type 'Comman... Remove this comment to see the full error message
341
341
const aliases = command . _aliases . map ( ( alias ) => formatItem ( `${ parentCommand . name ( ) } ${ alias } ` , null , true ) )
342
- output = [ ...output , chalk . bold ( 'ALIASES' ) , formatHelpList ( aliases ) , '' ]
342
+ output = [ ...output , ansis . bold ( 'ALIASES' ) , formatHelpList ( aliases ) , '' ]
343
343
}
344
344
345
345
if ( command . examples . length !== 0 ) {
346
346
output = [
347
347
...output ,
348
- chalk . bold ( 'EXAMPLES' ) ,
348
+ ansis . bold ( 'EXAMPLES' ) ,
349
349
formatHelpList ( command . examples . map ( ( example ) => `${ HELP_$ } ${ example } ` ) ) ,
350
350
'' ,
351
351
]
@@ -355,7 +355,7 @@ export default class BaseCommand extends Command {
355
355
formatItem ( cmd . name ( ) , helper . subcommandDescription ( cmd ) . split ( '\n' ) [ 0 ] , true ) ,
356
356
)
357
357
if ( commandList . length !== 0 ) {
358
- output = [ ...output , chalk . bold ( 'COMMANDS' ) , formatHelpList ( commandList ) , '' ]
358
+ output = [ ...output , ansis . bold ( 'COMMANDS' ) , formatHelpList ( commandList ) , '' ]
359
359
}
360
360
361
361
return [ ...output , '' ] . join ( '\n' )
@@ -450,11 +450,11 @@ export default class BaseCommand extends Command {
450
450
451
451
// Log success
452
452
log ( )
453
- log ( chalk . greenBright ( 'You are now logged into your Netlify account!' ) )
453
+ log ( ansis . greenBright ( 'You are now logged into your Netlify account!' ) )
454
454
log ( )
455
- log ( `Run ${ chalk . cyanBright ( 'netlify status' ) } for account details` )
455
+ log ( `Run ${ ansis . cyanBright ( 'netlify status' ) } for account details` )
456
456
log ( )
457
- log ( `To see all available commands run: ${ chalk . cyanBright ( 'netlify help' ) } ` )
457
+ log ( `To see all available commands run: ${ ansis . cyanBright ( 'netlify help' ) } ` )
458
458
log ( )
459
459
return accessToken
460
460
}
0 commit comments