diff --git a/packages/astro/src/core/app/pipeline.ts b/packages/astro/src/core/app/pipeline.ts index 77d2f80b24..f62dc84ed9 100644 --- a/packages/astro/src/core/app/pipeline.ts +++ b/packages/astro/src/core/app/pipeline.ts @@ -1,16 +1,16 @@ import type { + ComponentInstance, ManifestData, + RewritePayload, RouteData, SSRElement, SSRResult, - ComponentInstance, - RewritePayload, } from '../../@types/astro.js'; import { Pipeline } from '../base-pipeline.js'; +import type { SinglePageBuiltModule } from '../build/types.js'; import { DEFAULT_404_COMPONENT } from '../constants.js'; import { RedirectSinglePageBuiltModule } from '../redirects/component.js'; import { createModuleScriptElement, createStylesheetElementSet } from '../render/ssr-element.js'; -import type { SinglePageBuiltModule } from '../build/types.js'; export class AppPipeline extends Pipeline { #manifestData: ManifestData | undefined; diff --git a/packages/astro/src/core/build/pipeline.ts b/packages/astro/src/core/build/pipeline.ts index 532759f1e4..daae6940e0 100644 --- a/packages/astro/src/core/build/pipeline.ts +++ b/packages/astro/src/core/build/pipeline.ts @@ -8,7 +8,10 @@ import type { import { getOutputDirectory } from '../../prerender/utils.js'; import { BEFORE_HYDRATION_SCRIPT_ID, PAGE_SCRIPT_ID } from '../../vite-plugin-scripts/index.js'; import type { SSRManifest } from '../app/types.js'; +import { RouteNotFound } from '../errors/errors-data.js'; +import { AstroError } from '../errors/index.js'; import { routeIsFallback, routeIsRedirect } from '../redirects/helpers.js'; +import { RedirectSinglePageBuiltModule } from '../redirects/index.js'; import { Pipeline } from '../render/index.js'; import { createAssetLink, @@ -16,6 +19,7 @@ import { createStylesheetElementSet, } from '../render/ssr-element.js'; import { isServerLikeOutput } from '../util.js'; +import { getOutDirWithinCwd } from './common.js'; import { type BuildInternals, cssOrder, @@ -31,10 +35,6 @@ import { } from './plugins/util.js'; import type { PageBuildData, SinglePageBuiltModule, StaticBuildOptions } from './types.js'; import { i18nHasFallback } from './util.js'; -import { RedirectSinglePageBuiltModule } from '../redirects/index.js'; -import { getOutDirWithinCwd } from './common.js'; -import { RouteNotFound } from '../errors/errors-data.js'; -import { AstroError } from '../errors/index.js'; /** * The build pipeline is responsible to gather the files emitted by the SSR build and generate the pages by executing these files. diff --git a/packages/astro/src/core/middleware/index.ts b/packages/astro/src/core/middleware/index.ts index 17c206d6e9..358cf31fe6 100644 --- a/packages/astro/src/core/middleware/index.ts +++ b/packages/astro/src/core/middleware/index.ts @@ -4,7 +4,7 @@ import { computePreferredLocale, computePreferredLocaleList, } from '../../i18n/utils.js'; -import { ASTRO_VERSION, clientLocalsSymbol, clientAddressSymbol } from '../constants.js'; +import { ASTRO_VERSION, clientAddressSymbol, clientLocalsSymbol } from '../constants.js'; import { AstroCookies } from '../cookies/index.js'; import { AstroError, AstroErrorData } from '../errors/index.js'; import { sequence } from './sequence.js'; diff --git a/packages/astro/src/core/middleware/sequence.ts b/packages/astro/src/core/middleware/sequence.ts index ef27d03c2c..8b2c2b49c5 100644 --- a/packages/astro/src/core/middleware/sequence.ts +++ b/packages/astro/src/core/middleware/sequence.ts @@ -1,6 +1,6 @@ import type { APIContext, MiddlewareHandler, RewritePayload } from '../../@types/astro.js'; -import { defineMiddleware } from './index.js'; import { AstroCookies } from '../cookies/cookies.js'; +import { defineMiddleware } from './index.js'; // From SvelteKit: https://github.com/sveltejs/kit/blob/master/packages/kit/src/exports/hooks/sequence.js /** diff --git a/packages/astro/src/vite-plugin-astro-server/pipeline.ts b/packages/astro/src/vite-plugin-astro-server/pipeline.ts index 685d13f570..797c5d29ab 100644 --- a/packages/astro/src/vite-plugin-astro-server/pipeline.ts +++ b/packages/astro/src/vite-plugin-astro-server/pipeline.ts @@ -14,10 +14,11 @@ import { getInfoOutput } from '../cli/info/index.js'; import type { HeadElements } from '../core/base-pipeline.js'; import { ASTRO_VERSION, DEFAULT_404_COMPONENT } from '../core/constants.js'; import { enhanceViteSSRError } from '../core/errors/dev/index.js'; +import { RouteNotFound } from '../core/errors/errors-data.js'; import { AggregateError, AstroError, CSSError, MarkdownError } from '../core/errors/index.js'; import type { Logger } from '../core/logger/core.js'; import type { ModuleLoader } from '../core/module-loader/index.js'; -import { loadRenderer, Pipeline } from '../core/render/index.js'; +import { Pipeline, loadRenderer } from '../core/render/index.js'; import { isPage, isServerLikeOutput, resolveIdToUrl, viteID } from '../core/util.js'; import { PAGE_SCRIPT_ID } from '../vite-plugin-scripts/index.js'; import { getStylesForURL } from './css.js'; @@ -25,7 +26,6 @@ import { getComponentMetadata } from './metadata.js'; import { createResolve } from './resolve.js'; import { default404Page } from './response.js'; import { getScriptsForURL } from './scripts.js'; -import { RouteNotFound } from '../core/errors/errors-data.js'; export class DevPipeline extends Pipeline { // renderers are loaded on every request, diff --git a/packages/astro/test/rewrite.test.js b/packages/astro/test/rewrite.test.js index 39ff084a4c..1c76ce10af 100644 --- a/packages/astro/test/rewrite.test.js +++ b/packages/astro/test/rewrite.test.js @@ -1,8 +1,8 @@ -import { describe, it, before, after } from 'node:test'; -import { loadFixture } from './test-utils.js'; -import { load as cheerioLoad } from 'cheerio'; import assert from 'node:assert/strict'; +import { after, before, describe, it } from 'node:test'; +import { load as cheerioLoad } from 'cheerio'; import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; describe('Dev reroute', () => { /** @type {import('./test-utils').Fixture} */