feat: scaffold Astro + Tailwind project

This commit is contained in:
TerryM
2026-05-12 16:16:03 +08:00
parent 906eb5c763
commit 03d3800c6c
12097 changed files with 1266600 additions and 0 deletions

24
node_modules/astro/dist/core/config/config.d.ts generated vendored Normal file
View File

@@ -0,0 +1,24 @@
import fs from 'node:fs';
import type { AstroConfig, AstroInlineConfig, AstroUserConfig } from '../../types/public/config.js';
export declare function resolveRoot(cwd?: string | URL): string;
interface ResolveConfigPathOptions {
root: string;
configFile?: string | false;
fs: typeof fs;
}
/**
* Resolve the file URL of the user's `astro.config.js|mjs|ts` file
*/
export declare function resolveConfigPath(options: ResolveConfigPathOptions): Promise<string | undefined>;
interface ResolveConfigResult {
userConfig: AstroUserConfig;
astroConfig: AstroConfig;
}
/**
* Resolves the Astro config with a given inline config.
*
* @param inlineConfig An inline config that takes highest priority when merging and resolving the final config.
* @param command The running command that uses this config. Usually 'dev' or 'build'.
*/
export declare function resolveConfig(inlineConfig: AstroInlineConfig, command: string, fsMod?: typeof fs): Promise<ResolveConfigResult>;
export {};

105
node_modules/astro/dist/core/config/config.js generated vendored Normal file
View File

@@ -0,0 +1,105 @@
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import colors from "piccolore";
import { $ZodError } from "zod/v4/core";
import { eventConfigError, telemetry } from "../../events/index.js";
import { trackAstroConfigZodError } from "../errors/errors.js";
import { AstroError, AstroErrorData } from "../errors/index.js";
import { formatConfigErrorMessage } from "../messages/runtime.js";
import { mergeConfig } from "./merge.js";
import { validateConfig } from "./validate.js";
import { loadConfigWithVite } from "./vite-load.js";
function resolveRoot(cwd) {
if (cwd instanceof URL) {
cwd = fileURLToPath(cwd);
}
return cwd ? path.resolve(cwd) : process.cwd();
}
const configPaths = Object.freeze([
"astro.config.mjs",
"astro.config.js",
"astro.config.ts",
"astro.config.mts"
]);
async function search(fsMod, root) {
const paths = configPaths.map((p) => path.join(root, p));
for (const file of paths) {
if (fsMod.existsSync(file)) {
return file;
}
}
}
async function resolveConfigPath(options) {
let userConfigPath;
if (options.configFile) {
userConfigPath = path.join(options.root, options.configFile);
if (!options.fs.existsSync(userConfigPath)) {
throw new AstroError({
...AstroErrorData.ConfigNotFound,
message: AstroErrorData.ConfigNotFound.message(options.configFile)
});
}
} else {
userConfigPath = await search(options.fs, options.root);
}
return userConfigPath;
}
async function loadConfig(root, configFile, fsMod = fs) {
if (configFile === false) return {};
const configPath = await resolveConfigPath({
root,
configFile,
fs: fsMod
});
if (!configPath) return {};
try {
return await loadConfigWithVite({
root,
configPath,
fs: fsMod
});
} catch (e) {
const configPathText = configFile ? colors.bold(configFile) : "your Astro config";
console.error(`${colors.bold(colors.red("[astro]"))} Unable to load ${configPathText}
`);
throw e;
}
}
function splitInlineConfig(inlineConfig) {
const { configFile, mode, logLevel, ...inlineUserConfig } = inlineConfig;
return {
inlineUserConfig,
inlineOnlyConfig: {
configFile,
mode,
logLevel
}
};
}
async function resolveConfig(inlineConfig, command, fsMod = fs) {
const root = resolveRoot(inlineConfig.root);
const { inlineUserConfig, inlineOnlyConfig } = splitInlineConfig(inlineConfig);
if (inlineConfig.root) {
inlineUserConfig.root = root;
}
const userConfig = await loadConfig(root, inlineOnlyConfig.configFile, fsMod);
const mergedConfig = mergeConfig(userConfig, inlineUserConfig);
let astroConfig;
try {
astroConfig = await validateConfig(mergedConfig, root, command);
} catch (e) {
if (e instanceof $ZodError) {
trackAstroConfigZodError(e);
console.error(formatConfigErrorMessage(e) + "\n");
telemetry.record(eventConfigError({ cmd: command, err: e, isFatal: true }));
}
throw e;
}
return { userConfig: mergedConfig, astroConfig };
}
export {
resolveConfig,
resolveConfigPath,
resolveRoot
};

4
node_modules/astro/dist/core/config/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
export { resolveConfig, resolveConfigPath, resolveRoot, } from './config.js';
export { mergeConfig } from './merge.js';
export { createSettings } from './settings.js';
export { loadTSConfig, updateTSConfigForFramework, type TSConfigLoadedResult, type TSConfigResult, } from './tsconfig.js';

20
node_modules/astro/dist/core/config/index.js generated vendored Normal file
View File

@@ -0,0 +1,20 @@
import {
resolveConfig,
resolveConfigPath,
resolveRoot
} from "./config.js";
import { mergeConfig } from "./merge.js";
import { createSettings } from "./settings.js";
import {
loadTSConfig,
updateTSConfigForFramework
} from "./tsconfig.js";
export {
createSettings,
loadTSConfig,
mergeConfig,
resolveConfig,
resolveConfigPath,
resolveRoot,
updateTSConfigForFramework
};

3
node_modules/astro/dist/core/config/merge.d.ts generated vendored Normal file
View File

@@ -0,0 +1,3 @@
import type { DeepPartial } from '../../type-utils.js';
import type { AstroConfig, AstroInlineConfig } from '../../types/public/index.js';
export declare function mergeConfig<C extends AstroConfig | AstroInlineConfig>(defaults: C, overrides: DeepPartial<C>): C;

54
node_modules/astro/dist/core/config/merge.js generated vendored Normal file
View File

@@ -0,0 +1,54 @@
import { mergeConfig as mergeViteConfig } from "vite";
import { arraify, isObject, isURL } from "../util-runtime.js";
function mergeConfigRecursively(defaults, overrides, rootPath) {
const merged = { ...defaults };
for (const key in overrides) {
const value = overrides[key];
if (value == null) {
continue;
}
const existing = merged[key];
if (existing == null) {
merged[key] = value;
continue;
}
if (key === "vite" && rootPath === "") {
merged[key] = mergeViteConfig(existing, value);
continue;
}
if (key === "server" && rootPath === "") {
if (typeof existing === "function" || typeof value === "function") {
merged[key] = (...args) => {
const existingConfig = typeof existing === "function" ? existing(...args) : existing;
const valueConfig = typeof value === "function" ? value(...args) : value;
return mergeConfigRecursively(existingConfig, valueConfig, key);
};
continue;
}
}
if (key === "allowedHosts" && rootPath === "server" && (typeof existing === "boolean" || typeof value === "boolean")) {
merged[key] = typeof value === "boolean" ? value : existing;
continue;
}
if (Array.isArray(existing) || Array.isArray(value)) {
merged[key] = [...arraify(existing ?? []), ...arraify(value ?? [])];
continue;
}
if (isURL(existing) && isURL(value)) {
merged[key] = value;
continue;
}
if (isObject(existing) && isObject(value)) {
merged[key] = mergeConfigRecursively(existing, value, rootPath ? `${rootPath}.${key}` : key);
continue;
}
merged[key] = value;
}
return merged;
}
function mergeConfig(defaults, overrides) {
return mergeConfigRecursively(defaults, overrides, "");
}
export {
mergeConfig
};

540
node_modules/astro/dist/core/config/schemas/base.d.ts generated vendored Normal file
View File

@@ -0,0 +1,540 @@
import type { RehypePlugin as _RehypePlugin, RemarkPlugin as _RemarkPlugin, RemarkRehype as _RemarkRehype, Smartypants as _Smartypants, ShikiConfig } from '@astrojs/markdown-remark';
import type { OutgoingHttpHeaders } from 'node:http';
import * as z from 'zod/v4';
import type { ViteUserConfig } from '../../../types/public/config.js';
/** @lintignore */
export interface ComplexifyUnionObj {
}
type ComplexifyWithUnion<T> = T & ComplexifyUnionObj;
type ComplexifyWithOmit<T> = Omit<T, '__nonExistent'>;
type ShikiLang = ComplexifyWithUnion<NonNullable<ShikiConfig['langs']>[number]>;
type ShikiTheme = ComplexifyWithUnion<NonNullable<ShikiConfig['theme']>>;
type ShikiTransformer = ComplexifyWithUnion<NonNullable<ShikiConfig['transformers']>[number]>;
type RehypePlugin = ComplexifyWithUnion<_RehypePlugin>;
type RemarkPlugin = ComplexifyWithUnion<_RemarkPlugin>;
/** @lintignore */
export type RemarkRehype = ComplexifyWithOmit<_RemarkRehype>;
/** @lintignore */
export type Smartypants = ComplexifyWithOmit<_Smartypants>;
export declare const ASTRO_CONFIG_DEFAULTS: {
root: string;
srcDir: string;
publicDir: string;
outDir: string;
cacheDir: string;
base: string;
trailingSlash: "ignore";
build: {
format: "directory";
client: string;
server: string;
assets: string;
serverEntry: string;
redirects: true;
inlineStylesheets: "auto";
concurrency: number;
};
image: {
endpoint: {
entrypoint: undefined;
route: "/_image";
};
service: {
entrypoint: "astro/assets/services/sharp";
config: {};
};
dangerouslyProcessSVG: false;
responsiveStyles: false;
};
devToolbar: {
enabled: true;
};
compressHTML: true;
server: {
host: false;
port: number;
open: false;
allowedHosts: never[];
};
integrations: never[];
markdown: Required<import("@astrojs/markdown-remark").AstroMarkdownOptions>;
vite: {};
legacy: {
collectionsBackwardsCompat: false;
};
redirects: {};
security: {
checkOrigin: true;
allowedDomains: never[];
csp: false;
actionBodySizeLimit: number;
serverIslandBodySizeLimit: number;
};
env: {
schema: {};
validateSecrets: false;
};
prerenderConflictBehavior: "warn";
experimental: {
advancedRouting: false;
clientPrerender: false;
contentIntellisense: false;
chromeDevtoolsWorkspace: false;
rustCompiler: false;
queuedRendering: {
enabled: false;
};
logger: {
entrypoint: string;
};
};
};
export declare const AstroConfigSchema: z.ZodObject<{
root: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodString>>, z.ZodTransform<URL, string>>;
srcDir: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodString>>, z.ZodTransform<URL, string>>;
publicDir: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodString>>, z.ZodTransform<URL, string>>;
outDir: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodString>>, z.ZodTransform<URL, string>>;
cacheDir: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodString>>, z.ZodTransform<URL, string>>;
site: z.ZodOptional<z.ZodString>;
compressHTML: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"jsx">]>>>;
base: z.ZodDefault<z.ZodOptional<z.ZodString>>;
trailingSlash: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"always">, z.ZodLiteral<"never">, z.ZodLiteral<"ignore">]>>>;
output: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"static">, z.ZodLiteral<"server">, z.ZodLiteral<"hybrid">]>>> & z.ZodType<"server" | "static", "server" | "static" | "hybrid" | undefined, z.core.$ZodTypeInternals<"server" | "static", "server" | "static" | "hybrid" | undefined>>;
scopedStyleStrategy: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"where">, z.ZodLiteral<"class">, z.ZodLiteral<"attribute">]>>>;
adapter: z.ZodOptional<z.ZodObject<{
name: z.ZodString;
hooks: z.ZodDefault<z.ZodObject<{}, z.core.$loose>>;
}, z.core.$strip>>;
integrations: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodArray<z.ZodObject<{
name: z.ZodString;
hooks: z.ZodDefault<z.ZodObject<{}, z.core.$loose>>;
}, z.core.$strip>>>>>;
build: z.ZodPrefault<z.ZodObject<{
format: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"file">, z.ZodLiteral<"directory">, z.ZodLiteral<"preserve">]>>>;
client: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodString>>, z.ZodTransform<URL, string>>;
server: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodString>>, z.ZodTransform<URL, string>>;
assets: z.ZodDefault<z.ZodOptional<z.ZodString>>;
assetsPrefix: z.ZodOptional<z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodIntersection<z.ZodObject<{
fallback: z.ZodString;
}, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodString>>]>>;
serverEntry: z.ZodDefault<z.ZodOptional<z.ZodString>>;
redirects: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
inlineStylesheets: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
never: "never";
auto: "auto";
always: "always";
}>>>;
concurrency: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
}, z.core.$strip>>;
server: z.ZodPrefault<z.ZodPipe<z.ZodTransform<any, unknown>, z.ZodObject<{
open: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
host: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
port: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
headers: z.ZodOptional<z.ZodCustom<OutgoingHttpHeaders, OutgoingHttpHeaders>>;
allowedHosts: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<true>]>>>;
}, z.core.$strip>>>;
redirects: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
status: z.ZodUnion<readonly [z.ZodLiteral<300>, z.ZodLiteral<301>, z.ZodLiteral<302>, z.ZodLiteral<303>, z.ZodLiteral<304>, z.ZodLiteral<307>, z.ZodLiteral<308>]>;
destination: z.ZodString;
}, z.core.$strip>]>>>;
prefetch: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
prefetchAll: z.ZodOptional<z.ZodBoolean>;
defaultStrategy: z.ZodOptional<z.ZodEnum<{
load: "load";
tap: "tap";
hover: "hover";
viewport: "viewport";
}>>;
}, z.core.$strip>]>>;
image: z.ZodPrefault<z.ZodObject<{
endpoint: z.ZodDefault<z.ZodObject<{
route: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"/_image">, z.ZodString]>>;
entrypoint: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
service: z.ZodDefault<z.ZodObject<{
entrypoint: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"astro/assets/services/sharp">, z.ZodString]>>;
config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
}, z.core.$strip>>;
dangerouslyProcessSVG: z.ZodDefault<z.ZodBoolean>;
domains: z.ZodDefault<z.ZodArray<z.ZodString>>;
remotePatterns: z.ZodDefault<z.ZodArray<z.ZodObject<{
protocol: z.ZodOptional<z.ZodString>;
hostname: z.ZodOptional<z.ZodString>;
port: z.ZodOptional<z.ZodString>;
pathname: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>>;
layout: z.ZodOptional<z.ZodEnum<{
fixed: "fixed";
none: "none";
constrained: "constrained";
"full-width": "full-width";
}>>;
objectFit: z.ZodOptional<z.ZodString>;
objectPosition: z.ZodOptional<z.ZodString>;
breakpoints: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
responsiveStyles: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>>;
devToolbar: z.ZodDefault<z.ZodObject<{
enabled: z.ZodDefault<z.ZodBoolean>;
placement: z.ZodOptional<z.ZodEnum<{
"bottom-left": "bottom-left";
"bottom-center": "bottom-center";
"bottom-right": "bottom-right";
}>>;
}, z.core.$strip>>;
markdown: z.ZodPrefault<z.ZodObject<{
syntaxHighlight: z.ZodDefault<z.ZodUnion<readonly [z.ZodDefault<z.ZodObject<{
type: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"shiki">, z.ZodLiteral<"prism">]>>;
excludeLangs: z.ZodOptional<z.ZodArray<z.ZodString>>;
}, z.core.$strip>>, z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"shiki">, z.ZodLiteral<"prism">]>>, z.ZodLiteral<false>]>>;
shikiConfig: z.ZodPrefault<z.ZodObject<{
langs: z.ZodDefault<z.ZodPipe<z.ZodArray<z.ZodCustom<ShikiLang, ShikiLang>>, z.ZodTransform<ShikiLang[], ShikiLang[]>>>;
langAlias: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
theme: z.ZodDefault<z.ZodUnion<[z.ZodEnum<{
andromeeda: "andromeeda";
"aurora-x": "aurora-x";
"ayu-dark": "ayu-dark";
"ayu-light": "ayu-light";
"ayu-mirage": "ayu-mirage";
"catppuccin-frappe": "catppuccin-frappe";
"catppuccin-latte": "catppuccin-latte";
"catppuccin-macchiato": "catppuccin-macchiato";
"catppuccin-mocha": "catppuccin-mocha";
"dark-plus": "dark-plus";
dracula: "dracula";
"dracula-soft": "dracula-soft";
"everforest-dark": "everforest-dark";
"everforest-light": "everforest-light";
"github-dark": "github-dark";
"github-dark-default": "github-dark-default";
"github-dark-dimmed": "github-dark-dimmed";
"github-dark-high-contrast": "github-dark-high-contrast";
"github-light": "github-light";
"github-light-default": "github-light-default";
"github-light-high-contrast": "github-light-high-contrast";
"gruvbox-dark-hard": "gruvbox-dark-hard";
"gruvbox-dark-medium": "gruvbox-dark-medium";
"gruvbox-dark-soft": "gruvbox-dark-soft";
"gruvbox-light-hard": "gruvbox-light-hard";
"gruvbox-light-medium": "gruvbox-light-medium";
"gruvbox-light-soft": "gruvbox-light-soft";
horizon: "horizon";
"horizon-bright": "horizon-bright";
houston: "houston";
"kanagawa-dragon": "kanagawa-dragon";
"kanagawa-lotus": "kanagawa-lotus";
"kanagawa-wave": "kanagawa-wave";
laserwave: "laserwave";
"light-plus": "light-plus";
"material-theme": "material-theme";
"material-theme-darker": "material-theme-darker";
"material-theme-lighter": "material-theme-lighter";
"material-theme-ocean": "material-theme-ocean";
"material-theme-palenight": "material-theme-palenight";
"min-dark": "min-dark";
"min-light": "min-light";
monokai: "monokai";
"night-owl": "night-owl";
"night-owl-light": "night-owl-light";
nord: "nord";
"one-dark-pro": "one-dark-pro";
"one-light": "one-light";
plastic: "plastic";
poimandres: "poimandres";
red: "red";
"rose-pine": "rose-pine";
"rose-pine-dawn": "rose-pine-dawn";
"rose-pine-moon": "rose-pine-moon";
"slack-dark": "slack-dark";
"slack-ochin": "slack-ochin";
"snazzy-light": "snazzy-light";
"solarized-dark": "solarized-dark";
"solarized-light": "solarized-light";
"synthwave-84": "synthwave-84";
"tokyo-night": "tokyo-night";
vesper: "vesper";
"vitesse-black": "vitesse-black";
"vitesse-dark": "vitesse-dark";
"vitesse-light": "vitesse-light";
}>, z.ZodCustom<ShikiTheme, ShikiTheme>]>>;
themes: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodEnum<{
andromeeda: "andromeeda";
"aurora-x": "aurora-x";
"ayu-dark": "ayu-dark";
"ayu-light": "ayu-light";
"ayu-mirage": "ayu-mirage";
"catppuccin-frappe": "catppuccin-frappe";
"catppuccin-latte": "catppuccin-latte";
"catppuccin-macchiato": "catppuccin-macchiato";
"catppuccin-mocha": "catppuccin-mocha";
"dark-plus": "dark-plus";
dracula: "dracula";
"dracula-soft": "dracula-soft";
"everforest-dark": "everforest-dark";
"everforest-light": "everforest-light";
"github-dark": "github-dark";
"github-dark-default": "github-dark-default";
"github-dark-dimmed": "github-dark-dimmed";
"github-dark-high-contrast": "github-dark-high-contrast";
"github-light": "github-light";
"github-light-default": "github-light-default";
"github-light-high-contrast": "github-light-high-contrast";
"gruvbox-dark-hard": "gruvbox-dark-hard";
"gruvbox-dark-medium": "gruvbox-dark-medium";
"gruvbox-dark-soft": "gruvbox-dark-soft";
"gruvbox-light-hard": "gruvbox-light-hard";
"gruvbox-light-medium": "gruvbox-light-medium";
"gruvbox-light-soft": "gruvbox-light-soft";
horizon: "horizon";
"horizon-bright": "horizon-bright";
houston: "houston";
"kanagawa-dragon": "kanagawa-dragon";
"kanagawa-lotus": "kanagawa-lotus";
"kanagawa-wave": "kanagawa-wave";
laserwave: "laserwave";
"light-plus": "light-plus";
"material-theme": "material-theme";
"material-theme-darker": "material-theme-darker";
"material-theme-lighter": "material-theme-lighter";
"material-theme-ocean": "material-theme-ocean";
"material-theme-palenight": "material-theme-palenight";
"min-dark": "min-dark";
"min-light": "min-light";
monokai: "monokai";
"night-owl": "night-owl";
"night-owl-light": "night-owl-light";
nord: "nord";
"one-dark-pro": "one-dark-pro";
"one-light": "one-light";
plastic: "plastic";
poimandres: "poimandres";
red: "red";
"rose-pine": "rose-pine";
"rose-pine-dawn": "rose-pine-dawn";
"rose-pine-moon": "rose-pine-moon";
"slack-dark": "slack-dark";
"slack-ochin": "slack-ochin";
"snazzy-light": "snazzy-light";
"solarized-dark": "solarized-dark";
"solarized-light": "solarized-light";
"synthwave-84": "synthwave-84";
"tokyo-night": "tokyo-night";
vesper: "vesper";
"vitesse-black": "vitesse-black";
"vitesse-dark": "vitesse-dark";
"vitesse-light": "vitesse-light";
}>, z.ZodCustom<ShikiTheme, ShikiTheme>]>>>>;
defaultColor: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"light">, z.ZodLiteral<"dark">, z.ZodString, z.ZodLiteral<false>]>>;
wrap: z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
transformers: z.ZodDefault<z.ZodArray<z.ZodCustom<ShikiTransformer, ShikiTransformer>>>;
}, z.core.$strip>>;
remarkPlugins: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodTuple<[z.ZodString, z.ZodAny], null>, z.ZodCustom<RemarkPlugin, RemarkPlugin>, z.ZodTuple<[z.ZodCustom<RemarkPlugin, RemarkPlugin>, z.ZodAny], null>]>>>;
rehypePlugins: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodTuple<[z.ZodString, z.ZodAny], null>, z.ZodCustom<RehypePlugin, RehypePlugin>, z.ZodTuple<[z.ZodCustom<RehypePlugin, RehypePlugin>, z.ZodAny], null>]>>>;
remarkRehype: z.ZodDefault<z.ZodCustom<RemarkRehype, RemarkRehype>>;
gfm: z.ZodDefault<z.ZodBoolean>;
smartypants: z.ZodPrefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodType<Smartypants, unknown, z.core.$ZodTypeInternals<Smartypants, unknown>>]>, z.ZodTransform<false | Smartypants, boolean | Smartypants>>>;
}, z.core.$strip>>;
vite: z.ZodDefault<z.ZodCustom<ViteUserConfig, ViteUserConfig>>;
i18n: z.ZodOptional<z.ZodOptional<z.ZodObject<{
defaultLocale: z.ZodString;
locales: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
path: z.ZodString;
codes: z.ZodTuple<[z.ZodString], z.ZodString>;
}, z.core.$strip>]>>;
domains: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
fallback: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
routing: z.ZodPrefault<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"manual">, z.ZodObject<{
prefixDefaultLocale: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
redirectToDefaultLocale: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
fallbackType: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
redirect: "redirect";
rewrite: "rewrite";
}>>>;
}, z.core.$strip>]>>>;
}, z.core.$strip>>>;
security: z.ZodDefault<z.ZodOptional<z.ZodObject<{
checkOrigin: z.ZodDefault<z.ZodBoolean>;
allowedDomains: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
hostname: z.ZodOptional<z.ZodString>;
protocol: z.ZodOptional<z.ZodString>;
port: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>>>;
actionBodySizeLimit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
serverIslandBodySizeLimit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
csp: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodDefault<z.ZodOptional<z.ZodBoolean>>, z.ZodObject<{
algorithm: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
"SHA-256": "SHA-256";
"SHA-384": "SHA-384";
"SHA-512": "SHA-512";
}>>>;
directives: z.ZodOptional<z.ZodArray<z.ZodCustom<`base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`, `base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`>>>;
styleDirective: z.ZodOptional<z.ZodObject<{
resources: z.ZodOptional<z.ZodArray<z.ZodString>>;
hashes: z.ZodOptional<z.ZodArray<z.ZodCustom<`sha256-${string}` | `sha384-${string}` | `sha512-${string}`, `sha256-${string}` | `sha384-${string}` | `sha512-${string}`>>>;
}, z.core.$strip>>;
scriptDirective: z.ZodOptional<z.ZodObject<{
resources: z.ZodOptional<z.ZodArray<z.ZodString>>;
hashes: z.ZodOptional<z.ZodArray<z.ZodCustom<`sha256-${string}` | `sha384-${string}` | `sha512-${string}`, `sha256-${string}` | `sha384-${string}` | `sha512-${string}`>>>;
strictDynamic: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>>;
}, z.core.$strip>]>>>;
}, z.core.$strip>>>;
env: z.ZodDefault<z.ZodOptional<z.ZodObject<{
schema: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodIntersection<z.ZodCustom<{
context: "client";
access: "public";
} | {
context: "server";
access: "public";
} | {
context: "server";
access: "secret";
}, {
context: "client";
access: "public";
} | {
context: "server";
access: "public";
} | {
context: "server";
access: "secret";
}>, z.ZodUnion<readonly [z.ZodObject<{
type: z.ZodLiteral<"string">;
optional: z.ZodOptional<z.ZodBoolean>;
default: z.ZodOptional<z.ZodString>;
max: z.ZodOptional<z.ZodNumber>;
min: z.ZodOptional<z.ZodNumber>;
length: z.ZodOptional<z.ZodNumber>;
url: z.ZodOptional<z.ZodBoolean>;
includes: z.ZodOptional<z.ZodString>;
startsWith: z.ZodOptional<z.ZodString>;
endsWith: z.ZodOptional<z.ZodString>;
}, z.core.$strip>, z.ZodObject<{
type: z.ZodLiteral<"number">;
optional: z.ZodOptional<z.ZodBoolean>;
default: z.ZodOptional<z.ZodNumber>;
gt: z.ZodOptional<z.ZodNumber>;
min: z.ZodOptional<z.ZodNumber>;
lt: z.ZodOptional<z.ZodNumber>;
max: z.ZodOptional<z.ZodNumber>;
int: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>, z.ZodObject<{
type: z.ZodLiteral<"boolean">;
optional: z.ZodOptional<z.ZodBoolean>;
default: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>, z.ZodObject<{
type: z.ZodLiteral<"enum">;
values: z.ZodArray<z.ZodString>;
optional: z.ZodOptional<z.ZodBoolean>;
default: z.ZodOptional<z.ZodString>;
}, z.core.$strip>]>>>>>;
validateSecrets: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
}, z.core.$strict>>>;
session: z.ZodOptional<z.ZodObject<{
driver: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
entrypoint: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<URL, URL>]>;
}, z.core.$strip>]>>;
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
cookie: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
name: z.ZodOptional<z.ZodString>;
domain: z.ZodOptional<z.ZodString>;
path: z.ZodOptional<z.ZodString>;
maxAge: z.ZodOptional<z.ZodNumber>;
sameSite: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
strict: "strict";
lax: "lax";
none: "none";
}>, z.ZodBoolean]>>;
secure: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>, z.ZodPipe<z.ZodString, z.ZodTransform<{
name: string;
}, string>>]>>;
ttl: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
prerenderConflictBehavior: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
error: "error";
ignore: "ignore";
warn: "warn";
}>>>;
fonts: z.ZodOptional<z.ZodArray<z.ZodObject<{
name: z.ZodString;
cssVariable: z.ZodString;
provider: z.ZodCustom<import("../../../assets/fonts/types.js").FontProvider<never>, import("../../../assets/fonts/types.js").FontProvider<never>>;
weights: z.ZodOptional<z.ZodTuple<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>], z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
styles: z.ZodOptional<z.ZodTuple<[z.ZodEnum<{
normal: "normal";
italic: "italic";
oblique: "oblique";
}>], z.ZodEnum<{
normal: "normal";
italic: "italic";
oblique: "oblique";
}>>>;
subsets: z.ZodOptional<z.ZodTuple<[z.ZodString], z.ZodString>>;
formats: z.ZodOptional<z.ZodTuple<[z.ZodEnum<{
woff2: "woff2";
woff: "woff";
otf: "otf";
ttf: "ttf";
eot: "eot";
}>], z.ZodEnum<{
woff2: "woff2";
woff: "woff";
otf: "otf";
ttf: "ttf";
eot: "eot";
}>>>;
fallbacks: z.ZodOptional<z.ZodArray<z.ZodString>>;
optimizedFallbacks: z.ZodOptional<z.ZodBoolean>;
display: z.ZodOptional<z.ZodEnum<{
optional: "optional";
auto: "auto";
block: "block";
swap: "swap";
fallback: "fallback";
}>>;
stretch: z.ZodOptional<z.ZodString>;
featureSettings: z.ZodOptional<z.ZodString>;
variationSettings: z.ZodOptional<z.ZodString>;
unicodeRange: z.ZodOptional<z.ZodTuple<[z.ZodString], z.ZodString>>;
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
}, z.core.$strict>>>;
experimental: z.ZodPrefault<z.ZodObject<{
advancedRouting: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
clientPrerender: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
contentIntellisense: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
chromeDevtoolsWorkspace: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
svgOptimizer: z.ZodOptional<z.ZodObject<{
name: z.ZodString;
optimize: z.ZodCustom<(contents: string) => string | Promise<string>, (contents: string) => string | Promise<string>>;
}, z.core.$strip>>;
cache: z.ZodOptional<z.ZodObject<{
provider: z.ZodOptional<z.ZodObject<{
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
entrypoint: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<URL, URL>]>;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>>;
routeRules: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
maxAge: z.ZodOptional<z.ZodNumber>;
swr: z.ZodOptional<z.ZodNumber>;
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
}, z.core.$strip>>>;
rustCompiler: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
queuedRendering: z.ZodPrefault<z.ZodOptional<z.ZodObject<{
enabled: z.ZodPrefault<z.ZodOptional<z.ZodBoolean>>;
poolSize: z.ZodOptional<z.ZodNumber>;
contentCache: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>>>;
logger: z.ZodOptional<z.ZodObject<{
entrypoint: z.ZodString;
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
}, z.core.$strip>>;
}, z.core.$strict>>;
legacy: z.ZodPrefault<z.ZodObject<{
collectionsBackwardsCompat: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
}, z.core.$strip>>;
}, z.core.$strip>;
export type AstroConfigType = z.infer<typeof AstroConfigSchema>;
export {};

338
node_modules/astro/dist/core/config/schemas/base.js generated vendored Normal file
View File

@@ -0,0 +1,338 @@
import { markdownConfigDefaults, syntaxHighlightDefaults } from "@astrojs/markdown-remark";
import { bundledThemes } from "shiki";
import * as z from "zod/v4";
import { FontFamilySchema } from "../../../assets/fonts/config.js";
import { SvgOptimizerSchema } from "../../../assets/svg/config.js";
import { EnvSchema } from "../../../env/schema.js";
import { CacheSchema, RouteRulesSchema } from "../../cache/config.js";
import { allowedDirectivesSchema, cspAlgorithmSchema, cspHashSchema } from "../../csp/config.js";
import { SessionSchema } from "../../session/config.js";
const ASTRO_CONFIG_DEFAULTS = {
root: ".",
srcDir: "./src",
publicDir: "./public",
outDir: "./dist",
cacheDir: "./node_modules/.astro",
base: "/",
trailingSlash: "ignore",
build: {
format: "directory",
client: "./client/",
server: "./server/",
assets: "_astro",
serverEntry: "entry.mjs",
redirects: true,
inlineStylesheets: "auto",
concurrency: 1
},
image: {
endpoint: { entrypoint: void 0, route: "/_image" },
service: { entrypoint: "astro/assets/services/sharp", config: {} },
dangerouslyProcessSVG: false,
responsiveStyles: false
},
devToolbar: {
enabled: true
},
compressHTML: true,
server: {
host: false,
port: 4321,
open: false,
allowedHosts: []
},
integrations: [],
markdown: markdownConfigDefaults,
vite: {},
legacy: {
collectionsBackwardsCompat: false
},
redirects: {},
security: {
checkOrigin: true,
allowedDomains: [],
csp: false,
actionBodySizeLimit: 1024 * 1024,
serverIslandBodySizeLimit: 1024 * 1024
},
env: {
schema: {},
validateSecrets: false
},
prerenderConflictBehavior: "warn",
experimental: {
advancedRouting: false,
clientPrerender: false,
contentIntellisense: false,
chromeDevtoolsWorkspace: false,
rustCompiler: false,
queuedRendering: {
enabled: false
},
logger: {
entrypoint: "astro/logger/node"
}
}
};
const highlighterTypesSchema = z.union([z.literal("shiki"), z.literal("prism")]).default(syntaxHighlightDefaults.type);
const quoteCharacterMapSchema = z.object({
double: z.string(),
single: z.string()
});
const smartypantsOptionsSchema = z.object({
backticks: z.union([z.boolean(), z.literal("all")]).default(true),
closingQuotes: quoteCharacterMapSchema.default({
double: "\u201D",
single: "\u2019"
}),
dashes: z.union([z.boolean(), z.literal("inverted"), z.literal("oldschool")]).default(true),
ellipses: z.union([z.boolean(), z.literal("spaced"), z.literal("unspaced")]).default(true),
openingQuotes: quoteCharacterMapSchema.default({
double: "\u201C",
single: "\u2018"
}),
quotes: z.boolean().default(true)
});
const AstroConfigSchema = z.object({
root: z.string().optional().default(ASTRO_CONFIG_DEFAULTS.root).transform((val) => new URL(val)),
srcDir: z.string().optional().default(ASTRO_CONFIG_DEFAULTS.srcDir).transform((val) => new URL(val)),
publicDir: z.string().optional().default(ASTRO_CONFIG_DEFAULTS.publicDir).transform((val) => new URL(val)),
outDir: z.string().optional().default(ASTRO_CONFIG_DEFAULTS.outDir).transform((val) => new URL(val)),
cacheDir: z.string().optional().default(ASTRO_CONFIG_DEFAULTS.cacheDir).transform((val) => new URL(val)),
site: z.string().url().optional(),
compressHTML: z.union([z.boolean(), z.literal("jsx")]).optional().default(ASTRO_CONFIG_DEFAULTS.compressHTML),
base: z.string().optional().default(ASTRO_CONFIG_DEFAULTS.base),
trailingSlash: z.union([z.literal("always"), z.literal("never"), z.literal("ignore")]).optional().default(ASTRO_CONFIG_DEFAULTS.trailingSlash),
output: z.union([z.literal("static"), z.literal("server"), z.literal("hybrid")]).optional().default("static").refine((val) => val !== "hybrid", {
message: 'The `output: "hybrid"` option has been removed. Use `output: "static"` (the default) instead, which now behaves the same way.'
}),
scopedStyleStrategy: z.union([z.literal("where"), z.literal("class"), z.literal("attribute")]).optional().default("attribute"),
adapter: z.object({ name: z.string(), hooks: z.object({}).loose().default({}) }).optional(),
integrations: z.preprocess(
// preprocess
(val) => Array.isArray(val) ? val.flat(Number.POSITIVE_INFINITY).filter(Boolean) : val,
// validate
z.array(z.object({ name: z.string(), hooks: z.object({}).loose().default({}) }))
).optional().default(ASTRO_CONFIG_DEFAULTS.integrations),
build: z.object({
format: z.union([z.literal("file"), z.literal("directory"), z.literal("preserve")]).optional().default(ASTRO_CONFIG_DEFAULTS.build.format),
client: z.string().optional().default(ASTRO_CONFIG_DEFAULTS.build.client).transform((val) => new URL(val)),
server: z.string().optional().default(ASTRO_CONFIG_DEFAULTS.build.server).transform((val) => new URL(val)),
assets: z.string().optional().default(ASTRO_CONFIG_DEFAULTS.build.assets),
assetsPrefix: z.string().optional().or(z.object({ fallback: z.string() }).and(z.record(z.string(), z.string()))).optional(),
serverEntry: z.string().optional().default(ASTRO_CONFIG_DEFAULTS.build.serverEntry),
redirects: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.build.redirects),
inlineStylesheets: z.enum(["always", "auto", "never"]).optional().default(ASTRO_CONFIG_DEFAULTS.build.inlineStylesheets),
concurrency: z.number().min(1).optional().default(ASTRO_CONFIG_DEFAULTS.build.concurrency)
}).prefault({}),
server: z.preprocess(
// preprocess
// NOTE: Uses the "error" command here because this is overwritten by the
// individualized schema parser with the correct command.
(val) => typeof val === "function" ? val({ command: "error" }) : val,
// validate
z.object({
open: z.union([z.string(), z.boolean()]).optional().default(ASTRO_CONFIG_DEFAULTS.server.open),
host: z.union([z.string(), z.boolean()]).optional().default(ASTRO_CONFIG_DEFAULTS.server.host),
port: z.number().optional().default(ASTRO_CONFIG_DEFAULTS.server.port),
headers: z.custom().optional(),
allowedHosts: z.union([z.array(z.string()), z.literal(true)]).optional().default(ASTRO_CONFIG_DEFAULTS.server.allowedHosts)
})
).prefault({}),
redirects: z.record(
z.string(),
z.union([
z.string(),
z.object({
status: z.union([
z.literal(300),
z.literal(301),
z.literal(302),
z.literal(303),
z.literal(304),
z.literal(307),
z.literal(308)
]),
destination: z.string()
})
])
).default(ASTRO_CONFIG_DEFAULTS.redirects),
prefetch: z.union([
z.boolean(),
z.object({
prefetchAll: z.boolean().optional(),
defaultStrategy: z.enum(["tap", "hover", "viewport", "load"]).optional()
})
]).optional(),
image: z.object({
endpoint: z.object({
route: z.literal("/_image").or(z.string()).default(ASTRO_CONFIG_DEFAULTS.image.endpoint.route),
entrypoint: z.string().optional()
}).default(ASTRO_CONFIG_DEFAULTS.image.endpoint),
service: z.object({
entrypoint: z.union([z.literal("astro/assets/services/sharp"), z.string()]).default(ASTRO_CONFIG_DEFAULTS.image.service.entrypoint),
config: z.record(z.string(), z.any()).default({})
}).default(ASTRO_CONFIG_DEFAULTS.image.service),
dangerouslyProcessSVG: z.boolean().default(ASTRO_CONFIG_DEFAULTS.image.dangerouslyProcessSVG),
domains: z.array(z.string()).default([]),
remotePatterns: z.array(
z.object({
protocol: z.string().optional(),
hostname: z.string().optional(),
port: z.string().optional(),
pathname: z.string().optional()
})
).default([]),
layout: z.enum(["constrained", "fixed", "full-width", "none"]).optional(),
objectFit: z.string().optional(),
objectPosition: z.string().optional(),
breakpoints: z.array(z.number()).optional(),
responsiveStyles: z.boolean().default(ASTRO_CONFIG_DEFAULTS.image.responsiveStyles)
}).prefault(ASTRO_CONFIG_DEFAULTS.image),
devToolbar: z.object({
enabled: z.boolean().default(ASTRO_CONFIG_DEFAULTS.devToolbar.enabled),
placement: z.enum(["bottom-left", "bottom-center", "bottom-right"]).optional()
}).default(ASTRO_CONFIG_DEFAULTS.devToolbar),
markdown: z.object({
syntaxHighlight: z.union([
z.object({
type: highlighterTypesSchema,
excludeLangs: z.array(z.string()).optional()
}).default(syntaxHighlightDefaults),
highlighterTypesSchema,
z.literal(false)
]).default(ASTRO_CONFIG_DEFAULTS.markdown.syntaxHighlight),
shikiConfig: z.object({
langs: z.custom().array().transform((langs) => {
for (const lang of langs) {
if (typeof lang === "object") {
if (lang.id) {
lang.name = lang.id;
}
if (lang.grammar) {
Object.assign(lang, lang.grammar);
}
}
}
return langs;
}).default([]),
langAlias: z.record(z.string(), z.string()).optional().default(ASTRO_CONFIG_DEFAULTS.markdown.shikiConfig.langAlias),
theme: z.enum(Object.keys(bundledThemes)).or(z.custom()).default(ASTRO_CONFIG_DEFAULTS.markdown.shikiConfig.theme),
themes: z.record(
z.string(),
z.enum(Object.keys(bundledThemes)).or(z.custom())
).optional().default(ASTRO_CONFIG_DEFAULTS.markdown.shikiConfig.themes),
defaultColor: z.union([z.literal("light"), z.literal("dark"), z.string(), z.literal(false)]).optional(),
wrap: z.boolean().or(z.null()).default(ASTRO_CONFIG_DEFAULTS.markdown.shikiConfig.wrap),
transformers: z.custom().array().default(ASTRO_CONFIG_DEFAULTS.markdown.shikiConfig.transformers)
}).prefault({}),
remarkPlugins: z.union([
z.string(),
z.tuple([z.string(), z.any()]),
z.custom((data) => typeof data === "function"),
z.tuple([z.custom((data) => typeof data === "function"), z.any()])
]).array().default(ASTRO_CONFIG_DEFAULTS.markdown.remarkPlugins),
rehypePlugins: z.union([
z.string(),
z.tuple([z.string(), z.any()]),
z.custom((data) => typeof data === "function"),
z.tuple([z.custom((data) => typeof data === "function"), z.any()])
]).array().default(ASTRO_CONFIG_DEFAULTS.markdown.rehypePlugins),
remarkRehype: z.custom((data) => data instanceof Object && !Array.isArray(data)).default(ASTRO_CONFIG_DEFAULTS.markdown.remarkRehype),
gfm: z.boolean().default(ASTRO_CONFIG_DEFAULTS.markdown.gfm),
smartypants: z.union([z.boolean(), smartypantsOptionsSchema]).transform((val) => {
if (val === true) return smartypantsOptionsSchema.parse({});
return val;
}).prefault(ASTRO_CONFIG_DEFAULTS.markdown.smartypants)
}).prefault({}),
vite: z.custom((data) => data instanceof Object && !Array.isArray(data)).default(ASTRO_CONFIG_DEFAULTS.vite),
i18n: z.optional(
z.object({
defaultLocale: z.string(),
locales: z.array(
z.union([
z.string(),
z.object({
path: z.string(),
codes: z.tuple([z.string()], z.string())
})
])
),
domains: z.record(
z.string(),
z.string().url(
"The domain value must be a valid URL, and it has to start with 'https' or 'http'."
)
).optional(),
fallback: z.record(z.string(), z.string()).optional(),
routing: z.literal("manual").or(
z.object({
prefixDefaultLocale: z.boolean().optional().default(false),
redirectToDefaultLocale: z.boolean().optional().default(false),
fallbackType: z.enum(["redirect", "rewrite"]).optional().default("redirect")
})
).optional().prefault({})
}).optional()
),
security: z.object({
checkOrigin: z.boolean().default(ASTRO_CONFIG_DEFAULTS.security.checkOrigin),
allowedDomains: z.array(
z.object({
hostname: z.string().optional(),
protocol: z.string().optional(),
port: z.string().optional()
})
).optional().default(ASTRO_CONFIG_DEFAULTS.security.allowedDomains),
actionBodySizeLimit: z.number().optional().default(ASTRO_CONFIG_DEFAULTS.security.actionBodySizeLimit),
serverIslandBodySizeLimit: z.number().optional().default(ASTRO_CONFIG_DEFAULTS.security.serverIslandBodySizeLimit),
csp: z.union([
z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.security.csp),
z.object({
algorithm: cspAlgorithmSchema,
directives: z.array(allowedDirectivesSchema).optional(),
styleDirective: z.object({
resources: z.array(z.string()).optional(),
hashes: z.array(cspHashSchema).optional()
}).optional(),
scriptDirective: z.object({
resources: z.array(z.string()).optional(),
hashes: z.array(cspHashSchema).optional(),
strictDynamic: z.boolean().optional()
}).optional()
})
]).optional().default(ASTRO_CONFIG_DEFAULTS.security.csp)
}).optional().default(ASTRO_CONFIG_DEFAULTS.security),
env: z.object({
schema: EnvSchema.optional().default(ASTRO_CONFIG_DEFAULTS.env.schema),
validateSecrets: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.env.validateSecrets)
}).strict().optional().default(ASTRO_CONFIG_DEFAULTS.env),
session: SessionSchema.optional(),
prerenderConflictBehavior: z.enum(["error", "warn", "ignore"]).optional().default(ASTRO_CONFIG_DEFAULTS.prerenderConflictBehavior),
fonts: z.array(FontFamilySchema).optional(),
experimental: z.strictObject({
advancedRouting: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.advancedRouting),
clientPrerender: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.clientPrerender),
contentIntellisense: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.contentIntellisense),
chromeDevtoolsWorkspace: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.chromeDevtoolsWorkspace),
svgOptimizer: SvgOptimizerSchema.optional(),
cache: CacheSchema.optional(),
routeRules: RouteRulesSchema.optional(),
rustCompiler: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.rustCompiler),
queuedRendering: z.object({
enabled: z.boolean().optional().prefault(false),
poolSize: z.number().int().nonnegative().optional(),
contentCache: z.boolean().optional()
}).optional().prefault(ASTRO_CONFIG_DEFAULTS.experimental.queuedRendering),
logger: z.object({
entrypoint: z.string(),
config: z.record(z.string(), z.any()).optional()
}).optional()
}).prefault({}),
legacy: z.object({
collectionsBackwardsCompat: z.boolean().optional().default(false)
}).prefault({})
});
export {
ASTRO_CONFIG_DEFAULTS,
AstroConfigSchema
};

View File

@@ -0,0 +1,3 @@
export { ASTRO_CONFIG_DEFAULTS, AstroConfigSchema, type AstroConfigType, } from './base.js';
export { AstroConfigRefinedSchema } from './refined.js';
export { createRelativeSchema } from './relative.js';

12
node_modules/astro/dist/core/config/schemas/index.js generated vendored Normal file
View File

@@ -0,0 +1,12 @@
import {
ASTRO_CONFIG_DEFAULTS,
AstroConfigSchema
} from "./base.js";
import { AstroConfigRefinedSchema } from "./refined.js";
import { createRelativeSchema } from "./relative.js";
export {
ASTRO_CONFIG_DEFAULTS,
AstroConfigRefinedSchema,
AstroConfigSchema,
createRelativeSchema
};

View File

@@ -0,0 +1,44 @@
import type { AstroConfig } from '../../../types/public/config.js';
export interface ConfigValidationIssue {
message: string;
path: (string | number)[];
}
type I18nConfig = NonNullable<AstroConfig['i18n']>;
/**
* Validates that `build.assetsPrefix`, when specified as an object, includes a `fallback` key.
*/
export declare function validateAssetsPrefix(config: Pick<AstroConfig, 'build'>): ConfigValidationIssue[];
/**
* Validates that remote pattern wildcards are only at the start of hostnames
* and at the end of pathnames.
*/
export declare function validateRemotePatterns(remotePatterns: AstroConfig['image']['remotePatterns']): ConfigValidationIssue[];
/**
* Validates that `redirectToDefaultLocale` is not `true` when
* `prefixDefaultLocale` is `false`, which would cause infinite redirects.
*/
export declare function validateI18nRedirectToDefaultLocale(i18n: AstroConfig['i18n']): ConfigValidationIssue[];
/**
* Validates that `outDir` is not inside `publicDir`, which would cause an infinite loop.
*/
export declare function validateOutDirNotInPublicDir(outDir: AstroConfig['outDir'], publicDir: AstroConfig['publicDir']): ConfigValidationIssue[];
/**
* Validates that the default locale is present in the locales array.
*/
export declare function validateI18nDefaultLocale(i18n: Pick<I18nConfig, 'defaultLocale' | 'locales'>): ConfigValidationIssue[];
/**
* Validates i18n fallback entries: keys and values must exist in locales,
* and the default locale cannot be used as a key.
*/
export declare function validateI18nFallback(i18n: Pick<I18nConfig, 'defaultLocale' | 'locales' | 'fallback'>): ConfigValidationIssue[];
/**
* Validates i18n domain entries: locale keys must exist, domain values must be
* valid origin URLs, site must be set, and output must be 'server'.
*/
export declare function validateI18nDomains(config: Pick<AstroConfig, 'site' | 'output' | 'i18n'>): ConfigValidationIssue[];
/**
* Validates that font `cssVariable` values start with `--` and don't contain
* spaces or colons.
*/
export declare function validateFontsCssVariables(fonts: NonNullable<AstroConfig['fonts']>): ConfigValidationIssue[];
export {};

View File

@@ -0,0 +1,168 @@
function validateAssetsPrefix(config) {
if (config.build.assetsPrefix && typeof config.build.assetsPrefix !== "string" && !config.build.assetsPrefix.fallback) {
return [
{
message: "The `fallback` is mandatory when defining the option as an object.",
path: ["build", "assetsPrefix"]
}
];
}
return [];
}
function validateRemotePatterns(remotePatterns) {
const issues = [];
for (let i = 0; i < remotePatterns.length; i++) {
const { hostname, pathname } = remotePatterns[i];
if (hostname && hostname.includes("*") && !(hostname.startsWith("*.") || hostname.startsWith("**."))) {
issues.push({
message: "wildcards can only be placed at the beginning of the hostname",
path: ["image", "remotePatterns", i, "hostname"]
});
}
if (pathname && pathname.includes("*") && !(pathname.endsWith("/*") || pathname.endsWith("/**"))) {
issues.push({
message: "wildcards can only be placed at the end of a pathname",
path: ["image", "remotePatterns", i, "pathname"]
});
}
}
return issues;
}
function validateI18nRedirectToDefaultLocale(i18n) {
if (i18n && typeof i18n.routing !== "string" && i18n.routing.prefixDefaultLocale === false && i18n.routing.redirectToDefaultLocale === true) {
return [
{
message: "The option `i18n.routing.redirectToDefaultLocale` can be used only when `i18n.routing.prefixDefaultLocale` is set to `true`; otherwise, redirects might cause infinite loops. Remove the option `i18n.routing.redirectToDefaultLocale`, or change its value to `false`.",
path: ["i18n", "routing", "redirectToDefaultLocale"]
}
];
}
return [];
}
function validateOutDirNotInPublicDir(outDir, publicDir) {
if (outDir.toString().startsWith(publicDir.toString())) {
return [
{
message: "The value of `outDir` must not point to a path within the folder set as `publicDir`, this will cause an infinite loop",
path: ["outDir"]
}
];
}
return [];
}
function validateI18nDefaultLocale(i18n) {
const locales = i18n.locales.map((locale) => typeof locale === "string" ? locale : locale.path);
if (!locales.includes(i18n.defaultLocale)) {
return [
{
message: `The default locale \`${i18n.defaultLocale}\` is not present in the \`i18n.locales\` array.`,
path: ["i18n", "locales"]
}
];
}
return [];
}
function validateI18nFallback(i18n) {
const issues = [];
const { defaultLocale, fallback } = i18n;
if (!fallback) return [];
const locales = i18n.locales.map((locale) => typeof locale === "string" ? locale : locale.path);
for (const [fallbackFrom, fallbackTo] of Object.entries(fallback)) {
if (!locales.includes(fallbackFrom)) {
issues.push({
message: `The locale \`${fallbackFrom}\` key in the \`i18n.fallback\` record doesn't exist in the \`i18n.locales\` array.`,
path: ["i18n", "fallbacks"]
});
}
if (fallbackFrom === defaultLocale) {
issues.push({
message: `You can't use the default locale as a key. The default locale can only be used as value.`,
path: ["i18n", "fallbacks"]
});
}
if (!locales.includes(fallbackTo)) {
issues.push({
message: `The locale \`${fallbackTo}\` value in the \`i18n.fallback\` record doesn't exist in the \`i18n.locales\` array.`,
path: ["i18n", "fallbacks"]
});
}
}
return issues;
}
function validateI18nDomains(config) {
const issues = [];
const i18n = config.i18n;
if (!i18n?.domains) return [];
const entries = Object.entries(i18n.domains);
const hasDomains = Object.keys(i18n.domains).length > 0;
if (entries.length > 0 && !hasDomains) {
issues.push({
message: `When specifying some domains, the property \`i18n.routing.strategy\` must be set to \`"domains"\`.`,
path: ["i18n", "routing", "strategy"]
});
}
if (hasDomains) {
if (!config.site) {
issues.push({
message: "The option `site` isn't set. When using the 'domains' strategy for `i18n`, `site` is required to create absolute URLs for locales that aren't mapped to a domain.",
path: ["site"]
});
}
if (config.output !== "server") {
issues.push({
message: 'Domain support is only available when `output` is `"server"`.',
path: ["output"]
});
}
}
const locales = i18n.locales.map((locale) => typeof locale === "string" ? locale : locale.path);
for (const [domainKey, domainValue] of entries) {
if (!locales.includes(domainKey)) {
issues.push({
message: `The locale \`${domainKey}\` key in the \`i18n.domains\` record doesn't exist in the \`i18n.locales\` array.`,
path: ["i18n", "domains"]
});
}
if (!domainValue.startsWith("https") && !domainValue.startsWith("http")) {
issues.push({
message: "The domain value must be a valid URL, and it has to start with 'https' or 'http'.",
path: ["i18n", "domains"]
});
} else {
try {
const domainUrl = new URL(domainValue);
if (domainUrl.pathname !== "/") {
issues.push({
message: `The URL \`${domainValue}\` must contain only the origin. A subsequent pathname isn't allowed here. Remove \`${domainUrl.pathname}\`.`,
path: ["i18n", "domains"]
});
}
} catch {
}
}
}
return issues;
}
function validateFontsCssVariables(fonts) {
const issues = [];
for (let i = 0; i < fonts.length; i++) {
const { cssVariable } = fonts[i];
if (!cssVariable.startsWith("--") || cssVariable.includes(" ") || cssVariable.includes(":")) {
issues.push({
message: `**cssVariable** property "${cssVariable}" contains invalid characters for CSS variable generation. It must start with -- and be a valid indent: https://developer.mozilla.org/en-US/docs/Web/CSS/ident.`,
path: ["fonts", i, "cssVariable"]
});
}
}
return issues;
}
export {
validateAssetsPrefix,
validateFontsCssVariables,
validateI18nDefaultLocale,
validateI18nDomains,
validateI18nFallback,
validateI18nRedirectToDefaultLocale,
validateOutDirNotInPublicDir,
validateRemotePatterns
};

View File

@@ -0,0 +1,3 @@
import * as z from 'zod/v4';
import type { AstroConfig } from '../../../types/public/config.js';
export declare const AstroConfigRefinedSchema: z.ZodCustom<AstroConfig, AstroConfig>;

40
node_modules/astro/dist/core/config/schemas/refined.js generated vendored Normal file
View File

@@ -0,0 +1,40 @@
import * as z from "zod/v4";
import {
validateAssetsPrefix,
validateFontsCssVariables,
validateI18nDefaultLocale,
validateI18nDomains,
validateI18nFallback,
validateI18nRedirectToDefaultLocale,
validateOutDirNotInPublicDir,
validateRemotePatterns
} from "./refined-validators.js";
const AstroConfigRefinedSchema = z.custom().superRefine((config, ctx) => {
let issues = [];
issues = issues.concat(
validateAssetsPrefix(config),
validateRemotePatterns(config.image.remotePatterns),
validateI18nRedirectToDefaultLocale(config.i18n),
validateOutDirNotInPublicDir(config.outDir, config.publicDir)
);
if (config.i18n) {
issues = issues.concat(
validateI18nDefaultLocale(config.i18n),
validateI18nFallback(config.i18n),
validateI18nDomains(config)
);
}
if (config.fonts && config.fonts.length > 0) {
issues = issues.concat(validateFontsCssVariables(config.fonts));
}
for (const issue of issues) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message: issue.message,
path: issue.path
});
}
});
export {
AstroConfigRefinedSchema
};

View File

@@ -0,0 +1,949 @@
import type { OutgoingHttpHeaders } from 'node:http';
import * as z from 'zod/v4';
export declare function createRelativeSchema(cmd: string, fileProtocolRoot: string): z.ZodPipe<z.ZodObject<{
site: z.ZodOptional<z.ZodString>;
base: z.ZodDefault<z.ZodOptional<z.ZodString>>;
trailingSlash: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"always">, z.ZodLiteral<"never">, z.ZodLiteral<"ignore">]>>>;
output: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"static">, z.ZodLiteral<"server">, z.ZodLiteral<"hybrid">]>>> & z.ZodType<"server" | "static", "server" | "static" | "hybrid" | undefined, z.core.$ZodTypeInternals<"server" | "static", "server" | "static" | "hybrid" | undefined>>;
scopedStyleStrategy: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"where">, z.ZodLiteral<"class">, z.ZodLiteral<"attribute">]>>>;
adapter: z.ZodOptional<z.ZodObject<{
name: z.ZodString;
hooks: z.ZodDefault<z.ZodObject<{}, z.core.$loose>>;
}, z.core.$strip>>;
integrations: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodArray<z.ZodObject<{
name: z.ZodString;
hooks: z.ZodDefault<z.ZodObject<{}, z.core.$loose>>;
}, z.core.$strip>>>>>;
redirects: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
status: z.ZodUnion<readonly [z.ZodLiteral<300>, z.ZodLiteral<301>, z.ZodLiteral<302>, z.ZodLiteral<303>, z.ZodLiteral<304>, z.ZodLiteral<307>, z.ZodLiteral<308>]>;
destination: z.ZodString;
}, z.core.$strip>]>>>;
prefetch: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
prefetchAll: z.ZodOptional<z.ZodBoolean>;
defaultStrategy: z.ZodOptional<z.ZodEnum<{
load: "load";
tap: "tap";
hover: "hover";
viewport: "viewport";
}>>;
}, z.core.$strip>]>>;
image: z.ZodPrefault<z.ZodObject<{
endpoint: z.ZodDefault<z.ZodObject<{
route: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"/_image">, z.ZodString]>>;
entrypoint: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
service: z.ZodDefault<z.ZodObject<{
entrypoint: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"astro/assets/services/sharp">, z.ZodString]>>;
config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
}, z.core.$strip>>;
dangerouslyProcessSVG: z.ZodDefault<z.ZodBoolean>;
domains: z.ZodDefault<z.ZodArray<z.ZodString>>;
remotePatterns: z.ZodDefault<z.ZodArray<z.ZodObject<{
protocol: z.ZodOptional<z.ZodString>;
hostname: z.ZodOptional<z.ZodString>;
port: z.ZodOptional<z.ZodString>;
pathname: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>>;
layout: z.ZodOptional<z.ZodEnum<{
fixed: "fixed";
none: "none";
constrained: "constrained";
"full-width": "full-width";
}>>;
objectFit: z.ZodOptional<z.ZodString>;
objectPosition: z.ZodOptional<z.ZodString>;
breakpoints: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
responsiveStyles: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>>;
devToolbar: z.ZodDefault<z.ZodObject<{
enabled: z.ZodDefault<z.ZodBoolean>;
placement: z.ZodOptional<z.ZodEnum<{
"bottom-left": "bottom-left";
"bottom-center": "bottom-center";
"bottom-right": "bottom-right";
}>>;
}, z.core.$strip>>;
markdown: z.ZodPrefault<z.ZodObject<{
syntaxHighlight: z.ZodDefault<z.ZodUnion<readonly [z.ZodDefault<z.ZodObject<{
type: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"shiki">, z.ZodLiteral<"prism">]>>;
excludeLangs: z.ZodOptional<z.ZodArray<z.ZodString>>;
}, z.core.$strip>>, z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"shiki">, z.ZodLiteral<"prism">]>>, z.ZodLiteral<false>]>>;
shikiConfig: z.ZodPrefault<z.ZodObject<{
langs: z.ZodDefault<z.ZodPipe<z.ZodArray<z.ZodCustom<import("shiki").LanguageRegistration & import("./base.js").ComplexifyUnionObj, import("shiki").LanguageRegistration & import("./base.js").ComplexifyUnionObj>>, z.ZodTransform<(import("shiki").LanguageRegistration & import("./base.js").ComplexifyUnionObj)[], (import("shiki").LanguageRegistration & import("./base.js").ComplexifyUnionObj)[]>>>;
langAlias: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
theme: z.ZodDefault<z.ZodUnion<[z.ZodEnum<{
andromeeda: "andromeeda";
"aurora-x": "aurora-x";
"ayu-dark": "ayu-dark";
"ayu-light": "ayu-light";
"ayu-mirage": "ayu-mirage";
"catppuccin-frappe": "catppuccin-frappe";
"catppuccin-latte": "catppuccin-latte";
"catppuccin-macchiato": "catppuccin-macchiato";
"catppuccin-mocha": "catppuccin-mocha";
"dark-plus": "dark-plus";
dracula: "dracula";
"dracula-soft": "dracula-soft";
"everforest-dark": "everforest-dark";
"everforest-light": "everforest-light";
"github-dark": "github-dark";
"github-dark-default": "github-dark-default";
"github-dark-dimmed": "github-dark-dimmed";
"github-dark-high-contrast": "github-dark-high-contrast";
"github-light": "github-light";
"github-light-default": "github-light-default";
"github-light-high-contrast": "github-light-high-contrast";
"gruvbox-dark-hard": "gruvbox-dark-hard";
"gruvbox-dark-medium": "gruvbox-dark-medium";
"gruvbox-dark-soft": "gruvbox-dark-soft";
"gruvbox-light-hard": "gruvbox-light-hard";
"gruvbox-light-medium": "gruvbox-light-medium";
"gruvbox-light-soft": "gruvbox-light-soft";
horizon: "horizon";
"horizon-bright": "horizon-bright";
houston: "houston";
"kanagawa-dragon": "kanagawa-dragon";
"kanagawa-lotus": "kanagawa-lotus";
"kanagawa-wave": "kanagawa-wave";
laserwave: "laserwave";
"light-plus": "light-plus";
"material-theme": "material-theme";
"material-theme-darker": "material-theme-darker";
"material-theme-lighter": "material-theme-lighter";
"material-theme-ocean": "material-theme-ocean";
"material-theme-palenight": "material-theme-palenight";
"min-dark": "min-dark";
"min-light": "min-light";
monokai: "monokai";
"night-owl": "night-owl";
"night-owl-light": "night-owl-light";
nord: "nord";
"one-dark-pro": "one-dark-pro";
"one-light": "one-light";
plastic: "plastic";
poimandres: "poimandres";
red: "red";
"rose-pine": "rose-pine";
"rose-pine-dawn": "rose-pine-dawn";
"rose-pine-moon": "rose-pine-moon";
"slack-dark": "slack-dark";
"slack-ochin": "slack-ochin";
"snazzy-light": "snazzy-light";
"solarized-dark": "solarized-dark";
"solarized-light": "solarized-light";
"synthwave-84": "synthwave-84";
"tokyo-night": "tokyo-night";
vesper: "vesper";
"vitesse-black": "vitesse-black";
"vitesse-dark": "vitesse-dark";
"vitesse-light": "vitesse-light";
}>, z.ZodCustom<NonNullable<import("@astrojs/markdown-remark").ThemePresets | import("shiki").ThemeRegistration | import("shiki").ThemeRegistrationRaw | undefined> & import("./base.js").ComplexifyUnionObj, NonNullable<import("@astrojs/markdown-remark").ThemePresets | import("shiki").ThemeRegistration | import("shiki").ThemeRegistrationRaw | undefined> & import("./base.js").ComplexifyUnionObj>]>>;
themes: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodEnum<{
andromeeda: "andromeeda";
"aurora-x": "aurora-x";
"ayu-dark": "ayu-dark";
"ayu-light": "ayu-light";
"ayu-mirage": "ayu-mirage";
"catppuccin-frappe": "catppuccin-frappe";
"catppuccin-latte": "catppuccin-latte";
"catppuccin-macchiato": "catppuccin-macchiato";
"catppuccin-mocha": "catppuccin-mocha";
"dark-plus": "dark-plus";
dracula: "dracula";
"dracula-soft": "dracula-soft";
"everforest-dark": "everforest-dark";
"everforest-light": "everforest-light";
"github-dark": "github-dark";
"github-dark-default": "github-dark-default";
"github-dark-dimmed": "github-dark-dimmed";
"github-dark-high-contrast": "github-dark-high-contrast";
"github-light": "github-light";
"github-light-default": "github-light-default";
"github-light-high-contrast": "github-light-high-contrast";
"gruvbox-dark-hard": "gruvbox-dark-hard";
"gruvbox-dark-medium": "gruvbox-dark-medium";
"gruvbox-dark-soft": "gruvbox-dark-soft";
"gruvbox-light-hard": "gruvbox-light-hard";
"gruvbox-light-medium": "gruvbox-light-medium";
"gruvbox-light-soft": "gruvbox-light-soft";
horizon: "horizon";
"horizon-bright": "horizon-bright";
houston: "houston";
"kanagawa-dragon": "kanagawa-dragon";
"kanagawa-lotus": "kanagawa-lotus";
"kanagawa-wave": "kanagawa-wave";
laserwave: "laserwave";
"light-plus": "light-plus";
"material-theme": "material-theme";
"material-theme-darker": "material-theme-darker";
"material-theme-lighter": "material-theme-lighter";
"material-theme-ocean": "material-theme-ocean";
"material-theme-palenight": "material-theme-palenight";
"min-dark": "min-dark";
"min-light": "min-light";
monokai: "monokai";
"night-owl": "night-owl";
"night-owl-light": "night-owl-light";
nord: "nord";
"one-dark-pro": "one-dark-pro";
"one-light": "one-light";
plastic: "plastic";
poimandres: "poimandres";
red: "red";
"rose-pine": "rose-pine";
"rose-pine-dawn": "rose-pine-dawn";
"rose-pine-moon": "rose-pine-moon";
"slack-dark": "slack-dark";
"slack-ochin": "slack-ochin";
"snazzy-light": "snazzy-light";
"solarized-dark": "solarized-dark";
"solarized-light": "solarized-light";
"synthwave-84": "synthwave-84";
"tokyo-night": "tokyo-night";
vesper: "vesper";
"vitesse-black": "vitesse-black";
"vitesse-dark": "vitesse-dark";
"vitesse-light": "vitesse-light";
}>, z.ZodCustom<NonNullable<import("@astrojs/markdown-remark").ThemePresets | import("shiki").ThemeRegistration | import("shiki").ThemeRegistrationRaw | undefined> & import("./base.js").ComplexifyUnionObj, NonNullable<import("@astrojs/markdown-remark").ThemePresets | import("shiki").ThemeRegistration | import("shiki").ThemeRegistrationRaw | undefined> & import("./base.js").ComplexifyUnionObj>]>>>>;
defaultColor: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"light">, z.ZodLiteral<"dark">, z.ZodString, z.ZodLiteral<false>]>>;
wrap: z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
transformers: z.ZodDefault<z.ZodArray<z.ZodCustom<import("shiki").ShikiTransformer & import("./base.js").ComplexifyUnionObj, import("shiki").ShikiTransformer & import("./base.js").ComplexifyUnionObj>>>;
}, z.core.$strip>>;
remarkPlugins: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodTuple<[z.ZodString, z.ZodAny], null>, z.ZodCustom<import("@astrojs/markdown-remark").RemarkPlugin & import("./base.js").ComplexifyUnionObj, import("@astrojs/markdown-remark").RemarkPlugin & import("./base.js").ComplexifyUnionObj>, z.ZodTuple<[z.ZodCustom<import("@astrojs/markdown-remark").RemarkPlugin & import("./base.js").ComplexifyUnionObj, import("@astrojs/markdown-remark").RemarkPlugin & import("./base.js").ComplexifyUnionObj>, z.ZodAny], null>]>>>;
rehypePlugins: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodTuple<[z.ZodString, z.ZodAny], null>, z.ZodCustom<import("@astrojs/markdown-remark").RehypePlugin & import("./base.js").ComplexifyUnionObj, import("@astrojs/markdown-remark").RehypePlugin & import("./base.js").ComplexifyUnionObj>, z.ZodTuple<[z.ZodCustom<import("@astrojs/markdown-remark").RehypePlugin & import("./base.js").ComplexifyUnionObj, import("@astrojs/markdown-remark").RehypePlugin & import("./base.js").ComplexifyUnionObj>, z.ZodAny], null>]>>>;
remarkRehype: z.ZodDefault<z.ZodCustom<import("./base.js").RemarkRehype, import("./base.js").RemarkRehype>>;
gfm: z.ZodDefault<z.ZodBoolean>;
smartypants: z.ZodPrefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodType<import("./base.js").Smartypants, unknown, z.core.$ZodTypeInternals<import("./base.js").Smartypants, unknown>>]>, z.ZodTransform<false | import("./base.js").Smartypants, boolean | import("./base.js").Smartypants>>>;
}, z.core.$strip>>;
vite: z.ZodDefault<z.ZodCustom<import("../../../index.js").ViteUserConfig, import("../../../index.js").ViteUserConfig>>;
i18n: z.ZodOptional<z.ZodOptional<z.ZodObject<{
defaultLocale: z.ZodString;
locales: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
path: z.ZodString;
codes: z.ZodTuple<[z.ZodString], z.ZodString>;
}, z.core.$strip>]>>;
domains: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
fallback: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
routing: z.ZodPrefault<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"manual">, z.ZodObject<{
prefixDefaultLocale: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
redirectToDefaultLocale: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
fallbackType: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
redirect: "redirect";
rewrite: "rewrite";
}>>>;
}, z.core.$strip>]>>>;
}, z.core.$strip>>>;
security: z.ZodDefault<z.ZodOptional<z.ZodObject<{
checkOrigin: z.ZodDefault<z.ZodBoolean>;
allowedDomains: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
hostname: z.ZodOptional<z.ZodString>;
protocol: z.ZodOptional<z.ZodString>;
port: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>>>;
actionBodySizeLimit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
serverIslandBodySizeLimit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
csp: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodDefault<z.ZodOptional<z.ZodBoolean>>, z.ZodObject<{
algorithm: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
"SHA-256": "SHA-256";
"SHA-384": "SHA-384";
"SHA-512": "SHA-512";
}>>>;
directives: z.ZodOptional<z.ZodArray<z.ZodCustom<`base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`, `base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`>>>;
styleDirective: z.ZodOptional<z.ZodObject<{
resources: z.ZodOptional<z.ZodArray<z.ZodString>>;
hashes: z.ZodOptional<z.ZodArray<z.ZodCustom<`sha256-${string}` | `sha384-${string}` | `sha512-${string}`, `sha256-${string}` | `sha384-${string}` | `sha512-${string}`>>>;
}, z.core.$strip>>;
scriptDirective: z.ZodOptional<z.ZodObject<{
resources: z.ZodOptional<z.ZodArray<z.ZodString>>;
hashes: z.ZodOptional<z.ZodArray<z.ZodCustom<`sha256-${string}` | `sha384-${string}` | `sha512-${string}`, `sha256-${string}` | `sha384-${string}` | `sha512-${string}`>>>;
strictDynamic: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>>;
}, z.core.$strip>]>>>;
}, z.core.$strip>>>;
env: z.ZodDefault<z.ZodOptional<z.ZodObject<{
schema: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodIntersection<z.ZodCustom<{
context: "client";
access: "public";
} | {
context: "server";
access: "public";
} | {
context: "server";
access: "secret";
}, {
context: "client";
access: "public";
} | {
context: "server";
access: "public";
} | {
context: "server";
access: "secret";
}>, z.ZodUnion<readonly [z.ZodObject<{
type: z.ZodLiteral<"string">;
optional: z.ZodOptional<z.ZodBoolean>;
default: z.ZodOptional<z.ZodString>;
max: z.ZodOptional<z.ZodNumber>;
min: z.ZodOptional<z.ZodNumber>;
length: z.ZodOptional<z.ZodNumber>;
url: z.ZodOptional<z.ZodBoolean>;
includes: z.ZodOptional<z.ZodString>;
startsWith: z.ZodOptional<z.ZodString>;
endsWith: z.ZodOptional<z.ZodString>;
}, z.core.$strip>, z.ZodObject<{
type: z.ZodLiteral<"number">;
optional: z.ZodOptional<z.ZodBoolean>;
default: z.ZodOptional<z.ZodNumber>;
gt: z.ZodOptional<z.ZodNumber>;
min: z.ZodOptional<z.ZodNumber>;
lt: z.ZodOptional<z.ZodNumber>;
max: z.ZodOptional<z.ZodNumber>;
int: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>, z.ZodObject<{
type: z.ZodLiteral<"boolean">;
optional: z.ZodOptional<z.ZodBoolean>;
default: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>, z.ZodObject<{
type: z.ZodLiteral<"enum">;
values: z.ZodArray<z.ZodString>;
optional: z.ZodOptional<z.ZodBoolean>;
default: z.ZodOptional<z.ZodString>;
}, z.core.$strip>]>>>>>;
validateSecrets: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
}, z.core.$strict>>>;
session: z.ZodOptional<z.ZodObject<{
driver: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
entrypoint: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<URL, URL>]>;
}, z.core.$strip>]>>;
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
cookie: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
name: z.ZodOptional<z.ZodString>;
domain: z.ZodOptional<z.ZodString>;
path: z.ZodOptional<z.ZodString>;
maxAge: z.ZodOptional<z.ZodNumber>;
sameSite: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
strict: "strict";
lax: "lax";
none: "none";
}>, z.ZodBoolean]>>;
secure: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>, z.ZodPipe<z.ZodString, z.ZodTransform<{
name: string;
}, string>>]>>;
ttl: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
prerenderConflictBehavior: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
error: "error";
ignore: "ignore";
warn: "warn";
}>>>;
fonts: z.ZodOptional<z.ZodArray<z.ZodObject<{
name: z.ZodString;
cssVariable: z.ZodString;
provider: z.ZodCustom<import("../../../index.js").FontProvider<never>, import("../../../index.js").FontProvider<never>>;
weights: z.ZodOptional<z.ZodTuple<[z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>], z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
styles: z.ZodOptional<z.ZodTuple<[z.ZodEnum<{
normal: "normal";
italic: "italic";
oblique: "oblique";
}>], z.ZodEnum<{
normal: "normal";
italic: "italic";
oblique: "oblique";
}>>>;
subsets: z.ZodOptional<z.ZodTuple<[z.ZodString], z.ZodString>>;
formats: z.ZodOptional<z.ZodTuple<[z.ZodEnum<{
woff2: "woff2";
woff: "woff";
otf: "otf";
ttf: "ttf";
eot: "eot";
}>], z.ZodEnum<{
woff2: "woff2";
woff: "woff";
otf: "otf";
ttf: "ttf";
eot: "eot";
}>>>;
fallbacks: z.ZodOptional<z.ZodArray<z.ZodString>>;
optimizedFallbacks: z.ZodOptional<z.ZodBoolean>;
display: z.ZodOptional<z.ZodEnum<{
optional: "optional";
auto: "auto";
block: "block";
swap: "swap";
fallback: "fallback";
}>>;
stretch: z.ZodOptional<z.ZodString>;
featureSettings: z.ZodOptional<z.ZodString>;
variationSettings: z.ZodOptional<z.ZodString>;
unicodeRange: z.ZodOptional<z.ZodTuple<[z.ZodString], z.ZodString>>;
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
}, z.core.$strict>>>;
experimental: z.ZodPrefault<z.ZodObject<{
advancedRouting: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
clientPrerender: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
contentIntellisense: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
chromeDevtoolsWorkspace: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
svgOptimizer: z.ZodOptional<z.ZodObject<{
name: z.ZodString;
optimize: z.ZodCustom<(contents: string) => string | Promise<string>, (contents: string) => string | Promise<string>>;
}, z.core.$strip>>;
cache: z.ZodOptional<z.ZodObject<{
provider: z.ZodOptional<z.ZodObject<{
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
entrypoint: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<URL, URL>]>;
name: z.ZodOptional<z.ZodString>;
}, z.core.$strip>>;
}, z.core.$strip>>;
routeRules: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
maxAge: z.ZodOptional<z.ZodNumber>;
swr: z.ZodOptional<z.ZodNumber>;
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
}, z.core.$strip>>>;
rustCompiler: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
queuedRendering: z.ZodPrefault<z.ZodOptional<z.ZodObject<{
enabled: z.ZodPrefault<z.ZodOptional<z.ZodBoolean>>;
poolSize: z.ZodOptional<z.ZodNumber>;
contentCache: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>>>;
logger: z.ZodOptional<z.ZodObject<{
entrypoint: z.ZodString;
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
}, z.core.$strip>>;
}, z.core.$strict>>;
legacy: z.ZodPrefault<z.ZodObject<{
collectionsBackwardsCompat: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
}, z.core.$strip>>;
root: z.ZodPipe<z.ZodDefault<z.ZodString>, z.ZodTransform<import("url").URL, string>>;
srcDir: z.ZodPipe<z.ZodDefault<z.ZodString>, z.ZodTransform<import("url").URL, string>>;
compressHTML: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"jsx">]>>>;
publicDir: z.ZodPipe<z.ZodDefault<z.ZodString>, z.ZodTransform<import("url").URL, string>>;
outDir: z.ZodPipe<z.ZodDefault<z.ZodString>, z.ZodTransform<import("url").URL, string>>;
cacheDir: z.ZodPipe<z.ZodDefault<z.ZodString>, z.ZodTransform<import("url").URL, string>>;
build: z.ZodPrefault<z.ZodOptional<z.ZodObject<{
format: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"file">, z.ZodLiteral<"directory">, z.ZodLiteral<"preserve">]>>>;
client: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodString>>, z.ZodTransform<import("url").URL, string>>;
server: z.ZodPipe<z.ZodDefault<z.ZodOptional<z.ZodString>>, z.ZodTransform<import("url").URL, string>>;
assets: z.ZodDefault<z.ZodOptional<z.ZodString>>;
assetsPrefix: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodOptional<z.ZodIntersection<z.ZodObject<{
fallback: z.ZodString;
}, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodString>>>]>;
serverEntry: z.ZodDefault<z.ZodOptional<z.ZodString>>;
redirects: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
inlineStylesheets: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
never: "never";
auto: "auto";
always: "always";
}>>>;
concurrency: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
}, z.core.$strip>>>;
server: z.ZodPrefault<z.ZodPipe<z.ZodTransform<any, unknown>, z.ZodObject<{
open: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
host: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodBoolean]>>>;
port: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
headers: z.ZodOptional<z.ZodCustom<OutgoingHttpHeaders, OutgoingHttpHeaders>>;
allowedHosts: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<true>]>>>;
}, z.core.$strip>>>;
}, z.core.$strip>, z.ZodTransform<{
base: string;
trailingSlash: "never" | "ignore" | "always";
output: "server" | "static";
scopedStyleStrategy: "where" | "class" | "attribute";
integrations: {
name: string;
hooks: {
[x: string]: unknown;
};
}[];
redirects: Record<string, string | {
status: 301 | 302 | 303 | 307 | 308 | 300 | 304;
destination: string;
}>;
image: {
endpoint: {
route: string;
entrypoint?: string | undefined;
};
service: {
entrypoint: string;
config: Record<string, any>;
};
dangerouslyProcessSVG: boolean;
domains: string[];
remotePatterns: {
protocol?: string | undefined;
hostname?: string | undefined;
port?: string | undefined;
pathname?: string | undefined;
}[];
responsiveStyles: boolean;
layout?: "fixed" | "none" | "constrained" | "full-width" | undefined;
objectFit?: string | undefined;
objectPosition?: string | undefined;
breakpoints?: number[] | undefined;
};
devToolbar: {
enabled: boolean;
placement?: "bottom-left" | "bottom-center" | "bottom-right" | undefined;
};
markdown: {
syntaxHighlight: false | "shiki" | "prism" | {
type: "shiki" | "prism";
excludeLangs?: string[] | undefined;
};
shikiConfig: {
langs: (import("shiki").LanguageRegistration & import("./base.js").ComplexifyUnionObj)[];
langAlias: Record<string, string>;
theme: "andromeeda" | "aurora-x" | "ayu-dark" | "ayu-light" | "ayu-mirage" | "catppuccin-frappe" | "catppuccin-latte" | "catppuccin-macchiato" | "catppuccin-mocha" | "dark-plus" | "dracula" | "dracula-soft" | "everforest-dark" | "everforest-light" | "github-dark" | "github-dark-default" | "github-dark-dimmed" | "github-dark-high-contrast" | "github-light" | "github-light-default" | "github-light-high-contrast" | "gruvbox-dark-hard" | "gruvbox-dark-medium" | "gruvbox-dark-soft" | "gruvbox-light-hard" | "gruvbox-light-medium" | "gruvbox-light-soft" | "horizon" | "horizon-bright" | "houston" | "kanagawa-dragon" | "kanagawa-lotus" | "kanagawa-wave" | "laserwave" | "light-plus" | "material-theme" | "material-theme-darker" | "material-theme-lighter" | "material-theme-ocean" | "material-theme-palenight" | "min-dark" | "min-light" | "monokai" | "night-owl" | "night-owl-light" | "nord" | "one-dark-pro" | "one-light" | "plastic" | "poimandres" | "red" | "rose-pine" | "rose-pine-dawn" | "rose-pine-moon" | "slack-dark" | "slack-ochin" | "snazzy-light" | "solarized-dark" | "solarized-light" | "synthwave-84" | "tokyo-night" | "vesper" | "vitesse-black" | "vitesse-dark" | "vitesse-light" | (NonNullable<import("@astrojs/markdown-remark").ThemePresets | import("shiki").ThemeRegistration | import("shiki").ThemeRegistrationRaw | undefined> & import("./base.js").ComplexifyUnionObj);
themes: Record<string, "andromeeda" | "aurora-x" | "ayu-dark" | "ayu-light" | "ayu-mirage" | "catppuccin-frappe" | "catppuccin-latte" | "catppuccin-macchiato" | "catppuccin-mocha" | "dark-plus" | "dracula" | "dracula-soft" | "everforest-dark" | "everforest-light" | "github-dark" | "github-dark-default" | "github-dark-dimmed" | "github-dark-high-contrast" | "github-light" | "github-light-default" | "github-light-high-contrast" | "gruvbox-dark-hard" | "gruvbox-dark-medium" | "gruvbox-dark-soft" | "gruvbox-light-hard" | "gruvbox-light-medium" | "gruvbox-light-soft" | "horizon" | "horizon-bright" | "houston" | "kanagawa-dragon" | "kanagawa-lotus" | "kanagawa-wave" | "laserwave" | "light-plus" | "material-theme" | "material-theme-darker" | "material-theme-lighter" | "material-theme-ocean" | "material-theme-palenight" | "min-dark" | "min-light" | "monokai" | "night-owl" | "night-owl-light" | "nord" | "one-dark-pro" | "one-light" | "plastic" | "poimandres" | "red" | "rose-pine" | "rose-pine-dawn" | "rose-pine-moon" | "slack-dark" | "slack-ochin" | "snazzy-light" | "solarized-dark" | "solarized-light" | "synthwave-84" | "tokyo-night" | "vesper" | "vitesse-black" | "vitesse-dark" | "vitesse-light" | (NonNullable<import("@astrojs/markdown-remark").ThemePresets | import("shiki").ThemeRegistration | import("shiki").ThemeRegistrationRaw | undefined> & import("./base.js").ComplexifyUnionObj)>;
wrap: boolean | null;
transformers: (import("shiki").ShikiTransformer & import("./base.js").ComplexifyUnionObj)[];
defaultColor?: string | false | undefined;
};
remarkPlugins: (string | (import("@astrojs/markdown-remark").RemarkPlugin & import("./base.js").ComplexifyUnionObj) | [string, any] | [import("@astrojs/markdown-remark").RemarkPlugin & import("./base.js").ComplexifyUnionObj, any])[];
rehypePlugins: (string | (import("@astrojs/markdown-remark").RehypePlugin & import("./base.js").ComplexifyUnionObj) | [string, any] | [import("@astrojs/markdown-remark").RehypePlugin & import("./base.js").ComplexifyUnionObj, any])[];
remarkRehype: import("./base.js").RemarkRehype;
gfm: boolean;
smartypants: false | import("./base.js").Smartypants;
};
vite: import("../../../index.js").ViteUserConfig;
security: {
checkOrigin: boolean;
allowedDomains: {
hostname?: string | undefined;
protocol?: string | undefined;
port?: string | undefined;
}[];
actionBodySizeLimit: number;
serverIslandBodySizeLimit: number;
csp: boolean | {
algorithm: "SHA-256" | "SHA-384" | "SHA-512";
directives?: (`base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`)[] | undefined;
styleDirective?: {
resources?: string[] | undefined;
hashes?: (`sha256-${string}` | `sha384-${string}` | `sha512-${string}`)[] | undefined;
} | undefined;
scriptDirective?: {
resources?: string[] | undefined;
hashes?: (`sha256-${string}` | `sha384-${string}` | `sha512-${string}`)[] | undefined;
strictDynamic?: boolean | undefined;
} | undefined;
};
};
env: {
schema: Record<string, ({
context: "client";
access: "public";
} | {
context: "server";
access: "public";
} | {
context: "server";
access: "secret";
}) & ({
type: "string";
optional?: boolean | undefined;
default?: string | undefined;
max?: number | undefined;
min?: number | undefined;
length?: number | undefined;
url?: boolean | undefined;
includes?: string | undefined;
startsWith?: string | undefined;
endsWith?: string | undefined;
} | {
type: "number";
optional?: boolean | undefined;
default?: number | undefined;
gt?: number | undefined;
min?: number | undefined;
lt?: number | undefined;
max?: number | undefined;
int?: boolean | undefined;
} | {
type: "enum";
values: string[];
optional?: boolean | undefined;
default?: string | undefined;
} | {
type: "boolean";
optional?: boolean | undefined;
default?: boolean | undefined;
})>;
validateSecrets: boolean;
};
prerenderConflictBehavior: "error" | "ignore" | "warn";
experimental: {
advancedRouting: boolean;
clientPrerender: boolean;
contentIntellisense: boolean;
chromeDevtoolsWorkspace: boolean;
rustCompiler: boolean;
queuedRendering: {
enabled: boolean;
poolSize?: number | undefined;
contentCache?: boolean | undefined;
};
svgOptimizer?: {
name: string;
optimize: (contents: string) => string | Promise<string>;
} | undefined;
cache?: {
provider?: {
entrypoint: string | URL;
config?: Record<string, any> | undefined;
name?: string | undefined;
} | undefined;
} | undefined;
routeRules?: Record<string, {
maxAge?: number | undefined;
swr?: number | undefined;
tags?: string[] | undefined;
}> | undefined;
logger?: {
entrypoint: string;
config?: Record<string, any> | undefined;
} | undefined;
};
legacy: {
collectionsBackwardsCompat: boolean;
};
root: import("url").URL;
srcDir: import("url").URL;
compressHTML: boolean | "jsx";
publicDir: import("url").URL;
outDir: import("url").URL;
cacheDir: import("url").URL;
build: {
format: "file" | "directory" | "preserve";
client: import("url").URL;
server: import("url").URL;
assets: string;
serverEntry: string;
redirects: boolean;
inlineStylesheets: "never" | "auto" | "always";
concurrency: number;
assetsPrefix?: string | ({
fallback: string;
} & Record<string, string>) | undefined;
};
server: {
open: string | boolean;
host: string | boolean;
port: number;
allowedHosts: true | string[];
headers?: OutgoingHttpHeaders | undefined;
};
site?: string | undefined;
adapter?: {
name: string;
hooks: {
[x: string]: unknown;
};
} | undefined;
prefetch?: boolean | {
prefetchAll?: boolean | undefined;
defaultStrategy?: "load" | "tap" | "hover" | "viewport" | undefined;
} | undefined;
i18n?: {
defaultLocale: string;
locales: (string | {
path: string;
codes: [string, ...string[]];
})[];
routing: "manual" | {
prefixDefaultLocale: boolean;
redirectToDefaultLocale: boolean;
fallbackType: "redirect" | "rewrite";
};
domains?: Record<string, string> | undefined;
fallback?: Record<string, string> | undefined;
} | undefined;
session?: {
driver?: string | {
entrypoint: string | URL;
config?: Record<string, any> | undefined;
} | undefined;
options?: Record<string, any> | undefined;
cookie?: {
name: string;
} | {
name?: string | undefined;
domain?: string | undefined;
path?: string | undefined;
maxAge?: number | undefined;
sameSite?: boolean | "strict" | "lax" | "none" | undefined;
secure?: boolean | undefined;
} | undefined;
ttl?: number | undefined;
} | undefined;
fonts?: {
name: string;
cssVariable: string;
provider: import("../../../index.js").FontProvider<never>;
weights?: [string | number, ...(string | number)[]] | undefined;
styles?: ["normal" | "italic" | "oblique", ...("normal" | "italic" | "oblique")[]] | undefined;
subsets?: [string, ...string[]] | undefined;
formats?: ["woff2" | "woff" | "otf" | "ttf" | "eot", ...("woff2" | "woff" | "otf" | "ttf" | "eot")[]] | undefined;
fallbacks?: string[] | undefined;
optimizedFallbacks?: boolean | undefined;
display?: "optional" | "auto" | "block" | "swap" | "fallback" | undefined;
stretch?: string | undefined;
featureSettings?: string | undefined;
variationSettings?: string | undefined;
unicodeRange?: [string, ...string[]] | undefined;
options?: Record<string, any> | undefined;
}[] | undefined;
}, {
base: string;
trailingSlash: "never" | "ignore" | "always";
output: "server" | "static";
scopedStyleStrategy: "where" | "class" | "attribute";
integrations: {
name: string;
hooks: {
[x: string]: unknown;
};
}[];
redirects: Record<string, string | {
status: 301 | 302 | 303 | 307 | 308 | 300 | 304;
destination: string;
}>;
image: {
endpoint: {
route: string;
entrypoint?: string | undefined;
};
service: {
entrypoint: string;
config: Record<string, any>;
};
dangerouslyProcessSVG: boolean;
domains: string[];
remotePatterns: {
protocol?: string | undefined;
hostname?: string | undefined;
port?: string | undefined;
pathname?: string | undefined;
}[];
responsiveStyles: boolean;
layout?: "fixed" | "none" | "constrained" | "full-width" | undefined;
objectFit?: string | undefined;
objectPosition?: string | undefined;
breakpoints?: number[] | undefined;
};
devToolbar: {
enabled: boolean;
placement?: "bottom-left" | "bottom-center" | "bottom-right" | undefined;
};
markdown: {
syntaxHighlight: false | "shiki" | "prism" | {
type: "shiki" | "prism";
excludeLangs?: string[] | undefined;
};
shikiConfig: {
langs: (import("shiki").LanguageRegistration & import("./base.js").ComplexifyUnionObj)[];
langAlias: Record<string, string>;
theme: "andromeeda" | "aurora-x" | "ayu-dark" | "ayu-light" | "ayu-mirage" | "catppuccin-frappe" | "catppuccin-latte" | "catppuccin-macchiato" | "catppuccin-mocha" | "dark-plus" | "dracula" | "dracula-soft" | "everforest-dark" | "everforest-light" | "github-dark" | "github-dark-default" | "github-dark-dimmed" | "github-dark-high-contrast" | "github-light" | "github-light-default" | "github-light-high-contrast" | "gruvbox-dark-hard" | "gruvbox-dark-medium" | "gruvbox-dark-soft" | "gruvbox-light-hard" | "gruvbox-light-medium" | "gruvbox-light-soft" | "horizon" | "horizon-bright" | "houston" | "kanagawa-dragon" | "kanagawa-lotus" | "kanagawa-wave" | "laserwave" | "light-plus" | "material-theme" | "material-theme-darker" | "material-theme-lighter" | "material-theme-ocean" | "material-theme-palenight" | "min-dark" | "min-light" | "monokai" | "night-owl" | "night-owl-light" | "nord" | "one-dark-pro" | "one-light" | "plastic" | "poimandres" | "red" | "rose-pine" | "rose-pine-dawn" | "rose-pine-moon" | "slack-dark" | "slack-ochin" | "snazzy-light" | "solarized-dark" | "solarized-light" | "synthwave-84" | "tokyo-night" | "vesper" | "vitesse-black" | "vitesse-dark" | "vitesse-light" | (NonNullable<import("@astrojs/markdown-remark").ThemePresets | import("shiki").ThemeRegistration | import("shiki").ThemeRegistrationRaw | undefined> & import("./base.js").ComplexifyUnionObj);
themes: Record<string, "andromeeda" | "aurora-x" | "ayu-dark" | "ayu-light" | "ayu-mirage" | "catppuccin-frappe" | "catppuccin-latte" | "catppuccin-macchiato" | "catppuccin-mocha" | "dark-plus" | "dracula" | "dracula-soft" | "everforest-dark" | "everforest-light" | "github-dark" | "github-dark-default" | "github-dark-dimmed" | "github-dark-high-contrast" | "github-light" | "github-light-default" | "github-light-high-contrast" | "gruvbox-dark-hard" | "gruvbox-dark-medium" | "gruvbox-dark-soft" | "gruvbox-light-hard" | "gruvbox-light-medium" | "gruvbox-light-soft" | "horizon" | "horizon-bright" | "houston" | "kanagawa-dragon" | "kanagawa-lotus" | "kanagawa-wave" | "laserwave" | "light-plus" | "material-theme" | "material-theme-darker" | "material-theme-lighter" | "material-theme-ocean" | "material-theme-palenight" | "min-dark" | "min-light" | "monokai" | "night-owl" | "night-owl-light" | "nord" | "one-dark-pro" | "one-light" | "plastic" | "poimandres" | "red" | "rose-pine" | "rose-pine-dawn" | "rose-pine-moon" | "slack-dark" | "slack-ochin" | "snazzy-light" | "solarized-dark" | "solarized-light" | "synthwave-84" | "tokyo-night" | "vesper" | "vitesse-black" | "vitesse-dark" | "vitesse-light" | (NonNullable<import("@astrojs/markdown-remark").ThemePresets | import("shiki").ThemeRegistration | import("shiki").ThemeRegistrationRaw | undefined> & import("./base.js").ComplexifyUnionObj)>;
wrap: boolean | null;
transformers: (import("shiki").ShikiTransformer & import("./base.js").ComplexifyUnionObj)[];
defaultColor?: string | false | undefined;
};
remarkPlugins: (string | (import("@astrojs/markdown-remark").RemarkPlugin & import("./base.js").ComplexifyUnionObj) | [string, any] | [import("@astrojs/markdown-remark").RemarkPlugin & import("./base.js").ComplexifyUnionObj, any])[];
rehypePlugins: (string | (import("@astrojs/markdown-remark").RehypePlugin & import("./base.js").ComplexifyUnionObj) | [string, any] | [import("@astrojs/markdown-remark").RehypePlugin & import("./base.js").ComplexifyUnionObj, any])[];
remarkRehype: import("./base.js").RemarkRehype;
gfm: boolean;
smartypants: false | import("./base.js").Smartypants;
};
vite: import("../../../index.js").ViteUserConfig;
security: {
checkOrigin: boolean;
allowedDomains: {
hostname?: string | undefined;
protocol?: string | undefined;
port?: string | undefined;
}[];
actionBodySizeLimit: number;
serverIslandBodySizeLimit: number;
csp: boolean | {
algorithm: "SHA-256" | "SHA-384" | "SHA-512";
directives?: (`base-uri${string}` | `child-src${string}` | `connect-src${string}` | `default-src${string}` | `fenced-frame-src${string}` | `font-src${string}` | `form-action${string}` | `frame-ancestors${string}` | `frame-src${string}` | `img-src${string}` | `manifest-src${string}` | `media-src${string}` | `object-src${string}` | `referrer${string}` | `report-to${string}` | `report-uri${string}` | `require-trusted-types-for${string}` | `sandbox${string}` | `trusted-types${string}` | `upgrade-insecure-requests${string}` | `worker-src${string}`)[] | undefined;
styleDirective?: {
resources?: string[] | undefined;
hashes?: (`sha256-${string}` | `sha384-${string}` | `sha512-${string}`)[] | undefined;
} | undefined;
scriptDirective?: {
resources?: string[] | undefined;
hashes?: (`sha256-${string}` | `sha384-${string}` | `sha512-${string}`)[] | undefined;
strictDynamic?: boolean | undefined;
} | undefined;
};
};
env: {
schema: Record<string, ({
context: "client";
access: "public";
} | {
context: "server";
access: "public";
} | {
context: "server";
access: "secret";
}) & ({
type: "string";
optional?: boolean | undefined;
default?: string | undefined;
max?: number | undefined;
min?: number | undefined;
length?: number | undefined;
url?: boolean | undefined;
includes?: string | undefined;
startsWith?: string | undefined;
endsWith?: string | undefined;
} | {
type: "number";
optional?: boolean | undefined;
default?: number | undefined;
gt?: number | undefined;
min?: number | undefined;
lt?: number | undefined;
max?: number | undefined;
int?: boolean | undefined;
} | {
type: "enum";
values: string[];
optional?: boolean | undefined;
default?: string | undefined;
} | {
type: "boolean";
optional?: boolean | undefined;
default?: boolean | undefined;
})>;
validateSecrets: boolean;
};
prerenderConflictBehavior: "error" | "ignore" | "warn";
experimental: {
advancedRouting: boolean;
clientPrerender: boolean;
contentIntellisense: boolean;
chromeDevtoolsWorkspace: boolean;
rustCompiler: boolean;
queuedRendering: {
enabled: boolean;
poolSize?: number | undefined;
contentCache?: boolean | undefined;
};
svgOptimizer?: {
name: string;
optimize: (contents: string) => string | Promise<string>;
} | undefined;
cache?: {
provider?: {
entrypoint: string | URL;
config?: Record<string, any> | undefined;
name?: string | undefined;
} | undefined;
} | undefined;
routeRules?: Record<string, {
maxAge?: number | undefined;
swr?: number | undefined;
tags?: string[] | undefined;
}> | undefined;
logger?: {
entrypoint: string;
config?: Record<string, any> | undefined;
} | undefined;
};
legacy: {
collectionsBackwardsCompat: boolean;
};
root: import("url").URL;
srcDir: import("url").URL;
compressHTML: boolean | "jsx";
publicDir: import("url").URL;
outDir: import("url").URL;
cacheDir: import("url").URL;
build: {
format: "file" | "directory" | "preserve";
client: import("url").URL;
server: import("url").URL;
assets: string;
serverEntry: string;
redirects: boolean;
inlineStylesheets: "never" | "auto" | "always";
concurrency: number;
assetsPrefix?: string | ({
fallback: string;
} & Record<string, string>) | undefined;
};
server: {
open: string | boolean;
host: string | boolean;
port: number;
allowedHosts: true | string[];
headers?: OutgoingHttpHeaders | undefined;
};
site?: string | undefined;
adapter?: {
name: string;
hooks: {
[x: string]: unknown;
};
} | undefined;
prefetch?: boolean | {
prefetchAll?: boolean | undefined;
defaultStrategy?: "load" | "tap" | "hover" | "viewport" | undefined;
} | undefined;
i18n?: {
defaultLocale: string;
locales: (string | {
path: string;
codes: [string, ...string[]];
})[];
routing: "manual" | {
prefixDefaultLocale: boolean;
redirectToDefaultLocale: boolean;
fallbackType: "redirect" | "rewrite";
};
domains?: Record<string, string> | undefined;
fallback?: Record<string, string> | undefined;
} | undefined;
session?: {
driver?: string | {
entrypoint: string | URL;
config?: Record<string, any> | undefined;
} | undefined;
options?: Record<string, any> | undefined;
cookie?: {
name: string;
} | {
name?: string | undefined;
domain?: string | undefined;
path?: string | undefined;
maxAge?: number | undefined;
sameSite?: boolean | "strict" | "lax" | "none" | undefined;
secure?: boolean | undefined;
} | undefined;
ttl?: number | undefined;
} | undefined;
fonts?: {
name: string;
cssVariable: string;
provider: import("../../../index.js").FontProvider<never>;
weights?: [string | number, ...(string | number)[]] | undefined;
styles?: ["normal" | "italic" | "oblique", ...("normal" | "italic" | "oblique")[]] | undefined;
subsets?: [string, ...string[]] | undefined;
formats?: ["woff2" | "woff" | "otf" | "ttf" | "eot", ...("woff2" | "woff" | "otf" | "ttf" | "eot")[]] | undefined;
fallbacks?: string[] | undefined;
optimizedFallbacks?: boolean | undefined;
display?: "optional" | "auto" | "block" | "swap" | "fallback" | undefined;
stretch?: string | undefined;
featureSettings?: string | undefined;
variationSettings?: string | undefined;
unicodeRange?: [string, ...string[]] | undefined;
options?: Record<string, any> | undefined;
}[] | undefined;
}>>;

View File

@@ -0,0 +1,91 @@
import path from "node:path";
import { fileURLToPath, pathToFileURL } from "node:url";
import * as z from "zod/v4";
import { appendForwardSlash, prependForwardSlash, removeTrailingForwardSlash } from "../../path.js";
import { ASTRO_CONFIG_DEFAULTS, AstroConfigSchema } from "./base.js";
function resolveDirAsUrl(dir, root) {
let resolvedDir = path.resolve(root, dir);
if (!resolvedDir.endsWith(path.sep)) {
resolvedDir += path.sep;
}
return pathToFileURL(resolvedDir);
}
function createRelativeSchema(cmd, fileProtocolRoot) {
let originalBuildClient;
let originalBuildServer;
const AstroConfigRelativeSchema = AstroConfigSchema.extend({
root: z.string().default(ASTRO_CONFIG_DEFAULTS.root).transform((val) => resolveDirAsUrl(val, fileProtocolRoot)),
srcDir: z.string().default(ASTRO_CONFIG_DEFAULTS.srcDir).transform((val) => resolveDirAsUrl(val, fileProtocolRoot)),
compressHTML: z.union([z.boolean(), z.literal("jsx")]).optional().default(ASTRO_CONFIG_DEFAULTS.compressHTML),
publicDir: z.string().default(ASTRO_CONFIG_DEFAULTS.publicDir).transform((val) => resolveDirAsUrl(val, fileProtocolRoot)),
outDir: z.string().default(ASTRO_CONFIG_DEFAULTS.outDir).transform((val) => resolveDirAsUrl(val, fileProtocolRoot)),
cacheDir: z.string().default(ASTRO_CONFIG_DEFAULTS.cacheDir).transform((val) => resolveDirAsUrl(val, fileProtocolRoot)),
build: z.object({
format: z.union([z.literal("file"), z.literal("directory"), z.literal("preserve")]).optional().default(ASTRO_CONFIG_DEFAULTS.build.format),
// NOTE: `client` and `server` are transformed relative to the default outDir first,
// later we'll fix this to be relative to the actual `outDir`
client: z.string().optional().default(ASTRO_CONFIG_DEFAULTS.build.client).transform((val) => {
originalBuildClient = val;
return resolveDirAsUrl(
val,
path.resolve(fileProtocolRoot, ASTRO_CONFIG_DEFAULTS.outDir)
);
}),
server: z.string().optional().default(ASTRO_CONFIG_DEFAULTS.build.server).transform((val) => {
originalBuildServer = val;
return resolveDirAsUrl(
val,
path.resolve(fileProtocolRoot, ASTRO_CONFIG_DEFAULTS.outDir)
);
}),
assets: z.string().optional().default(ASTRO_CONFIG_DEFAULTS.build.assets),
assetsPrefix: z.string().optional().or(z.object({ fallback: z.string() }).and(z.record(z.string(), z.string())).optional()),
serverEntry: z.string().optional().default(ASTRO_CONFIG_DEFAULTS.build.serverEntry),
redirects: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.build.redirects),
inlineStylesheets: z.enum(["always", "auto", "never"]).optional().default(ASTRO_CONFIG_DEFAULTS.build.inlineStylesheets),
concurrency: z.number().min(1).optional().default(ASTRO_CONFIG_DEFAULTS.build.concurrency)
}).optional().prefault({}),
server: z.preprocess(
// preprocess
(val) => {
if (typeof val === "function") {
return val({ command: cmd === "dev" ? "dev" : "preview" });
}
return val;
},
// validate
z.object({
open: z.union([z.string(), z.boolean()]).optional().default(ASTRO_CONFIG_DEFAULTS.server.open),
host: z.union([z.string(), z.boolean()]).optional().default(ASTRO_CONFIG_DEFAULTS.server.host),
port: z.number().optional().default(ASTRO_CONFIG_DEFAULTS.server.port),
headers: z.custom().optional(),
allowedHosts: z.union([z.array(z.string()), z.literal(true)]).optional().default(ASTRO_CONFIG_DEFAULTS.server.allowedHosts)
})
).prefault({})
}).transform((config) => {
if (config.outDir.toString() !== resolveDirAsUrl(ASTRO_CONFIG_DEFAULTS.outDir, fileProtocolRoot).toString()) {
const outDirPath = fileURLToPath(config.outDir);
config.build.client = resolveDirAsUrl(originalBuildClient, outDirPath);
config.build.server = resolveDirAsUrl(originalBuildServer, outDirPath);
}
if (config.trailingSlash === "never") {
config.base = prependForwardSlash(removeTrailingForwardSlash(config.base));
config.image.endpoint.route = prependForwardSlash(
removeTrailingForwardSlash(config.image.endpoint.route)
);
} else if (config.trailingSlash === "always") {
config.base = prependForwardSlash(appendForwardSlash(config.base));
config.image.endpoint.route = prependForwardSlash(
appendForwardSlash(config.image.endpoint.route)
);
} else {
config.base = prependForwardSlash(config.base);
config.image.endpoint.route = prependForwardSlash(config.image.endpoint.route);
}
return config;
});
return AstroConfigRelativeSchema;
}
export {
createRelativeSchema
};

4
node_modules/astro/dist/core/config/settings.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
import type { AstroSettings } from '../../types/astro.js';
import type { AstroConfig, AstroInlineConfig } from '../../types/public/config.js';
export declare function createBaseSettings(config: AstroConfig, logLevel: AstroInlineConfig['logLevel']): AstroSettings;
export declare function createSettings(config: AstroConfig, logLevel: AstroInlineConfig['logLevel'], cwd?: string): Promise<AstroSettings>;

163
node_modules/astro/dist/core/config/settings.js generated vendored Normal file
View File

@@ -0,0 +1,163 @@
import path from "node:path";
import { fileURLToPath, pathToFileURL } from "node:url";
import yaml from "js-yaml";
import toml from "smol-toml";
import { getContentPaths } from "../../content/index.js";
import createPreferences from "../../preferences/index.js";
import { markdownContentEntryType } from "../../vite-plugin-markdown/content-entry-type.js";
import { getDefaultClientDirectives } from "../client-directive/index.js";
import { SUPPORTED_MARKDOWN_FILE_EXTENSIONS } from "./../constants.js";
import { AstroError, AstroErrorData } from "../errors/index.js";
import {
formatTOMLError,
formatYAMLException,
isTOMLError,
isYAMLException
} from "../errors/utils.js";
import { AstroTimer } from "./timer.js";
import { loadTSConfig } from "./tsconfig.js";
function createBaseSettings(config, logLevel) {
const { contentDir } = getContentPaths(
config,
void 0,
config.legacy?.collectionsBackwardsCompat
);
const dotAstroDir = new URL(".astro/", config.root);
const preferences = createPreferences(config, dotAstroDir);
return {
config,
preferences,
tsConfig: void 0,
tsConfigPath: void 0,
adapter: void 0,
prerenderer: void 0,
injectedRoutes: [],
resolvedInjectedRoutes: [],
pageExtensions: [".astro", ".html", ...SUPPORTED_MARKDOWN_FILE_EXTENSIONS],
contentEntryTypes: [markdownContentEntryType],
dataEntryTypes: [
{
extensions: [".json"],
getEntryInfo({ contents, fileUrl }) {
if (contents === void 0 || contents === "") return { data: {} };
const pathRelToContentDir = path.relative(
fileURLToPath(contentDir),
fileURLToPath(fileUrl)
);
let data;
try {
data = JSON.parse(contents);
} catch (e) {
throw new AstroError({
...AstroErrorData.DataCollectionEntryParseError,
message: AstroErrorData.DataCollectionEntryParseError.message(
pathRelToContentDir,
e instanceof Error ? e.message : "contains invalid JSON."
),
location: { file: fileUrl.pathname },
stack: e instanceof Error ? e.stack : void 0
});
}
if (data == null || typeof data !== "object") {
throw new AstroError({
...AstroErrorData.DataCollectionEntryParseError,
message: AstroErrorData.DataCollectionEntryParseError.message(
pathRelToContentDir,
"data is not an object."
),
location: { file: fileUrl.pathname }
});
}
return { data };
}
},
{
extensions: [".yaml", ".yml"],
getEntryInfo({ contents, fileUrl }) {
try {
const data = yaml.load(contents, { filename: fileURLToPath(fileUrl) });
const rawData = contents;
return { data, rawData };
} catch (e) {
const pathRelToContentDir = path.relative(
fileURLToPath(contentDir),
fileURLToPath(fileUrl)
);
const formattedError = isYAMLException(e) ? formatYAMLException(e) : new Error("contains invalid YAML.");
throw new AstroError({
...AstroErrorData.DataCollectionEntryParseError,
message: AstroErrorData.DataCollectionEntryParseError.message(
pathRelToContentDir,
formattedError.message
),
stack: formattedError.stack,
location: "loc" in formattedError ? { file: fileUrl.pathname, ...formattedError.loc } : { file: fileUrl.pathname }
});
}
}
},
{
extensions: [".toml"],
getEntryInfo({ contents, fileUrl }) {
try {
const data = toml.parse(contents);
const rawData = contents;
return { data, rawData };
} catch (e) {
const pathRelToContentDir = path.relative(
fileURLToPath(contentDir),
fileURLToPath(fileUrl)
);
const formattedError = isTOMLError(e) ? formatTOMLError(e) : new Error("contains invalid TOML.");
throw new AstroError({
...AstroErrorData.DataCollectionEntryParseError,
message: AstroErrorData.DataCollectionEntryParseError.message(
pathRelToContentDir,
formattedError.message
),
stack: formattedError.stack,
location: "loc" in formattedError ? { file: fileUrl.pathname, ...formattedError.loc } : { file: fileUrl.pathname }
});
}
}
}
],
renderers: [],
scripts: [],
clientDirectives: getDefaultClientDirectives(),
middlewares: { pre: [], post: [] },
watchFiles: [],
devToolbarApps: [],
timer: new AstroTimer(),
dotAstroDir,
latestAstroVersion: void 0,
// Will be set later if applicable when the dev server starts
injectedTypes: [],
buildOutput: void 0,
injectedCsp: {
fontResources: /* @__PURE__ */ new Set(),
styleHashes: []
},
logLevel: logLevel ?? "info",
fontsHttpServer: null
};
}
async function createSettings(config, logLevel, cwd) {
const tsconfig = await loadTSConfig(cwd);
const settings = createBaseSettings(config, logLevel);
let watchFiles = [];
if (cwd) {
watchFiles.push(fileURLToPath(new URL("./package.json", pathToFileURL(cwd))));
}
if (!tsconfig.error) {
watchFiles.push(...tsconfig.sources);
settings.tsConfig = tsconfig.tsconfig;
settings.tsConfigPath = tsconfig.tsconfigFile;
}
settings.watchFiles = watchFiles;
return settings;
}
export {
createBaseSettings,
createSettings
};

22
node_modules/astro/dist/core/config/timer.d.ts generated vendored Normal file
View File

@@ -0,0 +1,22 @@
/**
* Timer to track certain operations' performance. Used by Astro's scripts only.
* Set `process.env.ASTRO_TIMER_PATH` truthy to enable.
*/
export declare class AstroTimer {
private enabled;
private ongoingTimers;
private stats;
constructor();
/**
* Start a timer for a scope with a given name.
*/
start(name: string): void;
/**
* End a timer for a scope with a given name.
*/
end(name: string): void;
/**
* Write stats to `process.env.ASTRO_TIMER_PATH`
*/
writeStats(): void;
}

46
node_modules/astro/dist/core/config/timer.js generated vendored Normal file
View File

@@ -0,0 +1,46 @@
import fs from "node:fs";
class AstroTimer {
enabled;
ongoingTimers = /* @__PURE__ */ new Map();
stats = {};
constructor() {
this.enabled = !!process.env.ASTRO_TIMER_PATH;
}
/**
* Start a timer for a scope with a given name.
*/
start(name) {
if (!this.enabled) return;
globalThis.gc?.();
this.ongoingTimers.set(name, {
startTime: performance.now(),
startHeap: process.memoryUsage().heapUsed
});
}
/**
* End a timer for a scope with a given name.
*/
end(name) {
if (!this.enabled) return;
const stat = this.ongoingTimers.get(name);
if (!stat) return;
globalThis.gc?.();
const endHeap = process.memoryUsage().heapUsed;
this.stats[name] = {
elapsedTime: performance.now() - stat.startTime,
heapUsedChange: endHeap - stat.startHeap,
heapUsedTotal: endHeap
};
this.ongoingTimers.delete(name);
}
/**
* Write stats to `process.env.ASTRO_TIMER_PATH`
*/
writeStats() {
if (!this.enabled) return;
fs.writeFileSync(process.env.ASTRO_TIMER_PATH, JSON.stringify(this.stats, null, 2));
}
}
export {
AstroTimer
};

43
node_modules/astro/dist/core/config/tsconfig.d.ts generated vendored Normal file
View File

@@ -0,0 +1,43 @@
import type { CompilerOptions, TypeAcquisition } from 'typescript';
export declare const defaultTSConfig: TSConfig;
export type frameworkWithTSSettings = 'vue' | 'react' | 'preact' | 'solid-js';
export declare const presets: Map<frameworkWithTSSettings, TSConfig>;
export interface TSConfigLoadedResult {
error?: undefined;
/** Absolute path of the root tsconfig/jsconfig file that was loaded. */
tsconfigFile: string;
/** The merged/resolved config (after `extends` are walked). */
tsconfig: TSConfig;
/** The user-written, un-merged config. Used by `astro add` to round-trip. */
rawConfig: TSConfig;
/**
* Every tsconfig file that contributed via `extends`, root-first.
* Includes `tsconfigFile`. Used to populate the dev-server watch list.
*/
sources: string[];
}
export type TSConfigResult = TSConfigLoadedResult | {
error: 'invalid-config';
message: string;
} | {
error: 'missing-config';
};
/**
* Load a tsconfig.json or jsconfig.json if the former is not found.
* @param root The directory to search in, defaults to `process.cwd()`.
*/
export declare function loadTSConfig(root: string | undefined): Promise<TSConfigResult>;
export declare function updateTSConfigForFramework(target: TSConfig, framework: frameworkWithTSSettings): TSConfig;
type StripEnums<T extends Record<string, any>> = {
[K in keyof T]: T[K] extends boolean ? T[K] : T[K] extends string ? T[K] : T[K] extends object ? T[K] : T[K] extends Array<any> ? T[K] : T[K] extends undefined ? undefined : any;
};
export interface TSConfig {
compilerOptions?: StripEnums<CompilerOptions>;
compileOnSave?: boolean;
extends?: string | string[];
files?: string[];
include?: string[];
exclude?: string[];
typeAcquisition?: TypeAcquisition;
}
export {};

132
node_modules/astro/dist/core/config/tsconfig.js generated vendored Normal file
View File

@@ -0,0 +1,132 @@
import { readFileSync, existsSync } from "node:fs";
import { join, normalize } from "node:path";
import { readTsconfig } from "get-tsconfig";
import { parse as parseJsonc } from "jsonc-parser";
const defaultTSConfig = { extends: "astro/tsconfigs/base" };
const presets = /* @__PURE__ */ new Map([
[
"vue",
// Settings needed for template intellisense when using Volar
{
compilerOptions: {
jsx: "preserve"
}
}
],
[
"react",
// Default TypeScript settings, but we need to redefine them in case the users changed them previously
{
compilerOptions: {
jsx: "react-jsx",
jsxImportSource: "react"
}
}
],
[
"preact",
// https://preactjs.com/guide/v10/typescript/#typescript-configuration
{
compilerOptions: {
jsx: "react-jsx",
jsxImportSource: "preact"
}
}
],
[
"solid-js",
// https://www.solidjs.com/guides/typescript#configuring-typescript
{
compilerOptions: {
jsx: "preserve",
jsxImportSource: "solid-js"
}
}
]
]);
async function loadTSConfig(root) {
const safeCwd = root || process.cwd();
let tsconfigPath;
for (const configName of ["tsconfig.json", "jsconfig.json"]) {
const possiblePath = join(safeCwd, configName);
if (existsSync(possiblePath)) {
tsconfigPath = possiblePath;
break;
}
}
if (!tsconfigPath) {
return {
error: "missing-config"
};
}
let rawConfig;
try {
const text = readFileSync(tsconfigPath, "utf-8");
const errors = [];
const parsed = parseJsonc(text, errors, { allowTrailingComma: true });
if (errors.length > 0) {
const first = errors[0];
return {
error: "invalid-config",
message: `Failed to parse ${tsconfigPath}: Malformed JSONC (error code ${first.error}) at offset ${first.offset}`
};
}
rawConfig = parsed;
} catch (e) {
const message = e instanceof Error ? e.message : String(e);
return {
error: "invalid-config",
message: `Failed to parse ${tsconfigPath}: ${message}`
};
}
if (!rawConfig) {
return {
error: "invalid-config",
message: `Failed to parse ${tsconfigPath}: Unknown error`
};
}
let resolved;
try {
resolved = readTsconfig(tsconfigPath);
} catch (e) {
const message = e instanceof Error ? e.message : String(e);
return {
error: "invalid-config",
message: `Failed to resolve ${tsconfigPath}: ${message}`
};
}
return {
tsconfigFile: normalize(resolved.path),
tsconfig: resolved.config,
rawConfig,
sources: (resolved.sources || [resolved.path]).map(normalize)
};
}
function updateTSConfigForFramework(target, framework) {
if (!presets.has(framework)) {
return target;
}
return deepMergeObjects(target, presets.get(framework));
}
function deepMergeObjects(a, b) {
const merged = { ...a };
for (const key in b) {
const value = b[key];
if (a[key] == null) {
merged[key] = value;
continue;
}
if (typeof a[key] === "object" && typeof value === "object") {
merged[key] = deepMergeObjects(a[key], value);
continue;
}
merged[key] = value;
}
return merged;
}
export {
defaultTSConfig,
loadTSConfig,
presets,
updateTSConfigForFramework
};

9
node_modules/astro/dist/core/config/validate.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
import type { AstroConfig } from '../../types/public/config.js';
/** Turn raw config values into normalized values */
export declare function validateConfig(userConfig: any, root: string, cmd: string): Promise<AstroConfig>;
/**
* Used twice:
* - To validate the user config
* - To validate the config after all integrations (that may have updated it)
*/
export declare function validateConfigRefined(updatedConfig: AstroConfig): Promise<AstroConfig>;

26
node_modules/astro/dist/core/config/validate.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
import { errorMap } from "../errors/index.js";
import { AstroConfigRefinedSchema, createRelativeSchema } from "./schemas/index.js";
async function validateConfig(userConfig, root, cmd) {
const AstroConfigRelativeSchema = createRelativeSchema(cmd, root);
return await validateConfigRefined(
await AstroConfigRelativeSchema.parseAsync(userConfig, {
error(issue) {
if (issue.path?.[0] === "experimental") {
return {
message: `Invalid or outdated experimental feature.
Check for incorrect spelling or outdated Astro version.
See https://docs.astro.build/en/reference/experimental-flags/ for a list of all current experiments.`
};
}
return errorMap(issue);
}
})
);
}
async function validateConfigRefined(updatedConfig) {
return await AstroConfigRefinedSchema.parseAsync(updatedConfig, { error: errorMap });
}
export {
validateConfig,
validateConfigRefined
};

8
node_modules/astro/dist/core/config/vite-load.d.ts generated vendored Normal file
View File

@@ -0,0 +1,8 @@
import type fsType from 'node:fs';
interface LoadConfigWithViteOptions {
root: string;
configPath: string;
fs: typeof fsType;
}
export declare function loadConfigWithVite({ configPath, fs, root, }: LoadConfigWithViteOptions): Promise<Record<string, any>>;
export {};

42
node_modules/astro/dist/core/config/vite-load.js generated vendored Normal file
View File

@@ -0,0 +1,42 @@
import { pathToFileURL } from "node:url";
import { isRunnableDevEnvironment } from "vite";
import loadFallbackPlugin from "../../vite-plugin-load-fallback/index.js";
import { debug } from "../logger/core.js";
import { ASTRO_VITE_ENVIRONMENT_NAMES } from "../constants.js";
import { createMinimalViteDevServer } from "../createMinimalViteDevServer.js";
async function loadConfigWithVite({
configPath,
fs,
root
}) {
if (/\.[cm]?js$/.test(configPath)) {
try {
const config = await import(pathToFileURL(configPath).toString() + "?t=" + Date.now());
return config.default ?? {};
} catch (e) {
if (e && typeof e === "object" && "code" in e && e.code === "ERR_DLOPEN_DISABLED") {
throw e;
}
debug("Failed to load config with Node", e);
}
}
let server;
try {
const plugins = loadFallbackPlugin({ fs, root: pathToFileURL(root) });
server = await createMinimalViteDevServer(plugins);
if (isRunnableDevEnvironment(server.environments[ASTRO_VITE_ENVIRONMENT_NAMES.ssr])) {
const environment = server.environments[ASTRO_VITE_ENVIRONMENT_NAMES.ssr];
const mod = await environment.runner.import(configPath);
return mod.default ?? {};
} else {
return {};
}
} finally {
if (server) {
await server.close();
}
}
}
export {
loadConfigWithVite
};