feat: execute route and release recovery contracts

This commit is contained in:
donghyeon-ka
2026-07-26 14:26:39 +09:00
parent a33e93d4d4
commit ce0040e407
49 changed files with 1761 additions and 373 deletions
+59
View File
@@ -0,0 +1,59 @@
{
"schemaVersion": 1,
"sourceDirectories": [],
"registries": [
{
"registryId": "ROUTES",
"path": "tests/fixtures/registry/routes/invalid-routes.js",
"exportName": "INVALID_ROUTES",
"owner": "fixture",
"requiredFields": [
"routeId",
"path",
"paramsSchema",
"searchSchema",
"loadingSurface",
"errorSurface",
"chunkId"
],
"uniqueFields": ["routeId", "path", "chunkId"],
"allowedValues": {
"paramsSchema": [null],
"searchSchema": [null],
"loadingSurface": ["app-shell"],
"errorSurface": ["route-boundary"],
"chunkId": ["route-home"]
},
"references": [
{
"field": "routeId",
"registryId": "RUNTIME",
"targetField": "routeId"
}
]
},
{
"registryId": "RUNTIME",
"path": "tests/fixtures/registry/routes/invalid-routes.js",
"exportName": "INVALID_RUNTIME",
"owner": "fixture",
"requiredFields": ["routeId", "moduleId", "paramsCodec", "searchCodec"],
"allowedValues": {
"moduleId": ["home-page"],
"paramsCodec": ["none"],
"searchCodec": ["none"]
},
"references": [
{
"field": "routeId",
"registryId": "ROUTES",
"targetField": "routeId"
}
]
}
],
"compatibilityImpact": {
"allowed": ["none", "additive", "behavior-change", "breaking"],
"current": "breaking"
}
}
+29
View File
@@ -0,0 +1,29 @@
export const INVALID_ROUTES = {
FIRST: {
routeId: "DUPLICATE",
path: "/duplicate",
paramsSchema: "UnknownParams",
searchSchema: "UnknownSearch",
loadingSurface: "unknown-loading",
errorSurface: "unknown-error",
chunkId: "unknown-chunk",
},
SECOND: {
routeId: "DUPLICATE",
path: "/duplicate",
paramsSchema: null,
searchSchema: null,
loadingSurface: "app-shell",
errorSurface: "route-boundary",
chunkId: "route-home",
},
};
export const INVALID_RUNTIME = {
ORPHAN: {
routeId: "ORPHAN",
moduleId: "unknown-module",
paramsCodec: "none",
searchCodec: "none",
},
};
+14
View File
@@ -0,0 +1,14 @@
import { ROUTE_RUNTIME_CONTRACT } from "../../../src/contracts/route-runtime-contract.js";
type RouteId = keyof typeof ROUTE_RUNTIME_CONTRACT;
export const missingRuntime = {
APP_HOME: true,
} satisfies Record<RouteId, boolean>;
export const orphanRuntime = {
...Object.fromEntries(
Object.keys(ROUTE_RUNTIME_CONTRACT).map((routeId) => [routeId, true]),
),
ORPHAN_ROUTE: true,
} satisfies Record<RouteId, boolean>;