diff options
Diffstat (limited to 'packages/astro/src')
47 files changed, 67 insertions, 63 deletions
diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts index 1100cd5f8..3ce8be97f 100644 --- a/packages/astro/src/@types/astro.ts +++ b/packages/astro/src/@types/astro.ts @@ -20,7 +20,7 @@ import type { AstroTimer } from '../core/config/timer'; import type { AstroCookies } from '../core/cookies'; import type { LogOptions } from '../core/logger/core'; import type { AstroComponentFactory, AstroComponentInstance } from '../runtime/server'; -import { SUPPORTED_MARKDOWN_FILE_EXTENSIONS } from './../core/constants.js'; +import type { SUPPORTED_MARKDOWN_FILE_EXTENSIONS } from './../core/constants.js'; export type { MarkdownHeading, MarkdownMetadata, diff --git a/packages/astro/src/assets/internal.ts b/packages/astro/src/assets/internal.ts index 0202e2359..3bad39ae4 100644 --- a/packages/astro/src/assets/internal.ts +++ b/packages/astro/src/assets/internal.ts @@ -1,8 +1,8 @@ import fs from 'node:fs'; import path from 'node:path'; import { pathToFileURL } from 'node:url'; -import { AstroSettings } from '../@types/astro.js'; -import { StaticBuildOptions } from '../core/build/types.js'; +import type { AstroSettings } from '../@types/astro.js'; +import type { StaticBuildOptions } from '../core/build/types.js'; import { AstroError, AstroErrorData } from '../core/errors/index.js'; import { rootRelativePath } from '../core/util.js'; import { ImageService, isLocalService, LocalImageService } from './services/service.js'; diff --git a/packages/astro/src/assets/services/service.ts b/packages/astro/src/assets/services/service.ts index 9295db3a9..0e2c483f8 100644 --- a/packages/astro/src/assets/services/service.ts +++ b/packages/astro/src/assets/services/service.ts @@ -2,7 +2,7 @@ import { AstroError, AstroErrorData } from '../../core/errors/index.js'; import { isRemotePath } from '../../core/path.js'; import { VALID_INPUT_FORMATS } from '../consts.js'; import { isESMImportedImage } from '../internal.js'; -import { ImageTransform, OutputFormat } from '../types.js'; +import type { ImageTransform, OutputFormat } from '../types.js'; export type ImageService = LocalImageService | ExternalImageService; diff --git a/packages/astro/src/assets/types.ts b/packages/astro/src/assets/types.ts index f3f54b2dd..4a97354bf 100644 --- a/packages/astro/src/assets/types.ts +++ b/packages/astro/src/assets/types.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/ban-types */ -import { VALID_INPUT_FORMATS, VALID_OUTPUT_FORMATS } from './consts.js'; -import { ImageService } from './services/service.js'; +import type { VALID_INPUT_FORMATS, VALID_OUTPUT_FORMATS } from './consts.js'; +import type { ImageService } from './services/service.js'; export type ImageQualityPreset = 'low' | 'mid' | 'high' | 'max' | (string & {}); export type ImageQuality = ImageQualityPreset | number; diff --git a/packages/astro/src/assets/utils/metadata.ts b/packages/astro/src/assets/utils/metadata.ts index fa6bb9e10..e276b0899 100644 --- a/packages/astro/src/assets/utils/metadata.ts +++ b/packages/astro/src/assets/utils/metadata.ts @@ -1,6 +1,6 @@ import fs from 'node:fs/promises'; import { fileURLToPath } from 'node:url'; -import { ImageMetadata, InputFormat } from '../types.js'; +import type { ImageMetadata, InputFormat } from '../types.js'; export interface Metadata extends ImageMetadata { orientation?: number; diff --git a/packages/astro/src/assets/utils/queryParams.ts b/packages/astro/src/assets/utils/queryParams.ts index e2753201e..980c3dcd9 100644 --- a/packages/astro/src/assets/utils/queryParams.ts +++ b/packages/astro/src/assets/utils/queryParams.ts @@ -1,4 +1,4 @@ -import { ImageMetadata, InputFormat } from '../types.js'; +import type { ImageMetadata, InputFormat } from '../types.js'; export function getOrigQueryParams( params: URLSearchParams diff --git a/packages/astro/src/assets/utils/transformToPath.ts b/packages/astro/src/assets/utils/transformToPath.ts index 925407eb1..5a73fca3c 100644 --- a/packages/astro/src/assets/utils/transformToPath.ts +++ b/packages/astro/src/assets/utils/transformToPath.ts @@ -2,7 +2,7 @@ import { basename, extname } from 'path'; import { removeQueryString } from '../../core/path.js'; import { shorthash } from '../../runtime/server/shorthash.js'; import { isESMImportedImage } from '../internal.js'; -import { ImageTransform } from '../types.js'; +import type { ImageTransform } from '../types.js'; export function propsToFilename(transform: ImageTransform) { if (!isESMImportedImage(transform.src)) { diff --git a/packages/astro/src/assets/vite-plugin-assets.ts b/packages/astro/src/assets/vite-plugin-assets.ts index 9af9c6073..f3c022e61 100644 --- a/packages/astro/src/assets/vite-plugin-assets.ts +++ b/packages/astro/src/assets/vite-plugin-assets.ts @@ -5,7 +5,7 @@ import { Readable } from 'node:stream'; import { fileURLToPath } from 'node:url'; import type * as vite from 'vite'; import { normalizePath } from 'vite'; -import { AstroPluginOptions, ImageTransform } from '../@types/astro'; +import type { AstroPluginOptions, ImageTransform } from '../@types/astro'; import { error } from '../core/logger/core.js'; import { joinPaths, prependForwardSlash } from '../core/path.js'; import { VIRTUAL_MODULE_ID, VIRTUAL_SERVICE_ID } from './consts.js'; diff --git a/packages/astro/src/content/utils.ts b/packages/astro/src/content/utils.ts index 22b71e0af..1fd600748 100644 --- a/packages/astro/src/content/utils.ts +++ b/packages/astro/src/content/utils.ts @@ -6,7 +6,7 @@ import { fileURLToPath, pathToFileURL } from 'node:url'; import type { EmitFile } from 'rollup'; import { ErrorPayload as ViteErrorPayload, normalizePath, ViteDevServer } from 'vite'; import { z } from 'zod'; -import { AstroConfig, AstroSettings } from '../@types/astro.js'; +import type { AstroConfig, AstroSettings } from '../@types/astro.js'; import { emitESMImage } from '../assets/internal.js'; import { AstroError, AstroErrorData } from '../core/errors/index.js'; import { CONTENT_TYPES_FILE } from './consts.js'; diff --git a/packages/astro/src/content/vite-plugin-content-assets.ts b/packages/astro/src/content/vite-plugin-content-assets.ts index cda8aff64..3bfbc697f 100644 --- a/packages/astro/src/content/vite-plugin-content-assets.ts +++ b/packages/astro/src/content/vite-plugin-content-assets.ts @@ -1,10 +1,10 @@ import npath from 'node:path'; import { pathToFileURL } from 'url'; import type { Plugin } from 'vite'; -import { AstroSettings } from '../@types/astro.js'; +import type { AstroSettings } from '../@types/astro.js'; import { moduleIsTopLevelPage, walkParentInfos } from '../core/build/graph.js'; import { BuildInternals, getPageDataByViteID } from '../core/build/internal.js'; -import { AstroBuildPlugin } from '../core/build/plugin.js'; +import type { AstroBuildPlugin } from '../core/build/plugin.js'; import type { StaticBuildOptions } from '../core/build/types'; import type { ModuleLoader } from '../core/module-loader/loader.js'; import { createViteLoader } from '../core/module-loader/vite.js'; diff --git a/packages/astro/src/content/vite-plugin-content-imports.ts b/packages/astro/src/content/vite-plugin-content-imports.ts index a81d1feba..c5b8e732b 100644 --- a/packages/astro/src/content/vite-plugin-content-imports.ts +++ b/packages/astro/src/content/vite-plugin-content-imports.ts @@ -3,7 +3,7 @@ import type fsMod from 'node:fs'; import { extname } from 'node:path'; import { pathToFileURL } from 'url'; import type { Plugin } from 'vite'; -import { AstroSettings, ContentEntryType } from '../@types/astro.js'; +import type { AstroSettings, ContentEntryType } from '../@types/astro.js'; import { AstroErrorData } from '../core/errors/errors-data.js'; import { AstroError } from '../core/errors/errors.js'; import { escapeViteEnvReferences, getFileInfo } from '../vite-plugin-utils/index.js'; diff --git a/packages/astro/src/core/app/node.ts b/packages/astro/src/core/app/node.ts index 2ab662d66..637417bd4 100644 --- a/packages/astro/src/core/app/node.ts +++ b/packages/astro/src/core/app/node.ts @@ -2,7 +2,7 @@ import type { RouteData } from '../../@types/astro'; import type { SerializedSSRManifest, SSRManifest } from './types'; import * as fs from 'fs'; -import { IncomingMessage } from 'http'; +import type { IncomingMessage } from 'http'; import { TLSSocket } from 'tls'; import { deserializeManifest } from './common.js'; import { App, MatchOptions } from './index.js'; diff --git a/packages/astro/src/core/build/add-rollup-input.ts b/packages/astro/src/core/build/add-rollup-input.ts index 79feb3a7d..4043d3ecd 100644 --- a/packages/astro/src/core/build/add-rollup-input.ts +++ b/packages/astro/src/core/build/add-rollup-input.ts @@ -1,4 +1,4 @@ -import { InputOptions } from 'rollup'; +import type { InputOptions } from 'rollup'; function fromEntries<V>(entries: [string, V][]) { const obj: Record<string, V> = {}; diff --git a/packages/astro/src/core/build/css-asset-name.ts b/packages/astro/src/core/build/css-asset-name.ts index d9112a172..132df6017 100644 --- a/packages/astro/src/core/build/css-asset-name.ts +++ b/packages/astro/src/core/build/css-asset-name.ts @@ -2,7 +2,7 @@ import type { GetModuleInfo } from 'rollup'; import crypto from 'crypto'; import npath from 'path'; -import { AstroSettings } from '../../@types/astro'; +import type { AstroSettings } from '../../@types/astro'; import { viteID } from '../util.js'; import { getTopLevelPages } from './graph.js'; diff --git a/packages/astro/src/core/build/index.ts b/packages/astro/src/core/build/index.ts index 29dc835ff..4123b71d9 100644 --- a/packages/astro/src/core/build/index.ts +++ b/packages/astro/src/core/build/index.ts @@ -5,8 +5,8 @@ import type { LogOptions } from '../logger/core'; import fs from 'fs'; import * as colors from 'kleur/colors'; import { performance } from 'perf_hooks'; -import * as vite from 'vite'; -import yargs from 'yargs-parser'; +import type * as vite from 'vite'; +import type yargs from 'yargs-parser'; import { runHookBuildDone, runHookBuildStart, @@ -21,7 +21,7 @@ import { RouteCache } from '../render/route-cache.js'; import { createRouteManifest } from '../routing/index.js'; import { collectPagesData } from './page-data.js'; import { staticBuild, viteBuild } from './static-build.js'; -import { StaticBuildOptions } from './types.js'; +import type { StaticBuildOptions } from './types.js'; import { getTimeStat } from './util.js'; export interface BuildOptions { diff --git a/packages/astro/src/core/build/internal.ts b/packages/astro/src/core/build/internal.ts index 7ae350e6f..5b7d1d2a5 100644 --- a/packages/astro/src/core/build/internal.ts +++ b/packages/astro/src/core/build/internal.ts @@ -1,8 +1,8 @@ import type { OutputChunk, RenderedChunk } from 'rollup'; import type { PageBuildData, ViteID } from './types'; -import { SSRResult } from '../../@types/astro'; -import { PageOptions } from '../../vite-plugin-astro/types'; +import type { SSRResult } from '../../@types/astro'; +import type { PageOptions } from '../../vite-plugin-astro/types'; import { prependForwardSlash, removeFileExtension } from '../path.js'; import { viteID } from '../util.js'; diff --git a/packages/astro/src/core/build/plugins/plugin-alias-resolve.ts b/packages/astro/src/core/build/plugins/plugin-alias-resolve.ts index 7b0aba7e8..052ea45b7 100644 --- a/packages/astro/src/core/build/plugins/plugin-alias-resolve.ts +++ b/packages/astro/src/core/build/plugins/plugin-alias-resolve.ts @@ -1,6 +1,6 @@ import type { Alias, Plugin as VitePlugin } from 'vite'; import type { BuildInternals } from '../internal.js'; -import { AstroBuildPlugin } from '../plugin.js'; +import type { AstroBuildPlugin } from '../plugin.js'; /** * `@rollup/plugin-alias` doesn't resolve aliases in Rollup input by default. This plugin fixes it diff --git a/packages/astro/src/core/build/plugins/plugin-hoisted-scripts.ts b/packages/astro/src/core/build/plugins/plugin-hoisted-scripts.ts index da40ede65..38d832384 100644 --- a/packages/astro/src/core/build/plugins/plugin-hoisted-scripts.ts +++ b/packages/astro/src/core/build/plugins/plugin-hoisted-scripts.ts @@ -3,8 +3,8 @@ import type { AstroSettings } from '../../../@types/astro'; import { viteID } from '../../util.js'; import type { BuildInternals } from '../internal.js'; import { getPageDataByViteID } from '../internal.js'; -import { AstroBuildPlugin } from '../plugin'; -import { StaticBuildOptions } from '../types'; +import type { AstroBuildPlugin } from '../plugin'; +import type { StaticBuildOptions } from '../types'; function virtualHoistedEntry(id: string) { return id.startsWith('/astro/hoisted.js?q='); diff --git a/packages/astro/src/core/build/plugins/plugin-ssr.ts b/packages/astro/src/core/build/plugins/plugin-ssr.ts index 9bf7a059f..c8883a438 100644 --- a/packages/astro/src/core/build/plugins/plugin-ssr.ts +++ b/packages/astro/src/core/build/plugins/plugin-ssr.ts @@ -14,7 +14,7 @@ import { serializeRouteData } from '../../routing/index.js'; import { addRollupInput } from '../add-rollup-input.js'; import { getOutFile, getOutFolder } from '../common.js'; import { eachPrerenderedPageData, eachServerPageData, sortedCSS } from '../internal.js'; -import { AstroBuildPlugin } from '../plugin'; +import type { AstroBuildPlugin } from '../plugin'; export const virtualModuleId = '@astrojs-ssr-virtual-entry'; const resolvedVirtualModuleId = '\0' + virtualModuleId; diff --git a/packages/astro/src/core/config/config.ts b/packages/astro/src/core/config/config.ts index 19583bdde..9c45c9c5f 100644 --- a/packages/astro/src/core/config/config.ts +++ b/packages/astro/src/core/config/config.ts @@ -7,7 +7,7 @@ import path from 'path'; import { fileURLToPath, pathToFileURL } from 'url'; import { mergeConfig as mergeViteConfig } from 'vite'; import { AstroError, AstroErrorData } from '../errors/index.js'; -import { LogOptions } from '../logger/core.js'; +import type { LogOptions } from '../logger/core.js'; import { arraify, isObject, isURL } from '../util.js'; import { createRelativeSchema } from './schema.js'; import { loadConfigWithVite } from './vite-load.js'; diff --git a/packages/astro/src/core/config/schema.ts b/packages/astro/src/core/config/schema.ts index 89bdd2cca..5848222de 100644 --- a/packages/astro/src/core/config/schema.ts +++ b/packages/astro/src/core/config/schema.ts @@ -3,7 +3,7 @@ import { markdownConfigDefaults } from '@astrojs/markdown-remark'; import type { ILanguageRegistration, IThemeRegistration, Theme } from 'shiki'; import type { AstroUserConfig, ViteUserConfig } from '../../@types/astro'; -import { OutgoingHttpHeaders } from 'http'; +import type { OutgoingHttpHeaders } from 'http'; import { BUNDLED_THEMES } from 'shiki'; import { z } from 'zod'; import { appendForwardSlash, prependForwardSlash, trimSlashes } from '../path.js'; diff --git a/packages/astro/src/core/dev/container.ts b/packages/astro/src/core/dev/container.ts index 22c489b2e..1b1ccca67 100644 --- a/packages/astro/src/core/dev/container.ts +++ b/packages/astro/src/core/dev/container.ts @@ -1,4 +1,4 @@ -import * as http from 'http'; +import type * as http from 'http'; import type { AddressInfo } from 'net'; import type { AstroSettings, AstroUserConfig } from '../../@types/astro'; @@ -13,7 +13,7 @@ import { } from '../../integrations/index.js'; import { createDefaultDevSettings, resolveRoot } from '../config/index.js'; import { createVite } from '../create-vite.js'; -import { LogOptions } from '../logger/core.js'; +import type { LogOptions } from '../logger/core.js'; import { nodeLogDestination } from '../logger/node.js'; import { appendForwardSlash } from '../path.js'; import { apply as applyPolyfill } from '../polyfill.js'; diff --git a/packages/astro/src/core/dev/dev.ts b/packages/astro/src/core/dev/dev.ts index b6f051e08..800107bcd 100644 --- a/packages/astro/src/core/dev/dev.ts +++ b/packages/astro/src/core/dev/dev.ts @@ -3,8 +3,8 @@ import type http from 'http'; import { cyan } from 'kleur/colors'; import type { AddressInfo } from 'net'; import { performance } from 'perf_hooks'; -import * as vite from 'vite'; -import yargs from 'yargs-parser'; +import type * as vite from 'vite'; +import type yargs from 'yargs-parser'; import type { AstroSettings } from '../../@types/astro'; import { attachContentServerListeners } from '../../content/index.js'; import { info, LogOptions, warn } from '../logger/core.js'; diff --git a/packages/astro/src/core/errors/errors.ts b/packages/astro/src/core/errors/errors.ts index 712528329..8ff43c60e 100644 --- a/packages/astro/src/core/errors/errors.ts +++ b/packages/astro/src/core/errors/errors.ts @@ -1,5 +1,5 @@ import type { DiagnosticCode } from '@astrojs/compiler/shared/diagnostics.js'; -import { AstroErrorCodes } from './errors-data.js'; +import type { AstroErrorCodes } from './errors-data.js'; import { codeFrame } from './printer.js'; import { getErrorDataByCode } from './utils.js'; diff --git a/packages/astro/src/core/errors/utils.ts b/packages/astro/src/core/errors/utils.ts index b4d37354f..52a7f9d8c 100644 --- a/packages/astro/src/core/errors/utils.ts +++ b/packages/astro/src/core/errors/utils.ts @@ -1,4 +1,4 @@ -import { DiagnosticCode } from '@astrojs/compiler/shared/diagnostics.js'; +import type { DiagnosticCode } from '@astrojs/compiler/shared/diagnostics.js'; import type { SSRError } from '../../@types/astro.js'; import { AstroErrorCodes, AstroErrorData, ErrorData } from './errors-data.js'; diff --git a/packages/astro/src/core/messages.ts b/packages/astro/src/core/messages.ts index 817958876..6d41f2796 100644 --- a/packages/astro/src/core/messages.ts +++ b/packages/astro/src/core/messages.ts @@ -14,8 +14,8 @@ import { underline, yellow, } from 'kleur/colors'; -import { ResolvedServerUrls } from 'vite'; -import { ZodError } from 'zod'; +import type { ResolvedServerUrls } from 'vite'; +import type { ZodError } from 'zod'; import { renderErrorMarkdown } from './errors/dev/utils.js'; import { AstroError, CompilerError, ErrorWithMetadata } from './errors/index.js'; import { emoji, padMultilineString } from './util.js'; diff --git a/packages/astro/src/core/preview/static-preview-server.ts b/packages/astro/src/core/preview/static-preview-server.ts index 0103ea74e..52cd7da73 100644 --- a/packages/astro/src/core/preview/static-preview-server.ts +++ b/packages/astro/src/core/preview/static-preview-server.ts @@ -1,4 +1,4 @@ -import http from 'http'; +import type http from 'http'; import { performance } from 'perf_hooks'; import enableDestroy from 'server-destroy'; import { fileURLToPath } from 'url'; diff --git a/packages/astro/src/core/preview/vite-plugin-astro-preview.ts b/packages/astro/src/core/preview/vite-plugin-astro-preview.ts index 95ff4d225..1d2453b46 100644 --- a/packages/astro/src/core/preview/vite-plugin-astro-preview.ts +++ b/packages/astro/src/core/preview/vite-plugin-astro-preview.ts @@ -1,7 +1,7 @@ import fs from 'fs'; import { fileURLToPath } from 'url'; -import { Plugin } from 'vite'; -import { AstroSettings } from '../../@types/astro.js'; +import type { Plugin } from 'vite'; +import type { AstroSettings } from '../../@types/astro.js'; import { notFoundTemplate, subpathNotUsedTemplate } from '../../template/4xx.js'; import { stripBase } from './util.js'; diff --git a/packages/astro/src/core/render/dev/css.ts b/packages/astro/src/core/render/dev/css.ts index db33935d5..1d80a8526 100644 --- a/packages/astro/src/core/render/dev/css.ts +++ b/packages/astro/src/core/render/dev/css.ts @@ -1,6 +1,6 @@ import type { ModuleLoader } from '../../module-loader/index'; -import { RuntimeMode } from '../../../@types/astro.js'; +import type { RuntimeMode } from '../../../@types/astro.js'; import { viteID } from '../../util.js'; import { isBuildableCSSRequest } from './util.js'; import { crawlGraph } from './vite.js'; diff --git a/packages/astro/src/core/render/paginate.ts b/packages/astro/src/core/render/paginate.ts index 799637e0f..7c9d06e0d 100644 --- a/packages/astro/src/core/render/paginate.ts +++ b/packages/astro/src/core/render/paginate.ts @@ -1,4 +1,4 @@ -import { +import type { GetStaticPathsResult, Page, PaginateFunction, diff --git a/packages/astro/src/events/error.ts b/packages/astro/src/events/error.ts index f8342fbf4..180c3df1d 100644 --- a/packages/astro/src/events/error.ts +++ b/packages/astro/src/events/error.ts @@ -1,4 +1,4 @@ -import { ZodError } from 'zod'; +import type { ZodError } from 'zod'; import { AstroError, AstroErrorData, ErrorWithMetadata } from '../core/errors/index.js'; import { getErrorDataByCode } from '../core/errors/utils.js'; diff --git a/packages/astro/src/integrations/index.ts b/packages/astro/src/integrations/index.ts index f4fac4fd1..324934575 100644 --- a/packages/astro/src/integrations/index.ts +++ b/packages/astro/src/integrations/index.ts @@ -3,7 +3,7 @@ import type { AddressInfo } from 'net'; import fs from 'node:fs'; import { fileURLToPath } from 'node:url'; import type { InlineConfig, ViteDevServer } from 'vite'; -import { +import type { AstroConfig, AstroRenderer, AstroSettings, diff --git a/packages/astro/src/runtime/server/jsx.ts b/packages/astro/src/runtime/server/jsx.ts index e139a74e7..3e8e521c7 100644 --- a/packages/astro/src/runtime/server/jsx.ts +++ b/packages/astro/src/runtime/server/jsx.ts @@ -1,5 +1,5 @@ /* eslint-disable no-console */ -import { SSRResult } from '../../@types/astro.js'; +import type { SSRResult } from '../../@types/astro.js'; import { AstroJSX, AstroVNode, isVNode } from '../../jsx-runtime/index.js'; import { escapeHTML, diff --git a/packages/astro/src/runtime/server/render/tags.ts b/packages/astro/src/runtime/server/render/tags.ts index 57935237b..fe9829d0c 100644 --- a/packages/astro/src/runtime/server/render/tags.ts +++ b/packages/astro/src/runtime/server/render/tags.ts @@ -1,4 +1,4 @@ -import { SSRElement, SSRResult } from '../../../@types/astro'; +import type { SSRElement, SSRResult } from '../../../@types/astro'; import { renderElement } from './util.js'; const stylesheetRel = 'stylesheet'; diff --git a/packages/astro/src/vite-plugin-astro-server/plugin.ts b/packages/astro/src/vite-plugin-astro-server/plugin.ts index b15f98fa8..29f83c85c 100644 --- a/packages/astro/src/vite-plugin-astro-server/plugin.ts +++ b/packages/astro/src/vite-plugin-astro-server/plugin.ts @@ -3,7 +3,7 @@ import type { AstroSettings, ManifestData } from '../@types/astro'; import type fs from 'fs'; import { patchOverlay } from '../core/errors/overlay.js'; -import { LogOptions } from '../core/logger/core.js'; +import type { LogOptions } from '../core/logger/core.js'; import { createViteLoader } from '../core/module-loader/index.js'; import { createDevelopmentEnvironment } from '../core/render/dev/index.js'; import { createRouteManifest } from '../core/routing/index.js'; diff --git a/packages/astro/src/vite-plugin-astro-server/route.ts b/packages/astro/src/vite-plugin-astro-server/route.ts index d26fc62d7..de58daa71 100644 --- a/packages/astro/src/vite-plugin-astro-server/route.ts +++ b/packages/astro/src/vite-plugin-astro-server/route.ts @@ -1,7 +1,11 @@ import type http from 'http'; import mime from 'mime'; import type { AstroSettings, ComponentInstance, ManifestData, RouteData } from '../@types/astro'; -import { ComponentPreload, DevelopmentEnvironment, SSROptions } from '../core/render/dev/index'; +import type { + ComponentPreload, + DevelopmentEnvironment, + SSROptions, +} from '../core/render/dev/index'; import { attachToResponse } from '../core/cookies/index.js'; import { call as callEndpoint } from '../core/endpoint/dev/index.js'; diff --git a/packages/astro/src/vite-plugin-astro/compile.ts b/packages/astro/src/vite-plugin-astro/compile.ts index 34fe645e5..5b4c3f6ce 100644 --- a/packages/astro/src/vite-plugin-astro/compile.ts +++ b/packages/astro/src/vite-plugin-astro/compile.ts @@ -1,7 +1,7 @@ import { ESBuildTransformResult, transformWithEsbuild } from 'vite'; -import { AstroConfig } from '../@types/astro'; +import type { AstroConfig } from '../@types/astro'; import { cachedCompilation, CompileProps, CompileResult } from '../core/compile/index.js'; -import { LogOptions } from '../core/logger/core.js'; +import type { LogOptions } from '../core/logger/core.js'; import { getFileInfo } from '../vite-plugin-utils/index.js'; interface CachedFullCompilation { diff --git a/packages/astro/src/vite-plugin-head-propagation/index.ts b/packages/astro/src/vite-plugin-head-propagation/index.ts index b17d5f382..6dbd76169 100644 --- a/packages/astro/src/vite-plugin-head-propagation/index.ts +++ b/packages/astro/src/vite-plugin-head-propagation/index.ts @@ -4,7 +4,7 @@ import type { BuildInternals } from '../core/build/internal.js'; import type { AstroBuildPlugin } from '../core/build/plugin.js'; import type { StaticBuildOptions } from '../core/build/types'; -import * as vite from 'vite'; +import type * as vite from 'vite'; import { walkParentInfos } from '../core/build/graph.js'; import { getAstroMetadata } from '../vite-plugin-astro/index.js'; diff --git a/packages/astro/src/vite-plugin-html/transform/slots.ts b/packages/astro/src/vite-plugin-html/transform/slots.ts index 5f0f432cb..e89cad42c 100644 --- a/packages/astro/src/vite-plugin-html/transform/slots.ts +++ b/packages/astro/src/vite-plugin-html/transform/slots.ts @@ -1,7 +1,7 @@ import type { Root, RootContent } from 'hast'; import type { Plugin } from 'unified'; -import MagicString from 'magic-string'; +import type MagicString from 'magic-string'; import { visit } from 'unist-util-visit'; import { escape } from './utils.js'; diff --git a/packages/astro/src/vite-plugin-html/transform/utils.ts b/packages/astro/src/vite-plugin-html/transform/utils.ts index 8a277ce72..6d61e7532 100644 --- a/packages/astro/src/vite-plugin-html/transform/utils.ts +++ b/packages/astro/src/vite-plugin-html/transform/utils.ts @@ -1,5 +1,5 @@ import type { Element } from 'hast'; -import MagicString from 'magic-string'; +import type MagicString from 'magic-string'; const splitAttrsTokenizer = /([\$\{\}\@a-z0-9_\:\-]*)\s*?=\s*?(['"]?)(.*?)\2\s+/gim; diff --git a/packages/astro/src/vite-plugin-integrations-container/index.ts b/packages/astro/src/vite-plugin-integrations-container/index.ts index a7967092e..0169a6f71 100644 --- a/packages/astro/src/vite-plugin-integrations-container/index.ts +++ b/packages/astro/src/vite-plugin-integrations-container/index.ts @@ -1,6 +1,6 @@ -import { Plugin as VitePlugin } from 'vite'; -import { AstroSettings } from '../@types/astro.js'; -import { LogOptions } from '../core/logger/core.js'; +import type { Plugin as VitePlugin } from 'vite'; +import type { AstroSettings } from '../@types/astro.js'; +import type { LogOptions } from '../core/logger/core.js'; import { runHookServerSetup } from '../integrations/index.js'; /** Connect Astro integrations into Vite, as needed. */ diff --git a/packages/astro/src/vite-plugin-jsx/import-source.ts b/packages/astro/src/vite-plugin-jsx/import-source.ts index f21d2ba02..35efcaeda 100644 --- a/packages/astro/src/vite-plugin-jsx/import-source.ts +++ b/packages/astro/src/vite-plugin-jsx/import-source.ts @@ -1,5 +1,5 @@ -import { TsConfigJson } from 'tsconfig-resolver'; -import { AstroRenderer } from '../@types/astro'; +import type { TsConfigJson } from 'tsconfig-resolver'; +import type { AstroRenderer } from '../@types/astro'; import { parseNpmName } from '../core/util.js'; export async function detectImportSource( diff --git a/packages/astro/src/vite-plugin-markdown/content-entry-type.ts b/packages/astro/src/vite-plugin-markdown/content-entry-type.ts index e94d18ad4..cbf5cc957 100644 --- a/packages/astro/src/vite-plugin-markdown/content-entry-type.ts +++ b/packages/astro/src/vite-plugin-markdown/content-entry-type.ts @@ -1,5 +1,5 @@ import { fileURLToPath } from 'node:url'; -import { ContentEntryType } from '../@types/astro.js'; +import type { ContentEntryType } from '../@types/astro.js'; import { parseFrontmatter } from '../content/utils.js'; export const markdownContentEntryType: ContentEntryType = { diff --git a/packages/astro/src/vite-plugin-scanner/index.ts b/packages/astro/src/vite-plugin-scanner/index.ts index 92d6a16eb..330b9390c 100644 --- a/packages/astro/src/vite-plugin-scanner/index.ts +++ b/packages/astro/src/vite-plugin-scanner/index.ts @@ -1,5 +1,5 @@ import { normalizePath, Plugin as VitePlugin } from 'vite'; -import { AstroSettings } from '../@types/astro.js'; +import type { AstroSettings } from '../@types/astro.js'; import { isEndpoint, isPage } from '../core/util.js'; import { scan } from './scan.js'; diff --git a/packages/astro/src/vite-plugin-scanner/scan.ts b/packages/astro/src/vite-plugin-scanner/scan.ts index 28e453f43..bb6efe9f5 100644 --- a/packages/astro/src/vite-plugin-scanner/scan.ts +++ b/packages/astro/src/vite-plugin-scanner/scan.ts @@ -1,6 +1,6 @@ import * as eslexer from 'es-module-lexer'; import { AstroError, AstroErrorData } from '../core/errors/index.js'; -import { PageOptions } from '../vite-plugin-astro/types.js'; +import type { PageOptions } from '../vite-plugin-astro/types.js'; const BOOLEAN_EXPORTS = new Set(['prerender']); diff --git a/packages/astro/src/vite-plugin-scripts/index.ts b/packages/astro/src/vite-plugin-scripts/index.ts index 00cbe690f..18f90b057 100644 --- a/packages/astro/src/vite-plugin-scripts/index.ts +++ b/packages/astro/src/vite-plugin-scripts/index.ts @@ -1,5 +1,5 @@ -import { ConfigEnv, Plugin as VitePlugin } from 'vite'; -import { AstroSettings, InjectedScriptStage } from '../@types/astro.js'; +import type { ConfigEnv, Plugin as VitePlugin } from 'vite'; +import type { AstroSettings, InjectedScriptStage } from '../@types/astro.js'; // NOTE: We can't use the virtual "\0" ID convention because we need to // inject these as ESM imports into actual code, where they would not diff --git a/packages/astro/src/vite-plugin-scripts/page-ssr.ts b/packages/astro/src/vite-plugin-scripts/page-ssr.ts index 98d12d73d..c004a6634 100644 --- a/packages/astro/src/vite-plugin-scripts/page-ssr.ts +++ b/packages/astro/src/vite-plugin-scripts/page-ssr.ts @@ -1,6 +1,6 @@ import MagicString from 'magic-string'; import { normalizePath, Plugin as VitePlugin } from 'vite'; -import { AstroSettings } from '../@types/astro.js'; +import type { AstroSettings } from '../@types/astro.js'; import { isPage } from '../core/util.js'; import { PAGE_SSR_SCRIPT_ID } from './index.js'; |