GoogleFeud / ts-runtime-checks

A typescript transformer that automatically generates validation code from your types.
https://googlefeud.github.io/ts-runtime-checks/
MIT License
312 stars 7 forks source link

Typescript 5 support #13

Closed FredTreg closed 1 year ago

FredTreg commented 1 year ago

Upgraded to TypeScript 5.1 and fixed corresponding compiling issues.

There were issues with ts.Expression vs ts.Node. I fixed as I could but could not help a as ts.Expression which I do not fully understand.

I used ts-patch for testing as it is the current drop-in replacement for ttypescript which does not support TS 5. See https://github.com/nonara/ts-patch/issues/93#issuecomment-1500795063 for more context

I have not added code to support TS 5 decorators, so I guess they will not work.

GoogleFeud commented 1 year ago

Hello, thank you so much for the pull request. I'm currently working on the next version of this library over at the dev branch, if you could do this in the dev branch that would be awesome! Also, we'll have to update the typescript version of the playground as well.

Thanks!

FredTreg commented 1 year ago

I'll send several PRs on dev then. Typescript 5 support was just prep work for the real PR I'm interested in: null vs undefined support. I'm currently using my own fork of your project but I hope what I did can be reintegrated into your project.