diff --git a/code/.storybook/vitest.config.ts b/code/.storybook/vitest.config.ts index a6120deed897..25a83b4396ea 100644 --- a/code/.storybook/vitest.config.ts +++ b/code/.storybook/vitest.config.ts @@ -21,7 +21,7 @@ export default mergeConfig( vitestCommonConfig, defineProject({ plugins: [ - import('@storybook/experimental-addon-test/vite-plugin').then(({ storybookTest }) => + import('@storybook/experimental-addon-test/vitest-plugin').then(({ storybookTest }) => storybookTest({ configDir: process.cwd(), }) diff --git a/code/addons/test/package.json b/code/addons/test/package.json index 559808a2ebc7..fcea742e5a58 100644 --- a/code/addons/test/package.json +++ b/code/addons/test/package.json @@ -29,24 +29,24 @@ "import": "./dist/index.js", "require": "./dist/index.cjs" }, - "./vite-plugin": { - "types": "./dist/plugin/index.d.ts", - "import": "./dist/plugin/index.js", - "require": "./dist/plugin/index.cjs" + "./vitest-plugin": { + "types": "./dist/vitest-plugin/index.d.ts", + "import": "./dist/vitest-plugin/index.js", + "require": "./dist/vitest-plugin/index.cjs" }, "./internal/global-setup": { - "types": "./dist/plugin/global-setup.d.ts", - "import": "./dist/plugin/global-setup.js", - "require": "./dist/plugin/global-setup.cjs" + "types": "./dist/vitest-plugin/global-setup.d.ts", + "import": "./dist/vitest-plugin/global-setup.js", + "require": "./dist/vitest-plugin/global-setup.cjs" }, "./internal/setup-file": { - "types": "./dist/plugin/setup-file.d.ts", - "import": "./dist/plugin/setup-file.js" + "types": "./dist/vitest-plugin/setup-file.d.ts", + "import": "./dist/vitest-plugin/setup-file.js" }, "./internal/test-utils": { - "types": "./dist/plugin/test-utils.d.ts", - "import": "./dist/plugin/test-utils.js", - "require": "./dist/plugin/test-utils.cjs" + "types": "./dist/vitest-plugin/test-utils.d.ts", + "import": "./dist/vitest-plugin/test-utils.js", + "require": "./dist/vitest-plugin/test-utils.cjs" }, "./manager": "./dist/manager.js", "./preset": "./dist/preset.cjs", @@ -93,16 +93,16 @@ "bundler": { "exportEntries": [ "./src/index.ts", - "./src/plugin/test-utils.ts", - "./src/plugin/setup-file.ts" + "./src/vitest-plugin/test-utils.ts", + "./src/vitest-plugin/setup-file.ts" ], "managerEntries": [ "./src/manager.tsx" ], "nodeEntries": [ "./src/preset.ts", - "./src/plugin/index.ts", - "./src/plugin/global-setup.ts", + "./src/vitest-plugin/index.ts", + "./src/vitest-plugin/global-setup.ts", "./src/postinstall.ts" ] } diff --git a/code/addons/test/src/index.ts b/code/addons/test/src/index.ts index 9a3583d228c5..db487be11695 100644 --- a/code/addons/test/src/index.ts +++ b/code/addons/test/src/index.ts @@ -1,9 +1,9 @@ -import type { storybookTest as storybookTestImport } from './plugin'; +import type { storybookTest as storybookTestImport } from './vitest-plugin'; // make it work with --isolatedModules export default {}; // @ts-expect-error - this is a hack to make the module's sub-path augmentable -declare module '@storybook/experimental-addon-test/vite-plugin' { +declare module '@storybook/experimental-addon-test/vitest-plugin' { export const storybookTest: typeof storybookTestImport; } diff --git a/code/addons/test/src/postinstall.ts b/code/addons/test/src/postinstall.ts index c1d8cf54709b..a868330b94e7 100644 --- a/code/addons/test/src/postinstall.ts +++ b/code/addons/test/src/postinstall.ts @@ -286,7 +286,7 @@ export default async function postInstall(options: PostinstallOptions) { browserWorkspaceFile, dedent` import { defineWorkspace } from 'vitest/config'; - import { storybookTest } from '@storybook/experimental-addon-test/vite-plugin';${vitestInfo.frameworkPluginImport} + import { storybookTest } from '@storybook/experimental-addon-test/vitest-plugin';${vitestInfo.frameworkPluginImport} // More info at: https://storybook.js.org/docs/writing-tests/test-runner-with-vitest export default defineWorkspace([ @@ -325,7 +325,7 @@ export default async function postInstall(options: PostinstallOptions) { newVitestConfigFile, dedent` import { defineConfig } from 'vitest/config'; - import { storybookTest } from '@storybook/experimental-addon-test/vite-plugin';${vitestInfo.frameworkPluginImport} + import { storybookTest } from '@storybook/experimental-addon-test/vitest-plugin';${vitestInfo.frameworkPluginImport} // More info at: https://storybook.js.org/docs/writing-tests/test-runner-with-vitest export default defineConfig({ diff --git a/code/addons/test/src/plugin/global-setup.ts b/code/addons/test/src/vitest-plugin/global-setup.ts similarity index 100% rename from code/addons/test/src/plugin/global-setup.ts rename to code/addons/test/src/vitest-plugin/global-setup.ts diff --git a/code/addons/test/src/plugin/index.ts b/code/addons/test/src/vitest-plugin/index.ts similarity index 100% rename from code/addons/test/src/plugin/index.ts rename to code/addons/test/src/vitest-plugin/index.ts diff --git a/code/addons/test/src/plugin/setup-file.test.ts b/code/addons/test/src/vitest-plugin/setup-file.test.ts similarity index 100% rename from code/addons/test/src/plugin/setup-file.test.ts rename to code/addons/test/src/vitest-plugin/setup-file.test.ts diff --git a/code/addons/test/src/plugin/setup-file.ts b/code/addons/test/src/vitest-plugin/setup-file.ts similarity index 100% rename from code/addons/test/src/plugin/setup-file.ts rename to code/addons/test/src/vitest-plugin/setup-file.ts diff --git a/code/addons/test/src/plugin/test-utils.ts b/code/addons/test/src/vitest-plugin/test-utils.ts similarity index 100% rename from code/addons/test/src/plugin/test-utils.ts rename to code/addons/test/src/vitest-plugin/test-utils.ts diff --git a/code/addons/test/src/plugin/types.ts b/code/addons/test/src/vitest-plugin/types.ts similarity index 100% rename from code/addons/test/src/plugin/types.ts rename to code/addons/test/src/vitest-plugin/types.ts diff --git a/code/addons/test/src/plugin/viewports.test.ts b/code/addons/test/src/vitest-plugin/viewports.test.ts similarity index 100% rename from code/addons/test/src/plugin/viewports.test.ts rename to code/addons/test/src/vitest-plugin/viewports.test.ts diff --git a/code/addons/test/src/plugin/viewports.ts b/code/addons/test/src/vitest-plugin/viewports.ts similarity index 100% rename from code/addons/test/src/plugin/viewports.ts rename to code/addons/test/src/vitest-plugin/viewports.ts diff --git a/scripts/tasks/sandbox-parts.ts b/scripts/tasks/sandbox-parts.ts index 971bcb7e27c3..07c518a9986e 100644 --- a/scripts/tasks/sandbox-parts.ts +++ b/scripts/tasks/sandbox-parts.ts @@ -437,7 +437,7 @@ export async function setupVitest(details: TemplateDetails, options: PassedOptio join(sandboxDir, 'vitest.workspace.ts'), dedent` import { defineWorkspace, defaultExclude } from "vitest/config"; - import { storybookTest } from "@storybook/experimental-addon-test/vite-plugin"; + import { storybookTest } from "@storybook/experimental-addon-test/vitest-plugin"; ${frameworkPluginImport} export default defineWorkspace([