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

ci: fix PnP e2e test #13059

Closed
wants to merge 2 commits into from
Closed

Conversation

merceyz
Copy link
Contributor

@merceyz merceyz commented Nov 9, 2020

Issue: Fixes #12928

The PnP e2e tests are failing due to PnP issues in create-react-app and a recent update to fsevents.

What I did

Applied the changes from facebook/create-react-app#9872 using packageExtensions and grabbed the latest build of Yarn from the repo.

The yarn.js file is a copy of the bundle from https://github.com/yarnpkg/berry/actions/runs/354405528 if you want to verify that it isn't malicious.

How to test

CI should be green

@@ -159,6 +159,7 @@ export const sfcVue: Parameters = {
generator: fromDeps('vue', 'vue-loader', 'vue-template-compiler'),
additionalDeps: [
'webpack@webpack-4',
'react',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

While this is what is required I'm assuming you don't actually want Vue users to have to install React. Perhaps Storybook should set an alias for react to make sure it's resolved from the core?

@gaetanmaisse seems to have "regressed" in #12972

Copy link
Member

Choose a reason for hiding this comment

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

~It's weird as in the stated PR I added react to the deps of @storybook/vue: https://github.com/storybookjs/storybook/pull/12972/files#diff-3133f51bc714c0aa1f09aa806d0b57b4727c48342f4c570ffe531942fa17e074R42

So we shouldn't need to add react as a direct dep to make everything work together 🤔 ~

Copy link
Member

Choose a reason for hiding this comment

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

Hmm pb comes from @storybook/addon-docs and not @storybook/vue:

ERR! Module not found: Error: @storybook/addon-docs tried to access react (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound.
ERR!
ERR! Required package: react (via "react")

Copy link
Member

Choose a reason for hiding this comment

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

So we are back to the issue we discussed a week ago with other SB foxes: #12972 (comment)

@merceyz As a Yarn 2 master, do you have any idea?

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps Storybook should set an alias for react to make sure it's resolved from the core?

Are you speaking of a webpack alias? Cause I guess we already have one to be sure to use a single version of react, @ndelangen can confirm. However, it doesn't solve our missing (peer)dependency issues 😞

Copy link
Contributor Author

@merceyz merceyz Nov 10, 2020

Choose a reason for hiding this comment

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

do you have any idea?

Either dependency injection or have @storybook/vue export react so that the vue part of the docs would import it from there but that only works if nothing else dependson react. The latter would give better treeshaking.

Are you speaking of a webpack alias?

Yes

However, it doesn't solve our missing (peer)dependency issues disappointed

That is true, if none of the dependencies the docs has needs react, importing react from @storybook/vue seems to be the best option

@merceyz merceyz changed the title test: fix e2e PnP test ci: fix PnP e2e test Nov 9, 2020
@gaetanmaisse
Copy link
Member

I'm not a big fan of adding yarn "binary" in SB already huge repo (ok, it's only ~1.5Mb but still). I followed the fsevents issue and was excepting a Yarn release quickly after the PR was merged 🙈 . If it's not happening then I think we can go with the script/yarn.js

@gaetanmaisse
Copy link
Member

@merceyz I more or less apply what you did in that PR but prefer what you suggest here as we are trying to move the examples out of the monorepo (so I didn't want to create a dependency by adding yarn bin in this repo).

PR #13129.

I would also enjoy discussing more deeply with you the react as peer/regular dep point, will try to reach you on Discord.

@merceyz
Copy link
Contributor Author

merceyz commented Nov 16, 2020

Sounds good, i'll close this then

@merceyz merceyz closed this Nov 16, 2020
@merceyz merceyz deleted the merceyz/pnp-e2e-test branch November 16, 2020 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI Failure: examples-v2-yarn-2
2 participants