astro 5.7.4 → 5.7.5

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 (126) hide show
  1. package/dist/assets/fonts/config.d.ts +0 -16
  2. package/dist/assets/fonts/config.js +1 -2
  3. package/dist/assets/fonts/providers/index.d.ts +1 -1
  4. package/dist/assets/fonts/providers/index.js +3 -2
  5. package/dist/assets/fonts/utils.d.ts +0 -1
  6. package/dist/assets/fonts/utils.js +0 -1
  7. package/dist/assets/fonts/vite-plugin-fonts.js +11 -8
  8. package/dist/assets/services/service.d.ts +1 -1
  9. package/dist/assets/utils/etag.d.ts +0 -11
  10. package/dist/assets/utils/etag.js +1 -2
  11. package/dist/assets/utils/vendor/image-size/lookup.d.ts +0 -2
  12. package/dist/assets/utils/vendor/image-size/lookup.js +0 -10
  13. package/dist/cli/add/index.d.ts +0 -9
  14. package/dist/cli/add/index.js +1 -2
  15. package/dist/cli/info/index.d.ts +0 -1
  16. package/dist/cli/info/index.js +0 -1
  17. package/dist/cli/preferences/index.d.ts +0 -2
  18. package/dist/container/index.js +1 -6
  19. package/dist/content/content-layer.d.ts +2 -7
  20. package/dist/content/content-layer.js +4 -6
  21. package/dist/content/index.d.ts +1 -2
  22. package/dist/content/index.js +1 -5
  23. package/dist/content/loaders/file.d.ts +2 -1
  24. package/dist/content/loaders/glob.d.ts +3 -2
  25. package/dist/content/utils.d.ts +1 -12
  26. package/dist/content/utils.js +0 -13
  27. package/dist/content/vite-plugin-content-virtual-mod.d.ts +0 -16
  28. package/dist/content/vite-plugin-content-virtual-mod.js +1 -3
  29. package/dist/core/app/index.js +3 -4
  30. package/dist/core/app/pipeline.d.ts +2 -3
  31. package/dist/core/app/pipeline.js +1 -3
  32. package/dist/core/app/types.d.ts +3 -2
  33. package/dist/core/build/consts.d.ts +0 -1
  34. package/dist/core/build/consts.js +1 -3
  35. package/dist/core/build/index.d.ts +2 -1
  36. package/dist/core/build/page-data.d.ts +3 -2
  37. package/dist/core/build/plugin.d.ts +1 -1
  38. package/dist/core/build/plugins/plugin-analyzer.d.ts +0 -2
  39. package/dist/core/build/plugins/plugin-analyzer.js +1 -2
  40. package/dist/core/build/plugins/plugin-chunks.d.ts +0 -2
  41. package/dist/core/build/plugins/plugin-chunks.js +1 -2
  42. package/dist/core/build/plugins/plugin-component-entry.d.ts +0 -8
  43. package/dist/core/build/plugins/plugin-component-entry.js +1 -3
  44. package/dist/core/build/plugins/plugin-internals.d.ts +0 -2
  45. package/dist/core/build/plugins/plugin-internals.js +1 -2
  46. package/dist/core/build/plugins/plugin-renderers.d.ts +0 -2
  47. package/dist/core/build/plugins/plugin-renderers.js +1 -2
  48. package/dist/core/build/plugins/plugin-scripts.d.ts +0 -5
  49. package/dist/core/build/plugins/plugin-scripts.js +1 -2
  50. package/dist/core/build/plugins/plugin-ssr.d.ts +0 -1
  51. package/dist/core/build/plugins/plugin-ssr.js +0 -1
  52. package/dist/core/build/plugins/util.d.ts +0 -9
  53. package/dist/core/build/plugins/util.js +0 -2
  54. package/dist/core/build/types.d.ts +1 -1
  55. package/dist/core/config/config.d.ts +0 -1
  56. package/dist/core/config/config.js +0 -1
  57. package/dist/core/config/index.d.ts +1 -2
  58. package/dist/core/config/index.js +0 -2
  59. package/dist/core/config/schemas/base.d.ts +6 -4
  60. package/dist/core/config/schemas/relative.d.ts +6 -6
  61. package/dist/core/config/timer.d.ts +0 -5
  62. package/dist/core/config/tsconfig.d.ts +1 -1
  63. package/dist/core/constants.d.ts +0 -4
  64. package/dist/core/constants.js +1 -3
  65. package/dist/core/cookies/index.d.ts +1 -1
  66. package/dist/core/cookies/index.js +2 -4
  67. package/dist/core/cookies/response.d.ts +0 -1
  68. package/dist/core/cookies/response.js +1 -5
  69. package/dist/core/dev/container.d.ts +2 -1
  70. package/dist/core/dev/dev.js +1 -1
  71. package/dist/core/dev/index.d.ts +1 -1
  72. package/dist/core/dev/index.js +1 -2
  73. package/dist/core/dev/restart.d.ts +1 -1
  74. package/dist/core/encryption.d.ts +0 -8
  75. package/dist/core/encryption.js +1 -7
  76. package/dist/core/errors/index.d.ts +1 -2
  77. package/dist/core/errors/index.js +0 -2
  78. package/dist/core/logger/core.d.ts +3 -9
  79. package/dist/core/logger/core.js +1 -5
  80. package/dist/core/messages.d.ts +0 -1
  81. package/dist/core/messages.js +2 -11
  82. package/dist/core/middleware/sequence.js +3 -0
  83. package/dist/core/preview/static-preview-server.d.ts +2 -1
  84. package/dist/core/redirects/index.d.ts +0 -1
  85. package/dist/core/redirects/index.js +0 -2
  86. package/dist/core/render/index.d.ts +0 -17
  87. package/dist/core/render/ssr-element.d.ts +0 -2
  88. package/dist/core/render/ssr-element.js +0 -2
  89. package/dist/core/render-context.js +4 -0
  90. package/dist/core/request.d.ts +1 -1
  91. package/dist/core/routing/3xx.d.ts +2 -1
  92. package/dist/core/routing/astro-designed-error-pages.d.ts +0 -1
  93. package/dist/core/routing/astro-designed-error-pages.js +1 -16
  94. package/dist/core/routing/index.d.ts +2 -3
  95. package/dist/core/routing/index.js +3 -8
  96. package/dist/core/routing/manifest/create.d.ts +2 -3
  97. package/dist/core/routing/manifest/create.js +0 -1
  98. package/dist/core/routing/request.d.ts +0 -1
  99. package/dist/core/routing/request.js +1 -2
  100. package/dist/core/routing/rewrite.d.ts +3 -2
  101. package/dist/core/server-islands/vite-plugin-server-islands.d.ts +0 -1
  102. package/dist/core/server-islands/vite-plugin-server-islands.js +0 -1
  103. package/dist/core/sync/index.d.ts +2 -1
  104. package/dist/core/util.d.ts +0 -1
  105. package/dist/core/util.js +0 -1
  106. package/dist/events/session.d.ts +1 -1
  107. package/dist/integrations/features-validation.d.ts +1 -3
  108. package/dist/integrations/features-validation.js +0 -2
  109. package/dist/preferences/index.d.ts +4 -4
  110. package/dist/type-utils.d.ts +0 -4
  111. package/dist/types/public/config.d.ts +19 -0
  112. package/dist/types/typed-emitter.d.ts +2 -1
  113. package/dist/vite-plugin-astro/hmr.d.ts +2 -1
  114. package/dist/vite-plugin-astro/query.d.ts +3 -2
  115. package/dist/vite-plugin-astro/types.d.ts +2 -1
  116. package/dist/vite-plugin-astro-server/controller.d.ts +2 -2
  117. package/dist/vite-plugin-astro-server/plugin.d.ts +2 -1
  118. package/dist/vite-plugin-astro-server/response.d.ts +0 -1
  119. package/dist/vite-plugin-astro-server/response.js +0 -12
  120. package/dist/vite-plugin-astro-server/route.d.ts +1 -1
  121. package/dist/vite-plugin-astro-server/server-state.d.ts +3 -3
  122. package/dist/vite-plugin-astro-server/server-state.js +0 -4
  123. package/dist/vite-plugin-load-fallback/index.d.ts +1 -1
  124. package/dist/vite-plugin-scanner/index.d.ts +2 -1
  125. package/package.json +5 -11
  126. package/templates/env.mjs +1 -0
@@ -1,4 +1,2 @@
1
- import type { Plugin as VitePlugin } from 'vite';
2
1
  import type { AstroBuildPlugin } from '../plugin.js';
3
- export declare function vitePluginChunks(): VitePlugin;
4
2
  export declare function pluginChunks(): AstroBuildPlugin;
@@ -29,6 +29,5 @@ function pluginChunks() {
29
29
  };
30
30
  }
31
31
  export {
32
- pluginChunks,
33
- vitePluginChunks
32
+ pluginChunks
34
33
  };
@@ -1,12 +1,4 @@
1
- import type { Plugin as VitePlugin } from 'vite';
2
1
  import type { BuildInternals } from '../internal.js';
3
2
  import type { AstroBuildPlugin } from '../plugin.js';
4
- export declare const astroEntryPrefix = "\0astro-entry:";
5
- /**
6
- * When adding hydrated or client:only components as Rollup inputs, sometimes we're not using all
7
- * of the export names, e.g. `import { Counter } from './ManyComponents.jsx'`. This plugin proxies
8
- * entries to re-export only the names the user is using.
9
- */
10
- export declare function vitePluginComponentEntry(internals: BuildInternals): VitePlugin;
11
3
  export declare function normalizeEntryId(id: string): string;
12
4
  export declare function pluginComponentEntry(internals: BuildInternals): AstroBuildPlugin;
@@ -68,8 +68,6 @@ function pluginComponentEntry(internals) {
68
68
  };
69
69
  }
70
70
  export {
71
- astroEntryPrefix,
72
71
  normalizeEntryId,
73
- pluginComponentEntry,
74
- vitePluginComponentEntry
72
+ pluginComponentEntry
75
73
  };
@@ -1,5 +1,3 @@
1
- import type { Plugin as VitePlugin } from 'vite';
2
1
  import type { BuildInternals } from '../internal.js';
3
2
  import type { AstroBuildPlugin } from '../plugin.js';
4
- export declare function vitePluginInternals(input: Set<string>, internals: BuildInternals): VitePlugin;
5
3
  export declare function pluginInternals(internals: BuildInternals): AstroBuildPlugin;
@@ -59,6 +59,5 @@ function pluginInternals(internals) {
59
59
  };
60
60
  }
61
61
  export {
62
- pluginInternals,
63
- vitePluginInternals
62
+ pluginInternals
64
63
  };
@@ -1,7 +1,5 @@
1
- import type { Plugin as VitePlugin } from 'vite';
2
1
  import type { AstroBuildPlugin } from '../plugin.js';
3
2
  import type { StaticBuildOptions } from '../types.js';
4
3
  export declare const RENDERERS_MODULE_ID = "@astro-renderers";
5
4
  export declare const RESOLVED_RENDERERS_MODULE_ID = "\0@astro-renderers";
6
- export declare function vitePluginRenderers(opts: StaticBuildOptions): VitePlugin;
7
5
  export declare function pluginRenderers(opts: StaticBuildOptions): AstroBuildPlugin;
@@ -50,6 +50,5 @@ function pluginRenderers(opts) {
50
50
  export {
51
51
  RENDERERS_MODULE_ID,
52
52
  RESOLVED_RENDERERS_MODULE_ID,
53
- pluginRenderers,
54
- vitePluginRenderers
53
+ pluginRenderers
55
54
  };
@@ -1,8 +1,3 @@
1
- import type { Plugin as VitePlugin } from 'vite';
2
1
  import type { BuildInternals } from '../internal.js';
3
2
  import type { AstroBuildPlugin } from '../plugin.js';
4
- /**
5
- * Inline scripts from Astro files directly into the HTML.
6
- */
7
- export declare function vitePluginScripts(internals: BuildInternals): VitePlugin;
8
3
  export declare function pluginScripts(internals: BuildInternals): AstroBuildPlugin;
@@ -38,6 +38,5 @@ function pluginScripts(internals) {
38
38
  };
39
39
  }
40
40
  export {
41
- pluginScripts,
42
- vitePluginScripts
41
+ pluginScripts
43
42
  };
@@ -1,6 +1,5 @@
1
1
  import type { BuildInternals } from '../internal.js';
2
2
  import type { AstroBuildPlugin } from '../plugin.js';
3
3
  import type { StaticBuildOptions } from '../types.js';
4
- export declare const SSR_VIRTUAL_MODULE_ID = "@astrojs-ssr-virtual-entry";
5
4
  export declare const RESOLVED_SSR_VIRTUAL_MODULE_ID: string;
6
5
  export declare function pluginSSR(options: StaticBuildOptions, internals: BuildInternals): AstroBuildPlugin;
@@ -177,6 +177,5 @@ if (_start in serverEntrypointModule) {
177
177
  }
178
178
  export {
179
179
  RESOLVED_SSR_VIRTUAL_MODULE_ID,
180
- SSR_VIRTUAL_MODULE_ID,
181
180
  pluginSSR
182
181
  };
@@ -9,7 +9,6 @@ type ExtendManualChunksHooks = {
9
9
  };
10
10
  export declare function extendManualChunks(outputOptions: OutputOptions, hooks: ExtendManualChunksHooks): void;
11
11
  export declare const ASTRO_PAGE_EXTENSION_POST_PATTERN = "@_@";
12
- export declare const ASTRO_PAGE_KEY_SEPARATOR = "&";
13
12
  /**
14
13
  * Generate a unique key to identify each page in the build process.
15
14
  * @param route Usually pageData.route.route
@@ -30,13 +29,5 @@ export declare function getVirtualModulePageName(virtualModulePrefix: string, pa
30
29
  * @param id Virtual module name
31
30
  */
32
31
  export declare function getPagesFromVirtualModulePageName(internals: BuildInternals, virtualModulePrefix: string, id: string): PageBuildData[];
33
- /**
34
- * From the VirtualModulePageName, get the component path.
35
- * Remember that the component can be use by multiple routes.
36
- * Inverse function of getVirtualModulePageName() above.
37
- * @param virtualModulePrefix The prefix at the beginning of the virtual module
38
- * @param id Virtual module name
39
- */
40
- export declare function getComponentFromVirtualModulePageName(virtualModulePrefix: string, id: string): string;
41
32
  export declare function shouldInlineAsset(assetContent: string, assetPath: string, assetsInlineLimit: NonNullable<BuildOptions['assetsInlineLimit']>): boolean;
42
33
  export {};
@@ -60,9 +60,7 @@ function shouldInlineAsset(assetContent, assetPath, assetsInlineLimit) {
60
60
  }
61
61
  export {
62
62
  ASTRO_PAGE_EXTENSION_POST_PATTERN,
63
- ASTRO_PAGE_KEY_SEPARATOR,
64
63
  extendManualChunks,
65
- getComponentFromVirtualModulePageName,
66
64
  getPagesFromVirtualModulePageName,
67
65
  getVirtualModulePageName,
68
66
  makePageDataKey,
@@ -5,7 +5,7 @@ import type { MiddlewareHandler } from '../../types/public/common.js';
5
5
  import type { RuntimeMode } from '../../types/public/config.js';
6
6
  import type { RouteData, SSRLoadedRenderer } from '../../types/public/internal.js';
7
7
  import type { Logger } from '../logger/core.js';
8
- export type ComponentPath = string;
8
+ type ComponentPath = string;
9
9
  export type ViteID = string;
10
10
  export type StylesheetAsset = {
11
11
  type: 'inline';
@@ -1,7 +1,6 @@
1
1
  import fs from 'node:fs';
2
2
  import type { AstroConfig, AstroInlineConfig, AstroUserConfig } from '../../types/public/config.js';
3
3
  export declare function resolveRoot(cwd?: string | URL): string;
4
- export declare const configPaths: readonly string[];
5
4
  interface ResolveConfigPathOptions {
6
5
  root: string;
7
6
  configFile?: string | false;
@@ -101,7 +101,6 @@ async function resolveConfig(inlineConfig, command, fsMod = fs) {
101
101
  return { userConfig: mergedConfig, astroConfig };
102
102
  }
103
103
  export {
104
- configPaths,
105
104
  resolveConfig,
106
105
  resolveConfigPath,
107
106
  resolveRoot
@@ -1,6 +1,5 @@
1
- export { configPaths, resolveConfig, resolveConfigPath, resolveRoot, } from './config.js';
1
+ export { resolveConfig, resolveConfigPath, resolveRoot, } from './config.js';
2
2
  export { createNodeLogger } from './logging.js';
3
3
  export { mergeConfig } from './merge.js';
4
- export type { AstroConfigType } from './schemas/index.js';
5
4
  export { createSettings } from './settings.js';
6
5
  export { loadTSConfig, updateTSConfigForFramework } from './tsconfig.js';
@@ -1,5 +1,4 @@
1
1
  import {
2
- configPaths,
3
2
  resolveConfig,
4
3
  resolveConfigPath,
5
4
  resolveRoot
@@ -9,7 +8,6 @@ import { mergeConfig } from "./merge.js";
9
8
  import { createSettings } from "./settings.js";
10
9
  import { loadTSConfig, updateTSConfigForFramework } from "./tsconfig.js";
11
10
  export {
12
- configPaths,
13
11
  createNodeLogger,
14
12
  createSettings,
15
13
  loadTSConfig,
@@ -2,6 +2,7 @@ import type { OutgoingHttpHeaders } from 'node:http';
2
2
  import type { ShikiConfig, RehypePlugin as _RehypePlugin, RemarkPlugin as _RemarkPlugin, RemarkRehype as _RemarkRehype } from '@astrojs/markdown-remark';
3
3
  import { z } from 'zod';
4
4
  import type { ViteUserConfig } from '../../../types/public/config.js';
5
+ /** @lintignore */
5
6
  export interface ComplexifyUnionObj {
6
7
  }
7
8
  type ComplexifyWithUnion<T> = T & ComplexifyUnionObj;
@@ -11,6 +12,7 @@ type ShikiTheme = ComplexifyWithUnion<NonNullable<ShikiConfig['theme']>>;
11
12
  type ShikiTransformer = ComplexifyWithUnion<NonNullable<ShikiConfig['transformers']>[number]>;
12
13
  type RehypePlugin = ComplexifyWithUnion<_RehypePlugin>;
13
14
  type RemarkPlugin = ComplexifyWithUnion<_RemarkPlugin>;
15
+ /** @lintignore */
14
16
  export type RemarkRehype = ComplexifyWithOmit<_RemarkRehype>;
15
17
  export declare const ASTRO_CONFIG_DEFAULTS: {
16
18
  root: string;
@@ -258,7 +260,7 @@ export declare const AstroConfigSchema: z.ZodObject<{
258
260
  hostname?: string | undefined;
259
261
  pathname?: string | undefined;
260
262
  }[];
261
- experimentalLayout?: "fixed" | "none" | "responsive" | "full-width" | undefined;
263
+ experimentalLayout?: "none" | "fixed" | "responsive" | "full-width" | undefined;
262
264
  experimentalObjectFit?: string | undefined;
263
265
  experimentalObjectPosition?: string | undefined;
264
266
  experimentalBreakpoints?: number[] | undefined;
@@ -278,7 +280,7 @@ export declare const AstroConfigSchema: z.ZodObject<{
278
280
  hostname?: string | undefined;
279
281
  pathname?: string | undefined;
280
282
  }[] | undefined;
281
- experimentalLayout?: "fixed" | "none" | "responsive" | "full-width" | undefined;
283
+ experimentalLayout?: "none" | "fixed" | "responsive" | "full-width" | undefined;
282
284
  experimentalObjectFit?: string | undefined;
283
285
  experimentalObjectPosition?: string | undefined;
284
286
  experimentalBreakpoints?: number[] | undefined;
@@ -1104,7 +1106,7 @@ export declare const AstroConfigSchema: z.ZodObject<{
1104
1106
  hostname?: string | undefined;
1105
1107
  pathname?: string | undefined;
1106
1108
  }[];
1107
- experimentalLayout?: "fixed" | "none" | "responsive" | "full-width" | undefined;
1109
+ experimentalLayout?: "none" | "fixed" | "responsive" | "full-width" | undefined;
1108
1110
  experimentalObjectFit?: string | undefined;
1109
1111
  experimentalObjectPosition?: string | undefined;
1110
1112
  experimentalBreakpoints?: number[] | undefined;
@@ -1336,7 +1338,7 @@ export declare const AstroConfigSchema: z.ZodObject<{
1336
1338
  hostname?: string | undefined;
1337
1339
  pathname?: string | undefined;
1338
1340
  }[] | undefined;
1339
- experimentalLayout?: "fixed" | "none" | "responsive" | "full-width" | undefined;
1341
+ experimentalLayout?: "none" | "fixed" | "responsive" | "full-width" | undefined;
1340
1342
  experimentalObjectFit?: string | undefined;
1341
1343
  experimentalObjectPosition?: string | undefined;
1342
1344
  experimentalBreakpoints?: number[] | undefined;
@@ -185,7 +185,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
185
185
  hostname?: string | undefined;
186
186
  pathname?: string | undefined;
187
187
  }[];
188
- experimentalLayout?: "fixed" | "none" | "responsive" | "full-width" | undefined;
188
+ experimentalLayout?: "none" | "fixed" | "responsive" | "full-width" | undefined;
189
189
  experimentalObjectFit?: string | undefined;
190
190
  experimentalObjectPosition?: string | undefined;
191
191
  experimentalBreakpoints?: number[] | undefined;
@@ -205,7 +205,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
205
205
  hostname?: string | undefined;
206
206
  pathname?: string | undefined;
207
207
  }[] | undefined;
208
- experimentalLayout?: "fixed" | "none" | "responsive" | "full-width" | undefined;
208
+ experimentalLayout?: "none" | "fixed" | "responsive" | "full-width" | undefined;
209
209
  experimentalObjectFit?: string | undefined;
210
210
  experimentalObjectPosition?: string | undefined;
211
211
  experimentalBreakpoints?: number[] | undefined;
@@ -1109,7 +1109,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
1109
1109
  hostname?: string | undefined;
1110
1110
  pathname?: string | undefined;
1111
1111
  }[];
1112
- experimentalLayout?: "fixed" | "none" | "responsive" | "full-width" | undefined;
1112
+ experimentalLayout?: "none" | "fixed" | "responsive" | "full-width" | undefined;
1113
1113
  experimentalObjectFit?: string | undefined;
1114
1114
  experimentalObjectPosition?: string | undefined;
1115
1115
  experimentalBreakpoints?: number[] | undefined;
@@ -1341,7 +1341,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
1341
1341
  hostname?: string | undefined;
1342
1342
  pathname?: string | undefined;
1343
1343
  }[] | undefined;
1344
- experimentalLayout?: "fixed" | "none" | "responsive" | "full-width" | undefined;
1344
+ experimentalLayout?: "none" | "fixed" | "responsive" | "full-width" | undefined;
1345
1345
  experimentalObjectFit?: string | undefined;
1346
1346
  experimentalObjectPosition?: string | undefined;
1347
1347
  experimentalBreakpoints?: number[] | undefined;
@@ -1565,7 +1565,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
1565
1565
  hostname?: string | undefined;
1566
1566
  pathname?: string | undefined;
1567
1567
  }[];
1568
- experimentalLayout?: "fixed" | "none" | "responsive" | "full-width" | undefined;
1568
+ experimentalLayout?: "none" | "fixed" | "responsive" | "full-width" | undefined;
1569
1569
  experimentalObjectFit?: string | undefined;
1570
1570
  experimentalObjectPosition?: string | undefined;
1571
1571
  experimentalBreakpoints?: number[] | undefined;
@@ -1797,7 +1797,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
1797
1797
  hostname?: string | undefined;
1798
1798
  pathname?: string | undefined;
1799
1799
  }[] | undefined;
1800
- experimentalLayout?: "fixed" | "none" | "responsive" | "full-width" | undefined;
1800
+ experimentalLayout?: "none" | "fixed" | "responsive" | "full-width" | undefined;
1801
1801
  experimentalObjectFit?: string | undefined;
1802
1802
  experimentalObjectPosition?: string | undefined;
1803
1803
  experimentalBreakpoints?: number[] | undefined;
@@ -1,8 +1,3 @@
1
- export interface Stat {
2
- elapsedTime: number;
3
- heapUsedChange: number;
4
- heapUsedTotal: number;
5
- }
6
1
  /**
7
2
  * Timer to track certain operations' performance. Used by Astro's scripts only.
8
3
  * Set `process.env.ASTRO_TIMER_PATH` truthy to enable.
@@ -13,7 +13,7 @@ export declare function loadTSConfig(root: string | undefined, findUp?: boolean)
13
13
  rawConfig: TSConfig;
14
14
  }>>;
15
15
  export declare function updateTSConfigForFramework(target: TSConfig, framework: frameworkWithTSSettings): TSConfig;
16
- export type StripEnums<T extends Record<string, any>> = {
16
+ type StripEnums<T extends Record<string, any>> = {
17
17
  [K in keyof T]: T[K] extends boolean ? T[K] : T[K] extends string ? T[K] : T[K] extends object ? T[K] : T[K] extends Array<any> ? T[K] : T[K] extends undefined ? undefined : any;
18
18
  };
19
19
  export interface TSConfig {
@@ -38,10 +38,6 @@ export declare const ROUTE_TYPE_HEADER = "X-Astro-Route-Type";
38
38
  * The value of the `component` field of the default 404 page, which is used when there is no user-provided 404.astro page.
39
39
  */
40
40
  export declare const DEFAULT_404_COMPONENT = "astro-default-404.astro";
41
- /**
42
- * The value of the `component` field of the default 500 page, which is used when there is no user-provided 404.astro page.
43
- */
44
- export declare const DEFAULT_500_COMPONENT = "astro-default-500.astro";
45
41
  /**
46
42
  * A response with one of these status codes will create a redirect response.
47
43
  */
@@ -1,11 +1,10 @@
1
- const ASTRO_VERSION = "5.7.4";
1
+ const ASTRO_VERSION = "5.7.5";
2
2
  const REROUTE_DIRECTIVE_HEADER = "X-Astro-Reroute";
3
3
  const REWRITE_DIRECTIVE_HEADER_KEY = "X-Astro-Rewrite";
4
4
  const REWRITE_DIRECTIVE_HEADER_VALUE = "yes";
5
5
  const NOOP_MIDDLEWARE_HEADER = "X-Astro-Noop";
6
6
  const ROUTE_TYPE_HEADER = "X-Astro-Route-Type";
7
7
  const DEFAULT_404_COMPONENT = "astro-default-404.astro";
8
- const DEFAULT_500_COMPONENT = "astro-default-500.astro";
9
8
  const REDIRECT_STATUS_CODES = [301, 302, 303, 307, 308, 300, 304];
10
9
  const REROUTABLE_STATUS_CODES = [404, 500];
11
10
  const clientAddressSymbol = Symbol.for("astro.clientAddress");
@@ -24,7 +23,6 @@ const MIDDLEWARE_PATH_SEGMENT_NAME = "middleware";
24
23
  export {
25
24
  ASTRO_VERSION,
26
25
  DEFAULT_404_COMPONENT,
27
- DEFAULT_500_COMPONENT,
28
26
  MIDDLEWARE_PATH_SEGMENT_NAME,
29
27
  NOOP_MIDDLEWARE_HEADER,
30
28
  REDIRECT_STATUS_CODES,
@@ -1,3 +1,3 @@
1
1
  export { AstroCookies } from './cookies.js';
2
- export { attachCookiesToResponse, getSetCookiesFromResponse, responseHasCookies, } from './response.js';
2
+ export { attachCookiesToResponse, getSetCookiesFromResponse, } from './response.js';
3
3
  export type { AstroCookieSetOptions, AstroCookieGetOptions } from './cookies.js';
@@ -1,12 +1,10 @@
1
1
  import { AstroCookies } from "./cookies.js";
2
2
  import {
3
3
  attachCookiesToResponse,
4
- getSetCookiesFromResponse,
5
- responseHasCookies
4
+ getSetCookiesFromResponse
6
5
  } from "./response.js";
7
6
  export {
8
7
  AstroCookies,
9
8
  attachCookiesToResponse,
10
- getSetCookiesFromResponse,
11
- responseHasCookies
9
+ getSetCookiesFromResponse
12
10
  };
@@ -1,5 +1,4 @@
1
1
  import { AstroCookies } from './cookies.js';
2
2
  export declare function attachCookiesToResponse(response: Response, cookies: AstroCookies): void;
3
- export declare function responseHasCookies(response: Response): boolean;
4
3
  export declare function getCookiesFromResponse(response: Response): AstroCookies | undefined;
5
4
  export declare function getSetCookiesFromResponse(response: Response): Generator<string, string[]>;
@@ -3,9 +3,6 @@ const astroCookiesSymbol = Symbol.for("astro.cookies");
3
3
  function attachCookiesToResponse(response, cookies) {
4
4
  Reflect.set(response, astroCookiesSymbol, cookies);
5
5
  }
6
- function responseHasCookies(response) {
7
- return Reflect.has(response, astroCookiesSymbol);
8
- }
9
6
  function getCookiesFromResponse(response) {
10
7
  let cookies = Reflect.get(response, astroCookiesSymbol);
11
8
  if (cookies != null) {
@@ -27,6 +24,5 @@ function* getSetCookiesFromResponse(response) {
27
24
  export {
28
25
  attachCookiesToResponse,
29
26
  getCookiesFromResponse,
30
- getSetCookiesFromResponse,
31
- responseHasCookies
27
+ getSetCookiesFromResponse
32
28
  };
@@ -15,7 +15,7 @@ export interface Container {
15
15
  handle: (req: http.IncomingMessage, res: http.ServerResponse) => void;
16
16
  close: () => Promise<void>;
17
17
  }
18
- export interface CreateContainerParams {
18
+ interface CreateContainerParams {
19
19
  logger: Logger;
20
20
  settings: AstroSettings;
21
21
  inlineConfig?: AstroInlineConfig;
@@ -24,3 +24,4 @@ export interface CreateContainerParams {
24
24
  }
25
25
  export declare function createContainer({ isRestart, logger, inlineConfig, settings, fs, }: CreateContainerParams): Promise<Container>;
26
26
  export declare function startContainer({ settings, viteServer, logger, }: Container): Promise<AddressInfo>;
27
+ export {};
@@ -22,7 +22,7 @@ async function dev(inlineConfig) {
22
22
  await telemetry.record([]);
23
23
  const restart = await createContainerWithAutomaticRestart({ inlineConfig, fs });
24
24
  const logger = restart.container.logger;
25
- const currentVersion = "5.7.4";
25
+ const currentVersion = "5.7.5";
26
26
  const isPrerelease = currentVersion.includes("-");
27
27
  if (!isPrerelease) {
28
28
  try {
@@ -1,3 +1,3 @@
1
- export { createContainer, startContainer } from './container.js';
1
+ export { startContainer } from './container.js';
2
2
  export { default } from './dev.js';
3
3
  export { createContainerWithAutomaticRestart } from './restart.js';
@@ -1,8 +1,7 @@
1
- import { createContainer, startContainer } from "./container.js";
1
+ import { startContainer } from "./container.js";
2
2
  import { default as default2 } from "./dev.js";
3
3
  import { createContainerWithAutomaticRestart } from "./restart.js";
4
4
  export {
5
- createContainer,
6
5
  createContainerWithAutomaticRestart,
7
6
  default2 as default,
8
7
  startContainer
@@ -1,7 +1,7 @@
1
1
  import type nodeFs from 'node:fs';
2
2
  import type { AstroInlineConfig } from '../../types/public/config.js';
3
3
  import type { Container } from './container.js';
4
- export interface CreateContainerWithAutomaticRestart {
4
+ interface CreateContainerWithAutomaticRestart {
5
5
  inlineConfig?: AstroInlineConfig;
6
6
  fs: typeof nodeFs;
7
7
  }
@@ -2,10 +2,6 @@
2
2
  * Creates a CryptoKey object that can be used to encrypt any string.
3
3
  */
4
4
  export declare function createKey(): Promise<CryptoKey>;
5
- /**
6
- * Get the encoded value of the ASTRO_KEY env var.
7
- */
8
- export declare function getEncodedEnvironmentKey(): string;
9
5
  /**
10
6
  * See if the environment variable key ASTRO_KEY is set.
11
7
  */
@@ -14,10 +10,6 @@ export declare function hasEnvironmentKey(): boolean;
14
10
  * Get the environment variable key and decode it into a CryptoKey.
15
11
  */
16
12
  export declare function getEnvironmentKey(): Promise<CryptoKey>;
17
- /**
18
- * Takes a key that has been serialized to an array of bytes and returns a CryptoKey
19
- */
20
- export declare function importKey(bytes: Uint8Array): Promise<CryptoKey>;
21
13
  /**
22
14
  * Encodes a CryptoKey to base64 string, so that it can be embedded in JSON / JavaScript
23
15
  */
@@ -27,10 +27,6 @@ async function getEnvironmentKey() {
27
27
  const encodedKey = getEncodedEnvironmentKey();
28
28
  return decodeKey(encodedKey);
29
29
  }
30
- async function importKey(bytes) {
31
- const key = await crypto.subtle.importKey("raw", bytes, ALGORITHM, true, ["encrypt", "decrypt"]);
32
- return key;
33
- }
34
30
  async function encodeKey(key) {
35
31
  const exported = await crypto.subtle.exportKey("raw", key);
36
32
  const encodedKey = encodeBase64(new Uint8Array(exported));
@@ -76,8 +72,6 @@ export {
76
72
  decryptString,
77
73
  encodeKey,
78
74
  encryptString,
79
- getEncodedEnvironmentKey,
80
75
  getEnvironmentKey,
81
- hasEnvironmentKey,
82
- importKey
76
+ hasEnvironmentKey
83
77
  };
@@ -1,6 +1,5 @@
1
1
  export * as AstroErrorData from './errors-data.js';
2
2
  export { AggregateError, AstroError, AstroUserError, CSSError, CompilerError, MarkdownError, isAstroError, } from './errors.js';
3
- export type { ErrorLocation, ErrorWithMetadata } from './errors.js';
4
- export { codeFrame } from './printer.js';
3
+ export type { ErrorWithMetadata } from './errors.js';
5
4
  export { createSafeError, positionAt } from './utils.js';
6
5
  export { errorMap } from './zod-error-map.js';
@@ -8,7 +8,6 @@ import {
8
8
  MarkdownError,
9
9
  isAstroError
10
10
  } from "./errors.js";
11
- import { codeFrame } from "./printer.js";
12
11
  import { createSafeError, positionAt } from "./utils.js";
13
12
  import { errorMap } from "./zod-error-map.js";
14
13
  export {
@@ -19,7 +18,6 @@ export {
19
18
  CSSError,
20
19
  CompilerError,
21
20
  MarkdownError,
22
- codeFrame,
23
21
  createSafeError,
24
22
  errorMap,
25
23
  isAstroError,
@@ -7,11 +7,12 @@ export type LoggerLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent';
7
7
  * rather than specific to a single command, function, use, etc. The label will be
8
8
  * shown in the log message to the user, so it should be relevant.
9
9
  */
10
- export type LoggerLabel = 'add' | 'build' | 'check' | 'config' | 'content' | 'crypto' | 'deprecated' | 'markdown' | 'router' | 'types' | 'vite' | 'watch' | 'middleware' | 'preferences' | 'redirects' | 'sync' | 'session' | 'toolbar' | 'assets' | 'env' | 'update' | 'adapter' | 'islands' | 'SKIP_FORMAT';
10
+ type LoggerLabel = 'add' | 'build' | 'check' | 'config' | 'content' | 'crypto' | 'deprecated' | 'markdown' | 'router' | 'types' | 'vite' | 'watch' | 'middleware' | 'preferences' | 'redirects' | 'sync' | 'session' | 'toolbar' | 'assets' | 'env' | 'update' | 'adapter' | 'islands' | 'SKIP_FORMAT';
11
11
  export interface LogOptions {
12
12
  dest: LogWritable<LogMessage>;
13
13
  level: LoggerLevel;
14
14
  }
15
+ /** @lintignore */
15
16
  export declare const dateTimeFormat: Intl.DateTimeFormat;
16
17
  export interface LogMessage {
17
18
  label: string | null;
@@ -20,15 +21,7 @@ export interface LogMessage {
20
21
  newLine: boolean;
21
22
  }
22
23
  export declare const levels: Record<LoggerLevel, number>;
23
- /** Full logging API */
24
- export declare function log(opts: LogOptions, level: LoggerLevel, label: string | null, message: string, newLine?: boolean): void;
25
24
  export declare function isLogLevelEnabled(configuredLogLevel: LoggerLevel, level: LoggerLevel): boolean;
26
- /** Emit a user-facing message. Useful for UI and other console messages. */
27
- export declare function info(opts: LogOptions, label: string | null, message: string, newLine?: boolean): void;
28
- /** Emit a warning message. Useful for high-priority messages that aren't necessarily errors. */
29
- export declare function warn(opts: LogOptions, label: string | null, message: string, newLine?: boolean): void;
30
- /** Emit a error message, Useful when Astro can't recover from some error. */
31
- export declare function error(opts: LogOptions, label: string | null, message: string, newLine?: boolean): void;
32
25
  export declare function debug(...args: any[]): void;
33
26
  /**
34
27
  * Get the prefix for a log message.
@@ -61,3 +54,4 @@ export declare class AstroIntegrationLogger {
61
54
  error(message: string): void;
62
55
  debug(message: string): void;
63
56
  }
57
+ export {};
@@ -126,12 +126,8 @@ export {
126
126
  Logger,
127
127
  dateTimeFormat,
128
128
  debug,
129
- error,
130
129
  getEventPrefix,
131
- info,
132
130
  isLogLevelEnabled,
133
131
  levels,
134
- log,
135
- timerMessage,
136
- warn
132
+ timerMessage
137
133
  };
@@ -43,7 +43,6 @@ export declare function prerelease({ currentVersion }: {
43
43
  currentVersion: string;
44
44
  }): string;
45
45
  export declare function success(message: string, tip?: string): string;
46
- export declare function failure(message: string, tip?: string): string;
47
46
  export declare function actionRequired(message: string): string;
48
47
  export declare function cancelled(message: string, tip?: string): string;
49
48
  export declare function formatConfigErrorMessage(err: ZodError): string;
@@ -1,7 +1,6 @@
1
1
  import {
2
2
  bgCyan,
3
3
  bgGreen,
4
- bgRed,
5
4
  bgWhite,
6
5
  bgYellow,
7
6
  black,
@@ -38,7 +37,7 @@ function serverStart({
38
37
  host,
39
38
  base
40
39
  }) {
41
- const version = "5.7.4";
40
+ const version = "5.7.5";
42
41
  const localPrefix = `${dim("\u2503")} Local `;
43
42
  const networkPrefix = `${dim("\u2503")} Network `;
44
43
  const emptyPrefix = " ".repeat(11);
@@ -156,13 +155,6 @@ function success(message, tip) {
156
155
  \u25B6 ${tip}` : void 0;
157
156
  return ["", `${badge} ${headline}`, footer].filter((v) => v !== void 0).map((msg) => ` ${msg}`).join("\n");
158
157
  }
159
- function failure(message, tip) {
160
- const badge = bgRed(black(` error `));
161
- const headline = red(message);
162
- const footer = tip ? `
163
- \u25B6 ${tip}` : void 0;
164
- return ["", `${badge} ${headline}`, footer].filter((v) => v !== void 0).map((msg) => ` ${msg}`).join("\n");
165
- }
166
158
  function actionRequired(message) {
167
159
  const badge = bgYellow(black(` action required `));
168
160
  const headline = yellow(message);
@@ -282,7 +274,7 @@ function printHelp({
282
274
  message.push(
283
275
  linebreak(),
284
276
  ` ${bgGreen(black(` ${commandName} `))} ${green(
285
- `v${"5.7.4"}`
277
+ `v${"5.7.5"}`
286
278
  )} ${headline}`
287
279
  );
288
280
  }
@@ -308,7 +300,6 @@ function printHelp({
308
300
  export {
309
301
  actionRequired,
310
302
  cancelled,
311
- failure,
312
303
  formatConfigErrorMessage,
313
304
  formatErrorMessage,
314
305
  fsStrictWarning,