Skip to content
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

Research: Explore automatically generating stories from docs-json build output #2173

Open
jcfranco opened this issue May 19, 2021 · 5 comments
Labels
0 - new New issues that need assignment. research Issues that require more in-depth research or multiple team members to resolve or make decision.
Milestone

Comments

@jcfranco
Copy link
Member

Background

To improve our storybook workflow, docs-json.json could help create stories since it includes metadata for all components.

Desired Outcome

Have a script that creates stories for all components from docs-json.json.

@jcfranco jcfranco added research Issues that require more in-depth research or multiple team members to resolve or make decision. 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels May 19, 2021
@jcfranco jcfranco self-assigned this May 19, 2021
@jcfranco jcfranco removed the needs triage Planning workflow - pending design/dev review. label Jun 4, 2021
@jcfranco jcfranco added this to the Sprint 6/21 – 7/2 milestone Jun 4, 2021
@jcfranco jcfranco added 1 - assigned Issues that are assigned to a sprint and a team member. and removed 0 - new New issues that need assignment. labels Jun 4, 2021
@jcfranco
Copy link
Member Author

Started looking into this and based on the info from docs-json.json we can:

  • associate type-matching knobs per attribute
  • use usage.md files to create individual stories

There are two key missing pieces affecting automating stories:

@caripizza @driskull Do you have any suggestions on what we could do for this? Any sort of file requiring manual edits defeats the purpose, IMO.

@driskull
Copy link
Member

For the range issue, I think we can avoid interfaces for now until the bug is fixed.

knowing which knobs to show for each story from usage examples. We have some stories that exclude or hardcode attributes based the use case.

The only way I can think of doing this is with another JSON (basic.md.json?) file where we can specify which knobs should be excluded for the usage example. Then we could access that data using custom docs generation. https://stenciljs.com/docs/docs-custom and build the storybook files?

Unless we can have some kind of markdown comment or code where we can specify that information and strip it out?

@driskull
Copy link
Member

If we just need to specify knobs per component, then maybe custom jsdoc tags could work? https://stenciljs.com/docs/docs-json#custom-jsdocs-tags

@jcfranco
Copy link
Member Author

For the range issue, I think we can avoid interfaces for now until the bug is fixed.

Inlining would certainly help. I also forgot to mention that default values coming from a module would also need to be inlined. I know it's small, but I'd rather avoid doing so since we do use that pattern often. I'll see if I can do this w/o explicitly inlining interfaces/types/default values.

The only way I can think of doing this is with another JSON (basic.md.json?) file where we can specify which knobs should be excluded for the usage example.

I like the idea of having special markers in the usage files. It would keep knob info close to the story source.

@driskull
Copy link
Member

I like the idea of having special markers in the usage files. It would keep knob info close to the story source.

Yeah, we can have a HTML comment that won't be rendered with some kind of parsable formatting.

@jcfranco jcfranco removed their assignment Jun 30, 2022
@jcfranco jcfranco added 0 - new New issues that need assignment. and removed 1 - assigned Issues that are assigned to a sprint and a team member. labels Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - new New issues that need assignment. research Issues that require more in-depth research or multiple team members to resolve or make decision.
Projects
None yet
Development

No branches or pull requests

3 participants