Skip to content

Lexicon Registry

The lexicon registry manages the lifecycle of lexicon bundles — loading, validating, and making them available to the evaluator and lint system.

TypeScript definition files (.d.ts) that describe available resource classes, their properties, and intrinsic functions. These types power editor autocompletion and compile-time checks.

Lint rules specific to the target ecosystem. These integrate with chant lint to catch provider-specific mistakes.

Metadata that maps resource type identifiers to their definitions. The evaluator uses this at build time to resolve resource types and validate configurations.

The core package provides reusable codegen infrastructure so that new lexicons don’t need to reimplement common patterns:

ModuleWhat it provides
@intentius/chant/runtimecreateResource, createProperty — Declarable-marked constructor factories
@intentius/chant/codegen/namingNamingStrategy — collision-free TypeScript class name generation
@intentius/chant/codegen/generategeneratePipeline — orchestrates fetch, parse, name, generate
@intentius/chant/codegen/packagepackagePipeline — bundles artifacts into BundleSpec
@intentius/chant/codegen/fetchfetchWithCache, extractFromZip — HTTP caching and zip extraction
@intentius/chant/lsp/lexicon-providersLexiconIndex, lexiconCompletions, lexiconHover — LSP helpers

Each lexicon supplies provider-specific callbacks and data tables. Core handles the orchestration, logging, warning collection, stats, and integrity computation.

chant is provider-agnostic by design. The core handles parsing, module resolution, evaluation, and serialization — but knows nothing about specific infrastructure platforms.

Lexicons bridge this gap:

  • The core stays lean — no bundled provider SDKs
  • Providers update independently — new resource types ship as lexicon updates
  • Custom targets are first-class — organizations can author internal lexicons
  • Projects declare exactly what they need — explicit, reproducible dependencies
  • New lexicons reuse core infrastructure — naming, generation, bundling, and LSP patterns are provided by core