diff --git a/packages/astro/index.d.ts b/packages/astro/index.d.ts index c2e2203e8fa0..a9e679be17d9 100644 --- a/packages/astro/index.d.ts +++ b/packages/astro/index.d.ts @@ -1,2 +1,2 @@ -export * from './dist/@types/astro.js' -export * from './dist/core/index.js' +export type * from './dist/@types/astro.js'; +export * from './dist/core/index.js'; diff --git a/packages/astro/src/core/build/index.ts b/packages/astro/src/core/build/index.ts index 81b0e26c4414..9e6aa99aee4f 100644 --- a/packages/astro/src/core/build/index.ts +++ b/packages/astro/src/core/build/index.ts @@ -48,7 +48,10 @@ export interface BuildOptions { * Builds your site for deployment. By default, this will generate static files and place them in a dist/ directory. * If SSR is enabled, this will generate the necessary server files to serve your site. */ -export default async function build(inlineConfig: AstroInlineConfig): Promise { +export default async function build( + inlineConfig: AstroInlineConfig, + options?: BuildOptions +): Promise { applyPolyfill(); const logging = createNodeLogging(inlineConfig); const { userConfig, astroConfig } = await resolveConfig(inlineConfig, 'build'); @@ -56,12 +59,8 @@ export default async function build(inlineConfig: AstroInlineConfig): Promise _build(inlineConfig); + +/** + * Generates TypeScript types for all Astro modules. This sets up a `src/env.d.ts` file for type inferencing, + * and defines the `astro:content` module for the Content Collections API. + */ +// Wrap `_sync` to prevent exposing the second internal options parameter +export const sync = (inlineConfig: AstroInlineConfig) => _sync(inlineConfig); diff --git a/packages/astro/src/core/sync/index.ts b/packages/astro/src/core/sync/index.ts index e00cc3dab18f..d899f4f67c3d 100644 --- a/packages/astro/src/core/sync/index.ts +++ b/packages/astro/src/core/sync/index.ts @@ -35,7 +35,10 @@ export type SyncInternalOptions = SyncOptions & { * Generates TypeScript types for all Astro modules. This sets up a `src/env.d.ts` file for type inferencing, * and defines the `astro:content` module for the Content Collections API. */ -export default async function sync(inlineConfig: AstroInlineConfig): Promise { +export default async function sync( + inlineConfig: AstroInlineConfig, + options?: SyncOptions +): Promise { const logging = createNodeLogging(inlineConfig); const { userConfig, astroConfig } = await resolveConfig(inlineConfig ?? {}, 'sync'); telemetry.record(eventCliSession('sync', userConfig)); @@ -48,11 +51,7 @@ export default async function sync(inlineConfig: AstroInlineConfig): Promise