astro 6.1.4 → 6.1.6
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/actions/integration.js +1 -1
- package/dist/assets/build/generate.d.ts +2 -2
- package/dist/assets/consts.d.ts +2 -0
- package/dist/assets/consts.js +4 -0
- package/dist/assets/fonts/core/compute-font-families-assets.d.ts +2 -2
- package/dist/assets/fonts/core/get-or-create-font-family-assets.d.ts +2 -2
- package/dist/assets/fonts/vite-plugin-fonts.d.ts +2 -2
- package/dist/assets/vite-plugin-assets.d.ts +2 -2
- package/dist/assets/vite-plugin-assets.js +33 -3
- package/dist/cli/add/index.js +1 -11
- package/dist/cli/create-key/core/create-key.d.ts +2 -2
- package/dist/cli/docs/core/open-docs.d.ts +2 -2
- package/dist/cli/flags.d.ts +2 -2
- package/dist/cli/flags.js +1 -1
- package/dist/cli/info/core/info.d.ts +2 -2
- package/dist/cli/info/infra/tinyclip-clipboard.d.ts +2 -2
- package/dist/cli/infra/build-time-astro-version-provider.js +1 -1
- package/dist/cli/infra/logger-help-display.d.ts +2 -2
- package/dist/cli/install-package.d.ts +2 -2
- package/dist/cli/preferences/index.js +1 -1
- package/dist/container/index.js +3 -3
- package/dist/content/content-layer.d.ts +2 -2
- package/dist/content/content-layer.js +3 -3
- package/dist/content/instance.d.ts +2 -2
- package/dist/content/runtime.js +1 -1
- package/dist/content/server-listeners.d.ts +2 -2
- package/dist/content/types-generator.d.ts +2 -2
- package/dist/content/utils.d.ts +2 -2
- package/dist/content/vite-plugin-content-imports.d.ts +2 -2
- package/dist/core/app/base.d.ts +2 -2
- package/dist/core/app/base.js +3 -3
- package/dist/core/app/dev/app.d.ts +4 -4
- package/dist/core/app/logging.d.ts +2 -2
- package/dist/core/app/logging.js +3 -3
- package/dist/core/app/types.d.ts +2 -2
- package/dist/core/base-pipeline.d.ts +3 -3
- package/dist/core/build/generate.d.ts +2 -2
- package/dist/core/build/index.d.ts +2 -2
- package/dist/core/build/page-data.d.ts +2 -2
- package/dist/core/build/types.d.ts +2 -2
- package/dist/core/cache/runtime/noop.d.ts +2 -2
- package/dist/core/constants.js +1 -1
- package/dist/core/create-vite.d.ts +2 -2
- package/dist/core/dev/adapter-validation.d.ts +3 -3
- package/dist/core/dev/container.d.ts +3 -3
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/logger/console.d.ts +2 -2
- package/dist/core/logger/console.js +4 -1
- package/dist/core/logger/core.d.ts +48 -21
- package/dist/core/logger/core.js +8 -4
- package/dist/core/logger/node.d.ts +4 -4
- package/dist/core/logger/node.js +21 -9
- package/dist/core/logger/vite.d.ts +1 -1
- package/dist/core/messages/runtime.d.ts +2 -2
- package/dist/core/messages/runtime.js +1 -1
- package/dist/core/preview/static-preview-server.d.ts +2 -2
- package/dist/core/render/params-and-props.d.ts +2 -2
- package/dist/core/render/route-cache.d.ts +3 -3
- package/dist/core/render/slots.d.ts +2 -2
- package/dist/core/request.d.ts +2 -2
- package/dist/core/routing/create-manifest.d.ts +3 -3
- package/dist/core/routing/prerender.d.ts +2 -2
- package/dist/core/routing/rewrite.d.ts +2 -2
- package/dist/core/sync/index.d.ts +3 -3
- package/dist/env/validators.d.ts +1 -1
- package/dist/integrations/features-validation.d.ts +2 -2
- package/dist/integrations/hooks.d.ts +13 -13
- package/dist/preferences/dlv.d.ts +1 -0
- package/dist/preferences/dlv.js +9 -0
- package/dist/preferences/index.js +1 -1
- package/dist/preferences/store.js +1 -1
- package/dist/runtime/server/endpoint.d.ts +2 -2
- package/dist/runtime/server/escape.d.ts +8 -0
- package/dist/runtime/server/escape.js +4 -0
- package/dist/runtime/server/render/component.js +6 -6
- package/dist/runtime/server/render/server-islands.js +5 -12
- package/dist/runtime/server/render/util.js +2 -5
- package/dist/transitions/swap-functions.js +1 -1
- package/dist/types/astro.d.ts +3 -3
- package/dist/types/public/config.d.ts +2 -2
- package/dist/vite-plugin-app/app.d.ts +5 -5
- package/dist/vite-plugin-app/createAstroServerApp.d.ts +2 -2
- package/dist/vite-plugin-app/createAstroServerApp.js +3 -3
- package/dist/vite-plugin-astro/compile.d.ts +2 -2
- package/dist/vite-plugin-astro/hmr.d.ts +2 -2
- package/dist/vite-plugin-astro/index.d.ts +2 -2
- package/dist/vite-plugin-astro-server/base.d.ts +2 -2
- package/dist/vite-plugin-astro-server/error.d.ts +2 -2
- package/dist/vite-plugin-astro-server/plugin.d.ts +2 -2
- package/dist/vite-plugin-astro-server/sec-fetch.d.ts +2 -2
- package/dist/vite-plugin-hmr-reload/index.js +17 -0
- package/dist/vite-plugin-integrations-container/index.d.ts +2 -2
- package/dist/vite-plugin-markdown/index.d.ts +2 -2
- package/dist/vite-plugin-routes/index.d.ts +2 -2
- package/package.json +3 -5
|
@@ -30,7 +30,7 @@ function astroIntegrationActionsRouteHandler({
|
|
|
30
30
|
});
|
|
31
31
|
},
|
|
32
32
|
"astro:routes:resolved": ({ routes }) => {
|
|
33
|
-
if (!hasNonPrerenderedRoute(routes)) {
|
|
33
|
+
if (!settings.config.adapter && !hasNonPrerenderedRoute(routes)) {
|
|
34
34
|
const error = new AstroError(ActionsWithoutServerOutputError);
|
|
35
35
|
error.stack = void 0;
|
|
36
36
|
throw error;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { StaticBuildOptions } from '../../core/build/types.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLogger } from '../../core/logger/core.js';
|
|
3
3
|
import type { MapValue } from '../../type-utils.js';
|
|
4
4
|
import type { AstroConfig } from '../../types/public/config.js';
|
|
5
5
|
import type { AssetsGlobalStaticImagesList } from '../types.js';
|
|
6
6
|
type AssetEnv = {
|
|
7
|
-
logger:
|
|
7
|
+
logger: AstroLogger;
|
|
8
8
|
isSSR: boolean;
|
|
9
9
|
count: {
|
|
10
10
|
total: number;
|
package/dist/assets/consts.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export declare const VIRTUAL_MODULE_ID = "astro:assets";
|
|
2
2
|
export declare const RESOLVED_VIRTUAL_MODULE_ID: string;
|
|
3
3
|
export declare const VIRTUAL_SERVICE_ID = "virtual:image-service";
|
|
4
|
+
export declare const VIRTUAL_GET_IMAGE_ID = "virtual:astro:get-image";
|
|
5
|
+
export declare const RESOLVED_VIRTUAL_GET_IMAGE_ID: string;
|
|
4
6
|
export declare const VIRTUAL_IMAGE_STYLES_ID = "virtual:astro:image-styles.css";
|
|
5
7
|
export declare const RESOLVED_VIRTUAL_IMAGE_STYLES_ID: string;
|
|
6
8
|
export declare const VALID_INPUT_FORMATS: readonly ["jpeg", "jpg", "png", "tiff", "webp", "gif", "svg", "avif"];
|
package/dist/assets/consts.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
const VIRTUAL_MODULE_ID = "astro:assets";
|
|
2
2
|
const RESOLVED_VIRTUAL_MODULE_ID = "\0" + VIRTUAL_MODULE_ID;
|
|
3
3
|
const VIRTUAL_SERVICE_ID = "virtual:image-service";
|
|
4
|
+
const VIRTUAL_GET_IMAGE_ID = "virtual:astro:get-image";
|
|
5
|
+
const RESOLVED_VIRTUAL_GET_IMAGE_ID = "\0" + VIRTUAL_GET_IMAGE_ID;
|
|
4
6
|
const VIRTUAL_IMAGE_STYLES_ID = "virtual:astro:image-styles.css";
|
|
5
7
|
const RESOLVED_VIRTUAL_IMAGE_STYLES_ID = "\0" + VIRTUAL_IMAGE_STYLES_ID;
|
|
6
8
|
const VALID_INPUT_FORMATS = [
|
|
@@ -38,11 +40,13 @@ const DEFAULT_HASH_PROPS = [
|
|
|
38
40
|
export {
|
|
39
41
|
DEFAULT_HASH_PROPS,
|
|
40
42
|
DEFAULT_OUTPUT_FORMAT,
|
|
43
|
+
RESOLVED_VIRTUAL_GET_IMAGE_ID,
|
|
41
44
|
RESOLVED_VIRTUAL_IMAGE_STYLES_ID,
|
|
42
45
|
RESOLVED_VIRTUAL_MODULE_ID,
|
|
43
46
|
VALID_INPUT_FORMATS,
|
|
44
47
|
VALID_OUTPUT_FORMATS,
|
|
45
48
|
VALID_SUPPORTED_FORMATS,
|
|
49
|
+
VIRTUAL_GET_IMAGE_ID,
|
|
46
50
|
VIRTUAL_IMAGE_STYLES_ID,
|
|
47
51
|
VIRTUAL_MODULE_ID,
|
|
48
52
|
VIRTUAL_SERVICE_ID
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AstroLogger } from '../../../core/logger/core.js';
|
|
2
2
|
import type { FontResolver, StringMatcher } from '../definitions.js';
|
|
3
3
|
import type { Collaborator, Defaults, FontFileById, ResolvedFontFamily } from '../types.js';
|
|
4
4
|
import type { collectFontAssetsFromFaces as _collectFontAssetsFromFaces } from './collect-font-assets-from-faces.js';
|
|
@@ -7,7 +7,7 @@ import type { getOrCreateFontFamilyAssets as _getOrCreateFontFamilyAssets } from
|
|
|
7
7
|
export declare function computeFontFamiliesAssets({ resolvedFamilies, fontResolver, logger, bold, defaults, stringMatcher, getOrCreateFontFamilyAssets, collectFontAssetsFromFaces, filterAndTransformFontFaces, }: {
|
|
8
8
|
resolvedFamilies: Array<ResolvedFontFamily>;
|
|
9
9
|
fontResolver: FontResolver;
|
|
10
|
-
logger:
|
|
10
|
+
logger: AstroLogger;
|
|
11
11
|
bold: (input: string) => string;
|
|
12
12
|
defaults: Defaults;
|
|
13
13
|
stringMatcher: StringMatcher;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AstroLogger } from '../../../core/logger/core.js';
|
|
2
2
|
import type { FontFamilyAssetsByUniqueKey, ResolvedFontFamily } from '../types.js';
|
|
3
3
|
export declare function getOrCreateFontFamilyAssets({ fontFamilyAssetsByUniqueKey, logger, bold, family, }: {
|
|
4
4
|
fontFamilyAssetsByUniqueKey: FontFamilyAssetsByUniqueKey;
|
|
5
|
-
logger:
|
|
5
|
+
logger: AstroLogger;
|
|
6
6
|
bold: (input: string) => string;
|
|
7
7
|
family: ResolvedFontFamily;
|
|
8
8
|
}): import("../types.js").FontFamilyAssets;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Plugin } from 'vite';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLogger } from '../../core/logger/core.js';
|
|
3
3
|
import type { AstroSettings } from '../../types/astro.js';
|
|
4
4
|
interface Options {
|
|
5
5
|
settings: AstroSettings;
|
|
6
6
|
sync: boolean;
|
|
7
|
-
logger:
|
|
7
|
+
logger: AstroLogger;
|
|
8
8
|
}
|
|
9
9
|
export declare function fontsPlugin({ settings, sync, logger }: Options): Plugin;
|
|
10
10
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type * as fsMod from 'node:fs';
|
|
2
2
|
import type * as vite from 'vite';
|
|
3
|
-
import type {
|
|
3
|
+
import type { AstroLogger } from '../core/logger/core.js';
|
|
4
4
|
import type { AstroSettings } from '../types/astro.js';
|
|
5
5
|
interface Options {
|
|
6
6
|
settings: AstroSettings;
|
|
7
7
|
sync: boolean;
|
|
8
|
-
logger:
|
|
8
|
+
logger: AstroLogger;
|
|
9
9
|
fs: typeof fsMod;
|
|
10
10
|
}
|
|
11
11
|
export default function assets({ fs, settings, sync, logger }: Options): vite.Plugin[];
|
|
@@ -13,9 +13,11 @@ import { normalizePath } from "../core/viteUtils.js";
|
|
|
13
13
|
import { ASTRO_VITE_ENVIRONMENT_NAMES } from "../core/constants.js";
|
|
14
14
|
import { isAstroServerEnvironment } from "../environments.js";
|
|
15
15
|
import {
|
|
16
|
+
RESOLVED_VIRTUAL_GET_IMAGE_ID,
|
|
16
17
|
RESOLVED_VIRTUAL_IMAGE_STYLES_ID,
|
|
17
18
|
RESOLVED_VIRTUAL_MODULE_ID,
|
|
18
19
|
VALID_INPUT_FORMATS,
|
|
20
|
+
VIRTUAL_GET_IMAGE_ID,
|
|
19
21
|
VIRTUAL_IMAGE_STYLES_ID,
|
|
20
22
|
VIRTUAL_MODULE_ID,
|
|
21
23
|
VIRTUAL_SERVICE_ID
|
|
@@ -99,7 +101,7 @@ function assets({ fs, settings, sync, logger }) {
|
|
|
99
101
|
},
|
|
100
102
|
resolveId: {
|
|
101
103
|
filter: {
|
|
102
|
-
id: new RegExp(`^(${VIRTUAL_SERVICE_ID}|${VIRTUAL_MODULE_ID})$`)
|
|
104
|
+
id: new RegExp(`^(${VIRTUAL_SERVICE_ID}|${VIRTUAL_MODULE_ID}|${VIRTUAL_GET_IMAGE_ID})$`)
|
|
103
105
|
},
|
|
104
106
|
async handler(id) {
|
|
105
107
|
if (id === VIRTUAL_SERVICE_ID) {
|
|
@@ -111,13 +113,41 @@ function assets({ fs, settings, sync, logger }) {
|
|
|
111
113
|
if (id === VIRTUAL_MODULE_ID) {
|
|
112
114
|
return RESOLVED_VIRTUAL_MODULE_ID;
|
|
113
115
|
}
|
|
116
|
+
if (id === VIRTUAL_GET_IMAGE_ID) {
|
|
117
|
+
return RESOLVED_VIRTUAL_GET_IMAGE_ID;
|
|
118
|
+
}
|
|
114
119
|
}
|
|
115
120
|
},
|
|
116
121
|
load: {
|
|
117
122
|
filter: {
|
|
118
|
-
id: new RegExp(`^(${RESOLVED_VIRTUAL_MODULE_ID})$`)
|
|
123
|
+
id: new RegExp(`^(${RESOLVED_VIRTUAL_MODULE_ID}|${RESOLVED_VIRTUAL_GET_IMAGE_ID})$`)
|
|
119
124
|
},
|
|
120
|
-
handler() {
|
|
125
|
+
handler(id) {
|
|
126
|
+
if (id === RESOLVED_VIRTUAL_GET_IMAGE_ID) {
|
|
127
|
+
const isServerEnvironment2 = isAstroServerEnvironment(this.environment);
|
|
128
|
+
const getImageExport2 = isServerEnvironment2 ? `import { getImage as getImageInternal } from "astro/assets";
|
|
129
|
+
export const getImage = async (options) => await getImageInternal(options, imageConfig);` : `import { AstroError, AstroErrorData } from "astro/errors";
|
|
130
|
+
export const getImage = async () => {
|
|
131
|
+
throw new AstroError(
|
|
132
|
+
AstroErrorData.GetImageNotUsedOnServer.message,
|
|
133
|
+
AstroErrorData.GetImageNotUsedOnServer.hint,
|
|
134
|
+
);
|
|
135
|
+
};`;
|
|
136
|
+
const assetQueryParams = settings.adapter?.client?.assetQueryParams ? `new URLSearchParams(${JSON.stringify(
|
|
137
|
+
Array.from(settings.adapter.client.assetQueryParams.entries())
|
|
138
|
+
)})` : "undefined";
|
|
139
|
+
return {
|
|
140
|
+
code: `
|
|
141
|
+
export const imageConfig = ${JSON.stringify(settings.config.image)};
|
|
142
|
+
Object.defineProperty(imageConfig, 'assetQueryParams', {
|
|
143
|
+
value: ${assetQueryParams},
|
|
144
|
+
enumerable: false,
|
|
145
|
+
configurable: true,
|
|
146
|
+
});
|
|
147
|
+
${getImageExport2}
|
|
148
|
+
`
|
|
149
|
+
};
|
|
150
|
+
}
|
|
121
151
|
const isServerEnvironment = isAstroServerEnvironment(this.environment);
|
|
122
152
|
const getImageExport = isServerEnvironment ? `import { getImage as getImageInternal } from "astro/assets";
|
|
123
153
|
export const getImage = async (options) => await getImageInternal(options, imageConfig);` : `import { AstroError, AstroErrorData } from "astro/errors";
|
package/dist/cli/add/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import fsMod, { existsSync, promises as fs } from "node:fs";
|
|
2
|
-
import { createRequire } from "node:module";
|
|
3
2
|
import path from "node:path";
|
|
4
3
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
5
4
|
import * as clack from "@clack/prompts";
|
|
@@ -182,16 +181,7 @@ async function add(names, { flags }) {
|
|
|
182
181
|
);
|
|
183
182
|
if (await askToContinue({ flags, logger })) {
|
|
184
183
|
const data = await getPackageJson();
|
|
185
|
-
let compatibilityDate;
|
|
186
|
-
try {
|
|
187
|
-
const require2 = createRequire(root);
|
|
188
|
-
const { getLocalWorkerdCompatibilityDate } = await import(require2.resolve("@astrojs/cloudflare/info"));
|
|
189
|
-
({ date: compatibilityDate } = getLocalWorkerdCompatibilityDate({
|
|
190
|
-
projectPath: rootPath
|
|
191
|
-
}));
|
|
192
|
-
} catch {
|
|
193
|
-
compatibilityDate = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
194
|
-
}
|
|
184
|
+
let compatibilityDate = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
195
185
|
await fs.writeFile(
|
|
196
186
|
wranglerConfigURL,
|
|
197
187
|
STUBS.CLOUDFLARE_WRANGLER_CONFIG(data?.name ?? "example", compatibilityDate),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AstroLogger } from '../../../core/logger/core.js';
|
|
2
2
|
import type { KeyGenerator } from '../definitions.js';
|
|
3
3
|
interface Options {
|
|
4
|
-
logger:
|
|
4
|
+
logger: AstroLogger;
|
|
5
5
|
keyGenerator: KeyGenerator;
|
|
6
6
|
}
|
|
7
7
|
export declare const createKeyCommand: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AstroLogger } from '../../../core/logger/core.js';
|
|
2
2
|
import type { CommandExecutor, OperatingSystemProvider } from '../../definitions.js';
|
|
3
3
|
import type { CloudIdeProvider } from '../definitions.js';
|
|
4
4
|
interface Options {
|
|
5
5
|
url: string;
|
|
6
6
|
operatingSystemProvider: OperatingSystemProvider;
|
|
7
|
-
logger:
|
|
7
|
+
logger: AstroLogger;
|
|
8
8
|
commandExecutor: CommandExecutor;
|
|
9
9
|
cloudIdeProvider: CloudIdeProvider;
|
|
10
10
|
}
|
package/dist/cli/flags.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Arguments } from 'yargs-parser';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLogger } from '../core/logger/core.js';
|
|
3
3
|
import type { AstroInlineConfig } from '../types/public/config.js';
|
|
4
4
|
export type Flags = Arguments;
|
|
5
5
|
/** @deprecated Use AstroConfigResolver instead */
|
|
@@ -8,4 +8,4 @@ export declare function flagsToAstroInlineConfig(flags: Flags): AstroInlineConfi
|
|
|
8
8
|
* The `logging` is usually created from an `AstroInlineConfig`, but some flows like `add`
|
|
9
9
|
* doesn't read the AstroConfig directly, so we create a `logging` object from the CLI flags instead.
|
|
10
10
|
*/
|
|
11
|
-
export declare function createLoggerFromFlags(flags: Flags):
|
|
11
|
+
export declare function createLoggerFromFlags(flags: Flags): AstroLogger;
|
package/dist/cli/flags.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AstroLogger } from '../../../core/logger/core.js';
|
|
2
2
|
import type { Clipboard, DebugInfoFormatter, DebugInfoProvider } from '../definitions.js';
|
|
3
3
|
interface Options {
|
|
4
4
|
debugInfoProvider: DebugInfoProvider;
|
|
5
5
|
getDebugInfoFormatter: (options: {
|
|
6
6
|
pretty: boolean;
|
|
7
7
|
}) => DebugInfoFormatter;
|
|
8
|
-
logger:
|
|
8
|
+
logger: AstroLogger;
|
|
9
9
|
clipboard: Clipboard;
|
|
10
10
|
}
|
|
11
11
|
export declare const infoCommand: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AstroLogger } from '../../../core/logger/core.js';
|
|
2
2
|
import type { Clipboard, Prompt } from '../definitions.js';
|
|
3
3
|
export declare class TinyclipClipboard implements Clipboard {
|
|
4
4
|
#private;
|
|
5
5
|
constructor({ logger, prompt, }: {
|
|
6
|
-
logger:
|
|
6
|
+
logger: AstroLogger;
|
|
7
7
|
prompt: Prompt;
|
|
8
8
|
});
|
|
9
9
|
copy(text: string): Promise<void>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AstroLogger } from '../../core/logger/core.js';
|
|
2
2
|
import type { AstroVersionProvider, HelpDisplay, TextStyler } from '../definitions.js';
|
|
3
3
|
import type { HelpPayload } from '../domain/help-payload.js';
|
|
4
4
|
import type { Flags } from '../flags.js';
|
|
5
5
|
export declare class LoggerHelpDisplay implements HelpDisplay {
|
|
6
6
|
#private;
|
|
7
7
|
constructor({ logger, textStyler, astroVersionProvider, flags, }: {
|
|
8
|
-
logger:
|
|
8
|
+
logger: AstroLogger;
|
|
9
9
|
textStyler: TextStyler;
|
|
10
10
|
astroVersionProvider: AstroVersionProvider;
|
|
11
11
|
flags: Flags;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AstroLogger } from '../core/logger/core.js';
|
|
2
2
|
type GetPackageOptions = {
|
|
3
3
|
skipAsk?: boolean;
|
|
4
4
|
optional?: boolean;
|
|
5
5
|
cwd?: string;
|
|
6
6
|
};
|
|
7
|
-
export declare function getPackage<T>(packageName: string, logger:
|
|
7
|
+
export declare function getPackage<T>(packageName: string, logger: AstroLogger, options: GetPackageOptions, otherDeps?: string[]): Promise<T | undefined>;
|
|
8
8
|
export declare function fetchPackageJson(scope: string | undefined, name: string, tag: string): Promise<Record<string, any> | Error>;
|
|
9
9
|
export declare function fetchPackageVersions(packageName: string): Promise<string[] | Error>;
|
|
10
10
|
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { fileURLToPath } from "node:url";
|
|
2
2
|
import { formatWithOptions } from "node:util";
|
|
3
|
-
import dlv from "dlv";
|
|
4
3
|
import { flattie } from "flattie";
|
|
5
4
|
import colors from "piccolore";
|
|
6
5
|
import { resolveConfig } from "../../core/config/config.js";
|
|
@@ -8,6 +7,7 @@ import { createSettings } from "../../core/config/settings.js";
|
|
|
8
7
|
import { collectErrorMetadata } from "../../core/errors/dev/utils.js";
|
|
9
8
|
import * as msg from "../../core/messages/runtime.js";
|
|
10
9
|
import { DEFAULT_PREFERENCES } from "../../preferences/defaults.js";
|
|
10
|
+
import dlv from "../../preferences/dlv.js";
|
|
11
11
|
import { coerce, isValidKey } from "../../preferences/index.js";
|
|
12
12
|
import { createLoggerFromFlags, flagsToAstroInlineConfig } from "../flags.js";
|
|
13
13
|
const { bgGreen, black, bold, dim, yellow } = colors;
|
package/dist/container/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { getDefaultClientDirectives } from "../core/client-directive/index.js";
|
|
|
3
3
|
import { ASTRO_CONFIG_DEFAULTS } from "../core/config/schemas/index.js";
|
|
4
4
|
import { validateConfig } from "../core/config/validate.js";
|
|
5
5
|
import { createKey } from "../core/encryption.js";
|
|
6
|
-
import {
|
|
6
|
+
import { AstroLogger } from "../core/logger/core.js";
|
|
7
7
|
import { nodeLogDestination } from "../core/logger/node.js";
|
|
8
8
|
import { NOOP_MIDDLEWARE_FN } from "../core/middleware/noop-middleware.js";
|
|
9
9
|
import { removeLeadingForwardSlash } from "../core/path.js";
|
|
@@ -82,9 +82,9 @@ class experimental_AstroContainer {
|
|
|
82
82
|
astroConfig
|
|
83
83
|
}) {
|
|
84
84
|
this.#pipeline = ContainerPipeline.create({
|
|
85
|
-
logger: new
|
|
85
|
+
logger: new AstroLogger({
|
|
86
86
|
level: "info",
|
|
87
|
-
|
|
87
|
+
destination: nodeLogDestination
|
|
88
88
|
}),
|
|
89
89
|
manifest: createManifest(manifest, renderers),
|
|
90
90
|
streaming,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FSWatcher } from 'vite';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLogger } from '../core/logger/core.js';
|
|
3
3
|
import type { AstroSettings } from '../types/astro.js';
|
|
4
4
|
import type { RefreshContentOptions } from '../types/public/content.js';
|
|
5
5
|
import type { MutableDataStore } from './mutable-data-store.js';
|
|
@@ -7,7 +7,7 @@ import { type ContentObservable } from './utils.js';
|
|
|
7
7
|
export interface ContentLayerOptions {
|
|
8
8
|
store: MutableDataStore;
|
|
9
9
|
settings: AstroSettings;
|
|
10
|
-
logger:
|
|
10
|
+
logger: AstroLogger;
|
|
11
11
|
watcher?: FSWatcher;
|
|
12
12
|
contentConfigObserver?: ContentObservable;
|
|
13
13
|
}
|
|
@@ -192,7 +192,7 @@ ${contentConfig.error.message}`
|
|
|
192
192
|
logger.info("Content config changed");
|
|
193
193
|
shouldClear = true;
|
|
194
194
|
}
|
|
195
|
-
if (previousAstroVersion && previousAstroVersion !== "6.1.
|
|
195
|
+
if (previousAstroVersion && previousAstroVersion !== "6.1.6") {
|
|
196
196
|
logger.info("Astro version changed");
|
|
197
197
|
shouldClear = true;
|
|
198
198
|
}
|
|
@@ -200,8 +200,8 @@ ${contentConfig.error.message}`
|
|
|
200
200
|
logger.info("Clearing content store");
|
|
201
201
|
this.#store.clearAll();
|
|
202
202
|
}
|
|
203
|
-
if ("6.1.
|
|
204
|
-
this.#store.metaStore().set("astro-version", "6.1.
|
|
203
|
+
if ("6.1.6") {
|
|
204
|
+
this.#store.metaStore().set("astro-version", "6.1.6");
|
|
205
205
|
}
|
|
206
206
|
if (currentConfigDigest) {
|
|
207
207
|
this.#store.metaStore().set("content-config-digest", currentConfigDigest);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { FSWatcher } from 'vite';
|
|
2
2
|
import { ContentLayer } from './content-layer.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { AstroLogger } from '../core/logger/core.js';
|
|
4
4
|
import type { AstroSettings } from '../types/astro.js';
|
|
5
5
|
import type { MutableDataStore } from './mutable-data-store.js';
|
|
6
6
|
interface ContentLayerOptions {
|
|
7
7
|
store: MutableDataStore;
|
|
8
8
|
settings: AstroSettings;
|
|
9
|
-
logger:
|
|
9
|
+
logger: AstroLogger;
|
|
10
10
|
watcher?: FSWatcher;
|
|
11
11
|
}
|
|
12
12
|
export declare const globalContentLayer: {
|
package/dist/content/runtime.js
CHANGED
|
@@ -318,7 +318,7 @@ const CONTENT_LAYER_IMAGE_REGEX = /__ASTRO_IMAGE_="([^"]+)"/g;
|
|
|
318
318
|
async function updateImageReferencesInBody(html, fileName) {
|
|
319
319
|
const { default: imageAssetMap } = await import("astro:asset-imports");
|
|
320
320
|
const imageObjects = /* @__PURE__ */ new Map();
|
|
321
|
-
const { getImage } = await import("astro:
|
|
321
|
+
const { getImage } = await import("virtual:astro:get-image");
|
|
322
322
|
for (const [_full, imagePath] of html.matchAll(CONTENT_LAYER_IMAGE_REGEX)) {
|
|
323
323
|
try {
|
|
324
324
|
const decodedImagePath = JSON.parse(imagePath.replaceAll(""", '"'));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type fsMod from 'node:fs';
|
|
2
2
|
import type { ViteDevServer } from 'vite';
|
|
3
|
-
import type {
|
|
3
|
+
import type { AstroLogger } from '../core/logger/core.js';
|
|
4
4
|
import type { AstroSettings } from '../types/astro.js';
|
|
5
5
|
interface ContentServerListenerParams {
|
|
6
6
|
fs: typeof fsMod;
|
|
7
|
-
logger:
|
|
7
|
+
logger: AstroLogger;
|
|
8
8
|
settings: AstroSettings;
|
|
9
9
|
viteServer: ViteDevServer;
|
|
10
10
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type fsMod from 'node:fs';
|
|
2
2
|
import { type ViteDevServer } from 'vite';
|
|
3
|
-
import type {
|
|
3
|
+
import type { AstroLogger } from '../core/logger/core.js';
|
|
4
4
|
import type { AstroSettings } from '../types/astro.js';
|
|
5
5
|
import { type ContentObservable } from './utils.js';
|
|
6
6
|
type ChokidarEvent = 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir';
|
|
@@ -10,7 +10,7 @@ type RawContentEvent = {
|
|
|
10
10
|
};
|
|
11
11
|
type CreateContentGeneratorParams = {
|
|
12
12
|
contentConfigObserver: ContentObservable;
|
|
13
|
-
logger:
|
|
13
|
+
logger: AstroLogger;
|
|
14
14
|
settings: AstroSettings;
|
|
15
15
|
/** This is required for loading the content config */
|
|
16
16
|
viteServer: ViteDevServer;
|
package/dist/content/utils.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import fsMod from 'node:fs';
|
|
|
2
2
|
import type { PluginContext } from 'rollup';
|
|
3
3
|
import type { RunnableDevEnvironment } from 'vite';
|
|
4
4
|
import * as z from 'zod/v4';
|
|
5
|
-
import type {
|
|
5
|
+
import type { AstroLogger } from '../core/logger/core.js';
|
|
6
6
|
import type { AstroSettings } from '../types/astro.js';
|
|
7
7
|
import type { AstroConfig } from '../types/public/config.js';
|
|
8
8
|
import type { ContentEntryType, DataEntryType } from '../types/public/content.js';
|
|
@@ -102,7 +102,7 @@ export declare function getDataEntryExts(settings: Pick<AstroSettings, 'dataEntr
|
|
|
102
102
|
export declare function getEntryConfigByExtMap<TEntryType extends ContentEntryType | DataEntryType>(entryTypes: TEntryType[]): Map<string, TEntryType>;
|
|
103
103
|
export declare function getSymlinkedContentCollections({ contentDir, logger, fs, }: {
|
|
104
104
|
contentDir: URL;
|
|
105
|
-
logger:
|
|
105
|
+
logger: AstroLogger;
|
|
106
106
|
fs: typeof fsMod;
|
|
107
107
|
}): Promise<Map<string, string>>;
|
|
108
108
|
export declare function reverseSymlink({ entry, symlinks, contentDir, }: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type fsMod from 'node:fs';
|
|
2
2
|
import type { Plugin } from 'vite';
|
|
3
|
-
import type {
|
|
3
|
+
import type { AstroLogger } from '../core/logger/core.js';
|
|
4
4
|
import type { AstroSettings } from '../types/astro.js';
|
|
5
5
|
export declare function astroContentImportPlugin({ fs, settings, logger, }: {
|
|
6
6
|
fs: typeof fsMod;
|
|
7
7
|
settings: AstroSettings;
|
|
8
|
-
logger:
|
|
8
|
+
logger: AstroLogger;
|
|
9
9
|
}): Plugin[];
|
package/dist/core/app/base.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { RoutesList } from '../../types/astro.js';
|
|
|
2
2
|
import type { RemotePattern, RouteData } from '../../types/public/index.js';
|
|
3
3
|
import type { Pipeline } from '../base-pipeline.js';
|
|
4
4
|
import { getSetCookiesFromResponse } from '../cookies/index.js';
|
|
5
|
-
import { AstroIntegrationLogger,
|
|
5
|
+
import { AstroIntegrationLogger, AstroLogger } from '../logger/core.js';
|
|
6
6
|
import { type CreateRenderContext, RenderContext } from '../render-context.js';
|
|
7
7
|
import type { AppPipeline } from './pipeline.js';
|
|
8
8
|
import type { SSRManifest } from './types.js';
|
|
@@ -79,7 +79,7 @@ export declare abstract class BaseApp<P extends Pipeline = AppPipeline> {
|
|
|
79
79
|
pipeline: P;
|
|
80
80
|
adapterLogger: AstroIntegrationLogger;
|
|
81
81
|
baseWithoutTrailingSlash: string;
|
|
82
|
-
logger:
|
|
82
|
+
logger: AstroLogger;
|
|
83
83
|
constructor(manifest: SSRManifest, streaming?: boolean, ...args: any[]);
|
|
84
84
|
abstract isDev(): boolean;
|
|
85
85
|
createRenderContext(payload: CreateRenderContext): Promise<RenderContext>;
|
package/dist/core/app/base.js
CHANGED
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
import { getCookiesFromResponse } from "../cookies/response.js";
|
|
29
29
|
import { AstroError, AstroErrorData } from "../errors/index.js";
|
|
30
30
|
import { consoleLogDestination } from "../logger/console.js";
|
|
31
|
-
import { AstroIntegrationLogger,
|
|
31
|
+
import { AstroIntegrationLogger, AstroLogger } from "../logger/core.js";
|
|
32
32
|
import { RenderContext } from "../render-context.js";
|
|
33
33
|
import { redirectTemplate } from "../routing/3xx.js";
|
|
34
34
|
import { ensure404Route } from "../routing/astro-designed-error-pages.js";
|
|
@@ -50,8 +50,8 @@ class BaseApp {
|
|
|
50
50
|
this.manifestData = { routes: manifest.routes.map((route) => route.routeData) };
|
|
51
51
|
this.baseWithoutTrailingSlash = removeTrailingForwardSlash(manifest.base);
|
|
52
52
|
this.pipeline = this.createPipeline(streaming, manifest, ...args);
|
|
53
|
-
this.logger = new
|
|
54
|
-
|
|
53
|
+
this.logger = new AstroLogger({
|
|
54
|
+
destination: consoleLogDestination,
|
|
55
55
|
level: manifest.logLevel
|
|
56
56
|
});
|
|
57
57
|
this.adapterLogger = new AstroIntegrationLogger(this.logger.options, manifest.adapterName);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { RouteData } from '../../../types/public/index.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLogger } from '../../logger/core.js';
|
|
3
3
|
import { BaseApp, type DevMatch, type LogRequestPayload, type RenderErrorOptions } from '../base.js';
|
|
4
4
|
import type { SSRManifest } from '../types.js';
|
|
5
5
|
import { NonRunnablePipeline } from './pipeline.js';
|
|
6
6
|
import type { RoutesList } from '../../../types/astro.js';
|
|
7
7
|
export declare class DevApp extends BaseApp<NonRunnablePipeline> {
|
|
8
|
-
logger:
|
|
9
|
-
constructor(manifest: SSRManifest, streaming: boolean | undefined, logger:
|
|
10
|
-
createPipeline(streaming: boolean, manifest: SSRManifest, logger:
|
|
8
|
+
logger: AstroLogger;
|
|
9
|
+
constructor(manifest: SSRManifest, streaming: boolean | undefined, logger: AstroLogger);
|
|
10
|
+
createPipeline(streaming: boolean, manifest: SSRManifest, logger: AstroLogger): NonRunnablePipeline;
|
|
11
11
|
isDev(): boolean;
|
|
12
12
|
/**
|
|
13
13
|
* Clears the cached middleware so it is re-resolved on the next request.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { AstroInlineConfig } from '../../types/public/index.js';
|
|
2
|
-
import {
|
|
3
|
-
export declare function createConsoleLogger(level: AstroInlineConfig['logLevel']):
|
|
2
|
+
import { AstroLogger } from '../logger/core.js';
|
|
3
|
+
export declare function createConsoleLogger(level: AstroInlineConfig['logLevel']): AstroLogger;
|
package/dist/core/app/logging.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { consoleLogDestination } from "../logger/console.js";
|
|
2
|
-
import {
|
|
2
|
+
import { AstroLogger } from "../logger/core.js";
|
|
3
3
|
function createConsoleLogger(level) {
|
|
4
|
-
return new
|
|
5
|
-
|
|
4
|
+
return new AstroLogger({
|
|
5
|
+
destination: consoleLogDestination,
|
|
6
6
|
level: level ?? "info"
|
|
7
7
|
});
|
|
8
8
|
}
|
package/dist/core/app/types.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { AstroConfig, CspAlgorithm, Locales, RemotePattern } from '../../ty
|
|
|
5
5
|
import type { RouteData, SSRComponentMetadata, SSRLoadedRenderer, SSRResult } from '../../types/public/internal.js';
|
|
6
6
|
import type { SinglePageBuiltModule } from '../build/types.js';
|
|
7
7
|
import type { CspDirective } from '../csp/config.js';
|
|
8
|
-
import type {
|
|
8
|
+
import type { AstroLoggerLevel } from '../logger/core.js';
|
|
9
9
|
import type { RoutingStrategies } from './common.js';
|
|
10
10
|
import type { CacheProviderFactory, SSRManifestCache } from '../cache/types.js';
|
|
11
11
|
import type { BaseSessionConfig, SessionDriverFactory } from '../session/types.js';
|
|
@@ -138,7 +138,7 @@ export type SSRManifest = {
|
|
|
138
138
|
placement: DevToolbarPlacement | undefined;
|
|
139
139
|
};
|
|
140
140
|
internalFetchHeaders?: Record<string, string>;
|
|
141
|
-
logLevel:
|
|
141
|
+
logLevel: AstroLoggerLevel;
|
|
142
142
|
};
|
|
143
143
|
export type SSRActions = {
|
|
144
144
|
server: Record<string, ActionClient<any, any, any>>;
|
|
@@ -6,7 +6,7 @@ import type { RuntimeMode } from '../types/public/config.js';
|
|
|
6
6
|
import type { RouteData, SSRActions, SSRLoadedRenderer, SSRManifest, SSRResult } from '../types/public/internal.js';
|
|
7
7
|
import type { ServerIslandMappings } from './app/types.js';
|
|
8
8
|
import type { SinglePageBuiltModule } from './build/types.js';
|
|
9
|
-
import type {
|
|
9
|
+
import type { AstroLogger } from './logger/core.js';
|
|
10
10
|
import { RouteCache } from './render/route-cache.js';
|
|
11
11
|
import { type DefaultRouteParams } from './routing/default.js';
|
|
12
12
|
import type { CacheProvider, CacheProviderFactory } from './cache/types.js';
|
|
@@ -29,7 +29,7 @@ export declare abstract class Pipeline {
|
|
|
29
29
|
compiledCacheRoutes: CompiledCacheRoute[] | undefined;
|
|
30
30
|
nodePool: NodePool | undefined;
|
|
31
31
|
htmlStringCache: HTMLStringCache | undefined;
|
|
32
|
-
readonly logger:
|
|
32
|
+
readonly logger: AstroLogger;
|
|
33
33
|
readonly manifest: SSRManifest;
|
|
34
34
|
/**
|
|
35
35
|
* "development" or "production" only
|
|
@@ -62,7 +62,7 @@ export declare abstract class Pipeline {
|
|
|
62
62
|
readonly cacheProvider: SSRManifest['cacheProvider'];
|
|
63
63
|
readonly cacheConfig: SSRManifest['cacheConfig'];
|
|
64
64
|
readonly serverIslands: SSRManifest['serverIslandMappings'];
|
|
65
|
-
constructor(logger:
|
|
65
|
+
constructor(logger: AstroLogger, manifest: SSRManifest,
|
|
66
66
|
/**
|
|
67
67
|
* "development" or "production" only
|
|
68
68
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AstroLogger } from '../logger/core.js';
|
|
2
2
|
import type { AstroPrerenderer, RouteToHeaders } from '../../types/public/index.js';
|
|
3
3
|
import type { RouteData } from '../../types/public/internal.js';
|
|
4
4
|
import { type BuildInternals } from './internal.js';
|
|
@@ -20,7 +20,7 @@ interface RenderToPathPayload {
|
|
|
20
20
|
route: RouteData;
|
|
21
21
|
options: StaticBuildOptions;
|
|
22
22
|
routeToHeaders?: RouteToHeaders;
|
|
23
|
-
logger:
|
|
23
|
+
logger: AstroLogger;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* Renders a single prerendered path to an in-memory result.
|