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

Auto generate doc table using typescript from svelte components #16609

Open
01oseluiz opened this issue Nov 5, 2021 · 3 comments
Open

Auto generate doc table using typescript from svelte components #16609

01oseluiz opened this issue Nov 5, 2021 · 3 comments

Comments

@01oseluiz
Copy link

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: alexprey/sveltedoc-parser#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(),
  },
  1. If we change the Button.svelte (and setting the script lang to 'ts'):
    image
  2. This generate the following doc table:
    image
  3. But if we change the Button.svelte to have docstring:
    image
  4. This is generated:
    image
@alexprey
Copy link

alexprey commented Dec 17, 2021

Working on typescript support in sveltedoc-parser package

@stale
Copy link

stale bot commented Jan 9, 2022

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!

@stale stale bot added the inactive label Jan 9, 2022
@gzimbron
Copy link

gzimbron commented Mar 3, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants