Skip to content

Commit

Permalink
chore(storybook-generator): adjust addDep version in template (#5073)
Browse files Browse the repository at this point in the history
  • Loading branch information
10Derozan authored Dec 13, 2023
1 parent e05e496 commit 2c087e8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changeset/neat-socks-jog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@modern-js/storybook-generator': patch
---

chore(storybook-generator): adjust addDep version in template
chore(storybook-generator): 调整模板里新增依赖的版本
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,17 @@ const handleTemplateFile = async (
? {}
: {
'react-dom': isReact18(context.materials.default.basePath)
? '^18'
: '^17',
? '^18.2.0'
: '^17.0.2',
};

const isExitReact = pkg.devDependencies?.react || pkg.dependencies?.react;
const addReactDependence = isExitReact
? {}
: {
react: isReact18(context.materials.default.basePath) ? '^18' : '^17',
react: isReact18(context.materials.default.basePath)
? '^18.2.0'
: '^17.0.2',
};

// modify stories/tsconfig.json
Expand Down

0 comments on commit 2c087e8

Please sign in to comment.