Description
I apologize for putting a feature request in an issue, but I'm not sure where else I'd propose this. Would you be interested in making Kaminari work seamlessly with Sorbet?
Currently, Sorbet users use a tool called Tapioca to generate static type definitions for Ruby gems. Tapioca also provides "compilers" that are able to introspect applications at runtime in order to generate type definitions from metaprogramming DSLs.
Due to the way that Kaminari dynamically defines the .page
scope, Tapioca doesn't automatically discover this scope. Also, even if Tapioca did automatically discover the .page
scope, the types would be slightly wrong due to the use of .extending
.
I wrote a custom DSL compiler that resolves this issue. The Tapioca maintainers would like to see the Ruby community maintain RBI definitions and Tapioca compilers alongside the actual gems. Would you be willing to accept a pull request to ship a Tapioca compiler alongside Kaminari?
Docs are here: https://github.com/Shopify/tapioca?tab=readme-ov-file#writing-custom-dsl-compilers