mikuso / ocpp-rpc

A Node.js client & server implementation of the WAMP-like RPC-over-websocket system defined in the OCPP-J protocols.
MIT License
94 stars 28 forks source link

Introduce typescript #68

Open pschoffer opened 9 months ago

pschoffer commented 9 months ago

@mikuso, what do you think of this approach to converting to typescript?

As long as we adjust the packaging logic, we can only convert file by file as we go. So I only converted few basic classes to have some type help and my typescript compiler didn't complain.

I also tweaked the mocha tests to be happy with mix of js and ts files and they all seem to be passing.

I think the biggest advantage is that it can be done very incrementally and also not all files need to be converted in the end.

pschoffer commented 9 months ago

I didn't spend the time figuring out the packaging and publishing flow. Most likely there will be extra work needed there to also extract type files from the ts sources along the js outputs. But I am happy to do that if you think we should go forward on this one.