smhg / gettext-parser

Parse and compile gettext po and mo files, nothing more, nothing less
MIT License
158 stars 43 forks source link

Typescript update #80

Closed erikyo closed 2 months ago

erikyo commented 3 months ago

Hey everyone,

I wanted to share a project I've been working on – a module designed to handle strings gathered by the parser, which incidentally was also developed by me. The purpose is to consolidate these strings into a cohesive 'set of blocks,' a process facilitated by your module.

I've found your module to be incredibly useful in my workflow, but I have a small suggestion for improvement. I think it would be fantastic if it were implemented in TypeScript, with the types directly provided within the npm module, similar to how it's done in gettext-merger here.

Adding TypeScript support and providing types within the npm package would greatly enhance its usability and compatibility with modern development practices. if some form of support or help is required I am here, I volunteer 😀

Looking forward to your thoughts on this!

ps I read an issue about 'comments', I think he was referring to the comments of the individual translation block and the fact that it is not optional not the fact that he wanted it removed

smhg commented 3 months ago

Thank you @erikyo. And sorry about the late reply. I can barely read TypeScript so I'm not the right person to ask. However, I think it would be great if this project had more contributors. Would you be able to create a PR with the absolute minimum necessary? We can then look how we proceed from that point onwards?

My only worry is TypeScript raised the bar for contributions (incl. myself). But if you can provide a proof of concept, I'd be very happy to consider it. Or you think adding types in an external repo is an workable option?

erikyo commented 3 months ago

Yes, of course, I'll try to create a bare minimum PR as soon as possible with just what's necessary to use TypeScript instead of JavaScript 🎉.

Regarding the complexity, it's true that TypeScript might be slightly more "complex" than JavaScript, but it's a step that can be tackled in a short amount of time, and imho the benefits are significant, especially for these kind of repositories/modules.

Adding types externally can help those who will use the repository, but it doesn't provide all the advantages of using proper TypeScript (e.g. type checking). In that case i would prefer this way in order to allow the ts checks/types with javascript files.

smhg commented 3 months ago

I fully support a JSDoc sollution if possible. Would you be ok to create a PR that way?

erikyo commented 2 months ago

superseded by #82