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

Addon-storyshots: Add React as peer dependency #13343

Merged
merged 1 commit into from Dec 2, 2020
Merged

Addon-storyshots: Add React as peer dependency #13343

merged 1 commit into from Dec 2, 2020

Conversation

brandon-leapyear
Copy link
Contributor

@brandon-leapyear brandon-leapyear commented Nov 30, 2020

This is an old work account. Please reference @brandonchinn178 for all future communication


Issue: yarn v2 uses plug-n-play which enforces packages declaring their dependencies. Without this change, I get

    @storybook/addon-storyshots tried to access @storybook/react, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

    Required package: @storybook/react (via "@storybook/react")
    Required by: @storybook/addon-storyshots@virtual:dbf6fb739a2cd0ef0bbac1487a859a8cf75e2fac4b91f1e5e09c94189b803fa7487df4ab9dcb9afa086207ede70464fa7661bd9c744b19bf7998fc8208244079#npm:6.1.1 (via /Users/bchinn/leapyear/leapyear-delta/.yarn/$$virtual/@storybook-addon-storyshots-virtual-203a42d9b0/0/cache/@storybook-addon-storyshots-npm-6.1.1-9c5555024d-13556baf4c.zip/node_modules/@storybook/addon-storyshots/dist/frameworks/react/)

Current workaround is to add the following to .yarnrc.yml:

packageExtensions:
  '@storybook/addon-storyshots@*':
    peerDependencies:
      '@storybook/react': '*'

What I did

How to test

  • Is this testable with Jest or Chromatic screenshots?
  • Does this need a new example in the kitchen sink apps?
  • Does this need an update to the documentation?

If your answer is yes to any of these, please make sure to include it in your PR.

@gaetanmaisse gaetanmaisse changed the title Add @storybook/react to storyshots peer deps Addon-storyshots: Add React as peer dependency Dec 2, 2020
@gaetanmaisse gaetanmaisse merged commit b8aa525 into storybookjs:master Dec 2, 2020
@shilman shilman added patch:yes Bugfix & documentation PR that need to be picked to main branch patch:done Patch/release PRs already cherry-picked to main/release branch labels Dec 2, 2020
shilman pushed a commit that referenced this pull request Dec 2, 2020
Addon-storyshots: Add React as peer dependency
@brandon-leapyear brandon-leapyear deleted the patch-1 branch December 2, 2020 08:13
ghengeveld pushed a commit that referenced this pull request Dec 7, 2020
Addon-storyshots: Add React as peer dependency
@@ -68,6 +68,7 @@
"jest-vue-preprocessor": "^1.5.0"
},
"peerDependencies": {
"@storybook/react": "*",
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 it should be marked as optional

Copy link
Member

Choose a reason for hiding this comment

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

PR please? 🙏

Copy link
Member

Choose a reason for hiding this comment

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

Oops, just saw it. Nvm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon: storyshots dependencies patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants