Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade Storybook to v8 #787

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ name: basic tests
on:
push:
branches:
- "user/**"
- "feature/**"
- "improvement/**"
- "bugfix/**"
- "w/**"
- "q/**"
- "hotfix/**"
- "dependabot/**"
- 'user/**'
- 'feature/**'
- 'improvement/**'
- 'bugfix/**'
- 'w/**'
- 'q/**'
- 'hotfix/**'
- 'dependabot/**'
pull_request:
types:
- opened
Expand All @@ -22,11 +22,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: '16'
node-version: 20
- run: npm ci
- run: npm run test
- run: npm run lint
19 changes: 18 additions & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,23 @@ import type { StorybookConfig } from '@storybook/react-webpack5';
const config: StorybookConfig = {
stories: ['../stories/**/*.@(mdx|stories.@(ts|tsx))'],
staticDirs: ['./public'],

addons: [
'@storybook/addon-essentials',
'@storybook/addon-storysource',
'@storybook/addon-mdx-gfm',
'@storybook/addon-webpack5-compiler-swc',
'@chromatic-com/storybook',
],
swc: (config, options) => ({
jsc: {
transform: {
react: {
runtime: 'automatic',
},
},
},
}),

webpackFinal: async (config, { configType }) => {
// Resolve error when webpack-ing storybook:
Expand All @@ -20,19 +32,24 @@ const config: StorybookConfig = {

return config;
},

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

docs: {
autodocs: true,
defaultName: 'Stories',
},

managerHead: (head) => `
${head}
<link rel="icon" href="/favicon.ico" />
`,

typescript: {
reactDocgen: 'react-docgen-typescript',
},
};

export default config;
3 changes: 2 additions & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { QueryClient, QueryClientProvider } from 'react-query';
import { CoreUiThemeProvider } from '../src/lib/next';
import { brand, coreUIAvailableThemes } from '../src/lib/style/theme';
import { Wrapper } from '../stories/common';
import { ScrollbarWrapper, ToastProvider } from '../src/lib';
import { ToastProvider } from '../src/lib';

export const globalTypes = {
theme: {
Expand Down Expand Up @@ -101,3 +101,4 @@ export const parameters = {
},
},
};
export const tags = ['autodocs'];
Loading
Loading