svelte-material-ui icon indicating copy to clipboard operation
svelte-material-ui copied to clipboard

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

Open DetachHead opened this issue 2 years ago • 6 comments

fixes #532

DetachHead avatar Nov 04 '22 08:11 DetachHead

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".

hperrin avatar Nov 22 '22 00:11 hperrin

@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.

DetachHead avatar Nov 22 '22 01:11 DetachHead

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

hperrin avatar Nov 22 '22 01:11 hperrin

@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 avatar Nov 22 '22 08:11 DetachHead

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

DetachHead avatar Nov 23 '22 02:11 DetachHead

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.

hperrin avatar Apr 03 '23 20:04 hperrin