gebeto / storybook-addon-manual-mocks

Manual Mocks addon for Storybook
https://www.npmjs.com/package/storybook-addon-manual-mocks
MIT License
6 stars 0 forks source link

Storybook 7 support #3

Closed tomas-hartman closed 9 months ago

tomas-hartman commented 1 year ago

Hey! Really cool plugin!

However I have a problem when I install it on Storybook 7 and this problem is peer dependencies. It can be overcome with npm i --legacy-peer-deps, but that's not really desired behavior. So far it seems to be working fine with sb 7-rc.3, but I did not test it properly yet. Would you consider updating the deps/plugin to work with Storybook 7?

For clarity, this is the error that I get from reguler npm i:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: clean-the-mess@1.0.0
npm ERR! Found: @storybook/addons@7.0.0-rc.3
npm ERR! node_modules/@storybook/addons
npm ERR!   @storybook/addons@"7.0.0-rc.3" from @storybook/builder-webpack5@7.0.0-rc.3
npm ERR!   node_modules/@storybook/builder-webpack5
npm ERR!     @storybook/builder-webpack5@"7.0.0-rc.3" from @storybook/react-webpack5@7.0.0-rc.3
npm ERR!     node_modules/@storybook/react-webpack5
npm ERR!       dev @storybook/react-webpack5@"^7.0.0-rc.3" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! dev storybook-addon-manual-mocks@"*" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @storybook/addons@6.5.16
npm ERR! node_modules/@storybook/addons
npm ERR!   peer @storybook/addons@"^6.5.8" from storybook-addon-manual-mocks@0.0.6
npm ERR!   node_modules/storybook-addon-manual-mocks
npm ERR!     dev storybook-addon-manual-mocks@"*" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
gebeto commented 1 year ago

Thanks for using this plugin 🙌

Sure I'll update it today

gebeto commented 1 year ago

Unfortunately this addon is not working with Storybook 7, because it is implemented for Webpack usage, but Storybook 7 is using Vite builder

So I need to update this addon, and add support for Vite builder, then I'll be able to update this dependencies for v7

tomas-hartman commented 1 year ago

Thanks a lot! I am using storybook 7 with webpack, so it works for me, but vite support would be a great feature as well! I am planning to switch to vite some time in the future anyways.

gebeto commented 1 year ago

Can you please share your storybook config (main.js) with me so I'll test it locally? I'm not very familiar with that how to configure SB7 with webpack, and when I just trying to sb@next init --builder webpack5, this addon is not working for me with this setup

tomas-hartman commented 1 year ago

Sure! You can take a look here: https://github.com/tomas-hartman/clean-the-mess/tree/refactor-styling/.storybook

craigrileyuk commented 1 year ago

Any news on Vite support. Really like this plugin and I'd love to keep using it with SB7.

Thanks for making it!

gebeto commented 1 year ago

@tomas-hartman @craigrileyuk

It happened! Vite and StoryBook v7 support were added 🚀 Now it is available in NPM