1+ import { styleText } from 'node:util'
12import * as p from '@clack/prompts'
2- import pc from 'picocolors'
33import { createDebug } from 'obug'
44
55let isInitialized = false
@@ -10,35 +10,35 @@ let isInitialized = false
1010export function initLogger ( ) : void {
1111 if ( isInitialized ) return
1212 isInitialized = true
13- p . intro ( pc . bgCyan ( pc . black ( ' npmx connector ') ) )
13+ p . intro ( styleText ( [ 'bgCyan' , ' black' ] , ' npmx connector ') )
1414}
1515
1616/**
1717 * Log when starting to execute a command
1818 */
1919export function logCommand ( command : string ) : void {
20- p . log . step ( pc . dim ( ' $ ') + pc . cyan ( command ) )
20+ p . log . step ( ` ${ styleText ( 'dim' , ' $ ') } ${ styleText ( 'cyan' , command ) } ` )
2121}
2222
2323/**
2424 * Log successful command completion
2525 */
2626export function logSuccess ( message : string ) : void {
27- p . log . success ( pc . green ( message ) )
27+ p . log . success ( styleText ( 'green' , message ) )
2828}
2929
3030/**
3131 * Log command failure
3232 */
3333export function logError ( message : string ) : void {
34- p . log . error ( pc . red ( message ) )
34+ p . log . error ( styleText ( 'red' , message ) )
3535}
3636
3737/**
3838 * Log warning
3939 */
4040export function logWarning ( message : string ) : void {
41- p . log . warn ( pc . yellow ( message ) )
41+ p . log . warn ( styleText ( 'yellow' , message ) )
4242}
4343
4444/**
@@ -61,9 +61,9 @@ export function showToken(token: string, port: number, frontendUrl: string): voi
6161
6262 p . note (
6363 [
64- `Open: ${ pc . bold ( pc . underline ( pc . cyan ( connectUrl ) ) ) } ` ,
64+ `Open: ${ styleText ( [ 'bold' , ' underline' , ' cyan' ] , connectUrl ) } ` ,
6565 '' ,
66- pc . dim ( `Or paste token manually: ${ token } ` ) ,
66+ styleText ( 'dim' , `Or paste token manually: ${ token } ` ) ,
6767 ] . join ( '\n' ) ,
6868 'Click to connect' ,
6969 )
0 commit comments