Home / Function/ spacecraft.schema() — astro Function Reference

spacecraft.schema() — astro Function Reference

Architecture documentation for the spacecraft.schema() function in content.config.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  5d0c08d4_c73f_e085_b6bd_1b2b6f82b303["spacecraft.schema()"]
  6701f32e_5f47_2ad2_aaa6_e72b4a79cbcc["content.config.ts"]
  5d0c08d4_c73f_e085_b6bd_1b2b6f82b303 -->|defined in| 6701f32e_5f47_2ad2_aaa6_e72b4a79cbcc
  style 5d0c08d4_c73f_e085_b6bd_1b2b6f82b303 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/test/fixtures/content-layer/src/content.config.ts lines 80–92

	schema: ({ image }) =>
		z.object({
			title: z.string(),
			description: z.string(),
			publishedDate: z.coerce.date(),
			tags: z.array(z.string()),
			heroImage: image().optional(),
			cat: reference('cats').prefault('siamese'),
			something: z
				.string()
				.optional()
				.transform((str) => ({ type: 'test', content: str })),
		}),

Subdomains

Frequently Asked Questions

What does spacecraft.schema() do?
spacecraft.schema() is a function in the astro codebase, defined in packages/astro/test/fixtures/content-layer/src/content.config.ts.
Where is spacecraft.schema() defined?
spacecraft.schema() is defined in packages/astro/test/fixtures/content-layer/src/content.config.ts at line 80.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free