Skip to Content

gtmesh types

Generates the SSG-facing TypeScript content-types package from schemas/, so your website compiles against the content contract.

gtmesh types [--check] [--dir <path>]

What it does

gtmesh types reads your per-type schemas in schemas/ — plus a handful of config-derived constants (the section list, per-environment render set, site base URL, facet axes, and thumbnail projection) — and emits a self-contained, buildable TypeScript package — the content-types package your website (or any TS consumer) imports. Your site’s components type-check against these generated types, so the consumer can’t drift from the content the engine produces.

With --check it writes nothing and instead verifies that the committed package still matches the schemas, exiting non-zero on drift. Wire that into CI so a schema change can’t ship without the regenerated package.

Generating types is the consume step. The schemas it reads are the same ones validate and seal enforce on page content — one source of truth for both the data and its TypeScript shape.

Arguments & flags

OptionDescriptionDefault
--checkVerify the committed package matches the schemas (CI gate); exits non-zero on drift. Writes nothingoff (generates)
--dir <path>Override the package output directoryconfig.codegen.dir

The global options (--project, --json, --quiet) also apply.

Reads & writes

  • Consumes: the per-type schemas in schemas/ (incl. any projection result schema like card.schema.yaml), plus config-derived constants from gtmesh.config.yamltaxonomy (sections, axes, facets), environments, site (incl. site.projections and site.assets), and images (and config.codegen.dir).
  • Produces: the generated TypeScript package on disk — unless --check, which produces only a pass/fail result. --check is read-only.
  • Commits: the regenerated package belongs in your commit; CI runs --check to confirm it’s in sync.

Examples

gtmesh types # (re)generate the package into config.codegen.dir gtmesh types --dir packages/content # generate into a specific directory gtmesh types --check # CI gate: fail if the package is stale
Last updated on