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

CSF-tools: Turn story comments into docs descriptions #19684

Merged
merged 9 commits into from
Nov 1, 2022

Conversation

shilman
Copy link
Member

@shilman shilman commented Oct 29, 2022

Issue: #8527

Credit to @izhan for paving the way https://github.com/izhan/storybook-description-loader

What I did

Telescopes off #19680

  • Parse out comments that start with /** and add them as docs.description.story parameters
  • Made it a loader so that it receives the original file with comments
  • Preserve user indentation
  • Added plugin options
  • Correctly merge generated parameters with user parameters
  • Made it async for performance

How to test

  • CI passes
  • Test it out in ui storybook or CRA sandbox

IssueHunt Summary

Referenced issues

This pull request has been submitted to:


code/lib/csf-tools/src/enrichCsf.ts Outdated Show resolved Hide resolved
code/lib/csf-tools/src/enrichCsf.ts Outdated Show resolved Hide resolved
@shilman shilman changed the title CSF-tools: Turn story comments into docs descriptions WIP CSF-tools: Turn story comments into docs descriptions Oct 31, 2022
@shilman shilman marked this pull request as ready for review October 31, 2022 16:32
Copy link
Member

@tmeasday tmeasday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

code/lib/csf-tools/src/enrichCsf.ts Outdated Show resolved Hide resolved
@shilman shilman merged commit 75f1cb6 into shilman/csf-plugin Nov 1, 2022
@shilman shilman deleted the shilman/csf-plugin-docgen-description branch November 1, 2022 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants