mifi / instauto

Instagram bot / automation library written in Javascript for Node.js
799 stars 145 forks source link

Typescript support + Db adapter support #71

Closed adrien2p closed 2 years ago

adrien2p commented 2 years ago
adrien2p commented 2 years ago

@mifi will you be able to review my pr please ?

adrien2p commented 2 years ago

there is also an update of the dependencies I'll let you check

adrien2p commented 2 years ago

@mifi when do you think you'll be available ?

mifi commented 2 years ago

Hi! Thanks for your PR. That's a lot of changes!

I'm not very experienced with typescript, and I use this codebase in other projects like https://github.com/mifi/SimpleInstaBot and I like the idea of just being able to run or use js code directly in node/electron without having to transpile it first. So because I have to maintain this code I don't think I'm ready to rewrite it to typescript as of now. However I'm open to adding typescript bindings (separate d.ts files), or adding JSDoc typescript comments above important functions and interfaces to make instauto easier to use. If you know a way to easily convert your PR's typescript changes into either one of these, then I'm happy to merge that.

Also I'm open for add support for db adapters, but I would like that feature to be a separate PR, so it's easier for me to review the changes.

adrien2p commented 2 years ago

@mifi I can understand. But when the lib is transpiled and then pushed to npm, when you will download it in your project it stays just javascript files so its not a good argument for me. The only TS files will be there. Otherwise if thats not a problem for you, can I make my own lib using this ?

adrien2p commented 2 years ago

I also made my own bot, which is an advanced bot

mifi commented 2 years ago

Yes I understand it's automatic on publish. It's just that I often do testing locally where I modify the js code with with puppeteer as well as in electron, and in such case i would have to transpile the ts every time, and the other problem is that I'm not fluent in typescript so I would struggle more with all the syntax when i need to make some simple changes, and if I need to debug, I'd have to do that on transpiled code, so I'd prefer external d.ts types. If node and electron supported ts out of the box, then I would be happy to transition to pure ts files :)

adrien2p commented 2 years ago

The same, for testing you can also debug code directly into your ts file (thanks to the map file). I think it's really that you dont have the knowledge on that tech. Not a problem. I've created my own package based on this one with lot of new features support ;)