Skip to content

Commit

Permalink
Update chromatic and storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
ethriel3695 committed Jun 5, 2024
1 parent 306d19b commit 75620f1
Show file tree
Hide file tree
Showing 5 changed files with 623 additions and 1,759 deletions.
23 changes: 4 additions & 19 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,22 @@
import type { StorybookConfig } from '@storybook/react-vite';
const { mergeConfig } = require('vite');
const turbosnap = require('vite-plugin-turbosnap');

const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],

addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
],

framework: {
name: '@storybook/react-vite',
options: {},
},

async viteFinal(config, { configType }) {
// return the customized config
if (configType === 'PRODUCTION') {
config?.plugins?.push(turbosnap({ rootDir: config.root }));
}
return mergeConfig(config, {
// customize the Vite config here
resolve: {
alias: { foo: 'bar' },
},
});
},
docs: {},

docs: {
autodocs: true,
},
typescript: {
reactDocgen: 'react-docgen-typescript'
}
};

export default config;
3 changes: 2 additions & 1 deletion .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React from 'react';

const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},

tags: ['autodocs']
};

export default parameters;
16 changes: 7 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"build": "tsc && vite build",
"preview": "vite preview",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"build-storybook": "storybook build --stats-json",
"chromatic": "chromatic --project-token=b7e18a53b1f3 --only-changed --debug --trace-changed 'expanded' --exit-zero-on-changes --exit-once-uploaded --auto-accept-changes 'main'"
},
"dependencies": {
Expand All @@ -18,18 +18,16 @@
},
"devDependencies": {
"@babel/core": "^7.18.13",
"@storybook/addon-actions": "^7.6.12",
"@storybook/addon-essentials": "^7.6.12",
"@storybook/addon-interactions": "^7.6.12",
"@storybook/addon-links": "^7.6.12",
"@storybook/react": "^7.6.12",
"@storybook/react-vite": "^7.6.12",
"@storybook/test": "^7.6.12",
"@storybook/addon-actions": "^8.1.5",
"@storybook/addon-essentials": "^8.1.5",
"@storybook/react": "^8.1.5",
"@storybook/react-vite": "^8.1.5",
"@storybook/test": "^8.1.5",
"@types/react": "^18.0.17",
"@types/react-dom": "^18.0.6",
"@vitejs/plugin-react": "^4.2.1",
"babel-loader": "^8.2.5",
"storybook": "^7.6.12",
"storybook": "^8.1.5",
"typescript": "^5.3.3",
"vite": "^5.0.12",
"vite-plugin-turbosnap": "^1.0.3",
Expand Down
Loading

0 comments on commit 75620f1

Please sign in to comment.