diff --git a/code/core/src/common/defineConfig.ts b/code/core/src/common/defineConfig.ts new file mode 100644 index 000000000000..2a16d88aa474 --- /dev/null +++ b/code/core/src/common/defineConfig.ts @@ -0,0 +1,5 @@ +import type { StorybookConfig } from '@storybook/core/types'; + +export function defineConfig(config: TConfig): TConfig { + return config; +} diff --git a/code/core/src/common/index.ts b/code/core/src/common/index.ts index 6166e285ab05..dcec4e025c53 100644 --- a/code/core/src/common/index.ts +++ b/code/core/src/common/index.ts @@ -42,6 +42,7 @@ export * from './utils/formatter'; export * from './utils/get-story-id'; export * from './utils/posix'; export * from './js-package-manager'; +export * from './defineConfig'; export { versions }; diff --git a/code/frameworks/angular/package.json b/code/frameworks/angular/package.json index 946679a7a129..2c71784ede70 100644 --- a/code/frameworks/angular/package.json +++ b/code/frameworks/angular/package.json @@ -20,6 +20,22 @@ "url": "https://opencollective.com/storybook" }, "license": "MIT", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "node": "./dist/index.js", + "import": "./dist/index.mjs", + "require": "./dist/index.js" + }, + "./preset": "./preset.js", + "./node": { + "types": "./dist/csf-factory/defineMainConfig.d.ts", + "node": "./dist/csf-factory/defineMainConfig.js", + "import": "./dist/csf-factory/defineMainConfig.js", + "require": "./dist/csf-factory/defineMainConfig.js" + }, + "./package.json": "./package.json" + }, "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", diff --git a/code/frameworks/angular/src/csf-factory/defineMainConfig.ts b/code/frameworks/angular/src/csf-factory/defineMainConfig.ts new file mode 100644 index 000000000000..24bc05422ac9 --- /dev/null +++ b/code/frameworks/angular/src/csf-factory/defineMainConfig.ts @@ -0,0 +1,7 @@ +import { defineConfig as commonDefineConfig } from 'storybook/internal/common'; + +import { StorybookConfig } from '../types'; + +export function defineMain(config: StorybookConfig) { + return commonDefineConfig(config); +} diff --git a/code/frameworks/ember/package.json b/code/frameworks/ember/package.json index 9e308f6b5f6d..94b6468b39f8 100644 --- a/code/frameworks/ember/package.json +++ b/code/frameworks/ember/package.json @@ -16,6 +16,22 @@ "url": "https://opencollective.com/storybook" }, "license": "MIT", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "node": "./dist/index.js", + "import": "./dist/index.mjs", + "require": "./dist/index.js" + }, + "./preset": "./preset.js", + "./node": { + "types": "./dist/csf-factory/defineMainConfig.d.ts", + "node": "./dist/csf-factory/defineMainConfig.js", + "import": "./dist/csf-factory/defineMainConfig.js", + "require": "./dist/csf-factory/defineMainConfig.js" + }, + "./package.json": "./package.json" + }, "main": "dist/index.js", "module": "dist/index.mjs", "types": "dist/index.d.ts", diff --git a/code/frameworks/ember/src/csf-factory/defineMainConfig.ts b/code/frameworks/ember/src/csf-factory/defineMainConfig.ts new file mode 100644 index 000000000000..dd999c40b17b --- /dev/null +++ b/code/frameworks/ember/src/csf-factory/defineMainConfig.ts @@ -0,0 +1,7 @@ +import { defineConfig as commonDefineConfig } from 'storybook/internal/common'; + +import type { StorybookConfig } from '../types'; + +export function defineMain(config: StorybookConfig) { + return commonDefineConfig(config); +} diff --git a/code/frameworks/experimental-nextjs-vite/package.json b/code/frameworks/experimental-nextjs-vite/package.json index b5205345ed72..4b20e1113092 100644 --- a/code/frameworks/experimental-nextjs-vite/package.json +++ b/code/frameworks/experimental-nextjs-vite/package.json @@ -58,6 +58,12 @@ "import": "./dist/vite-plugin/index.mjs", "require": "./dist/vite-plugin/index.js" }, + "./node": { + "types": "./dist/csf-factory/defineMainConfig.d.ts", + "node": "./dist/csf-factory/defineMainConfig.js", + "import": "./dist/csf-factory/defineMainConfig.mjs", + "require": "./dist/csf-factory/defineMainConfig.js" + }, "./package.json": "./package.json" }, "main": "dist/index.js", @@ -134,6 +140,7 @@ "./src/index.ts", "./src/vite-plugin/index.ts", "./src/preset.ts", + "./src/csf-factory/defineMainConfig.ts", "./src/preview.tsx", "./src/export-mocks/cache/index.ts", "./src/export-mocks/headers/index.ts", diff --git a/code/frameworks/experimental-nextjs-vite/src/csf-factory/defineMainConfig.ts b/code/frameworks/experimental-nextjs-vite/src/csf-factory/defineMainConfig.ts new file mode 100644 index 000000000000..dd999c40b17b --- /dev/null +++ b/code/frameworks/experimental-nextjs-vite/src/csf-factory/defineMainConfig.ts @@ -0,0 +1,7 @@ +import { defineConfig as commonDefineConfig } from 'storybook/internal/common'; + +import type { StorybookConfig } from '../types'; + +export function defineMain(config: StorybookConfig) { + return commonDefineConfig(config); +} diff --git a/code/frameworks/html-vite/package.json b/code/frameworks/html-vite/package.json index 804987dac1c7..1ce79c846355 100644 --- a/code/frameworks/html-vite/package.json +++ b/code/frameworks/html-vite/package.json @@ -30,6 +30,12 @@ "types": "./dist/preset.d.ts", "require": "./dist/preset.js" }, + "./node": { + "types": "./dist/csf-factory/defineMainConfig.d.ts", + "node": "./dist/csf-factory/defineMainConfig.js", + "import": "./dist/csf-factory/defineMainConfig.mjs", + "require": "./dist/csf-factory/defineMainConfig.js" + }, "./package.json": "./package.json" }, "main": "dist/index.js", @@ -67,7 +73,8 @@ "bundler": { "entries": [ "./src/index.ts", - "./src/preset.ts" + "./src/preset.ts", + "./src/csf-factory/defineMainConfig.ts" ], "platform": "node" }, diff --git a/code/frameworks/html-vite/src/csf-factory/defineMainConfig.ts b/code/frameworks/html-vite/src/csf-factory/defineMainConfig.ts new file mode 100644 index 000000000000..dd999c40b17b --- /dev/null +++ b/code/frameworks/html-vite/src/csf-factory/defineMainConfig.ts @@ -0,0 +1,7 @@ +import { defineConfig as commonDefineConfig } from 'storybook/internal/common'; + +import type { StorybookConfig } from '../types'; + +export function defineMain(config: StorybookConfig) { + return commonDefineConfig(config); +} diff --git a/code/frameworks/html-webpack5/package.json b/code/frameworks/html-webpack5/package.json index 03cd0ce7cfc2..8a7167dd0f54 100644 --- a/code/frameworks/html-webpack5/package.json +++ b/code/frameworks/html-webpack5/package.json @@ -30,6 +30,12 @@ "types": "./dist/preset.d.ts", "require": "./dist/preset.js" }, + "./node": { + "types": "./dist/csf-factory/defineMainConfig.d.ts", + "node": "./dist/csf-factory/defineMainConfig.js", + "import": "./dist/csf-factory/defineMainConfig.mjs", + "require": "./dist/csf-factory/defineMainConfig.js" + }, "./package.json": "./package.json" }, "main": "dist/index.js", @@ -68,7 +74,8 @@ "bundler": { "entries": [ "./src/index.ts", - "./src/preset.ts" + "./src/preset.ts", + "./src/csf-factory/defineMainConfig.ts" ], "platform": "node" }, diff --git a/code/frameworks/html-webpack5/src/csf-factory/defineMainConfig.ts b/code/frameworks/html-webpack5/src/csf-factory/defineMainConfig.ts new file mode 100644 index 000000000000..dd999c40b17b --- /dev/null +++ b/code/frameworks/html-webpack5/src/csf-factory/defineMainConfig.ts @@ -0,0 +1,7 @@ +import { defineConfig as commonDefineConfig } from 'storybook/internal/common'; + +import type { StorybookConfig } from '../types'; + +export function defineMain(config: StorybookConfig) { + return commonDefineConfig(config); +} diff --git a/code/frameworks/nextjs/package.json b/code/frameworks/nextjs/package.json index a440c6b17a17..41dea2891772 100644 --- a/code/frameworks/nextjs/package.json +++ b/code/frameworks/nextjs/package.json @@ -87,6 +87,12 @@ "import": "./dist/export-mocks/router/index.mjs", "require": "./dist/export-mocks/router/index.js" }, + "./main": { + "types": "./dist/csf-factory/defineMainConfig.d.ts", + "node": "./dist/csf-factory/defineMainConfig.js", + "import": "./dist/csf-factory/defineMainConfig.mjs", + "require": "./dist/csf-factory/defineMainConfig.js" + }, "./package.json": "./package.json" }, "main": "dist/index.js", @@ -209,6 +215,7 @@ "./src/image-context.ts", "./src/index.ts", "./src/preset.ts", + "./src/csf-factory/defineMainConfig.ts", "./src/preview.tsx", "./src/export-mocks/index.ts", "./src/export-mocks/cache/index.ts", diff --git a/code/frameworks/nextjs/src/csf-factory/defineMainConfig.ts b/code/frameworks/nextjs/src/csf-factory/defineMainConfig.ts new file mode 100644 index 000000000000..dd999c40b17b --- /dev/null +++ b/code/frameworks/nextjs/src/csf-factory/defineMainConfig.ts @@ -0,0 +1,7 @@ +import { defineConfig as commonDefineConfig } from 'storybook/internal/common'; + +import type { StorybookConfig } from '../types'; + +export function defineMain(config: StorybookConfig) { + return commonDefineConfig(config); +} diff --git a/code/frameworks/preact-vite/package.json b/code/frameworks/preact-vite/package.json index 5b146f3a9bbf..e639c1c7e0bb 100644 --- a/code/frameworks/preact-vite/package.json +++ b/code/frameworks/preact-vite/package.json @@ -29,6 +29,12 @@ "types": "./dist/preset.d.ts", "require": "./dist/preset.js" }, + "./node": { + "types": "./dist/csf-factory/defineMainConfig.d.ts", + "node": "./dist/csf-factory/defineMainConfig.js", + "import": "./dist/csf-factory/defineMainConfig.mjs", + "require": "./dist/csf-factory/defineMainConfig.js" + }, "./package.json": "./package.json" }, "main": "dist/index.js", diff --git a/code/frameworks/preact-vite/src/csf-factory/defineMainConfig.ts b/code/frameworks/preact-vite/src/csf-factory/defineMainConfig.ts new file mode 100644 index 000000000000..dd999c40b17b --- /dev/null +++ b/code/frameworks/preact-vite/src/csf-factory/defineMainConfig.ts @@ -0,0 +1,7 @@ +import { defineConfig as commonDefineConfig } from 'storybook/internal/common'; + +import type { StorybookConfig } from '../types'; + +export function defineMain(config: StorybookConfig) { + return commonDefineConfig(config); +} diff --git a/code/frameworks/preact-webpack5/package.json b/code/frameworks/preact-webpack5/package.json index 5f0290ffcebc..cd7effb465d0 100644 --- a/code/frameworks/preact-webpack5/package.json +++ b/code/frameworks/preact-webpack5/package.json @@ -30,6 +30,12 @@ "types": "./dist/preset.d.ts", "require": "./dist/preset.js" }, + "./node": { + "types": "./dist/csf-factory/defineMainConfig.d.ts", + "node": "./dist/csf-factory/defineMainConfig.js", + "import": "./dist/csf-factory/defineMainConfig.mjs", + "require": "./dist/csf-factory/defineMainConfig.js" + }, "./package.json": "./package.json" }, "main": "dist/index.js", @@ -69,7 +75,8 @@ "bundler": { "entries": [ "./src/index.ts", - "./src/preset.ts" + "./src/preset.ts", + "./src/csf-factory/defineMainConfig.ts" ], "platform": "node" }, diff --git a/code/frameworks/preact-webpack5/src/csf-factory/defineMainConfig.ts b/code/frameworks/preact-webpack5/src/csf-factory/defineMainConfig.ts new file mode 100644 index 000000000000..dd999c40b17b --- /dev/null +++ b/code/frameworks/preact-webpack5/src/csf-factory/defineMainConfig.ts @@ -0,0 +1,7 @@ +import { defineConfig as commonDefineConfig } from 'storybook/internal/common'; + +import type { StorybookConfig } from '../types'; + +export function defineMain(config: StorybookConfig) { + return commonDefineConfig(config); +} diff --git a/code/frameworks/react-native-web-vite/package.json b/code/frameworks/react-native-web-vite/package.json index da31ba3bca39..8f392bc254dd 100644 --- a/code/frameworks/react-native-web-vite/package.json +++ b/code/frameworks/react-native-web-vite/package.json @@ -35,6 +35,12 @@ "import": "./dist/vite-plugin.mjs", "require": "./dist/vite-plugin.js" }, + "./node": { + "types": "./dist/csf-factory/defineMainConfig.d.ts", + "node": "./dist/csf-factory/defineMainConfig.js", + "import": "./dist/csf-factory/defineMainConfig.mjs", + "require": "./dist/csf-factory/defineMainConfig.js" + }, "./package.json": "./package.json" }, "main": "dist/index.js", @@ -86,7 +92,8 @@ "entries": [ "./src/index.ts", "./src/preset.ts", - "./src/vite-plugin.ts" + "./src/vite-plugin.ts", + "./src/csf-factory/defineMainConfig.ts" ], "platform": "node" }, diff --git a/code/frameworks/react-native-web-vite/src/csf-factory/defineMainConfig.ts b/code/frameworks/react-native-web-vite/src/csf-factory/defineMainConfig.ts new file mode 100644 index 000000000000..dd999c40b17b --- /dev/null +++ b/code/frameworks/react-native-web-vite/src/csf-factory/defineMainConfig.ts @@ -0,0 +1,7 @@ +import { defineConfig as commonDefineConfig } from 'storybook/internal/common'; + +import type { StorybookConfig } from '../types'; + +export function defineMain(config: StorybookConfig) { + return commonDefineConfig(config); +} diff --git a/code/frameworks/react-vite/package.json b/code/frameworks/react-vite/package.json index d871585cf42c..6228aea36f4c 100644 --- a/code/frameworks/react-vite/package.json +++ b/code/frameworks/react-vite/package.json @@ -30,6 +30,12 @@ "types": "./dist/preset.d.ts", "require": "./dist/preset.js" }, + "./node": { + "types": "./dist/csf-factory/defineMainConfig.d.ts", + "node": "./dist/csf-factory/defineMainConfig.js", + "import": "./dist/csf-factory/defineMainConfig.mjs", + "require": "./dist/csf-factory/defineMainConfig.js" + }, "./package.json": "./package.json" }, "main": "dist/index.js", @@ -93,7 +99,8 @@ "bundler": { "entries": [ "./src/index.ts", - "./src/preset.ts" + "./src/preset.ts", + "./src/csf-factory/defineMainConfig.ts" ], "platform": "node" }, diff --git a/code/frameworks/react-vite/src/csf-factory/defineMainConfig.ts b/code/frameworks/react-vite/src/csf-factory/defineMainConfig.ts new file mode 100644 index 000000000000..dd999c40b17b --- /dev/null +++ b/code/frameworks/react-vite/src/csf-factory/defineMainConfig.ts @@ -0,0 +1,7 @@ +import { defineConfig as commonDefineConfig } from 'storybook/internal/common'; + +import type { StorybookConfig } from '../types'; + +export function defineMain(config: StorybookConfig) { + return commonDefineConfig(config); +} diff --git a/code/frameworks/react-webpack5/package.json b/code/frameworks/react-webpack5/package.json index c6c05892a81f..8c26cc0072aa 100644 --- a/code/frameworks/react-webpack5/package.json +++ b/code/frameworks/react-webpack5/package.json @@ -30,6 +30,12 @@ "types": "./dist/preset.d.ts", "require": "./dist/preset.js" }, + "./node": { + "types": "./dist/csf-factory/defineMainConfig.d.ts", + "node": "./dist/csf-factory/defineMainConfig.js", + "import": "./dist/csf-factory/defineMainConfig.mjs", + "require": "./dist/csf-factory/defineMainConfig.js" + }, "./package.json": "./package.json" }, "main": "dist/index.js", @@ -74,7 +80,8 @@ "bundler": { "entries": [ "./src/index.ts", - "./src/preset.ts" + "./src/preset.ts", + "./src/csf-factory/defineMainConfig.ts" ], "platform": "node" }, diff --git a/code/frameworks/react-webpack5/src/csf-factory/defineMainConfig.ts b/code/frameworks/react-webpack5/src/csf-factory/defineMainConfig.ts new file mode 100644 index 000000000000..dd999c40b17b --- /dev/null +++ b/code/frameworks/react-webpack5/src/csf-factory/defineMainConfig.ts @@ -0,0 +1,7 @@ +import { defineConfig as commonDefineConfig } from 'storybook/internal/common'; + +import type { StorybookConfig } from '../types'; + +export function defineMain(config: StorybookConfig) { + return commonDefineConfig(config); +} diff --git a/code/frameworks/server-webpack5/package.json b/code/frameworks/server-webpack5/package.json index ef6b005495c5..1f61cce000ec 100644 --- a/code/frameworks/server-webpack5/package.json +++ b/code/frameworks/server-webpack5/package.json @@ -30,6 +30,12 @@ "types": "./dist/preset.d.ts", "require": "./dist/preset.js" }, + "./node": { + "types": "./dist/csf-factory/defineMainConfig.d.ts", + "node": "./dist/csf-factory/defineMainConfig.js", + "import": "./dist/csf-factory/defineMainConfig.mjs", + "require": "./dist/csf-factory/defineMainConfig.js" + }, "./package.json": "./package.json" }, "main": "dist/index.js", @@ -67,7 +73,8 @@ "bundler": { "entries": [ "./src/index.ts", - "./src/preset.ts" + "./src/preset.ts", + "./src/csf-factory/defineMainConfig.ts" ], "platform": "node" }, diff --git a/code/frameworks/server-webpack5/src/csf-factory/defineMainConfig.ts b/code/frameworks/server-webpack5/src/csf-factory/defineMainConfig.ts new file mode 100644 index 000000000000..dd999c40b17b --- /dev/null +++ b/code/frameworks/server-webpack5/src/csf-factory/defineMainConfig.ts @@ -0,0 +1,7 @@ +import { defineConfig as commonDefineConfig } from 'storybook/internal/common'; + +import type { StorybookConfig } from '../types'; + +export function defineMain(config: StorybookConfig) { + return commonDefineConfig(config); +} diff --git a/code/frameworks/svelte-vite/package.json b/code/frameworks/svelte-vite/package.json index 5007a4d2ff35..b82e3b98b28b 100644 --- a/code/frameworks/svelte-vite/package.json +++ b/code/frameworks/svelte-vite/package.json @@ -30,6 +30,12 @@ "types": "./dist/preset.d.ts", "require": "./dist/preset.js" }, + "./node": { + "types": "./dist/csf-factory/defineMainConfig.d.ts", + "node": "./dist/csf-factory/defineMainConfig.js", + "import": "./dist/csf-factory/defineMainConfig.mjs", + "require": "./dist/csf-factory/defineMainConfig.js" + }, "./package.json": "./package.json" }, "main": "dist/index.js", @@ -78,7 +84,8 @@ "bundler": { "entries": [ "./src/index.ts", - "./src/preset.ts" + "./src/preset.ts", + "./src/csf-factory/defineMainConfig.ts" ], "platform": "node" }, diff --git a/code/frameworks/svelte-vite/src/csf-factory/defineMainConfig.ts b/code/frameworks/svelte-vite/src/csf-factory/defineMainConfig.ts new file mode 100644 index 000000000000..dd999c40b17b --- /dev/null +++ b/code/frameworks/svelte-vite/src/csf-factory/defineMainConfig.ts @@ -0,0 +1,7 @@ +import { defineConfig as commonDefineConfig } from 'storybook/internal/common'; + +import type { StorybookConfig } from '../types'; + +export function defineMain(config: StorybookConfig) { + return commonDefineConfig(config); +} diff --git a/code/frameworks/svelte-webpack5/package.json b/code/frameworks/svelte-webpack5/package.json index 78b652a38c07..f483c25bf7e3 100644 --- a/code/frameworks/svelte-webpack5/package.json +++ b/code/frameworks/svelte-webpack5/package.json @@ -30,6 +30,12 @@ "types": "./dist/preset.d.ts", "require": "./dist/preset.js" }, + "./node": { + "types": "./dist/csf-factory/defineMainConfig.d.ts", + "node": "./dist/csf-factory/defineMainConfig.js", + "import": "./dist/csf-factory/defineMainConfig.mjs", + "require": "./dist/csf-factory/defineMainConfig.js" + }, "./package.json": "./package.json" }, "main": "dist/index.js", @@ -70,7 +76,8 @@ "bundler": { "entries": [ "./src/index.ts", - "./src/preset.ts" + "./src/preset.ts", + "./src/csf-factory/defineMainConfig.ts" ], "platform": "node" }, diff --git a/code/frameworks/svelte-webpack5/src/csf-factory/defineMainConfig.ts b/code/frameworks/svelte-webpack5/src/csf-factory/defineMainConfig.ts new file mode 100644 index 000000000000..dd999c40b17b --- /dev/null +++ b/code/frameworks/svelte-webpack5/src/csf-factory/defineMainConfig.ts @@ -0,0 +1,7 @@ +import { defineConfig as commonDefineConfig } from 'storybook/internal/common'; + +import type { StorybookConfig } from '../types'; + +export function defineMain(config: StorybookConfig) { + return commonDefineConfig(config); +} diff --git a/code/frameworks/sveltekit/package.json b/code/frameworks/sveltekit/package.json index 6165990d8b1e..b47ab7a26343 100644 --- a/code/frameworks/sveltekit/package.json +++ b/code/frameworks/sveltekit/package.json @@ -41,6 +41,12 @@ "require": "./dist/vite-plugin.js", "import": "./dist/vite-plugin.mjs" }, + "./node": { + "types": "./dist/csf-factory/defineMainConfig.d.ts", + "node": "./dist/csf-factory/defineMainConfig.js", + "import": "./dist/csf-factory/defineMainConfig.mjs", + "require": "./dist/csf-factory/defineMainConfig.js" + }, "./package.json": "./package.json" }, "main": "dist/index.js", @@ -84,7 +90,8 @@ "./src/index.ts", "./src/preview.ts", "./src/preset.ts", - "./src/vite-plugin.ts" + "./src/vite-plugin.ts", + "./src/csf-factory/defineMainConfig.ts" ], "platform": "node" }, diff --git a/code/frameworks/sveltekit/src/csf-factory/defineMainConfig.ts b/code/frameworks/sveltekit/src/csf-factory/defineMainConfig.ts new file mode 100644 index 000000000000..dd999c40b17b --- /dev/null +++ b/code/frameworks/sveltekit/src/csf-factory/defineMainConfig.ts @@ -0,0 +1,7 @@ +import { defineConfig as commonDefineConfig } from 'storybook/internal/common'; + +import type { StorybookConfig } from '../types'; + +export function defineMain(config: StorybookConfig) { + return commonDefineConfig(config); +} diff --git a/code/frameworks/vue3-vite/package.json b/code/frameworks/vue3-vite/package.json index 8d9b0f427a6a..2852d303990b 100644 --- a/code/frameworks/vue3-vite/package.json +++ b/code/frameworks/vue3-vite/package.json @@ -35,6 +35,12 @@ "require": "./dist/vite-plugin.js", "import": "./dist/vite-plugin.mjs" }, + "./node": { + "types": "./dist/csf-factory/defineMainConfig.d.ts", + "node": "./dist/csf-factory/defineMainConfig.js", + "import": "./dist/csf-factory/defineMainConfig.mjs", + "require": "./dist/csf-factory/defineMainConfig.js" + }, "./package.json": "./package.json" }, "main": "dist/index.js", @@ -80,7 +86,8 @@ "entries": [ "./src/index.ts", "./src/preset.ts", - "./src/vite-plugin.ts" + "./src/vite-plugin.ts", + "./src/csf-factory/defineMainConfig.ts" ], "platform": "node" }, diff --git a/code/frameworks/vue3-vite/src/csf-factory/defineMainConfig.ts b/code/frameworks/vue3-vite/src/csf-factory/defineMainConfig.ts new file mode 100644 index 000000000000..dd999c40b17b --- /dev/null +++ b/code/frameworks/vue3-vite/src/csf-factory/defineMainConfig.ts @@ -0,0 +1,7 @@ +import { defineConfig as commonDefineConfig } from 'storybook/internal/common'; + +import type { StorybookConfig } from '../types'; + +export function defineMain(config: StorybookConfig) { + return commonDefineConfig(config); +} diff --git a/code/frameworks/vue3-webpack5/package.json b/code/frameworks/vue3-webpack5/package.json index b08859e0a714..973f16e8a820 100644 --- a/code/frameworks/vue3-webpack5/package.json +++ b/code/frameworks/vue3-webpack5/package.json @@ -30,6 +30,12 @@ "types": "./dist/preset.d.ts", "require": "./dist/preset.js" }, + "./node": { + "types": "./dist/csf-factory/defineMainConfig.d.ts", + "node": "./dist/csf-factory/defineMainConfig.js", + "import": "./dist/csf-factory/defineMainConfig.mjs", + "require": "./dist/csf-factory/defineMainConfig.js" + }, "./package.json": "./package.json" }, "main": "dist/index.js", @@ -71,7 +77,8 @@ "bundler": { "entries": [ "./src/index.ts", - "./src/preset.ts" + "./src/preset.ts", + "./src/csf-factory/defineMainConfig.ts" ], "platform": "node" }, diff --git a/code/frameworks/vue3-webpack5/src/csf-factory/defineMainConfig.ts b/code/frameworks/vue3-webpack5/src/csf-factory/defineMainConfig.ts new file mode 100644 index 000000000000..dd999c40b17b --- /dev/null +++ b/code/frameworks/vue3-webpack5/src/csf-factory/defineMainConfig.ts @@ -0,0 +1,7 @@ +import { defineConfig as commonDefineConfig } from 'storybook/internal/common'; + +import type { StorybookConfig } from '../types'; + +export function defineMain(config: StorybookConfig) { + return commonDefineConfig(config); +} diff --git a/code/frameworks/web-components-vite/package.json b/code/frameworks/web-components-vite/package.json index 92a76784a0aa..27b17e55155e 100644 --- a/code/frameworks/web-components-vite/package.json +++ b/code/frameworks/web-components-vite/package.json @@ -30,6 +30,12 @@ "types": "./dist/preset.d.ts", "require": "./dist/preset.js" }, + "./node": { + "types": "./dist/csf-factory/defineMainConfig.d.ts", + "node": "./dist/csf-factory/defineMainConfig.js", + "import": "./dist/csf-factory/defineMainConfig.mjs", + "require": "./dist/csf-factory/defineMainConfig.js" + }, "./package.json": "./package.json" }, "main": "dist/index.js", @@ -66,6 +72,7 @@ }, "bundler": { "entries": [ + "./src/csf-factory/defineMainConfig.ts", "./src/index.ts", "./src/preset.ts" ], diff --git a/code/frameworks/web-components-vite/src/csf-factory/defineMainConfig.ts b/code/frameworks/web-components-vite/src/csf-factory/defineMainConfig.ts new file mode 100644 index 000000000000..dd999c40b17b --- /dev/null +++ b/code/frameworks/web-components-vite/src/csf-factory/defineMainConfig.ts @@ -0,0 +1,7 @@ +import { defineConfig as commonDefineConfig } from 'storybook/internal/common'; + +import type { StorybookConfig } from '../types'; + +export function defineMain(config: StorybookConfig) { + return commonDefineConfig(config); +} diff --git a/code/frameworks/web-components-webpack5/package.json b/code/frameworks/web-components-webpack5/package.json index aa4281ef433e..2e9b89f3223c 100644 --- a/code/frameworks/web-components-webpack5/package.json +++ b/code/frameworks/web-components-webpack5/package.json @@ -33,6 +33,12 @@ "types": "./dist/preset.d.ts", "require": "./dist/preset.js" }, + "./node": { + "types": "./dist/csf-factory/defineMainConfig.d.ts", + "node": "./dist/csf-factory/defineMainConfig.js", + "import": "./dist/csf-factory/defineMainConfig.mjs", + "require": "./dist/csf-factory/defineMainConfig.js" + }, "./package.json": "./package.json" }, "main": "dist/index.js", @@ -71,7 +77,8 @@ "bundler": { "entries": [ "./src/index.ts", - "./src/preset.ts" + "./src/preset.ts", + "./src/csf-factory/defineMainConfig.ts" ], "platform": "node" }, diff --git a/code/frameworks/web-components-webpack5/src/csf-factory/defineMainConfig.ts b/code/frameworks/web-components-webpack5/src/csf-factory/defineMainConfig.ts new file mode 100644 index 000000000000..dd999c40b17b --- /dev/null +++ b/code/frameworks/web-components-webpack5/src/csf-factory/defineMainConfig.ts @@ -0,0 +1,7 @@ +import { defineConfig as commonDefineConfig } from 'storybook/internal/common'; + +import type { StorybookConfig } from '../types'; + +export function defineMain(config: StorybookConfig) { + return commonDefineConfig(config); +}