Home / File/ schema.ts — astro Source File

schema.ts — astro Source File

Architecture documentation for schema.ts, a typescript file in the astro codebase. 3 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  2443d334_7355_e8e8_182c_700654c43514["schema.ts"]
  5bfc9b61_bc50_d3f1_022e_8ddb08454392["./config-defaults.js"]
  2443d334_7355_e8e8_182c_700654c43514 --> 5bfc9b61_bc50_d3f1_022e_8ddb08454392
  4b2a278b_7519_80c4_73d6_387d11edd840["sitemap"]
  2443d334_7355_e8e8_182c_700654c43514 --> 4b2a278b_7519_80c4_73d6_387d11edd840
  f8c9251e_f535_6281_2118_9e79a4155212["v4"]
  2443d334_7355_e8e8_182c_700654c43514 --> f8c9251e_f535_6281_2118_9e79a4155212
  style 2443d334_7355_e8e8_182c_700654c43514 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { EnumChangefreq as ChangeFreq } from 'sitemap';
import * as z from 'zod/v4';
import { SITEMAP_CONFIG_DEFAULTS } from './config-defaults.js';

const localeKeySchema = z.string().min(1);

export const SitemapOptionsSchema = z
	.object({
		filenameBase: z.string().optional().prefault(SITEMAP_CONFIG_DEFAULTS.filenameBase),
		filter: z.function({ input: [z.string()], output: z.boolean() }).optional(),
		customSitemaps: z.array(z.url()).optional(),
		customPages: z.array(z.url()).optional(),
		canonicalURL: z.url().optional(),
		xslURL: z.string().optional(),

		i18n: z
			.object({
				defaultLocale: localeKeySchema,
				locales: z.record(
					localeKeySchema,
					z
						.string()
						.min(2)
						.regex(/^[a-zA-Z\-]+$/gm, {
							message: 'Only English alphabet symbols and hyphen allowed',
						}),
				),
			})
			.refine((val) => !val || val.locales[val.defaultLocale], {
				message: '`defaultLocale` must exist in `locales` keys',
			})
			.optional(),

		entryLimit: z.number().nonnegative().optional().default(SITEMAP_CONFIG_DEFAULTS.entryLimit),
		serialize: z.function({ input: [z.any()], output: z.any() }).optional(),

		changefreq: z.enum(ChangeFreq).optional(),
		lastmod: z.date().optional(),
		priority: z.number().min(0).max(1).optional(),

		namespaces: z
			.object({
				news: z.boolean().optional(),
				xhtml: z.boolean().optional(),
				image: z.boolean().optional(),
				video: z.boolean().optional(),
			})
			.optional()
			.default(SITEMAP_CONFIG_DEFAULTS.namespaces),
		chunks: z.record(z.string(), z.function({ input: [z.any()], output: z.any() })).optional(),
	})
	.strict()
	.default(SITEMAP_CONFIG_DEFAULTS);

Domain

Dependencies

  • ./config-defaults.js
  • sitemap
  • v4

Frequently Asked Questions

What does schema.ts do?
schema.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain.
What does schema.ts depend on?
schema.ts imports 3 module(s): ./config-defaults.js, sitemap, v4.
Where is schema.ts in the architecture?
schema.ts is located at packages/integrations/sitemap/src/schema.ts (domain: CoreAstro, directory: packages/integrations/sitemap/src).

Analyze Your Own Codebase

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

Try Supermodel Free