1

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):

  1. I write Ruby back-end code with types.
  2. I run a command to generate corresponding Typescript Types.
  3. 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?

Aga
  • 11
  • 1

0 Answers0