From 1bd296b1599c551547fca8072f3657e7b9ce31ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=90=91=E5=A4=9C?= Date: Sat, 16 Nov 2024 04:37:25 +0800 Subject: [PATCH] feat: optimize outputs --- packages/core/src/server/preview.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/core/src/server/preview.ts b/packages/core/src/server/preview.ts index 8f6523bd3..d678d3797 100644 --- a/packages/core/src/server/preview.ts +++ b/packages/core/src/server/preview.ts @@ -12,13 +12,15 @@ import { ResolvedUserConfig, UserConfig } from '../config/types.js'; +import { bold, brandColor, green } from '../utils/color.js'; import { resolveServerUrls, setupSIGTERMListener, teardownSIGTERMListener } from '../utils/http.js'; import { printServerUrls } from '../utils/logger.js'; -import { isObject } from '../utils/share.js'; +import { getShortName } from '../utils/path.js'; +import { isObject, version } from '../utils/share.js'; import { knownJavascriptExtensionRE } from '../utils/url.js'; import { type CommonServerOptions, @@ -224,6 +226,14 @@ export class PreviewServer extends httpServer { 'preview' ); + const shortFile = getShortName( + this.resolvedUserConfig.configFilePath, + this.resolvedUserConfig.root + ); + this.logger.info(`Using config file at ${bold(green(shortFile))}`); + + console.log('\n', bold(brandColor(`${'ϟ'} Farm v${version}`)), '\n'); + printServerUrls( this.resolvedUrls, this.previewServerOptions.host,