Skip to content

Commit 4d079f5

Browse files
authored
Storybook: Migrate from version 7 to 10 (#31994)
1 parent 77d4aa9 commit 4d079f5

24 files changed

+265
-487
lines changed
Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
import { createRequire } from "node:module";
12
import type { StorybookConfig } from "@storybook/react-webpack5";
23
import path from 'path';
34

5+
const require = createRequire(import.meta.url);
6+
47
const getAbsolutePath = (packageName: string): any =>
58
path.dirname(require.resolve(path.join(packageName, 'package.json')));
69

@@ -9,22 +12,26 @@ const config: StorybookConfig = {
912
"../stories/**/*.mdx",
1013
"../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)",
1114
],
15+
1216
addons: [
1317
getAbsolutePath("@storybook/addon-links"),
14-
getAbsolutePath("@storybook/addon-essentials"),
15-
getAbsolutePath("@storybook/addon-interactions"),
18+
getAbsolutePath("@storybook/addon-webpack5-compiler-swc"),
19+
getAbsolutePath("@storybook/addon-docs")
1620
],
21+
1722
framework: {
1823
name: getAbsolutePath("@storybook/react-webpack5"),
1924
options: {
20-
builder: {
21-
useSWC: true,
22-
},
25+
builder: {},
2326
},
2427
},
25-
docs: {
26-
autodocs: "tag",
27-
},
28+
29+
docs: {},
30+
2831
staticDirs: ['../stories/assets', '../node_modules/devextreme/dist'],
32+
33+
typescript: {
34+
reactDocgen: "react-docgen-typescript"
35+
}
2936
};
3037
export default config;

apps/react-storybook/.storybook/preview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Preview } from '@storybook/react';
1+
import type { Preview } from '@storybook/react-webpack5';
22

33
import { ThemeDecorator, themeToolbarItems, compact } from './themes/themes';
44

apps/react-storybook/.storybook/themes/themes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { Decorator } from '@storybook/react';
2+
import { Decorator } from '@storybook/react-webpack5';
33
import './styles.css';
44

55
export const themeToolbarItems = [

apps/react-storybook/package.json

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,17 @@
1919
"openai": "4.73.1"
2020
},
2121
"devDependencies": {
22-
"@storybook/addon-essentials": "8.6.14",
23-
"@storybook/addon-interactions": "8.6.14",
24-
"@storybook/addon-links": "10.1.4",
25-
"@storybook/blocks": "8.6.14",
26-
"@storybook/react": "10.1.4",
27-
"@storybook/react-webpack5": "10.1.4",
28-
"@storybook/test": "8.6.14",
22+
"@storybook/addon-docs": "10.1.9",
23+
"@storybook/addon-links": "10.1.9",
24+
"@storybook/addon-webpack5-compiler-swc": "^4.0.2",
25+
"@storybook/react-webpack5": "10.1.9",
2926
"@types/react": "18.0.0",
3027
"@types/react-dom": "18.0.0",
3128
"http-server": "14.1.1",
3229
"prop-types": "15.8.1",
3330
"react": "18.0.0",
3431
"react-dom": "18.0.0",
35-
"storybook": "10.1.4",
36-
"typescript": "4.9.5"
32+
"storybook": "10.1.9",
33+
"typescript": "^5.9.3"
3734
}
3835
}

apps/react-storybook/stories/card_view/CardView.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import type { Meta, StoryObj } from "@storybook/react";
1+
import type { Meta, StoryObj } from "@storybook/react-webpack5";
22

33
import dxCardView from "devextreme/ui/card_view";
44
import { wrapDxWithReact } from "../utils";
55
import { store } from "./data";
66
import { generatedData } from "./generatedData";
77
import { renderFooter } from "./templates";
8-
import { fn } from '@storybook/test';
8+
import { fn } from 'storybook/test';
99

1010
const CardView = wrapDxWithReact(dxCardView);
1111

apps/react-storybook/stories/card_view/parts/Card.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {Meta, StoryObj} from "@storybook/react";
1+
import type { Meta, StoryObj } from "@storybook/react-webpack5";
22

33
import dxCardView from "devextreme/ui/card_view";
44
import { wrapDxWithReact } from "../../utils";

apps/react-storybook/stories/card_view/parts/Toolbar.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {Meta, StoryObj} from "@storybook/react";
1+
import type { Meta, StoryObj } from "@storybook/react-webpack5";
22

33
import dxCardView from "devextreme/ui/card_view";
44
import { wrapDxWithReact } from "../../utils";

apps/react-storybook/stories/chat/Chat.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useState, useCallback, useEffect, useMemo } from 'react';
22
import { Chat, ChatTypes } from 'devextreme-react/chat'
33
import { Button, Toast } from 'devextreme-react';
4-
import type { Meta, StoryObj } from '@storybook/react';
4+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
55
import DataSource from 'devextreme/data/data_source';
66
import CustomStore from 'devextreme/data/custom_store';
77
import {

apps/react-storybook/stories/examples/common/CustomConfigurationComponents.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Meta, StoryObj } from '@storybook/react';
1+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
22
import React from "react";
33

44
import DataGrid, {

apps/react-storybook/stories/examples/datagrid/DataGrid.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Meta, StoryObj } from '@storybook/react';
1+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
22
import React, { useCallback, useState } from "react";
33
import { countries, generateData } from './data';
44

0 commit comments

Comments
 (0)