jimmywarting / native-file-system-adapter

File system, based on the spec reference implementation
https://jimmywarting.github.io/native-file-system-adapter/example/test.html
MIT License
481 stars 43 forks source link

npm, typescript #1

Closed PaulTime closed 4 years ago

PaulTime commented 4 years ago

Hello, do you have any plans on publish this lib to npm and add some typescript support?😊 thanks a lot!

jimmywarting commented 4 years ago

Probably will add it to npm Still wonder about GitHub package manager if i can maybe add it there instead. NPM feels retired now..? I also have some code changes i would like to change first

Code splitting being more a popular option i feel like a CDN is a better option. WebPack sometimes feels unnecessary now when both browser and deno can import stuff from url. But can understand if someone wants to bundle stuff also

I want my code to be written in pure js so import works in the browser too. So jsdoc have to do. Still willing to accept a .d.ts file or some sort of auto generation from jsdoc doe

jimmywarting commented 4 years ago

I'm not a huge fan of typescript

PaulTime commented 4 years ago

I think It's ok to add types to DefinitelyTyped repo or just add a .d.ts file.

jimmywarting commented 4 years ago

I have released 0.1.0 to npm now. i have also changed the api a bit since the spec have also changed

chooseFileSystem have been split up to tre functions instead. mainly

And getting access to the sandboxed filesystem was changed from FileSystemDirectoryHandle.getSystemDirectory to getOriginPrivateDirectory it's more dynamic now in a way that you can hook in your own memory, dropbox or google drive now by using: getOriginPrivateDirectory(adapter)

jimmywarting commented 4 years ago

Still lurking into typing, not so good at typescript - i'm more of a buildless type of guy that loves working with vanilla js and uses jsdoc instead. but from my understanding it should be possible to generate some type definitions from comments...

might need some help with typing if you want to see it being added.

PaulTime commented 4 years ago

Yes, thanks a lot! I just tried it installed in my project but there is a problem with web-stream-polyfill as its been fetched via url so webpack cant resolve it . Maybe we could add web-stream-polyfill as dependency, but there could be a problem with your style of imports, so maybe we could support both import styles what do you think? or just it would be better(simpler?) to just replace it with node import?

PaulTime commented 4 years ago

Also I discovered that you forgot to mention "types" filed in package.json for ts compiler. Because for now I see that there is a d.ts file but my compiler just can't reach to that file