diff --git a/package.json b/package.json index 98bffa203deb..10544642b3d8 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "build:examples": "turbo run build --filter=\"@example/*\"", "dev": "turbo run dev --concurrency=40 --parallel --filter=astro --filter=create-astro --filter=\"@astrojs/*\" --filter=\"@benchmark/*\"", "format": "pnpm run format:code", - "format:ci": "pnpm run format:imports && pnpm run format:code", + "format:ci": "pnpm run format:code", "format:code": "prettier -w \"**/*\" --ignore-unknown --cache", "format:imports": "organize-imports-cli ./packages/*/tsconfig.json ./packages/*/*/tsconfig.json", "test": "turbo run test --concurrency=1 --filter=astro --filter=create-astro --filter=\"@astrojs/*\"", diff --git a/packages/astro/src/assets/vite-plugin-assets.ts b/packages/astro/src/assets/vite-plugin-assets.ts index eb6fade4da49..ff6d0034e550 100644 --- a/packages/astro/src/assets/vite-plugin-assets.ts +++ b/packages/astro/src/assets/vite-plugin-assets.ts @@ -1,4 +1,5 @@ import MagicString from 'magic-string'; +import type * as vite from 'vite'; import { normalizePath } from 'vite'; import type { AstroPluginOptions, ImageTransform } from '../@types/astro.js'; import { extendManualChunks } from '../core/build/plugins/util.js'; diff --git a/packages/astro/src/core/build/index.ts b/packages/astro/src/core/build/index.ts index 162c268c6640..0245e50c2ff1 100644 --- a/packages/astro/src/core/build/index.ts +++ b/packages/astro/src/core/build/index.ts @@ -2,6 +2,7 @@ import { blue, bold, green } from 'kleur/colors'; import fs from 'node:fs'; import { performance } from 'node:perf_hooks'; import { fileURLToPath } from 'node:url'; +import type * as vite from 'vite'; import type { AstroConfig, AstroInlineConfig, diff --git a/packages/astro/src/core/dev/dev.ts b/packages/astro/src/core/dev/dev.ts index 9260f33a84ed..c0c1b9b8ea64 100644 --- a/packages/astro/src/core/dev/dev.ts +++ b/packages/astro/src/core/dev/dev.ts @@ -1,4 +1,5 @@ import { green } from 'kleur/colors'; +import type * as vite from 'vite'; import fs from 'node:fs'; import type http from 'node:http'; import type { AddressInfo } from 'node:net'; diff --git a/packages/astro/src/core/module-loader/vite.ts b/packages/astro/src/core/module-loader/vite.ts index 204b1621c06d..48ec230f078a 100644 --- a/packages/astro/src/core/module-loader/vite.ts +++ b/packages/astro/src/core/module-loader/vite.ts @@ -1,5 +1,6 @@ import { EventEmitter } from 'node:events'; import path from 'node:path'; +import type * as vite from 'vite'; import type { ModuleLoader, ModuleLoaderEventEmitter } from './loader.js'; export function createViteLoader(viteServer: vite.ViteDevServer): ModuleLoader { diff --git a/packages/astro/src/i18n/vite-plugin-i18n.ts b/packages/astro/src/i18n/vite-plugin-i18n.ts index c9c035ce0757..bf6cff171305 100644 --- a/packages/astro/src/i18n/vite-plugin-i18n.ts +++ b/packages/astro/src/i18n/vite-plugin-i18n.ts @@ -1,3 +1,4 @@ +import type * as vite from 'vite'; import type { AstroSettings } from '../@types/astro.js'; const virtualModuleId = 'astro:i18n'; diff --git a/packages/astro/src/prefetch/vite-plugin-prefetch.ts b/packages/astro/src/prefetch/vite-plugin-prefetch.ts index af3b776ed2ed..83c3c3ff7c59 100644 --- a/packages/astro/src/prefetch/vite-plugin-prefetch.ts +++ b/packages/astro/src/prefetch/vite-plugin-prefetch.ts @@ -1,3 +1,4 @@ +import type * as vite from 'vite'; import type { AstroSettings } from '../@types/astro.js'; const virtualModuleId = 'astro:prefetch'; diff --git a/packages/astro/src/transitions/vite-plugin-transitions.ts b/packages/astro/src/transitions/vite-plugin-transitions.ts index cce10702e0ae..16cb174baf44 100644 --- a/packages/astro/src/transitions/vite-plugin-transitions.ts +++ b/packages/astro/src/transitions/vite-plugin-transitions.ts @@ -1,3 +1,4 @@ +import type * as vite from 'vite'; import type { AstroSettings } from '../@types/astro.js'; const virtualModuleId = 'astro:transitions'; diff --git a/packages/astro/src/vite-plugin-astro-server/base.ts b/packages/astro/src/vite-plugin-astro-server/base.ts index b1521bdfa6f7..e757515d739c 100644 --- a/packages/astro/src/vite-plugin-astro-server/base.ts +++ b/packages/astro/src/vite-plugin-astro-server/base.ts @@ -1,3 +1,4 @@ +import type * as vite from 'vite'; import type { AstroSettings } from '../@types/astro.js'; import { bold } from 'kleur/colors'; diff --git a/packages/astro/src/vite-plugin-astro-server/plugin.ts b/packages/astro/src/vite-plugin-astro-server/plugin.ts index 79bff553ab33..d324dfdc6e4a 100644 --- a/packages/astro/src/vite-plugin-astro-server/plugin.ts +++ b/packages/astro/src/vite-plugin-astro-server/plugin.ts @@ -1,4 +1,5 @@ import type fs from 'node:fs'; +import type * as vite from 'vite'; import type { AstroSettings, ManifestData, SSRManifest } from '../@types/astro.js'; import type { SSRManifestI18n } from '../core/app/types.js'; import { patchOverlay } from '../core/errors/overlay.js'; diff --git a/packages/astro/src/vite-plugin-astro/index.ts b/packages/astro/src/vite-plugin-astro/index.ts index ac20be3e3142..63198990387b 100644 --- a/packages/astro/src/vite-plugin-astro/index.ts +++ b/packages/astro/src/vite-plugin-astro/index.ts @@ -1,4 +1,5 @@ import type { SourceDescription } from 'rollup'; +import type * as vite from 'vite'; import type { AstroSettings } from '../@types/astro.js'; import type { Logger } from '../core/logger/core.js'; import type { PluginMetadata as AstroPluginMetadata } from './types.js'; diff --git a/packages/astro/src/vite-plugin-dev-overlay/vite-plugin-dev-overlay.ts b/packages/astro/src/vite-plugin-dev-overlay/vite-plugin-dev-overlay.ts index b5259ad807ef..5c3aabe5ac6d 100644 --- a/packages/astro/src/vite-plugin-dev-overlay/vite-plugin-dev-overlay.ts +++ b/packages/astro/src/vite-plugin-dev-overlay/vite-plugin-dev-overlay.ts @@ -1,3 +1,4 @@ +import type * as vite from 'vite'; import type { AstroPluginOptions } from '../@types/astro.js'; const VIRTUAL_MODULE_ID = 'astro:dev-overlay'; diff --git a/packages/astro/src/vite-plugin-env/index.ts b/packages/astro/src/vite-plugin-env/index.ts index 6c90c4c5a3b5..1958344e595c 100644 --- a/packages/astro/src/vite-plugin-env/index.ts +++ b/packages/astro/src/vite-plugin-env/index.ts @@ -1,5 +1,6 @@ import MagicString from 'magic-string'; import { fileURLToPath } from 'node:url'; +import type * as vite from 'vite'; import { loadEnv } from 'vite'; import type { AstroConfig, AstroSettings } from '../@types/astro.js'; diff --git a/packages/astro/src/vite-plugin-head/index.ts b/packages/astro/src/vite-plugin-head/index.ts index 3f05a3ed7b16..228e4e437fcd 100644 --- a/packages/astro/src/vite-plugin-head/index.ts +++ b/packages/astro/src/vite-plugin-head/index.ts @@ -1,4 +1,5 @@ import type { ModuleInfo } from 'rollup'; +import type * as vite from 'vite'; import type { SSRComponentMetadata, SSRResult } from '../@types/astro.js'; import type { AstroBuildPlugin } from '../core/build/plugin.js'; import type { PluginMetadata } from '../vite-plugin-astro/types.js'; diff --git a/packages/astro/src/vite-plugin-load-fallback/index.ts b/packages/astro/src/vite-plugin-load-fallback/index.ts index f5cf9c31c940..80db39edd433 100644 --- a/packages/astro/src/vite-plugin-load-fallback/index.ts +++ b/packages/astro/src/vite-plugin-load-fallback/index.ts @@ -1,5 +1,6 @@ import nodeFs from 'node:fs'; import npath from 'node:path'; +import type * as vite from 'vite'; import { slash } from '../core/path.js'; import { cleanUrl } from '../vite-plugin-utils/index.js'; diff --git a/packages/integrations/react/src/index.ts b/packages/integrations/react/src/index.ts index 9f603d24e0ad..d5f6965224e4 100644 --- a/packages/integrations/react/src/index.ts +++ b/packages/integrations/react/src/index.ts @@ -1,6 +1,7 @@ import react, { type Options as ViteReactPluginOptions } from '@vitejs/plugin-react'; import type { AstroIntegration } from 'astro'; import { version as ReactVersion } from 'react-dom'; +import type * as vite from 'vite'; export type ReactIntegrationOptions = Pick & { experimentalReactChildren?: boolean;