Skip to content

Commit

Permalink
don't add framework plugins to sandboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
JReinhold committed Dec 19, 2024
1 parent 4512a5a commit a045f4e
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions scripts/tasks/sandbox-parts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,34 +368,6 @@ async function linkPackageStories(
);
}

const getVitestPluginInfo = (details: TemplateDetails) => {
let frameworkPluginImport = '';
let frameworkPluginCall = '';

const framework = details.template.expected.framework;
const isNextjs = framework.includes('nextjs');
const isSveltekit = framework.includes('sveltekit');

if (isNextjs) {
frameworkPluginImport =
"import { storybookNextJsPlugin } from '@storybook/experimental-nextjs-vite/vite-plugin'";
frameworkPluginCall = 'storybookNextJsPlugin()';
}

if (isSveltekit) {
frameworkPluginImport =
"import { storybookSveltekitPlugin } from '@storybook/sveltekit/vite-plugin'";
frameworkPluginCall = 'storybookSveltekitPlugin()';
}

if (framework === '@storybook/vue3-vite') {
frameworkPluginImport = "import { storybookVuePlugin } from '@storybook/vue3-vite/vite-plugin'";
frameworkPluginCall = 'storybookVuePlugin()';
}

return { frameworkPluginImport, frameworkPluginCall };
};

export async function setupVitest(details: TemplateDetails, options: PassedOptionValues) {
const { sandboxDir, template } = details;
const packageJsonPath = join(sandboxDir, 'package.json');
Expand All @@ -420,7 +392,6 @@ export async function setupVitest(details: TemplateDetails, options: PassedOptio

const isVue = template.expected.renderer === '@storybook/vue3';
const isNextjs = template.expected.framework.includes('nextjs');
const { frameworkPluginCall, frameworkPluginImport } = getVitestPluginInfo(details);
// const isAngular = template.expected.framework === '@storybook/angular';

const portableStoriesFrameworks = [
Expand Down Expand Up @@ -467,7 +438,6 @@ export async function setupVitest(details: TemplateDetails, options: PassedOptio
dedent`
import { defineWorkspace, defaultExclude } from "vitest/config";
import { storybookTest } from "@storybook/experimental-addon-test/vitest-plugin";
${frameworkPluginImport}
export default defineWorkspace([
{
Expand All @@ -479,7 +449,6 @@ export async function setupVitest(details: TemplateDetails, options: PassedOptio
include: ["vitest"],
},
}),
${frameworkPluginCall}
],
${
isNextjs
Expand Down

0 comments on commit a045f4e

Please sign in to comment.