Skip to content

Commit

Permalink
Fix cli log next.js color
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Oct 4, 2023
1 parent 28767ad commit 1dd221d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 3 additions & 0 deletions packages/next/src/lib/picocolors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ export const green = enabled ? formatter('\x1b[32m', '\x1b[39m') : String
export const yellow = enabled ? formatter('\x1b[33m', '\x1b[39m') : String
export const blue = enabled ? formatter('\x1b[34m', '\x1b[39m') : String
export const magenta = enabled ? formatter('\x1b[35m', '\x1b[39m') : String
export const purple = enabled
? formatter('\x1b[38;2;173;127;168m', '\x1b[39m')
: String
export const cyan = enabled ? formatter('\x1b[36m', '\x1b[39m') : String
export const white = enabled ? formatter('\x1b[37m', '\x1b[39m') : String
export const gray = enabled ? formatter('\x1b[90m', '\x1b[39m') : String
Expand Down
8 changes: 2 additions & 6 deletions packages/next/src/server/lib/start-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { formatHostname } from './format-hostname'
import { initialize } from './router-server'
import { checkIsNodeDebugging } from './is-node-debugging'
import { CONFIG_FILES } from '../../shared/lib/constants'
import { bold, magenta } from '../../lib/picocolors'
import { bold, purple } from '../../lib/picocolors'

const debug = setupDebug('next:start-server')

Expand Down Expand Up @@ -92,11 +92,7 @@ function logStartInfo({
formatDurationText: string
}) {
Log.bootstrap(
bold(
magenta(
`${`${Log.prefixes.ready} Next.js`} ${process.env.__NEXT_VERSION}`
)
)
bold(purple(`${Log.prefixes.ready} Next.js ${process.env.__NEXT_VERSION}`))
)
Log.bootstrap(`- Local: ${appUrl}`)
if (hostname) {
Expand Down

0 comments on commit 1dd221d

Please sign in to comment.