Guide 13
Tips and Tricks
cngxjs (opens in new tab)Updated Guide13of 13
Patterns that pay off in real projects. None are required. They’re what we reach for once the basics are in place.
Monorepos
One compodocx run per project, each writing to its own version folder under a shared
/documentation. Each project keeps its own version-switcher and theme. A static index page at the root links to each project’s latest label.Watch + serve
--watch --servegives instant feedback while authoring. The dev server reuses production routing, so what you see locally matches what ships.Diff in CI on every PR
Generate a JSON export per build (
--exportFormat json), keep the previous one as a baseline, and runcompodocx diff --old prev.json --new next.jsonin CI. Exit code 2 fails the build on breaking changes.--jsonor--mdgives your bot a report for PR comments. Re-export the baseline after upgrading compodocx.LLM context for code review
--exportFormat llm-mdemits an LLM-context markdown bundle. Pipe it into your AI assistant or any tool that accepts a markdown corpus. Sized and structured for direct consumption, with signatures capped to keep the prompt small.Migrating from compodoc
Run the new CLI once and read the log: it lists every legacy construct, ignored flag, and retired template with its location.
compodocx migrate jsdoc <dir> --dry-runshows which@categoryand@docsKindtags it would remove. Handlebars templates are rewritten by hand, using the cookbook in MIGRATION.md.Keep your doc tsconfig narrow
Exclude test files, storybook entries, dev-only fixtures. Heavy generic types render slower. A smaller surface keeps cold builds fast and keeps the rendered docs focused on what consumers actually use.
Public API filtering
Symbols no entry point exports get no page by default.
--publicApiOnly <dist>goes further and reads the public names from an API Extractor report or your built package. Useful when you ship internal helpers in the same package and don’t want them on the docs page.Correct a detected feature
The build log prints how each feature was detected. To move a symbol, add an
@feature <key>tag or afeaturesglob in the config file. Neither can move a symbol into another entry point.