Type Safety
CelestialDocs is built with strict TypeScript and Zod validation so mistakes surface during development instead of in production.
Where Type Safety Applies
- Content collections: Frontmatter validated with Zod—missing
titleordescriptionfails fast. - Navigation config:
SIDEBAR_NAVIGATIONuses typed structures, catching missingslugor malformed groups. - Components: UI primitives ship with typed props; misuse surfaces as IDE errors.
Benefits
- Fewer runtime 404s from typos in slugs
- Consistent SEO metadata because required fields are enforced
- Safer refactors—renames surface in both content and navigation configs
Example: Safe Navigation Group
const guides = {
id: "guides",
label: "Guides",
entries: [{ slug: "guides/overview" }, { slug: "guides/getting-started" }],
autoGenerated: true,
} satisfies SidebarGroup;
Author Workflow
- Add or edit a page.
- Run
pnpm dev; schema validation catches missing metadata instantly. - Navigation changes compile under strict types, reducing regressions.
Next Steps
- Explore the navigation model in Hybrid Approach: Best of Both Worlds
- See how DX improves authoring in Developer Experience