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/ 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/ (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