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-contexts] Should I add global and qs to my package.json? #7625

Closed
sjiep opened this issue Jul 30, 2019 · 22 comments
Closed

[addon-contexts] Should I add global and qs to my package.json? #7625

sjiep opened this issue Jul 30, 2019 · 22 comments

Comments

@sjiep
Copy link

sjiep commented Jul 30, 2019

Describe the bug
When adding the context addon package to my project as suggested in the README. I receive the following warning from yarn:

warning " > @storybook/[email protected]" has unmet peer dependency "global@*".
warning " > @storybook/[email protected]" has unmet peer dependency "qs@*".

It appears that these two packages are listed as peer dependencies in the package.json of @storybook/[email protected]. However the README doesn't mention that these two package should be installed 'manually'.

Expected behavior
When following the README instructions, not to be left with warnings from yarn.

Either the README should mention we should install these packages together with the addon, or these packages should be added as real dependencies of the addon, not just peer dependencies.

System:

Binaries:
    Node: 10.15.0 - ~/.nvm/versions/node/v10.15.0/bin/node
    Yarn: 1.17.3 - /usr/bin/yarn
    npm: 6.8.0 - ~/.nvm/versions/node/v10.15.0/bin/npm
@leoyli
Copy link
Contributor

leoyli commented Jul 31, 2019

@shilman, I actually have the same question on package management here. Should we remove the entire peerDependencies and put qs or global under regular dependencies? I don't see it is really necessary. One thing need to be cared is the dependencies deduplication.

@shilman
Copy link
Member

shilman commented Jul 31, 2019

@leoyli I think it's fine to put them as regular dependencies in this case. We should use peer deps when we want to use the user's version. But I don't think it matters in this case?

@leoyli
Copy link
Contributor

leoyli commented Jul 31, 2019

@shilman, I think we should use it from @storybook/core, like qs, or global at least (and use ^ to allow dedup). We can use yarn resolution to enforce consistency across the entire workspaces. But now when I install it, I'm always seeing warnings, which seems not too good and confusing.

@shilman
Copy link
Member

shilman commented Jul 31, 2019

@leoyli how do you propose we use it from @storybook/core?

typically we just make sure the versions more or less line up across packages in the monorepo and then trust that npm/yarn will do the right thing to dedupe.

in other words adding at as a direct dep of the package shouldn't add any extra overhead unless the version is radically different than @storybook/core's version, which it should never be.

@sjiep
Copy link
Author

sjiep commented Aug 1, 2019

@shilman @leoyli in my experience adding qs and global as dependencies to the addon-context package should work out nicely (as long as you keep the version range the same/similar). Yarn should nicely hoist/dedupe these dependencies into one.

@sjiep
Copy link
Author

sjiep commented Aug 2, 2019

I see that now in storybook 5.1.10, react, preact and vue have been adding to peer dependencies. Giving the the following warning from yarn (I'm using React):

warning " > @storybook/[email protected]" has unmet peer dependency "preact@*".
warning " > @storybook/[email protected]" has unmet peer dependency "vue@*".

I'm not entirely sure how to solve that one, you definitely wouldn't want all react, preact and vue as dependencies in storybook itself.

@shilman
Copy link
Member

shilman commented Aug 2, 2019

@leoyli why are these peer dependencies at all? i don't see them imported anywhere in addon-contexts. i think this is a bug.

@leoyli
Copy link
Contributor

leoyli commented Aug 2, 2019

@shilman.... well I see you the person added it:

https://github.com/storybookjs/storybook/blame/ae8baa22ef8bf019d2cee07a5ef51bb6aa711359/addons/contexts/package.json#L39

It defiantly should not be there, it just meant to make sure the tarball can be built as a optional dependencies. And I can shape a PR to change this altogether as soon as tonight.

@shilman
Copy link
Member

shilman commented Aug 3, 2019

@leoyli hahaha well you also see why then 😘

thanks for picking this up 🙇

@leoyli leoyli self-assigned this Aug 3, 2019
@stale stale bot added the inactive label Aug 24, 2019
@leoyli leoyli removed the inactive label Sep 22, 2019
@storybookjs storybookjs deleted a comment from stale bot Sep 22, 2019
@shilman
Copy link
Member

shilman commented Sep 24, 2019

Gadzooks!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.3.0-alpha.1 containing PR #7675 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed Sep 24, 2019
@sjiep
Copy link
Author

sjiep commented Jan 31, 2020

@shilman I've updated to v5.3.9 but I see the peer dependencies are still defined in the addons-context package.json. However it looks like the merge from #7675 should have removed them?

@shilman
Copy link
Member

shilman commented Jan 31, 2020

@sjiep That's pretty weird. Perhaps some bad conflict resolution at some point? I'm reopening & will try to re-apply these changes to both next and master when I get back to work (on vacation).

@shilman shilman reopened this Jan 31, 2020
@shilman shilman assigned shilman and unassigned leoyli Jan 31, 2020
@shilman shilman added this to the 5.3.x milestone Jan 31, 2020
@stale
Copy link

stale bot commented Feb 21, 2020

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Feb 21, 2020
@ahuth
Copy link
Contributor

ahuth commented Mar 12, 2020

Hey @shilman , did you ever get a chance to try to re-apply the changes? I can't actually find the commit that adds back the peer deps. Would love to be able to use this addon without needing to install packages I don't actually use (my company unfortunately runs npm ls on CI, and any warnings/errors from that will cause CI failure).

Let me know if you need any help with this, or if a new PR would be helpful.

@stale stale bot removed the inactive label Mar 12, 2020
@shilman
Copy link
Member

shilman commented Mar 14, 2020

@ahuth sorry this fell through the cracks. a new PR would be helpful!

Also, FWIW, I plan to deprecate addon-contexts in 6.0 and have created a new addon, addon-toolbars that achieves the same result in a simple/standard/ergonomic/cross-framework way. If you can upgrade, I highly recommend it:

https://github.com/storybookjs/storybook/tree/next/addons/toolbars

@ahuth
Copy link
Contributor

ahuth commented Mar 16, 2020

No worries! Also, the toolbars addon looks perfect 👍

@stale
Copy link

stale bot commented Apr 7, 2020

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Apr 7, 2020
@voxpelli
Copy link

Still running into this, what would you want a PR for @shilman? Just the removal of the peer dependencies?

@stale
Copy link

stale bot commented May 6, 2020

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label May 6, 2020
@stale stale bot removed the inactive label May 6, 2020
@stale
Copy link

stale bot commented May 30, 2020

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label May 30, 2020
@stale
Copy link

stale bot commented Jul 3, 2020

Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!

@stale stale bot closed this as completed Jul 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants