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

[Bug] JSDoc prop descriptions aren't added to autodocs #122

Closed
Masstronaut opened this issue Aug 16, 2023 · 1 comment
Closed

[Bug] JSDoc prop descriptions aren't added to autodocs #122

Masstronaut opened this issue Aug 16, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@Masstronaut
Copy link

Masstronaut commented Aug 16, 2023

Describe the bug

Svelte component props documented with the officially recommended method - JSDoc comments - don't have their description added to the autodocs. Example:

<script lang="ts">
	// Alert.svelte
	/** 
	 * The variant sets the styling of the alert.
	 * Use `Alert` variants to provide additional context to the user about the alert information. */
	export let variant: AlertVariant | undefined = undefined;
</script>

Elsewhere in VSCode - including in *.stories.svelte files - this comment shows up as a tooltip for the variant prop of the Alert component. You can see in this screenshot that hovering over variant on an Alert component causes the tooltip and description to appear:

image

However, in my autodocs for the Alert component, the description for the variant prop is not present:

image

Steps to reproduce the behavior

  1. Create a svelte component with a prop that has a JSDoc comment describing it
  2. enable autodocs globally for the project since it can't be specified on a per-component level with svelte-csf (See [Bug] Can't set tags on <Meta> component to enable fine-grained autodocs #87 )
  3. create a svelte CSF story for the component
  4. run storybook and look at the generated autodocs for it. Note that the prop documentation is not present.

Expected behavior

Prop comments should be included in the appropriate place in autodocs

Screenshots and/or logs

See screenshots above

Environment

  • OS: Mac OS
  • Node.js version: v20.5.0
  • NPM version: 9.8.0
  • Browser (if applicable): n/a
  • Browser version (if applicable): n/a
  • Device (if applicable): n/a

Additional context

Add any other context about the problem here.

@Masstronaut Masstronaut added the bug Something isn't working label Aug 16, 2023
@Masstronaut Masstronaut changed the title [Bug] Prop descriptions [Bug] Prop descriptions aren't added to autodocs Aug 16, 2023
@Masstronaut Masstronaut changed the title [Bug] Prop descriptions aren't added to autodocs [Bug] JSDoc prop descriptions aren't added to autodocs Aug 16, 2023
@JReinhold
Copy link
Collaborator

This is unrelated to this addon, but actually a problem in Storybook's doc parsing not supporting TypeScript. Check out storybookjs/storybook#15891 which describes why and a potential workaround.

Closing in favor of storybookjs/storybook#15891

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants