astro 3.4.3 → 3.5.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 (158) hide show
  1. package/client.d.ts +86 -0
  2. package/components/Code.astro +37 -4
  3. package/components/Image.astro +2 -2
  4. package/components/Picture.astro +19 -5
  5. package/components/ViewTransitions.astro +39 -38
  6. package/content-module.template.mjs +4 -14
  7. package/dist/@types/astro.d.ts +223 -5
  8. package/dist/assets/build/generate.d.ts +2 -1
  9. package/dist/assets/build/generate.js +16 -5
  10. package/dist/assets/consts.d.ts +1 -0
  11. package/dist/assets/consts.js +2 -0
  12. package/dist/assets/endpoint/generic.js +6 -2
  13. package/dist/assets/internal.js +11 -2
  14. package/dist/assets/services/service.d.ts +10 -10
  15. package/dist/assets/services/service.js +2 -1
  16. package/dist/assets/services/vendor/squoosh/image-pool.d.ts +1 -2
  17. package/dist/assets/types.d.ts +19 -9
  18. package/dist/assets/utils/emitAsset.js +5 -0
  19. package/dist/assets/utils/metadata.d.ts +1 -2
  20. package/dist/assets/utils/proxy.d.ts +1 -0
  21. package/dist/assets/utils/proxy.js +16 -0
  22. package/dist/assets/utils/queryParams.d.ts +1 -1
  23. package/dist/assets/utils/transformToPath.d.ts +1 -1
  24. package/dist/assets/utils/transformToPath.js +8 -3
  25. package/dist/assets/vite-plugin-assets.js +26 -11
  26. package/dist/cli/build/index.js +1 -1
  27. package/dist/content/consts.d.ts +1 -0
  28. package/dist/content/consts.js +2 -0
  29. package/dist/content/runtime-assets.d.ts +9 -1
  30. package/dist/content/runtime-assets.js +1 -1
  31. package/dist/content/runtime.d.ts +1 -0
  32. package/dist/content/runtime.js +8 -2
  33. package/dist/content/utils.d.ts +1 -0
  34. package/dist/content/utils.js +9 -0
  35. package/dist/content/vite-plugin-content-assets.js +49 -23
  36. package/dist/content/vite-plugin-content-imports.js +9 -3
  37. package/dist/content/vite-plugin-content-virtual-mod.d.ts +17 -12
  38. package/dist/content/vite-plugin-content-virtual-mod.js +136 -57
  39. package/dist/core/app/index.js +19 -4
  40. package/dist/core/app/types.d.ts +7 -1
  41. package/dist/core/build/buildPipeline.js +17 -4
  42. package/dist/core/build/common.js +2 -0
  43. package/dist/core/build/generate.js +64 -34
  44. package/dist/core/build/index.d.ts +0 -8
  45. package/dist/core/build/index.js +9 -2
  46. package/dist/core/build/internal.d.ts +11 -1
  47. package/dist/core/build/internal.js +23 -1
  48. package/dist/core/build/page-data.js +46 -18
  49. package/dist/core/build/plugin.d.ts +12 -10
  50. package/dist/core/build/plugin.js +14 -22
  51. package/dist/core/build/plugins/index.js +4 -0
  52. package/dist/core/build/plugins/plugin-alias-resolve.js +1 -1
  53. package/dist/core/build/plugins/plugin-analyzer.js +1 -1
  54. package/dist/core/build/plugins/plugin-chunks.d.ts +4 -0
  55. package/dist/core/build/plugins/plugin-chunks.js +31 -0
  56. package/dist/core/build/plugins/plugin-component-entry.js +1 -1
  57. package/dist/core/build/plugins/plugin-content.d.ts +4 -0
  58. package/dist/core/build/plugins/plugin-content.js +273 -0
  59. package/dist/core/build/plugins/plugin-css.js +9 -4
  60. package/dist/core/build/plugins/plugin-hoisted-scripts.js +1 -1
  61. package/dist/core/build/plugins/plugin-internals.js +1 -1
  62. package/dist/core/build/plugins/plugin-manifest.js +14 -5
  63. package/dist/core/build/plugins/plugin-middleware.d.ts +1 -3
  64. package/dist/core/build/plugins/plugin-middleware.js +5 -57
  65. package/dist/core/build/plugins/plugin-pages.js +3 -3
  66. package/dist/core/build/plugins/plugin-prerender.js +2 -5
  67. package/dist/core/build/plugins/plugin-renderers.js +1 -1
  68. package/dist/core/build/plugins/plugin-ssr.js +6 -5
  69. package/dist/core/build/plugins/util.d.ts +3 -3
  70. package/dist/core/build/static-build.d.ts +2 -1
  71. package/dist/core/build/static-build.js +52 -28
  72. package/dist/core/build/types.d.ts +1 -1
  73. package/dist/core/build/util.d.ts +7 -0
  74. package/dist/core/build/util.js +37 -1
  75. package/dist/core/compile/compile.js +1 -0
  76. package/dist/core/config/config.js +3 -0
  77. package/dist/core/config/schema.d.ts +208 -0
  78. package/dist/core/config/schema.js +72 -4
  79. package/dist/core/config/settings.js +1 -0
  80. package/dist/core/constants.js +1 -1
  81. package/dist/core/create-vite.js +9 -3
  82. package/dist/core/dev/dev.js +1 -1
  83. package/dist/core/endpoint/index.d.ts +4 -3
  84. package/dist/core/endpoint/index.js +29 -3
  85. package/dist/core/errors/errors-data.d.ts +11 -0
  86. package/dist/core/errors/errors-data.js +17 -0
  87. package/dist/core/messages.js +2 -2
  88. package/dist/core/middleware/index.d.ts +7 -3
  89. package/dist/core/middleware/index.js +3 -2
  90. package/dist/core/middleware/loadMiddleware.d.ts +1 -2
  91. package/dist/core/middleware/loadMiddleware.js +3 -4
  92. package/dist/core/middleware/sequence.d.ts +2 -2
  93. package/dist/core/middleware/sequence.js +3 -2
  94. package/dist/core/middleware/vite-plugin.d.ts +9 -0
  95. package/dist/core/middleware/vite-plugin.js +101 -0
  96. package/dist/core/pipeline.d.ts +1 -1
  97. package/dist/core/pipeline.js +6 -4
  98. package/dist/core/preview/static-preview-server.js +3 -1
  99. package/dist/core/preview/vite-plugin-astro-preview.js +13 -2
  100. package/dist/core/redirects/helpers.d.ts +1 -0
  101. package/dist/core/redirects/helpers.js +4 -0
  102. package/dist/core/render/context.d.ts +24 -1
  103. package/dist/core/render/context.js +96 -2
  104. package/dist/core/render/core.d.ts +2 -14
  105. package/dist/core/render/core.js +12 -52
  106. package/dist/core/render/index.d.ts +2 -3
  107. package/dist/core/render/index.js +3 -4
  108. package/dist/core/render/params-and-props.d.ts +1 -1
  109. package/dist/core/render/params-and-props.js +5 -2
  110. package/dist/core/render/result.d.ts +1 -0
  111. package/dist/core/render/result.js +23 -0
  112. package/dist/core/render/route-cache.d.ts +1 -1
  113. package/dist/core/render/route-cache.js +17 -11
  114. package/dist/core/routing/manifest/create.js +118 -4
  115. package/dist/core/sync/index.d.ts +2 -24
  116. package/dist/i18n/index.d.ts +54 -0
  117. package/dist/i18n/index.js +91 -0
  118. package/dist/i18n/middleware.d.ts +2 -0
  119. package/dist/i18n/middleware.js +62 -0
  120. package/dist/i18n/vite-plugin-i18n.d.ts +7 -0
  121. package/dist/i18n/vite-plugin-i18n.js +62 -0
  122. package/dist/integrations/astroFeaturesValidation.js +4 -1
  123. package/dist/integrations/index.js +12 -0
  124. package/dist/prefetch/index.d.ts +31 -0
  125. package/dist/prefetch/index.js +176 -0
  126. package/dist/prefetch/vite-plugin-prefetch.d.ts +5 -0
  127. package/dist/prefetch/vite-plugin-prefetch.js +43 -0
  128. package/dist/runtime/client/dev-overlay/entrypoint.js +2 -2
  129. package/dist/runtime/client/dev-overlay/overlay.d.ts +10 -2
  130. package/dist/runtime/client/dev-overlay/overlay.js +47 -28
  131. package/dist/runtime/client/dev-overlay/plugins/astro.d.ts +1 -0
  132. package/dist/runtime/client/dev-overlay/plugins/astro.js +44 -9
  133. package/dist/runtime/client/dev-overlay/plugins/audit.d.ts +2 -1
  134. package/dist/runtime/client/dev-overlay/plugins/audit.js +101 -24
  135. package/dist/runtime/client/dev-overlay/plugins/xray.d.ts +1 -0
  136. package/dist/runtime/client/dev-overlay/plugins/xray.js +22 -0
  137. package/dist/runtime/client/dev-overlay/ui-library/card.js +2 -0
  138. package/dist/runtime/client/dev-overlay/ui-library/icons.d.ts +3 -0
  139. package/dist/runtime/client/dev-overlay/ui-library/icons.js +4 -1
  140. package/dist/runtime/client/dev-overlay/ui-library/tooltip.js +1 -0
  141. package/dist/runtime/client/dev-overlay/ui-library/window.js +1 -0
  142. package/dist/runtime/server/index.d.ts +0 -2
  143. package/dist/runtime/server/render/component.js +3 -5
  144. package/dist/transitions/router.d.ts +1 -0
  145. package/dist/transitions/router.js +10 -5
  146. package/dist/transitions/vite-plugin-transitions.d.ts +4 -1
  147. package/dist/transitions/vite-plugin-transitions.js +7 -1
  148. package/dist/vite-plugin-astro-server/devPipeline.d.ts +1 -0
  149. package/dist/vite-plugin-astro-server/devPipeline.js +2 -0
  150. package/dist/vite-plugin-astro-server/plugin.js +11 -1
  151. package/dist/vite-plugin-astro-server/route.js +113 -51
  152. package/dist/vite-plugin-head/index.js +1 -1
  153. package/dist/vite-plugin-markdown/index.js +1 -0
  154. package/dist/vite-plugin-scripts/index.js +2 -1
  155. package/package.json +7 -5
  156. package/tsconfigs/base.json +1 -1
  157. package/dist/core/endpoint/dev/index.d.ts +0 -2
  158. package/dist/core/endpoint/dev/index.js +0 -17
@@ -120,6 +120,16 @@ export declare const AstroConfigSchema: z.ZodObject<{
120
120
  status: 300 | 301 | 302 | 303 | 304 | 307 | 308;
121
121
  destination: string;
122
122
  }>]>>>;
123
+ prefetch: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
124
+ prefetchAll: z.ZodOptional<z.ZodBoolean>;
125
+ defaultStrategy: z.ZodOptional<z.ZodEnum<["tap", "hover", "viewport"]>>;
126
+ }, "strip", z.ZodTypeAny, {
127
+ prefetchAll?: boolean | undefined;
128
+ defaultStrategy?: "tap" | "hover" | "viewport" | undefined;
129
+ }, {
130
+ prefetchAll?: boolean | undefined;
131
+ defaultStrategy?: "tap" | "hover" | "viewport" | undefined;
132
+ }>]>>;
123
133
  image: z.ZodDefault<z.ZodObject<{
124
134
  endpoint: z.ZodOptional<z.ZodString>;
125
135
  service: z.ZodDefault<z.ZodObject<{
@@ -182,14 +192,17 @@ export declare const AstroConfigSchema: z.ZodObject<{
182
192
  shikiConfig: z.ZodDefault<z.ZodObject<{
183
193
  langs: z.ZodDefault<z.ZodEffects<z.ZodArray<z.ZodType<import("shikiji/dist/types/langs.mjs").p, z.ZodTypeDef, import("shikiji/dist/types/langs.mjs").p>, "many">, import("shikiji/dist/types/langs.mjs").p[], import("shikiji/dist/types/langs.mjs").p[]>>;
184
194
  theme: z.ZodDefault<z.ZodUnion<[z.ZodEnum<["css-variables" | "dark-plus" | "dracula" | "dracula-soft" | "github-dark" | "github-dark-dimmed" | "github-light" | "hc_light" | "light-plus" | "material-theme" | "material-theme-darker" | "material-theme-lighter" | "material-theme-ocean" | "material-theme-palenight" | "min-dark" | "min-light" | "monokai" | "nord" | "one-dark-pro" | "poimandres" | "rose-pine" | "rose-pine-dawn" | "rose-pine-moon" | "slack-dark" | "slack-ochin" | "solarized-dark" | "solarized-light" | "vitesse-dark" | "vitesse-light", ...("css-variables" | "dark-plus" | "dracula" | "dracula-soft" | "github-dark" | "github-dark-dimmed" | "github-light" | "hc_light" | "light-plus" | "material-theme" | "material-theme-darker" | "material-theme-lighter" | "material-theme-ocean" | "material-theme-palenight" | "min-dark" | "min-light" | "monokai" | "nord" | "one-dark-pro" | "poimandres" | "rose-pine" | "rose-pine-dawn" | "rose-pine-moon" | "slack-dark" | "slack-ochin" | "solarized-dark" | "solarized-light" | "vitesse-dark" | "vitesse-light")[]]>, z.ZodType<ShikiTheme, z.ZodTypeDef, ShikiTheme>]>>;
195
+ experimentalThemes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodEnum<["css-variables" | "dark-plus" | "dracula" | "dracula-soft" | "github-dark" | "github-dark-dimmed" | "github-light" | "hc_light" | "light-plus" | "material-theme" | "material-theme-darker" | "material-theme-lighter" | "material-theme-ocean" | "material-theme-palenight" | "min-dark" | "min-light" | "monokai" | "nord" | "one-dark-pro" | "poimandres" | "rose-pine" | "rose-pine-dawn" | "rose-pine-moon" | "slack-dark" | "slack-ochin" | "solarized-dark" | "solarized-light" | "vitesse-dark" | "vitesse-light", ...("css-variables" | "dark-plus" | "dracula" | "dracula-soft" | "github-dark" | "github-dark-dimmed" | "github-light" | "hc_light" | "light-plus" | "material-theme" | "material-theme-darker" | "material-theme-lighter" | "material-theme-ocean" | "material-theme-palenight" | "min-dark" | "min-light" | "monokai" | "nord" | "one-dark-pro" | "poimandres" | "rose-pine" | "rose-pine-dawn" | "rose-pine-moon" | "slack-dark" | "slack-ochin" | "solarized-dark" | "solarized-light" | "vitesse-dark" | "vitesse-light")[]]>, z.ZodType<ShikiTheme, z.ZodTypeDef, ShikiTheme>]>>>;
185
196
  wrap: z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
186
197
  }, "strip", z.ZodTypeAny, {
187
198
  langs: import("shikiji/dist/types/langs.mjs").p[];
188
199
  theme: ShikiTheme & (ShikiTheme | undefined);
200
+ experimentalThemes: Record<string, ShikiTheme>;
189
201
  wrap: boolean | null;
190
202
  }, {
191
203
  langs?: import("shikiji/dist/types/langs.mjs").p[] | undefined;
192
204
  theme?: ShikiTheme | undefined;
205
+ experimentalThemes?: Record<string, ShikiTheme> | undefined;
193
206
  wrap?: boolean | null | undefined;
194
207
  }>>;
195
208
  remarkPlugins: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodAny], null>, z.ZodType<RemarkPlugin, z.ZodTypeDef, RemarkPlugin>, z.ZodTuple<[z.ZodType<RemarkPlugin, z.ZodTypeDef, RemarkPlugin>, z.ZodAny], null>]>, "many">>;
@@ -203,6 +216,7 @@ export declare const AstroConfigSchema: z.ZodObject<{
203
216
  shikiConfig: {
204
217
  langs: import("shikiji/dist/types/langs.mjs").p[];
205
218
  theme: ShikiTheme & (ShikiTheme | undefined);
219
+ experimentalThemes: Record<string, ShikiTheme>;
206
220
  wrap: boolean | null;
207
221
  };
208
222
  remarkPlugins: (string | [string, any] | RemarkPlugin | [RemarkPlugin, any])[];
@@ -219,6 +233,7 @@ export declare const AstroConfigSchema: z.ZodObject<{
219
233
  shikiConfig?: {
220
234
  langs?: import("shikiji/dist/types/langs.mjs").p[] | undefined;
221
235
  theme?: ShikiTheme | undefined;
236
+ experimentalThemes?: Record<string, ShikiTheme> | undefined;
222
237
  wrap?: boolean | null | undefined;
223
238
  } | undefined;
224
239
  remarkPlugins?: (string | [string, any] | RemarkPlugin | [RemarkPlugin, any])[] | undefined;
@@ -231,12 +246,53 @@ export declare const AstroConfigSchema: z.ZodObject<{
231
246
  experimental: z.ZodDefault<z.ZodObject<{
232
247
  optimizeHoistedScript: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
233
248
  devOverlay: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
249
+ i18n: z.ZodOptional<z.ZodEffects<z.ZodOptional<z.ZodObject<{
250
+ defaultLocale: z.ZodString;
251
+ locales: z.ZodArray<z.ZodString, "many">;
252
+ fallback: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
253
+ routingStrategy: z.ZodDefault<z.ZodOptional<z.ZodEnum<["prefix-always", "prefix-other-locales"]>>>;
254
+ }, "strip", z.ZodTypeAny, {
255
+ defaultLocale: string;
256
+ locales: string[];
257
+ routingStrategy: "prefix-always" | "prefix-other-locales";
258
+ fallback?: Record<string, string> | undefined;
259
+ }, {
260
+ defaultLocale: string;
261
+ locales: string[];
262
+ fallback?: Record<string, string> | undefined;
263
+ routingStrategy?: "prefix-always" | "prefix-other-locales" | undefined;
264
+ }>>, {
265
+ defaultLocale: string;
266
+ locales: string[];
267
+ routingStrategy: "prefix-always" | "prefix-other-locales";
268
+ fallback?: Record<string, string> | undefined;
269
+ } | undefined, {
270
+ defaultLocale: string;
271
+ locales: string[];
272
+ fallback?: Record<string, string> | undefined;
273
+ routingStrategy?: "prefix-always" | "prefix-other-locales" | undefined;
274
+ } | undefined>>;
275
+ contentCollectionCache: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
234
276
  }, "strict", z.ZodTypeAny, {
235
277
  optimizeHoistedScript: boolean;
236
278
  devOverlay: boolean;
279
+ contentCollectionCache: boolean;
280
+ i18n?: {
281
+ defaultLocale: string;
282
+ locales: string[];
283
+ routingStrategy: "prefix-always" | "prefix-other-locales";
284
+ fallback?: Record<string, string> | undefined;
285
+ } | undefined;
237
286
  }, {
238
287
  optimizeHoistedScript?: boolean | undefined;
239
288
  devOverlay?: boolean | undefined;
289
+ i18n?: {
290
+ defaultLocale: string;
291
+ locales: string[];
292
+ fallback?: Record<string, string> | undefined;
293
+ routingStrategy?: "prefix-always" | "prefix-other-locales" | undefined;
294
+ } | undefined;
295
+ contentCollectionCache?: boolean | undefined;
240
296
  }>>;
241
297
  legacy: z.ZodDefault<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
242
298
  }, "strip", z.ZodTypeAny, {
@@ -298,6 +354,7 @@ export declare const AstroConfigSchema: z.ZodObject<{
298
354
  shikiConfig: {
299
355
  langs: import("shikiji/dist/types/langs.mjs").p[];
300
356
  theme: ShikiTheme & (ShikiTheme | undefined);
357
+ experimentalThemes: Record<string, ShikiTheme>;
301
358
  wrap: boolean | null;
302
359
  };
303
360
  remarkPlugins: (string | [string, any] | RemarkPlugin | [RemarkPlugin, any])[];
@@ -313,6 +370,13 @@ export declare const AstroConfigSchema: z.ZodObject<{
313
370
  experimental: {
314
371
  optimizeHoistedScript: boolean;
315
372
  devOverlay: boolean;
373
+ contentCollectionCache: boolean;
374
+ i18n?: {
375
+ defaultLocale: string;
376
+ locales: string[];
377
+ routingStrategy: "prefix-always" | "prefix-other-locales";
378
+ fallback?: Record<string, string> | undefined;
379
+ } | undefined;
316
380
  };
317
381
  legacy: {};
318
382
  site?: string | undefined;
@@ -322,6 +386,10 @@ export declare const AstroConfigSchema: z.ZodObject<{
322
386
  [k: string]: unknown;
323
387
  };
324
388
  } | undefined;
389
+ prefetch?: boolean | {
390
+ prefetchAll?: boolean | undefined;
391
+ defaultStrategy?: "tap" | "hover" | "viewport" | undefined;
392
+ } | undefined;
325
393
  }, {
326
394
  root?: string | undefined;
327
395
  srcDir?: string | undefined;
@@ -356,6 +424,10 @@ export declare const AstroConfigSchema: z.ZodObject<{
356
424
  status: 300 | 301 | 302 | 303 | 304 | 307 | 308;
357
425
  destination: string;
358
426
  }> | undefined;
427
+ prefetch?: boolean | {
428
+ prefetchAll?: boolean | undefined;
429
+ defaultStrategy?: "tap" | "hover" | "viewport" | undefined;
430
+ } | undefined;
359
431
  image?: {
360
432
  endpoint?: string | undefined;
361
433
  service?: {
@@ -376,6 +448,7 @@ export declare const AstroConfigSchema: z.ZodObject<{
376
448
  shikiConfig?: {
377
449
  langs?: import("shikiji/dist/types/langs.mjs").p[] | undefined;
378
450
  theme?: ShikiTheme | undefined;
451
+ experimentalThemes?: Record<string, ShikiTheme> | undefined;
379
452
  wrap?: boolean | null | undefined;
380
453
  } | undefined;
381
454
  remarkPlugins?: (string | [string, any] | RemarkPlugin | [RemarkPlugin, any])[] | undefined;
@@ -388,6 +461,13 @@ export declare const AstroConfigSchema: z.ZodObject<{
388
461
  experimental?: {
389
462
  optimizeHoistedScript?: boolean | undefined;
390
463
  devOverlay?: boolean | undefined;
464
+ i18n?: {
465
+ defaultLocale: string;
466
+ locales: string[];
467
+ fallback?: Record<string, string> | undefined;
468
+ routingStrategy?: "prefix-always" | "prefix-other-locales" | undefined;
469
+ } | undefined;
470
+ contentCollectionCache?: boolean | undefined;
391
471
  } | undefined;
392
472
  legacy?: {} | undefined;
393
473
  }>;
@@ -437,6 +517,16 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
437
517
  [k: string]: unknown;
438
518
  };
439
519
  }[], unknown>;
520
+ prefetch: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
521
+ prefetchAll: z.ZodOptional<z.ZodBoolean>;
522
+ defaultStrategy: z.ZodOptional<z.ZodEnum<["tap", "hover", "viewport"]>>;
523
+ }, "strip", z.ZodTypeAny, {
524
+ prefetchAll?: boolean | undefined;
525
+ defaultStrategy?: "tap" | "hover" | "viewport" | undefined;
526
+ }, {
527
+ prefetchAll?: boolean | undefined;
528
+ defaultStrategy?: "tap" | "hover" | "viewport" | undefined;
529
+ }>]>>;
440
530
  image: z.ZodDefault<z.ZodObject<{
441
531
  endpoint: z.ZodOptional<z.ZodString>;
442
532
  service: z.ZodDefault<z.ZodObject<{
@@ -499,14 +589,17 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
499
589
  shikiConfig: z.ZodDefault<z.ZodObject<{
500
590
  langs: z.ZodDefault<z.ZodEffects<z.ZodArray<z.ZodType<import("shikiji/dist/types/langs.mjs").p, z.ZodTypeDef, import("shikiji/dist/types/langs.mjs").p>, "many">, import("shikiji/dist/types/langs.mjs").p[], import("shikiji/dist/types/langs.mjs").p[]>>;
501
591
  theme: z.ZodDefault<z.ZodUnion<[z.ZodEnum<["css-variables" | "dark-plus" | "dracula" | "dracula-soft" | "github-dark" | "github-dark-dimmed" | "github-light" | "hc_light" | "light-plus" | "material-theme" | "material-theme-darker" | "material-theme-lighter" | "material-theme-ocean" | "material-theme-palenight" | "min-dark" | "min-light" | "monokai" | "nord" | "one-dark-pro" | "poimandres" | "rose-pine" | "rose-pine-dawn" | "rose-pine-moon" | "slack-dark" | "slack-ochin" | "solarized-dark" | "solarized-light" | "vitesse-dark" | "vitesse-light", ...("css-variables" | "dark-plus" | "dracula" | "dracula-soft" | "github-dark" | "github-dark-dimmed" | "github-light" | "hc_light" | "light-plus" | "material-theme" | "material-theme-darker" | "material-theme-lighter" | "material-theme-ocean" | "material-theme-palenight" | "min-dark" | "min-light" | "monokai" | "nord" | "one-dark-pro" | "poimandres" | "rose-pine" | "rose-pine-dawn" | "rose-pine-moon" | "slack-dark" | "slack-ochin" | "solarized-dark" | "solarized-light" | "vitesse-dark" | "vitesse-light")[]]>, z.ZodType<ShikiTheme, z.ZodTypeDef, ShikiTheme>]>>;
592
+ experimentalThemes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodEnum<["css-variables" | "dark-plus" | "dracula" | "dracula-soft" | "github-dark" | "github-dark-dimmed" | "github-light" | "hc_light" | "light-plus" | "material-theme" | "material-theme-darker" | "material-theme-lighter" | "material-theme-ocean" | "material-theme-palenight" | "min-dark" | "min-light" | "monokai" | "nord" | "one-dark-pro" | "poimandres" | "rose-pine" | "rose-pine-dawn" | "rose-pine-moon" | "slack-dark" | "slack-ochin" | "solarized-dark" | "solarized-light" | "vitesse-dark" | "vitesse-light", ...("css-variables" | "dark-plus" | "dracula" | "dracula-soft" | "github-dark" | "github-dark-dimmed" | "github-light" | "hc_light" | "light-plus" | "material-theme" | "material-theme-darker" | "material-theme-lighter" | "material-theme-ocean" | "material-theme-palenight" | "min-dark" | "min-light" | "monokai" | "nord" | "one-dark-pro" | "poimandres" | "rose-pine" | "rose-pine-dawn" | "rose-pine-moon" | "slack-dark" | "slack-ochin" | "solarized-dark" | "solarized-light" | "vitesse-dark" | "vitesse-light")[]]>, z.ZodType<ShikiTheme, z.ZodTypeDef, ShikiTheme>]>>>;
502
593
  wrap: z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
503
594
  }, "strip", z.ZodTypeAny, {
504
595
  langs: import("shikiji/dist/types/langs.mjs").p[];
505
596
  theme: ShikiTheme & (ShikiTheme | undefined);
597
+ experimentalThemes: Record<string, ShikiTheme>;
506
598
  wrap: boolean | null;
507
599
  }, {
508
600
  langs?: import("shikiji/dist/types/langs.mjs").p[] | undefined;
509
601
  theme?: ShikiTheme | undefined;
602
+ experimentalThemes?: Record<string, ShikiTheme> | undefined;
510
603
  wrap?: boolean | null | undefined;
511
604
  }>>;
512
605
  remarkPlugins: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodAny], null>, z.ZodType<RemarkPlugin, z.ZodTypeDef, RemarkPlugin>, z.ZodTuple<[z.ZodType<RemarkPlugin, z.ZodTypeDef, RemarkPlugin>, z.ZodAny], null>]>, "many">>;
@@ -520,6 +613,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
520
613
  shikiConfig: {
521
614
  langs: import("shikiji/dist/types/langs.mjs").p[];
522
615
  theme: ShikiTheme & (ShikiTheme | undefined);
616
+ experimentalThemes: Record<string, ShikiTheme>;
523
617
  wrap: boolean | null;
524
618
  };
525
619
  remarkPlugins: (string | [string, any] | RemarkPlugin | [RemarkPlugin, any])[];
@@ -536,6 +630,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
536
630
  shikiConfig?: {
537
631
  langs?: import("shikiji/dist/types/langs.mjs").p[] | undefined;
538
632
  theme?: ShikiTheme | undefined;
633
+ experimentalThemes?: Record<string, ShikiTheme> | undefined;
539
634
  wrap?: boolean | null | undefined;
540
635
  } | undefined;
541
636
  remarkPlugins?: (string | [string, any] | RemarkPlugin | [RemarkPlugin, any])[] | undefined;
@@ -548,12 +643,53 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
548
643
  experimental: z.ZodDefault<z.ZodObject<{
549
644
  optimizeHoistedScript: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
550
645
  devOverlay: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
646
+ i18n: z.ZodOptional<z.ZodEffects<z.ZodOptional<z.ZodObject<{
647
+ defaultLocale: z.ZodString;
648
+ locales: z.ZodArray<z.ZodString, "many">;
649
+ fallback: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
650
+ routingStrategy: z.ZodDefault<z.ZodOptional<z.ZodEnum<["prefix-always", "prefix-other-locales"]>>>;
651
+ }, "strip", z.ZodTypeAny, {
652
+ defaultLocale: string;
653
+ locales: string[];
654
+ routingStrategy: "prefix-always" | "prefix-other-locales";
655
+ fallback?: Record<string, string> | undefined;
656
+ }, {
657
+ defaultLocale: string;
658
+ locales: string[];
659
+ fallback?: Record<string, string> | undefined;
660
+ routingStrategy?: "prefix-always" | "prefix-other-locales" | undefined;
661
+ }>>, {
662
+ defaultLocale: string;
663
+ locales: string[];
664
+ routingStrategy: "prefix-always" | "prefix-other-locales";
665
+ fallback?: Record<string, string> | undefined;
666
+ } | undefined, {
667
+ defaultLocale: string;
668
+ locales: string[];
669
+ fallback?: Record<string, string> | undefined;
670
+ routingStrategy?: "prefix-always" | "prefix-other-locales" | undefined;
671
+ } | undefined>>;
672
+ contentCollectionCache: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
551
673
  }, "strict", z.ZodTypeAny, {
552
674
  optimizeHoistedScript: boolean;
553
675
  devOverlay: boolean;
676
+ contentCollectionCache: boolean;
677
+ i18n?: {
678
+ defaultLocale: string;
679
+ locales: string[];
680
+ routingStrategy: "prefix-always" | "prefix-other-locales";
681
+ fallback?: Record<string, string> | undefined;
682
+ } | undefined;
554
683
  }, {
555
684
  optimizeHoistedScript?: boolean | undefined;
556
685
  devOverlay?: boolean | undefined;
686
+ i18n?: {
687
+ defaultLocale: string;
688
+ locales: string[];
689
+ fallback?: Record<string, string> | undefined;
690
+ routingStrategy?: "prefix-always" | "prefix-other-locales" | undefined;
691
+ } | undefined;
692
+ contentCollectionCache?: boolean | undefined;
557
693
  }>>;
558
694
  legacy: z.ZodDefault<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
559
695
  root: z.ZodEffects<z.ZodDefault<z.ZodString>, import("url").URL, string | undefined>;
@@ -681,6 +817,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
681
817
  shikiConfig: {
682
818
  langs: import("shikiji/dist/types/langs.mjs").p[];
683
819
  theme: ShikiTheme & (ShikiTheme | undefined);
820
+ experimentalThemes: Record<string, ShikiTheme>;
684
821
  wrap: boolean | null;
685
822
  };
686
823
  remarkPlugins: (string | [string, any] | RemarkPlugin | [RemarkPlugin, any])[];
@@ -696,6 +833,13 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
696
833
  experimental: {
697
834
  optimizeHoistedScript: boolean;
698
835
  devOverlay: boolean;
836
+ contentCollectionCache: boolean;
837
+ i18n?: {
838
+ defaultLocale: string;
839
+ locales: string[];
840
+ routingStrategy: "prefix-always" | "prefix-other-locales";
841
+ fallback?: Record<string, string> | undefined;
842
+ } | undefined;
699
843
  };
700
844
  legacy: {};
701
845
  site?: string | undefined;
@@ -705,6 +849,10 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
705
849
  [k: string]: unknown;
706
850
  };
707
851
  } | undefined;
852
+ prefetch?: boolean | {
853
+ prefetchAll?: boolean | undefined;
854
+ defaultStrategy?: "tap" | "hover" | "viewport" | undefined;
855
+ } | undefined;
708
856
  }, {
709
857
  output?: "server" | "static" | "hybrid" | undefined;
710
858
  redirects?: Record<string, string | {
@@ -720,6 +868,10 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
720
868
  hooks?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
721
869
  } | undefined;
722
870
  integrations?: unknown;
871
+ prefetch?: boolean | {
872
+ prefetchAll?: boolean | undefined;
873
+ defaultStrategy?: "tap" | "hover" | "viewport" | undefined;
874
+ } | undefined;
723
875
  image?: {
724
876
  endpoint?: string | undefined;
725
877
  service?: {
@@ -740,6 +892,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
740
892
  shikiConfig?: {
741
893
  langs?: import("shikiji/dist/types/langs.mjs").p[] | undefined;
742
894
  theme?: ShikiTheme | undefined;
895
+ experimentalThemes?: Record<string, ShikiTheme> | undefined;
743
896
  wrap?: boolean | null | undefined;
744
897
  } | undefined;
745
898
  remarkPlugins?: (string | [string, any] | RemarkPlugin | [RemarkPlugin, any])[] | undefined;
@@ -752,6 +905,13 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
752
905
  experimental?: {
753
906
  optimizeHoistedScript?: boolean | undefined;
754
907
  devOverlay?: boolean | undefined;
908
+ i18n?: {
909
+ defaultLocale: string;
910
+ locales: string[];
911
+ fallback?: Record<string, string> | undefined;
912
+ routingStrategy?: "prefix-always" | "prefix-other-locales" | undefined;
913
+ } | undefined;
914
+ contentCollectionCache?: boolean | undefined;
755
915
  } | undefined;
756
916
  legacy?: {} | undefined;
757
917
  root?: string | undefined;
@@ -833,6 +993,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
833
993
  shikiConfig: {
834
994
  langs: import("shikiji/dist/types/langs.mjs").p[];
835
995
  theme: ShikiTheme & (ShikiTheme | undefined);
996
+ experimentalThemes: Record<string, ShikiTheme>;
836
997
  wrap: boolean | null;
837
998
  };
838
999
  remarkPlugins: (string | [string, any] | RemarkPlugin | [RemarkPlugin, any])[];
@@ -848,6 +1009,13 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
848
1009
  experimental: {
849
1010
  optimizeHoistedScript: boolean;
850
1011
  devOverlay: boolean;
1012
+ contentCollectionCache: boolean;
1013
+ i18n?: {
1014
+ defaultLocale: string;
1015
+ locales: string[];
1016
+ routingStrategy: "prefix-always" | "prefix-other-locales";
1017
+ fallback?: Record<string, string> | undefined;
1018
+ } | undefined;
851
1019
  };
852
1020
  legacy: {};
853
1021
  site?: string | undefined;
@@ -857,6 +1025,10 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
857
1025
  [k: string]: unknown;
858
1026
  };
859
1027
  } | undefined;
1028
+ prefetch?: boolean | {
1029
+ prefetchAll?: boolean | undefined;
1030
+ defaultStrategy?: "tap" | "hover" | "viewport" | undefined;
1031
+ } | undefined;
860
1032
  }, {
861
1033
  output?: "server" | "static" | "hybrid" | undefined;
862
1034
  redirects?: Record<string, string | {
@@ -872,6 +1044,10 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
872
1044
  hooks?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
873
1045
  } | undefined;
874
1046
  integrations?: unknown;
1047
+ prefetch?: boolean | {
1048
+ prefetchAll?: boolean | undefined;
1049
+ defaultStrategy?: "tap" | "hover" | "viewport" | undefined;
1050
+ } | undefined;
875
1051
  image?: {
876
1052
  endpoint?: string | undefined;
877
1053
  service?: {
@@ -892,6 +1068,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
892
1068
  shikiConfig?: {
893
1069
  langs?: import("shikiji/dist/types/langs.mjs").p[] | undefined;
894
1070
  theme?: ShikiTheme | undefined;
1071
+ experimentalThemes?: Record<string, ShikiTheme> | undefined;
895
1072
  wrap?: boolean | null | undefined;
896
1073
  } | undefined;
897
1074
  remarkPlugins?: (string | [string, any] | RemarkPlugin | [RemarkPlugin, any])[] | undefined;
@@ -904,6 +1081,13 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
904
1081
  experimental?: {
905
1082
  optimizeHoistedScript?: boolean | undefined;
906
1083
  devOverlay?: boolean | undefined;
1084
+ i18n?: {
1085
+ defaultLocale: string;
1086
+ locales: string[];
1087
+ fallback?: Record<string, string> | undefined;
1088
+ routingStrategy?: "prefix-always" | "prefix-other-locales" | undefined;
1089
+ } | undefined;
1090
+ contentCollectionCache?: boolean | undefined;
907
1091
  } | undefined;
908
1092
  legacy?: {} | undefined;
909
1093
  root?: string | undefined;
@@ -985,6 +1169,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
985
1169
  shikiConfig: {
986
1170
  langs: import("shikiji/dist/types/langs.mjs").p[];
987
1171
  theme: ShikiTheme & (ShikiTheme | undefined);
1172
+ experimentalThemes: Record<string, ShikiTheme>;
988
1173
  wrap: boolean | null;
989
1174
  };
990
1175
  remarkPlugins: (string | [string, any] | RemarkPlugin | [RemarkPlugin, any])[];
@@ -1000,6 +1185,13 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
1000
1185
  experimental: {
1001
1186
  optimizeHoistedScript: boolean;
1002
1187
  devOverlay: boolean;
1188
+ contentCollectionCache: boolean;
1189
+ i18n?: {
1190
+ defaultLocale: string;
1191
+ locales: string[];
1192
+ routingStrategy: "prefix-always" | "prefix-other-locales";
1193
+ fallback?: Record<string, string> | undefined;
1194
+ } | undefined;
1003
1195
  };
1004
1196
  legacy: {};
1005
1197
  site?: string | undefined;
@@ -1009,6 +1201,10 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
1009
1201
  [k: string]: unknown;
1010
1202
  };
1011
1203
  } | undefined;
1204
+ prefetch?: boolean | {
1205
+ prefetchAll?: boolean | undefined;
1206
+ defaultStrategy?: "tap" | "hover" | "viewport" | undefined;
1207
+ } | undefined;
1012
1208
  }, {
1013
1209
  output?: "server" | "static" | "hybrid" | undefined;
1014
1210
  redirects?: Record<string, string | {
@@ -1024,6 +1220,10 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
1024
1220
  hooks?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
1025
1221
  } | undefined;
1026
1222
  integrations?: unknown;
1223
+ prefetch?: boolean | {
1224
+ prefetchAll?: boolean | undefined;
1225
+ defaultStrategy?: "tap" | "hover" | "viewport" | undefined;
1226
+ } | undefined;
1027
1227
  image?: {
1028
1228
  endpoint?: string | undefined;
1029
1229
  service?: {
@@ -1044,6 +1244,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
1044
1244
  shikiConfig?: {
1045
1245
  langs?: import("shikiji/dist/types/langs.mjs").p[] | undefined;
1046
1246
  theme?: ShikiTheme | undefined;
1247
+ experimentalThemes?: Record<string, ShikiTheme> | undefined;
1047
1248
  wrap?: boolean | null | undefined;
1048
1249
  } | undefined;
1049
1250
  remarkPlugins?: (string | [string, any] | RemarkPlugin | [RemarkPlugin, any])[] | undefined;
@@ -1056,6 +1257,13 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
1056
1257
  experimental?: {
1057
1258
  optimizeHoistedScript?: boolean | undefined;
1058
1259
  devOverlay?: boolean | undefined;
1260
+ i18n?: {
1261
+ defaultLocale: string;
1262
+ locales: string[];
1263
+ fallback?: Record<string, string> | undefined;
1264
+ routingStrategy?: "prefix-always" | "prefix-other-locales" | undefined;
1265
+ } | undefined;
1266
+ contentCollectionCache?: boolean | undefined;
1059
1267
  } | undefined;
1060
1268
  legacy?: {} | undefined;
1061
1269
  root?: string | undefined;
@@ -1,7 +1,8 @@
1
1
  import { markdownConfigDefaults } from "@astrojs/markdown-remark";
2
2
  import { bundledThemes } from "shikiji";
3
+ import fs from "node:fs";
3
4
  import path from "node:path";
4
- import { pathToFileURL } from "node:url";
5
+ import { fileURLToPath, pathToFileURL } from "node:url";
5
6
  import { z } from "zod";
6
7
  import { appendForwardSlash, prependForwardSlash, removeTrailingForwardSlash } from "../path.js";
7
8
  import "mdast-util-to-hast";
@@ -43,7 +44,8 @@ const ASTRO_CONFIG_DEFAULTS = {
43
44
  redirects: {},
44
45
  experimental: {
45
46
  optimizeHoistedScript: false,
46
- devOverlay: false
47
+ devOverlay: false,
48
+ contentCollectionCache: false
47
49
  }
48
50
  };
49
51
  const AstroConfigSchema = z.object({
@@ -116,6 +118,13 @@ const AstroConfigSchema = z.object({
116
118
  })
117
119
  ])
118
120
  ).default(ASTRO_CONFIG_DEFAULTS.redirects),
121
+ prefetch: z.union([
122
+ z.boolean(),
123
+ z.object({
124
+ prefetchAll: z.boolean().optional(),
125
+ defaultStrategy: z.enum(["tap", "hover", "viewport"]).optional()
126
+ })
127
+ ]).optional(),
119
128
  image: z.object({
120
129
  endpoint: z.string().optional(),
121
130
  service: z.object({
@@ -150,7 +159,21 @@ const AstroConfigSchema = z.object({
150
159
  langs: z.custom().array().transform((langs) => {
151
160
  for (const lang of langs) {
152
161
  if (typeof lang === "object") {
153
- if (lang.id && !lang.name) {
162
+ const langPath = lang.path;
163
+ if (langPath) {
164
+ const astroRoot = fileURLToPath(new URL("../../../", import.meta.url));
165
+ const normalizedPath = path.isAbsolute(langPath) ? langPath : path.resolve(astroRoot, langPath);
166
+ try {
167
+ const content = fs.readFileSync(normalizedPath, "utf-8");
168
+ const parsed = JSON.parse(content);
169
+ Object.assign(lang, parsed);
170
+ } catch (e) {
171
+ throw new Error(`Unable to find language file at ${normalizedPath}`, {
172
+ cause: e
173
+ });
174
+ }
175
+ }
176
+ if (lang.id) {
154
177
  lang.name = lang.id;
155
178
  }
156
179
  if (lang.grammar) {
@@ -161,6 +184,9 @@ const AstroConfigSchema = z.object({
161
184
  return langs;
162
185
  }).default([]),
163
186
  theme: z.enum(Object.keys(bundledThemes)).or(z.custom()).default(ASTRO_CONFIG_DEFAULTS.markdown.shikiConfig.theme),
187
+ experimentalThemes: z.record(
188
+ z.enum(Object.keys(bundledThemes)).or(z.custom())
189
+ ).default(ASTRO_CONFIG_DEFAULTS.markdown.shikiConfig.experimentalThemes),
164
190
  wrap: z.boolean().or(z.null()).default(ASTRO_CONFIG_DEFAULTS.markdown.shikiConfig.wrap)
165
191
  }).default({}),
166
192
  remarkPlugins: z.union([
@@ -182,7 +208,49 @@ const AstroConfigSchema = z.object({
182
208
  vite: z.custom((data) => data instanceof Object && !Array.isArray(data)).default(ASTRO_CONFIG_DEFAULTS.vite),
183
209
  experimental: z.object({
184
210
  optimizeHoistedScript: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.optimizeHoistedScript),
185
- devOverlay: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.devOverlay)
211
+ devOverlay: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.devOverlay),
212
+ i18n: z.optional(
213
+ z.object({
214
+ defaultLocale: z.string(),
215
+ locales: z.string().array(),
216
+ fallback: z.record(z.string(), z.string()).optional(),
217
+ // TODO: properly add default when the feature goes of experimental
218
+ routingStrategy: z.enum(["prefix-always", "prefix-other-locales"]).optional().default("prefix-other-locales")
219
+ }).optional().superRefine((i18n, ctx) => {
220
+ if (i18n) {
221
+ const { defaultLocale, locales, fallback } = i18n;
222
+ if (!locales.includes(defaultLocale)) {
223
+ ctx.addIssue({
224
+ code: z.ZodIssueCode.custom,
225
+ message: `The default locale \`${defaultLocale}\` is not present in the \`i18n.locales\` array.`
226
+ });
227
+ }
228
+ if (fallback) {
229
+ for (const [fallbackFrom, fallbackTo] of Object.entries(fallback)) {
230
+ if (!locales.includes(fallbackFrom)) {
231
+ ctx.addIssue({
232
+ code: z.ZodIssueCode.custom,
233
+ message: `The locale \`${fallbackFrom}\` key in the \`i18n.fallback\` record doesn't exist in the \`i18n.locales\` array.`
234
+ });
235
+ }
236
+ if (fallbackFrom === defaultLocale) {
237
+ ctx.addIssue({
238
+ code: z.ZodIssueCode.custom,
239
+ message: `You can't use the default locale as a key. The default locale can only be used as value.`
240
+ });
241
+ }
242
+ if (!locales.includes(fallbackTo)) {
243
+ ctx.addIssue({
244
+ code: z.ZodIssueCode.custom,
245
+ message: `The locale \`${fallbackTo}\` value in the \`i18n.fallback\` record doesn't exist in the \`i18n.locales\` array.`
246
+ });
247
+ }
248
+ }
249
+ }
250
+ }
251
+ })
252
+ ),
253
+ contentCollectionCache: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.contentCollectionCache)
186
254
  }).strict(
187
255
  `Invalid or outdated experimental feature.
188
256
  Check for incorrect spelling or outdated Astro version.
@@ -86,6 +86,7 @@ function createBaseSettings(config) {
86
86
  renderers: [],
87
87
  scripts: [],
88
88
  clientDirectives: getDefaultClientDirectives(),
89
+ middlewares: { pre: [], post: [] },
89
90
  watchFiles: [],
90
91
  devOverlayPlugins: [],
91
92
  timer: new AstroTimer()
@@ -1,4 +1,4 @@
1
- const ASTRO_VERSION = "3.4.3";
1
+ const ASTRO_VERSION = "3.5.0";
2
2
  const SUPPORTED_MARKDOWN_FILE_EXTENSIONS = [
3
3
  ".markdown",
4
4
  ".mdown",
@@ -8,6 +8,8 @@ import {
8
8
  astroContentImportPlugin,
9
9
  astroContentVirtualModPlugin
10
10
  } from "../content/index.js";
11
+ import astroInternationalization from "../i18n/vite-plugin-i18n.js";
12
+ import astroPrefetch from "../prefetch/vite-plugin-prefetch.js";
11
13
  import astroTransitions from "../transitions/vite-plugin-transitions.js";
12
14
  import astroPostprocessVitePlugin from "../vite-plugin-astro-postprocess/index.js";
13
15
  import { vitePluginAstroServer } from "../vite-plugin-astro-server/index.js";
@@ -26,6 +28,7 @@ import astroScannerPlugin from "../vite-plugin-scanner/index.js";
26
28
  import astroScriptsPlugin from "../vite-plugin-scripts/index.js";
27
29
  import astroScriptsPageSSRPlugin from "../vite-plugin-scripts/page-ssr.js";
28
30
  import { vitePluginSSRManifest } from "../vite-plugin-ssr-manifest/index.js";
31
+ import { vitePluginMiddleware } from "./middleware/vite-plugin.js";
29
32
  import { joinPaths } from "./path.js";
30
33
  const ALWAYS_NOEXTERNAL = [
31
34
  // This is only because Vite's native ESM doesn't resolve "exports" correctly.
@@ -101,13 +104,16 @@ async function createVite(commandConfig, { settings, logger, mode, command, fs =
101
104
  astroHeadPlugin(),
102
105
  astroScannerPlugin({ settings, logger }),
103
106
  astroInjectEnvTsPlugin({ settings, logger, fs }),
104
- astroContentVirtualModPlugin({ settings }),
107
+ astroContentVirtualModPlugin({ fs, settings }),
105
108
  astroContentImportPlugin({ fs, settings }),
106
109
  astroContentAssetPropagationPlugin({ mode, settings }),
110
+ vitePluginMiddleware({ settings }),
107
111
  vitePluginSSRManifest(),
108
112
  astroAssetsPlugin({ settings, logger, mode }),
109
- astroTransitions(),
110
- astroDevOverlay({ settings, logger })
113
+ astroPrefetch({ settings }),
114
+ astroTransitions({ settings }),
115
+ astroDevOverlay({ settings, logger }),
116
+ !!settings.config.experimental.i18n && astroInternationalization({ settings })
111
117
  ],
112
118
  publicDir: fileURLToPath(settings.config.publicDir),
113
119
  root: fileURLToPath(settings.config.root),
@@ -20,7 +20,7 @@ async function dev(inlineConfig) {
20
20
  base: restart.container.settings.config.base
21
21
  })
22
22
  );
23
- const currentVersion = "3.4.3";
23
+ const currentVersion = "3.5.0";
24
24
  if (currentVersion.includes("-")) {
25
25
  logger.warn(null, msg.prerelease({ currentVersion }));
26
26
  }