Skip to content

Commit

Permalink
Apply solution discussed in monthly meeting:
Browse files Browse the repository at this point in the history
- Set `react` and `react-dom` as peerDeps for all `lib` packages needing them
- Set `react` and `react-dom` as peerDeps + optional tag for all `addon` packages needing them
- Set `react` and `react-dom` as regular deps for all non react apps
- Remove `react` and `react-dom` from root `package.json`
- Set a fixed version of `react` in all examples

Also:
- Use "^16.8.0 || ^17.0.0" version range as some packages need React Hooks
  • Loading branch information
gaetanmaisse committed Nov 2, 2020
1 parent 0c0a4dc commit 7ad9f84
Show file tree
Hide file tree
Showing 45 changed files with 240 additions and 108 deletions.
12 changes: 10 additions & 2 deletions addons/a11y/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,16 @@
"@types/webpack-env": "^1.15.2"
},
"peerDependencies": {
"react": "^16.8.3 || ^17.0.0",
"react-dom": "^16.8.3 || ^17.0.0"
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
},
"peerDependenciesMeta": {
"react": {
"optional": true
},
"react-dom": {
"optional": true
}
},
"publishConfig": {
"access": "public"
Expand Down
12 changes: 10 additions & 2 deletions addons/actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,16 @@
"@types/webpack-env": "^1.15.2"
},
"peerDependencies": {
"react": "15 || 16 || ^17.0.0",
"react-dom": "15 || 16 || ^17.0.0"
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
},
"peerDependenciesMeta": {
"react": {
"optional": true
},
"react-dom": {
"optional": true
}
},
"publishConfig": {
"access": "public"
Expand Down
12 changes: 10 additions & 2 deletions addons/backgrounds/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,16 @@
"@types/webpack-env": "^1.15.2"
},
"peerDependencies": {
"react": "15 || 16 || ^17.0.0",
"react-dom": "15 || 16 || ^17.0.0"
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
},
"peerDependenciesMeta": {
"react": {
"optional": true
},
"react-dom": {
"optional": true
}
},
"publishConfig": {
"access": "public"
Expand Down
12 changes: 10 additions & 2 deletions addons/controls/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,16 @@
"ts-dedent": "^2.0.0"
},
"peerDependencies": {
"react": "15 || 16 || ^17.0.0",
"react-dom": "15 || 16 || ^17.0.0"
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
},
"peerDependenciesMeta": {
"react": {
"optional": true
},
"react-dom": {
"optional": true
}
},
"publishConfig": {
"access": "public"
Expand Down
12 changes: 10 additions & 2 deletions addons/cssresources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,16 @@
"enzyme-adapter-react-16": "^1.15.2"
},
"peerDependencies": {
"react": "15 || 16 || ^17.0.0",
"react-dom": "15 || 16 || ^17.0.0"
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
},
"peerDependenciesMeta": {
"react": {
"optional": true
},
"react-dom": {
"optional": true
}
},
"publishConfig": {
"access": "public"
Expand Down
12 changes: 10 additions & 2 deletions addons/design-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,16 @@
"use-image": "^1.0.3"
},
"peerDependencies": {
"react": "15 || 16 || ^17.0.0",
"react-dom": "15 || 16 || ^17.0.0"
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
},
"peerDependenciesMeta": {
"react": {
"optional": true
},
"react-dom": {
"optional": true
}
},
"publishConfig": {
"access": "public"
Expand Down
10 changes: 8 additions & 2 deletions addons/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@
"@babel/core": "^7.11.5",
"@storybook/vue": "6.1.0-beta.0",
"babel-loader": "^8.0.0",
"react": "^16.8.3 || ^17.0.0",
"react-dom": "^16.8.3 || ^17.0.0",
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0",
"sveltedoc-parser": "^3.0.4",
"vue": "^2.6.10",
"webpack": ">=4"
Expand All @@ -127,6 +127,12 @@
"@storybook/vue": {
"optional": true
},
"react": {
"optional": true
},
"react-dom": {
"optional": true
},
"sveltedoc-parser": {
"optional": true
},
Expand Down
10 changes: 8 additions & 2 deletions addons/essentials/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,20 @@
"@babel/core": "^7.9.6",
"@storybook/vue": "6.1.0-beta.0",
"babel-loader": "^8.0.0",
"react": "^16.8.3 || ^17.0.0",
"react-dom": "^16.8.3 || ^17.0.0",
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0",
"webpack": ">=4"
},
"peerDependenciesMeta": {
"@storybook/vue": {
"optional": true
},
"react": {
"optional": true
},
"react-dom": {
"optional": true
},
"webpack": {
"optional": true
}
Expand Down
12 changes: 10 additions & 2 deletions addons/events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,16 @@
"@types/webpack-env": "^1.15.2"
},
"peerDependencies": {
"react": "15 || 16 || ^17.0.0",
"react-dom": "15 || 16 || ^17.0.0"
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
},
"peerDependenciesMeta": {
"react": {
"optional": true
},
"react-dom": {
"optional": true
}
},
"publishConfig": {
"access": "public"
Expand Down
12 changes: 10 additions & 2 deletions addons/google-analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,16 @@
"regenerator-runtime": "^0.13.7"
},
"peerDependencies": {
"react": "15 || 16 || ^17.0.0",
"react-dom": "15 || 16 || ^17.0.0"
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
},
"peerDependenciesMeta": {
"react": {
"optional": true
},
"react-dom": {
"optional": true
}
},
"publishConfig": {
"access": "public"
Expand Down
12 changes: 10 additions & 2 deletions addons/graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,16 @@
"webpack": "^4.43.0"
},
"peerDependencies": {
"react": "15 || 16 || ^17.0.0",
"react-dom": "15 || 16 || ^17.0.0"
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
},
"peerDependenciesMeta": {
"react": {
"optional": true
},
"react-dom": {
"optional": true
}
},
"publishConfig": {
"access": "public"
Expand Down
12 changes: 10 additions & 2 deletions addons/jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,16 @@
"@types/webpack-env": "^1.15.2"
},
"peerDependencies": {
"react": "15 || 16 || ^17.0.0",
"react-dom": "15 || 16 || ^17.0.0"
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
},
"peerDependenciesMeta": {
"react": {
"optional": true
},
"react-dom": {
"optional": true
}
},
"publishConfig": {
"access": "public"
Expand Down
12 changes: 10 additions & 2 deletions addons/knobs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,16 @@
"enzyme": "^3.11.0"
},
"peerDependencies": {
"react": "15 || 16 || ^17.0.0",
"react-dom": "15 || 16 || ^17.0.0"
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
},
"peerDependenciesMeta": {
"react": {
"optional": true
},
"react-dom": {
"optional": true
}
},
"publishConfig": {
"access": "public"
Expand Down
12 changes: 10 additions & 2 deletions addons/links/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,16 @@
"enzyme": "^3.11.0"
},
"peerDependencies": {
"react": "15 || 16 || ^17.0.0",
"react-dom": "15 || 16 || ^17.0.0"
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
},
"peerDependenciesMeta": {
"react": {
"optional": true
},
"react-dom": {
"optional": true
}
},
"publishConfig": {
"access": "public"
Expand Down
12 changes: 10 additions & 2 deletions addons/queryparams/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,16 @@
"@types/webpack-env": "^1.15.2"
},
"peerDependencies": {
"react": "15 || 16 || ^17.0.0",
"react-dom": "15 || 16 || ^17.0.0"
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
},
"peerDependenciesMeta": {
"react": {
"optional": true
},
"react-dom": {
"optional": true
}
},
"publishConfig": {
"access": "public"
Expand Down
12 changes: 9 additions & 3 deletions addons/storyshots/storyshots-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"global": "^4.3.2",
"jest-specific-snapshot": "^4.0.0",
"pretty-format": "^26.4.0",
"react-test-renderer": "^16.8.3 || ^17.0.0",
"react-test-renderer": "^16.8.0 || ^17.0.0",
"read-pkg-up": "^7.0.0",
"regenerator-runtime": "^0.13.7",
"ts-dedent": "^2.0.0"
Expand All @@ -64,8 +64,8 @@
"@storybook/vue": "*",
"jest-preset-angular": "*",
"jest-vue-preprocessor": "*",
"react": "15 || 16 || ^17.0.0",
"react-dom": "15 || 16 || ^17.0.0",
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0",
"vue": "*"
},
"peerDependenciesMeta": {
Expand All @@ -78,6 +78,12 @@
"jest-vue-preprocessor": {
"optional": true
},
"react": {
"optional": true
},
"react-dom": {
"optional": true
},
"vue": {
"optional": true
}
Expand Down
12 changes: 10 additions & 2 deletions addons/storysource/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,16 @@
"@types/react-syntax-highlighter": "^11.0.4"
},
"peerDependencies": {
"react": "^16.8.3 || ^17.0.0",
"react-dom": "^16.8.3 || ^17.0.0"
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
},
"peerDependenciesMeta": {
"react": {
"optional": true
},
"react-dom": {
"optional": true
}
},
"publishConfig": {
"access": "public"
Expand Down
12 changes: 10 additions & 2 deletions addons/toolbars/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,16 @@
"core-js": "^3.0.1"
},
"peerDependencies": {
"react": "15 || 16 || ^17.0.0",
"react-dom": "15 || 16 || ^17.0.0"
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
},
"peerDependenciesMeta": {
"react": {
"optional": true
},
"react-dom": {
"optional": true
}
},
"publishConfig": {
"access": "public"
Expand Down
12 changes: 10 additions & 2 deletions addons/viewport/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,16 @@
"regenerator-runtime": "^0.13.7"
},
"peerDependencies": {
"react": "^16.8.3 || ^17.0.0",
"react-dom": "^16.8.3 || ^17.0.0"
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
},
"peerDependenciesMeta": {
"react": {
"optional": true
},
"react-dom": {
"optional": true
}
},
"publishConfig": {
"access": "public"
Expand Down

0 comments on commit 7ad9f84

Please sign in to comment.