-
Notifications
You must be signed in to change notification settings - Fork 25
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
FCT-1112 | display story only when running storybook locally #2902
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
@@ -34,6 +34,6 @@ | |||
"start": "storybook dev -p 6006", | |||
"build-and-serve": "yarn build & yarn serve", | |||
"build": "NODE_ENV=production storybook build", | |||
"serve": "serve" | |||
"serve": "serve ./storybook-static" |
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.
Was there an issue with this command? The serve
tool config is in the serve.json
file and refers to this folder already.
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.
exactly, yarn serve
would crash bc it wasn't finding an index.html
unless I specified the filepath.
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.
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 only way I can reproduce this is by running the build-and-serve
command and I quickly noticed why it happened: I forgot the second & character and the tasks are started in parallel instead of consecutive order 🤦
Can you fix this command and run it again, or run the build + serve commands manually one after another.
I just ran both commands from the project-root and from within the storybook folder and had no issues.
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.
Another reason I could imagine is that your system is picking up a globally installed version of serve
which does not support the serve.json
file yet. Is serve -v
showing the version specified in the package.json
?
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.
@misama-ct I spent entirely too long trying to understand what was causing different behavior on my machine, and I've found that what's causing the issue is that serve
has a dependency serve-handler
, which has a dependency on minimatch:3.1.2
.
In our root package.json, we have a resolution to set minimatch
to always resolve to ^9.0.0
.
The syntax used to call minimatch
in serve-handler
is valid in 3.1.2
, but not in 9.x
, thus the error I am seeing.
We resolve the minimatch
version to greater than 9.x
because older versions have security vulnerabilities, and from what I can tell there is no way to tell yarn v3
to resolve 3.1.2
only for serve-handler
.
I verified that this issue also occurs for @tylermorrisford when he installs main
and attempts to run yarn serve
.
So out of curiosity, how are you building packages for the monorepo? because I cannot get this to work without modifying something.
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.
@misama-ct I'm going to revert the change for the purposes of this PR - it can be handled separately if necessary.
I like the tag + filter option. This would allow us to have one story-file with multiple stories and the capability to hide only specific ones. One feature I'd love to have as well are e.g. |
I agree - my first approach was actually an attempt to update the globs in the I'll take another go at it though, because I like the pattern, especially if we can use it for |
117df62
to
dba7e6d
Compare
…e sidebar when running storybook locally by adding a 'local-dev' tag to the story meta
…d documentation for local-dev tag in storybook/README.md
dba7e6d
to
7eec9a6
Compare
7050106
to
58b214a
Compare
import { Meta, Markdown } from '@storybook/blocks'; | ||
import ReadMe from './../README.md?raw' | ||
|
||
<Meta tags={['local-dev']} title="components/Filters/FilterMenu/Readme" /> |
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.
@misama-ct we can use tags
in the functional-component flavor of Meta
for *.mdx
. I think I prefer this over a separate glob-based approach in main.ts
.
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.
Very nice. Perfect.
* feat(local only storybook): add ability to only display a story in the sidebar when running storybook locally by adding a 'local-dev' tag to the story meta * feat(local only storybook): use tag in mdx files as well * feat(local only storybook): add local story stubs for FiltersList, add documentation for local-dev tag in storybook/README.md * fix(tag): remove local-dev tag from dropdownmenu readme
* feat(local only storybook): add ability to only display a story in the sidebar when running storybook locally by adding a 'local-dev' tag to the story meta * feat(local only storybook): use tag in mdx files as well * feat(local only storybook): add local story stubs for FiltersList, add documentation for local-dev tag in storybook/README.md * fix(tag): remove local-dev tag from dropdownmenu readme
…2912) * chore(readmes): run yarn generate-readmes and commit results * feat(filters): add placeholder test files for unit and vrt tests, add versioning * FCT-1112 | display story only when running storybook locally (#2902) * feat(local only storybook): add ability to only display a story in the sidebar when running storybook locally by adding a 'local-dev' tag to the story meta * feat(local only storybook): use tag in mdx files as well * feat(local only storybook): add local story stubs for FiltersList, add documentation for local-dev tag in storybook/README.md * fix(tag): remove local-dev tag from dropdownmenu readme * fix(serve cmd): revert change specifying ./storybook-static filepath in storybook/package.json in order to merge local dev tagging to filters files branch * feat(filter menu file structure): add component file for trigger button * chore(spacing): change spacing in filter-menu * chore(ci): ! for running checks
* feat(local only storybook): add ability to only display a story in the sidebar when running storybook locally by adding a 'local-dev' tag to the story meta * feat(local only storybook): use tag in mdx files as well * feat(local only storybook): add local story stubs for FiltersList, add documentation for local-dev tag in storybook/README.md * fix(tag): remove local-dev tag from dropdownmenu readme
feat(local only storybook): add ability to only display a story in the sidebar when running storybook locally by adding a 'local-dev' tag to the story meta
this is a POC - feedback welcome