astro 6.1.5 → 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/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/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/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/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/integrations/features-validation.d.ts +2 -2
- package/dist/integrations/hooks.d.ts +13 -13
- 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/server-islands.js +5 -12
- package/dist/runtime/server/render/util.js +2 -5
- 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 -3
|
@@ -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;
|
|
@@ -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[];
|
|
@@ -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 {};
|
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: {
|
|
@@ -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.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AstroSettings, RoutesList } from '../../types/astro.js';
|
|
2
2
|
import type { AstroInlineConfig, RuntimeMode } from '../../types/public/config.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { AstroLogger } from '../logger/core.js';
|
|
4
4
|
interface BuildOptions {
|
|
5
5
|
/**
|
|
6
6
|
* Output a development-based build similar to code transformed in `astro dev`. This
|
|
@@ -28,7 +28,7 @@ interface BuildOptions {
|
|
|
28
28
|
*/
|
|
29
29
|
export default function build(inlineConfig: AstroInlineConfig, options?: BuildOptions): Promise<void>;
|
|
30
30
|
interface AstroBuilderOptions extends BuildOptions {
|
|
31
|
-
logger:
|
|
31
|
+
logger: AstroLogger;
|
|
32
32
|
mode: string;
|
|
33
33
|
runtimeMode: RuntimeMode;
|
|
34
34
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { AstroSettings, RoutesList } from '../../types/astro.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLogger } from '../logger/core.js';
|
|
3
3
|
import type { AllPagesData } from './types.js';
|
|
4
4
|
interface CollectPagesDataOptions {
|
|
5
5
|
settings: AstroSettings;
|
|
6
|
-
logger:
|
|
6
|
+
logger: AstroLogger;
|
|
7
7
|
manifest: RoutesList;
|
|
8
8
|
}
|
|
9
9
|
interface CollectPagesDataResult {
|
|
@@ -4,7 +4,7 @@ import type { AstroSettings, ComponentInstance, RoutesList } from '../../types/a
|
|
|
4
4
|
import type { MiddlewareHandler } from '../../types/public/common.js';
|
|
5
5
|
import type { RuntimeMode } from '../../types/public/config.js';
|
|
6
6
|
import type { RouteData } from '../../types/public/internal.js';
|
|
7
|
-
import type {
|
|
7
|
+
import type { AstroLogger } from '../logger/core.js';
|
|
8
8
|
type ComponentPath = string;
|
|
9
9
|
export type ViteID = string;
|
|
10
10
|
export type StylesheetAsset = {
|
|
@@ -31,7 +31,7 @@ export type AllPagesData = Record<ComponentPath, PageBuildData>;
|
|
|
31
31
|
export interface StaticBuildOptions {
|
|
32
32
|
allPages: AllPagesData;
|
|
33
33
|
settings: AstroSettings;
|
|
34
|
-
logger:
|
|
34
|
+
logger: AstroLogger;
|
|
35
35
|
routesList: RoutesList;
|
|
36
36
|
runtimeMode: RuntimeMode;
|
|
37
37
|
origin: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CacheLike } from './cache.js';
|
|
2
2
|
import type { CacheOptions } from '../types.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { AstroLogger } from '../../logger/core.js';
|
|
4
4
|
export declare class NoopAstroCache implements CacheLike {
|
|
5
5
|
readonly enabled = false;
|
|
6
6
|
set(): void;
|
|
@@ -18,7 +18,7 @@ export declare class NoopAstroCache implements CacheLike {
|
|
|
18
18
|
export declare class DisabledAstroCache implements CacheLike {
|
|
19
19
|
#private;
|
|
20
20
|
readonly enabled = false;
|
|
21
|
-
constructor(logger?:
|
|
21
|
+
constructor(logger?: AstroLogger);
|
|
22
22
|
set(): void;
|
|
23
23
|
get tags(): string[];
|
|
24
24
|
get options(): Readonly<CacheOptions>;
|
package/dist/core/constants.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import nodeFs from 'node:fs';
|
|
2
2
|
import * as vite from 'vite';
|
|
3
3
|
import type { AstroSettings, RoutesList } from '../types/astro.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { AstroLogger } from './logger/core.js';
|
|
5
5
|
type CreateViteOptions = {
|
|
6
6
|
settings: AstroSettings;
|
|
7
|
-
logger:
|
|
7
|
+
logger: AstroLogger;
|
|
8
8
|
mode: string;
|
|
9
9
|
fs?: typeof nodeFs;
|
|
10
10
|
routesList: RoutesList;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AstroSettings } from '../../types/astro.js';
|
|
2
2
|
import type { AstroAdapter } from '../../types/public/integrations.js';
|
|
3
|
-
import type {
|
|
4
|
-
export declare function warnMissingAdapter(logger:
|
|
5
|
-
export declare function validateSetAdapter(logger:
|
|
3
|
+
import type { AstroLogger } from '../logger/core.js';
|
|
4
|
+
export declare function warnMissingAdapter(logger: AstroLogger, settings: AstroSettings): void;
|
|
5
|
+
export declare function validateSetAdapter(logger: AstroLogger, settings: AstroSettings, adapter: AstroAdapter, maybeConflictingIntegration: string, command?: 'dev' | 'build' | string): void;
|
|
@@ -4,10 +4,10 @@ import type { AddressInfo } from 'node:net';
|
|
|
4
4
|
import * as vite from 'vite';
|
|
5
5
|
import type { AstroSettings } from '../../types/astro.js';
|
|
6
6
|
import type { AstroInlineConfig } from '../../types/public/config.js';
|
|
7
|
-
import type {
|
|
7
|
+
import type { AstroLogger } from '../logger/core.js';
|
|
8
8
|
export interface Container {
|
|
9
9
|
fs: typeof nodeFs;
|
|
10
|
-
logger:
|
|
10
|
+
logger: AstroLogger;
|
|
11
11
|
settings: AstroSettings;
|
|
12
12
|
viteServer: vite.ViteDevServer;
|
|
13
13
|
inlineConfig: AstroInlineConfig;
|
|
@@ -16,7 +16,7 @@ export interface Container {
|
|
|
16
16
|
close: () => Promise<void>;
|
|
17
17
|
}
|
|
18
18
|
interface CreateContainerParams {
|
|
19
|
-
logger:
|
|
19
|
+
logger: AstroLogger;
|
|
20
20
|
settings: AstroSettings;
|
|
21
21
|
inlineConfig?: AstroInlineConfig;
|
|
22
22
|
isRestart?: boolean;
|
package/dist/core/dev/dev.js
CHANGED
|
@@ -37,7 +37,7 @@ async function dev(inlineConfig) {
|
|
|
37
37
|
await telemetry.record([]);
|
|
38
38
|
const restart = await createContainerWithAutomaticRestart({ inlineConfig, fs });
|
|
39
39
|
const logger = restart.container.logger;
|
|
40
|
-
const currentVersion = "6.1.
|
|
40
|
+
const currentVersion = "6.1.6";
|
|
41
41
|
const isPrerelease = currentVersion.includes("-");
|
|
42
42
|
if (!isPrerelease) {
|
|
43
43
|
try {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export declare const consoleLogDestination:
|
|
1
|
+
import { type AstroLogMessage, type AstroLoggerDestination } from './core.js';
|
|
2
|
+
export declare const consoleLogDestination: AstroLoggerDestination<AstroLogMessage>;
|