Skip to content

Commit

Permalink
feat: pass astro version as argument to integration hook astro:config…
Browse files Browse the repository at this point in the history
…:setup
  • Loading branch information
feelixe committed Jan 31, 2025
1 parent 7ccf950 commit 00c2908
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/astro/src/integrations/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import type {
} from '../types/public/integrations.js';
import type { RouteData } from '../types/public/internal.js';
import { validateSupportedFeatures } from './features-validation.js';
import { ASTRO_VERSION } from '../core/constants.js';

async function withTakingALongTimeMsg<T>({
name,
Expand Down Expand Up @@ -176,6 +177,7 @@ export async function runHookConfigSetup({
config: updatedConfig,
command,
isRestart,
astroVersion: ASTRO_VERSION,
addRenderer(renderer: AstroRenderer) {
if (!renderer.name) {
throw new Error(`Integration ${bold(integration.name)} has an unnamed renderer.`);
Expand Down
1 change: 1 addition & 0 deletions packages/astro/src/types/public/integrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ export interface BaseIntegrationHooks {
config: AstroConfig;
command: 'dev' | 'build' | 'preview' | 'sync';
isRestart: boolean;
astroVersion: string;
updateConfig: (newConfig: DeepPartial<AstroConfig>) => AstroConfig;
addRenderer: (renderer: AstroRenderer) => void;
addWatchFile: (path: URL | string) => void;
Expand Down

0 comments on commit 00c2908

Please sign in to comment.