Skip to content

Commit

Permalink
Merge pull request #29067 from storybookjs/yann/entrypoint-renaming
Browse files Browse the repository at this point in the history
Test: Rename vitest plugin entrypoint
  • Loading branch information
yannbf authored Sep 6, 2024
2 parents e610404 + 236e51e commit 01b9f91
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion code/.storybook/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
})
Expand Down
32 changes: 16 additions & 16 deletions code/addons/test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
]
}
Expand Down
4 changes: 2 additions & 2 deletions code/addons/test/src/index.ts
Original file line number Diff line number Diff line change
@@ -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;
}
4 changes: 2 additions & 2 deletions code/addons/test/src/postinstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down Expand Up @@ -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({
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion scripts/tasks/sandbox-parts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down

0 comments on commit 01b9f91

Please sign in to comment.