deploy: v0.12 fix 存档key名

This commit is contained in:
2026-06-24 03:09:02 +00:00
parent 7a08d49fe3
commit e0a5281119
58743 changed files with 7297269 additions and 39505 deletions
@@ -0,0 +1,19 @@
import type { DynamicPrerenderManifestRoute, PrerenderManifest } from '../../../../build';
import type { DeepReadonly } from '../../../../shared/lib/deep-readonly';
/**
* A matcher for the prerender manifest.
*
* This class is used to match the pathname to the dynamic route.
*/
export declare class PrerenderManifestMatcher {
private readonly matchers;
constructor(pathname: string, prerenderManifest: DeepReadonly<PrerenderManifest>);
/**
* Match the pathname to the dynamic route. If no match is found, an error is
* thrown.
*
* @param pathname - The pathname to match.
* @returns The dynamic route that matches the pathname.
*/
match(pathname: string): DeepReadonly<DynamicPrerenderManifestRoute> | null;
}
@@ -0,0 +1,48 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "PrerenderManifestMatcher", {
enumerable: true,
get: function() {
return PrerenderManifestMatcher;
}
});
const _routematcher = require("../../../../shared/lib/router/utils/route-matcher");
const _routeregex = require("../../../../shared/lib/router/utils/route-regex");
class PrerenderManifestMatcher {
constructor(pathname, prerenderManifest){
this.matchers = Object.entries(prerenderManifest.dynamicRoutes).filter(([source, route])=>{
// If the pathname is a fallback source route, or the source route is
// the same as the pathname, then we should include it in the matchers.
return route.fallbackSourceRoute === pathname || source === pathname;
}).map(([source, route])=>({
source,
route
}));
}
/**
* Match the pathname to the dynamic route. If no match is found, an error is
* thrown.
*
* @param pathname - The pathname to match.
* @returns The dynamic route that matches the pathname.
*/ match(pathname) {
// Iterate over the matchers. They're already in the correct order of
// specificity as they were inserted into the prerender manifest that way
// and iterating over them with Object.entries guarantees that.
for (const matcher of this.matchers){
// Lazily create the matcher, this is only done once per matcher.
if (!matcher.matcher) {
matcher.matcher = (0, _routematcher.getRouteMatcher)((0, _routeregex.getRouteRegex)(matcher.source));
}
const match = matcher.matcher(pathname);
if (match) {
return matcher.route;
}
}
return null;
}
}
//# sourceMappingURL=prerender-manifest-matcher.js.map
@@ -0,0 +1 @@
{"version":3,"sources":["../../../../../src/server/route-modules/app-page/helpers/prerender-manifest-matcher.ts"],"sourcesContent":["import type {\n DynamicPrerenderManifestRoute,\n PrerenderManifest,\n} from '../../../../build'\nimport type { DeepReadonly } from '../../../../shared/lib/deep-readonly'\nimport {\n getRouteMatcher,\n type RouteMatchFn,\n} from '../../../../shared/lib/router/utils/route-matcher'\nimport { getRouteRegex } from '../../../../shared/lib/router/utils/route-regex'\n\n/**\n * A matcher for a dynamic route.\n */\ntype Matcher = {\n /**\n * The matcher for the dynamic route. This is lazily created when the matcher\n * is first used.\n */\n matcher?: RouteMatchFn\n\n /**\n * The source of the dynamic route.\n */\n source: string\n\n /**\n * The route that matches the source.\n */\n route: DeepReadonly<DynamicPrerenderManifestRoute>\n}\n\n/**\n * A matcher for the prerender manifest.\n *\n * This class is used to match the pathname to the dynamic route.\n */\nexport class PrerenderManifestMatcher {\n private readonly matchers: Array<Matcher>\n constructor(\n pathname: string,\n prerenderManifest: DeepReadonly<PrerenderManifest>\n ) {\n this.matchers = Object.entries(prerenderManifest.dynamicRoutes)\n .filter(([source, route]) => {\n // If the pathname is a fallback source route, or the source route is\n // the same as the pathname, then we should include it in the matchers.\n return route.fallbackSourceRoute === pathname || source === pathname\n })\n .map(([source, route]) => ({ source, route }))\n }\n\n /**\n * Match the pathname to the dynamic route. If no match is found, an error is\n * thrown.\n *\n * @param pathname - The pathname to match.\n * @returns The dynamic route that matches the pathname.\n */\n public match(\n pathname: string\n ): DeepReadonly<DynamicPrerenderManifestRoute> | null {\n // Iterate over the matchers. They're already in the correct order of\n // specificity as they were inserted into the prerender manifest that way\n // and iterating over them with Object.entries guarantees that.\n for (const matcher of this.matchers) {\n // Lazily create the matcher, this is only done once per matcher.\n if (!matcher.matcher) {\n matcher.matcher = getRouteMatcher(getRouteRegex(matcher.source))\n }\n\n const match = matcher.matcher(pathname)\n if (match) {\n return matcher.route\n }\n }\n\n return null\n }\n}\n"],"names":["PrerenderManifestMatcher","constructor","pathname","prerenderManifest","matchers","Object","entries","dynamicRoutes","filter","source","route","fallbackSourceRoute","map","match","matcher","getRouteMatcher","getRouteRegex"],"mappings":";;;;+BAqCaA;;;eAAAA;;;8BA7BN;4BACuB;AA4BvB,MAAMA;IAEXC,YACEC,QAAgB,EAChBC,iBAAkD,CAClD;QACA,IAAI,CAACC,QAAQ,GAAGC,OAAOC,OAAO,CAACH,kBAAkBI,aAAa,EAC3DC,MAAM,CAAC,CAAC,CAACC,QAAQC,MAAM;YACtB,qEAAqE;YACrE,uEAAuE;YACvE,OAAOA,MAAMC,mBAAmB,KAAKT,YAAYO,WAAWP;QAC9D,GACCU,GAAG,CAAC,CAAC,CAACH,QAAQC,MAAM,GAAM,CAAA;gBAAED;gBAAQC;YAAM,CAAA;IAC/C;IAEA;;;;;;GAMC,GACD,AAAOG,MACLX,QAAgB,EACoC;QACpD,qEAAqE;QACrE,yEAAyE;QACzE,+DAA+D;QAC/D,KAAK,MAAMY,WAAW,IAAI,CAACV,QAAQ,CAAE;YACnC,iEAAiE;YACjE,IAAI,CAACU,QAAQA,OAAO,EAAE;gBACpBA,QAAQA,OAAO,GAAGC,IAAAA,6BAAe,EAACC,IAAAA,yBAAa,EAACF,QAAQL,MAAM;YAChE;YAEA,MAAMI,QAAQC,QAAQA,OAAO,CAACZ;YAC9B,IAAIW,OAAO;gBACT,OAAOC,QAAQJ,KAAK;YACtB;QACF;QAEA,OAAO;IACT;AACF","ignoreList":[0]}