full site update

This commit is contained in:
2025-07-24 18:46:24 +02:00
parent bfe2b90d8d
commit 37a6e0ab31
6912 changed files with 540482 additions and 361712 deletions

View File

@@ -1,32 +1,30 @@
import { ActionsWithoutServerOutputError } from "../core/errors/errors-data.js";
import { AstroError } from "../core/errors/errors.js";
import { isServerLikeOutput, viteID } from "../core/util.js";
import { ACTIONS_TYPES_FILE, VIRTUAL_MODULE_ID } from "./consts.js";
import { ActionsWithoutServerOutputError } from "../core/errors/errors-data.js";
import { viteID } from "../core/util.js";
import { ACTION_RPC_ROUTE_PATTERN, ACTIONS_TYPES_FILE, VIRTUAL_MODULE_ID } from "./consts.js";
function astroIntegrationActionsRouteHandler({
settings
settings,
filename
}) {
return {
name: VIRTUAL_MODULE_ID,
hooks: {
async "astro:config:setup"(params) {
params.injectRoute({
pattern: "/_actions/[...path]",
async "astro:config:setup"() {
settings.injectedRoutes.push({
pattern: ACTION_RPC_ROUTE_PATTERN,
entrypoint: "astro/actions/runtime/route.js",
prerender: false
});
params.addMiddleware({
entrypoint: "astro/actions/runtime/middleware.js",
order: "post"
prerender: false,
origin: "internal"
});
},
"astro:config:done": async (params) => {
if (!isServerLikeOutput(params.config)) {
if (params.buildOutput === "static") {
const error = new AstroError(ActionsWithoutServerOutputError);
error.stack = void 0;
throw error;
}
const stringifiedActionsImport = JSON.stringify(
viteID(new URL("./actions", params.config.srcDir))
viteID(new URL(`./${filename}`, params.config.srcDir))
);
settings.injectedTypes.push({
filename: ACTIONS_TYPES_FILE,