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
| Option | Description | Default |
|---|---|---|
--check | Verify the committed package matches the schemas (CI gate); exits non-zero on drift. Writes nothing | off (generates) |
--dir <path> | Override the package output directory | config.codegen.dir |
The global options (--project, --json, --quiet) also apply.
Reads & writes
- Consumes: the per-type schemas in
schemas/(andconfig.codegen.dir). - Produces: the generated TypeScript package on disk — unless
--check, which produces only a pass/fail result.--checkis read-only. - Commits: the regenerated package belongs in your commit; CI runs
--checkto 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 staleRelated
- Content-types package — what this emits and how your site consumes it.
validate— the same schemas, enforced on page content.- Reference — the version-exact flag list.