Skip to content

Commit

Permalink
Revert "Maintenance: Revert "WebpackBuilder: Remove need for react
Browse files Browse the repository at this point in the history
…as peerDependency""
  • Loading branch information
ndelangen authored Aug 21, 2023
1 parent d7291c7 commit ff7477e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 34 deletions.
14 changes: 1 addition & 13 deletions code/builders/builder-webpack5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,15 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@babel/core": "^7.22.9",
"@storybook/addons": "workspace:*",
"@babel/core": "^7.22.0",
"@storybook/channels": "workspace:*",
"@storybook/client-api": "workspace:*",
"@storybook/client-logger": "workspace:*",
"@storybook/components": "workspace:*",
"@storybook/core-common": "workspace:*",
"@storybook/core-events": "workspace:*",
"@storybook/core-webpack": "workspace:*",
"@storybook/global": "^5.0.0",
"@storybook/manager-api": "workspace:*",
"@storybook/node-logger": "workspace:*",
"@storybook/preview": "workspace:*",
"@storybook/preview-api": "workspace:*",
"@storybook/router": "workspace:*",
"@storybook/store": "workspace:*",
"@storybook/theming": "workspace:*",
"@swc/core": "^1.3.49",
"@types/node": "^16.0.0",
"@types/semver": "^7.3.4",
Expand Down Expand Up @@ -110,10 +102,6 @@
"slash": "^5.0.0",
"typescript": "~4.9.3"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,29 @@ const storybookPaths: Record<string, string> = {
`@storybook/components`
)}/dist/experimental`,
...[
// these packages are not pre-bundled because of react dependencies
// these packages are not pre-bundled because of react dependencies.
// these are not dependencies of the builder anymore, thus resolving them can fail.
// we should remove the aliases in 8.0, I'm not sure why they are here in the first place.
'components',
'global',
'manager-api',
'router',
'theming',
].reduce(
(acc, sbPackage) => ({
...acc,
[`@storybook/${sbPackage}`]: getAbsolutePath(`@storybook/${sbPackage}`),
}),
{}
),
].reduce((acc, sbPackage) => {
let packagePath;
try {
packagePath = getAbsolutePath(`@storybook/${sbPackage}`);
} catch (e) {
// ignore
}
if (packagePath) {
return {
...acc,
[`@storybook/${sbPackage}`]: getAbsolutePath(`@storybook/${sbPackage}`),
};
}
return acc;
}, {}),
// deprecated, remove in 8.0
[`@storybook/api`]: getAbsolutePath(`@storybook/manager-api`),
};
Expand Down
15 changes: 2 additions & 13 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ __metadata:
languageName: node
linkType: hard

"@babel/core@npm:^7.11.6, @babel/core@npm:^7.12.0, @babel/core@npm:^7.12.3, @babel/core@npm:^7.13.16, @babel/core@npm:^7.19.6, @babel/core@npm:^7.20.12, @babel/core@npm:^7.22.1, @babel/core@npm:^7.22.9, @babel/core@npm:^7.3.4, @babel/core@npm:^7.7.5":
"@babel/core@npm:^7.11.6, @babel/core@npm:^7.12.0, @babel/core@npm:^7.12.3, @babel/core@npm:^7.13.16, @babel/core@npm:^7.19.6, @babel/core@npm:^7.20.12, @babel/core@npm:^7.22.0, @babel/core@npm:^7.22.1, @babel/core@npm:^7.22.9, @babel/core@npm:^7.3.4, @babel/core@npm:^7.7.5":
version: 7.22.9
resolution: "@babel/core@npm:7.22.9"
dependencies:
Expand Down Expand Up @@ -6466,23 +6466,15 @@ __metadata:
version: 0.0.0-use.local
resolution: "@storybook/builder-webpack5@workspace:builders/builder-webpack5"
dependencies:
"@babel/core": ^7.22.9
"@storybook/addons": "workspace:*"
"@babel/core": ^7.22.0
"@storybook/channels": "workspace:*"
"@storybook/client-api": "workspace:*"
"@storybook/client-logger": "workspace:*"
"@storybook/components": "workspace:*"
"@storybook/core-common": "workspace:*"
"@storybook/core-events": "workspace:*"
"@storybook/core-webpack": "workspace:*"
"@storybook/global": ^5.0.0
"@storybook/manager-api": "workspace:*"
"@storybook/node-logger": "workspace:*"
"@storybook/preview": "workspace:*"
"@storybook/preview-api": "workspace:*"
"@storybook/router": "workspace:*"
"@storybook/store": "workspace:*"
"@storybook/theming": "workspace:*"
"@swc/core": ^1.3.49
"@types/node": ^16.0.0
"@types/pretty-hrtime": ^1.0.0
Expand Down Expand Up @@ -6517,9 +6509,6 @@ __metadata:
webpack-dev-middleware: ^6.1.1
webpack-hot-middleware: ^2.25.1
webpack-virtual-modules: ^0.5.0
peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
peerDependenciesMeta:
typescript:
optional: true
Expand Down

0 comments on commit ff7477e

Please sign in to comment.