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
|
@@ -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>;
|
|
@@ -1,50 +1,77 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface AstroLoggerDestination<T> {
|
|
2
2
|
write: (chunk: T) => boolean;
|
|
3
3
|
}
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* How the log should be formatted
|
|
6
|
+
* - 'default': how Astro usually format the logs
|
|
7
|
+
* - 'json': logs are formatted in JSON format
|
|
8
|
+
*/
|
|
9
|
+
export type AstroLoggerFormat = 'default' | 'json';
|
|
10
|
+
/**
|
|
11
|
+
* The level of logging. Priority is the following:
|
|
12
|
+
* 1. debug
|
|
13
|
+
* 2. error
|
|
14
|
+
* 3. warn
|
|
15
|
+
* 4. info
|
|
16
|
+
* 5. silent
|
|
17
|
+
*/
|
|
18
|
+
export type AstroLoggerLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent';
|
|
5
19
|
/**
|
|
6
20
|
* Defined logger labels. Add more as needed, but keep them high-level & reusable,
|
|
7
21
|
* rather than specific to a single command, function, use, etc. The label will be
|
|
8
22
|
* shown in the log message to the user, so it should be relevant.
|
|
9
23
|
*/
|
|
10
|
-
type
|
|
11
|
-
export interface
|
|
12
|
-
|
|
13
|
-
level:
|
|
24
|
+
type AstroLoggerLabel = 'add' | 'build' | 'check' | 'config' | 'content' | 'crypto' | 'deprecated' | 'markdown' | 'router' | 'types' | 'vite' | 'watch' | 'middleware' | 'preferences' | 'redirects' | 'sync' | 'session' | 'toolbar' | 'assets' | 'env' | 'update' | 'adapter' | 'islands' | 'cache' | 'csp' | 'SKIP_FORMAT';
|
|
25
|
+
export interface AstroLogOptions {
|
|
26
|
+
destination: AstroLoggerDestination<AstroLogMessage>;
|
|
27
|
+
level: AstroLoggerLevel;
|
|
28
|
+
_format?: AstroLoggerFormat;
|
|
14
29
|
}
|
|
15
30
|
/** @lintignore */
|
|
16
31
|
export declare const dateTimeFormat: Intl.DateTimeFormat;
|
|
17
|
-
export interface
|
|
32
|
+
export interface AstroLogMessage {
|
|
33
|
+
/**
|
|
34
|
+
* Label associated to the message. Used by Astro for pretty logging
|
|
35
|
+
*/
|
|
18
36
|
label: string | null;
|
|
19
|
-
|
|
37
|
+
/**
|
|
38
|
+
* The level of the log
|
|
39
|
+
*/
|
|
40
|
+
level: AstroLoggerLevel;
|
|
41
|
+
/**
|
|
42
|
+
* The message of the log
|
|
43
|
+
*/
|
|
20
44
|
message: string;
|
|
45
|
+
/**
|
|
46
|
+
* Whether a newline should be appended to the end of the message i.e. message + '\n'
|
|
47
|
+
*/
|
|
21
48
|
newLine: boolean;
|
|
22
49
|
}
|
|
23
|
-
export declare const levels: Record<
|
|
24
|
-
export declare function isLogLevelEnabled(configuredLogLevel:
|
|
50
|
+
export declare const levels: Record<AstroLoggerLevel, number>;
|
|
51
|
+
export declare function isLogLevelEnabled(configuredLogLevel: AstroLoggerLevel, level: AstroLoggerLevel): boolean;
|
|
25
52
|
export declare function debug(...args: any[]): void;
|
|
26
53
|
/**
|
|
27
54
|
* Get the prefix for a log message.
|
|
28
55
|
* This includes the timestamp, log level, and label all properly formatted
|
|
29
56
|
* with colors. This is shared across different loggers, so it's defined here.
|
|
30
57
|
*/
|
|
31
|
-
export declare function getEventPrefix({ level, label }:
|
|
58
|
+
export declare function getEventPrefix({ level, label }: AstroLogMessage): string;
|
|
32
59
|
/** Print out a timer message for debug() */
|
|
33
60
|
export declare function timerMessage(message: string, startTime?: number): string;
|
|
34
|
-
export declare class
|
|
35
|
-
options:
|
|
36
|
-
constructor(options:
|
|
37
|
-
info(label:
|
|
38
|
-
warn(label:
|
|
39
|
-
error(label:
|
|
40
|
-
debug(label:
|
|
41
|
-
level():
|
|
61
|
+
export declare class AstroLogger {
|
|
62
|
+
options: AstroLogOptions;
|
|
63
|
+
constructor(options: AstroLogOptions);
|
|
64
|
+
info(label: AstroLoggerLabel | null, message: string, newLine?: boolean): void;
|
|
65
|
+
warn(label: AstroLoggerLabel | null, message: string, newLine?: boolean): void;
|
|
66
|
+
error(label: AstroLoggerLabel | null, message: string, newLine?: boolean): void;
|
|
67
|
+
debug(label: AstroLoggerLabel, ...messages: any[]): void;
|
|
68
|
+
level(): AstroLoggerLevel;
|
|
42
69
|
forkIntegrationLogger(label: string): AstroIntegrationLogger;
|
|
43
70
|
}
|
|
44
71
|
export declare class AstroIntegrationLogger {
|
|
45
|
-
options:
|
|
72
|
+
options: AstroLogOptions;
|
|
46
73
|
label: string;
|
|
47
|
-
constructor(logging:
|
|
74
|
+
constructor(logging: AstroLogOptions, label: string);
|
|
48
75
|
/**
|
|
49
76
|
* Creates a new logger instance with a new label, but the same log options.
|
|
50
77
|
*/
|
package/dist/core/logger/core.js
CHANGED
|
@@ -14,12 +14,13 @@ const levels = {
|
|
|
14
14
|
};
|
|
15
15
|
function log(opts, level, label, message, newLine = true) {
|
|
16
16
|
const logLevel = opts.level;
|
|
17
|
-
const dest = opts.
|
|
17
|
+
const dest = opts.destination;
|
|
18
18
|
const event = {
|
|
19
19
|
label,
|
|
20
20
|
level,
|
|
21
21
|
message,
|
|
22
|
-
newLine
|
|
22
|
+
newLine,
|
|
23
|
+
_format: opts._format
|
|
23
24
|
};
|
|
24
25
|
if (!isLogLevelEnabled(logLevel, level)) {
|
|
25
26
|
return;
|
|
@@ -71,9 +72,12 @@ function timerMessage(message, startTime = Date.now()) {
|
|
|
71
72
|
let timeDisplay = timeDiff < 750 ? `${Math.round(timeDiff)}ms` : `${(timeDiff / 1e3).toFixed(1)}s`;
|
|
72
73
|
return `${message} ${colors.dim(timeDisplay)}`;
|
|
73
74
|
}
|
|
74
|
-
class
|
|
75
|
+
class AstroLogger {
|
|
75
76
|
options;
|
|
76
77
|
constructor(options) {
|
|
78
|
+
if (!options._format) {
|
|
79
|
+
options._format = "default";
|
|
80
|
+
}
|
|
77
81
|
this.options = options;
|
|
78
82
|
}
|
|
79
83
|
info(label, message, newLine = true) {
|
|
@@ -123,7 +127,7 @@ class AstroIntegrationLogger {
|
|
|
123
127
|
}
|
|
124
128
|
export {
|
|
125
129
|
AstroIntegrationLogger,
|
|
126
|
-
|
|
130
|
+
AstroLogger,
|
|
127
131
|
dateTimeFormat,
|
|
128
132
|
debug,
|
|
129
133
|
getEventPrefix,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AstroInlineConfig } from '../../types/public/config.js';
|
|
2
|
-
import {
|
|
3
|
-
import { type
|
|
4
|
-
export declare const nodeLogDestination:
|
|
2
|
+
import { AstroLogger } from './core.js';
|
|
3
|
+
import { type AstroLogMessage, type AstroLoggerDestination } from './core.js';
|
|
4
|
+
export declare const nodeLogDestination: AstroLoggerDestination<AstroLogMessage>;
|
|
5
5
|
export declare function enableVerboseLogging(): void;
|
|
6
|
-
export declare function createNodeLogger(inlineConfig: AstroInlineConfig):
|
|
6
|
+
export declare function createNodeLogger(inlineConfig: AstroInlineConfig): AstroLogger;
|
package/dist/core/logger/node.js
CHANGED
|
@@ -1,19 +1,31 @@
|
|
|
1
1
|
import { createDebug, enable as obugEnable } from "obug";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { AstroLogger } from "./core.js";
|
|
3
|
+
import {
|
|
4
|
+
getEventPrefix,
|
|
5
|
+
levels
|
|
6
|
+
} from "./core.js";
|
|
4
7
|
const nodeLogDestination = {
|
|
5
8
|
write(event) {
|
|
6
9
|
let dest = process.stderr;
|
|
7
10
|
if (levels[event.level] < levels["error"]) {
|
|
8
11
|
dest = process.stdout;
|
|
9
12
|
}
|
|
13
|
+
let format = event._format ?? "default";
|
|
10
14
|
let trailingLine = event.newLine ? "\n" : "";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
switch (format) {
|
|
16
|
+
case "json": {
|
|
17
|
+
dest.write(JSON.stringify({ message: event.message, label: event.label }) + trailingLine);
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
case "default": {
|
|
21
|
+
if (event.label === "SKIP_FORMAT") {
|
|
22
|
+
dest.write(event.message + trailingLine);
|
|
23
|
+
} else {
|
|
24
|
+
dest.write(getEventPrefix(event) + " " + event.message + trailingLine);
|
|
25
|
+
}
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
15
28
|
}
|
|
16
|
-
return true;
|
|
17
29
|
}
|
|
18
30
|
};
|
|
19
31
|
const debuggers = {};
|
|
@@ -33,8 +45,8 @@ function enableVerboseLogging() {
|
|
|
33
45
|
}
|
|
34
46
|
function createNodeLogger(inlineConfig) {
|
|
35
47
|
if (inlineConfig.logger) return inlineConfig.logger;
|
|
36
|
-
return new
|
|
37
|
-
|
|
48
|
+
return new AstroLogger({
|
|
49
|
+
destination: nodeLogDestination,
|
|
38
50
|
level: inlineConfig.logLevel ?? "info"
|
|
39
51
|
});
|
|
40
52
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { LogLevel, Logger as ViteLogger } from 'vite';
|
|
2
|
-
import { type
|
|
2
|
+
import { type AstroLogger as AstroLogger } from './core.js';
|
|
3
3
|
export declare function createViteLogger(astroLogger: AstroLogger, viteLogLevel?: LogLevel): ViteLogger;
|
|
@@ -3,7 +3,7 @@ import type { $ZodError } from 'zod/v4/core';
|
|
|
3
3
|
import { type ErrorWithMetadata } from '../errors/index.js';
|
|
4
4
|
import type { AstroVersionProvider, TextStyler } from '../../cli/definitions.js';
|
|
5
5
|
import type { AstroConfig } from '../../types/public/index.js';
|
|
6
|
-
import type {
|
|
6
|
+
import type { AstroLogger } from '../logger/core.js';
|
|
7
7
|
/**
|
|
8
8
|
* Prestyled messages for the CLI. Used by astro CLI commands.
|
|
9
9
|
*/
|
|
@@ -60,4 +60,4 @@ export declare function printHelp({ commandName, headline, usage, tables, descri
|
|
|
60
60
|
tables?: Record<string, [command: string, help: string][]>;
|
|
61
61
|
description?: string;
|
|
62
62
|
}): void;
|
|
63
|
-
export declare function warnIfCspWithShiki(config: AstroConfig, logger:
|
|
63
|
+
export declare function warnIfCspWithShiki(config: AstroConfig, logger: AstroLogger): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type http from 'node:http';
|
|
2
2
|
import type { AstroSettings } from '../../types/astro.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { AstroLogger } from '../logger/core.js';
|
|
4
4
|
interface PreviewServer {
|
|
5
5
|
host?: string;
|
|
6
6
|
port: number;
|
|
@@ -8,5 +8,5 @@ interface PreviewServer {
|
|
|
8
8
|
closed(): Promise<void>;
|
|
9
9
|
stop(): Promise<void>;
|
|
10
10
|
}
|
|
11
|
-
export default function createStaticPreviewServer(settings: AstroSettings, logger:
|
|
11
|
+
export default function createStaticPreviewServer(settings: AstroSettings, logger: AstroLogger): Promise<PreviewServer>;
|
|
12
12
|
export {};
|
|
@@ -2,14 +2,14 @@ import type { ComponentInstance } from '../../types/astro.js';
|
|
|
2
2
|
import type { Params, Props } from '../../types/public/common.js';
|
|
3
3
|
import type { AstroConfig } from '../../types/public/index.js';
|
|
4
4
|
import type { RouteData } from '../../types/public/internal.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { AstroLogger } from '../logger/core.js';
|
|
6
6
|
import type { RouteCache } from './route-cache.js';
|
|
7
7
|
interface GetParamsAndPropsOptions {
|
|
8
8
|
mod: ComponentInstance | undefined;
|
|
9
9
|
routeData?: RouteData | undefined;
|
|
10
10
|
routeCache: RouteCache;
|
|
11
11
|
pathname: string;
|
|
12
|
-
logger:
|
|
12
|
+
logger: AstroLogger;
|
|
13
13
|
serverLike: boolean;
|
|
14
14
|
base: string;
|
|
15
15
|
trailingSlash: AstroConfig['trailingSlash'];
|
|
@@ -2,7 +2,7 @@ import type { ComponentInstance } from '../../types/astro.js';
|
|
|
2
2
|
import type { GetStaticPathsItem, GetStaticPathsResultKeyed, Params } from '../../types/public/common.js';
|
|
3
3
|
import type { AstroConfig, RuntimeMode } from '../../types/public/config.js';
|
|
4
4
|
import type { RouteData } from '../../types/public/internal.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { AstroLogger } from '../logger/core.js';
|
|
6
6
|
interface CallGetStaticPathsOptions {
|
|
7
7
|
mod: ComponentInstance | undefined;
|
|
8
8
|
route: RouteData;
|
|
@@ -24,12 +24,12 @@ export declare class RouteCache {
|
|
|
24
24
|
private logger;
|
|
25
25
|
private cache;
|
|
26
26
|
private runtimeMode;
|
|
27
|
-
constructor(logger:
|
|
27
|
+
constructor(logger: AstroLogger, runtimeMode?: RuntimeMode);
|
|
28
28
|
/** Clear the cache. */
|
|
29
29
|
clearAll(): void;
|
|
30
30
|
set(route: RouteData, entry: RouteCacheEntry): void;
|
|
31
31
|
get(route: RouteData): RouteCacheEntry | undefined;
|
|
32
32
|
key(route: RouteData): string;
|
|
33
33
|
}
|
|
34
|
-
export declare function findPathItemByKey(staticPaths: GetStaticPathsResultKeyed, params: Params, route: RouteData, logger:
|
|
34
|
+
export declare function findPathItemByKey(staticPaths: GetStaticPathsResultKeyed, params: Params, route: RouteData, logger: AstroLogger, trailingSlash: AstroConfig['trailingSlash']): GetStaticPathsItem | undefined;
|
|
35
35
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ComponentSlots } from '../../runtime/server/index.js';
|
|
2
2
|
import type { SSRResult } from '../../types/public/internal.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { AstroLogger } from '../logger/core.js';
|
|
4
4
|
export declare class Slots {
|
|
5
5
|
#private;
|
|
6
|
-
constructor(result: SSRResult, slots: ComponentSlots | null, logger:
|
|
6
|
+
constructor(result: SSRResult, slots: ComponentSlots | null, logger: AstroLogger);
|
|
7
7
|
has(name: string): boolean;
|
|
8
8
|
render(name: string, args?: any[]): Promise<any>;
|
|
9
9
|
}
|
package/dist/core/request.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IncomingHttpHeaders } from 'node:http';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLogger } from './logger/core.js';
|
|
3
3
|
type HeaderType = Headers | Record<string, any> | IncomingHttpHeaders;
|
|
4
4
|
interface CreateRequestOptions {
|
|
5
5
|
url: URL | string;
|
|
@@ -7,7 +7,7 @@ interface CreateRequestOptions {
|
|
|
7
7
|
headers: HeaderType;
|
|
8
8
|
method?: string;
|
|
9
9
|
body?: RequestInit['body'];
|
|
10
|
-
logger:
|
|
10
|
+
logger: AstroLogger;
|
|
11
11
|
locals?: object | undefined;
|
|
12
12
|
/**
|
|
13
13
|
* Whether the request is being created for a static build or for a prerendered page within a hybrid/SSR build, or for emulating one of those in dev mode.
|
|
@@ -2,7 +2,7 @@ import nodeFs from 'node:fs';
|
|
|
2
2
|
import type { AstroSettings, RoutesList } from '../../types/astro.js';
|
|
3
3
|
import type { AstroConfig } from '../../types/public/config.js';
|
|
4
4
|
import type { RouteData } from '../../types/public/internal.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { AstroLogger } from '../logger/core.js';
|
|
6
6
|
export interface RouteEntry {
|
|
7
7
|
path: string;
|
|
8
8
|
isDir: boolean;
|
|
@@ -16,11 +16,11 @@ interface CreateRouteManifestParams {
|
|
|
16
16
|
/** fs module, for testing */
|
|
17
17
|
fsMod?: typeof nodeFs;
|
|
18
18
|
}
|
|
19
|
-
export declare function createRoutesFromEntries(entries: RouteEntry[], settings: RoutingSettings, logger:
|
|
19
|
+
export declare function createRoutesFromEntries(entries: RouteEntry[], settings: RoutingSettings, logger: AstroLogger, pagesDirRelative?: string): RouteData[];
|
|
20
20
|
/**
|
|
21
21
|
* Create a full route manifest from filesystem and injected routes.
|
|
22
22
|
*/
|
|
23
|
-
export declare function createRoutesList(params: CreateRouteManifestParams, logger:
|
|
23
|
+
export declare function createRoutesList(params: CreateRouteManifestParams, logger: AstroLogger, { dev, }?: {
|
|
24
24
|
dev?: boolean;
|
|
25
25
|
}): Promise<RoutesList>;
|
|
26
26
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { AstroSettings } from '../../types/astro.js';
|
|
2
2
|
import type { RouteData } from '../../types/public/internal.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { AstroLogger } from '../logger/core.js';
|
|
4
4
|
/**
|
|
5
5
|
* Parses the `export const prerender = true|false` declaration from a route's
|
|
6
6
|
* source content. Returns `true`, `false`, or `undefined` if not present.
|
|
7
7
|
*/
|
|
8
8
|
export declare function parsePrerenderExport(content: string): boolean | undefined;
|
|
9
|
-
export declare function getRoutePrerenderOption(content: string, route: RouteData, settings: AstroSettings, logger:
|
|
9
|
+
export declare function getRoutePrerenderOption(content: string, route: RouteData, settings: AstroSettings, logger: AstroLogger): Promise<void>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RewritePayload } from '../../types/public/common.js';
|
|
2
2
|
import type { AstroConfig } from '../../types/public/config.js';
|
|
3
3
|
import type { RouteData } from '../../types/public/internal.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { AstroLogger } from '../logger/core.js';
|
|
5
5
|
type FindRouteToRewrite = {
|
|
6
6
|
payload: RewritePayload;
|
|
7
7
|
routes: RouteData[];
|
|
@@ -31,7 +31,7 @@ export declare function findRouteToRewrite({ payload, routes, request, trailingS
|
|
|
31
31
|
* @param logger
|
|
32
32
|
* @param routePattern
|
|
33
33
|
*/
|
|
34
|
-
export declare function copyRequest(newUrl: URL, oldRequest: Request, isPrerendered: boolean, logger:
|
|
34
|
+
export declare function copyRequest(newUrl: URL, oldRequest: Request, isPrerendered: boolean, logger: AstroLogger, routePattern: string): Request;
|
|
35
35
|
export declare function setOriginPathname(request: Request, pathname: string, trailingSlash: AstroConfig['trailingSlash'], buildFormat: AstroConfig['build']['format']): void;
|
|
36
36
|
export declare function getOriginPathname(request: Request): string;
|
|
37
37
|
/**
|
|
@@ -2,10 +2,10 @@ import fsMod from 'node:fs';
|
|
|
2
2
|
import { type FSWatcher } from 'vite';
|
|
3
3
|
import type { AstroSettings } from '../../types/astro.js';
|
|
4
4
|
import type { AstroInlineConfig } from '../../types/public/config.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { AstroLogger } from '../logger/core.js';
|
|
6
6
|
type SyncOptions = {
|
|
7
7
|
mode: string;
|
|
8
|
-
logger:
|
|
8
|
+
logger: AstroLogger;
|
|
9
9
|
settings: AstroSettings;
|
|
10
10
|
force?: boolean;
|
|
11
11
|
skip?: {
|
|
@@ -24,7 +24,7 @@ export default function sync(inlineConfig: AstroInlineConfig, { fs, telemetry: _
|
|
|
24
24
|
*/
|
|
25
25
|
export declare function clearContentLayerCache({ settings, logger, fs, isDev, }: {
|
|
26
26
|
settings: AstroSettings;
|
|
27
|
-
logger:
|
|
27
|
+
logger: AstroLogger;
|
|
28
28
|
fs?: typeof fsMod;
|
|
29
29
|
isDev: boolean;
|
|
30
30
|
}): Promise<void>;
|
package/dist/env/validators.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AstroConfig } from '../types/public/index.js';
|
|
2
2
|
import type { EnvFieldType } from './schema.js';
|
|
3
|
-
|
|
3
|
+
type ValidationResultValue = EnvFieldType['default'];
|
|
4
4
|
export type ValidationResultErrors = ['missing'] | ['type'] | Array<string>;
|
|
5
5
|
interface ValidationResultValid {
|
|
6
6
|
ok: true;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AstroLogger } from '../core/logger/core.js';
|
|
2
2
|
import type { AstroSettings } from '../types/astro.js';
|
|
3
3
|
import type { AdapterSupport, AdapterSupportsKind, AstroAdapterFeatureMap } from '../types/public/integrations.js';
|
|
4
4
|
export declare const AdapterFeatureStability: {
|
|
@@ -18,7 +18,7 @@ type ValidationResult = {
|
|
|
18
18
|
* will throw a runtime error.
|
|
19
19
|
*
|
|
20
20
|
*/
|
|
21
|
-
export declare function validateSupportedFeatures(adapterName: string, featureMap: AstroAdapterFeatureMap, settings: AstroSettings, logger:
|
|
21
|
+
export declare function validateSupportedFeatures(adapterName: string, featureMap: AstroAdapterFeatureMap, settings: AstroSettings, logger: AstroLogger): ValidationResult;
|
|
22
22
|
export declare function unwrapSupportKind(supportKind?: AdapterSupport): AdapterSupportsKind | undefined;
|
|
23
23
|
export declare function getSupportMessage(supportKind: AdapterSupport): string | undefined;
|
|
24
24
|
export declare function getAdapterStaticRecommendation(adapterName: string): string | undefined;
|