@kurotako/ir
The intermediate representation for kurotako: the schema
model that parsers produce and generators consume, keyed by (namespace, entity), with
Valibot schemas for validation.
You only depend on this package directly for programmatic use (writing a parser or a
generator). Normal tako usage never imports it.
Install
npm install @kurotako/ir
# bun add @kurotako/ir
Needs Node.js >= 24; runs unmodified on Node and Bun.
Documentation
Concepts and API reference: https://kurotako.marmotz.dev/docs/concepts/intermediate-representation.
0.x: the public API may change between minor versions.
License
Classes
Interfaces
- EntityBuilder
- EnumBuilder
- FieldBuilder
- IrIssue
- RelationBuilder
- SourceIrBuilder
- TypeAliasBuilder
- TypeVariantBuilder
- UnionBuilder
Type Aliases
- CompositeUnique
- Constraints
- DateType
- DefaultValue
- Entity
- EnumDef
- EnumValue
- EnumZero
- Field
- FieldType
- IndexDef
- IndexType
- IR
- IrIssueCode
- IrValidation
- JsonValue
- ReferentialAction
- Relation
- RelationTarget
- ScalarTsType
- ScalarType
- SourceIR
- StringFormat
- TemporalClass
- TypeAlias
Variables
- CompositeUniqueSchema
- ConstraintsSchema
- DateTypeSchema
- DefaultValueSchema
- EntitySchema
- EnumDefSchema
- EnumValueSchema
- FieldSchema
- FieldTypeSchema
- IndexDefSchema
- IndexTypeSchema
- IR_VERSION
- IrSchema
- JsonValueSchema
- ReferentialActionSchema
- RelationSchema
- RelationTargetSchema
- ScalarTypeSchema
- SourceIrSchema
- StringFormatSchema
- TypeAliasSchema
Functions
- assertIR
- assertSourceIR
- collectRefNames
- createFields
- createSourceIR
- dateTsType
- defaultValueExpr
- flattenUnion
- formInitExpr
- getSource
- isCompatible
- isCreateOptional
- isCrossSource
- isDbAssigned
- isReadOptional
- iterEntities
- iterFields
- iterTypeAliases
- nonRedundantTypeAliases
- parseIR
- primaryKeyFields
- readFields
- refCycleMembers
- resolveEntity
- resolveEnum
- resolveRef
- resolveRelationTarget
- resolveTypeAlias
- scalarTsType
- temporalClass
- updateFields
- validateIR
- validateSourceIR