From a22d3371655b88eda3cd8bb89ef714a355cd4f60 Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Mon, 15 Jul 2024 13:59:14 +0200 Subject: [PATCH 1/3] Add diagnostic when the `storybook` package is missing --- code/lib/cli/src/doctor/index.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/code/lib/cli/src/doctor/index.ts b/code/lib/cli/src/doctor/index.ts index 6aab5507b21a..0fe8627c9d3d 100644 --- a/code/lib/cli/src/doctor/index.ts +++ b/code/lib/cli/src/doctor/index.ts @@ -105,6 +105,15 @@ export const doctor = async ({ const allDependencies = (await packageManager.getAllDependencies()) as Record; + if (!('storybook' in allDependencies)) { + logDiagnostic( + 'Package storybook not found', + dedent` + The storybook package was not found in your package.json. + Installing storybook as a direct dev dependency in your package.json is required. + ` + ); + } const incompatibleStorybookPackagesList = await getIncompatibleStorybookPackages({ currentStorybookVersion: storybookVersion, }); From c8c1f4aa7648e737a34e2c860eb9fadeb95a9a08 Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Mon, 15 Jul 2024 16:01:04 +0200 Subject: [PATCH 2/3] Chalk storybook --- code/lib/cli/src/doctor/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/lib/cli/src/doctor/index.ts b/code/lib/cli/src/doctor/index.ts index 0fe8627c9d3d..e74e43c8903a 100644 --- a/code/lib/cli/src/doctor/index.ts +++ b/code/lib/cli/src/doctor/index.ts @@ -107,9 +107,9 @@ export const doctor = async ({ if (!('storybook' in allDependencies)) { logDiagnostic( - 'Package storybook not found', + `Package ${chalk.cyan('storybook')} not found`, dedent` - The storybook package was not found in your package.json. + The ${chalk.cyan('storybook')} package was not found in your package.json. Installing storybook as a direct dev dependency in your package.json is required. ` ); From 3fb7d9190631f9f128666fc993166b6f2848b8b3 Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Mon, 15 Jul 2024 16:01:21 +0200 Subject: [PATCH 3/3] Chalk storybook --- code/lib/cli/src/doctor/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/lib/cli/src/doctor/index.ts b/code/lib/cli/src/doctor/index.ts index e74e43c8903a..0e2f0747aa7a 100644 --- a/code/lib/cli/src/doctor/index.ts +++ b/code/lib/cli/src/doctor/index.ts @@ -110,7 +110,7 @@ export const doctor = async ({ `Package ${chalk.cyan('storybook')} not found`, dedent` The ${chalk.cyan('storybook')} package was not found in your package.json. - Installing storybook as a direct dev dependency in your package.json is required. + Installing ${chalk.cyan('storybook')} as a direct dev dependency in your package.json is required. ` ); }