Guide 03
Usage
cngxjs (opens in new tab)Updated Guide03of 13
A few patterns we lean on. Most flags have a config-file equivalent.
Build once for CI
npx compodocx -p tsconfig.doc.jsonWrites to ./documentation/<versionLabel>/ by default. The label is read from the nearest package.json. Pass--no-multiVersion for a flat output.
Watch during authoring
npx compodocx -p tsconfig.doc.json --watch --serveThe dev server reuses the same routing and theming as production. What you see locally matches what ships.
Multi-version with a custom label
npx compodocx -p tsconfig.doc.json --versionLabel v1.4.0Writes ./documentation/v1.4.0/ and updates./documentation/versions.json. The manifest is append-only, deduplicated by label, and semver-sorted descending. The version-switcher in the navbar reads it at runtime, no extra wiring.
Wire into npm scripts (opens in new tab)
"docs": "compodocx -p tsconfig.doc.json",
"docs:watch": "compodocx -p tsconfig.doc.json --watch --serve",
"docs:json": "compodocx -p tsconfig.doc.json --exportFormat json -d snapshots/",
"docs:llm": "compodocx -p tsconfig.doc.json --exportFormat llm-md"API diff between snapshots
npx compodocx -p tsconfig.doc.json --exportFormat json -d snapshots/next/
npx compodocx diff --old snapshots/prev/documentation.json --new snapshots/next/documentation.jsonExits 0 on no public-API change,1 on additive changes, 2 on breaking changes (or fatal errors). Add --json or --md for a report your bot can post as a PR comment. Both exports must come from the same compodocx schema, so re-export older baselines after an upgrade.
Validate playgrounds in CI
npx compodocx playground:validate documentationBuilds every @playground of a generated docs folder with a realnpm install and ng build. Exits1 when one fails. It needs network access and is slow, so run it as a CI step after the docs build.
LLM context for code review
npx compodocx -p tsconfig.doc.json --exportFormat llm-mdWithout -d, writes to stdout. Pipe it straight into your AI assistant or any tool that reads markdown. With -d, writes<output>/llm-context.md.