twenty/packages/twenty-ui/.storybook/main.ts
Syed Md Mihan Chistie be20a690b3
added typechecking for all ts files (#6466)
Fixes: #6436 

Changes made: 

- Added typecheck step before twenty-ui build to check stories TS errors
- Added a tsconfig.dev.json to add stories and tests to typecheking when
in dev mode
- Added tsconfig.dev.json to storybook dev command of twenty-ui to
typecheck stories while developing
- Fixed twenty-ui stories that were broken

- Added a serve command to serve front build
- Fixed unit test from another PR

---------

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-08-20 11:05:13 +02:00

41 lines
1.1 KiB
TypeScript

import { StorybookConfig } from '@storybook/react-vite';
import * as path from 'path';
import checker from 'vite-plugin-checker';
const config: StorybookConfig = {
stories: ['../src/**/*.stories.@(js|jsx|ts|tsx|mdx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-onboarding',
'@storybook/addon-interactions',
'@storybook/addon-coverage',
'storybook-dark-mode',
'storybook-addon-cookie',
'storybook-addon-pseudo-states',
],
framework: {
name: '@storybook/react-vite',
options: {},
},
viteFinal: (config) => {
return {
...config,
plugins: [
...(config.plugins ?? []),
checker({
typescript: {
tsconfigPath: path.resolve(__dirname, '../tsconfig.dev.json'),
},
}),
],
};
},
};
export default config;
// To customize your Vite configuration you can use the viteFinal field.
// Check https://storybook.js.org/docs/react/builders/vite#configuration
// and https://nx.dev/recipes/storybook/custom-builder-configs