brittneypostma / storybook-sveltekit

storybook running in sveltekit
16 stars 5 forks source link

Thank you Thank you Thank you #1

Closed orefalo closed 2 years ago

orefalo commented 2 years ago

At last.. after hours of fishing and testing a recent, up to date repo that works plus a video and an article! love it! thank you so much.

Now... would you have any recommendation to enable ts ? I have it working for "dev", but not for the "storybook" target.

brittneypostma commented 2 years ago

Oh wow, glad it helped. I have very little ts experience and none specifically in SvelteKit unfortunately. I do have ts working in a CRA with storybook at work that might help. It seemed the issues with SvelteKit were stemming from the community Vite builder.

orefalo commented 2 years ago

Would gladly take some tips to make it work. my personal project is failing on

ERROR in ./src/lib/components/buttons/Button.svelte
Module build failed (from ./node_modules/svelte-loader/index.js):
Error: ParseError: Unexpected token (2:8)
1: <script context="module" lang="ts">
2:   export type ButtonSize = "xs" | "sm" | "ba" | "lg" | "xl"
            ^
3:   export type ButtonShape = "square" | "circle"
4:   export type ButtonType = "primary" | "secondary" | "disabled" | "warning"
    at /Users/orefalo/GitRepositories/SnapCore/snapcore-designer2/node_modules/svelte-loader/index.js:86:12
 @ ./src/lib/components/buttons/Button.stories.svelte 21:0-37 33:14-20 88:15-21
 @ ./src sync ^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(js|jsx|ts|tsx|svelte))$
 @ ./generated-stories-entry.js
 @ multi ./node_modules/@storybook/core-client/dist/esm/globals/polyfills.js ./node_modules/@storybook/core-client/dist/esm/globals/globals.js (webpack)-hot-middleware/client.js?reload=true&quiet=false&noInfo=undefined ./storybook-init-framework-entry.js ./node_modules/@storybook/addon-docs/dist/esm/frameworks/common/config.js-generated-config-entry.js ./node_modules/@storybook/addon-docs/dist/esm

and I am pulling my hairs.

surprisingly 'yarn dev' works fine

orefalo commented 2 years ago

looks like it's an issue with typescript+sveltekit+storybook