[package]
name = "normalize-typegen"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
description = "Polyglot type and validator generation from schemas"

[features]
default = ["typescript", "python", "go", "rust-types", "backend-jsonschema", "backend-graphql", "backend-proto"]

# Language umbrella flags (convenience)
typescript = ["backend-typescript", "typescript-validators"]
python = ["backend-python", "python-validators"]
go = ["backend-go"]
rust-types = ["backend-rust"]

# Per-language validators (umbrella)
typescript-validators = ["backend-zod", "backend-valibot"]
python-validators = ["backend-pydantic"]

# Backend flags (primary)
backend-typescript = []
backend-zod = []
backend-valibot = []
backend-python = []
backend-pydantic = []
backend-go = []
backend-rust = []
backend-jsonschema = []
backend-graphql = []
backend-proto = []

# Input parsers — grammars load dynamically via `normalize-languages`.
input-typescript = ["dep:normalize-languages", "dep:tree-sitter"]
input-graphql = ["dep:normalize-languages", "dep:tree-sitter"]

# Legacy aliases (for backwards compatibility)
typescript-types = ["backend-typescript"]
python-types = ["backend-python"]
go-types = ["backend-go"]
zod = ["backend-zod"]
valibot = ["backend-valibot"]
pydantic = ["backend-pydantic"]
yup = ["backend-typescript"]

[dependencies]
serde = { workspace = true }
serde_json = { workspace = true }
thiserror = "2"
tree-sitter = { version = "0.26", optional = true }
normalize-languages = { path = "../normalize-languages", version = "0.3.1", default-features = false, optional = true }

[dev-dependencies]
insta = { version = "1", features = ["json"] }
