|
| 1 | +import type { StorybookConfig } from "@storybook/react-vite"; |
| 2 | +import { mergeConfig } from 'vite'; |
| 3 | +import path from 'path'; |
| 4 | + |
| 5 | +const config: StorybookConfig = { |
| 6 | + stories: ["../packages/**/src/**/*.mdx", "../packages/**/src/**/*.stories.@(js|jsx|mjs|ts|tsx)"], |
| 7 | + addons: [ |
| 8 | + "@storybook/addon-links", |
| 9 | + "@storybook/addon-essentials", |
| 10 | + "@storybook/addon-interactions", |
| 11 | + ], |
| 12 | + framework: { |
| 13 | + name: "@storybook/react-vite", |
| 14 | + options: {}, |
| 15 | + }, |
| 16 | + docs: { |
| 17 | + autodocs: "tag", |
| 18 | + }, |
| 19 | + async viteFinal(config) { |
| 20 | + return mergeConfig(config, { |
| 21 | + resolve: { |
| 22 | + alias: { |
| 23 | + // Alias components package to source to avoid circular dependency during build |
| 24 | + '@object-ui/core': path.resolve(__dirname, '../packages/core/src/index.ts'), |
| 25 | + '@object-ui/react': path.resolve(__dirname, '../packages/react/src/index.ts'), |
| 26 | + '@object-ui/components': path.resolve(__dirname, '../packages/components/src/index.ts'), |
| 27 | + '@object-ui/fields': path.resolve(__dirname, '../packages/fields/src/index.tsx'), |
| 28 | + '@object-ui/layout': path.resolve(__dirname, '../packages/layout/src/index.ts'), |
| 29 | + // Alias plugin packages for Storybook to resolve them from workspace |
| 30 | + '@object-ui/plugin-aggrid': path.resolve(__dirname, '../packages/plugin-aggrid/src/index.tsx'), |
| 31 | + '@object-ui/plugin-calendar': path.resolve(__dirname, '../packages/plugin-calendar/src/index.tsx'), |
| 32 | + '@object-ui/plugin-charts': path.resolve(__dirname, '../packages/plugin-charts/src/index.tsx'), |
| 33 | + '@object-ui/plugin-chatbot': path.resolve(__dirname, '../packages/plugin-chatbot/src/index.tsx'), |
| 34 | + '@object-ui/plugin-dashboard': path.resolve(__dirname, '../packages/plugin-dashboard/src/index.tsx'), |
| 35 | + '@object-ui/plugin-editor': path.resolve(__dirname, '../packages/plugin-editor/src/index.tsx'), |
| 36 | + '@object-ui/plugin-form': path.resolve(__dirname, '../packages/plugin-form/src/index.tsx'), |
| 37 | + '@object-ui/plugin-gantt': path.resolve(__dirname, '../packages/plugin-gantt/src/index.tsx'), |
| 38 | + '@object-ui/plugin-grid': path.resolve(__dirname, '../packages/plugin-grid/src/index.tsx'), |
| 39 | + '@object-ui/plugin-kanban': path.resolve(__dirname, '../packages/plugin-kanban/src/index.tsx'), |
| 40 | + '@object-ui/plugin-map': path.resolve(__dirname, '../packages/plugin-map/src/index.tsx'), |
| 41 | + '@object-ui/plugin-markdown': path.resolve(__dirname, '../packages/plugin-markdown/src/index.tsx'), |
| 42 | + '@object-ui/plugin-timeline': path.resolve(__dirname, '../packages/plugin-timeline/src/index.tsx'), |
| 43 | + '@object-ui/plugin-view': path.resolve(__dirname, '../packages/plugin-view/src/index.tsx'), |
| 44 | + }, |
| 45 | + }, |
| 46 | + }); |
| 47 | + }, |
| 48 | +}; |
| 49 | +export default config; |
0 commit comments