Ruby has types through RBS or Sorbet. What's the best way to autogenerate/sync Typescript Types with Ruby Types?
The pain point that I am trying to solve is avoiding bugs caused by misalignments between Front-End (Typescript) and Back-End (Ruby) types.
The ideal workflow is something like this (but does not have to be exactly the same):
- I write Ruby back-end code with types.
- I run a command to generate corresponding Typescript Types.
- I write Typescript front-end code with these generated types.
Note: I'm looking for a solution that is easy to apply to a non-Rails application.
The best that I could find is this https://github.com/mugi-uno/rbs2ts. What are other alternative solutions?