config.ts — astro Source File
Architecture documentation for config.ts, a typescript file in the astro codebase. 3 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 4aa6f973_fe9c_322b_0b4f_95b1e849db53["config.ts"] a2fc192c_cdf9_df62_81bf_9c18a80b317e["./fonts/constants.js"] 4aa6f973_fe9c_322b_0b4f_95b1e849db53 --> a2fc192c_cdf9_df62_81bf_9c18a80b317e ea387312_d0a2_bb52_dafc_3872f7307f95["../../src/assets/fonts/types.js"] 4aa6f973_fe9c_322b_0b4f_95b1e849db53 --> ea387312_d0a2_bb52_dafc_3872f7307f95 f8c9251e_f535_6281_2118_9e79a4155212["v4"] 4aa6f973_fe9c_322b_0b4f_95b1e849db53 --> f8c9251e_f535_6281_2118_9e79a4155212 style 4aa6f973_fe9c_322b_0b4f_95b1e849db53 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import * as z from 'zod/v4';
import { FONT_TYPES } from './constants.js';
import type { FontProvider } from './types.js';
export const WeightSchema = z.union([z.string(), z.number()]);
export const StyleSchema = z.enum(['normal', 'italic', 'oblique']);
export const DisplaySchema = z.enum(['auto', 'block', 'swap', 'fallback', 'optional']);
const FormatSchema = z.enum(FONT_TYPES);
const _FontProviderSchema = z.strictObject({
name: z.string(),
config: z.record(z.string(), z.any()).optional(),
init: z.custom<FontProvider['init']>((v) => typeof v === 'function').optional(),
resolveFont: z.custom<FontProvider['resolveFont']>((v) => typeof v === 'function'),
listFonts: z.custom<FontProvider['listFonts']>((v) => typeof v === 'function').optional(),
});
// Using z.object directly makes zod remap the input, preventing
// the usage of class instances. Instead, we check if it matches
// the right shape and pass the original
export const FontProviderSchema = z.custom<FontProvider>((v) => {
return _FontProviderSchema.safeParse(v).success;
}, 'Invalid FontProvider object');
export const FontFamilySchema = z
.object({
name: z.string(),
cssVariable: z.string(),
provider: FontProviderSchema,
weights: z.tuple([WeightSchema], WeightSchema).optional(),
styles: z.tuple([StyleSchema], StyleSchema).optional(),
subsets: z.tuple([z.string()], z.string()).optional(),
formats: z.tuple([FormatSchema], FormatSchema).optional(),
fallbacks: z.array(z.string()).optional(),
optimizedFallbacks: z.boolean().optional(),
display: DisplaySchema.optional(),
stretch: z.string().optional(),
featureSettings: z.string().optional(),
variationSettings: z.string().optional(),
unicodeRange: z.tuple([z.string()], z.string()).optional(),
options: z.record(z.string(), z.any()).optional(),
})
.strict();
Domain
Subdomains
Functions
Dependencies
- ../../src/assets/fonts/types.js
- ./fonts/constants.js
- v4
Source
Frequently Asked Questions
What does config.ts do?
config.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, RenderingEngine subdomain.
What functions are defined in config.ts?
config.ts defines 1 function(s): FontProviderSchema.
What does config.ts depend on?
config.ts imports 3 module(s): ../../src/assets/fonts/types.js, ./fonts/constants.js, v4.
Where is config.ts in the architecture?
config.ts is located at packages/astro/src/assets/fonts/config.ts (domain: CoreAstro, subdomain: RenderingEngine, directory: packages/astro/src/assets/fonts).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free