From be28704cb18b0a8e92ecbc4154987f9f569ee4dc Mon Sep 17 00:00:00 2001 From: p-sw Date: Fri, 7 Jun 2024 00:11:12 +0900 Subject: [PATCH] feat(cli): add logging to config validation The validateConfig function in the cli module has been updated to include logging. The logs show the locations where the component and shared module will be installed, as well as the import path for the shared module. --- packages/cli/src/helpers/config.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/helpers/config.ts b/packages/cli/src/helpers/config.ts index 8722d29..93e0cb3 100644 --- a/packages/cli/src/helpers/config.ts +++ b/packages/cli/src/helpers/config.ts @@ -13,6 +13,10 @@ export async function loadConfig(config?: string): Promise { } } -export async function validateConfig(config?: unknown): Promise { - return await configZod.parseAsync(config) +export async function validateConfig(log: (message: string) => void, config?: unknown): Promise { + const parsedConfig: ResolvedConfig = await configZod.parseAsync(config) + log(`Install component to: ${join(process.cwd(), parsedConfig.paths.components)}`) + log(`Install shared module to: ${join(process.cwd(), parsedConfig.paths.shared)}`) + log(`Import shared with: ${parsedConfig.import.shared}`) + return parsedConfig }