Files
crewli/apps/app/.storybook/main.ts
bert.hausmans ebb8e3bcf6 chore: add Storybook 10 setup with PrimeVue + Tailwind integration
Installs Storybook 10.4 in apps/app/ as a component-development and
autodoc tool. Configures viteFinal with all seven SPA aliases so
stories resolve imports identically to the dev/build pipeline.
preview.ts reuses @/plugins/primevue's installPrimeVue() so Storybook
stays in lock-step with main.ts whenever the PrimeVue config changes.

Only the addons we need are wired: addon-docs (autodocs) and
addon-a11y (axe-core checks). addon-interactions is intentionally
omitted — interaction testing stays in Playwright CT per the testing
architecture.

Seed stories: PrimeVue Button (Primary/Secondary/Danger), Tailwind
utility box, and FormField (Default/WithError/Disabled) wrapped in
@primevue/forms Form + Zod resolver.

Adds make storybook target alongside make app / make docs.
2026-05-14 11:50:21 +02:00

32 lines
1.1 KiB
TypeScript

import { fileURLToPath } from 'node:url'
import type { StorybookConfig } from '@storybook/vue3-vite'
import { mergeConfig } from 'vite'
const config: StorybookConfig = {
framework: '@storybook/vue3-vite',
stories: ['../src/**/*.stories.ts'],
addons: [
'@storybook/addon-docs',
'@storybook/addon-a11y',
],
viteFinal: async (storybookViteConfig) => {
return mergeConfig(storybookViteConfig, {
resolve: {
alias: {
'@': fileURLToPath(new URL('../src', import.meta.url)),
'@themeConfig': fileURLToPath(new URL('../themeConfig.ts', import.meta.url)),
'@core': fileURLToPath(new URL('../src/@core', import.meta.url)),
'@layouts': fileURLToPath(new URL('../src/@layouts', import.meta.url)),
'@images': fileURLToPath(new URL('../src/assets/images/', import.meta.url)),
'@styles': fileURLToPath(new URL('../src/assets/styles/', import.meta.url)),
'@configured-variables': fileURLToPath(
new URL('../src/assets/styles/variables/_template.scss', import.meta.url),
),
},
},
})
},
}
export default config