svelecte
svelecte copied to clipboard
Intellisense fails when importing directly from 'svelecte'
when i import it like this:
<script lang="ts">
import Svelecte from 'svelecte';
</script>
i dont have any intellisense when defining the props of the component
However, if i import it like this:
<script lang="ts">
import Svelecte from 'svelecte/src/Svelecte.svelte';
</script>
i have the intellisense.
is it possible to provide the intellisense when doing the first import? im sure it is more convenient to import the component directly from svelecte
instead of svelecte/src/...
Also, isnt it possible to add some declaration files? i think there are some scripts that create them automatically based on the svelte component (such as this one)
I have no experience with TypeScript, so if you can, prepare PR. I will hapilly merge it.
hi, thanks for responding back! actually, i think that before doing the typescript thing, the issue of the import path should be solved first.
i've looked onto some other svelte component repos, such as svelte-select and sveltestrap, and i think this happens in your component because of the location and content of your index.js
file.
on both of the repos i mentioned, it is are under the src/
directory, not the root directory. Also, on their index.js
files, they only export the component(s), and nothing else (sveltestrap, svelte-select).
i'm not sure if i am able to help solving this, cause i have no knowledge at all on building components
Okay that will be easy to fix, will take a look at it tomorrow
thanks so much! once thats done, ill open another issue on typescript support and i might be able to help with it!
also, consider moving component.js
and item.js
to src/
Had problems with these, when testing it. The easiest solution would be to migrate whole package to svelte/kit (#49). But that's out of my time budget for now.
I am also having an issue that has to do with this, I guess.
Do you already have a rough approximation of the time, when the milestone v4.0 could be finished?
Do you already have a rough approximation of the time, when the milestone v4.0 could be finished?
Can't promise you anything. I though I should be able to finish it by the end of the 2023. It's hard to find some time for it lately.
Should be fixed in v4, due the moving to sveltekit, which should generate all types properly