Skip to content

Storybook support #5397

Closed

Description

@benmccann

Describe the problem

Storybook mostly works now, but there's still some things that can be cleaned up. Opening this as a tracking issue for the various pending PRs

Describe the proposed solution

Alternatives considered

No response

Importance

nice to have

Additional Information

No response

Activity

  1. GauBen commented on Jul 6, 2022

    @GauBen
    Contributor

    I ran into this very issue this morning, and after a bit of trial and error, I managed to have a working configuration: windicss/windicss#267 (comment)

    I'll try to contribute to svelte-add.

  2. benmccann commented on Jul 6, 2022

    @benmccann
    MemberAuthor

    I think rather than creating a new Svelte adder it may make more sense to fix npx sb init, which does the same thing

  3. IanVS commented on Jul 7, 2022

    @IanVS

    For sb init, you have remove need for yarn. There is some logic to detect the package manager in use based on the lockfile, but I've seen it fail sometimes and try to use yarn in npm projects. It can be forced using --use-npm, but there's no --use-pnpm.

  4. benmccann commented on Jul 7, 2022

    @benmccann
    MemberAuthor

    I somehow had an empty yarn.lock file in my home directory that the generator was picking up on. I removed that and it's working now

  5. benbender commented on Jul 16, 2022

    @benbender

    Thanks for this combined effort! 🎉

    The last missing piece, after all those changes have landed, will be some kind of docgen-extraction for ts-types inside of svelte-components, right?

    The different storybook-svelte-packages (and more) are using https://github.com/alexprey/sveltedoc-parser which seems quite dead atm and, sadly, never finished support of doc-extraction of ts-components. Last time I checked there wasn't any complete/working solution for this problem.

    That's not really specific for storybook, but more a lack in the svelte-ecosystem.
    Any plans to tackle that too?

  6. IanVS commented on Jul 21, 2022

    @IanVS

    I wonder if some of https://github.com/styleguidist/react-docgen-typescript could be used as a starting point / reference to add sveltedoc-parser typescript support. There was already some work in KatChaotic/sveltedoc-parser@dev...typescript-support, I hope someone will be willing to fork the project and continue working on adding support. It seems like it would benefit much of the ecosystem.

  7. GauBen commented on Jul 21, 2022

    @GauBen
    Contributor

    The svelte language tools probably contain all that's needed to extract the documentation, given that it works in vscode:

    image

    image

  8. dummdidumm commented on Jul 21, 2022

    @dummdidumm
    Member

    Yes and no - we rely on typescript to show all of this, not sure how we could intercept this cleverly to get what we want. However, we indeed have some kind of extraction going on, which could be reused to achieve this. svelte2tsx is the package where it would be implemented

  9. IanVS commented on Jul 21, 2022

    @IanVS

    I mentioned svelte2tsx in the sveltedoc-parser typescript issue a while back, with no response. @dummdidumm what do you envision would need to be done to achieve docgen from svelte typescript?

  10. added this to the whenever milestone on Oct 12, 2022
  11. benmccann commented on Dec 13, 2022

    @benmccann
    MemberAuthor
  12. ciscorn commented on Jul 9, 2024

    @ciscorn

    I just submitted a PR to introduce an approach using svelte2tsx and TypeScript.
    storybookjs/storybook#28492

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions