rbi icon indicating copy to clipboard operation
rbi copied to clipboard

Produce `.rbs` files from `.rbi` files

Open rattrayalex opened this issue 3 years ago • 0 comments

(Moving from https://github.com/Shopify/rbs_parser/issues/19)

It would be nice for a tool to exist that could translate Sorbet's .rbi files into best-effort .rbs files.

An example use-case is a gem author who wishes to develop with Sorbet and expose .rbs files as well as .rbi to their users.

In general, this could be quite useful in moving the Ruby community forward together around types, by leveraging existing production-grade tools (Sorbet) to support the long-term health of the ecosystem.

According to @Morriar , an easy way to do this might be write a new printer that would output RBS rather than RBI.

Is this a tool you might be willing to build, or to build the underlying API for?

(I might be willing to produce an rbs2rbi CLI package on top of the the API if you like, but I don't think I'd be able to maintain the printer).

Thanks!

rattrayalex avatar May 30 '22 17:05 rattrayalex