hperrin / svelte-material-ui

Svelte Material UI Components
https://sveltematerialui.com/
Apache License 2.0
3.31k stars 285 forks source link

fix `typesVersions` pointing to source code instead of declaration files #533

Open DetachHead opened 1 year ago

DetachHead commented 1 year ago

fixes #532

hperrin commented 1 year ago

Unfortunately, this wouldn't work, because of how the types are stripped. The ".d.ts" files just point to the svelte files, which are stripped in "dist".

DetachHead commented 1 year ago

@hperrin perhaps we could use @sveltejs/package instead? it strips types and creates a seperate .svelte.d.ts file as well (i believe using the preprocess property in svelte.config.js), which i think would solve the problem.

hperrin commented 1 year ago

Yeah, I'm definitely open to implementing a better solution.

DetachHead commented 1 year ago

@hperrin i'm in the process of converting all the packages to use svelte-package but i'm running into some strange type errors on the site package: https://github.com/DetachHead/svelte-material-ui/actions/runs/3520533501/jobs/5901535004

would you happen to have any ideas as to what's causing it?

DetachHead commented 1 year ago

i've successfully switched to svelte-package, you can test it out by installing the packages i published on my fork https://github.com/DetachHead/svelte-material-ui/actions/runs/3528249711/jobs/5918149377

note that i moved the sources from src to src/lib and the output from dist to package to match the default directories used by svelte-package.

i'm still not sure what causes those type errors in the site package, but all the packages i'm using in my own project seem to work

hperrin commented 1 year ago

I'm going to save this for SMUI v8, but I would like to implement this solution. I'm also wondering how svelte-package is making the .svelte.d.ts files.