From 6c57be157d0dd593e6ab7f0fd0def9f771812276 Mon Sep 17 00:00:00 2001 From: Cody Kaup Date: Wed, 23 Oct 2024 14:57:45 -0500 Subject: [PATCH] Add story and fix chalk output --- node-src/ui/messages/errors/buildFailed.stories.ts | 12 ++++++++++++ node-src/ui/messages/errors/buildFailed.ts | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/node-src/ui/messages/errors/buildFailed.stories.ts b/node-src/ui/messages/errors/buildFailed.stories.ts index 72eb28e6e..c37747b74 100644 --- a/node-src/ui/messages/errors/buildFailed.stories.ts +++ b/node-src/ui/messages/errors/buildFailed.stories.ts @@ -59,3 +59,15 @@ export const BuildFailed = () => { message: 'Command failed with exit code 1' }, buildLog ); + +export const BuildFailedWithCommand = () => + buildFailed( + { + options: { buildCommand: 'nx run my-app:build-storybook' }, + buildCommand, + buildLogFile: '/path/to/project/build-storybook.log', + runtimeMetadata, + } as any, + { message: 'Command failed with exit code 1' }, + buildLog + ); diff --git a/node-src/ui/messages/errors/buildFailed.ts b/node-src/ui/messages/errors/buildFailed.ts index aa48c1b9a..300736b46 100644 --- a/node-src/ui/messages/errors/buildFailed.ts +++ b/node-src/ui/messages/errors/buildFailed.ts @@ -16,8 +16,8 @@ export default ( const commandToBuild = buildScriptName || buildCommandOption; const suggestedRunCommands = buildScriptName - ? `{bold npm run ${commandToBuild}} or {bold yarn ${commandToBuild}}` - : `{bold ${commandToBuild}}`; + ? chalk`{bold npm run ${commandToBuild}} or {bold yarn ${commandToBuild}}` + : chalk`{bold ${commandToBuild}}`; return [ dedent(chalk`