From ad42b610c25b72561ad367b82b1c7383fd2a5dd2 Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Wed, 4 Oct 2023 23:41:49 +0200 Subject: [PATCH] Fix cli log next.js color (#56448) The color of "Next.js " in CLI was changed to `magenta` accidentally in #55992 , this PR added the original color back --- packages/next/src/lib/picocolors.ts | 3 +++ packages/next/src/server/lib/start-server.ts | 8 ++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/next/src/lib/picocolors.ts b/packages/next/src/lib/picocolors.ts index 67a9ac98e9bce..d78de403455d6 100644 --- a/packages/next/src/lib/picocolors.ts +++ b/packages/next/src/lib/picocolors.ts @@ -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 diff --git a/packages/next/src/server/lib/start-server.ts b/packages/next/src/server/lib/start-server.ts index 61266efcdcc74..9300fe5f69bf2 100644 --- a/packages/next/src/server/lib/start-server.ts +++ b/packages/next/src/server/lib/start-server.ts @@ -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') @@ -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) {