HOW ASTRO
ACTUALLY WORKS
The web framework for content-driven websites. Conventions, patterns, and architecture extracted from the withastro/astro repository by sourcebook.
WHAT_MATTERS
-
→
astro.ts is a hub file (imported by 88 files) — changes here ripple everywhere
-
→
17 third-party integrations under packages/integrations/ — each has its own directory
-
→
Circular import chains detected — avoid adding to these cycles
KEY_FINDINGS
This is a monorepo. Changes may affect multiple packages. Check workspace dependencies before modifying shared code.
HIGHTests are co-located with source files (*.test.ts next to *.ts). Keep this pattern.
HIGHProject uses barrel exports (index.ts files that re-export). Import from the directory, not from deep paths.
HIGH5 barrel export files found
Use Zod schemas for validation. This is the project's standard validation approach.
HIGH5 files use Zod
Tests use Node.js built-in test runner.
HIGH15 test files
UI components live in: packages/integrations/vue/test/fixtures/ directories.
HIGH3 component directories
Third-party integrations live under packages/integrations/ (web-vitals, vue, vercel, tailwind, svelte, solid, ...). Each integration has its own directory.
HIGH17 integrations found
Hub files: packages/astro/src/types/astro.ts (88 files); packages/astro/src/core/errors/index.ts (71 files); packages/astro/src/types/public/internal.ts (68 files); packages/astro/src/core/logger/core.ts (67 files); packages/astro/src/types/public/config.ts (55 files). Changes here have the widest blast radius.
HIGHCircular import chains detected: shiki.ts → types.ts; generate-sitemap.ts → index.ts; index.ts → validate-options.ts. Avoid adding to these cycles.
HIGH54 dead code candidates.
HIGH