-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
Document how to get all Storybook Story IDs #154
Comments
when you say you want story id's what specifically do you mean? |
Every story has a StoryID, I'd like to be able to access them. |
It looks like the Client API has the ability to do this https://github.com/storybookjs/storybook/blob/v5.3.21/lib/client-api/src/story_store.test.ts#L137 |
so I was looking at the code and the id is created using the toId function in the csf package
see: node_modules/@storybook/csf/dist/index.js or the source on github As to how you would get the id's as a user, I will check that for you and respond soon. |
The @storybook/csf package provide the toId function as an export so that can be used to get storyId's. Would that be acceptable? Or would it be better for storybook/react-native to re-export that function? |
Is your feature request related to a problem? Please describe.
I'm looking into Visual Testing with React Native and want to be able to get all Storybook Story IDs from the Storybook.
From what I can understand there's a way of doing this on Web with
extract
: https://github.com/storybookjs/storybook/blob/master/lib/cli/src/extract.tsHowever that requires building the storybook on web.
Describe the solution you'd like
Some documentation on how to best extract all Story IDs or perhaps more information about how to interact with Storybook Server.
https://github.com/oblador/loki edits Stories which enables Visual Testing, documentation to enable writing alternatives to Loki would be great!
Describe alternatives you've considered
I've also considered reading all the Story files and extracting the ids through using Regex to match on
storiesOf
and.add
Are you able to assist bring the feature to reality?
yes can do PRs, just need some discussion about what maintainers think is the best approach.
The text was updated successfully, but these errors were encountered: