-
Notifications
You must be signed in to change notification settings - Fork 24
Widen peer dependency range to include prereleases #26
Conversation
Hey @IanVS thanks for your contribution! However I'm not sure if this is the best approach. This would open up this library to have possible version mismatches with future React/Storybook versions without proper support being added first. Also, in https://semver.npmjs.com/ I see that In the yarn docs you can see this explanation about ranges and prereleases: So I think the only way to support alphas/betas would be to add a range like this, and keep updating it with subsequent minor versions:
I'm not sure it's the best approach as well. @shilman what would you suggest? It's not nice that this lib breaks people's code when they're trying out Storybook prerelease versions |
Ugh, why are peer dependencies so awful? Is there really no good way to do this? I see that of course you're correct, when experimenting with https://semver.npmjs.com/. It sounds like this nightmare is "working as intended" npm/cli#3135 |
@yannbf that proposal looks pretty good to me! |
It feels kind of wrong, but to avoid having to update this package every time there's a new storybook version, I wonder if that pattern could even be extended out into the future, with something like:
Interestingly, |
@yannbf I've adopted your proposal here. |
Awesome! Could you test the canary version that was generated to see if it fixes the problem for you? |
Yes, I have confirmed that |
Awesome! Thanks a lot for your contribution, Ian! |
Fixes #25
This uses a more liberal
>=
semver range for peer dependencies, to allow installations with pre-release versions of storybook (and react for that matter) with npm 7. It's also just good practice to be as open as possible with peer dependencies, to avoid problems like reach-router has right now (reach/router#432 (comment))📦 Published PR as canary version:
0.0.17--canary.26.e11efee.0
✨ Test out this PR locally via:
npm install @storybook/testing-react@0.0.17--canary.26.e11efee.0 # or yarn add @storybook/testing-react@0.0.17--canary.26.e11efee.0