diff --git a/packages/astro/src/i18n/index.ts b/packages/astro/src/i18n/index.ts index 58cd1a2000..32cd24f9cf 100644 --- a/packages/astro/src/i18n/index.ts +++ b/packages/astro/src/i18n/index.ts @@ -7,11 +7,11 @@ import type { ValidRedirectStatus, } from '../@types/astro.js'; import { shouldAppendForwardSlash } from '../core/build/util.js'; +import { REROUTE_DIRECTIVE_HEADER } from '../core/constants.js'; import { MissingLocale } from '../core/errors/errors-data.js'; import { AstroError } from '../core/errors/index.js'; -import type { RoutingStrategies } from './utils.js'; import { createI18nMiddleware } from './middleware.js'; -import { REROUTE_DIRECTIVE_HEADER } from '../core/constants.js'; +import type { RoutingStrategies } from './utils.js'; export function requestHasLocale(locales: Locales) { return function (context: APIContext): boolean { diff --git a/packages/astro/src/i18n/middleware.ts b/packages/astro/src/i18n/middleware.ts index 54aa1249f8..42c0f0e763 100644 --- a/packages/astro/src/i18n/middleware.ts +++ b/packages/astro/src/i18n/middleware.ts @@ -1,15 +1,15 @@ -import { - getPathByLocale, - type MiddlewarePayload, - notFound, - normalizeTheLocale, - requestHasLocale, - redirectToDefaultLocale, - redirectToFallback, -} from './index.js'; import type { APIContext, MiddlewareHandler, SSRManifest } from '../@types/astro.js'; import type { SSRManifestI18n } from '../core/app/types.js'; import { ROUTE_TYPE_HEADER } from '../core/constants.js'; +import { + type MiddlewarePayload, + getPathByLocale, + normalizeTheLocale, + notFound, + redirectToDefaultLocale, + redirectToFallback, + requestHasLocale, +} from './index.js'; export function createI18nMiddleware( i18n: SSRManifest['i18n'], diff --git a/packages/astro/src/virtual-modules/i18n.ts b/packages/astro/src/virtual-modules/i18n.ts index 0714c08b79..a0a07f1f0e 100644 --- a/packages/astro/src/virtual-modules/i18n.ts +++ b/packages/astro/src/virtual-modules/i18n.ts @@ -1,15 +1,15 @@ -import * as I18nInternals from '../i18n/index.js'; -import { toRoutingStrategy } from '../i18n/utils.js'; -import { AstroError } from '../core/errors/index.js'; -import { IncorrectStrategyForI18n } from '../core/errors/errors-data.js'; -import type { RedirectToFallback } from '../i18n/index.js'; -import type { SSRManifest } from '../core/app/types.js'; import type { APIContext, AstroConfig, MiddlewareHandler, ValidRedirectStatus, } from '../@types/astro.js'; +import type { SSRManifest } from '../core/app/types.js'; +import { IncorrectStrategyForI18n } from '../core/errors/errors-data.js'; +import { AstroError } from '../core/errors/index.js'; +import * as I18nInternals from '../i18n/index.js'; +import type { RedirectToFallback } from '../i18n/index.js'; +import { toRoutingStrategy } from '../i18n/utils.js'; import type { I18nInternalConfig } from '../i18n/vite-plugin-i18n.js'; export { normalizeTheLocale, toCodes, toPaths } from '../i18n/index.js'; diff --git a/packages/astro/test/fixtures/i18n-routing-manual-with-default-middleware/src/middleware.js b/packages/astro/test/fixtures/i18n-routing-manual-with-default-middleware/src/middleware.js index d45754902b..60d179ec71 100644 --- a/packages/astro/test/fixtures/i18n-routing-manual-with-default-middleware/src/middleware.js +++ b/packages/astro/test/fixtures/i18n-routing-manual-with-default-middleware/src/middleware.js @@ -1,5 +1,5 @@ -import { defineMiddleware, sequence } from 'astro:middleware'; import { middleware } from 'astro:i18n'; +import { defineMiddleware, sequence } from 'astro:middleware'; const customLogic = defineMiddleware(async (context, next) => { const url = new URL(context.request.url); diff --git a/packages/astro/test/fixtures/i18n-routing-manual/src/middleware.js b/packages/astro/test/fixtures/i18n-routing-manual/src/middleware.js index 29634e3ffe..33b110b638 100644 --- a/packages/astro/test/fixtures/i18n-routing-manual/src/middleware.js +++ b/packages/astro/test/fixtures/i18n-routing-manual/src/middleware.js @@ -1,5 +1,5 @@ -import { defineMiddleware } from 'astro:middleware'; import { redirectToDefaultLocale, requestHasLocale } from 'astro:i18n'; +import { defineMiddleware } from 'astro:middleware'; const allowList = new Set(['/help', '/help/']); diff --git a/packages/astro/test/i18n-routing-manual-with-default-middleware.test.js b/packages/astro/test/i18n-routing-manual-with-default-middleware.test.js index 2a80b04b95..bf0f6e8b97 100644 --- a/packages/astro/test/i18n-routing-manual-with-default-middleware.test.js +++ b/packages/astro/test/i18n-routing-manual-with-default-middleware.test.js @@ -1,8 +1,8 @@ -import { describe, it, before, after } from 'node:test'; import assert from 'node:assert/strict'; -import { loadFixture } from './test-utils.js'; +import { after, before, describe, it } from 'node:test'; import * as cheerio from 'cheerio'; import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; // DEV describe('Dev server manual routing', () => { diff --git a/packages/astro/test/i18n-routing-manual.test.js b/packages/astro/test/i18n-routing-manual.test.js index 24f9c187e8..d664b37978 100644 --- a/packages/astro/test/i18n-routing-manual.test.js +++ b/packages/astro/test/i18n-routing-manual.test.js @@ -1,8 +1,8 @@ -import { describe, it, before, after } from 'node:test'; import assert from 'node:assert/strict'; -import { loadFixture } from './test-utils.js'; +import { after, before, describe, it } from 'node:test'; import * as cheerio from 'cheerio'; import testAdapter from './test-adapter.js'; +import { loadFixture } from './test-utils.js'; // DEV describe('Dev server manual routing', () => {