Skip to content

feat(schema): add generator blocks with env-toggleable TypeScript codegen#61

Merged
quinnjr merged 1 commit intodevelopfrom
feature/typegen-generator
Mar 23, 2026
Merged

feat(schema): add generator blocks with env-toggleable TypeScript codegen#61
quinnjr merged 1 commit intodevelopfrom
feature/typegen-generator

Conversation

@quinnjr
Copy link
Copy Markdown
Contributor

@quinnjr quinnjr commented Mar 23, 2026

Summary

  • New generator block in .prax schemas with generate = env("VAR") toggle support — generators can be enabled/disabled via environment variables (true/1/yes), literal booleans, or always-on (default)
  • New prax-typegen crate (v0.1.0) — standalone TypeScript code generator that produces interfaces, enums, CreateInput/UpdateInput types, and Zod schemas with lazy relation refs; installable independently via cargo install prax-typegen
  • prax-schema updatesGenerator AST type, parser integration for generator_def blocks, Schema::enabled_generators() API

Schema Example

generator typescript {
  provider = "prax-typegen"
  output   = "./src/types"
  generate = env("TYPESCRIPT_GENERATE")
}

Test plan

  • 23 tests in prax-schema for generator AST, toggle logic, parser integration
  • 19 tests in prax-typegen for type mapping, interface generation, Zod generation
  • cargo clippy clean (no new warnings)
  • cargo fmt clean
  • End-to-end: run prax-typegen against a sample .prax file and verify output

Made with Cursor

…egen

Add first-class `generator` block support to .prax schemas with
env-variable toggling (generate = env("VAR")), and introduce the
prax-typegen crate for generating TypeScript interfaces and Zod
schemas from Prax models.

Made-with: Cursor
@quinnjr quinnjr merged commit e8ceb4f into develop Mar 23, 2026
17 of 20 checks passed
@github-actions
Copy link
Copy Markdown

📊 Benchmark Results

Benchmark jobs completed:

  • Regression Check: failure
  • Throughput Benchmarks: success
  • Memory Benchmarks: success
  • Async Benchmarks: success

See the Actions run for detailed benchmark results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant