How withastro/starlight works
Project type and purpose
• This is an open-source monorepo built with pnpm workspaces.
Top-level architectural domains
• Workspace Manager (pnpm + tsconfig + GitHub workflows)
• Package Library
– packages/docsearch
– packages/markdoc
– packages/starlight
– packages/tailwind
• Documentation Site (“docs” directory built with Astro + Lunaria)
• Example Apps (in /examples/* demonstrating how to consume packages)
• Continuous Integration (GitHub Actions: ci.yml, format.yml, release.yml, etc.)
• Development Container (.devcontainer)
Main components and relationships
A. Monorepo Workspace
• Root package.json, pnpm-workspace.yaml, tsconfig.json
• Orchestrates installs and cross‐package linking
• Houses examples and docs site as “consumers” of the workspace packages
B. Individual Packages
1. docsearch – UI component + integration to Algolia
3. markdoc – Markdoc parser/renderer integration for Astro
4. starlight – Core themable design system & content components for docs (includes routing, i18n, sidebar, SEO, code snippets, etc.)
5. tailwind – Tailwind CSS plugin / default config used by the docs theme
C. Documentation Website
• Built with Astro + Lunaria config (docs/astro.config.mjs, docs/lunaria.config.json)
• Imports and configures starlight for UI, markdoc for content, tailwind for styles, docsearch for search
• Publishes static assets under docs/public/
D. Examples
• Simple demos showing how to configure and consume content.config.ts, different rendering modes (Markdoc vs MDX), tailwind usage, etc.
E. CI/CD Pipeline (GitHub Actions)
• Lints and formats code, runs tests per package, builds docs, publishes packages to npm registry
Architectural patterns and design principles
• Monorepo with workspace isolation – share code and types via tsconfig path mapping
• Each package has its own tests, build outputs, versioning, CHANGELOG, README
• Docs site follows a plugin-based architecture: Astro + Lunaria + multiple integrations
• Strong emphasis on composability – for example, starlight provides core components that can be overridden via user components