-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Core: StorybookConfig stories
-field support type async function
#21555
Conversation
@shilman I think we need to discuss this... Perhaps we decide after GA? This PR seems correct to me..
Yet our types say not. We kinda want to have this just be an array, because this value can be modified by codemods (maybe?), and for those to work, we want it to be a simple value. But considering the above, I think we should merge this as-is, make the types match the documentation & implementation, then figure out how to do better config in the future. |
stories
-field support type async function
Closes #21524
What I did
Modifies to the StorybookConfig['stories'] type to include a function that returns a Promise that resolves to
StoriesEntry[]
. This should cover the custom implementation case. Since this logic is already supported where presets are loaded/resolved and is already documented, I did not make changes to documentation or add tests.How to test
main.ts
inui/.storybook
so that thestories
key in the config has an async function that resolves a promise like this:StoriesEntry
array.Checklist
MIGRATION.MD
Maintainers
make sure to add the
ci:merged
orci:daily
GH label to it.["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]