chore: update Storybook dependencies to version 10.0.5 and refactor Storybook configuration for absolute paths

This commit is contained in:
MyPrototypeWhat 2025-11-06 17:24:28 +08:00
parent c4fa975b89
commit 2b1269af92
3 changed files with 183 additions and 3631 deletions

View File

@ -1,14 +1,15 @@
import { fileURLToPath } from 'node:url'
import type { StorybookConfig } from '@storybook/react-vite'
import { resolve } from 'path'
import { dirname, resolve } from 'path'
const config: StorybookConfig = {
stories: ['../stories/components/**/*.stories.@(js|jsx|ts|tsx)'],
addons: ['@storybook/addon-docs', '@storybook/addon-themes'],
framework: '@storybook/react-vite',
addons: [getAbsolutePath('@storybook/addon-docs'), getAbsolutePath('@storybook/addon-themes')],
framework: getAbsolutePath('@storybook/react-vite'),
viteFinal: async (config) => {
const { mergeConfig } = await import('vite')
const tailwindPlugin = (await import('@tailwindcss/vite')).default
console.log('aliasaliasaliasaliasalias', resolve('src/index.ts'))
return mergeConfig(config, {
plugins: [tailwindPlugin()],
resolve: {
@ -21,3 +22,7 @@ const config: StorybookConfig = {
}
export default config
function getAbsolutePath(value: string): any {
return dirname(fileURLToPath(import.meta.resolve(`${value}/package.json`)))
}

View File

@ -61,9 +61,9 @@
},
"devDependencies": {
"@heroui/react": "^2.8.4",
"@storybook/addon-docs": "^9.1.6",
"@storybook/addon-themes": "^9.1.6",
"@storybook/react-vite": "^9.1.6",
"@storybook/addon-docs": "^10.0.5",
"@storybook/addon-themes": "^10.0.5",
"@storybook/react-vite": "^10.0.5",
"@types/react": "^19.0.12",
"@types/react-dom": "^19.0.4",
"@types/styled-components": "^5.1.34",
@ -71,12 +71,12 @@
"@uiw/codemirror-themes-all": "^4.25.1",
"@uiw/react-codemirror": "^4.25.1",
"antd": "^5.22.5",
"eslint-plugin-storybook": "9.1.6",
"eslint-plugin-storybook": "10.0.5",
"framer-motion": "^12.23.12",
"linguist-languages": "^9.0.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"storybook": "^9.1.6",
"storybook": "^10.0.5",
"styled-components": "^6.1.15",
"tsdown": "^0.15.5",
"tsx": "^4.20.5",

3791
yarn.lock

File diff suppressed because it is too large Load Diff