astro 4.1.2 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/components/ViewTransitions.astro +6 -1
  2. package/dist/@types/astro.d.ts +127 -25
  3. package/dist/assets/internal.js +3 -2
  4. package/dist/assets/services/noop.js +1 -4
  5. package/dist/assets/types.d.ts +1 -1
  6. package/dist/assets/utils/emitAsset.js +1 -1
  7. package/dist/assets/utils/proxy.d.ts +2 -1
  8. package/dist/assets/utils/proxy.js +5 -1
  9. package/dist/assets/vite-plugin-assets.js +21 -14
  10. package/dist/content/runtime-assets.d.ts +1 -1
  11. package/dist/content/runtime-assets.js +1 -1
  12. package/dist/content/types-generator.js +0 -26
  13. package/dist/content/utils.d.ts +1 -1
  14. package/dist/content/utils.js +3 -10
  15. package/dist/content/vite-plugin-content-imports.js +1 -0
  16. package/dist/core/app/createOutgoingHttpHeaders.d.ts +9 -0
  17. package/dist/core/app/createOutgoingHttpHeaders.js +19 -0
  18. package/dist/core/app/index.d.ts +38 -1
  19. package/dist/core/app/index.js +38 -8
  20. package/dist/core/app/node.d.ts +42 -10
  21. package/dist/core/app/node.js +87 -46
  22. package/dist/core/app/types.d.ts +2 -1
  23. package/dist/core/config/schema.d.ts +146 -66
  24. package/dist/core/config/schema.js +24 -6
  25. package/dist/core/config/vite-load.js +2 -2
  26. package/dist/core/constants.js +1 -1
  27. package/dist/core/create-vite.js +3 -3
  28. package/dist/core/dev/dev.js +1 -1
  29. package/dist/core/endpoint/index.d.ts +2 -1
  30. package/dist/core/errors/dev/vite.js +5 -11
  31. package/dist/core/errors/errors-data.d.ts +5 -0
  32. package/dist/core/errors/errors-data.js +7 -0
  33. package/dist/core/errors/overlay.js +2 -2
  34. package/dist/core/logger/vite.d.ts +0 -1
  35. package/dist/core/logger/vite.js +1 -2
  36. package/dist/core/messages.js +2 -2
  37. package/dist/core/render/context.d.ts +3 -2
  38. package/dist/core/render/context.js +1 -1
  39. package/dist/core/render/result.d.ts +2 -1
  40. package/dist/core/routing/manifest/create.d.ts +1 -1
  41. package/dist/core/routing/manifest/create.js +175 -117
  42. package/dist/core/sync/index.js +2 -2
  43. package/dist/i18n/index.d.ts +3 -2
  44. package/dist/i18n/index.js +4 -4
  45. package/dist/i18n/middleware.js +36 -19
  46. package/dist/prefetch/index.js +17 -1
  47. package/dist/prefetch/vite-plugin-prefetch.js +4 -1
  48. package/dist/runtime/client/{dev-overlay/plugins → dev-toolbar/apps}/astro.js +2 -2
  49. package/dist/runtime/client/{dev-overlay/plugins → dev-toolbar/apps}/audit/a11y.js +52 -4
  50. package/dist/runtime/client/{dev-overlay/plugins → dev-toolbar/apps}/audit/index.js +3 -3
  51. package/dist/runtime/client/{dev-overlay/plugins → dev-toolbar/apps}/settings.js +7 -7
  52. package/dist/runtime/client/dev-toolbar/apps/utils/highlight.d.ts +8 -0
  53. package/dist/runtime/client/{dev-overlay/plugins → dev-toolbar/apps}/utils/window.d.ts +1 -1
  54. package/dist/runtime/client/{dev-overlay/plugins → dev-toolbar/apps}/xray.js +4 -4
  55. package/dist/runtime/client/{dev-overlay → dev-toolbar}/entrypoint.js +64 -68
  56. package/dist/runtime/client/{dev-overlay → dev-toolbar}/settings.d.ts +2 -2
  57. package/dist/runtime/client/{dev-overlay → dev-toolbar}/settings.js +10 -5
  58. package/dist/runtime/client/dev-toolbar/toolbar.d.ts +45 -0
  59. package/dist/runtime/client/{dev-overlay/overlay.js → dev-toolbar/toolbar.js} +99 -103
  60. package/dist/runtime/client/{dev-overlay → dev-toolbar}/ui-library/badge.d.ts +1 -1
  61. package/dist/runtime/client/{dev-overlay → dev-toolbar}/ui-library/badge.js +2 -2
  62. package/dist/runtime/client/{dev-overlay → dev-toolbar}/ui-library/button.d.ts +1 -1
  63. package/dist/runtime/client/{dev-overlay → dev-toolbar}/ui-library/button.js +3 -2
  64. package/dist/runtime/client/{dev-overlay → dev-toolbar}/ui-library/card.d.ts +1 -1
  65. package/dist/runtime/client/{dev-overlay → dev-toolbar}/ui-library/card.js +2 -2
  66. package/dist/runtime/client/{dev-overlay → dev-toolbar}/ui-library/highlight.d.ts +1 -1
  67. package/dist/runtime/client/{dev-overlay → dev-toolbar}/ui-library/highlight.js +2 -2
  68. package/dist/runtime/client/{dev-overlay → dev-toolbar}/ui-library/icon.d.ts +1 -1
  69. package/dist/runtime/client/{dev-overlay → dev-toolbar}/ui-library/icon.js +2 -2
  70. package/dist/runtime/client/dev-toolbar/ui-library/index.d.ts +8 -0
  71. package/dist/runtime/client/dev-toolbar/ui-library/index.js +18 -0
  72. package/dist/runtime/client/{dev-overlay → dev-toolbar}/ui-library/toggle.d.ts +1 -1
  73. package/dist/runtime/client/{dev-overlay → dev-toolbar}/ui-library/toggle.js +2 -2
  74. package/dist/runtime/client/{dev-overlay → dev-toolbar}/ui-library/tooltip.d.ts +3 -3
  75. package/dist/runtime/client/{dev-overlay → dev-toolbar}/ui-library/tooltip.js +2 -2
  76. package/dist/runtime/client/{dev-overlay → dev-toolbar}/ui-library/window.d.ts +1 -1
  77. package/dist/runtime/client/{dev-overlay → dev-toolbar}/ui-library/window.js +3 -3
  78. package/dist/vite-plugin-astro/compile.js +0 -4
  79. package/dist/vite-plugin-astro/hmr.d.ts +3 -2
  80. package/dist/vite-plugin-astro/hmr.js +20 -41
  81. package/dist/vite-plugin-astro/index.js +36 -3
  82. package/dist/vite-plugin-astro/query.d.ts +0 -1
  83. package/dist/vite-plugin-astro/query.js +0 -5
  84. package/dist/vite-plugin-astro-server/route.js +3 -3
  85. package/dist/{vite-plugin-dev-overlay/vite-plugin-dev-overlay.d.ts → vite-plugin-dev-toolbar/vite-plugin-dev-toolbar.d.ts} +1 -1
  86. package/dist/{vite-plugin-dev-overlay/vite-plugin-dev-overlay.js → vite-plugin-dev-toolbar/vite-plugin-dev-toolbar.js} +5 -5
  87. package/dist/vite-plugin-markdown/images.js +46 -19
  88. package/package.json +4 -3
  89. package/dist/runtime/client/dev-overlay/overlay.d.ts +0 -45
  90. package/dist/runtime/client/dev-overlay/plugins/utils/highlight.d.ts +0 -8
  91. package/dist/runtime/client/dev-overlay/ui-library/index.d.ts +0 -8
  92. package/dist/runtime/client/dev-overlay/ui-library/index.js +0 -18
  93. /package/dist/runtime/client/{dev-overlay/plugins → dev-toolbar/apps}/astro.d.ts +0 -0
  94. /package/dist/runtime/client/{dev-overlay/plugins → dev-toolbar/apps}/audit/a11y.d.ts +0 -0
  95. /package/dist/runtime/client/{dev-overlay/plugins → dev-toolbar/apps}/audit/index.d.ts +0 -0
  96. /package/dist/runtime/client/{dev-overlay/plugins → dev-toolbar/apps}/settings.d.ts +0 -0
  97. /package/dist/runtime/client/{dev-overlay/plugins → dev-toolbar/apps}/utils/highlight.js +0 -0
  98. /package/dist/runtime/client/{dev-overlay/plugins → dev-toolbar/apps}/utils/icons.d.ts +0 -0
  99. /package/dist/runtime/client/{dev-overlay/plugins → dev-toolbar/apps}/utils/icons.js +0 -0
  100. /package/dist/runtime/client/{dev-overlay/plugins → dev-toolbar/apps}/utils/window.js +0 -0
  101. /package/dist/runtime/client/{dev-overlay/plugins → dev-toolbar/apps}/xray.d.ts +0 -0
  102. /package/dist/runtime/client/{dev-overlay → dev-toolbar}/entrypoint.d.ts +0 -0
  103. /package/dist/runtime/client/{dev-overlay → dev-toolbar}/ui-library/icons.d.ts +0 -0
  104. /package/dist/runtime/client/{dev-overlay → dev-toolbar}/ui-library/icons.js +0 -0
@@ -5,6 +5,7 @@ import { pathToFileURL } from "node:url";
5
5
  import { z } from "zod";
6
6
  import { appendForwardSlash, prependForwardSlash, removeTrailingForwardSlash } from "../path.js";
7
7
  import "mdast-util-to-hast";
8
+ import "shikiji-core";
8
9
  const ASTRO_CONFIG_DEFAULTS = {
9
10
  root: ".",
10
11
  srcDir: "./src",
@@ -41,7 +42,9 @@ const ASTRO_CONFIG_DEFAULTS = {
41
42
  redirects: {},
42
43
  experimental: {
43
44
  optimizeHoistedScript: false,
44
- contentCollectionCache: false
45
+ contentCollectionCache: false,
46
+ clientPrerender: false,
47
+ globalRoutePriority: false
45
48
  }
46
49
  };
47
50
  const AstroConfigSchema = z.object({
@@ -161,7 +164,8 @@ const AstroConfigSchema = z.object({
161
164
  experimentalThemes: z.record(
162
165
  z.enum(Object.keys(bundledThemes)).or(z.custom())
163
166
  ).default(ASTRO_CONFIG_DEFAULTS.markdown.shikiConfig.experimentalThemes),
164
- wrap: z.boolean().or(z.null()).default(ASTRO_CONFIG_DEFAULTS.markdown.shikiConfig.wrap)
167
+ wrap: z.boolean().or(z.null()).default(ASTRO_CONFIG_DEFAULTS.markdown.shikiConfig.wrap),
168
+ transformers: z.custom().array().default(ASTRO_CONFIG_DEFAULTS.markdown.shikiConfig.transformers)
165
169
  }).default({}),
166
170
  remarkPlugins: z.union([
167
171
  z.string(),
@@ -195,15 +199,27 @@ const AstroConfigSchema = z.object({
195
199
  fallback: z.record(z.string(), z.string()).optional(),
196
200
  routing: z.object({
197
201
  prefixDefaultLocale: z.boolean().default(false),
202
+ redirectToDefaultLocale: z.boolean().default(true),
198
203
  strategy: z.enum(["pathname"]).default("pathname")
199
- }).default({}).transform((routing) => {
204
+ }).default({}).refine(
205
+ ({ prefixDefaultLocale, redirectToDefaultLocale }) => {
206
+ return !(prefixDefaultLocale === false && redirectToDefaultLocale === false);
207
+ },
208
+ {
209
+ message: "The option `i18n.redirectToDefaultLocale` is only useful when the `i18n.prefixDefaultLocale` is set to `true`. Remove the option `i18n.redirectToDefaultLocale`, or change its value to `true`."
210
+ }
211
+ ).transform((routing) => {
200
212
  let strategy;
201
213
  switch (routing.strategy) {
202
214
  case "pathname": {
203
215
  if (routing.prefixDefaultLocale === true) {
204
- strategy = "prefix-always";
216
+ if (routing.redirectToDefaultLocale) {
217
+ strategy = "pathname-prefix-always";
218
+ } else {
219
+ strategy = "pathname-prefix-always-no-redirect";
220
+ }
205
221
  } else {
206
- strategy = "prefix-other-locales";
222
+ strategy = "pathname-prefix-other-locales";
207
223
  }
208
224
  }
209
225
  }
@@ -252,7 +268,9 @@ const AstroConfigSchema = z.object({
252
268
  ),
253
269
  experimental: z.object({
254
270
  optimizeHoistedScript: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.optimizeHoistedScript),
255
- contentCollectionCache: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.contentCollectionCache)
271
+ contentCollectionCache: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.contentCollectionCache),
272
+ clientPrerender: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.clientPrerender),
273
+ globalRoutePriority: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.globalRoutePriority)
256
274
  }).strict(
257
275
  `Invalid or outdated experimental feature.
258
276
  Check for incorrect spelling or outdated Astro version.
@@ -4,8 +4,8 @@ import loadFallbackPlugin from "../../vite-plugin-load-fallback/index.js";
4
4
  import { debug } from "../logger/core.js";
5
5
  async function createViteServer(root, fs) {
6
6
  const viteServer = await createServer({
7
- server: { middlewareMode: true, hmr: false, watch: { ignored: ["**"] } },
8
- optimizeDeps: { disabled: true },
7
+ server: { middlewareMode: true, hmr: false, watch: null },
8
+ optimizeDeps: { noDiscovery: true },
9
9
  clearScreen: false,
10
10
  appType: "custom",
11
11
  ssr: {
@@ -1,4 +1,4 @@
1
- const ASTRO_VERSION = "4.1.2";
1
+ const ASTRO_VERSION = "4.2.0";
2
2
  const SUPPORTED_MARKDOWN_FILE_EXTENSIONS = [
3
3
  ".markdown",
4
4
  ".mdown",
@@ -15,8 +15,9 @@ import astroPostprocessVitePlugin from "../vite-plugin-astro-postprocess/index.j
15
15
  import { vitePluginAstroServer } from "../vite-plugin-astro-server/index.js";
16
16
  import astroVitePlugin from "../vite-plugin-astro/index.js";
17
17
  import configAliasVitePlugin from "../vite-plugin-config-alias/index.js";
18
- import astroDevOverlay from "../vite-plugin-dev-overlay/vite-plugin-dev-overlay.js";
18
+ import astroDevToolbar from "../vite-plugin-dev-toolbar/vite-plugin-dev-toolbar.js";
19
19
  import envVitePlugin from "../vite-plugin-env/index.js";
20
+ import vitePluginFileURL from "../vite-plugin-fileurl/index.js";
20
21
  import astroHeadPlugin from "../vite-plugin-head/index.js";
21
22
  import htmlVitePlugin from "../vite-plugin-html/index.js";
22
23
  import { astroInjectEnvTsPlugin } from "../vite-plugin-inject-env-ts/index.js";
@@ -31,7 +32,6 @@ import { vitePluginSSRManifest } from "../vite-plugin-ssr-manifest/index.js";
31
32
  import { createViteLogger } from "./logger/vite.js";
32
33
  import { vitePluginMiddleware } from "./middleware/vite-plugin.js";
33
34
  import { joinPaths } from "./path.js";
34
- import vitePluginFileURL from "../vite-plugin-fileurl/index.js";
35
35
  const ALWAYS_NOEXTERNAL = [
36
36
  // This is only because Vite's native ESM doesn't resolve "exports" correctly.
37
37
  "astro",
@@ -113,7 +113,7 @@ async function createVite(commandConfig, { settings, logger, mode, command, fs =
113
113
  astroAssetsPlugin({ settings, logger, mode }),
114
114
  astroPrefetch({ settings }),
115
115
  astroTransitions({ settings }),
116
- astroDevOverlay({ settings, logger }),
116
+ astroDevToolbar({ settings, logger }),
117
117
  vitePluginFileURL({}),
118
118
  !!settings.config.i18n && astroInternationalization({ settings })
119
119
  ],
@@ -23,7 +23,7 @@ async function dev(inlineConfig) {
23
23
  base: restart.container.settings.config.base
24
24
  })
25
25
  );
26
- const currentVersion = "4.1.2";
26
+ const currentVersion = "4.2.0";
27
27
  if (currentVersion.includes("-")) {
28
28
  logger.warn("SKIP_FORMAT", msg.prerelease({ currentVersion }));
29
29
  }
@@ -1,5 +1,6 @@
1
1
  import type { APIContext, EndpointHandler, Locales, MiddlewareHandler, Params } from '../../@types/astro.js';
2
2
  import { type Environment, type RenderContext } from '../render/index.js';
3
+ import type { RoutingStrategies } from '../config/schema.js';
3
4
  type CreateAPIContext = {
4
5
  request: Request;
5
6
  params: Params;
@@ -7,7 +8,7 @@ type CreateAPIContext = {
7
8
  props: Record<string, any>;
8
9
  adapterName?: string;
9
10
  locales: Locales | undefined;
10
- routingStrategy: 'prefix-always' | 'prefix-other-locales' | undefined;
11
+ routingStrategy: RoutingStrategies | undefined;
11
12
  defaultLocale: string | undefined;
12
13
  };
13
14
  /**
@@ -1,7 +1,6 @@
1
- import { replaceCssVariables } from "@astrojs/markdown-remark";
2
1
  import * as fs from "node:fs";
3
2
  import { fileURLToPath } from "node:url";
4
- import { codeToHtml } from "shikiji";
3
+ import { codeToHtml, createCssVariablesTheme } from "shikiji";
5
4
  import { FailedToLoadModuleSSR, InvalidGlob, MdxIntegrationMissingError } from "../errors-data.js";
6
5
  import { AstroError } from "../errors.js";
7
6
  import { createSafeError } from "../utils.js";
@@ -70,7 +69,8 @@ function enhanceViteSSRError({
70
69
  }
71
70
  const ALTERNATIVE_JS_EXTS = ["cjs", "mjs"];
72
71
  const ALTERNATIVE_MD_EXTS = ["mdoc"];
73
- const INLINE_STYLE_SELECTOR_GLOBAL = /style="(.*?)"/g;
72
+ let _cssVariablesTheme;
73
+ const cssVariablesTheme = () => _cssVariablesTheme ?? (_cssVariablesTheme = createCssVariablesTheme({ variablePrefix: "--astro-code-" }));
74
74
  async function getViteErrorPayload(err) {
75
75
  let plugin = err.plugin;
76
76
  if (!plugin && err.hint) {
@@ -86,18 +86,12 @@ async function getViteErrorPayload(err) {
86
86
  if (ALTERNATIVE_MD_EXTS.includes(highlighterLang ?? "")) {
87
87
  highlighterLang = "md";
88
88
  }
89
- let highlightedCode = err.fullCode ? await codeToHtml(err.fullCode, {
89
+ const highlightedCode = err.fullCode ? await codeToHtml(err.fullCode, {
90
90
  // @ts-expect-error always assume that shiki can accept the lang string
91
91
  lang: highlighterLang,
92
- theme: "css-variables",
92
+ theme: cssVariablesTheme(),
93
93
  lineOptions: err.loc?.line ? [{ line: err.loc.line, classes: ["error-line"] }] : void 0
94
94
  }) : void 0;
95
- if (highlightedCode) {
96
- highlightedCode = highlightedCode.replace(
97
- INLINE_STYLE_SELECTOR_GLOBAL,
98
- (m) => replaceCssVariables(m)
99
- );
100
- }
101
95
  return {
102
96
  type: "error",
103
97
  err: {
@@ -893,6 +893,11 @@ export declare const MissingLocale: {
893
893
  title: string;
894
894
  message: (locale: string) => string;
895
895
  };
896
+ export declare const MissingIndexForInternationalization: {
897
+ name: string;
898
+ title: string;
899
+ message: (src: string) => string;
900
+ };
896
901
  /**
897
902
  * @docs
898
903
  * @description
@@ -313,6 +313,12 @@ const MissingLocale = {
313
313
  title: "The provided locale does not exist.",
314
314
  message: (locale) => `The locale/path \`${locale}\` does not exist in the configured \`i18n.locales\`.`
315
315
  };
316
+ const MissingIndexForInternationalization = {
317
+ name: "MissingIndexForInternationalizationError",
318
+ title: "Index page not found.",
319
+ message: (src) => `Astro couldn't find the index URL. This index page is required to create a redirect from the index URL to the index URL of the default locale.
320
+ Create an index page in \`${src}\``
321
+ };
316
322
  const CantRenderPage = {
317
323
  name: "CantRenderPage",
318
324
  title: "Astro can't render the route.",
@@ -502,6 +508,7 @@ export {
502
508
  MiddlewareNoDataOrNextCalled,
503
509
  MiddlewareNotAResponse,
504
510
  MissingImageDimension,
511
+ MissingIndexForInternationalization,
505
512
  MissingLocale,
506
513
  MissingMediaQueryDirective,
507
514
  MissingSharp,
@@ -68,7 +68,7 @@ const style = (
68
68
  --toggle-border-color: #C3CADB;
69
69
 
70
70
  /* Syntax Highlighting */
71
- --astro-code-color-text: #000000;
71
+ --astro-code-foreground: #000000;
72
72
  --astro-code-token-constant: #4ca48f;
73
73
  --astro-code-token-string: #9f722a;
74
74
  --astro-code-token-comment: #8490b5;
@@ -121,7 +121,7 @@ const style = (
121
121
  --toggle-border-color: #3D4663;
122
122
 
123
123
  /* Syntax Highlighting */
124
- --astro-code-color-text: #ffffff;
124
+ --astro-code-foreground: #ffffff;
125
125
  --astro-code-token-constant: #90f4e3;
126
126
  --astro-code-token-string: #f4cf90;
127
127
  --astro-code-token-comment: #8490b5;
@@ -1,4 +1,3 @@
1
1
  import type { Logger as ViteLogger, LogLevel } from 'vite';
2
2
  import { type Logger as AstroLogger } from './core.js';
3
- export declare function isAstroSrcFile(id: string | null): boolean | undefined;
4
3
  export declare function createViteLogger(astroLogger: AstroLogger, viteLogLevel?: LogLevel): ViteLogger;
@@ -74,6 +74,5 @@ function createViteLogger(astroLogger, viteLogLevel = "info") {
74
74
  return logger;
75
75
  }
76
76
  export {
77
- createViteLogger,
78
- isAstroSrcFile
77
+ createViteLogger
79
78
  };
@@ -36,7 +36,7 @@ function serverStart({
36
36
  host,
37
37
  base
38
38
  }) {
39
- const version = "4.1.2";
39
+ const version = "4.2.0";
40
40
  const localPrefix = `${dim("\u2503")} Local `;
41
41
  const networkPrefix = `${dim("\u2503")} Network `;
42
42
  const emptyPrefix = " ".repeat(11);
@@ -258,7 +258,7 @@ function printHelp({
258
258
  message.push(
259
259
  linebreak(),
260
260
  ` ${bgGreen(black(` ${commandName} `))} ${green(
261
- `v${"4.1.2"}`
261
+ `v${"4.2.0"}`
262
262
  )} ${headline}`
263
263
  );
264
264
  }
@@ -1,5 +1,6 @@
1
1
  import type { ComponentInstance, Locales, Params, Props, RouteData, SSRElement, SSRResult } from '../../@types/astro.js';
2
2
  import type { Environment } from './environment.js';
3
+ import type { RoutingStrategies } from '../config/schema.js';
3
4
  /**
4
5
  * The RenderContext represents the parts of rendering that are specific to one request.
5
6
  */
@@ -17,7 +18,7 @@ export interface RenderContext {
17
18
  locals?: object;
18
19
  locales: Locales | undefined;
19
20
  defaultLocale: string | undefined;
20
- routing: 'prefix-always' | 'prefix-other-locales' | undefined;
21
+ routing: RoutingStrategies | undefined;
21
22
  }
22
23
  export type CreateRenderContextArgs = Partial<Omit<RenderContext, 'params' | 'props' | 'locals'>> & {
23
24
  route: RouteData;
@@ -47,5 +48,5 @@ export declare function parseLocale(header: string): BrowserLocale[];
47
48
  */
48
49
  export declare function computePreferredLocale(request: Request, locales: Locales): string | undefined;
49
50
  export declare function computePreferredLocaleList(request: Request, locales: Locales): string[];
50
- export declare function computeCurrentLocale(request: Request, locales: Locales, routingStrategy: 'prefix-always' | 'prefix-other-locales' | undefined, defaultLocale: string | undefined): undefined | string;
51
+ export declare function computeCurrentLocale(request: Request, locales: Locales, routingStrategy: RoutingStrategies | undefined, defaultLocale: string | undefined): undefined | string;
51
52
  export {};
@@ -162,7 +162,7 @@ function computeCurrentLocale(request, locales, routingStrategy, defaultLocale)
162
162
  }
163
163
  }
164
164
  }
165
- if (routingStrategy === "prefix-other-locales") {
165
+ if (routingStrategy === "pathname-prefix-other-locales") {
166
166
  return defaultLocale;
167
167
  }
168
168
  return void 0;
@@ -1,6 +1,7 @@
1
1
  import type { Locales, Params, SSRElement, SSRLoadedRenderer, SSRResult } from '../../@types/astro.js';
2
2
  import { AstroCookies } from '../cookies/index.js';
3
3
  import type { Logger } from '../logger/core.js';
4
+ import type { RoutingStrategies } from '../config/schema.js';
4
5
  export interface CreateResultArgs {
5
6
  /**
6
7
  * Used to provide better error messages for `Astro.clientAddress`
@@ -32,6 +33,6 @@ export interface CreateResultArgs {
32
33
  cookies?: AstroCookies;
33
34
  locales: Locales | undefined;
34
35
  defaultLocale: string | undefined;
35
- routingStrategy: 'prefix-always' | 'prefix-other-locales' | undefined;
36
+ routingStrategy: RoutingStrategies | undefined;
36
37
  }
37
38
  export declare function createResult(args: CreateResultArgs): SSRResult;
@@ -11,4 +11,4 @@ export interface CreateRouteManifestParams {
11
11
  fsMod?: typeof nodeFs;
12
12
  }
13
13
  /** Create manifest of all static routes */
14
- export declare function createRouteManifest({ settings, cwd, fsMod }: CreateRouteManifestParams, logger: Logger): ManifestData;
14
+ export declare function createRouteManifest(params: CreateRouteManifestParams, logger: Logger): ManifestData;