thecodejack / svelte-file-dropzone

Svelte component for fileupload
https://svelte-file-dropzone.netlify.app/
252 stars 45 forks source link

Arackis/properly package #127

Closed arackaf closed 1 year ago

arackaf commented 1 year ago

This PR updates your pre-publish script to use svelte-package, as documented here, which generates TypeScript types. I've updated your package.json to use "exports" and added the needed "typesVersions" magic as described here

With this change, you can import the Dropzone component like this

import Dropzone from "svelte-file-dropzone/Dropzone.svelte";

which plays well with TypeScript. Also, I believe this library previously used Rollup to compile the Svelte away, which I'm pretty sure is heavily discouraged, ie in case your end user is using a different version of svelte than that which you used to compile it.

If you'd like to test what this looks like, it's deployed to this library.

https://www.npmjs.com/package/arackaf-svelte-file-dropzone

I left your rollup build script in place since I think it might be needed for your Storybook? In any event, SvelteKit might be a simpler way to demo the project (see the library template it generates for more info).

Lastly, my previous PR is incorporated into this one

https://github.com/thecodejack/svelte-file-dropzone/pull/126

arackaf commented 1 year ago

Also just fyi if you've moved on from this project I'd be happy to keep working on it as a collaborator: get rid of the old build stuff, move storybook to SvelteKit, look at old PRs, etc

thecodejack commented 1 year ago

Hi @arackaf Thanks for PR. I will add you as maintainer over weekend. Thanks :)

thecodejack commented 1 year ago

Hi @arackaf

I have invited you to maintain package in both github & npm. Please help in the maintenance. Thanks.

arackaf commented 1 year ago

Awesome!!!

arackaf commented 1 year ago

I see the GitHub invite, but not npm. Did you send it to arackaf ?

thecodejack commented 1 year ago

yes.

image
arackaf commented 1 year ago

got it sorry about that - npm is bad about showing pending invites - got it from email though

arackaf commented 1 year ago

@thecodejack I got the PR released. I couldn't keep the prior top-level default import working, so I pushed out a 2.0 release, with release notes that the only breaking change is the import to use to get the dropzone component.

I'm gonna work on getting a storybook upgrade PR up soon ...

thecodejack commented 1 year ago

Thanks @arackaf . I will try to be proactive from mid of April if need any help on this.