storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
83.99k stars 9.23k forks source link

Auto generate doc table using typescript from svelte components #16609

Open 01oseluiz opened 2 years ago

01oseluiz commented 2 years ago

Is your feature request related to a problem? Please describe The docs don't get types directly from typescript. I have to describe my variables/functions with typescript, but have to describe again with docstring.

Describe the solution you'd like I would like that docs addon could infer types from docstring and typescript too

Describe alternatives you've considered

Are you able to assist to bring the feature to reality? Maybe. I was looking at the code, and seams that the lib used for the storybook sveltedoc-parser doesn't have support for analyze typescript: https://github.com/alexprey/sveltedoc-parser/issues/34

Additional context An example:

  1. Create an app with svelte and TS, and add storybook
  2. Add the code bellow to the main.js
    svelteOptions: {
    preprocess: sveltePreprocess(),
    },
  3. If we change the Button.svelte (and setting the script lang to 'ts'): image
  4. This generate the following doc table: image
  5. But if we change the Button.svelte to have docstring: image
  6. This is generated: image
alexprey commented 2 years ago

Working on typescript support in sveltedoc-parser package

stale[bot] commented 2 years ago

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

gzimbron commented 2 years ago

I have the same problem, did you found a solution?