-
Notifications
You must be signed in to change notification settings - Fork 973
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
Make storybook configurable in a redwood app #1828
Conversation
@jtoar I think it makes sense to have two separate configuration files, since the one has a Node.js context and the other has a browser context. I don't think they have to be in a directory, so maybe just |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's my comment from a few days ago, I wasn't sure if you saw it.
I do not think that we need to do storybook.preview.js
right now. If you agree then we can merge this and add storybook.preview.js
seperately.
@jtoar I think it makes sense to have two separate configuration files, since the one has a Node.js context and the other has a browser context. I don't think they have to be in a directory, so maybe just config/storybook.preview.js and config/storybook.config.js
Dang, screwed up the rebasing again; hold! |
Co-authored-by: Peter Pistorius <peter.pistorius@gmail.com>
4f213e0
to
8e2f7ef
Compare
@peterp totally agree, let's get this one in for the next release if you think it's looking good! |
Test summaryRun details
View run in Cypress Dashboard ➡️ Flakiness
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
Ship it! |
@jtoar thoughts about where/how to document this? |
@thedavidprice time for a Storybook doc I think; I'lll add it as a section there, then link to some of the other docs we have like Mocking GraphQL Requests. |
…-e2e-tests * 'main' of github.com:redwoodjs/redwood: Bump @apollo/client from 3.3.7 to 3.3.11 (redwoodjs#1923) Switch create-redwood-app template to TypeScript (redwoodjs#1810) Bump @graphql-tools/merge from 6.2.7 to 6.2.10 (redwoodjs#1910) Adds resolution to template, to prevent module duplication in web/node_modules (redwoodjs#1933) Update service generator to use Prisma namespace (redwoodjs#1853) Make storybook configurable in a redwood app (redwoodjs#1828)
@peterp 's change of Maybe you should apply the change to |
Looks great! 😎 |
This PR makes storybook's
main.js
file configurable from a Redwood App by copying the strategy we currently use with webpack. The webpack-merge docs say that the merge function works with more than just webpack configs, so I reused it here. Here's the quote from the docs:This PR doesn't do anything for
storybook/preview.js
yet—I know that's what #989 was mainly about. So a question while we're on that topic:storybook.config.js
file in a redwood app, with a bunch of exports (one for main, one for preview, etc) or a storybook config dir, like we have in core?&.config.js
, the other with.preview.js
Finally, here's an unimpressive screenshot just to show that things are working:
The file in the redwood app looks like: