diff --git a/packages/astro/src/core/render/environment.ts b/packages/astro/src/core/render/environment.ts index 4a8c2c1f7..de7cbe6a8 100644 --- a/packages/astro/src/core/render/environment.ts +++ b/packages/astro/src/core/render/environment.ts @@ -1,8 +1,8 @@ import type { MarkdownRenderingOptions } from '@astrojs/markdown-remark'; -import type { RuntimeMode, SSRLoadedRenderer, AstroSettings } from '../../@types/astro'; +import type { AstroSettings, RuntimeMode, SSRLoadedRenderer } from '../../@types/astro'; import type { LogOptions } from '../logger/core.js'; -import type { RouteCache } from './route-cache.js'; import type { ModuleLoader } from '../module-loader'; +import type { RouteCache } from './route-cache.js'; /** * An environment represents the static parts of rendering that do not change diff --git a/packages/astro/src/core/render/index.ts b/packages/astro/src/core/render/index.ts index ac8fb7593..a82c5699e 100644 --- a/packages/astro/src/core/render/index.ts +++ b/packages/astro/src/core/render/index.ts @@ -1,5 +1,5 @@ -import type { DevelopmentEnvironment } from './environment'; import type { AstroMiddlewareInstance, ComponentInstance, RouteData } from '../../@types/astro'; +import type { DevelopmentEnvironment } from './environment'; export { createRenderContext } from './context.js'; export type { RenderContext } from './context.js'; diff --git a/packages/astro/src/prerender/routing.ts b/packages/astro/src/prerender/routing.ts index beac0b841..a3b3c0d54 100644 --- a/packages/astro/src/prerender/routing.ts +++ b/packages/astro/src/prerender/routing.ts @@ -1,8 +1,8 @@ import type { AstroSettings, ComponentInstance, RouteData } from '../@types/astro'; import { RedirectComponentInstance, routeIsRedirect } from '../core/redirects/index.js'; +import type { DevelopmentEnvironment } from '../core/render'; import { preload } from '../vite-plugin-astro-server/index.js'; import { getPrerenderStatus } from './metadata.js'; -import type { DevelopmentEnvironment } from '../core/render'; type GetSortedPreloadedMatchesParams = { env: DevelopmentEnvironment; diff --git a/packages/astro/src/vite-plugin-astro-server/css.ts b/packages/astro/src/vite-plugin-astro-server/css.ts index 41f803acd..093bda461 100644 --- a/packages/astro/src/vite-plugin-astro-server/css.ts +++ b/packages/astro/src/vite-plugin-astro-server/css.ts @@ -1,5 +1,5 @@ -import type { ModuleLoader } from '../core/module-loader'; import type { RuntimeMode } from '../@types/astro.js'; +import type { ModuleLoader } from '../core/module-loader'; import { viteID } from '../core/util.js'; import { isBuildableCSSRequest } from './util.js'; import { crawlGraph } from './vite.js'; diff --git a/packages/astro/src/vite-plugin-astro-server/environment.ts b/packages/astro/src/vite-plugin-astro-server/environment.ts index 0c98878ff..bcf783bf2 100644 --- a/packages/astro/src/vite-plugin-astro-server/environment.ts +++ b/packages/astro/src/vite-plugin-astro-server/environment.ts @@ -1,11 +1,11 @@ -import { createResolve } from './resolve.js'; -import type { ModuleLoader } from '../core/module-loader'; import type { AstroSettings, RuntimeMode, SSRManifest } from '../@types/astro.js'; import type { LogOptions } from '../core/logger/core.js'; -import { RouteCache } from '../core/render/route-cache.js'; -import { isServerLikeOutput } from '../prerender/utils.js'; +import type { ModuleLoader } from '../core/module-loader'; import type { DevelopmentEnvironment } from '../core/render'; import { createEnvironment } from '../core/render/index.js'; +import { RouteCache } from '../core/render/route-cache.js'; +import { isServerLikeOutput } from '../prerender/utils.js'; +import { createResolve } from './resolve.js'; export function createDevelopmentEnvironment( manifest: SSRManifest, diff --git a/packages/astro/src/vite-plugin-astro-server/index.ts b/packages/astro/src/vite-plugin-astro-server/index.ts index 95512c408..17302ba41 100644 --- a/packages/astro/src/vite-plugin-astro-server/index.ts +++ b/packages/astro/src/vite-plugin-astro-server/index.ts @@ -1,9 +1,9 @@ import type { ComponentInstance } from '../@types/astro.js'; +import { enhanceViteSSRError } from '../core/errors/dev/index.js'; +import { AggregateError, CSSError, MarkdownError } from '../core/errors/index.js'; +import type { DevelopmentEnvironment } from '../core/render/environment'; import { loadRenderers } from '../core/render/index.js'; import { viteID } from '../core/util.js'; -import { AggregateError, CSSError, MarkdownError } from '../core/errors/index.js'; -import { enhanceViteSSRError } from '../core/errors/dev/index.js'; -import type { DevelopmentEnvironment } from '../core/render/environment'; export async function preload({ env, diff --git a/packages/astro/src/vite-plugin-astro-server/metadata.ts b/packages/astro/src/vite-plugin-astro-server/metadata.ts index 9ac6e73fe..81e972dba 100644 --- a/packages/astro/src/vite-plugin-astro-server/metadata.ts +++ b/packages/astro/src/vite-plugin-astro-server/metadata.ts @@ -1,8 +1,8 @@ -import { crawlGraph } from './vite.js'; -import type { ModuleLoader, ModuleInfo } from '../core/module-loader'; +import type { SSRComponentMetadata, SSRResult } from '../@types/astro'; +import type { ModuleInfo, ModuleLoader } from '../core/module-loader'; import { viteID } from '../core/util.js'; import { getAstroMetadata } from '../vite-plugin-astro/index.js'; -import type { SSRComponentMetadata, SSRResult } from '../@types/astro'; +import { crawlGraph } from './vite.js'; export async function getComponentMetadata( filePath: URL, diff --git a/packages/astro/src/vite-plugin-astro-server/plugin.ts b/packages/astro/src/vite-plugin-astro-server/plugin.ts index 713b88e4d..681aac341 100644 --- a/packages/astro/src/vite-plugin-astro-server/plugin.ts +++ b/packages/astro/src/vite-plugin-astro-server/plugin.ts @@ -4,10 +4,10 @@ import type { AstroSettings, ManifestData, SSRManifest } from '../@types/astro'; import { patchOverlay } from '../core/errors/overlay.js'; import type { LogOptions } from '../core/logger/core.js'; import { createViteLoader } from '../core/module-loader/index.js'; -import { createDevelopmentEnvironment } from './environment.js'; import { createRouteManifest } from '../core/routing/index.js'; import { baseMiddleware } from './base.js'; import { createController } from './controller.js'; +import { createDevelopmentEnvironment } from './environment.js'; import { handleRequest } from './request.js'; export interface AstroPluginOptions { diff --git a/packages/astro/src/vite-plugin-astro-server/request.ts b/packages/astro/src/vite-plugin-astro-server/request.ts index e334f42fd..2e6360e35 100644 --- a/packages/astro/src/vite-plugin-astro-server/request.ts +++ b/packages/astro/src/vite-plugin-astro-server/request.ts @@ -1,7 +1,7 @@ import type http from 'node:http'; import type { ManifestData, SSRManifest } from '../@types/astro'; -import type { DevServerController } from './controller'; import type { DevelopmentEnvironment } from '../core/render/index'; +import type { DevServerController } from './controller'; import { collectErrorMetadata } from '../core/errors/dev/index.js'; import { createSafeError } from '../core/errors/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 6160eab71..119785a12 100644 --- a/packages/astro/src/vite-plugin-astro-server/route.ts +++ b/packages/astro/src/vite-plugin-astro-server/route.ts @@ -12,16 +12,12 @@ import { attachToResponse } from '../core/cookies/index.js'; import { AstroErrorData, isAstroError } from '../core/errors/index.js'; import { warn } from '../core/logger/core.js'; import { loadMiddleware } from '../core/middleware/loadMiddleware.js'; -import { getStylesForURL } from './css.js'; -import { preload } from './index.js'; -import { getComponentMetadata } from './metadata.js'; -import { getScriptsForURL } from './scripts.js'; import { createRenderContext, - type DevelopmentEnvironment, - type SSROptions, getParamsAndProps, tryRenderRoute, + type DevelopmentEnvironment, + type SSROptions, } from '../core/render/index.js'; import { createRequest } from '../core/request.js'; import { matchAllRoutes } from '../core/routing/index.js'; @@ -30,7 +26,11 @@ import { getSortedPreloadedMatches } from '../prerender/routing.js'; import { isServerLikeOutput } from '../prerender/utils.js'; import { PAGE_SCRIPT_ID } from '../vite-plugin-scripts/index.js'; import { log404 } from './common.js'; +import { getStylesForURL } from './css.js'; +import { preload } from './index.js'; +import { getComponentMetadata } from './metadata.js'; import { handle404Response, writeSSRResult, writeWebResponse } from './response.js'; +import { getScriptsForURL } from './scripts.js'; const clientLocalsSymbol = Symbol.for('astro.locals'); diff --git a/packages/astro/src/vite-plugin-astro-server/scripts.ts b/packages/astro/src/vite-plugin-astro-server/scripts.ts index 9e6c587d0..55fe20254 100644 --- a/packages/astro/src/vite-plugin-astro-server/scripts.ts +++ b/packages/astro/src/vite-plugin-astro-server/scripts.ts @@ -1,9 +1,9 @@ +import type { SSRElement } from '../@types/astro'; +import type { ModuleInfo, ModuleLoader } from '../core/module-loader'; +import { createModuleScriptElementWithSrc } from '../core/render/ssr-element.js'; +import { rootRelativePath, viteID } from '../core/util.js'; import type { PluginMetadata as AstroPluginMetadata } from '../vite-plugin-astro/types'; import { crawlGraph } from './vite.js'; -import type { ModuleLoader, ModuleInfo } from '../core/module-loader'; -import type { SSRElement } from '../@types/astro'; -import { rootRelativePath, viteID } from '../core/util.js'; -import { createModuleScriptElementWithSrc } from '../core/render/ssr-element.js'; export async function getScriptsForURL( filePath: URL, diff --git a/packages/astro/src/vite-plugin-astro-server/vite.ts b/packages/astro/src/vite-plugin-astro-server/vite.ts index ac8659982..ef6ffd308 100644 --- a/packages/astro/src/vite-plugin-astro-server/vite.ts +++ b/packages/astro/src/vite-plugin-astro-server/vite.ts @@ -1,8 +1,8 @@ -import type { ModuleLoader, ModuleNode } from '../core/module-loader/index'; import npath from 'node:path'; -import { isCSSRequest } from './util.js'; -import { unwrapId } from '../core/util.js'; import { SUPPORTED_MARKDOWN_FILE_EXTENSIONS } from '../core/constants.js'; +import type { ModuleLoader, ModuleNode } from '../core/module-loader/index'; +import { unwrapId } from '../core/util.js'; +import { isCSSRequest } from './util.js'; /** * List of file extensions signalling we can (and should) SSR ahead-of-time