Astro is a modern web framework and site builder designed for content-focused websites with first-class support for server-side rendering (SSR), partial hydration (Astro Islands), and seamless integration of multiple UI frameworks. This repository hosts a pnpm-based monorepo encompassing the core Astro framework, official deployment adapters, framework integrations, content processors, and robust developer tooling.
This page provides a detailed, technical introduction to the Astro monorepo's structure and architectural components, explaining how they fit together to enable the complete Astro experience.
The Astro monorepo incorporates multiple tightly integrated components to build, deploy, and extend Astro-powered sites:
astro package)@astrojs/markdown-satteri pipeline and supports Shiki for syntax highlighting packages/astro/package.json122-159astro commands), VS Code extension, language server, type-checking utilities (astro-check), and scaffolding tools like create-astro package.json67-84Flue) for automated issue diagnosis and fix generation package.json71-72The Astro repository is organized via pnpm workspaces package.json53-58 and orchestrated via Turbo for parallelized, cached builds package.json83
| Category | Directory | Examples |
|---|---|---|
| Core packages | packages/ | astro, @astrojs/telemetry, create-astro |
| Integrations | packages/integrations/ | mdx, sitemap, node, react, vue |
| Markdown | packages/markdown/ | remark markdown processors |
| Language Tools | packages/language-tools/ | astro-check, astro-vscode, language-server |
| Examples | examples/ | blog, portfolio, framework-react |
Sources: package.json12-58 pnpm-lock.yaml14-150 packages/astro/package.json119-172
The astro package is the heart of the monorepo, encompassing the site builder, SSR runtime, and asset processing.
The package defines its public API surface via a comprehensive exports map in package.json packages/astro/package.json15-85:
| Export Identifier | Description | Implementation Path |
|---|---|---|
. | Main framework entry | dist/index.js |
./app | SSR App runtime entry | dist/core/app/entrypoints/index.js |
./assets | Image/Font asset pipeline | dist/assets/index.js |
./actions/runtime/entrypoints/* | Astro Actions runtime | dist/actions/runtime/entrypoints/* |
./content/runtime | Content Collections API | dist/content/runtime.js |
./middleware | Middleware types/logic | dist/core/middleware/index.js |
./loaders | Content Data Loaders | dist/content/loaders/index.js |
./zod | Bundled Zod for config/content | dist/zod.js |
Astro supports three primary output modes configured in astro.config.mjs:
Astro leverages Vite packages/astro/package.json168 as its underlying engine, orchestrating multiple concurrent build environments to handle the complexity of SSR and partial hydration.
The build is initiated via the CLI command astro build packages/astro/package.json87 The orchestration coordinates three distinct Vite passes:
hybrid or static modes.astro-island.ts) packages/astro/package.json104Sources: packages/astro/package.json103-122 package.json12-16
The repository implements a sophisticated AI-powered maintenance system using Flue package.json71-72 This system is designed to reduce the manual burden of managing a high-volume monorepo.
.agents/skills/triage/, the system includes specialized skills for:
astro-pr-writer) and managing changesets package.json11| Component | Role | Source Pointer |
|---|---|---|
| CLI | Command-line interface for dev, build, sync. | packages/astro/bin/astro.mjs |
| Compiler | Rust-based parser for .astro files. | @astrojs/compiler-rs |
| Runtime | The logic that executes on the server/client. | packages/astro/dist/runtime/* |
| Language Tools | TypeScript support and VS Code integration. | packages/language-tools/* |
| Integrations | Framework bridges (React, Vue, etc.). | packages/integrations/* |
Sources: packages/astro/package.json1-123 package.json53-58 pnpm-lock.yaml1-200
Refresh this wiki
This wiki was recently refreshed. Please wait 6 days to refresh again.