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.
- package/dist/assets/fonts/config.d.ts +0 -16
- package/dist/assets/fonts/config.js +1 -2
- package/dist/assets/fonts/providers/index.d.ts +1 -1
- package/dist/assets/fonts/providers/index.js +3 -2
- package/dist/assets/fonts/utils.d.ts +0 -1
- package/dist/assets/fonts/utils.js +0 -1
- package/dist/assets/fonts/vite-plugin-fonts.js +11 -8
- package/dist/assets/services/service.d.ts +1 -1
- package/dist/assets/utils/etag.d.ts +0 -11
- package/dist/assets/utils/etag.js +1 -2
- package/dist/assets/utils/vendor/image-size/lookup.d.ts +0 -2
- package/dist/assets/utils/vendor/image-size/lookup.js +0 -10
- package/dist/cli/add/index.d.ts +0 -9
- package/dist/cli/add/index.js +1 -2
- package/dist/cli/info/index.d.ts +0 -1
- package/dist/cli/info/index.js +0 -1
- package/dist/cli/preferences/index.d.ts +0 -2
- package/dist/container/index.js +1 -6
- package/dist/content/content-layer.d.ts +2 -7
- package/dist/content/content-layer.js +4 -6
- package/dist/content/index.d.ts +1 -2
- package/dist/content/index.js +1 -5
- package/dist/content/loaders/file.d.ts +2 -1
- package/dist/content/loaders/glob.d.ts +3 -2
- package/dist/content/utils.d.ts +1 -12
- package/dist/content/utils.js +0 -13
- package/dist/content/vite-plugin-content-virtual-mod.d.ts +0 -16
- package/dist/content/vite-plugin-content-virtual-mod.js +1 -3
- package/dist/core/app/index.js +3 -4
- package/dist/core/app/pipeline.d.ts +2 -3
- package/dist/core/app/pipeline.js +1 -3
- package/dist/core/app/types.d.ts +3 -2
- package/dist/core/build/consts.d.ts +0 -1
- package/dist/core/build/consts.js +1 -3
- package/dist/core/build/index.d.ts +2 -1
- package/dist/core/build/page-data.d.ts +3 -2
- package/dist/core/build/plugin.d.ts +1 -1
- package/dist/core/build/plugins/plugin-analyzer.d.ts +0 -2
- package/dist/core/build/plugins/plugin-analyzer.js +1 -2
- package/dist/core/build/plugins/plugin-chunks.d.ts +0 -2
- package/dist/core/build/plugins/plugin-chunks.js +1 -2
- package/dist/core/build/plugins/plugin-component-entry.d.ts +0 -8
- package/dist/core/build/plugins/plugin-component-entry.js +1 -3
- package/dist/core/build/plugins/plugin-internals.d.ts +0 -2
- package/dist/core/build/plugins/plugin-internals.js +1 -2
- package/dist/core/build/plugins/plugin-renderers.d.ts +0 -2
- package/dist/core/build/plugins/plugin-renderers.js +1 -2
- package/dist/core/build/plugins/plugin-scripts.d.ts +0 -5
- package/dist/core/build/plugins/plugin-scripts.js +1 -2
- package/dist/core/build/plugins/plugin-ssr.d.ts +0 -1
- package/dist/core/build/plugins/plugin-ssr.js +0 -1
- package/dist/core/build/plugins/util.d.ts +0 -9
- package/dist/core/build/plugins/util.js +0 -2
- package/dist/core/build/types.d.ts +1 -1
- package/dist/core/config/config.d.ts +0 -1
- package/dist/core/config/config.js +0 -1
- package/dist/core/config/index.d.ts +1 -2
- package/dist/core/config/index.js +0 -2
- package/dist/core/config/schemas/base.d.ts +6 -4
- package/dist/core/config/schemas/relative.d.ts +6 -6
- package/dist/core/config/timer.d.ts +0 -5
- package/dist/core/config/tsconfig.d.ts +1 -1
- package/dist/core/constants.d.ts +0 -4
- package/dist/core/constants.js +1 -3
- package/dist/core/cookies/index.d.ts +1 -1
- package/dist/core/cookies/index.js +2 -4
- package/dist/core/cookies/response.d.ts +0 -1
- package/dist/core/cookies/response.js +1 -5
- package/dist/core/dev/container.d.ts +2 -1
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/dev/index.d.ts +1 -1
- package/dist/core/dev/index.js +1 -2
- package/dist/core/dev/restart.d.ts +1 -1
- package/dist/core/encryption.d.ts +0 -8
- package/dist/core/encryption.js +1 -7
- package/dist/core/errors/index.d.ts +1 -2
- package/dist/core/errors/index.js +0 -2
- package/dist/core/logger/core.d.ts +3 -9
- package/dist/core/logger/core.js +1 -5
- package/dist/core/messages.d.ts +0 -1
- package/dist/core/messages.js +2 -11
- package/dist/core/middleware/sequence.js +3 -0
- package/dist/core/preview/static-preview-server.d.ts +2 -1
- package/dist/core/redirects/index.d.ts +0 -1
- package/dist/core/redirects/index.js +0 -2
- package/dist/core/render/index.d.ts +0 -17
- package/dist/core/render/ssr-element.d.ts +0 -2
- package/dist/core/render/ssr-element.js +0 -2
- package/dist/core/render-context.js +4 -0
- package/dist/core/request.d.ts +1 -1
- package/dist/core/routing/3xx.d.ts +2 -1
- package/dist/core/routing/astro-designed-error-pages.d.ts +0 -1
- package/dist/core/routing/astro-designed-error-pages.js +1 -16
- package/dist/core/routing/index.d.ts +2 -3
- package/dist/core/routing/index.js +3 -8
- package/dist/core/routing/manifest/create.d.ts +2 -3
- package/dist/core/routing/manifest/create.js +0 -1
- package/dist/core/routing/request.d.ts +0 -1
- package/dist/core/routing/request.js +1 -2
- package/dist/core/routing/rewrite.d.ts +3 -2
- package/dist/core/server-islands/vite-plugin-server-islands.d.ts +0 -1
- package/dist/core/server-islands/vite-plugin-server-islands.js +0 -1
- package/dist/core/sync/index.d.ts +2 -1
- package/dist/core/util.d.ts +0 -1
- package/dist/core/util.js +0 -1
- package/dist/events/session.d.ts +1 -1
- package/dist/integrations/features-validation.d.ts +1 -3
- package/dist/integrations/features-validation.js +0 -2
- package/dist/preferences/index.d.ts +4 -4
- package/dist/type-utils.d.ts +0 -4
- package/dist/types/public/config.d.ts +19 -0
- package/dist/types/typed-emitter.d.ts +2 -1
- package/dist/vite-plugin-astro/hmr.d.ts +2 -1
- package/dist/vite-plugin-astro/query.d.ts +3 -2
- package/dist/vite-plugin-astro/types.d.ts +2 -1
- package/dist/vite-plugin-astro-server/controller.d.ts +2 -2
- package/dist/vite-plugin-astro-server/plugin.d.ts +2 -1
- package/dist/vite-plugin-astro-server/response.d.ts +0 -1
- package/dist/vite-plugin-astro-server/response.js +0 -12
- package/dist/vite-plugin-astro-server/route.d.ts +1 -1
- package/dist/vite-plugin-astro-server/server-state.d.ts +3 -3
- package/dist/vite-plugin-astro-server/server-state.js +0 -4
- package/dist/vite-plugin-load-fallback/index.d.ts +1 -1
- package/dist/vite-plugin-scanner/index.d.ts +2 -1
- package/package.json +5 -11
- package/templates/env.mjs +1 -0
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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
|
-
|
|
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;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export {
|
|
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?: "
|
|
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?: "
|
|
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?: "
|
|
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?: "
|
|
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?: "
|
|
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?: "
|
|
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?: "
|
|
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?: "
|
|
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?: "
|
|
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?: "
|
|
1800
|
+
experimentalLayout?: "none" | "fixed" | "responsive" | "full-width" | undefined;
|
|
1801
1801
|
experimentalObjectFit?: string | undefined;
|
|
1802
1802
|
experimentalObjectPosition?: string | undefined;
|
|
1803
1803
|
experimentalBreakpoints?: number[] | undefined;
|
|
@@ -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
|
-
|
|
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 {
|
package/dist/core/constants.d.ts
CHANGED
|
@@ -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
|
*/
|
package/dist/core/constants.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
const ASTRO_VERSION = "5.7.
|
|
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,
|
|
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
|
-
|
|
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 {};
|
package/dist/core/dev/dev.js
CHANGED
|
@@ -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.
|
|
25
|
+
const currentVersion = "5.7.5";
|
|
26
26
|
const isPrerelease = currentVersion.includes("-");
|
|
27
27
|
if (!isPrerelease) {
|
|
28
28
|
try {
|
package/dist/core/dev/index.d.ts
CHANGED
package/dist/core/dev/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
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
|
*/
|
package/dist/core/encryption.js
CHANGED
|
@@ -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 {
|
|
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
|
-
|
|
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 {};
|
package/dist/core/logger/core.js
CHANGED
package/dist/core/messages.d.ts
CHANGED
|
@@ -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;
|
package/dist/core/messages.js
CHANGED
|
@@ -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.
|
|
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.
|
|
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,
|