diff options
-rw-r--r-- | .changeset/green-islands-repeat.md | 5 | ||||
-rw-r--r-- | packages/astro/src/@types/astro.ts | 5 | ||||
-rw-r--r-- | packages/astro/src/core/config/index.ts | 2 | ||||
-rw-r--r-- | packages/astro/src/core/config/schema.ts | 2 |
4 files changed, 10 insertions, 4 deletions
diff --git a/.changeset/green-islands-repeat.md b/.changeset/green-islands-repeat.md new file mode 100644 index 000000000..9894fde96 --- /dev/null +++ b/.changeset/green-islands-repeat.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fix AstroConfigSchema type export diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts index fd809e846..4267e2306 100644 --- a/packages/astro/src/@types/astro.ts +++ b/packages/astro/src/@types/astro.ts @@ -13,10 +13,9 @@ import type { AddressInfo } from 'node:net'; import type * as rollup from 'rollup'; import type { TsConfigJson } from 'tsconfig-resolver'; import type * as vite from 'vite'; -import type { z } from 'zod'; import type { SerializedSSRManifest } from '../core/app/types'; import type { PageBuildData } from '../core/build/types'; -import type { AstroConfigSchema } from '../core/config'; +import type { AstroConfigType } from '../core/config'; import type { AstroTimer } from '../core/config/timer'; import type { AstroCookies } from '../core/cookies'; import type { LogOptions, LoggerLevel } from '../core/logger/core'; @@ -1354,7 +1353,7 @@ export interface ResolvedInjectedRoute extends InjectedRoute { * Resolved Astro Config * Config with user settings along with all defaults filled in. */ -export interface AstroConfig extends z.output<typeof AstroConfigSchema> { +export interface AstroConfig extends AstroConfigType { // Public: // This is a more detailed type than zod validation gives us. // TypeScript still confirms zod validation matches this type. diff --git a/packages/astro/src/core/config/index.ts b/packages/astro/src/core/config/index.ts index 23db73382..4699a624c 100644 --- a/packages/astro/src/core/config/index.ts +++ b/packages/astro/src/core/config/index.ts @@ -1,6 +1,6 @@ export { resolveConfig, resolveConfigPath, resolveFlags, resolveRoot } from './config.js'; export { createNodeLogging } from './logging.js'; export { mergeConfig } from './merge.js'; -export type { AstroConfigSchema } from './schema'; +export type { AstroConfigType } from './schema'; export { createSettings } from './settings.js'; export { loadTSConfig, updateTSConfigForFramework } from './tsconfig.js'; diff --git a/packages/astro/src/core/config/schema.ts b/packages/astro/src/core/config/schema.ts index d4f156ff5..51b9a6d48 100644 --- a/packages/astro/src/core/config/schema.ts +++ b/packages/astro/src/core/config/schema.ts @@ -266,6 +266,8 @@ export const AstroConfigSchema = z.object({ legacy: z.object({}).optional().default({}), }); +export type AstroConfigType = z.infer<typeof AstroConfigSchema>; + export function createRelativeSchema(cmd: string, fileProtocolRoot: string) { // We need to extend the global schema to add transforms that are relative to root. // This is type checked against the global schema to make sure we still match. |