Skip to content

Commit a59c76c

Browse files
authored
Storybook: Migrate from version 7 to 10 (#32002)
1 parent 31fb049 commit a59c76c

File tree

21 files changed

+509
-679
lines changed

21 files changed

+509
-679
lines changed
Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
import { createRequire } from "node:module";
12
import type { StorybookConfig } from "@storybook/react-webpack5";
23
import path from 'path';
4+
5+
const require = createRequire(import.meta.url);
6+
37
const getAbsolutePath = (packageName: string): any =>
48
path.dirname(require.resolve(path.join(packageName, 'package.json')));
59

@@ -8,22 +12,26 @@ const config: StorybookConfig = {
812
"../stories/**/*.mdx",
913
"../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)",
1014
],
15+
1116
addons: [
1217
getAbsolutePath("@storybook/addon-links"),
13-
getAbsolutePath("@storybook/addon-essentials"),
14-
getAbsolutePath("@storybook/addon-interactions"),
18+
getAbsolutePath("@storybook/addon-webpack5-compiler-swc"),
19+
getAbsolutePath("@storybook/addon-docs")
1520
],
21+
1622
framework: {
1723
name: getAbsolutePath("@storybook/react-webpack5"),
1824
options: {
19-
builder: {
20-
useSWC: true,
21-
},
25+
builder: {},
2226
},
2327
},
24-
docs: {
25-
autodocs: "tag",
26-
},
28+
29+
docs: {},
30+
2731
staticDirs: ['../stories/assets', '../node_modules/devextreme/dist'],
32+
33+
typescript: {
34+
reactDocgen: "react-docgen-typescript"
35+
}
2836
};
2937
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,17 +19,14 @@
1919
"devDependencies": {
2020
"@types/react": "18.0.0",
2121
"@types/react-dom": "18.0.0",
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
"prop-types": "15.8.1",
3027
"react": "18.0.0",
3128
"react-dom": "18.0.0",
32-
"storybook": "10.1.4",
33-
"typescript": "4.9.5"
29+
"storybook": "10.1.9",
30+
"typescript": "^5.9.3"
3431
}
3532
}

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)