talira

The swiss army knife of RBI generation

open sourceMITself-hostablefree

Tapioca makes Sorbet usable in a real Ruby app by generating RBI files for what Sorbet can't see on its own. tapioca gem writes RBIs for every gem in the Gemfile, importing signatures and documentation from their source, and tapioca annotations pulls hand-written ones from the community rbi-central repository. tapioca dsl loads the app and writes the methods that meta-programming creates (Rails models' columns, associations and scopes, Protobuf, SmartProperties and more), with an interface for writing your own DSL compilers. It also finds unneeded shims, rewrites RBS comments into Sorbet signatures, and checks in CI that the RBIs are up to date. It's pre-1.0, so its interface may still change.

Problems it solves

  • Sorbet says every method from my gems doesn't exist
  • get type signatures for third-party gems so the type checker stops complaining
  • Sorbet can't see the column methods Rails generates on my models
  • the methods ActiveRecord adds at runtime need type definitions
  • fail CI when someone adds a gem or a column and forgets to regenerate the type files
  • write type stubs for my own DSL that defines methods with metaprogramming
  • start adding gradual typing to an existing Rails app
  • share hand-written type signatures for a popular gem with other teams
  • use RBS comment syntax but check it with Sorbet
  • find which constants Sorbet still can't resolve in my codebase

Features

  • RBIs for every gem in the Gemfile
  • signatures and docs imported from gem source
  • community annotations from rbi-central
  • DSL RBIs for Rails, Protobuf, SmartProperties and more
  • custom DSL compilers and gem extensions
  • unneeded shim detection
  • RBS comment rewriting
  • CI checks that RBIs are in sync
  • tapioca todo for unresolved constants
  • editor integration via Ruby LSP

Capabilities

Has a command line toolplan not known
Takes pluginsplan not known

Alternatives

The same job

These do what Tapioca does.

  1. Sorbet for Rails A Sorbet build for Rails apps that type-checks specs, factories, and ERB views

Compare Tapioca with the top 3