-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
Svelte support #86
Comments
We've just released a major change to SvelteKit with the goal of better supporting tools in the Vite ecosystem like Histoire, Storybook, and Vitest by requiring users to have a |
Would love to see this come to life! Svelte ecosystem desperately needs a way to demo components I created an issue over at @babichjacob 's |
Are there any instructions on how svelte support can be added to histoire? |
Now that #87 is done, I can work on adding support for more frameworks :) |
Do we have an eta on this? I would love to help however I can. Would love to start working with Histoire on svelte projects! |
I'm currently writing the code necessary to handle multiple frameworks and bed testing it with Vue 2.7 |
Great. let us know when you need some beta testing 😉 |
It's coming together 3357c46 |
Vue 2.7 support is pushed, meaning Histoire now fully supports multiple frameworks! |
Unresolved question is the builtin tailwind plugin that generates a |
@babichjacob is one of the maintainers of svelte-add tailwind .. he might have some ideas on this |
@Akryum did you check out unocss + preset-wind as a replacement for tailwind? It understands tailwinds css but doesn't require extra setup for postcss and supports vue, svelte and others out of the box. |
@dominikg I'm not sure it's related to adding Svelte support, you are free to use any CSS framework you want in your Histoire project. |
@oneezy The unresolved question I mentionned is about the auto-generated story for Tailwind design tokens such as this which is using Vue 3 story syntax.
Potential solutions I see:
|
Sounded like you were looking for a way to support tailwind in multiple formats, but if it is 'just' about adding a default story if the project already has a tailwind setup that's not needed.
It is effort, but could be provided via separate packages and possibly by third parties
That would be a lot of extra for an optional feature and the end result would be very different. Projects that otherwise do not depend on vue don't need the extra weight just for a tailwind preview
Yes, a vanilla js + html story could work All things considered i'd see this generated tailwind story as an optional feature only suitable for some projects that use tailwind. Depending on the actual config / implementation, the generated story could as well be useless as the project doesn't work that way. So if this thing is the only blocker for svelte support i'd vote for disabling it and release it without a generated tailwind story. |
The dependency is already there for the main Histoire UI |
The tailwind plugin no longer rely on |
that's awesome @Akryum ! Going to give this a test run when I have some time |
just tried to give it a go and ran into this
$ pnpm story:dev
> [email protected] story:dev C:\Users\oneezy\Desktop\www\7.Testing\histoire\examples\svelte3
> histoire dev
node:internal/errors:464
ErrorCaptureStackTrace(err);
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'C:\Users\oneezy\Desktop\www\7.Testing\histoire\packages\histoire\dist\node\bin.js' imported from C:\Users\oneezy\Desktop\www\7.Testing\histoire\packages\histoire\bin.mjs
at new NodeError (node:internal/errors:371:5)
at finalizeResolution (node:internal/modules/esm/resolve:416:11)
at moduleResolve (node:internal/modules/esm/resolve:932:10)
at defaultResolve (node:internal/modules/esm/resolve:1044:11)
at ESMLoader.resolve (node:internal/modules/esm/loader:422:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:222:40)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
at link (node:internal/modules/esm/module_job:75:36) {
code: 'ERR_MODULE_NOT_FOUND'
}
- ELIFECYCLE Command failed with exit code 1. |
You need to build the repo first, see the contributing guide |
Well, it's trying but my setup
packages/histoire-plugin-svelte build$ rimraf dist && vite build && pnpm run build:types
│ vite v3.0.5 building for production...
│ ✓ 0 modules transformed.
│ Entry module cannot be external (src/client/index.ts).
│ error during build:
│ Error: Entry module cannot be external (src/client/index.ts).
│ at error (file:///C:/Users/oneezy/Desktop/www/7.Testing/histoire/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared
│ at ModuleLoader.loadEntryModule (file:///C:/Users/oneezy/Desktop/www/7.Testing/histoire/node_modules/.pnpm/[email protected]/node_module
│ at async Promise.all (index 0)
└─ Failed in 1s |
Explains it all 😅 |
Should be fixed on the branch |
Went ahead and made a demo repo for anyone who wants to try histoire + svelte https://github.com/oneezy/histoire-svelte Note: I forced it to only install |
made one too https://github.com/sw-yx/sveltekit-monorepo - with monorepo |
yo @sw-yx ! Give it a spin if you like, |
No description provided.
The text was updated successfully, but these errors were encountered: