isr-engine 4.1.0 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/CacheTagContext-Btmq8KCD.js +69 -0
- package/dist/CacheTagContext-Btmq8KCD.js.map +1 -0
- package/dist/{abVariantContext-CGBlCt0q.js → abVariantContext-yWZOqscY.js} +118 -38
- package/dist/abVariantContext-yWZOqscY.js.map +1 -0
- package/dist/cache/RedisInvalidationBus.d.ts.map +1 -1
- package/dist/cache/RedisResponseCacheBackend.d.ts +1 -0
- package/dist/cache/RedisResponseCacheBackend.d.ts.map +1 -1
- package/dist/cache/ResponseCacheBackend.d.ts +6 -0
- package/dist/cache/ResponseCacheBackend.d.ts.map +1 -1
- package/dist/cli/cli.js +1 -1
- package/dist/config/defineConfig.js +1 -1
- package/dist/context/CacheTagContext.d.ts +10 -0
- package/dist/context/CacheTagContext.d.ts.map +1 -0
- package/dist/{createCacheInspectorMiddleware-D6c-CINz.js → createCacheInspectorMiddleware-glgtcBcQ.js} +2 -2
- package/dist/{createCacheInspectorMiddleware-D6c-CINz.js.map → createCacheInspectorMiddleware-glgtcBcQ.js.map} +1 -1
- package/dist/createCachedFetcher-CgJscexq.js +186 -0
- package/dist/createCachedFetcher-CgJscexq.js.map +1 -0
- package/dist/{createISRApp-DTlZvKBm.js → createISRApp-BG-s3uuL.js} +356 -162
- package/dist/createISRApp-BG-s3uuL.js.map +1 -0
- package/dist/defaults/runtime/contentRevalidation.d.ts +26 -0
- package/dist/defaults/runtime/contentRevalidation.d.ts.map +1 -0
- package/dist/defaults/runtime/createCachedFetcher.d.ts +8 -2
- package/dist/defaults/runtime/createCachedFetcher.d.ts.map +1 -1
- package/dist/defaults/runtime/defineSiteHooks.d.ts +4 -7
- package/dist/defaults/runtime/defineSiteHooks.d.ts.map +1 -1
- package/dist/defaults/runtime/defineSiteHooks.js +655 -2
- package/dist/defaults/runtime/defineSiteHooks.js.map +1 -0
- package/dist/defaults/runtime/locale-links.client.d.ts.map +1 -1
- package/dist/defaults/runtime/renderCancellation.d.ts +3 -0
- package/dist/defaults/runtime/renderCancellation.d.ts.map +1 -0
- package/dist/engine/ISREngine.d.ts.map +1 -1
- package/dist/engine/seo/SEOEngine.d.ts +3 -0
- package/dist/engine/seo/SEOEngine.d.ts.map +1 -1
- package/dist/engine/seo/resolveSeoConfig.d.ts +6 -0
- package/dist/engine/seo/resolveSeoConfig.d.ts.map +1 -1
- package/dist/{i18n-B2mWmifk.js → i18n-BZpAOZeO.js} +3 -2
- package/dist/{i18n-B2mWmifk.js.map → i18n-BZpAOZeO.js.map} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/isr/ISRRoutes.d.ts +2 -0
- package/dist/isr/ISRRoutes.d.ts.map +1 -1
- package/dist/isr-engine.js +7 -7
- package/dist/middlewares/LocaleRedirect.d.ts +4 -3
- package/dist/middlewares/LocaleRedirect.d.ts.map +1 -1
- package/dist/plugin/coherentCacheStore.d.ts.map +1 -1
- package/dist/plugin/isrCacheMiddleware.d.ts +7 -6
- package/dist/plugin/isrCacheMiddleware.d.ts.map +1 -1
- package/dist/plugin/isrCacheStore.d.ts +2 -0
- package/dist/plugin/isrCacheStore.d.ts.map +1 -1
- package/dist/rsc/browser.d.ts +3 -0
- package/dist/rsc/browser.d.ts.map +1 -1
- package/dist/rsc/browser.js +4 -9
- package/dist/rsc/browser.js.map +1 -1
- package/dist/rsc/cacheTag.d.ts +1 -8
- package/dist/rsc/cacheTag.d.ts.map +1 -1
- package/dist/rsc/index.d.ts +1 -1
- package/dist/rsc/index.d.ts.map +1 -1
- package/dist/rsc/index.js +4 -3
- package/dist/rsc/revalidate.d.ts +18 -9
- package/dist/rsc/revalidate.d.ts.map +1 -1
- package/dist/{rsc-DWwcqD4W.js → rsc-BYq2vvnh.js} +2 -2
- package/dist/{rsc-DWwcqD4W.js.map → rsc-BYq2vvnh.js.map} +1 -1
- package/dist/runtime/LocaleLink.d.ts.map +1 -1
- package/dist/runtime/i18n.d.ts +3 -0
- package/dist/runtime/i18n.d.ts.map +1 -1
- package/dist/runtime/localePreference.d.ts +7 -0
- package/dist/runtime/localePreference.d.ts.map +1 -0
- package/dist/server/contentRevalidationRoute.d.ts +4 -0
- package/dist/server/contentRevalidationRoute.d.ts.map +1 -0
- package/dist/server/manager.d.ts.map +1 -1
- package/dist/server/opsConfig.d.ts +6 -1
- package/dist/server/opsConfig.d.ts.map +1 -1
- package/dist/server/productionRuntime.d.ts +2 -0
- package/dist/server/productionRuntime.d.ts.map +1 -1
- package/dist/server/publishedSitemap.d.ts +8 -0
- package/dist/server/publishedSitemap.d.ts.map +1 -0
- package/dist/types/ISRConfig.d.ts +27 -0
- package/dist/types/ISRConfig.d.ts.map +1 -1
- package/dist/utils/cookie.d.ts +2 -2
- package/dist/utils/cookie.d.ts.map +1 -1
- package/dist/utils/isrPath.d.ts +6 -0
- package/dist/utils/isrPath.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/context/CacheTagContext.ts +20 -0
- package/src/defaults/entry.server.ssr.tsx +10 -0
- package/src/defaults/runtime/contentRevalidation.ts +96 -0
- package/src/defaults/runtime/createCachedFetcher.ts +76 -20
- package/src/defaults/runtime/defineServerEntry.tsx +30 -29
- package/src/defaults/runtime/defineSiteHooks.ts +117 -80
- package/src/defaults/runtime/locale-links.client.ts +14 -4
- package/src/defaults/runtime/renderCancellation.ts +10 -0
- package/src/runtime/LocaleLink.tsx +8 -2
- package/src/runtime/i18n.ts +4 -0
- package/src/runtime/localePreference.ts +36 -0
- package/src/types/ISRConfig.ts +29 -0
- package/src/utils/cookie.ts +11 -4
- package/src/utils/isrPath.ts +24 -0
- package/dist/abVariantContext-CGBlCt0q.js.map +0 -1
- package/dist/cookie-DcUeYm6E.js +0 -42
- package/dist/cookie-DcUeYm6E.js.map +0 -1
- package/dist/createISRApp-DTlZvKBm.js.map +0 -1
- package/dist/defineSiteHooks-iwLiVChy.js +0 -716
- package/dist/defineSiteHooks-iwLiVChy.js.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
1
|
+
import { A as isHtmlRoutePattern, C as getRequestId, D as assertDistinctHtmlRouteIdentities, E as requestContext, O as decodeHtmlPathname, S as getRequestContext, _ as encodeSpinnerMessage, a as isUncacheable, c as contentResponseTargets, g as encodeLogField, h as setOriginLogger, k as htmlRouteIdentity, l as registerInvalidator, o as runWithTagStore, p as setRevalidationMetricRecorder, r as collectTags, u as revalidateContent, v as escapeSupplementalLogControls, w as getTraceId, y as snapshotLogArgument } from "./abVariantContext-yWZOqscY.js";
|
|
2
|
+
import { a as registerContentInvalidator, i as normalizeContentScopes, r as invalidateContentCaches } from "./CacheTagContext-Btmq8KCD.js";
|
|
3
|
+
import { a as getCookieHeader, c as RSC_URL_POSTFIX, d as stripQuery$1, f as stripRscSuffix, i as readLocalePreference, l as contentPathname, o as parseCookieHeader, r as isSupportedLocalePreference, s as readCookie, t as createCachedFetcher, u as normalizePath$1 } from "./createCachedFetcher-CgJscexq.js";
|
|
4
|
+
import { a as selectAcceptableLocale, i as resolveI18nConfig, r as parseLocale } from "./i18n-BZpAOZeO.js";
|
|
4
5
|
import fs, { createReadStream, promises } from "node:fs";
|
|
5
6
|
import path from "node:path";
|
|
6
7
|
import express from "express";
|
|
@@ -20,7 +21,7 @@ import compression from "compression";
|
|
|
20
21
|
import helmet from "helmet";
|
|
21
22
|
import fs$3 from "node:fs/promises";
|
|
22
23
|
import { pathToFileURL } from "node:url";
|
|
23
|
-
import { Readable } from "node:stream";
|
|
24
|
+
import { Readable, Writable } from "node:stream";
|
|
24
25
|
import os from "node:os";
|
|
25
26
|
import http, { request } from "node:http";
|
|
26
27
|
import { LRUCache } from "lru-cache";
|
|
@@ -30,7 +31,8 @@ import { createHash as createHash$1, randomUUID as randomUUID$1 } from "crypto";
|
|
|
30
31
|
import * as esbuild from "esbuild";
|
|
31
32
|
import { lookup } from "node:dns/promises";
|
|
32
33
|
import { request as request$1 } from "node:https";
|
|
33
|
-
import {
|
|
34
|
+
import { pipeline } from "node:stream/promises";
|
|
35
|
+
import { LIMITS, SitemapStream } from "sitemap";
|
|
34
36
|
import { parse } from "parse5";
|
|
35
37
|
import { createServer as createServer$1 } from "http";
|
|
36
38
|
// src/config/resolveImageOptions.ts
|
|
@@ -58,48 +60,6 @@ function resolveImageOptions(images) {
|
|
|
58
60
|
});
|
|
59
61
|
return { remoteAllowlist: [...new Set(hosts)] };
|
|
60
62
|
}
|
|
61
|
-
// src/utils/htmlPathname.ts
|
|
62
|
-
/** Shared logical identity for HTML dispatch, aliases and build-time route validation. */
|
|
63
|
-
function decodeHtmlPathname(raw) {
|
|
64
|
-
const pathname = decodeURIComponent(raw);
|
|
65
|
-
if (pathname.includes("\\") || pathname.includes("\0") || pathname.split("/").some((segment) => segment === ".." || segment === ".")) throw new Error("Invalid HTML pathname");
|
|
66
|
-
return pathname;
|
|
67
|
-
}
|
|
68
|
-
function isHtmlRoutePattern(route) {
|
|
69
|
-
return route.includes("*") || route.split("/").some((segment) => segment.startsWith(":"));
|
|
70
|
-
}
|
|
71
|
-
/** Validate the original declaration before a URL parser can repair or normalize it. */
|
|
72
|
-
function htmlRouteIdentity(route, { allowPatterns = false } = {}) {
|
|
73
|
-
const invalid = (reason) => /* @__PURE__ */ new Error(`Invalid HTML route ${JSON.stringify(route)}: ${reason}`);
|
|
74
|
-
if (typeof route !== "string") throw invalid("expected a path string");
|
|
75
|
-
if (allowPatterns && route === "*") return route;
|
|
76
|
-
if (!(allowPatterns ? /^\/[A-Za-z0-9%\-._~/*:]*$/ : /^\/[A-Za-z0-9%\-._~/]*$/).test(route) || route.startsWith("//")) throw invalid("expected one origin-relative, percent-encoded pathname without query or fragment");
|
|
77
|
-
const segments = route.slice(1).split("/");
|
|
78
|
-
if (segments.at(-1) === "") segments.pop();
|
|
79
|
-
if (segments.some((segment) => !segment)) throw invalid("empty path segment");
|
|
80
|
-
let identity;
|
|
81
|
-
try {
|
|
82
|
-
identity = decodeHtmlPathname(route);
|
|
83
|
-
} catch (cause) {
|
|
84
|
-
throw new Error(`Invalid HTML route ${JSON.stringify(route)}: malformed or unsafe pathname`, { cause });
|
|
85
|
-
}
|
|
86
|
-
if (Array.from(identity).some((character) => {
|
|
87
|
-
const code = character.charCodeAt(0);
|
|
88
|
-
return code < 32 || code === 127;
|
|
89
|
-
})) throw invalid("control characters are forbidden");
|
|
90
|
-
return identity;
|
|
91
|
-
}
|
|
92
|
-
/** Exact duplicates are idempotent; matching rules do not own concrete page identities. */
|
|
93
|
-
function assertDistinctHtmlRouteIdentities(routes, options = {}) {
|
|
94
|
-
const owners = /* @__PURE__ */ new Map();
|
|
95
|
-
for (const route of routes) {
|
|
96
|
-
const identity = htmlRouteIdentity(route, options);
|
|
97
|
-
if (options.allowPatterns && isHtmlRoutePattern(route)) continue;
|
|
98
|
-
const owner = owners.get(identity);
|
|
99
|
-
if (owner !== void 0 && owner !== route) throw new Error(`Route identity collision: ${JSON.stringify(owner)} and ${JSON.stringify(route)} resolve to ${JSON.stringify(identity)}`);
|
|
100
|
-
owners.set(identity, route);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
63
|
// src/utils/cacheDuration.ts
|
|
104
64
|
/** Cache deadlines must remain finite, positive (or explicitly zero for SWR) timestamps. */
|
|
105
65
|
function assertCacheDuration(seconds, label, allowZero = false) {
|
|
@@ -1655,7 +1615,7 @@ function resolveFetchHandler(module) {
|
|
|
1655
1615
|
}
|
|
1656
1616
|
var package_default = {
|
|
1657
1617
|
name: "isr-engine",
|
|
1658
|
-
version: "4.
|
|
1618
|
+
version: "4.3.0",
|
|
1659
1619
|
description: "ISR/SSG/Fallback rendering orchestration on Vite + React 19 RSC.",
|
|
1660
1620
|
license: "UNLICENSED",
|
|
1661
1621
|
repository: {
|
|
@@ -1739,7 +1699,7 @@ var package_default = {
|
|
|
1739
1699
|
"test": "vitest run",
|
|
1740
1700
|
"pretest:browser": "pnpm run build",
|
|
1741
1701
|
"test:browser:production": "pnpm run build && playwright test --config playwright.production.config.ts",
|
|
1742
|
-
"test:browser": "playwright test
|
|
1702
|
+
"test:browser": "playwright test",
|
|
1743
1703
|
"bench": "node bench/runner.mjs",
|
|
1744
1704
|
"check": "pnpm run type-check && pnpm run lint && pnpm run test",
|
|
1745
1705
|
"audit:security": "pnpm audit --registry=https://registry.npmjs.org --audit-level=low",
|
|
@@ -2898,6 +2858,7 @@ async function resolveImportPath(filePath, options) {
|
|
|
2898
2858
|
return pathToFileURL$1(filePath).href + (forceReload ? `?t=${Date.now()}` : "");
|
|
2899
2859
|
}
|
|
2900
2860
|
// src/server/opsConfig.ts
|
|
2861
|
+
var CONTENT_REVALIDATION_PATH = "/__isr/content/revalidate";
|
|
2901
2862
|
var opsLimiters = /* @__PURE__ */ new WeakMap();
|
|
2902
2863
|
var runtimeOpsConfigs = /* @__PURE__ */ new WeakMap();
|
|
2903
2864
|
/** Carry one resolved policy from the Vite plugin into its owning Express runtime. */
|
|
@@ -2982,6 +2943,8 @@ function resolveOpsConfig(config, env) {
|
|
|
2982
2943
|
const defaults = env === "production" ? PROD_DEFAULTS : DEV_DEFAULTS;
|
|
2983
2944
|
const warnings = [];
|
|
2984
2945
|
const authToken = trimToUndefined(ops?.authToken);
|
|
2946
|
+
const publicationEnabled = env === "production" && ops?.contentRevalidation === true;
|
|
2947
|
+
if (publicationEnabled && !authToken) warnings.push(`${CONTENT_REVALIDATION_PATH} requires server.ops.authToken and was disabled.`);
|
|
2985
2948
|
return {
|
|
2986
2949
|
authToken,
|
|
2987
2950
|
requestLimit: resolveRequestLimitPolicy("ops", config?.server?.requestLimits?.ops),
|
|
@@ -2989,6 +2952,10 @@ function resolveOpsConfig(config, env) {
|
|
|
2989
2952
|
health: resolveEndpointConfig("health", ops?.health, defaults.health, env, authToken, warnings),
|
|
2990
2953
|
metrics: resolveEndpointConfig("metrics", ops?.metrics, defaults.metrics, env, authToken, warnings),
|
|
2991
2954
|
inventory: resolveEndpointConfig("inventory", ops?.inventory, defaults.inventory, env, authToken, warnings),
|
|
2955
|
+
contentRevalidation: {
|
|
2956
|
+
enabled: publicationEnabled && !!authToken,
|
|
2957
|
+
public: false
|
|
2958
|
+
},
|
|
2992
2959
|
warnings
|
|
2993
2960
|
};
|
|
2994
2961
|
}
|
|
@@ -3140,6 +3107,13 @@ function createCoherentCacheStore({ backend, max = 1e3, maxBytes = 67108864 }) {
|
|
|
3140
3107
|
generation++;
|
|
3141
3108
|
for (const [key, snapshot] of Array.from(local.entries())) if (snapshot.value.tags.includes(tag) || snapshot.value.pathTag === tag) local.delete(key);
|
|
3142
3109
|
}
|
|
3110
|
+
function invalidate(tags, run) {
|
|
3111
|
+
if (destroyed) return Promise.reject(/* @__PURE__ */ new Error("response cache is closed"));
|
|
3112
|
+
const evict = () => tags.forEach(evictByTag);
|
|
3113
|
+
evict();
|
|
3114
|
+
return track(run().finally(evict));
|
|
3115
|
+
}
|
|
3116
|
+
const invalidateTags = backend.invalidateTags?.bind(backend);
|
|
3143
3117
|
async function commitValue(key, entry, lease, seed = false) {
|
|
3144
3118
|
if (destroyed) return false;
|
|
3145
3119
|
const value = {
|
|
@@ -3201,10 +3175,9 @@ function createCoherentCacheStore({ backend, max = 1e3, maxBytes = 67108864 }) {
|
|
|
3201
3175
|
},
|
|
3202
3176
|
evictByTag,
|
|
3203
3177
|
invalidateByTag(tag) {
|
|
3204
|
-
|
|
3205
|
-
evictByTag(tag);
|
|
3206
|
-
return track(backend.invalidateTag(tag).finally(() => evictByTag(tag)));
|
|
3178
|
+
return invalidate([tag], () => backend.invalidateTag(tag));
|
|
3207
3179
|
},
|
|
3180
|
+
...invalidateTags && { invalidateTags: (tags, publicationId) => invalidate(tags, () => invalidateTags(tags, publicationId)) },
|
|
3208
3181
|
clear() {
|
|
3209
3182
|
generation++;
|
|
3210
3183
|
local.clear();
|
|
@@ -3251,6 +3224,7 @@ requireKind(KEYS[3], 'zset')
|
|
|
3251
3224
|
if #KEYS == 4 then requireKind(KEYS[4], 'hash') end
|
|
3252
3225
|
local function initialize(newIncarnation)
|
|
3253
3226
|
redis.call('DEL', KEYS[2], KEYS[3])
|
|
3227
|
+
redis.call('HDEL', KEYS[1], 'contentRevision', 'previousContentRevision', 'contentPublication')
|
|
3254
3228
|
redis.call('HSET', KEYS[1], 'incarnation', newIncarnation, 'revision', '0')
|
|
3255
3229
|
redis.call('HSET', KEYS[2], '__incarnation', newIncarnation)
|
|
3256
3230
|
redis.call('ZADD', KEYS[3], '+inf', '__incarnation:' .. newIncarnation)
|
|
@@ -3283,7 +3257,15 @@ end
|
|
|
3283
3257
|
local clock = redis.call('TIME')
|
|
3284
3258
|
local now = tonumber(clock[1]) * 1000 + math.floor(tonumber(clock[2]) / 1000)
|
|
3285
3259
|
`;
|
|
3286
|
-
var CAPTURE = PRELUDE + `
|
|
3260
|
+
var CAPTURE = PRELUDE + `
|
|
3261
|
+
return {
|
|
3262
|
+
incarnation,
|
|
3263
|
+
revision,
|
|
3264
|
+
redis.call('HGET', KEYS[1], 'contentRevision') or '',
|
|
3265
|
+
redis.call('HGET', KEYS[1], 'previousContentRevision') or '',
|
|
3266
|
+
redis.call('HGET', KEYS[1], 'contentPublication') or ''
|
|
3267
|
+
}
|
|
3268
|
+
`;
|
|
3287
3269
|
var READ = PRELUDE + `
|
|
3288
3270
|
local entry = redis.call('HMGET', KEYS[4], 'incarnation', 'revision', 'expiresAt', 'tags', 'version')
|
|
3289
3271
|
if not entry[1] then return {incarnation, revision, 'miss'} end
|
|
@@ -3333,8 +3315,10 @@ return 1
|
|
|
3333
3315
|
var INVALIDATE = PRELUDE + `
|
|
3334
3316
|
redis.call('HINCRBY', KEYS[1], 'revision', 1)
|
|
3335
3317
|
revision = redis.call('HGET', KEYS[1], 'revision')
|
|
3336
|
-
|
|
3337
|
-
redis.call('
|
|
3318
|
+
for _, field in ipairs(cjson.decode(ARGV[2])) do
|
|
3319
|
+
redis.call('HSET', KEYS[2], field, revision)
|
|
3320
|
+
redis.call('ZADD', KEYS[3], now + ${MAX_RESPONSE_TTL_MS}, field)
|
|
3321
|
+
end
|
|
3338
3322
|
-- Each response lives at most maxTtl. Older tombstones can be reclaimed;
|
|
3339
3323
|
-- global revision still fences every lease acquired before invalidation.
|
|
3340
3324
|
local expired = redis.call('ZRANGEBYSCORE', KEYS[3], '-inf', now, 'LIMIT', 0, 128)
|
|
@@ -3344,6 +3328,11 @@ for _, field in ipairs(expired) do
|
|
|
3344
3328
|
end
|
|
3345
3329
|
redis.call('PEXPIRE', KEYS[2], ${MAX_RESPONSE_TTL_MS})
|
|
3346
3330
|
redis.call('PEXPIRE', KEYS[3], ${MAX_RESPONSE_TTL_MS})
|
|
3331
|
+
if ARGV[3] and ARGV[3] ~= '' then
|
|
3332
|
+
local previous = redis.call('HGET', KEYS[1], 'contentRevision') or ''
|
|
3333
|
+
redis.call('HSET', KEYS[1], 'contentRevision', revision,
|
|
3334
|
+
'previousContentRevision', previous, 'contentPublication', ARGV[3])
|
|
3335
|
+
end
|
|
3347
3336
|
return {incarnation, revision}
|
|
3348
3337
|
`;
|
|
3349
3338
|
var CLEAR = PRELUDE + `
|
|
@@ -3386,7 +3375,10 @@ var RedisResponseCacheBackend = class {
|
|
|
3386
3375
|
const result = await this.execute(CAPTURE, void 0, []);
|
|
3387
3376
|
return {
|
|
3388
3377
|
incarnation: result[0],
|
|
3389
|
-
revision: result[1]
|
|
3378
|
+
revision: result[1],
|
|
3379
|
+
...result[2] && { contentRevision: result[2] },
|
|
3380
|
+
...result[3] && { previousContentRevision: result[3] },
|
|
3381
|
+
...result[4] && { contentPublication: result[4] }
|
|
3390
3382
|
};
|
|
3391
3383
|
}
|
|
3392
3384
|
async read(key, cached) {
|
|
@@ -3432,7 +3424,11 @@ var RedisResponseCacheBackend = class {
|
|
|
3432
3424
|
return this.commit(key, value, lease, tags, ttlMs, void 0, "seed");
|
|
3433
3425
|
}
|
|
3434
3426
|
async invalidateTag(tag) {
|
|
3435
|
-
await this.
|
|
3427
|
+
await this.invalidateTags([tag]);
|
|
3428
|
+
}
|
|
3429
|
+
async invalidateTags(tags, publicationId = "") {
|
|
3430
|
+
const fields = new Set(tags.map((tag) => this.digest(tag)));
|
|
3431
|
+
await this.execute(INVALIDATE, void 0, [JSON.stringify([...fields]), publicationId]);
|
|
3436
3432
|
}
|
|
3437
3433
|
async remove(key) {
|
|
3438
3434
|
await this.invalidateTag(`entry:${key}`);
|
|
@@ -4194,13 +4190,25 @@ function createAutoCacheStore(opts = {}) {
|
|
|
4194
4190
|
// src/cache/RedisInvalidationBus.ts
|
|
4195
4191
|
function normalizeTarget(target) {
|
|
4196
4192
|
if (!target || typeof target !== "object") return null;
|
|
4197
|
-
const
|
|
4198
|
-
if (
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4193
|
+
const { kind, value, protocol, scopes } = target;
|
|
4194
|
+
if (typeof value !== "string") return null;
|
|
4195
|
+
const transport = protocol === "response-v1" ? { protocol: "response-v1" } : {};
|
|
4196
|
+
if (kind === "path" || kind === "tag") return {
|
|
4197
|
+
kind,
|
|
4198
|
+
value,
|
|
4199
|
+
...transport
|
|
4203
4200
|
};
|
|
4201
|
+
if (kind !== "content" || !value) return null;
|
|
4202
|
+
try {
|
|
4203
|
+
return {
|
|
4204
|
+
kind,
|
|
4205
|
+
value,
|
|
4206
|
+
scopes: normalizeContentScopes(scopes),
|
|
4207
|
+
...transport
|
|
4208
|
+
};
|
|
4209
|
+
} catch {
|
|
4210
|
+
return null;
|
|
4211
|
+
}
|
|
4204
4212
|
}
|
|
4205
4213
|
var RedisInvalidationBus = class {
|
|
4206
4214
|
logger = Logger.getInstance();
|
|
@@ -4574,8 +4582,6 @@ var DEV_STYLE_GENERATION_HEADER = "x-isr-engine-dev-style-generation";
|
|
|
4574
4582
|
* 用户层 namespace 用 cacheNamespace / ISR_CACHE_NAMESPACE 控制(独立维度)。
|
|
4575
4583
|
*/
|
|
4576
4584
|
var ENGINE_CACHE_KEY_VERSION = "e3";
|
|
4577
|
-
/** RSC 流响应的子路径后缀(与站点 framework/request.tsx 约定一致) */
|
|
4578
|
-
var RSC_URL_POSTFIX = "_.rsc";
|
|
4579
4585
|
/** 后台重验证请求的 sentinel 头,避免循环 */
|
|
4580
4586
|
var BG_REVALIDATE_HEADER = "x-isr-background-revalidate";
|
|
4581
4587
|
/** 预热请求的 sentinel 头,避免 HIT → prefetch → HIT → prefetch 二次自激 */
|
|
@@ -4663,7 +4669,19 @@ function createIsrCacheHandler(config, options = {}) {
|
|
|
4663
4669
|
const cacheKeyPrefix = `${ENGINE_CACHE_KEY_VERSION}:${cacheNamespace}:${options.buildId ?? process.env.APP_VERSION ?? "dev"}:`;
|
|
4664
4670
|
/** 后台重验证正在进行的 key 集合 —— 防止并发 STALE 请求重复触发多次 bg 拉取 */
|
|
4665
4671
|
const revalidating = /* @__PURE__ */ new Set();
|
|
4666
|
-
|
|
4672
|
+
let appliedPublication;
|
|
4673
|
+
let observedPublication;
|
|
4674
|
+
let observedIncarnation;
|
|
4675
|
+
const state = {
|
|
4676
|
+
invalidationGeneration: 0,
|
|
4677
|
+
reconcileContent(lease) {
|
|
4678
|
+
const { incarnation, contentRevision, previousContentRevision, contentPublication } = lease;
|
|
4679
|
+
if (incarnation === observedIncarnation && contentRevision === observedPublication) return;
|
|
4680
|
+
if (observedIncarnation !== void 0 && observedIncarnation !== incarnation || contentRevision !== void 0 && (!contentPublication || contentPublication !== appliedPublication || previousContentRevision !== observedPublication)) invalidateContentCaches();
|
|
4681
|
+
observedIncarnation = incarnation;
|
|
4682
|
+
observedPublication = contentRevision;
|
|
4683
|
+
}
|
|
4684
|
+
};
|
|
4667
4685
|
const seeded = /* @__PURE__ */ new Map();
|
|
4668
4686
|
const internalToken = randomBytes(24).toString("hex");
|
|
4669
4687
|
const singleflightWaitMs = options.singleflightWaitMs ?? 5e3;
|
|
@@ -4695,9 +4713,9 @@ function createIsrCacheHandler(config, options = {}) {
|
|
|
4695
4713
|
* LRU 上限防止 path/tag 唯一值暴增导致内存泄漏。
|
|
4696
4714
|
*/
|
|
4697
4715
|
const invalidationLog = new LRUCache({ max: INVALIDATION_LOG_MAX });
|
|
4698
|
-
const
|
|
4716
|
+
const prepareInvalidation = (target, durable) => {
|
|
4699
4717
|
if (target.kind === "path") {
|
|
4700
|
-
const pathname =
|
|
4718
|
+
const pathname = contentPathname(target.value);
|
|
4701
4719
|
target = {
|
|
4702
4720
|
...target,
|
|
4703
4721
|
value: options.resolveInvalidationPath?.(pathname) ?? pathname
|
|
@@ -4705,12 +4723,17 @@ function createIsrCacheHandler(config, options = {}) {
|
|
|
4705
4723
|
}
|
|
4706
4724
|
if (durable || !cache.coherence) state.invalidationGeneration++;
|
|
4707
4725
|
invalidationLog.set(`${target.kind}:${target.value}`, Date.now());
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4726
|
+
return target;
|
|
4727
|
+
};
|
|
4728
|
+
const staticSeedTag = options.staticSeed ? `__isr_path:${cacheNamespace}:__static_seed` : void 0;
|
|
4729
|
+
const responseTag = (target) => target.kind === "path" ? `__isr_path:${cacheNamespace}:${stripRscSuffix(normalizePath$1(target.value))}` : target.value;
|
|
4730
|
+
const invalidateLocal = async (target, durable = true) => {
|
|
4731
|
+
target = prepareInvalidation(target, durable);
|
|
4732
|
+
if (staticSeedTag) {
|
|
4733
|
+
if (!durable && cache.evictByTag) cache.evictByTag(staticSeedTag);
|
|
4734
|
+
else if (cache.invalidateByTag) await cache.invalidateByTag(staticSeedTag);
|
|
4712
4735
|
}
|
|
4713
|
-
const tag =
|
|
4736
|
+
const tag = responseTag(target);
|
|
4714
4737
|
if (!durable && cache.evictByTag) {
|
|
4715
4738
|
cache.evictByTag(tag);
|
|
4716
4739
|
return;
|
|
@@ -4743,15 +4766,51 @@ function createIsrCacheHandler(config, options = {}) {
|
|
|
4743
4766
|
logger$5.info(`🔁 ISR cache invalidate tag=${target.value} → 精准清除 ${cleared} 条(按 tag 匹配)`);
|
|
4744
4767
|
}
|
|
4745
4768
|
};
|
|
4769
|
+
async function invalidatePublication({ id, scopes }, durable = true) {
|
|
4770
|
+
const targets = contentResponseTargets(scopes);
|
|
4771
|
+
if (!targets.length && !scopes.locales.length) return;
|
|
4772
|
+
appliedPublication = id;
|
|
4773
|
+
if (!targets.length) {
|
|
4774
|
+
if (durable || !cache.coherence) {
|
|
4775
|
+
state.invalidationGeneration++;
|
|
4776
|
+
if (durable) await cache.invalidateTags?.([], id);
|
|
4777
|
+
}
|
|
4778
|
+
return;
|
|
4779
|
+
}
|
|
4780
|
+
if (durable && cache.invalidateTags) {
|
|
4781
|
+
const tags = targets.map((target) => responseTag(prepareInvalidation(target, durable)));
|
|
4782
|
+
if (staticSeedTag) tags.push(staticSeedTag);
|
|
4783
|
+
await cache.invalidateTags(tags, id);
|
|
4784
|
+
return;
|
|
4785
|
+
}
|
|
4786
|
+
const failures = (await Promise.allSettled(targets.map((target) => invalidateLocal(target, durable)))).flatMap((result) => result.status === "rejected" ? [result.reason] : []);
|
|
4787
|
+
if (failures.length) throw new AggregateError(failures, "Content response invalidation failed");
|
|
4788
|
+
}
|
|
4789
|
+
const protocol = cache.coherence ? "response-v1" : void 0;
|
|
4746
4790
|
const unregisterInvalidator = registerInvalidator(async (target) => {
|
|
4747
4791
|
await invalidateLocal(target);
|
|
4748
|
-
await options.invalidationBus?.publish(
|
|
4792
|
+
await options.invalidationBus?.publish(protocol ? {
|
|
4749
4793
|
...target,
|
|
4750
|
-
protocol
|
|
4794
|
+
protocol
|
|
4751
4795
|
} : target);
|
|
4752
|
-
})
|
|
4796
|
+
}, async (publication) => {
|
|
4797
|
+
await invalidatePublication(publication);
|
|
4798
|
+
await options.invalidationBus?.publish({
|
|
4799
|
+
kind: "content",
|
|
4800
|
+
value: publication.id,
|
|
4801
|
+
scopes: publication.scopes,
|
|
4802
|
+
...protocol && { protocol }
|
|
4803
|
+
});
|
|
4804
|
+
}, config?.runtime?.i18n);
|
|
4753
4805
|
const unsubscribeBus = options.invalidationBus?.subscribe(async (target) => {
|
|
4754
|
-
|
|
4806
|
+
const durable = target.protocol !== "response-v1";
|
|
4807
|
+
if (target.kind === "content") {
|
|
4808
|
+
invalidateContentCaches(target.scopes);
|
|
4809
|
+
await invalidatePublication({
|
|
4810
|
+
id: target.value,
|
|
4811
|
+
scopes: target.scopes
|
|
4812
|
+
}, durable);
|
|
4813
|
+
} else await invalidateLocal(target, durable);
|
|
4755
4814
|
});
|
|
4756
4815
|
const handler = ((req, res, next) => {
|
|
4757
4816
|
handleRequest(req, res, next, {
|
|
@@ -4762,6 +4821,7 @@ function createIsrCacheHandler(config, options = {}) {
|
|
|
4762
4821
|
bgTimeoutMs,
|
|
4763
4822
|
variantIsolation,
|
|
4764
4823
|
variantCookieName,
|
|
4824
|
+
i18n: config?.runtime?.i18n,
|
|
4765
4825
|
hostIsolation,
|
|
4766
4826
|
cacheKeyPrefix,
|
|
4767
4827
|
inflightRegens,
|
|
@@ -4901,7 +4961,7 @@ function createIsrCacheMiddleware(explicitConfig, options = {}) {
|
|
|
4901
4961
|
development: true
|
|
4902
4962
|
}));
|
|
4903
4963
|
try {
|
|
4904
|
-
const inspector = opsConfig.inventory.enabled ? (await import("./createCacheInspectorMiddleware-
|
|
4964
|
+
const inspector = opsConfig.inventory.enabled ? (await import("./createCacheInspectorMiddleware-glgtcBcQ.js")).createCacheInspectorMiddleware(nextHandler, opsConfig) : void 0;
|
|
4905
4965
|
handler = nextHandler;
|
|
4906
4966
|
server.middlewares.use((req, res, next) => {
|
|
4907
4967
|
if (handler !== nextHandler) return next();
|
|
@@ -5002,19 +5062,19 @@ async function handleRequest(req, res, next, ctx) {
|
|
|
5002
5062
|
next();
|
|
5003
5063
|
return Promise.resolve();
|
|
5004
5064
|
}
|
|
5005
|
-
if (ctx.development && stripQuery$1(url).endsWith(
|
|
5065
|
+
if (ctx.development && stripQuery$1(url).endsWith("_.rsc") && req.headers[DEV_STYLE_GENERATION_HEADER] !== void 0) {
|
|
5006
5066
|
setHeaderOnce(res, "X-Cache-Status", "BYPASS");
|
|
5007
5067
|
next();
|
|
5008
5068
|
return Promise.resolve();
|
|
5009
5069
|
}
|
|
5010
5070
|
const requestDirectives = parseCacheDirectives(req.headers["cache-control"]);
|
|
5071
|
+
const logicalPath = stripRscSuffix(stripQuery$1(url));
|
|
5011
5072
|
const pragmaNoCache = req.headers["cache-control"] === void 0 && parseCacheDirectives(req.headers.pragma).has("no-cache");
|
|
5012
|
-
if (hasPrivateRequest(req, ctx.variantCookieName) || requestDirectives.has("no-store") || requestDirectives.has("no-cache") || pragmaNoCache) {
|
|
5073
|
+
if (hasPrivateRequest(req, ctx.variantCookieName, ctx.i18n, logicalPath) || requestDirectives.has("no-store") || requestDirectives.has("no-cache") || pragmaNoCache) {
|
|
5013
5074
|
setHeaderOnce(res, "X-Cache-Status", "BYPASS");
|
|
5014
5075
|
next();
|
|
5015
5076
|
return;
|
|
5016
5077
|
}
|
|
5017
|
-
const logicalPath = stripRscSuffix(stripQuery$1(url));
|
|
5018
5078
|
let resolved = matchRouteRule(logicalPath, ctx.rules);
|
|
5019
5079
|
const overrideMode = ctx.development ? parseModeOverride(url) : void 0;
|
|
5020
5080
|
if (overrideMode) {
|
|
@@ -5048,7 +5108,7 @@ async function handleRequest(req, res, next, ctx) {
|
|
|
5048
5108
|
}
|
|
5049
5109
|
if (!isActive()) return;
|
|
5050
5110
|
const staticSeed = ctx.staticSeed;
|
|
5051
|
-
if (!entry && ctx.state.invalidationGeneration === 0 && resolved.mode === "ssg" && staticSeed && (!ctx.staticSeedInfo || ctx.staticSeedInfo(logicalPath)) && !url.includes("?") && !url.endsWith(
|
|
5111
|
+
if (!entry && ctx.state.invalidationGeneration === 0 && resolved.mode === "ssg" && staticSeed && (!ctx.staticSeedInfo || ctx.staticSeedInfo(logicalPath)) && !url.includes("?") && !url.endsWith("_.rsc") && !ctx.variantIsolation && !ctx.hostIsolation) {
|
|
5052
5112
|
let seedTask = ctx.seeded.get(cacheKey);
|
|
5053
5113
|
const leader = !seedTask;
|
|
5054
5114
|
if (!seedTask) {
|
|
@@ -5202,6 +5262,7 @@ async function runMissPath(_req, res, next, ctx, resolved, cacheKey, bgRevalidat
|
|
|
5202
5262
|
}
|
|
5203
5263
|
if (!isActive()) return;
|
|
5204
5264
|
if (ctx.cache.coherence && !renderLease) res.setHeader("X-Cache-Status", "BYPASS");
|
|
5265
|
+
if (renderLease) ctx.state.reconcileContent(renderLease);
|
|
5205
5266
|
const renderGeneration = ctx.state.invalidationGeneration;
|
|
5206
5267
|
runWithTagStore(() => {
|
|
5207
5268
|
captureAndStore(res, ctx.maxCachedBodyBytes, cacheKey, (captured) => {
|
|
@@ -5517,10 +5578,6 @@ function isBypassPath(url) {
|
|
|
5517
5578
|
if (/\.(js|mjs|cjs|ts|tsx|jsx|json|map|css|scss|sass|less|stylus|png|jpe?g|gif|webp|avif|svg|ico|woff2?|ttf|eot|mp3|mp4|webm|ogg|wasm|zip|pdf)(\?|$)/i.test(p)) return true;
|
|
5518
5579
|
return false;
|
|
5519
5580
|
}
|
|
5520
|
-
function stripQuery$1(url) {
|
|
5521
|
-
const i = url.indexOf("?");
|
|
5522
|
-
return i === -1 ? url : url.slice(0, i);
|
|
5523
|
-
}
|
|
5524
5581
|
/**
|
|
5525
5582
|
* 从 URL 查询字符串解析 `mode=isr|ssr|ssg` 开发调试覆盖
|
|
5526
5583
|
* csr 不在用户级 mode 列表(是 server 崩溃时的内部 fallback)
|
|
@@ -5531,15 +5588,6 @@ function parseModeOverride(url) {
|
|
|
5531
5588
|
const mode = new URLSearchParams(url.slice(qIdx + 1)).get("mode");
|
|
5532
5589
|
if (mode === "isr" || mode === "ssr" || mode === "ssg") return mode;
|
|
5533
5590
|
}
|
|
5534
|
-
function stripRscSuffix(path) {
|
|
5535
|
-
if (path.endsWith(`/${RSC_URL_POSTFIX}`)) return path.slice(0, -6) || "/";
|
|
5536
|
-
if (path.endsWith(RSC_URL_POSTFIX)) return path.slice(0, -5) || "/";
|
|
5537
|
-
return path;
|
|
5538
|
-
}
|
|
5539
|
-
function normalizePath$1(path) {
|
|
5540
|
-
if (!path.startsWith("/")) return `/${path}`;
|
|
5541
|
-
return path;
|
|
5542
|
-
}
|
|
5543
5591
|
function setHeaderOnce(res, name, value) {
|
|
5544
5592
|
if (res.headersSent) return;
|
|
5545
5593
|
if (!res.getHeader(name)) res.setHeader(name, value);
|
|
@@ -5698,10 +5746,11 @@ function parseCacheDirectives(header) {
|
|
|
5698
5746
|
}
|
|
5699
5747
|
return directives;
|
|
5700
5748
|
}
|
|
5701
|
-
function hasPrivateRequest(req, variantCookieName) {
|
|
5749
|
+
function hasPrivateRequest(req, variantCookieName, i18n, logicalPath) {
|
|
5702
5750
|
if (req.headers.authorization || req.headers.range) return true;
|
|
5703
|
-
const cookies = parseCookieHeader(
|
|
5704
|
-
|
|
5751
|
+
const cookies = parseCookieHeader(getCookieHeader(req));
|
|
5752
|
+
const ignoreLocalePreference = i18n && isSupportedLocalePreference(cookies["isr_locale"], i18n) && parseLocale(logicalPath, i18n).hasPrefix && URL.parse(`http://localhost${logicalPath}`)?.pathname === logicalPath;
|
|
5753
|
+
return Object.keys(cookies).some((name) => name !== "anon" && name !== variantCookieName && !(name === "isr_locale" && ignoreLocalePreference));
|
|
5705
5754
|
}
|
|
5706
5755
|
function hasPrivateResponse(headers) {
|
|
5707
5756
|
const control = String(headers["cache-control"] || "").toLowerCase();
|
|
@@ -6242,6 +6291,7 @@ function mergeSEOConfig(base, override) {
|
|
|
6242
6291
|
* - Open Graph / Twitter Cards
|
|
6243
6292
|
*/
|
|
6244
6293
|
var SITEMAP_DATE = /^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:\d{2}))?$/;
|
|
6294
|
+
var SITEMAP_BYTE_LIMIT = 52428800;
|
|
6245
6295
|
function validLastModified(value) {
|
|
6246
6296
|
if (!value || !SITEMAP_DATE.test(value) || !Number.isFinite(Date.parse(value))) return;
|
|
6247
6297
|
const day = value.slice(0, 10);
|
|
@@ -6308,24 +6358,62 @@ var SEOEngine = class SEOEngine {
|
|
|
6308
6358
|
const key = JSON.stringify(entries);
|
|
6309
6359
|
const now = Date.now();
|
|
6310
6360
|
if (this.sitemapCache?.key === key && now - this.sitemapCache.generatedAt < this.config.sitemap.cacheTimeout * 1e3) return this.sitemapCache.xml;
|
|
6311
|
-
|
|
6312
|
-
const sitemap = new SitemapStream({ hostname: this.config.baseUrl });
|
|
6313
|
-
for (const { url, lastmod } of entries) sitemap.write({
|
|
6314
|
-
url,
|
|
6315
|
-
priority: this.getUrlPriority(url),
|
|
6316
|
-
changefreq: this.getUrlChangeFreq(url),
|
|
6317
|
-
lastmod
|
|
6318
|
-
});
|
|
6319
|
-
sitemap.end();
|
|
6320
|
-
const xml = (await streamToPromise(sitemap)).toString();
|
|
6361
|
+
const xml = await this.renderSitemap(entries);
|
|
6321
6362
|
this.sitemapCache = {
|
|
6322
6363
|
key,
|
|
6323
6364
|
xml,
|
|
6324
6365
|
generatedAt: now
|
|
6325
6366
|
};
|
|
6326
|
-
this.logger.info(`✅ 站点地图已生成: ${entries.length} 个页面`);
|
|
6327
6367
|
return xml;
|
|
6328
6368
|
}
|
|
6369
|
+
async generatePublishedSitemap(catalog) {
|
|
6370
|
+
if (!Array.isArray(catalog)) throw new TypeError("Sitemap source must return an array");
|
|
6371
|
+
const entries = [];
|
|
6372
|
+
const seen = /* @__PURE__ */ new Set();
|
|
6373
|
+
for (const { path, status, noindex, modifiedTime } of catalog) {
|
|
6374
|
+
let identity;
|
|
6375
|
+
try {
|
|
6376
|
+
identity = htmlRouteIdentity(path);
|
|
6377
|
+
} catch {
|
|
6378
|
+
continue;
|
|
6379
|
+
}
|
|
6380
|
+
if (seen.has(identity)) throw new TypeError(`Duplicate sitemap path: ${path}`);
|
|
6381
|
+
seen.add(identity);
|
|
6382
|
+
if (status !== "published" || noindex !== void 0 && noindex !== false || identity.startsWith("/__") || identity === "/api" || identity.startsWith("/api/") || this.shouldExcludeUrl(identity)) continue;
|
|
6383
|
+
if (entries.length >= LIMITS.MAX_SITEMAP_ITEM_LIMIT) throw new RangeError(`Publication sitemap exceeds ${LIMITS.MAX_SITEMAP_ITEM_LIMIT} URLs`);
|
|
6384
|
+
entries.push({
|
|
6385
|
+
url: path,
|
|
6386
|
+
lastmod: validLastModified(modifiedTime)
|
|
6387
|
+
});
|
|
6388
|
+
}
|
|
6389
|
+
return this.renderSitemap(entries, { enforceLimits: true });
|
|
6390
|
+
}
|
|
6391
|
+
async renderSitemap(entries, { enforceLimits = false } = {}) {
|
|
6392
|
+
const hostname = this.config.baseUrl;
|
|
6393
|
+
if (!hostname) throw new Error("SEO baseUrl 未配置,无法生成 sitemap。请设置 ssr.config.ts runtime.site。");
|
|
6394
|
+
const items = entries.map(({ url, lastmod }) => {
|
|
6395
|
+
if (enforceLimits && new URL(url, hostname).href.length >= LIMITS.MAX_URL_LENGTH) throw new RangeError(`Publication sitemap URL must be shorter than ${LIMITS.MAX_URL_LENGTH} characters`);
|
|
6396
|
+
return {
|
|
6397
|
+
url,
|
|
6398
|
+
priority: this.getUrlPriority(url),
|
|
6399
|
+
changefreq: this.getUrlChangeFreq(url),
|
|
6400
|
+
lastmod
|
|
6401
|
+
};
|
|
6402
|
+
});
|
|
6403
|
+
const chunks = [];
|
|
6404
|
+
let bytes = 0;
|
|
6405
|
+
await pipeline(Readable.from(items), new SitemapStream({ hostname }), new Writable({ write(chunk, _encoding, done) {
|
|
6406
|
+
bytes += chunk.length;
|
|
6407
|
+
if (enforceLimits && bytes > SITEMAP_BYTE_LIMIT) {
|
|
6408
|
+
done(/* @__PURE__ */ new RangeError(`Publication sitemap exceeds ${SITEMAP_BYTE_LIMIT} uncompressed bytes`));
|
|
6409
|
+
return;
|
|
6410
|
+
}
|
|
6411
|
+
chunks.push(chunk);
|
|
6412
|
+
done();
|
|
6413
|
+
} }));
|
|
6414
|
+
this.logger.info(`✅ 站点地图已生成: ${entries.length} 个页面`);
|
|
6415
|
+
return Buffer.concat(chunks, bytes).toString();
|
|
6416
|
+
}
|
|
6329
6417
|
/** 生成 Robots.txt */
|
|
6330
6418
|
generateRobotsTxt() {
|
|
6331
6419
|
return [
|
|
@@ -6517,6 +6605,17 @@ function resolveSitemapLastModified(config) {
|
|
|
6517
6605
|
for (const { path, modifiedTime } of config.runtime?.seo?.fallbackLocal ?? []) if (typeof path === "string" && typeof modifiedTime === "string" && !timestamps.has(path)) timestamps.set(path, modifiedTime);
|
|
6518
6606
|
return timestamps;
|
|
6519
6607
|
}
|
|
6608
|
+
function resolveSitemapLoader(config, engine) {
|
|
6609
|
+
const seo = config.runtime?.seo;
|
|
6610
|
+
const source = seo?.sitemap;
|
|
6611
|
+
if (!source) return;
|
|
6612
|
+
const sitemap = engine ?? SEOEngine.getInstance({ baseUrl: resolveSeoConfig(config).baseUrl });
|
|
6613
|
+
return {
|
|
6614
|
+
ttl: source.ttl ?? seo.ttl,
|
|
6615
|
+
staleIfErrorMs: source.staleIfErrorMs ?? 3e5,
|
|
6616
|
+
load: async () => sitemap.generatePublishedSitemap(await source.load({ services: config.runtime.services }))
|
|
6617
|
+
};
|
|
6618
|
+
}
|
|
6520
6619
|
// src/experiments/ExposureQueue.ts
|
|
6521
6620
|
/**
|
|
6522
6621
|
* ExposureQueue —— 曝光事件批量上报队列
|
|
@@ -6917,7 +7016,6 @@ var FRAMEWORK_SKIP_EXACT = /* @__PURE__ */ new Set([
|
|
|
6917
7016
|
"/robots.txt",
|
|
6918
7017
|
"/favicon.ico"
|
|
6919
7018
|
]);
|
|
6920
|
-
var RSC_POSTFIX = "_.rsc";
|
|
6921
7019
|
function createLocaleRedirectMiddleware(options) {
|
|
6922
7020
|
const { i18n, skipPathPrefixes = [] } = options;
|
|
6923
7021
|
if (!i18n.prefixDefault) return null;
|
|
@@ -6935,8 +7033,8 @@ function createLocaleRedirectMiddleware(options) {
|
|
|
6935
7033
|
for (const p of skipPathPrefixes) if (rawPath.startsWith(p)) return next();
|
|
6936
7034
|
let path = rawPath;
|
|
6937
7035
|
let rscSuffix = "";
|
|
6938
|
-
if (path.endsWith(
|
|
6939
|
-
rscSuffix =
|
|
7036
|
+
if (path.endsWith("_.rsc")) {
|
|
7037
|
+
rscSuffix = RSC_URL_POSTFIX;
|
|
6940
7038
|
path = path.slice(0, -5) || "/";
|
|
6941
7039
|
}
|
|
6942
7040
|
if (path.includes(".")) return next();
|
|
@@ -6950,8 +7048,9 @@ function createLocaleRedirectMiddleware(options) {
|
|
|
6950
7048
|
return;
|
|
6951
7049
|
}
|
|
6952
7050
|
}
|
|
6953
|
-
const cookieLocale =
|
|
7051
|
+
const cookieLocale = (path === "/" ? readLocalePreference(req, i18n) : void 0) ?? readCookie(req, "locale", "first");
|
|
6954
7052
|
const target = (cookieLocale && localePrefixes.has(cookieLocale) ? cookieLocale : null) || selectAcceptableLocale(typeof req.headers["accept-language"] === "string" ? req.headers["accept-language"] : null, i18n);
|
|
7053
|
+
res.set("Cache-Control", "no-store");
|
|
6955
7054
|
if (target === null) {
|
|
6956
7055
|
res.vary("Accept-Language").vary("Cookie").status(406).end();
|
|
6957
7056
|
return;
|
|
@@ -6964,19 +7063,92 @@ function createLocaleRedirectMiddleware(options) {
|
|
|
6964
7063
|
redirectLocale(res, 302, prefix, path, rscSuffix, req.url);
|
|
6965
7064
|
};
|
|
6966
7065
|
}
|
|
6967
|
-
|
|
6968
|
-
|
|
6969
|
-
|
|
6970
|
-
|
|
6971
|
-
|
|
6972
|
-
|
|
6973
|
-
|
|
6974
|
-
|
|
6975
|
-
|
|
6976
|
-
|
|
7066
|
+
// src/server/contentRevalidationRoute.ts
|
|
7067
|
+
var parsePublication = express.json({
|
|
7068
|
+
limit: "64kb",
|
|
7069
|
+
inflate: false
|
|
7070
|
+
});
|
|
7071
|
+
var requireJson = (req, res, next) => {
|
|
7072
|
+
if (!req.is("application/json")) {
|
|
7073
|
+
res.status(415).json({ error: "Expected application/json" });
|
|
7074
|
+
return;
|
|
7075
|
+
}
|
|
7076
|
+
parsePublication(req, res, next);
|
|
7077
|
+
};
|
|
7078
|
+
var rejectInvalidJson = (error, _req, res, _next) => {
|
|
7079
|
+
const status = error.status === 413 || error.status === 415 ? error.status : 400;
|
|
7080
|
+
res.status(status).json({ error: "Invalid content publication JSON" });
|
|
7081
|
+
};
|
|
7082
|
+
var applyPublication = async (req, res) => {
|
|
7083
|
+
try {
|
|
7084
|
+
await revalidateContent(req.body);
|
|
7085
|
+
res.status(204).end();
|
|
7086
|
+
} catch (error) {
|
|
7087
|
+
if (error instanceof TypeError) {
|
|
7088
|
+
res.status(400).json({ error: error.message });
|
|
7089
|
+
return;
|
|
6977
7090
|
}
|
|
7091
|
+
logger$8.error("[Ops] Content revalidation failed", error);
|
|
7092
|
+
res.status(503).json({ error: "Content revalidation unavailable" });
|
|
6978
7093
|
}
|
|
6979
|
-
|
|
7094
|
+
};
|
|
7095
|
+
function mountContentRevalidationRoute(app, ops) {
|
|
7096
|
+
const requirePost = (req, res, next) => {
|
|
7097
|
+
res.set("Cache-Control", "no-store");
|
|
7098
|
+
if (!ops.contentRevalidation.enabled) {
|
|
7099
|
+
res.status(404).end();
|
|
7100
|
+
return;
|
|
7101
|
+
}
|
|
7102
|
+
if (req.method !== "POST") {
|
|
7103
|
+
res.set("Allow", "POST").status(405).end();
|
|
7104
|
+
return;
|
|
7105
|
+
}
|
|
7106
|
+
next();
|
|
7107
|
+
};
|
|
7108
|
+
app.all(CONTENT_REVALIDATION_PATH, requirePost, getOpsRequestLimiter(ops), createOpsAuthMiddleware("contentRevalidation", ops), requireJson, rejectInvalidJson, applyPublication);
|
|
7109
|
+
}
|
|
7110
|
+
// src/server/publishedSitemap.ts
|
|
7111
|
+
function createPublishedSitemap(config, engine) {
|
|
7112
|
+
const source = resolveSitemapLoader(config, engine);
|
|
7113
|
+
if (!source) return;
|
|
7114
|
+
const cached = createCachedFetcher({
|
|
7115
|
+
key: () => "sitemap",
|
|
7116
|
+
ttl: source.ttl,
|
|
7117
|
+
staleIfErrorMs: source.staleIfErrorMs,
|
|
7118
|
+
max: 1,
|
|
7119
|
+
async fetch() {
|
|
7120
|
+
try {
|
|
7121
|
+
return await source.load();
|
|
7122
|
+
} catch (error) {
|
|
7123
|
+
logger$8.warn("[SEO] Publication sitemap refresh failed", error);
|
|
7124
|
+
throw error;
|
|
7125
|
+
}
|
|
7126
|
+
}
|
|
7127
|
+
});
|
|
7128
|
+
let generation = 0;
|
|
7129
|
+
return {
|
|
7130
|
+
async serve(res) {
|
|
7131
|
+
const isOpen = () => !res.destroyed && !res.writableEnded;
|
|
7132
|
+
while (isOpen()) {
|
|
7133
|
+
const current = generation;
|
|
7134
|
+
try {
|
|
7135
|
+
const xml = await cached(void 0);
|
|
7136
|
+
if (current !== generation) continue;
|
|
7137
|
+
if (isOpen()) res.type("application/xml").set("Cache-Control", "no-cache").end(xml);
|
|
7138
|
+
} catch {
|
|
7139
|
+
if (current !== generation) continue;
|
|
7140
|
+
if (isOpen()) res.status(503).type("text/plain").set("Cache-Control", "no-store").end("Sitemap unavailable");
|
|
7141
|
+
}
|
|
7142
|
+
return;
|
|
7143
|
+
}
|
|
7144
|
+
},
|
|
7145
|
+
close: registerContentInvalidator(({ sitemap }) => {
|
|
7146
|
+
if (sitemap) {
|
|
7147
|
+
generation++;
|
|
7148
|
+
cached.invalidate();
|
|
7149
|
+
}
|
|
7150
|
+
})
|
|
7151
|
+
};
|
|
6980
7152
|
}
|
|
6981
7153
|
// src/security/staticCspManifest.ts
|
|
6982
7154
|
var STATIC_CSP_MANIFEST = "static-csp-manifest.json";
|
|
@@ -7309,12 +7481,13 @@ async function createProductionRuntime(config, options = {}) {
|
|
|
7309
7481
|
const app = express();
|
|
7310
7482
|
app.disable("x-powered-by");
|
|
7311
7483
|
app.set("trust proxy", config.server.trustProxy ?? false);
|
|
7312
|
-
app.use(createProductionJsonMiddleware());
|
|
7313
7484
|
const opsConfig = resolveOpsConfig(config, "production");
|
|
7314
7485
|
for (const warning of opsConfig.warnings) logger$8.warn(`[Ops] ${warning}`);
|
|
7315
7486
|
app.use(createCspNonceMiddleware());
|
|
7316
7487
|
app.use(createSecurityMiddleware(false, extraConnectSrc));
|
|
7317
7488
|
app.use(createCompressionMiddleware());
|
|
7489
|
+
mountContentRevalidationRoute(app, opsConfig);
|
|
7490
|
+
app.use(createProductionJsonMiddleware());
|
|
7318
7491
|
if (extraConnectSrc.length > 0) logger$8.info(`🔒 CSP connect-src 加入:${extraConnectSrc.join(", ")}`);
|
|
7319
7492
|
const cookieDomain = runtime?.cookieDomain;
|
|
7320
7493
|
app.use((req, res, next) => {
|
|
@@ -7322,6 +7495,14 @@ async function createProductionRuntime(config, options = {}) {
|
|
|
7322
7495
|
if (needsAnonCookie) applyAnonCookie(res, data.anonId, cookieDomain);
|
|
7323
7496
|
requestContext.run(data, () => next());
|
|
7324
7497
|
});
|
|
7498
|
+
const seoCfg = resolveSeoConfig(config);
|
|
7499
|
+
const seo = SEOEngine.getInstance({ baseUrl: seoCfg.baseUrl });
|
|
7500
|
+
const publishedSitemap = createPublishedSitemap(config, seo);
|
|
7501
|
+
if (publishedSitemap) cleanups.push(publishedSitemap.close);
|
|
7502
|
+
cleanups.push(() => seo.shutdown());
|
|
7503
|
+
await seo.initialize();
|
|
7504
|
+
const seoRequests = createSeoRequestMiddleware(config.server.requestLimits?.seo, publishedSitemap);
|
|
7505
|
+
if (publishedSitemap) app.use(seoRequests);
|
|
7325
7506
|
if (runtime?.i18n?.prefixDefault) {
|
|
7326
7507
|
const middleware = createLocaleRedirectMiddleware({ i18n: resolveI18nConfig(runtime.i18n) });
|
|
7327
7508
|
if (middleware) {
|
|
@@ -7364,21 +7545,9 @@ async function createProductionRuntime(config, options = {}) {
|
|
|
7364
7545
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
7365
7546
|
});
|
|
7366
7547
|
});
|
|
7367
|
-
options.setupRoutes?.(app);
|
|
7368
7548
|
const staticHtmlLimiter = createRequestLimiter("staticHtml", config.server.requestLimits?.staticHtml);
|
|
7369
|
-
|
|
7370
|
-
app.use(
|
|
7371
|
-
if (req.method !== "GET" && req.method !== "HEAD") return next();
|
|
7372
|
-
let pathname;
|
|
7373
|
-
try {
|
|
7374
|
-
pathname = normalizeStaticAssetPathname(req.path).toLowerCase().replace(/\/$/, "");
|
|
7375
|
-
} catch {
|
|
7376
|
-
res.status(400).end();
|
|
7377
|
-
return;
|
|
7378
|
-
}
|
|
7379
|
-
if (pathname === "/sitemap.xml" || pathname === "/robots.txt") return seoLimiter(req, res, next);
|
|
7380
|
-
next();
|
|
7381
|
-
});
|
|
7549
|
+
options.setupRoutes?.(app);
|
|
7550
|
+
if (!publishedSitemap) app.use(seoRequests);
|
|
7382
7551
|
app.use(createStaticAssetMiddleware(clientDir));
|
|
7383
7552
|
app.use("/assets", (_req, res) => {
|
|
7384
7553
|
res.status(404).set("Cache-Control", "no-store").end();
|
|
@@ -7451,7 +7620,7 @@ async function createProductionRuntime(config, options = {}) {
|
|
|
7451
7620
|
});
|
|
7452
7621
|
cleanups.push(() => cache.destroy());
|
|
7453
7622
|
if (opsConfig.inventory.enabled) {
|
|
7454
|
-
const { createCacheInspectorMiddleware } = await import("./createCacheInspectorMiddleware-
|
|
7623
|
+
const { createCacheInspectorMiddleware } = await import("./createCacheInspectorMiddleware-glgtcBcQ.js");
|
|
7455
7624
|
app.use(createCacheInspectorMiddleware(cache, opsConfig));
|
|
7456
7625
|
logger$8.info("🔍 ISR cache inventory 已启用:GET /__isr/cache/inventory");
|
|
7457
7626
|
}
|
|
@@ -7484,21 +7653,19 @@ async function createProductionRuntime(config, options = {}) {
|
|
|
7484
7653
|
res.status(500).type("text/plain").end(`metrics error: ${String(err)}`);
|
|
7485
7654
|
}
|
|
7486
7655
|
});
|
|
7487
|
-
|
|
7488
|
-
|
|
7489
|
-
|
|
7490
|
-
|
|
7491
|
-
|
|
7492
|
-
|
|
7493
|
-
|
|
7494
|
-
|
|
7495
|
-
|
|
7496
|
-
|
|
7497
|
-
|
|
7498
|
-
}
|
|
7499
|
-
|
|
7500
|
-
}
|
|
7501
|
-
});
|
|
7656
|
+
if (!publishedSitemap) {
|
|
7657
|
+
const sitemapLastModified = resolveSitemapLastModified(config);
|
|
7658
|
+
app.get("/sitemap.xml", async (_req, res) => {
|
|
7659
|
+
try {
|
|
7660
|
+
const xml = await seo.generateSitemap(extractRoutesForSitemap(config), sitemapLastModified);
|
|
7661
|
+
res.set("content-type", "application/xml; charset=utf-8");
|
|
7662
|
+
res.set("cache-control", "public, max-age=3600");
|
|
7663
|
+
res.end(xml);
|
|
7664
|
+
} catch (err) {
|
|
7665
|
+
res.status(500).type("text/plain").end(`sitemap error: ${String(err)}`);
|
|
7666
|
+
}
|
|
7667
|
+
});
|
|
7668
|
+
}
|
|
7502
7669
|
app.get("/robots.txt", (_req, res) => {
|
|
7503
7670
|
res.set("content-type", "text/plain; charset=utf-8");
|
|
7504
7671
|
res.set("cache-control", "public, max-age=3600");
|
|
@@ -7678,6 +7845,25 @@ function createStaticHtmlMiddlewareWithLimiter(clientDir, index, limiter) {
|
|
|
7678
7845
|
function normalizeStaticAssetPathname(pathname) {
|
|
7679
7846
|
return path.posix.normalize(decodeURIComponent(new URL(`http://localhost${pathname}`).pathname).replaceAll("\\", "/"));
|
|
7680
7847
|
}
|
|
7848
|
+
function createSeoRequestMiddleware(policy, publishedSitemap) {
|
|
7849
|
+
const limiter = createRequestLimiter("seo", policy);
|
|
7850
|
+
return async (req, res, next) => {
|
|
7851
|
+
if (req.method !== "GET" && req.method !== "HEAD") return next();
|
|
7852
|
+
let pathname;
|
|
7853
|
+
try {
|
|
7854
|
+
pathname = normalizeStaticAssetPathname(req.path).toLowerCase().replace(/\/$/, "");
|
|
7855
|
+
} catch {
|
|
7856
|
+
res.status(400).end();
|
|
7857
|
+
return;
|
|
7858
|
+
}
|
|
7859
|
+
if (pathname === "/sitemap.xml" && publishedSitemap) {
|
|
7860
|
+
if (await admitRequest(limiter, req, res)) await publishedSitemap.serve(res);
|
|
7861
|
+
return;
|
|
7862
|
+
}
|
|
7863
|
+
if (pathname === "/sitemap.xml" || pathname === "/robots.txt") return limiter(req, res, next);
|
|
7864
|
+
next();
|
|
7865
|
+
};
|
|
7866
|
+
}
|
|
7681
7867
|
function createStaticAssetMiddleware(clientDir) {
|
|
7682
7868
|
const assets = express.static(clientDir, {
|
|
7683
7869
|
index: false,
|
|
@@ -7889,6 +8075,11 @@ async function initServerContext(config) {
|
|
|
7889
8075
|
if (needsAnonCookie) applyAnonCookie(res, data.anonId, cookieDomain);
|
|
7890
8076
|
requestContext.run(data, () => next());
|
|
7891
8077
|
});
|
|
8078
|
+
const publishedSitemap = config && createPublishedSitemap(config);
|
|
8079
|
+
if (publishedSitemap) {
|
|
8080
|
+
developmentCleanups.push(publishedSitemap.close);
|
|
8081
|
+
serverContext.requestHandler.use(createSeoRequestMiddleware(config?.server.requestLimits?.seo, publishedSitemap));
|
|
8082
|
+
}
|
|
7892
8083
|
if (config?.runtime?.i18n?.prefixDefault) {
|
|
7893
8084
|
const localeRedirect = createLocaleRedirectMiddleware({ i18n: resolveI18nConfig(config.runtime.i18n) });
|
|
7894
8085
|
if (localeRedirect) serverContext.requestHandler.use(localeRedirect);
|
|
@@ -8016,15 +8207,17 @@ var ISRRoutes = class {
|
|
|
8016
8207
|
defaultMode;
|
|
8017
8208
|
routes;
|
|
8018
8209
|
requestLimits;
|
|
8210
|
+
seoAlreadyLimited;
|
|
8019
8211
|
constructor(engine, logger, config) {
|
|
8020
8212
|
this.engine = engine;
|
|
8021
8213
|
this.logger = logger;
|
|
8022
8214
|
this.defaultMode = config.renderMode;
|
|
8023
8215
|
this.routes = config.routes || {};
|
|
8024
8216
|
this.requestLimits = config.requestLimits;
|
|
8217
|
+
this.seoAlreadyLimited = config.seoAlreadyLimited ?? false;
|
|
8025
8218
|
}
|
|
8026
8219
|
setup(requestHandler) {
|
|
8027
|
-
const
|
|
8220
|
+
const seoLimiters = this.seoAlreadyLimited ? [] : [createRequestLimiter("seo", this.requestLimits?.seo)];
|
|
8028
8221
|
const opsConfig = getRuntimeOpsConfig(requestHandler) ?? resolveOpsConfig({ server: { requestLimits: this.requestLimits } }, "development");
|
|
8029
8222
|
if (opsConfig.health.enabled) requestHandler.get("/health", getOpsRequestLimiter(opsConfig), createOpsAuthMiddleware("health", opsConfig), (_req, res) => {
|
|
8030
8223
|
res.json({
|
|
@@ -8036,7 +8229,7 @@ var ISRRoutes = class {
|
|
|
8036
8229
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
8037
8230
|
});
|
|
8038
8231
|
});
|
|
8039
|
-
requestHandler.get("/sitemap.xml",
|
|
8232
|
+
requestHandler.get("/sitemap.xml", ...seoLimiters, async (_req, res) => {
|
|
8040
8233
|
try {
|
|
8041
8234
|
const candidates = [
|
|
8042
8235
|
path.resolve(process.cwd(), "dist/client/sitemap.xml"),
|
|
@@ -8061,7 +8254,7 @@ var ISRRoutes = class {
|
|
|
8061
8254
|
res.status(500).send("Internal Server Error");
|
|
8062
8255
|
}
|
|
8063
8256
|
});
|
|
8064
|
-
requestHandler.get("/robots.txt",
|
|
8257
|
+
requestHandler.get("/robots.txt", ...seoLimiters, async (_req, res) => {
|
|
8065
8258
|
try {
|
|
8066
8259
|
const candidates = [
|
|
8067
8260
|
path.resolve(process.cwd(), "dist/client/robots.txt"),
|
|
@@ -8262,7 +8455,8 @@ var ISREngine = class {
|
|
|
8262
8455
|
new ISRRoutes(this, this.logger, {
|
|
8263
8456
|
renderMode: this.config.renderMode,
|
|
8264
8457
|
routes: this.config.routes,
|
|
8265
|
-
requestLimits: this.config.server.requestLimits
|
|
8458
|
+
requestLimits: this.config.server.requestLimits,
|
|
8459
|
+
seoAlreadyLimited: Boolean(this.config.runtime.seo?.sitemap)
|
|
8266
8460
|
}).setup(requestHandler);
|
|
8267
8461
|
});
|
|
8268
8462
|
return this.serverContext;
|
|
@@ -8281,7 +8475,7 @@ var ISREngine = class {
|
|
|
8281
8475
|
await fs.promises.mkdir(outputDir, { recursive: true });
|
|
8282
8476
|
const robotsTxt = this.seoEngine.generateRobotsTxt();
|
|
8283
8477
|
await fs.promises.writeFile(path.join(outputDir, "robots.txt"), robotsTxt, "utf-8");
|
|
8284
|
-
const sitemapXml = await this.seoEngine.generateSitemap(void 0, resolveSitemapLastModified(this.config));
|
|
8478
|
+
const sitemapXml = await (resolveSitemapLoader(this.config, this.seoEngine)?.load() ?? this.seoEngine.generateSitemap(void 0, resolveSitemapLastModified(this.config)));
|
|
8285
8479
|
await fs.promises.writeFile(path.join(outputDir, "sitemap.xml"), sitemapXml, "utf-8");
|
|
8286
8480
|
}
|
|
8287
8481
|
/**
|
|
@@ -8340,6 +8534,6 @@ async function createISRApp(appOption) {
|
|
|
8340
8534
|
shutdown: async () => engine.shutdown()
|
|
8341
8535
|
};
|
|
8342
8536
|
}
|
|
8343
|
-
export { parseComponents as $, invalidatorRunsTotal as A, InternalStrategies as B, createCoherentCacheStore as C, loadConfig as D, getOpsRequestLimiter as E, getFallbackChain as F, DEFAULT_PORT as G, extractSsgRoutes as H, getRouteFallbackChain as I, DEFAULT_SCAN_CONFIG as J, package_default as K, matchRoutePattern as L, recordHttpRequest as M, createHybridCacheStore as N, createPrometheusMetricsMiddleware as O, createMemoryCacheStore as P, parseComponentFromFile as Q, resolveRenderMode as R, MemoryCacheAdapter as S, createOpsAuthMiddleware as T, spiderSsgRoutes as U, RenderModes as V, logger$8 as W, scanProject as X, scanComponents as Y, scanRoutes as Z, requestPinnedImage as _, closeServer as a, isDev as at, RedisInvalidationBus as b, prepareProductionBuild as c, CacheCleanup as ct, SEOEngine as d,
|
|
8537
|
+
export { parseComponents as $, invalidatorRunsTotal as A, InternalStrategies as B, createCoherentCacheStore as C, loadConfig as D, getOpsRequestLimiter as E, getFallbackChain as F, DEFAULT_PORT as G, extractSsgRoutes as H, getRouteFallbackChain as I, DEFAULT_SCAN_CONFIG as J, package_default as K, matchRoutePattern as L, recordHttpRequest as M, createHybridCacheStore as N, createPrometheusMetricsMiddleware as O, createMemoryCacheStore as P, parseComponentFromFile as Q, resolveRenderMode as R, MemoryCacheAdapter as S, createOpsAuthMiddleware as T, spiderSsgRoutes as U, RenderModes as V, logger$8 as W, scanProject as X, scanComponents as Y, scanRoutes as Z, requestPinnedImage as _, closeServer as a, isDev as at, RedisInvalidationBus as b, prepareProductionBuild as c, CacheCleanup as ct, SEOEngine as d, parseRouteFromFile as et, createSEOEngine as f, createImagePlugin as g, createImageMiddleware as h, startAppServer as i, readDirRecursive as it, promRegistry as j, invalidatorFailuresTotal as k, generateStaticCspManifest as l, Logger as lt, mergeSEOConfig as m, ISREngine as n, isCodeFile as nt, startServer as o, isProd as ot, DEFAULT_SEO_CONFIG as p, resolveFetchHandler as q, shutdownServer as r, isTestFile as rt, createProductionRuntime as s, getEnv as st, createISRApp as t, parseRoutes as tt, createABVariantMiddleware as u, resolveImageOptions as ut, createIsrCacheHandler as v, createDevAssetRequestMiddleware as w, RedisCacheAdapter as x, createIsrCacheMiddleware as y, FallbackChain as z };
|
|
8344
8538
|
|
|
8345
|
-
//# sourceMappingURL=createISRApp-
|
|
8539
|
+
//# sourceMappingURL=createISRApp-BG-s3uuL.js.map
|