svelte-dark-mode icon indicating copy to clipboard operation
svelte-dark-mode copied to clipboard

Convert project to TypeScript and use `svelte-kit package` to package library

Open metonym opened this issue 3 years ago • 4 comments

With unit tests in place, we can more confidently refactor the code to TypeScript. In addition to greater type safety, this would conserve the manual effort of syncing type definitions.

SvelteKit package is probably the best option to do this.

metonym avatar Jun 19 '22 19:06 metonym

I would also love to see this available in SvelteKit. Thanks!

MatousAc avatar Dec 27 '22 06:12 MatousAc

@MatousAc Does this library not work for you in SvelteKit?

metonym avatar Dec 27 '22 18:12 metonym

Hmm, I'm honestly kinda new to Svelte. But I guess maybe the problem wasn't that I was using sveltekit, but that I was trying your example in TypeScript rather than JavaScript. I'll try that out now that I have reconsidered the problem.

MatousAc avatar Dec 28 '22 02:12 MatousAc

I'm pretty sure that the problem is that I am using a custom-typed (TS) svelte store for my theme variable. That just doesn't seem to be compatible with this library. Kinda makes sense. At this point, I'm doing most of it myself anyways, so I might as well detect the user's OS preferences too.

MatousAc avatar Dec 28 '22 04:12 MatousAc