Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yarn 2: Fix dependencies issues for compatibility #10613

Merged
merged 9 commits into from
May 2, 2020
5 changes: 4 additions & 1 deletion addons/a11y/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@
"regenerator-runtime": "^0.13.3"
},
"devDependencies": {
"@types/webpack-env": "^1.15.2"
"@testing-library/react": "^10.0.4",
"@types/webpack-env": "^1.15.2",
"react": "^16.13.1",
"react-dom": "^16.13.1"
},
"peerDependencies": {
"react": "*",
Expand Down
3 changes: 3 additions & 0 deletions addons/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"@storybook/api": "6.0.0-beta.0",
"@storybook/client-api": "6.0.0-beta.0",
"@storybook/components": "6.0.0-beta.0",
"@storybook/core": "6.0.0-beta.0",
"@storybook/core-events": "6.0.0-beta.0",
"@storybook/csf": "0.0.1",
"@storybook/node-logger": "6.0.0-beta.0",
Expand Down Expand Up @@ -87,6 +88,7 @@
"@storybook/web-components": "6.0.0-beta.0",
"@types/doctrine": "^0.0.3",
"@types/enzyme": "^3.10.3",
"@types/estree": "^0.0.44",
"@types/jest": "^25.1.1",
"@types/tmp": "^0.1.0",
"@types/cross-spawn": "^6.0.1",
Expand All @@ -111,6 +113,7 @@
"styled-components": "^5.0.1",
"terser-webpack-plugin": "^2.3.6",
"tmp": "^0.2.1",
"tslib": "^1.11.1",
"web-component-analyzer": "^1.0.3",
"webpack": "^4.33.0",
"zone.js": "^0.10.2"
Expand Down
12 changes: 6 additions & 6 deletions addons/docs/src/frameworks/common/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function webpack(webpackConfig: any = {}, options: any = {}) {
include: new RegExp(`node_modules\\${path.sep}acorn-jsx`),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing this will do nothing in yarn 2?

use: [
{
loader: 'babel-loader',
loader: require.resolve('babel-loader'),
options: {
presets: [[require.resolve('@babel/preset-env'), { modules: 'commonjs' }]],
},
Expand All @@ -77,11 +77,11 @@ export function webpack(webpackConfig: any = {}, options: any = {}) {
test: /\.(stories|story).mdx$/,
use: [
{
loader: 'babel-loader',
loader: require.resolve('babel-loader'),
options: createBabelOptions(babelOptions, configureJSX),
},
{
loader: '@mdx-js/loader',
loader: require.resolve('@mdx-js/loader'),
options: {
compilers: [createCompiler(options)],
...mdxLoaderOptions,
Expand All @@ -94,11 +94,11 @@ export function webpack(webpackConfig: any = {}, options: any = {}) {
exclude: /\.(stories|story).mdx$/,
use: [
{
loader: 'babel-loader',
loader: require.resolve('babel-loader'),
options: createBabelOptions(babelOptions, configureJSX),
},
{
loader: '@mdx-js/loader',
loader: require.resolve('@mdx-js/loader'),
options: mdxLoaderOptions,
},
],
Expand All @@ -112,7 +112,7 @@ export function webpack(webpackConfig: any = {}, options: any = {}) {
result.plugins.push(
new DllReferencePlugin({
context,
manifest: path.join(coreDirName, 'dll', 'storybook_docs-manifest.json'),
manifest: require.resolve('@storybook/core/dll/storybook_docs-manifest.json'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to use path.join for windows? Or does require.resolve handle that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good question 🤔 I guess so, I based my change on what is done at L10: https://github.com/storybookjs/storybook/pull/10613/files#diff-3f9960d4367e0d7176bea0f6d79a54e7R10
@ndelangen maybe know the answer to that question?

I only have Unix computers so I can't directly test. However, the previous version was written by @tooppaaa and I think he is working on Windows so maybe he can give it a try and let us know if it works 😇. @tooppaaa if you have time can you:

git checkout fix-deps
yarn bootstrap --core
cd examples/official-storybook
yarn STORYBOOK_DISPLAY_WARNING=true DISPLAY_WARNING=true start-storybook -p 9011 -c ./

Then let us know if SB has started properly and if stories related to addon docs are working fine. 🙇

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this works on windows, this would resolve to a path with the slashes in the wrong direction, as is how windows likes it. 🤷‍♂️

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good ! IE included ;)

})
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { Parser } from 'acorn';
// @ts-ignore
import jsx from 'acorn-jsx';
// eslint-disable-next-line import/no-extraneous-dependencies
import estree from 'estree';
// @ts-ignore
import * as acornWalk from 'acorn-walk';
import {
InspectionType,
Expand Down
1 change: 1 addition & 0 deletions addons/docs/src/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ declare module 'remark-external-links';
declare module 'babel-plugin-react-docgen';
declare module 'require-from-string';
declare module 'styled-components';
declare module 'acorn-jsx';
3 changes: 2 additions & 1 deletion addons/essentials/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"ts-dedent": "^1.1.1"
},
"devDependencies": {
"@types/jest": "^25.1.1"
"@types/jest": "^25.1.1",
"@types/webpack-env": "^1.15.2"
},
"peerDependencies": {
"babel-loader": "^8.0.0",
Expand Down
2 changes: 1 addition & 1 deletion addons/essentials/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ export function managerEntries(entry: any[] = [], options: PresetOptions = {}) {
.filter((key) => (options as any)[key] !== false)
.map((key) => makeAddon(key))
.filter((addon) => !isInstalled(addon))
.map((addon) => `${addon}/register`);
.map((addon) => require.resolve(`${addon}/register`));
return [...entry, ...registerAddons];
}
2 changes: 1 addition & 1 deletion addons/essentials/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"types": ["jest"]
"types": ["webpack-env", "jest"]
},
"include": ["src/**/*"],
"exclude": ["src/**.test.ts"]
Expand Down
3 changes: 3 additions & 0 deletions addons/graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@babel/core": "^7.9.0",
"@babel/plugin-transform-classes": "^7.9.2",
"@storybook/addons": "6.0.0-beta.0",
"@storybook/api": "6.0.0-beta.0",
"@types/webpack": "^4.41.9",
"babel-loader": "^8.0.6",
"core-js": "^3.0.1",
"global": "^4.3.2",
"graphiql": "^0.17.5",
Expand Down
6 changes: 4 additions & 2 deletions addons/toolbars/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@
"@storybook/addons": "6.0.0-beta.0",
"@storybook/api": "6.0.0-beta.0",
"@storybook/client-api": "6.0.0-beta.0",
"@storybook/components": "6.0.0-beta.0"
"@storybook/components": "6.0.0-beta.0",
"core-js": "^3.0.1"
},
"peerDependencies": {
"react": "*"
"react": "*",
"react-dom": "*"
},
"publishConfig": {
"access": "public"
Expand Down
15 changes: 7 additions & 8 deletions app/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,22 @@
"@storybook/core": "6.0.0-beta.0",
"@storybook/node-logger": "6.0.0-beta.0",
"@types/webpack-env": "^1.15.2",
"autoprefixer": "^9.7.6",
"core-js": "^3.0.1",
"fork-ts-checker-webpack-plugin": "^4.0.3",
"global": "^4.3.2",
"postcss-loader": "^3.0.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"regenerator-runtime": "^0.13.3",
"sass-loader": "^8.0.0",
"strip-json-comments": "^3.0.1",
"ts-loader": "^6.0.1",
"tsconfig-paths-webpack-plugin": "^3.2.0"
"tsconfig-paths-webpack-plugin": "^3.2.0",
"webpack": "^4.43.0"
},
"devDependencies": {
"@types/autoprefixer": "^9.4.0",
"webpack": "^4.33.0"
"@types/autoprefixer": "^9.4.0"
},
"peerDependencies": {
"@angular-devkit/build-angular": ">=0.8.9",
Expand All @@ -61,13 +65,8 @@
"@angular/platform-browser": ">=6.0.0",
"@angular/platform-browser-dynamic": ">=6.0.0",
"@babel/core": "*",
"autoprefixer": "^8.1.0",
"babel-loader": "^7.0.0 || ^8.0.0",
"react": "*",
"react-dom": "*",
"rxjs": "^6.0.0",
"typescript": "^3.4.0",
"webpack": "^4.32.0",
"zone.js": "^0.8.29 || ^0.9.0 || ^0.10.0"
},
"engines": {
Expand Down
1 change: 0 additions & 1 deletion app/ember/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
},
"peerDependencies": {
"@babel/core": "*",
"babel-loader": "^7.0.0 || ^8.0.0",
"babel-plugin-ember-modules-api-polyfill": "^2.12.0",
"babel-plugin-htmlbars-inline-precompile": "2 || 3",
"ember-source": "^3.16.0",
Expand Down
1 change: 0 additions & 1 deletion app/html/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
},
"peerDependencies": {
"@babel/core": "*",
"babel-loader": "^7.0.0 || ^8.0.0",
"react": "*",
"react-dom": "*"
},
Expand Down
1 change: 0 additions & 1 deletion app/marionette/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
},
"peerDependencies": {
"@babel/core": "*",
"babel-loader": "^7.0.0 || ^8.0.0",
"backbone": "*",
"backbone.marionette": "*",
"react": "*",
Expand Down
1 change: 0 additions & 1 deletion app/marko/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
},
"peerDependencies": {
"@babel/core": "*",
"babel-loader": "^7.0.0 || ^8.0.0",
"marko": "^4.15.2",
"react": "*",
"react-dom": "*",
Expand Down
1 change: 0 additions & 1 deletion app/mithril/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
},
"peerDependencies": {
"@babel/core": "*",
"babel-loader": "^7.0.0 || ^8.0.0",
"mithril": "^1.1.6",
"react": "*",
"react-dom": "*"
Expand Down
1 change: 0 additions & 1 deletion app/preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
},
"peerDependencies": {
"@babel/core": "*",
"babel-loader": "^7.0.0 || ^8.0.0",
"preact": "^8.4.2",
"react": "*",
"react-dom": "*"
Expand Down
1 change: 0 additions & 1 deletion app/rax/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
},
"peerDependencies": {
"@babel/core": "*",
"babel-loader": "^7.0.0 || ^8.0.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! this means we can remove some documentation too, I think we tell users to install this?

"rax": "^0.4.0 || ^1.0.0",
"react": "*",
"react-dom": "*"
Expand Down
1 change: 0 additions & 1 deletion app/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
},
"peerDependencies": {
"@babel/core": "^7.0.1",
"babel-loader": "^7.0.0 || ^8.0.0",
"react": "*",
"react-dom": "*"
},
Expand Down
1 change: 0 additions & 1 deletion app/riot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
},
"peerDependencies": {
"@babel/core": "*",
"babel-loader": "^7.0.0 || ^8.0.0",
"react": "*",
"react-dom": "*",
"riot": "^3.0.0 || ^4.0.0",
Expand Down
3 changes: 0 additions & 3 deletions app/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@
"devDependencies": {
"fs-extra": "^9.0.0"
},
"peerDependencies": {
"babel-loader": "^7.0.0 || ^8.0.0"
},
"engines": {
"node": ">=8.0.0"
},
Expand Down
1 change: 0 additions & 1 deletion app/svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
},
"peerDependencies": {
"@babel/core": "*",
"babel-loader": "^7.0.0 || ^8.0.0",
"react": "*",
"react-dom": "*",
"svelte": "^3.1.0",
Expand Down
1 change: 0 additions & 1 deletion lib/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@
},
"peerDependencies": {
"@babel/core": "*",
"babel-loader": "^7.0.0 || ^8.0.0",
"react": "*",
"react-dom": "*"
},
Expand Down
25 changes: 17 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3935,7 +3935,7 @@
dependencies:
defer-to-connect "^1.0.1"

"@testing-library/dom@^7.1.0":
"@testing-library/dom@^7.1.0", "@testing-library/dom@^7.2.2":
version "7.2.2"
resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-7.2.2.tgz#30ab09cca132fe49b2ca61ccd9ed785c5f0a6fc5"
integrity sha512-g+gT//COYh2FgRrlgcgdkifkjqSk7wQIS7F8jbrf6yoEsh85PJUJ/QtO0bJ9QU7pQPYQgKcgqNJsOs0dlyFYag==
Expand All @@ -3955,6 +3955,15 @@
"@testing-library/dom" "^7.1.0"
"@types/testing-library__react" "^10.0.0"

"@testing-library/react@^10.0.4":
version "10.0.4"
resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-10.0.4.tgz#8e0e299cd91acc626d81ed8489fdc13df864c31d"
integrity sha512-2e1B5debfuiIGbvUuiSXybskuh7ZTVJDDvG/IxlzLOY9Co/mKFj9hIklAe2nGZYcOUxFaiqWrRZ9vCVGzJfRlQ==
dependencies:
"@babel/runtime" "^7.9.6"
"@testing-library/dom" "^7.2.2"
"@types/testing-library__react" "^10.0.1"

"@tootallnate/once@1":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82"
Expand Down Expand Up @@ -4132,7 +4141,7 @@
resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d"
integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==

"@types/estree@*":
"@types/estree@*", "@types/estree@^0.0.44":
version "0.0.44"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.44.tgz#980cc5a29a3ef3bea6ff1f7d021047d7ea575e21"
integrity sha512-iaIVzr+w2ZJ5HkidlZ3EJM8VTZb2MJLCjw3V+505yVts0gRC4UMvjw0d1HPtGqI/HQC/KdsYtayfzl+AXY2R8g==
Expand Down Expand Up @@ -4560,7 +4569,7 @@
dependencies:
pretty-format "^25.1.0"

"@types/testing-library__react@^10.0.0":
"@types/testing-library__react@^10.0.0", "@types/testing-library__react@^10.0.1":
version "10.0.1"
resolved "https://registry.yarnpkg.com/@types/testing-library__react/-/testing-library__react-10.0.1.tgz#92bb4a02394bf44428e35f1da2970ed77f803593"
integrity sha512-RbDwmActAckbujLZeVO/daSfdL1pnjVqas25UueOkAY5r7vriavWf0Zqg7ghXMHa8ycD/kLkv8QOj31LmSYwww==
Expand Down Expand Up @@ -4610,7 +4619,7 @@
"@types/source-list-map" "*"
source-map "^0.6.1"

"@types/webpack@^4.41.12", "@types/webpack@^4.41.7", "@types/webpack@^4.41.8":
"@types/webpack@^4.41.12", "@types/webpack@^4.41.7", "@types/webpack@^4.41.8", "@types/webpack@^4.41.9":
version "4.41.12"
resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-4.41.12.tgz#0386ee2a2814368e2f2397abb036c0bf173ff6c3"
integrity sha512-BpCtM4NnBen6W+KEhrL9jKuZCXVtiH6+0b6cxdvNt2EwU949Al334PjQSl2BeAyvAX9mgoNNG21wvjP3xZJJ5w==
Expand Down Expand Up @@ -5975,7 +5984,7 @@ autoprefixer@9.7.4:
postcss "^7.0.26"
postcss-value-parser "^4.0.2"

autoprefixer@^9.4.3, autoprefixer@^9.4.9, autoprefixer@^9.6.1, autoprefixer@^9.7.2:
autoprefixer@^9.4.3, autoprefixer@^9.4.9, autoprefixer@^9.6.1, autoprefixer@^9.7.2, autoprefixer@^9.7.6:
version "9.7.6"
resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.7.6.tgz#63ac5bbc0ce7934e6997207d5bb00d68fa8293a4"
integrity sha512-F7cYpbN7uVVhACZTeeIeealwdGM6wMtfWARVLTy5xmKtgVdBNJvbDRoCK3YO1orcs7gv/KwYlb3iXwu9Ug9BkQ==
Expand Down Expand Up @@ -24963,7 +24972,7 @@ react-dom@^15.4.2:
object-assign "^4.1.0"
prop-types "^15.5.10"

react-dom@^16.0.0, react-dom@^16.10.2, react-dom@^16.12.0, react-dom@^16.8.3, react-dom@^16.8.4:
react-dom@^16.0.0, react-dom@^16.10.2, react-dom@^16.12.0, react-dom@^16.13.1, react-dom@^16.8.3, react-dom@^16.8.4:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.13.1.tgz#c1bd37331a0486c078ee54c4740720993b2e0e7f"
integrity sha512-81PIMmVLnCNLO/fFOQxdQkvEq/+Hfpv24XNJfpyZhTRfO0QcmQIF/PgCa1zCOj2w1hrn12MFLyaJ/G0+Mxtfag==
Expand Down Expand Up @@ -25275,7 +25284,7 @@ react@^15.4.2:
object-assign "^4.1.0"
prop-types "^15.5.10"

react@^16.0.0, react@^16.10.2, react@^16.8.3, react@^16.8.4, react@^16.9.17:
react@^16.0.0, react@^16.10.2, react@^16.13.1, react@^16.8.3, react@^16.8.4, react@^16.9.17:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react/-/react-16.13.1.tgz#2e818822f1a9743122c063d6410d85c1e3afe48e"
integrity sha512-YMZQQq32xHLX0bz5Mnibv1/LHb3Sqzngu7xstSM+vrkE5Kzr9xE0yMByK5kMoTK30YVJE61WfbxIFFvfeDKT1w==
Expand Down Expand Up @@ -29454,7 +29463,7 @@ tsconfig-paths@^3.4.0:
minimist "^1.2.0"
strip-bom "^3.0.0"

tslib@1.11.1, tslib@^1.10.0, tslib@^1.7.1, tslib@^1.8.1, tslib@^1.9.0:
tslib@1.11.1, tslib@^1.10.0, tslib@^1.11.1, tslib@^1.7.1, tslib@^1.8.1, tslib@^1.9.0:
version "1.11.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35"
integrity sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==
Expand Down