Catalog
The parsers and generators shipped in v1. Each is a separate @kurotako/* package; you
install the ones your pipeline uses and import the exported parser or generator in
tako.config.ts.
Parsers
@kurotako/parser-prisma
Reads either a Prisma 7 schema (through DMMF) or a Prisma 8 PostgreSQL
contract.json, and produces IR entities, fields, enums and relations.
- Export:
prismaParser— the value you pass tousein asourcesentry. - Name:
prisma— itsnamefield, shown in diagnostics.
| Option | Type | Default | Notes |
|---|---|---|---|
schema | string | './prisma/schema.prisma' | path to the schema file, resolved against the config directory. Prisma's multi-file schema folder is supported. |
version | 7 | 8 | inferred | force the input mode; omitted, it is inferred from a Prisma schema, contract.json, or a directory containing one. |
namespacePrefix | Record<string, string> | — | Prisma 8 only: prepends a prefix to every model from the named Prisma namespace. Ignored with a warning in Prisma 7 mode. |
rename | Record<string, string> | — | overrides an entity name. Keys are Entity in Prisma 7 mode and namespace.Entity in Prisma 8 mode. |
hidden | Record<string, string[]> | — | fields kept out of the read variant, { User: ['passwordHash'] }. Keys are IR entity names (after rename). An unknown entry is an error. Also settable with /// @kurotako.hidden (Prisma 7 mode). See Read shapes and dates. |
Unknown option keys are a hard error (a typo like schemaPath fails rather than being
ignored).
sources: {
db: {
use: prismaParser, options
:
{
schema: './prisma/schema.prisma'
}
}
,
}
For Prisma 8, emit the contract with Prisma first, then point the parser at it:
sources: {
db: {
use: prismaParser, options
:
{
schema: './prisma/generated/contract.json', version
:
8, rename
:
{
'public.User'
:
'Account'
}
,
}
,
}
,
}
Prisma 8 support is currently PostgreSQL-first. Unknown PostgreSQL codecs are preserved
as unknown IR fields; a foreign database dialect, an unsupported contract version, an
invalid contract, a post-rename entity collision, or an ambiguous cross-namespace relation
fails with one of the exported Prisma*Error classes.
@kurotako/parser-openapi
Reads an OpenAPI 3.0 or 3.1 document (local JSON/YAML or an unauthenticated HTTP (S) URL)
and produces IR entities, type aliases, enums and typed maps from components.schemas
and every reachable inline schema in operations (request bodies, responses, parameters).
- Export:
openapiParser— the value you pass tousein asourcesentry. - Name:
openapi— itsnamefield, shown in diagnostics.
| Option | Type | Default | Notes |
|---|---|---|---|
document | string | — | required; a local path resolved against the config directory, or an http:/https: URL with no credentials. |
Unknown option keys are a hard error. References are resolved (not dereferenced) by
@apidevtools/json-schema-ref-parser; unsupported schemes, credential-bearing URLs,
unresolved references, name collisions, and unsupported JSON Schema keywords each fail
with one of the exported OpenApi*Error classes.
sources: {
api: {
use: openapiParser, options
:
{
document: './openapi.yaml',
}
,
}
,
}
Generators
@kurotako/gen-zod
Emits Zod schemas from the IR — one file per entity, plus enums.ts, filters.ts and a
barrel, under <namespace>/zod/.
- Export:
zodGenerator— the value you pass tousein ageneratorsentry. - Name:
zod— itsnamefield; it is the key under which a dependent reads its artifact (ctx.dependencies.zod) and the last segment of the private path (<namespace>/<dependent>/zod/).
| Option | Type | Default | Notes |
|---|---|---|---|
zodVersion | 3 | 4 | 4 | which Zod API flavor to emit. Explicit — the generator never probes the environment (it must stay pure for tako check). |
dateType | 'date' | 'string' | 'temporal' | 'date' | how date fields are modelled: z.coerce.date(), an ISO 8601 string, or a Temporal object. See Date types. |
generators: [ { use: zodGenerator, options: { zodVersion: 4 } } ]
Each entity yields six variants (full, create, update, read, where, select) in
both relation families; read (UserReadSchema) has its defaulted fields required and
its hidden fields removed.
@kurotako/gen-angular
Emits TypeScript types, typed FormGroups and Validators aligned on the schema
constraints, under <namespace>/angular/.
- Export:
angularGenerator— the value you pass tousein ageneratorsentry. - Name:
angular— itsnamefield. - Depends on: a private copy of
zod, run bycorefor this generator alone and emitted under<namespace>/angular/zod/. You do not addzodGeneratortogeneratorsforangularto work (keep it only if your code imports<namespace>/zod).
| Option | Type | Default | Notes |
|---|---|---|---|
forms | ('reactive' | 'signal')[] | ['reactive', 'signal'] | which form surfaces to emit |
relations | 'flat' | 'deep' | 'flat' | flat = foreign-key scalars only; deep = nested FormGroup / FormArray |
zodVersion | 3 | 4 | 4 | Zod API flavor of the private Zod copy (forwarded to gen-zod) |
generators: [ { use: angularGenerator, options: { forms: [ 'reactive' ], relations: 'deep' } } ]
@kurotako/gen-react-tanstack
Emits one typed React hook per entity, use<Entity>Form, built on
TanStack Form and validated by the Zod schemas kurotako
generates from the same IR, under <namespace>/react-tanstack/: one <Entity>.form.ts per
entity, a form.runtime.ts (the only file that calls @tanstack/react-form) and a barrel.
See the React quick start.
- Export:
reactTanstackGenerator— the value you pass tousein ageneratorsentry. - Name:
react-tanstack— itsnamefield. - Depends on: a private copy of
zod, run bycorefor this generator alone and emitted under<namespace>/react-tanstack/zod/. You do not addzodGeneratortogenerators(keep it only if your code imports<namespace>/zod). - Peer dependency:
@tanstack/react-form^1.17.0(pluszod, merged from the private copy).
| Option | Type | Default | Notes |
|---|---|---|---|
zodVersion | 3 | 4 | 4 | Zod API flavor of the private Zod copy (forwarded to gen-zod) |
include | string[] | every entity | entity names to emit hooks for, in every namespace the entry covers; a name found in none of them is an error |
variants | ('full' | 'create' | 'update')[] | ['full'] | which Zod variant a hook is built on; full is the request-body shape, at least one variant |
relations | 'flat' | 'deep' | 'flat' | flat = scalar and enum fields; deep = nested objects for to-one relations, arrays for to-many |
generators: [
{ use: reactTanstackGenerator, options: { include: ['LoginDto'], variants: ['create'] } },
]
@kurotako/gen-typescript
Emits pure TypeScript type declarations from the IR — no runtime dependency on generated
code. One <Entity>.type.ts file per entity, plus enums.ts, filters.ts, aliases.ts
when the source has type aliases, scalars.ts when a JsonValue helper is needed, and a
barrel, under <namespace>/typescript/.
- Export:
typescriptGenerator— the value you pass tousein ageneratorsentry. - Name:
typescript— itsnamefield. - Depends on: nothing.
| Option | Type | Default | Notes |
|---|---|---|---|
dateType | 'date' | 'string' | 'temporal' | 'date' | how date fields are typed: Date, string, or Temporal.*. See Date types. |
Each entity yields six variants (full, create, update, read, where, select) in
both relation families (flat, deep), named ${Entity}${Variant}${Family}Dto — e.g.
User, UserCreateDto, UserReadDto, UserDeepDto.
generators: [ { use: typescriptGenerator, options: { dateType: 'string' } } ]
@kurotako/gen-openapi
Emits one OpenAPI 3.0/3.1 document (components/schemas only — no paths/operations)
per namespace from the IR — entities, type aliases and enums, including relations (rendered nested via $ref,
cross-source relations omitted) and a discriminated-union
mapping symmetric to @kurotako/parser-openapi. A field marked hidden is left out of its
schema, which describes a response (see
Read shapes and dates).
- Export:
openapiGenerator— the value you pass tousein ageneratorsentry. - Name:
openapi— itsnamefield. - Depends on: nothing.
| Option | Type | Default | Notes |
|---|---|---|---|
openapiVersion | '3.0' | '3.1' | '3.1' | which OpenAPI version to target. |
format | 'json' | 'yaml' | 'json' | output serialization. |
title | string | the namespace | document info.title. |
version | string | '0.0.0' | document info.version. |
generators: [ { use: openapiGenerator, options: { format: 'yaml', title: 'My API' } } ]
Adding your own
Parser and generator packages are plain packages whose entry is built with
defineParser / defineGenerator from @kurotako/config. The authoring guides ("writing a parser", "writing a
generator") are a fast-follow; until then, the
@kurotako/config API reference documents the contract.