diff --git a/packages/dev/commands/build.ts b/packages/dev/commands/build.ts index 3653724..6da0937 100644 --- a/packages/dev/commands/build.ts +++ b/packages/dev/commands/build.ts @@ -247,10 +247,12 @@ ${ if (await configFile.exists()) { userConfigData = await configFile.json(); } else { - console.warn("⚠️ config.json not found at runtime"); + console.error("❌ config.json not found at runtime"); + process.exit(1); } } catch (e) { console.error("❌ Failed to load config.json:", e); + process.exit(1); } const client = new DjsClient({ djsConfig: config, userConfig: userConfigData as UserConfig });` : " const client = new DjsClient({ djsConfig: config });" @@ -427,10 +429,11 @@ export function registerBuildCommand(cli: CAC) { try { await fs.copyFile(configJsonPath, outConfigJsonPath); console.log( - pc.green("✓") + ` config.json copied to ${pc.bold("dist/")}`, + `${pc.green("✓")} config.json copied to ${pc.bold("dist/")}`, ); - } catch (e) { - console.warn(pc.yellow("⚠️ Could not copy config.json to dist/")); + } catch (_e) { + console.error(pc.red("❌ Could not copy config.json to dist/")); + process.exit(1); } } diff --git a/packages/dev/utils/common.ts b/packages/dev/utils/common.ts index e39342d..fce4c6e 100644 --- a/packages/dev/utils/common.ts +++ b/packages/dev/utils/common.ts @@ -151,11 +151,10 @@ export async function runBot(projectPath: string) { userConfig = JSON.parse(configJsonContent); console.log(`${pc.green("✓")} User config loaded`); } catch (_error) { - console.warn( - pc.yellow( - "⚠️ userConfig is enabled but config.json not found or invalid", - ), + console.error( + pc.red("❌ userConfig is enabled but config.json not found or invalid"), ); + process.exit(1); } }