storybook-addon-themes
storybook-addon-themes copied to clipboard
Addon breaks compilation in Storybook 6.2.x
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.
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.
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.
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...
Shouldn’t such a dependency be declared as a peerDependency
?