ftp-deploy icon indicating copy to clipboard operation
ftp-deploy copied to clipboard

Using TypeScript or create types

Open cyrdam opened this issue 3 years ago • 9 comments

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

cyrdam avatar Oct 18 '21 11:10 cyrdam

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)

simonh1000 avatar Oct 18 '21 13:10 simonh1000

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.

cyrdam avatar Oct 22 '21 10:10 cyrdam

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

shekharkhedekar avatar Apr 25 '22 18:04 shekharkhedekar

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: @.***>

simonh1000 avatar Apr 25 '22 19:04 simonh1000

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 avatar Apr 25 '22 20:04 shekharkhedekar

@simonh1000 please add me as a collaborator on this repo

shekharkhedekar avatar Apr 26 '22 03:04 shekharkhedekar

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

simonh1000 avatar May 13 '23 08:05 simonh1000

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 avatar May 23 '23 20:05 cyrdam

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.

cyrdam avatar Sep 10 '23 21:09 cyrdam