mu-semtech / mu-javascript-template

Template for running javascript/express microservices
4 stars 17 forks source link

Second-class TypeScript and CoffeeScript support #37

Closed madnificent closed 2 years ago

madnificent commented 2 years ago

This PR would allow us to run typescript and coffeescript with the mu-javascript-template.

If we would go through with this, I would strongly suggest to keep these second-class citizens. They have a good shot of changing and fading more rapidly than JavaScript itself and we should feel comfortable removing them as we add more features. That being said, it could be nice to experiment and use in practice if the builds work.

It is not clear if these should effectively go in their own template instead. I assumed it would be cheaper to maintain them in one repository.

Why not PureScript, you ask? Because I only know a bit of that in theory and I couldn't blindly add it to the mix.

The current state is not complete. It only runs in development mode using the .coffee and .ts extensions. You should be able to mix both but I would also consider such thing undefined behaviour.

elpoelma commented 2 years ago

When the sources include a tsconfig.json file, the run-development.sh runs the typescript compiler. Note that the tsconfig file should include the 'noEmit' option as babel still runs the transpilation itself.

elpoelma commented 2 years ago

When running the microservice in production, it now allows for coffeescript files.