-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat: add Storybook starter #2381
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
fec8004
Add Storybook starter
DustinJSilk e53e6e0
Update Storybook docs with preview command
DustinJSilk edf8ec6
Copy the project vite plugins
DustinJSilk 7e3ba9f
Use storybook v7 and html-vite
DustinJSilk 4a204ba
Fix tsconfig options
DustinJSilk db79b81
Fix storybook.build
DustinJSilk 7aab865
Add required react dependency
DustinJSilk 2b8caf6
fix to working storybook version and remove QWIK_LOADER eval
DustinJSilk feba151
Update integration to include 3rd party library
DustinJSilk 75a130c
Include tips on using storybook with tailwind
DustinJSilk 433ab1f
Add documentation for running with i18n
DustinJSilk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix to working storybook version and remove QWIK_LOADER eval
- Loading branch information
commit 2b8caf64d0db10324bff02477216bc36c60855f4
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The storybook cli scaffolds
*.mdxfor all frameworks (not*.stories.mdx). I'm guessing this is becausestories.mdxis a special pattern that will make the file declare stories rather than just be documentation.Picking up all mdx files can cause conflicts with Qwik-city mdx though, so having some explicit indicator that mdx is for storybook, not qwik city is important (because Qwik-city mdx will only work with Qwik component, and SB mdx will only work with react components).
I think a "storybook" prefix gets the explicit marking, without triggering the special behavior of
stories.mdx.But, because of some limitations, I'm planning on just doing
*.mdxin the storybook CLI qwik integration like other frameworks. I'll need to add documentation to warn about the Qwik-city conflict potential. You could do that if you want to match how the sb cli will eventually work (based on my current guess).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.
Using
stories.mdxis the recommended approach to defining stories in mdx files. So this should keep it consistent with what storybook users expect and avoids adding Qwik mdx files as stories. There is of course still the issue of any mdx files in the routes folder being turned into a page but I think thats fine for now as most stories will be on a component level.What is the special behaviour from a
.stories.mdxfile that we're trying to avoid by using.storybook.mdx?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.
in a
stories.mdxfile, any story you reference will get added to the navigation. If you already declared the story in astories.tsxfile, this will cause duplicates.with any other pattern, you can reference the stories in the mdx without adding them to the side bar.
I suppose it could go either way, but I defer to the default in storybook CLI