-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Storybook support #5397
Comments
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. |
I think rather than creating a new Svelte adder it may make more sense to fix |
For sb init, you have |
I somehow had an empty |
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. |
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. |
The svelte language tools probably contain all that's needed to extract the documentation, given that it works in vscode: |
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 |
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? |
Storybook 7 will have SvelteKit support: |
I just submitted a PR to introduce an approach using svelte2tsx and TypeScript. |
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
peerDependency
on@types/react
intuit/design-systems-cli#701svelte-loader
optional storybookjs/addon-svelte-csf#62.storybook
toserver.fs.allow
storybookjs/builder-vite#427svelte.config.js
storybookjs/builder-vite#428peerDependencies
storybookjs/builder-vite#445svelte-loader
optional dependency storybookjs/storybook#18645npx sb init
viteFinal
to match michaelwooley/storybook-experimental-vite when SvelteKit is presentAlternatives considered
No response
Importance
nice to have
Additional Information
No response
The text was updated successfully, but these errors were encountered: