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 breaks compilation in Storybook 6.2.x #49

Open
KrofDrakula opened this issue Apr 6, 2021 · 4 comments
Open

Addon breaks compilation in Storybook 6.2.x #49

KrofDrakula opened this issue Apr 6, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@KrofDrakula
Copy link

storybook-addon-themes installs its own version of @storybook/[email protected] which is incompatible with Storybook v6.2.x.

It should define @storybook/* dependencies as devDependencies and peerDependencies in order to avoid breaking for future versions. That would enable developing the addon normally by installing the dependencies directly, but when published and consumed, would use the peer dependency provided by the actual installed version.

@tonai
Copy link
Owner

tonai commented Apr 8, 2021

Hello @KrofDrakula ,
I tried to reproduce your problem without success.
I understand what you mean but if I can't reproduce your problem, I can't check that it will fix it.
Dependencies for @storybook/* are declared as ^6.0.16 in my test project (it is declared as ^6.0.0 in this addon) and it only installed version 6.2.5 that is ok for both cases.

@KrofDrakula
Copy link
Author

Hm, this could be a Yarn issue, then. It seems that upgrading Storybook packages that we depend on directly from 6.1 to 6.2 doesn't propagate to this addon's dependencies which remain at 6.1.x after upgrading.

I guess the only way to resolve the current situation would be removing the 6.1.x references from the yarn lockfile and rerun installation, which would hopefully pick up the updated dependencies. With peerDependencies, the addon would just use the top-level version and not be out of date, but that might require version detection for @storybook/api in case there is an incompatible change between versions.

@tonai
Copy link
Owner

tonai commented Apr 14, 2021

Maybe it is because we doesn't require to use the last version in this package.json.
Storybook addons declare their dependencies the same way than this addon, but they use fixed version (https://github.com/storybookjs/storybook/blob/next/addons/backgrounds/package.json => 6.3.0-alpha.7).
We declare dependencies like that ^6.0.0, but in my case I can't use fixed version...

@Frikki
Copy link

Frikki commented Jun 10, 2021

Shouldn’t such a dependency be declared as a peerDependency?

@tonai tonai added the bug Something isn't working label Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants