feat: execute route and release recovery contracts
This commit is contained in:
+59
@@ -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"
|
||||
}
|
||||
}
|
||||
@@ -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",
|
||||
},
|
||||
};
|
||||
@@ -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>;
|
||||
Reference in New Issue
Block a user