Skip to content

Commit 48d113a

Browse files
feat(storybook): #ENABLING-684 update storybook to v9 (#440)
chore: fix rushstack crash version
1 parent a109e1b commit 48d113a

185 files changed

Lines changed: 813 additions & 495 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/docs/.storybook/main.ts

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
import type { StorybookConfig } from '@storybook/react-vite';
2-
import { dirname, join, resolve } from 'path';
2+
import { dirname, resolve } from 'path';
3+
import { fileURLToPath } from 'url';
34

45
const config: StorybookConfig = {
56
stories: [
6-
'../../../packages/**/src/**/*.stories.@(js|jsx|ts|tsx)',
7-
'../../../packages/**/src/**/*.mdx',
7+
'../../../packages/react/src/**/*.stories.@(js|jsx|ts|tsx)',
8+
'../../../packages/react/src/**/*.mdx',
89
'../src/stories/**/*.stories.@(js|jsx|ts|tsx)',
910
'../src/stories/**/*.mdx',
1011
],
1112
staticDirs: ['../public'],
1213
addons: [
13-
getAbsolutePath('@storybook/addon-a11y'),
14-
getAbsolutePath('@storybook/addon-links'),
15-
getAbsolutePath('@storybook/addon-essentials'),
16-
getAbsolutePath('@storybook/addon-interactions'),
17-
getAbsolutePath('@chromatic-com/storybook'),
14+
'@storybook/addon-a11y',
15+
'@storybook/addon-links',
16+
'@storybook/addon-docs',
17+
'@chromatic-com/storybook',
1818
],
1919
typescript: {
2020
reactDocgen: 'react-docgen',
2121
},
2222
framework: {
23-
name: getAbsolutePath('@storybook/react-vite'),
23+
name: '@storybook/react-vite',
2424
options: { strictMode: false },
2525
},
2626
docs: {},
@@ -29,20 +29,33 @@ const config: StorybookConfig = {
2929
const { mergeConfig } = await import('vite');
3030

3131
return mergeConfig(config, {
32+
esbuild: {
33+
jsx: 'automatic',
34+
},
3235
// Add dependencies to pre-optimization
3336
resolve: {
3437
alias: {
3538
'@images': resolve(
36-
__dirname,
37-
'node_modules/@edifice.io/bootstrap/dist/images',
39+
dirname(fileURLToPath(import.meta.url)),
40+
'../node_modules/@edifice.io/bootstrap/dist/images',
3841
),
3942
},
4043
},
44+
optimizeDeps: {
45+
include: [
46+
'react',
47+
'react-dom',
48+
'react/jsx-runtime',
49+
'react-i18next',
50+
'i18next',
51+
'@tanstack/react-query',
52+
'msw-storybook-addon',
53+
],
54+
esbuildOptions: {
55+
sourcemap: false,
56+
},
57+
},
4158
});
4259
},
4360
};
4461
export default config;
45-
46-
function getAbsolutePath(value: string): any {
47-
return dirname(require.resolve(join(value, 'package.json')));
48-
}

apps/docs/.storybook/manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// .storybook/manager
22

3-
import { addons } from "@storybook/manager-api";
3+
import { addons } from "storybook/manager-api";
44
import theme from "./theme";
55

66
addons.setConfig({

apps/docs/.storybook/preview.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Preview } from '@storybook/react';
1+
import { Preview } from '@storybook/react-vite';
22
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
33
import { initialize, mswLoader } from 'msw-storybook-addon';
44
import { I18nextProvider } from 'react-i18next';
@@ -8,7 +8,6 @@ import {
88
EdificeThemeProvider,
99
} from '../../../packages/react/src/providers';
1010

11-
import React from 'react';
1211
import i18n from '../i18n';
1312

1413
import {

apps/docs/.storybook/theme.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// .storybook/theme
22

3-
import { create } from "@storybook/theming/create";
3+
import { create } from "storybook/theming/create";
44

55
export default create({
66
base: "light",

apps/docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@
3939
"@edifice.io/config": "workspace:*",
4040
"vite": "catalog:"
4141
}
42-
}
42+
}

apps/docs/src/stories/Radius.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, Story } from "@storybook/blocks";
1+
import { Meta, Story } from "@storybook/addon-docs/blocks";
22
import { Card } from "../components/Card";
33

44
<Meta title="Design System/Tokens/Radius" />

apps/docs/src/stories/Shadows.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Meta } from '@storybook/blocks';
2-
import { Card } from '../components/Card';
1+
import { Meta } from "@storybook/addon-docs/blocks";
2+
import { Card } from "../components/Card";
33

44
<Meta title="Design System/Tokens/Shadows" />
55

apps/docs/src/stories/Spacings.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Meta, Story } from '@storybook/blocks';
2-
import { Card } from '../components/Card';
1+
import { Meta, Story } from "@storybook/addon-docs/blocks";
2+
import { Card } from "../components/Card";
33

44
<Meta title="Design System/Tokens/Spacings" />
55

apps/docs/src/stories/Typography.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, Story } from '@storybook/blocks';
1+
import { Meta, Story } from '@storybook/addon-docs/blocks';
22
import { Card } from '../components/Card';
33

44
<Meta title="Design System/Tokens/Typography" />

apps/docs/src/stories/colors/Common.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta } from "@storybook/blocks";
1+
import { Meta } from "@storybook/addon-docs/blocks";
22
import { Colors } from "../../components/Colors";
33

44
<Meta title="Design System/Colors/Common" />

0 commit comments

Comments
 (0)