Skip to Content
DocumentationFeaturesPlatformContent-types package

Content-types package

What it is

The bridge between the mesh and whatever consumes it. gtmesh types emits a self-contained TypeScript workspace package (default packages/content-types/) that your static-site generator — or any TypeScript consumer — compiles against. It is the content-types package.

Why it matters

The mesh’s contract is its page schemas and its registry. Hand-writing types to match them drifts the moment a schema changes. Generating them keeps the consumer honest: the SSG imports the same shapes the engine guarantees, and gtmesh types --check fails CI the instant the committed package and the schemas disagree.

How it works

gtmesh types reads schemas/ and the page types declared in config.page_types, then writes a buildable package containing:

  • per-type page interfaces — one TypeScript interface per page type, derived from its schema;
  • a PageType union — the closed set of page types, derived from config.page_types;
  • a registry reader — to load registry/pages.csv in a typed way;
  • page-bundle loaders — to load a page’s content/<slug>/index.yaml bundle.

The package is self-contained, so the consumer depends on it like any workspace package — no reaching into the mesh internals.

Wire gtmesh types --check into CI. It writes nothing and exits non-zero on drift, so the consumer’s types can never fall out of sync with the content contract.

Key files & flags

WhereWhat it controls
gtmesh typesGenerate the package
gtmesh types --checkVerify the committed package matches the schemas (CI gate)
gtmesh types --dir <path>Override the package directory
schemas/ + config.page_typesThe source of the generated interfaces and union
  • types — the command in full
  • Lifecycle — how pages reach the registry the package reads
Last updated on