Skip to content

Commit ee92876

Browse files
committed
Fix storybook upgrade error
1 parent 1b4ad94 commit ee92876

File tree

8 files changed

+677
-557
lines changed

8 files changed

+677
-557
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@ codecov.*
1414
codecov.*.*
1515
lcov.info
1616
tarpaulin-report.html
17-
tarpaulin-report.json
17+
tarpaulin-report.json
18+
*storybook.log
19+
storybook-static

eslint.config.mjs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
2-
import storybook from "eslint-plugin-storybook";
3-
41
import { configs } from 'eslint-plugin-devup'
52

63
export default configs.recommended
Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,10 @@
11
import { DevupUI } from '@devup-ui/vite-plugin'
2-
import { type StorybookConfig } from '@storybook/react-vite'
3-
import { dirname, join } from 'path'
2+
import type { StorybookConfig } from '@storybook/react-vite'
43
import { mergeConfig } from 'vite'
54

6-
function getAbsolutePath(value: string) {
7-
return dirname(require.resolve(join(value, 'package.json')))
8-
}
9-
105
const config: StorybookConfig = {
116
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
12-
13-
addons: [
14-
getAbsolutePath('@storybook/addon-onboarding'),
15-
getAbsolutePath('@storybook/addon-links'),
16-
getAbsolutePath('@storybook/addon-essentials'),
17-
getAbsolutePath('@chromatic-com/storybook'),
18-
'@chromatic-com/storybook'
19-
],
20-
7+
addons: ['@storybook/addon-docs', '@storybook/addon-onboarding'],
218
framework: {
229
name: '@storybook/react-vite',
2310
options: {},
@@ -28,9 +15,5 @@ const config: StorybookConfig = {
2815
plugins: [DevupUI()],
2916
})
3017
},
31-
32-
typescript: {
33-
reactDocgen: 'react-docgen-typescript'
34-
}
3518
}
3619
export default config

packages/components/.storybook/preview.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ const preview: import('@storybook/react-vite').Preview = {
1111
},
1212
},
1313
},
14-
15-
tags: ['autodocs']
1614
}
1715

1816
export default preview

packages/components/package.json

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,28 +44,27 @@
4444
],
4545
"types": "./dist/index.d.ts",
4646
"dependencies": {
47-
"react": "^19.1",
48-
"csstype": "^3.1",
49-
"@devup-ui/react": "workspace:*"
47+
"@devup-ui/react": "workspace:*",
48+
"csstype": "^3.1.3",
49+
"react": "^19.1.0"
5050
},
5151
"devDependencies": {
52-
"@chromatic-com/storybook": "^4.0.1",
53-
"rollup-plugin-preserve-directives": "^0.4.0",
54-
"vite": "^7.0.0",
55-
"vite-plugin-dts": "^4.5.4",
56-
"vitest": "^3.2.4",
57-
"typescript": "^5.8.3",
58-
"@types/react": "^19",
59-
"@storybook/addon-links": "^9.0.15",
52+
"@devup-ui/vite-plugin": "workspace:*",
53+
"@storybook/addon-docs": "9.0.15",
6054
"@storybook/addon-onboarding": "^9.0.15",
6155
"@storybook/react-vite": "^9.0.15",
56+
"@types/react": "^19.1.8",
57+
"eslint-plugin-storybook": "9.0.15",
58+
"rollup-plugin-preserve-directives": "^0.4.0",
6259
"storybook": "^9.0.15",
63-
"@devup-ui/vite-plugin": "workspace:*",
64-
"eslint-plugin-storybook": "9.0.15"
60+
"typescript": "^5.8.3",
61+
"vite": "^6.3.5",
62+
"vite-plugin-dts": "^4.5.4",
63+
"vitest": "^3.2.4"
6564
},
6665
"peerDependencies": {
67-
"react": "*",
66+
"@devup-ui/react": "workspace:*",
6867
"csstype": "*",
69-
"@devup-ui/react": "workspace:*"
68+
"react": "*"
7069
}
7170
}

packages/components/src/components/Button/Button.stories.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1+
import { Meta } from '@storybook/react-vite'
2+
13
import { Button } from './index'
24

35
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
4-
export default {
6+
const meta: Meta<typeof Button> = {
57
title: 'Devfive/Button',
68
component: Button,
7-
tags: ['autodocs'],
9+
decorators: [
10+
(Story) => (
11+
<div style={{ padding: '10px' }}>
12+
<Story />
13+
</div>
14+
),
15+
],
816
}
917

1018
export const Default = {
@@ -20,3 +28,5 @@ export const Default = {
2028
size: 'm',
2129
},
2230
}
31+
32+
export default meta

packages/components/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@
2222
"noEmit": true,
2323
"baseUrl": ".",
2424
"jsx": "react-jsx"
25-
}
25+
},
26+
"include": ["src/**/*", ".storybook/**/*"]
2627
}

0 commit comments

Comments
 (0)