astro 5.14.6 → 5.14.8
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/consts.d.ts +1 -0
- package/dist/actions/consts.js +2 -0
- package/dist/actions/runtime/server.js +10 -2
- package/dist/{virtual-modules/actions.d.ts → actions/runtime/virtual.d.ts} +1 -1
- package/dist/{virtual-modules/actions.js → actions/runtime/virtual.js} +1 -1
- package/dist/actions/vite-plugin-actions.js +5 -1
- package/dist/cli/create-key/core/create-key.d.ts +11 -2
- package/dist/cli/create-key/core/create-key.js +18 -8
- package/dist/cli/definitions.d.ts +20 -0
- package/dist/cli/definitions.js +0 -0
- package/dist/cli/domain/command.d.ts +8 -0
- package/dist/cli/domain/command.js +6 -0
- package/dist/cli/domain/help-payload.d.ts +7 -0
- package/dist/cli/domain/help-payload.js +0 -0
- package/dist/cli/help/index.d.ts +2 -0
- package/dist/cli/help/index.js +34 -0
- package/dist/cli/index.js +34 -44
- package/dist/cli/infra/build-time-astro-version-provider.d.ts +2 -0
- package/dist/cli/infra/build-time-astro-version-provider.js +10 -0
- package/dist/cli/infra/cli-command-runner.d.ts +6 -0
- package/dist/cli/infra/cli-command-runner.js +14 -0
- package/dist/cli/infra/kleur-text-styler.d.ts +2 -0
- package/dist/cli/infra/kleur-text-styler.js +7 -0
- package/dist/cli/infra/logger-help-display.d.ts +11 -0
- package/dist/cli/infra/logger-help-display.js +60 -0
- package/dist/content/content-layer.js +3 -3
- package/dist/content/utils.js +6 -2
- package/dist/core/build/plugins/plugin-css.js +3 -1
- package/dist/core/compile/compile.js +2 -0
- package/dist/core/constants.js +1 -1
- package/dist/core/cookies/cookies.js +7 -1
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/messages.d.ts +1 -0
- package/dist/core/messages.js +2 -2
- package/package.json +3 -3
package/dist/actions/consts.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const ACTIONS_TYPES_FILE = "actions.d.ts";
|
|
2
2
|
export declare const VIRTUAL_MODULE_ID = "astro:actions";
|
|
3
|
+
export declare const RESOLVED_VIRTUAL_MODULE_ID: string;
|
|
3
4
|
/** Used to expose shared utilities, with server or client specific implementations */
|
|
4
5
|
export declare const RUNTIME_VIRTUAL_MODULE_ID = "virtual:astro:actions/runtime";
|
|
5
6
|
export declare const RESOLVED_RUNTIME_VIRTUAL_MODULE_ID: string;
|
package/dist/actions/consts.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const ACTIONS_TYPES_FILE = "actions.d.ts";
|
|
2
2
|
const VIRTUAL_MODULE_ID = "astro:actions";
|
|
3
|
+
const RESOLVED_VIRTUAL_MODULE_ID = "\0" + VIRTUAL_MODULE_ID;
|
|
3
4
|
const RUNTIME_VIRTUAL_MODULE_ID = "virtual:astro:actions/runtime";
|
|
4
5
|
const RESOLVED_RUNTIME_VIRTUAL_MODULE_ID = "\0" + RUNTIME_VIRTUAL_MODULE_ID;
|
|
5
6
|
const ENTRYPOINT_VIRTUAL_MODULE_ID = "virtual:astro:actions/entrypoint";
|
|
@@ -22,6 +23,7 @@ export {
|
|
|
22
23
|
RESOLVED_NOOP_ENTRYPOINT_VIRTUAL_MODULE_ID,
|
|
23
24
|
RESOLVED_OPTIONS_VIRTUAL_MODULE_ID,
|
|
24
25
|
RESOLVED_RUNTIME_VIRTUAL_MODULE_ID,
|
|
26
|
+
RESOLVED_VIRTUAL_MODULE_ID,
|
|
25
27
|
RUNTIME_VIRTUAL_MODULE_ID,
|
|
26
28
|
VIRTUAL_MODULE_ID
|
|
27
29
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { shouldAppendForwardSlash } from "../../core/build/util.js";
|
|
3
3
|
import { AstroError } from "../../core/errors/errors.js";
|
|
4
|
-
import { ActionCalledFromServerError } from "../../core/errors/errors-data.js";
|
|
4
|
+
import { ActionCalledFromServerError, ActionNotFoundError } from "../../core/errors/errors-data.js";
|
|
5
5
|
import { removeTrailingForwardSlash } from "../../core/path.js";
|
|
6
6
|
import { apiContextRoutesSymbol } from "../../core/render-context.js";
|
|
7
7
|
import { ACTION_RPC_ROUTE_PATTERN } from "../consts.js";
|
|
@@ -150,7 +150,15 @@ function getActionContext(context) {
|
|
|
150
150
|
pipeline.manifest.trailingSlash,
|
|
151
151
|
pipeline.manifest.buildFormat
|
|
152
152
|
) ? removeTrailingForwardSlash(callerInfo.name) : callerInfo.name;
|
|
153
|
-
|
|
153
|
+
let baseAction;
|
|
154
|
+
try {
|
|
155
|
+
baseAction = await pipeline.getAction(callerInfoName);
|
|
156
|
+
} catch (error) {
|
|
157
|
+
if (error instanceof Error && "name" in error && typeof error.name === "string" && error.name === ActionNotFoundError.name) {
|
|
158
|
+
return { data: void 0, error: new ActionError({ code: "NOT_FOUND" }) };
|
|
159
|
+
}
|
|
160
|
+
throw error;
|
|
161
|
+
}
|
|
154
162
|
let input;
|
|
155
163
|
try {
|
|
156
164
|
input = await parseRequestBody(context.request);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ActionClient } from '
|
|
1
|
+
import type { ActionClient } from './server.js';
|
|
2
2
|
export * from 'virtual:astro:actions/runtime';
|
|
3
3
|
export declare function getActionPath(action: ActionClient<any, any, any>): string;
|
|
4
4
|
export declare const actions: Record<string | symbol, any>;
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
astroCalledServerError,
|
|
7
7
|
deserializeActionResult,
|
|
8
8
|
getActionQueryString
|
|
9
|
-
} from "
|
|
9
|
+
} from "./shared.js";
|
|
10
10
|
export * from "virtual:astro:actions/runtime";
|
|
11
11
|
const apiContextRoutesSymbol = Symbol.for("context.routes");
|
|
12
12
|
const ENCODED_DOT = "%2E";
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
RESOLVED_NOOP_ENTRYPOINT_VIRTUAL_MODULE_ID,
|
|
9
9
|
RESOLVED_OPTIONS_VIRTUAL_MODULE_ID,
|
|
10
10
|
RESOLVED_RUNTIME_VIRTUAL_MODULE_ID,
|
|
11
|
+
RESOLVED_VIRTUAL_MODULE_ID,
|
|
11
12
|
RUNTIME_VIRTUAL_MODULE_ID,
|
|
12
13
|
VIRTUAL_MODULE_ID
|
|
13
14
|
} from "./consts.js";
|
|
@@ -38,7 +39,7 @@ function vitePluginActions({
|
|
|
38
39
|
enforce: "pre",
|
|
39
40
|
async resolveId(id) {
|
|
40
41
|
if (id === VIRTUAL_MODULE_ID) {
|
|
41
|
-
return
|
|
42
|
+
return RESOLVED_VIRTUAL_MODULE_ID;
|
|
42
43
|
}
|
|
43
44
|
if (id === RUNTIME_VIRTUAL_MODULE_ID) {
|
|
44
45
|
return RESOLVED_RUNTIME_VIRTUAL_MODULE_ID;
|
|
@@ -69,6 +70,9 @@ function vitePluginActions({
|
|
|
69
70
|
server.watcher.on("change", watcherCallback);
|
|
70
71
|
},
|
|
71
72
|
async load(id, opts) {
|
|
73
|
+
if (id === RESOLVED_VIRTUAL_MODULE_ID) {
|
|
74
|
+
return { code: `export * from 'astro/actions/runtime/virtual.js';` };
|
|
75
|
+
}
|
|
72
76
|
if (id === RESOLVED_NOOP_ENTRYPOINT_VIRTUAL_MODULE_ID) {
|
|
73
77
|
return { code: "export const server = {}" };
|
|
74
78
|
}
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import type { Logger } from '../../../core/logger/core.js';
|
|
2
2
|
import type { KeyGenerator } from '../definitions.js';
|
|
3
|
-
interface
|
|
3
|
+
interface Options {
|
|
4
4
|
logger: Logger;
|
|
5
5
|
keyGenerator: KeyGenerator;
|
|
6
6
|
}
|
|
7
|
-
export declare
|
|
7
|
+
export declare const createKeyCommand: {
|
|
8
|
+
help: {
|
|
9
|
+
commandName: string;
|
|
10
|
+
tables: {
|
|
11
|
+
Flags: [string, string][];
|
|
12
|
+
};
|
|
13
|
+
description: string;
|
|
14
|
+
};
|
|
15
|
+
run({ logger, keyGenerator }: Options): Promise<void>;
|
|
16
|
+
};
|
|
8
17
|
export {};
|
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
"
|
|
5
|
-
|
|
1
|
+
import { defineCommand } from "../../domain/command.js";
|
|
2
|
+
const createKeyCommand = defineCommand({
|
|
3
|
+
help: {
|
|
4
|
+
commandName: "astro create-key",
|
|
5
|
+
tables: {
|
|
6
|
+
Flags: [["--help (-h)", "See all available flags."]]
|
|
7
|
+
},
|
|
8
|
+
description: "Generates a key to encrypt props passed to server islands."
|
|
9
|
+
},
|
|
10
|
+
async run({ logger, keyGenerator }) {
|
|
11
|
+
const key = await keyGenerator.generate();
|
|
12
|
+
logger.info(
|
|
13
|
+
"crypto",
|
|
14
|
+
`Generated a key to encrypt props passed to server islands. To reuse the same key across builds, set this value as ASTRO_KEY in an environment variable on your build server.
|
|
6
15
|
|
|
7
16
|
ASTRO_KEY=${key}`
|
|
8
|
-
|
|
9
|
-
}
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
10
20
|
export {
|
|
11
|
-
|
|
21
|
+
createKeyCommand
|
|
12
22
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AnyCommand } from './domain/command.js';
|
|
2
|
+
import type { HelpPayload } from './domain/help-payload.js';
|
|
3
|
+
export interface HelpDisplay {
|
|
4
|
+
shouldFire: () => boolean;
|
|
5
|
+
show: (payload: HelpPayload) => void;
|
|
6
|
+
}
|
|
7
|
+
export interface TextStyler {
|
|
8
|
+
bgWhite: (msg: string) => string;
|
|
9
|
+
black: (msg: string) => string;
|
|
10
|
+
dim: (msg: string) => string;
|
|
11
|
+
green: (msg: string) => string;
|
|
12
|
+
bold: (msg: string) => string;
|
|
13
|
+
bgGreen: (msg: string) => string;
|
|
14
|
+
}
|
|
15
|
+
export interface AstroVersionProvider {
|
|
16
|
+
getVersion: () => string;
|
|
17
|
+
}
|
|
18
|
+
export interface CommandRunner {
|
|
19
|
+
run: <T extends AnyCommand>(command: T, ...args: Parameters<T['run']>) => ReturnType<T['run']>;
|
|
20
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HelpPayload } from './help-payload.js';
|
|
2
|
+
interface Command<T extends (...args: Array<any>) => any> {
|
|
3
|
+
help: HelpPayload;
|
|
4
|
+
run: T;
|
|
5
|
+
}
|
|
6
|
+
export type AnyCommand = Command<(...args: Array<any>) => any>;
|
|
7
|
+
export declare function defineCommand<T extends AnyCommand>(command: T): T;
|
|
8
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const DEFAULT_HELP_PAYLOAD = {
|
|
2
|
+
commandName: "astro",
|
|
3
|
+
usage: "[command] [...flags]",
|
|
4
|
+
headline: "Build faster websites.",
|
|
5
|
+
tables: {
|
|
6
|
+
Commands: [
|
|
7
|
+
["add", "Add an integration."],
|
|
8
|
+
["build", "Build your project and write it to disk."],
|
|
9
|
+
["check", "Check your project for errors."],
|
|
10
|
+
["create-key", "Create a cryptography key"],
|
|
11
|
+
["db", "Manage your Astro database."],
|
|
12
|
+
["dev", "Start the development server."],
|
|
13
|
+
["docs", "Open documentation in your web browser."],
|
|
14
|
+
["info", "List info about your current Astro setup."],
|
|
15
|
+
["preview", "Preview your build locally."],
|
|
16
|
+
["sync", "Generate content collection types."],
|
|
17
|
+
["preferences", "Configure user preferences."],
|
|
18
|
+
["telemetry", "Configure telemetry settings."]
|
|
19
|
+
],
|
|
20
|
+
"Global Flags": [
|
|
21
|
+
["--config <path>", "Specify your config file."],
|
|
22
|
+
["--root <path>", "Specify your project root folder."],
|
|
23
|
+
["--site <url>", "Specify your project site."],
|
|
24
|
+
["--base <pathname>", "Specify your project base."],
|
|
25
|
+
["--verbose", "Enable verbose logging."],
|
|
26
|
+
["--silent", "Disable all logging."],
|
|
27
|
+
["--version", "Show the version number and exit."],
|
|
28
|
+
["--help", "Show this help message."]
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
DEFAULT_HELP_PAYLOAD
|
|
34
|
+
};
|
package/dist/cli/index.js
CHANGED
|
@@ -1,40 +1,6 @@
|
|
|
1
1
|
import * as colors from "kleur/colors";
|
|
2
2
|
import yargs from "yargs-parser";
|
|
3
3
|
import { ASTRO_VERSION } from "../core/constants.js";
|
|
4
|
-
async function printAstroHelp() {
|
|
5
|
-
const { printHelp } = await import("../core/messages.js");
|
|
6
|
-
printHelp({
|
|
7
|
-
commandName: "astro",
|
|
8
|
-
usage: "[command] [...flags]",
|
|
9
|
-
headline: "Build faster websites.",
|
|
10
|
-
tables: {
|
|
11
|
-
Commands: [
|
|
12
|
-
["add", "Add an integration."],
|
|
13
|
-
["build", "Build your project and write it to disk."],
|
|
14
|
-
["check", "Check your project for errors."],
|
|
15
|
-
["create-key", "Create a cryptography key"],
|
|
16
|
-
["db", "Manage your Astro database."],
|
|
17
|
-
["dev", "Start the development server."],
|
|
18
|
-
["docs", "Open documentation in your web browser."],
|
|
19
|
-
["info", "List info about your current Astro setup."],
|
|
20
|
-
["preview", "Preview your build locally."],
|
|
21
|
-
["sync", "Generate content collection types."],
|
|
22
|
-
["preferences", "Configure user preferences."],
|
|
23
|
-
["telemetry", "Configure telemetry settings."]
|
|
24
|
-
],
|
|
25
|
-
"Global Flags": [
|
|
26
|
-
["--config <path>", "Specify your config file."],
|
|
27
|
-
["--root <path>", "Specify your project root folder."],
|
|
28
|
-
["--site <url>", "Specify your project site."],
|
|
29
|
-
["--base <pathname>", "Specify your project base."],
|
|
30
|
-
["--verbose", "Enable verbose logging."],
|
|
31
|
-
["--silent", "Disable all logging."],
|
|
32
|
-
["--version", "Show the version number and exit."],
|
|
33
|
-
["--help", "Show this help message."]
|
|
34
|
-
]
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
4
|
function printVersion() {
|
|
39
5
|
console.log();
|
|
40
6
|
console.log(` ${colors.bgGreen(colors.black(` astro `))} ${colors.green(`v${ASTRO_VERSION}`)}`);
|
|
@@ -66,28 +32,52 @@ function resolveCommand(flags) {
|
|
|
66
32
|
return "help";
|
|
67
33
|
}
|
|
68
34
|
async function runCommand(cmd, flags) {
|
|
35
|
+
const [
|
|
36
|
+
{ createLoggerFromFlags },
|
|
37
|
+
{ createKleurTextStyler },
|
|
38
|
+
{ createBuildTimeAstroVersionProvider },
|
|
39
|
+
{ createLoggerHelpDisplay },
|
|
40
|
+
{ createCliCommandRunner }
|
|
41
|
+
] = await Promise.all([
|
|
42
|
+
import("./flags.js"),
|
|
43
|
+
import("./infra/kleur-text-styler.js"),
|
|
44
|
+
import("./infra/build-time-astro-version-provider.js"),
|
|
45
|
+
import("./infra/logger-help-display.js"),
|
|
46
|
+
import("./infra/cli-command-runner.js")
|
|
47
|
+
]);
|
|
48
|
+
const logger = createLoggerFromFlags(flags);
|
|
49
|
+
const textStyler = createKleurTextStyler();
|
|
50
|
+
const astroVersionProvider = createBuildTimeAstroVersionProvider();
|
|
51
|
+
const helpDisplay = createLoggerHelpDisplay({
|
|
52
|
+
logger,
|
|
53
|
+
flags,
|
|
54
|
+
textStyler,
|
|
55
|
+
astroVersionProvider
|
|
56
|
+
});
|
|
57
|
+
const runner = createCliCommandRunner({ helpDisplay });
|
|
69
58
|
switch (cmd) {
|
|
70
|
-
|
|
71
|
-
|
|
59
|
+
/** Display --help flag */
|
|
60
|
+
case "help": {
|
|
61
|
+
const { DEFAULT_HELP_PAYLOAD } = await import("./help/index.js");
|
|
62
|
+
helpDisplay.show(DEFAULT_HELP_PAYLOAD);
|
|
72
63
|
return;
|
|
73
|
-
|
|
64
|
+
}
|
|
65
|
+
case "version": {
|
|
74
66
|
printVersion();
|
|
75
67
|
return;
|
|
68
|
+
}
|
|
76
69
|
case "info": {
|
|
77
70
|
const { printInfo } = await import("./info/index.js");
|
|
78
71
|
await printInfo({ flags });
|
|
79
72
|
return;
|
|
80
73
|
}
|
|
81
74
|
case "create-key": {
|
|
82
|
-
const [{
|
|
83
|
-
import("./create-key/
|
|
84
|
-
import("./
|
|
85
|
-
import("./create-key/infra/crypto-key-generator.js")
|
|
75
|
+
const [{ createCryptoKeyGenerator }, { createKeyCommand }] = await Promise.all([
|
|
76
|
+
import("./create-key/infra/crypto-key-generator.js"),
|
|
77
|
+
import("./create-key/core/create-key.js")
|
|
86
78
|
]);
|
|
87
|
-
const logger = createLoggerFromFlags(flags);
|
|
88
79
|
const keyGenerator = createCryptoKeyGenerator();
|
|
89
|
-
await
|
|
90
|
-
return;
|
|
80
|
+
return await runner.run(createKeyCommand, { logger, keyGenerator });
|
|
91
81
|
}
|
|
92
82
|
case "docs": {
|
|
93
83
|
const { docs } = await import("./docs/index.js");
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function createCliCommandRunner({ helpDisplay }) {
|
|
2
|
+
return {
|
|
3
|
+
run(command, ...args) {
|
|
4
|
+
if (helpDisplay.shouldFire()) {
|
|
5
|
+
helpDisplay.show(command.help);
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
return command.run(...args);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
createCliCommandRunner
|
|
14
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Logger } from '../../core/logger/core.js';
|
|
2
|
+
import type { AstroVersionProvider, HelpDisplay, TextStyler } from '../definitions.js';
|
|
3
|
+
import type { Flags } from '../flags.js';
|
|
4
|
+
interface Options {
|
|
5
|
+
logger: Logger;
|
|
6
|
+
textStyler: TextStyler;
|
|
7
|
+
astroVersionProvider: AstroVersionProvider;
|
|
8
|
+
flags: Flags;
|
|
9
|
+
}
|
|
10
|
+
export declare function createLoggerHelpDisplay({ logger, flags, textStyler, astroVersionProvider, }: Options): HelpDisplay;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
function createLoggerHelpDisplay({
|
|
2
|
+
logger,
|
|
3
|
+
flags,
|
|
4
|
+
textStyler,
|
|
5
|
+
astroVersionProvider
|
|
6
|
+
}) {
|
|
7
|
+
return {
|
|
8
|
+
shouldFire() {
|
|
9
|
+
return !!(flags.help || flags.h);
|
|
10
|
+
},
|
|
11
|
+
show({ commandName, description, headline, tables, usage }) {
|
|
12
|
+
const linebreak = () => "";
|
|
13
|
+
const title = (label) => ` ${textStyler.bgWhite(textStyler.black(` ${label} `))}`;
|
|
14
|
+
const table = (rows, { padding }) => {
|
|
15
|
+
const split = process.stdout.columns < 60;
|
|
16
|
+
let raw = "";
|
|
17
|
+
for (const row of rows) {
|
|
18
|
+
if (split) {
|
|
19
|
+
raw += ` ${row[0]}
|
|
20
|
+
`;
|
|
21
|
+
} else {
|
|
22
|
+
raw += `${`${row[0]}`.padStart(padding)}`;
|
|
23
|
+
}
|
|
24
|
+
raw += " " + textStyler.dim(row[1]) + "\n";
|
|
25
|
+
}
|
|
26
|
+
return raw.slice(0, -1);
|
|
27
|
+
};
|
|
28
|
+
let message = [];
|
|
29
|
+
if (headline) {
|
|
30
|
+
message.push(
|
|
31
|
+
linebreak(),
|
|
32
|
+
` ${textStyler.bgGreen(textStyler.black(` ${commandName} `))} ${textStyler.green(
|
|
33
|
+
`v${astroVersionProvider.getVersion()}`
|
|
34
|
+
)} ${headline}`
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
if (usage) {
|
|
38
|
+
message.push(linebreak(), ` ${textStyler.green(commandName)} ${textStyler.bold(usage)}`);
|
|
39
|
+
}
|
|
40
|
+
if (tables) {
|
|
41
|
+
let calculateTablePadding2 = function(rows) {
|
|
42
|
+
return rows.reduce((val, [first]) => Math.max(val, first.length), 0) + 2;
|
|
43
|
+
};
|
|
44
|
+
var calculateTablePadding = calculateTablePadding2;
|
|
45
|
+
const tableEntries = Object.entries(tables);
|
|
46
|
+
const padding = Math.max(...tableEntries.map(([, rows]) => calculateTablePadding2(rows)));
|
|
47
|
+
for (const [tableTitle, tableRows] of tableEntries) {
|
|
48
|
+
message.push(linebreak(), title(tableTitle), table(tableRows, { padding }));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (description) {
|
|
52
|
+
message.push(linebreak(), `${description}`);
|
|
53
|
+
}
|
|
54
|
+
logger.info("SKIP_FORMAT", message.join("\n") + "\n");
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
createLoggerHelpDisplay
|
|
60
|
+
};
|
|
@@ -164,7 +164,7 @@ ${contentConfig.error.message}`);
|
|
|
164
164
|
logger.info("Content config changed");
|
|
165
165
|
shouldClear = true;
|
|
166
166
|
}
|
|
167
|
-
if (previousAstroVersion && previousAstroVersion !== "5.14.
|
|
167
|
+
if (previousAstroVersion && previousAstroVersion !== "5.14.8") {
|
|
168
168
|
logger.info("Astro version changed");
|
|
169
169
|
shouldClear = true;
|
|
170
170
|
}
|
|
@@ -172,8 +172,8 @@ ${contentConfig.error.message}`);
|
|
|
172
172
|
logger.info("Clearing content store");
|
|
173
173
|
this.#store.clearAll();
|
|
174
174
|
}
|
|
175
|
-
if ("5.14.
|
|
176
|
-
await this.#store.metaStore().set("astro-version", "5.14.
|
|
175
|
+
if ("5.14.8") {
|
|
176
|
+
await this.#store.metaStore().set("astro-version", "5.14.8");
|
|
177
177
|
}
|
|
178
178
|
if (currentConfigDigest) {
|
|
179
179
|
await this.#store.metaStore().set("content-config-digest", currentConfigDigest);
|
package/dist/content/utils.js
CHANGED
|
@@ -127,8 +127,12 @@ async function getEntryDataAndImages(entry, collectionConfig, shouldEmitFile, ex
|
|
|
127
127
|
} else if (collectionConfig.type === CONTENT_LAYER_TYPE) {
|
|
128
128
|
schema = schema({
|
|
129
129
|
image: () => z.string().transform((val) => {
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
let normalizedPath = val;
|
|
131
|
+
if (val && !val.startsWith("./") && !val.startsWith("../") && !val.startsWith("/") && !val.startsWith("~") && !val.startsWith("@") && !val.includes("://")) {
|
|
132
|
+
normalizedPath = `./${val}`;
|
|
133
|
+
}
|
|
134
|
+
imageImports.add(normalizedPath);
|
|
135
|
+
return `${IMAGE_IMPORT_PREFIX}${normalizedPath}`;
|
|
132
136
|
})
|
|
133
137
|
});
|
|
134
138
|
}
|
|
@@ -151,7 +151,9 @@ function rollupPluginAstroBuildCSS(options) {
|
|
|
151
151
|
propagatedStyles.add(sheet);
|
|
152
152
|
sheetAddedToPage = true;
|
|
153
153
|
}
|
|
154
|
-
|
|
154
|
+
const wasInlined = toBeInlined && sheetAddedToPage;
|
|
155
|
+
const isOrphaned = !sheetAddedToPage;
|
|
156
|
+
if (wasInlined || isOrphaned) {
|
|
155
157
|
delete bundle[id];
|
|
156
158
|
for (const chunk of Object.values(bundle)) {
|
|
157
159
|
if (chunk.type === "chunk") {
|
|
@@ -21,6 +21,8 @@ async function compile({
|
|
|
21
21
|
normalizedFilename: normalizeFilename(filename, astroConfig.root),
|
|
22
22
|
sourcemap: "both",
|
|
23
23
|
internalURL: "astro/compiler-runtime",
|
|
24
|
+
// TODO: remove in Astro v7
|
|
25
|
+
astroGlobalArgs: JSON.stringify(astroConfig.site),
|
|
24
26
|
scopedStyleStrategy: astroConfig.scopedStyleStrategy,
|
|
25
27
|
resultScopedSlot: true,
|
|
26
28
|
transitionsAnimationURL: "astro/components/viewtransitions.css",
|
package/dist/core/constants.js
CHANGED
|
@@ -79,7 +79,13 @@ class AstroCookies {
|
|
|
79
79
|
if (key in values) {
|
|
80
80
|
const value = values[key];
|
|
81
81
|
if (value) {
|
|
82
|
-
|
|
82
|
+
let decodedValue;
|
|
83
|
+
try {
|
|
84
|
+
decodedValue = decode(value);
|
|
85
|
+
} catch (_error) {
|
|
86
|
+
decodedValue = value;
|
|
87
|
+
}
|
|
88
|
+
return new AstroCookie(decodedValue);
|
|
83
89
|
}
|
|
84
90
|
}
|
|
85
91
|
}
|
package/dist/core/dev/dev.js
CHANGED
|
@@ -22,7 +22,7 @@ async function dev(inlineConfig) {
|
|
|
22
22
|
await telemetry.record([]);
|
|
23
23
|
const restart = await createContainerWithAutomaticRestart({ inlineConfig, fs });
|
|
24
24
|
const logger = restart.container.logger;
|
|
25
|
-
const currentVersion = "5.14.
|
|
25
|
+
const currentVersion = "5.14.8";
|
|
26
26
|
const isPrerelease = currentVersion.includes("-");
|
|
27
27
|
if (!isPrerelease) {
|
|
28
28
|
try {
|
package/dist/core/messages.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ export declare function actionRequired(message: string): string;
|
|
|
47
47
|
export declare function cancelled(message: string, tip?: string): string;
|
|
48
48
|
export declare function formatConfigErrorMessage(err: ZodError): string;
|
|
49
49
|
export declare function formatErrorMessage(err: ErrorWithMetadata, showFullStacktrace: boolean): string;
|
|
50
|
+
/** @deprecated Migrate to HelpDisplay */
|
|
50
51
|
export declare function printHelp({ commandName, headline, usage, tables, description, }: {
|
|
51
52
|
commandName: string;
|
|
52
53
|
headline?: string;
|
package/dist/core/messages.js
CHANGED
|
@@ -37,7 +37,7 @@ function serverStart({
|
|
|
37
37
|
host,
|
|
38
38
|
base
|
|
39
39
|
}) {
|
|
40
|
-
const version = "5.14.
|
|
40
|
+
const version = "5.14.8";
|
|
41
41
|
const localPrefix = `${dim("\u2503")} Local `;
|
|
42
42
|
const networkPrefix = `${dim("\u2503")} Network `;
|
|
43
43
|
const emptyPrefix = " ".repeat(11);
|
|
@@ -274,7 +274,7 @@ function printHelp({
|
|
|
274
274
|
message.push(
|
|
275
275
|
linebreak(),
|
|
276
276
|
` ${bgGreen(black(` ${commandName} `))} ${green(
|
|
277
|
-
`v${"5.14.
|
|
277
|
+
`v${"5.14.8"}`
|
|
278
278
|
)} ${headline}`
|
|
279
279
|
);
|
|
280
280
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro",
|
|
3
|
-
"version": "5.14.
|
|
3
|
+
"version": "5.14.8",
|
|
4
4
|
"description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "withastro",
|
|
@@ -149,9 +149,9 @@
|
|
|
149
149
|
"zod": "^3.25.76",
|
|
150
150
|
"zod-to-json-schema": "^3.24.6",
|
|
151
151
|
"zod-to-ts": "^1.2.0",
|
|
152
|
+
"@astrojs/internal-helpers": "0.7.4",
|
|
152
153
|
"@astrojs/markdown-remark": "6.3.8",
|
|
153
|
-
"@astrojs/telemetry": "3.3.0"
|
|
154
|
-
"@astrojs/internal-helpers": "0.7.4"
|
|
154
|
+
"@astrojs/telemetry": "3.3.0"
|
|
155
155
|
},
|
|
156
156
|
"optionalDependencies": {
|
|
157
157
|
"sharp": "^0.34.0"
|