Generate source for story Meta
in csf-tools
#29538
JonahPlusPlus
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is your feature request related to a problem? Please describe.
I'm updating storybook-solidjs to have support for code snippets generation. SolidJS does not have a VDOM to get info from, so I've opted to use the source code from csf-tools, and run a JSX parser and extract arguments from the AST. So far, this is going well.
The problem is getting the component name. For now, I've opted to extract it from the title, but this isn't necessarily correct. I've noticed that csf-tools generates a description for both the meta and the story, but only generates a source for the story. If it were to generate a source for the meta, I would be able to use the component field to get the proper name.
Describe the solution you'd like
First, change
enrichCsfMeta
to extract the meta's source and add it to the parameters.Alos, remove the current
parameters.docs.source
field (which I'll call aSourceObj
type) inStoryContext
.Replace it with a
source
field where contents are of the form:to reflect the current
parameters.docs.description
field.Describe alternatives you've considered
Alternatively, if this breaking change (changing the shape of
source
) is a concern, add to theSourceObj
type fields prefixedcomponent*
, to mark fields dedicated to the meta source.Are you able to assist to bring the feature to reality?
yes, I can
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions