Skip to content

Commit

Permalink
fix(storybook): fix typescript v5 capability issue (#4002)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan committed Jun 19, 2023
1 parent 2858c11 commit 580fcf7
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .changeset/purple-dogs-know.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@modern-js/plugin-storybook': patch
---

fix(storybook): fix typescript v5 capability issue

fix(storybook): 修复与 typescript v5 的兼容问题

5 changes: 3 additions & 2 deletions packages/cli/plugin-storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,13 @@
"@storybook/core": "6.5.12",
"@storybook/manager-webpack5": "6.5.12",
"@storybook/react": "6.5.12",
"@swc/helpers": "0.5.1",
"esbuild": "0.15.7",
"findup-sync": "^4.0.0",
"fs-extra": "^10.0.0",
"process.argv": "^0.6.0",
"tsconfig-paths-webpack-plugin": "4.0.0",
"@swc/helpers": "0.5.1"
"react-docgen-typescript-plugin": "1.0.5",
"tsconfig-paths-webpack-plugin": "4.0.0"
},
"devDependencies": {
"@babel/core": "^7.21.8",
Expand Down
6 changes: 6 additions & 0 deletions packages/cli/plugin-storybook/template/main.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ module.exports = {
},
...(userMainConfig.addons || []),
],
// Fix typescript v5 capability issue
// https://github.com/hipstersmoothie/react-docgen-typescript-plugin/issues/78
// https://github.com/storybookjs/storybook/issues/21642
typescript: {
reactDocgen: 'react-docgen-typescript-plugin'
},
webpackFinal: async (config, options) => {
// change webpack config
const { customFinalWebpack = () => config } = options;
Expand Down
22 changes: 22 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 580fcf7

Please sign in to comment.