11import crypto from 'node:crypto'
2+ import { styleText } from 'node:util'
23import { createRequestHandler } from '@react-router/express'
34import * as Sentry from '@sentry/node'
45import { ip as ipAddress } from 'address'
5- import chalk from 'chalk'
66import closeWithGrace from 'close-with-grace'
77import compression from 'compression'
88import express from 'express'
@@ -258,9 +258,7 @@ if (!portAvailable && !IS_DEV) {
258258const server = app . listen ( portToUse , ( ) => {
259259 if ( ! portAvailable ) {
260260 console . warn (
261- chalk . yellow (
262- `⚠️ Port ${ desiredPort } is not available, using ${ portToUse } instead.` ,
263- ) ,
261+ styleText ( 'yellow' , `⚠️ Port ${ desiredPort } is not available, using ${ portToUse } instead.` ) ,
264262 )
265263 }
266264 console . log ( `🚀 We have liftoff!` )
@@ -276,9 +274,9 @@ const server = app.listen(portToUse, () => {
276274
277275 console . log (
278276 `
279- ${ chalk . bold ( ' Local:') } ${ chalk . cyan ( localUrl ) }
280- ${ lanUrl ? `${ chalk . bold ( ' On Your Network:') } ${ chalk . cyan ( lanUrl ) } ` : '' }
281- ${ chalk . bold ( 'Press Ctrl+C to stop' ) }
277+ ${ styleText ( 'bold' , ' Local:') } ${ styleText ( 'cyan' , localUrl ) }
278+ ${ lanUrl ? `${ styleText ( 'bold' , ' On Your Network:') } ${ styleText ( 'cyan' , lanUrl ) } ` : '' }
279+ ${ styleText ( 'bold' , 'Press Ctrl+C to stop' ) }
282280 ` . trim ( ) ,
283281 )
284282} )
@@ -288,8 +286,8 @@ closeWithGrace(async ({ err }) => {
288286 server . close ( ( e ) => ( e ? reject ( e ) : resolve ( 'ok' ) ) )
289287 } )
290288 if ( err ) {
291- console . error ( chalk . red ( err ) )
292- console . error ( chalk . red ( err . stack ) )
289+ console . error ( styleText ( ' red' , String ( err ) ) )
290+ console . error ( styleText ( ' red' , String ( err . stack ) ) )
293291 if ( SENTRY_ENABLED ) {
294292 Sentry . captureException ( err )
295293 await Sentry . flush ( 500 )
0 commit comments