Refactor routing in App component to enhance navigation and improve error handling by integrating dynamic routes and updating the NotFound route.

This commit is contained in:
becarta
2025-05-23 12:43:00 +02:00
parent f40db0f5c9
commit a544759a3b
11127 changed files with 1647032 additions and 0 deletions

45
node_modules/astro/dist/actions/integration.js generated vendored Normal file
View File

@@ -0,0 +1,45 @@
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";
function astroIntegrationActionsRouteHandler({
settings
}) {
return {
name: VIRTUAL_MODULE_ID,
hooks: {
async "astro:config:setup"(params) {
params.injectRoute({
pattern: "/_actions/[...path]",
entrypoint: "astro/actions/runtime/route.js",
prerender: false
});
params.addMiddleware({
entrypoint: "astro/actions/runtime/middleware.js",
order: "post"
});
},
"astro:config:done": async (params) => {
if (!isServerLikeOutput(params.config)) {
const error = new AstroError(ActionsWithoutServerOutputError);
error.stack = void 0;
throw error;
}
const stringifiedActionsImport = JSON.stringify(
viteID(new URL("./actions", params.config.srcDir))
);
settings.injectedTypes.push({
filename: ACTIONS_TYPES_FILE,
content: `declare module "astro:actions" {
type Actions = typeof import(${stringifiedActionsImport})["server"];
export const actions: Actions;
}`
});
}
}
};
}
export {
astroIntegrationActionsRouteHandler as default
};