simonh1000 / ftp-deploy

Bulk upload to FTP server
Other
289 stars 61 forks source link

Using TypeScript or create types #136

Open cyrdam opened 3 years ago

cyrdam commented 3 years ago

Hi, would it be possible to use this within TypeScript projects with good type support? (Directly within the repo or added to DefinitelyTyped)

simonh1000 commented 3 years ago

I'm a fan of TypeScript but dont know when or if I'll get round to using it (and adding a compiled version for js users)

cyrdam commented 3 years ago

On a short look into it I already found issues within the code and also issues with old dependencies. This would do more than just refactor it to TypeScript.

I could try to do it, but am short on time. Maybe someone else might do it within that time would be great.

shekharkhedekar commented 2 years ago

I’d like to take this on. I’ll put up a pull request for this.

simonh1000 commented 2 years ago

that works be great can I suggest that you try not to change the code beyond adding the types. you may well see refactorings and improvements to the algorithm, but review will be easier if the diff is easier to parse

and refactoring is safer anyway once you have the types in place 😃

On Mon, 25 Apr 2022, 20:50 Shekhar Khedekar, @.***> wrote:

I’d like to take this on. I’ll put up a pull request for this.

— Reply to this email directly, view it on GitHub https://github.com/simonh1000/ftp-deploy/issues/136#issuecomment-1108920458, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIDMFGXAYT3ULT6GSMYQVLVG3SPNANCNFSM5GGK3RKA . You are receiving this because you commented.Message ID: @.***>

shekharkhedekar commented 2 years ago

that works be great can I suggest that you try not to change the code beyond adding the types. you may well see refactorings and improvements to the algorithm, but review will be easier if the diff is easier to parse and refactoring is safer anyway once you have the types in place 😃 On Mon, 25 Apr 2022, 20:50 Shekhar Khedekar, @.> wrote: I’d like to take this on. I’ll put up a pull request for this. — Reply to this email directly, view it on GitHub <#136 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIDMFGXAYT3ULT6GSMYQVLVG3SPNANCNFSM5GGK3RKA . You are receiving this because you commented.Message ID: @.>

Great plan. Will keep the pull requests as small/focused as possible.

shekharkhedekar commented 2 years ago

@simonh1000 please add me as a collaborator on this repo

simonh1000 commented 1 year ago

this is making me rethink my interest in typescript https://devclass.com/2023/05/11/typescript-is-not-worth-it-for-developing-libraries-says-svelte-author-as-team-switches-to-javascript-and-jsdoc/

What do others think

cyrdam commented 1 year ago

Using TypeScript can improve the maintainability and reliability of your code. While it may seem like an additional overhead for small projects, the benefits of using TypeScript far outweigh the initial setup effort. With TypeScript, you can catch potential issues early on and prevent them from causing problems down the line.

TypeScript also supports JSDoc, so you can still use normal JS files and have them validated with TypeScript using JSDoc comments. However, TypeScript is much more powerful than JSDoc and offers many more features.

If you’re concerned about being tied to a specific tool, keep in mind that you can always opt-out of using TypeScript and still have simple JS files in the end. The hurdle to switch is not as great as it may seem.

In summary, using TypeScript can help you maintain your code more effectively and prevent issues from arising. It’s a valuable tool that can benefit your project, regardless of its size.

cyrdam commented 1 year ago

A side note: I have found this little bug: #162.

Without a check on this object type it was easy to overlook it. I would welcome some kind of type checking here.