Skip to content
Projetos

Sobre

Define once in Ruby. Generate everywhere in TypeScript.

Desenvolvimento web e de aplicativos

Como estes números são medidos

O que você pode fazer

  • Automatic TypeScript interface generation from serializers
  • Type-safe route helpers from Rails routes
  • Supports Alba, ActiveModel::Serializer, Oj::Serializer, Panko::Serializer, Blueprinter
  • OpenAPI 3.0/3.1 schema generation

Crescimento medido de estrelas

em 24 h
0
em 7 dias
0
em 15 dias
0
em 1 mês
Coletando histórico

Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.

README.md

Original

Typelizer

Gem Version

Typelizer generates TypeScript types, route helpers, and OpenAPI schemas from your Ruby on Rails application. It keeps your backend and frontend in sync without hand-maintaining types.

Features

  • Automatic TypeScript interface generation from serializers
  • Type-safe route helpers from Rails routes
  • Supports Alba, ActiveModel::Serializer, Oj::Serializer, Panko::Serializer, Blueprinter
  • OpenAPI 3.0/3.1 schema generation
  • Multiple output writers with layered configuration
  • File watching with automatic regeneration in development

Quick Start

Add to your Gemfile:

gem "typelizer"

Include the DSL in your serializers:

class ApplicationResource
  include Alba::Resource
  include Typelizer::DSL
end

class PostResource < ApplicationResource
  attributes :id, :title, :body
end

Generate TypeScript types:

rails typelizer:generate

Documentation

Full documentation: https://typelizer.dev

Development

You need PostgreSQL running locally. Then:

bundle install
cd spec/app && RAILS_ENV=test bundle exec rails db:create db:migrate && cd ../..
bundle exec rspec

The test suite uses a dummy Rails app in spec/app/ with models, migrations, and serializers for all five supported frameworks (Alba, AMS, OjSerializers, Panko, Blueprinter). Linting is done with StandardRB:

bundle exec standardrb

bundle exec rake runs both the tests and the linter.

Credits

Typelizer is inspired by types_from_serializers, js-routes, and Wayfinder.


Evil Martians logo Typelizer is built by Evil Martians, an American design and engineering consultancy for developer tools, AI, and cybersecurity startups.

License

The gem is available as open source under the terms of the MIT License.

Explore projetos relacionados

Carregando…