Storybook integration

Has anyone successfully integrated storybook with Frontity.

I’ve gotten the warning:

I’ve followed the guides: https://storybook.js.org/docs/guides/guide-react/ both manual and automatic.

With the automatic I get the issue:

 • Detecting project type. ✓
    We couldn't detect your project type. (code: UNDETECTED)
    You can specify a project type explicitly via `sb init --type <type>` or follow some of the slow start guides: https://storybook.js.org/basics/slow-start-guide/

With Manual - I’ve tried their documentation and failed to get it to work.

Any suggestions?

Hi @maurice.tadros

I initially ran npx -p @storybook/cli sb init and got the same error as you, but was prompted to a select project type. I selected React and everything seemed to work okay.

I could run npm run storybook from within my Frontity project and a page at http://localhost:6006/?path=/story/button--text opened in my browser.

I guess running npx -p @storybook/cli sb init --type react would also work.

BTW I ran the test on a brand new and clean install of Frontity. Try setting up a new Frontity project and see if Storybook will work with that.

Incidentally, I’m otherwise unfamiliar with Storybook.

Hope the above helps. Let us know how you get on.

Thank you @mburridge,

I spent some more time, and it is not working well. For simple cases, it works but when you include a file that webpack compiles it gives you errors.

I made a repo to highlight the issue: https://github.com/Bowriverstudio/frontity-storybook

I believe the issue is related to getting storybook to use frontity’s webpack but I’m not sure how to accomplish that: https://storybook.js.org/docs/configurations/custom-webpack-config/

Thank you for your help.

@maurice.tadros thanks for the repo. I’ve done a PR and solved a couple of problems, but still needs some work. Unfortunately I don’t have time right now, so give it a try and see if you can solve the remaining problem: https://github.com/Bowriverstudio/frontity-storybook/pull/1

Hello @luisherranz,

I took a look, and will try to fix the remaining issues.

Thanks for the help,
Maurice