mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-24 20:42:05 +03:00
dcf92ae7f1
This PR was created by [GitStart](https://gitstart.com/) to address the requirements from this ticket: [TWNTY-7539](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-7539). --- ### Description - Move the utilities/dimensions from twenty-front to twenty-ui and update imports\ Fixes twentyhq/private-issues#79 --------- Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com> Co-authored-by: Charles Bochet <charles@twenty.com>
62 lines
1.6 KiB
TypeScript
62 lines
1.6 KiB
TypeScript
import { StorybookConfig } from '@storybook/react-vite';
|
|
|
|
const computeStoriesGlob = () => {
|
|
if (process.env.STORYBOOK_SCOPE === 'pages') {
|
|
return [
|
|
'../src/pages/**/*.stories.@(js|jsx|ts|tsx)',
|
|
'../src/__stories__/*.stories.@(js|jsx|ts|tsx)',
|
|
'../src/pages/**/*.docs.mdx',
|
|
'../src/__stories__/*.docs.mdx',
|
|
];
|
|
}
|
|
|
|
if (process.env.STORYBOOK_SCOPE === 'modules') {
|
|
return [
|
|
'../src/modules/**/!(perf)/*.stories.@(js|jsx|ts|tsx)',
|
|
'../src/modules/**/*.docs.mdx',
|
|
];
|
|
}
|
|
|
|
if (process.env.STORYBOOK_SCOPE === 'performance') {
|
|
return ['../src/modules/**/perf/*.perf.stories.@(js|jsx|ts|tsx)'];
|
|
}
|
|
|
|
if (process.env.STORYBOOK_SCOPE === 'ui-docs') {
|
|
return ['../src/modules/ui/**/*.docs.mdx'];
|
|
}
|
|
|
|
return ['../src/**/*.docs.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'];
|
|
};
|
|
|
|
const config: StorybookConfig = {
|
|
stories: computeStoriesGlob(),
|
|
staticDirs: ['../public'],
|
|
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: async (config) => {
|
|
// Merge custom configuration into the default config
|
|
const { mergeConfig } = await import('vite');
|
|
|
|
return mergeConfig(config, {
|
|
resolve: {
|
|
alias: {
|
|
'react-dom/client': 'react-dom/profiling',
|
|
},
|
|
},
|
|
});
|
|
},
|
|
};
|
|
export default config;
|