From 39a13d1355fbbc5494ee8d19b491cddcfc089c99 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Mon, 4 Nov 2024 12:21:35 +0100 Subject: [PATCH] Addon Test: Enhance post-install logic for Next.js Vite framework support --- code/addons/test/src/postinstall.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/addons/test/src/postinstall.ts b/code/addons/test/src/postinstall.ts index f7b5efe8521c..90595b0e15d6 100644 --- a/code/addons/test/src/postinstall.ts +++ b/code/addons/test/src/postinstall.ts @@ -58,7 +58,9 @@ export default async function postInstall(options: PostinstallOptions) { '@storybook/experimental-nextjs-vite', '@storybook/sveltekit', ].includes(info.frameworkPackageName) - ? info.frameworkPackageName + ? info.frameworkPackageName === '@storybook/nextjs' + ? '@storybook/experimental-nextjs-vite' + : info.frameworkPackageName : info.rendererPackageName && ['@storybook/react', '@storybook/svelte', '@storybook/vue3'].includes( info.rendererPackageName @@ -431,7 +433,7 @@ const getVitestPluginInfo = (framework: string) => { let frameworkPluginCall = ''; let frameworkPluginDocs = ''; - if (framework === '@storybook/nextjs') { + if (framework === '@storybook/nextjs' || framework === '@storybook/experimental-nextjs-vite') { frameworkPluginImport = "import { storybookNextJsPlugin } from '@storybook/experimental-nextjs-vite/vite-plugin';"; frameworkPluginDocs =