isr-engine 2.0.0 → 3.0.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 +4 -10
- package/dist/{abVariantContext-Cqp-uxtd.cjs → abVariantContext-BcnxBn4V.cjs} +17 -257
- package/dist/abVariantContext-BcnxBn4V.cjs.map +1 -0
- package/dist/{abVariantContext-CWCdRSdG.js → abVariantContext-BmZZi1YZ.js} +12 -205
- package/dist/abVariantContext-BmZZi1YZ.js.map +1 -0
- package/dist/cli/cli.cjs +1 -1
- package/dist/cli/cli.js +1 -1
- package/dist/{createCacheInspectorMiddleware-B0Eiy7nh.js → createCacheInspectorMiddleware-BY6MX88X.js} +2 -2
- package/dist/{createCacheInspectorMiddleware-B0Eiy7nh.js.map → createCacheInspectorMiddleware-BY6MX88X.js.map} +1 -1
- package/dist/{createCacheInspectorMiddleware-1ZChBvIw.cjs → createCacheInspectorMiddleware-DZr98Zfn.cjs} +2 -2
- package/dist/{createCacheInspectorMiddleware-1ZChBvIw.cjs.map → createCacheInspectorMiddleware-DZr98Zfn.cjs.map} +1 -1
- package/dist/{createISRApp-DBichmCL.cjs → createISRApp-CHiiWF3P.cjs} +251 -22
- package/dist/createISRApp-CHiiWF3P.cjs.map +1 -0
- package/dist/{createISRApp-9PZON4FE.js → createISRApp-CS6XfjHl.js} +217 -18
- package/dist/createISRApp-CS6XfjHl.js.map +1 -0
- package/dist/{createImagePlugin-ClEnkrXE.cjs → createImagePlugin-BtJzr0t-.cjs} +2 -2
- package/dist/{createImagePlugin-ClEnkrXE.cjs.map → createImagePlugin-BtJzr0t-.cjs.map} +1 -1
- package/dist/{createImagePlugin-D15Xb8hZ.js → createImagePlugin-Ddo5t3dJ.js} +2 -2
- package/dist/{createImagePlugin-D15Xb8hZ.js.map → createImagePlugin-Ddo5t3dJ.js.map} +1 -1
- package/dist/isr-engine.cjs +47 -27
- package/dist/isr-engine.cjs.map +1 -1
- package/dist/isr-engine.js +42 -22
- package/dist/isr-engine.js.map +1 -1
- package/dist/metrics/PromMetrics.d.ts.map +1 -1
- package/dist/plugin/createDevCssHandoffPlugin.d.ts.map +1 -1
- package/dist/plugin/createIsrPlugin.d.ts.map +1 -1
- package/dist/rsc/index.cjs +2 -2
- package/dist/rsc/index.js +2 -2
- package/dist/rsc/revalidate.d.ts.map +1 -1
- package/dist/rsc/revalidationMetrics.d.ts +6 -0
- package/dist/rsc/revalidationMetrics.d.ts.map +1 -0
- package/dist/{rsc-lvWPTuVD.js → rsc-BSxvkPHd.js} +2 -2
- package/dist/{rsc-lvWPTuVD.js.map → rsc-BSxvkPHd.js.map} +1 -1
- package/dist/{rsc-H7D_meHu.cjs → rsc-NB-Uka7j.cjs} +2 -2
- package/dist/{rsc-H7D_meHu.cjs.map → rsc-NB-Uka7j.cjs.map} +1 -1
- package/package.json +7 -10
- package/src/defaults/runtime/dev-style-resource-dispatcher.server.ts +1 -1
- package/dist/abVariantContext-CWCdRSdG.js.map +0 -1
- package/dist/abVariantContext-Cqp-uxtd.cjs.map +0 -1
- package/dist/createISRApp-9PZON4FE.js.map +0 -1
- package/dist/createISRApp-DBichmCL.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
2
|
import { c as requestContext, i as getRequestContext } from "./RequestContext-BVQ-rOmV.js";
|
|
3
|
-
import { a as isUncacheable,
|
|
3
|
+
import { a as isUncacheable, f as setRevalidationMetricRecorder, l as registerInvalidator, p as Logger, r as collectTags, s as runWithTagStore } from "./abVariantContext-BmZZi1YZ.js";
|
|
4
4
|
import { a as withLocale, c as parseCookieHeader, i as resolveI18nConfig, l as readCookie, n as negotiateLocale } from "./i18n-Dobe0Wxn.js";
|
|
5
5
|
import fs, { createReadStream } from "node:fs";
|
|
6
6
|
import path from "node:path";
|
|
@@ -22,6 +22,7 @@ import { Readable } from "node:stream";
|
|
|
22
22
|
import os from "node:os";
|
|
23
23
|
import http from "node:http";
|
|
24
24
|
import { LRUCache } from "lru-cache";
|
|
25
|
+
import { Counter, Gauge, Histogram, Registry, collectDefaultMetrics } from "prom-client";
|
|
25
26
|
import { pathToFileURL as pathToFileURL$1 } from "url";
|
|
26
27
|
import { createHash as createHash$1, randomUUID as randomUUID$1 } from "crypto";
|
|
27
28
|
import * as esbuild from "esbuild";
|
|
@@ -1326,7 +1327,7 @@ function resolveFetchHandler(module) {
|
|
|
1326
1327
|
}
|
|
1327
1328
|
var package_default = {
|
|
1328
1329
|
name: "isr-engine",
|
|
1329
|
-
version: "
|
|
1330
|
+
version: "3.0.0",
|
|
1330
1331
|
description: "ISR/SSG/Fallback rendering orchestration on Vite + React 19 RSC.",
|
|
1331
1332
|
license: "UNLICENSED",
|
|
1332
1333
|
repository: {
|
|
@@ -1433,7 +1434,7 @@ var package_default = {
|
|
|
1433
1434
|
engines: { "node": "24.15.0" },
|
|
1434
1435
|
packageManager: "pnpm@9.15.9",
|
|
1435
1436
|
dependencies: {
|
|
1436
|
-
"@vitejs/plugin-rsc": "0.5.
|
|
1437
|
+
"@vitejs/plugin-rsc": "0.5.39",
|
|
1437
1438
|
"chalk": "^6.0.1",
|
|
1438
1439
|
"commander": "^12.1.0",
|
|
1439
1440
|
"compression": "^1.8.2",
|
|
@@ -1446,15 +1447,14 @@ var package_default = {
|
|
|
1446
1447
|
"ora": "^10.0.0",
|
|
1447
1448
|
"parse5": "^8.0.1",
|
|
1448
1449
|
"prom-client": "^15.1.3",
|
|
1450
|
+
"rsc-html-stream": "0.0.7",
|
|
1449
1451
|
"sharp": "^0.35.5",
|
|
1450
1452
|
"sitemap": "^10.0.0",
|
|
1451
1453
|
"typescript": "^6.0.3"
|
|
1452
1454
|
},
|
|
1453
1455
|
peerDependencies: {
|
|
1454
|
-
"react": "19.3.
|
|
1455
|
-
"react-dom": "19.3.
|
|
1456
|
-
"react-server-dom-webpack": "19.3.0-canary-bd6ea412-20260824",
|
|
1457
|
-
"rsc-html-stream": "^0.0.7",
|
|
1456
|
+
"react": "19.3.1",
|
|
1457
|
+
"react-dom": "19.3.1",
|
|
1458
1458
|
"vite": "8.1.6"
|
|
1459
1459
|
},
|
|
1460
1460
|
optionalDependencies: { "ioredis": "^5.11.1" },
|
|
@@ -1486,11 +1486,9 @@ var package_default = {
|
|
|
1486
1486
|
"ioredis-mock": "^8.9.0",
|
|
1487
1487
|
"miniflare": "4.20260730.0",
|
|
1488
1488
|
"prettier": "^3.10.1",
|
|
1489
|
-
"react": "19.3.
|
|
1490
|
-
"react-dom": "19.3.
|
|
1491
|
-
"react-server-dom-webpack": "19.3.0-canary-bd6ea412-20260824",
|
|
1489
|
+
"react": "19.3.1",
|
|
1490
|
+
"react-dom": "19.3.1",
|
|
1492
1491
|
"rimraf": "^6.1.4",
|
|
1493
|
-
"rsc-html-stream": "^0.0.7",
|
|
1494
1492
|
"sass-embedded": "^1.108.2",
|
|
1495
1493
|
"semantic-release": "25.0.9",
|
|
1496
1494
|
"tsc-alias": "^1.9.10",
|
|
@@ -2317,6 +2315,207 @@ function createHybridCacheStore(opts) {
|
|
|
2317
2315
|
};
|
|
2318
2316
|
}
|
|
2319
2317
|
//#endregion
|
|
2318
|
+
//#region src/metrics/PromMetrics.ts
|
|
2319
|
+
/**
|
|
2320
|
+
* PromMetrics —— prom-client 包装,导出 Prometheus 文本格式
|
|
2321
|
+
*
|
|
2322
|
+
* 设计:
|
|
2323
|
+
* - prom-client 是 Node 生态的事实标准(Grafana / Datadog / Prometheus 直接抓取)
|
|
2324
|
+
* - 单 Registry,避免污染全局;用户业务可拿 `promRegistry` 自行注册自家 metric
|
|
2325
|
+
* - 响应时间用 Histogram(带桶),不是平均值 —— 才能正确算 P95/P99
|
|
2326
|
+
* - 默认采集 process_*(CPU / RSS / event-loop lag)—— 一行 collectDefaultMetrics
|
|
2327
|
+
*/
|
|
2328
|
+
var PromMetrics_exports = /* @__PURE__ */ __exportAll({
|
|
2329
|
+
cacheEntriesGauge: () => cacheEntriesGauge,
|
|
2330
|
+
cacheHitsTotal: () => cacheHitsTotal,
|
|
2331
|
+
cacheRevalidatingGauge: () => cacheRevalidatingGauge,
|
|
2332
|
+
createPrometheusMetricsMiddleware: () => createPrometheusMetricsMiddleware,
|
|
2333
|
+
httpRequestDurationSeconds: () => httpRequestDurationSeconds,
|
|
2334
|
+
httpRequestsTotal: () => httpRequestsTotal,
|
|
2335
|
+
invalidatorFailuresTotal: () => invalidatorFailuresTotal,
|
|
2336
|
+
invalidatorRunsTotal: () => invalidatorRunsTotal,
|
|
2337
|
+
l2ReadTimeoutsTotal: () => l2ReadTimeoutsTotal,
|
|
2338
|
+
normalizeRoute: () => normalizeRoute,
|
|
2339
|
+
promRegistry: () => promRegistry,
|
|
2340
|
+
recordHttpRequest: () => recordHttpRequest
|
|
2341
|
+
});
|
|
2342
|
+
var promRegistry = new Registry();
|
|
2343
|
+
collectDefaultMetrics({
|
|
2344
|
+
register: promRegistry,
|
|
2345
|
+
prefix: "isr_"
|
|
2346
|
+
});
|
|
2347
|
+
var httpRequestsTotal = new Counter({
|
|
2348
|
+
name: "isr_http_requests_total",
|
|
2349
|
+
help: "Total ISR HTTP requests",
|
|
2350
|
+
labelNames: [
|
|
2351
|
+
"method",
|
|
2352
|
+
"route",
|
|
2353
|
+
"status",
|
|
2354
|
+
"mode",
|
|
2355
|
+
"cache"
|
|
2356
|
+
],
|
|
2357
|
+
registers: [promRegistry]
|
|
2358
|
+
});
|
|
2359
|
+
var httpRequestDurationSeconds = new Histogram({
|
|
2360
|
+
name: "isr_http_request_duration_seconds",
|
|
2361
|
+
help: "ISR HTTP request duration",
|
|
2362
|
+
labelNames: [
|
|
2363
|
+
"method",
|
|
2364
|
+
"route",
|
|
2365
|
+
"mode",
|
|
2366
|
+
"cache"
|
|
2367
|
+
],
|
|
2368
|
+
buckets: [
|
|
2369
|
+
.001,
|
|
2370
|
+
.005,
|
|
2371
|
+
.01,
|
|
2372
|
+
.025,
|
|
2373
|
+
.05,
|
|
2374
|
+
.1,
|
|
2375
|
+
.25,
|
|
2376
|
+
.5,
|
|
2377
|
+
1,
|
|
2378
|
+
2.5,
|
|
2379
|
+
5
|
|
2380
|
+
],
|
|
2381
|
+
registers: [promRegistry]
|
|
2382
|
+
});
|
|
2383
|
+
var cacheEntriesGauge = new Gauge({
|
|
2384
|
+
name: "isr_cache_entries",
|
|
2385
|
+
help: "Current ISR cache entries (L1 LRU size)",
|
|
2386
|
+
labelNames: ["backend"],
|
|
2387
|
+
registers: [promRegistry]
|
|
2388
|
+
});
|
|
2389
|
+
var cacheRevalidatingGauge = new Gauge({
|
|
2390
|
+
name: "isr_cache_revalidating_inflight",
|
|
2391
|
+
help: "Number of in-flight background revalidations",
|
|
2392
|
+
registers: [promRegistry]
|
|
2393
|
+
});
|
|
2394
|
+
var cacheHitsTotal = new Counter({
|
|
2395
|
+
name: "isr_cache_hits_total",
|
|
2396
|
+
help: "ISR cache hits",
|
|
2397
|
+
labelNames: ["status"],
|
|
2398
|
+
registers: [promRegistry]
|
|
2399
|
+
});
|
|
2400
|
+
var invalidatorRunsTotal = new Counter({
|
|
2401
|
+
name: "isr_invalidator_runs_total",
|
|
2402
|
+
help: "Total revalidate dispatches (one increment per revalidatePath/Tag call with ≥1 invalidator)",
|
|
2403
|
+
labelNames: ["kind", "target"],
|
|
2404
|
+
registers: [promRegistry]
|
|
2405
|
+
});
|
|
2406
|
+
var invalidatorFailuresTotal = new Counter({
|
|
2407
|
+
name: "isr_invalidator_failures_total",
|
|
2408
|
+
help: "Per-invalidator failures during revalidate dispatch (one increment per failing invalidator)",
|
|
2409
|
+
labelNames: ["kind", "target"],
|
|
2410
|
+
registers: [promRegistry]
|
|
2411
|
+
});
|
|
2412
|
+
var l2ReadTimeoutsTotal = new Counter({
|
|
2413
|
+
name: "isr_l2_read_timeouts_total",
|
|
2414
|
+
help: "L2 cache async read timeouts (raceWithTimeout fired before underlying promise resolved)",
|
|
2415
|
+
registers: [promRegistry]
|
|
2416
|
+
});
|
|
2417
|
+
/**
|
|
2418
|
+
* 路由归一化 —— 防 Prometheus label 基数爆炸。
|
|
2419
|
+
*
|
|
2420
|
+
* 动态段(id / uuid / hex / 长 hash)直接作为 label 值会让时间序列数爆炸
|
|
2421
|
+
* (每个 /books/123 都是新序列),Prometheus 存储成本线性暴涨、查询变慢。
|
|
2422
|
+
*
|
|
2423
|
+
* 规则:
|
|
2424
|
+
* - 纯数字段(1 ~ 20 位) → `:id`
|
|
2425
|
+
* - UUID v1-v5 → `:uuid`
|
|
2426
|
+
* - 长 hex(≥16 字符全 hex)→ `:hash`
|
|
2427
|
+
* - base64url/大小写混合长串(≥24 字符,含数字和字母)→ `:hash`
|
|
2428
|
+
*
|
|
2429
|
+
* 命中任意规则即替换;其他保留原样(`/books` `/about` 保留)。
|
|
2430
|
+
*
|
|
2431
|
+
* 可用 `addRouteNormalizeRule(pattern, replacement)` 扩展业务特有规则。
|
|
2432
|
+
*/
|
|
2433
|
+
var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
2434
|
+
var LONG_HEX_RE = /^[0-9a-f]{16,}$/i;
|
|
2435
|
+
var OPAQUE_ID_RE = /^[A-Za-z0-9_-]{24,}$/;
|
|
2436
|
+
var PURE_DIGIT_RE = /^\d{1,20}$/;
|
|
2437
|
+
var customRules = [];
|
|
2438
|
+
function normalizeRoute(route) {
|
|
2439
|
+
if (!route || route === "/") return "/";
|
|
2440
|
+
const segments = route.split("/");
|
|
2441
|
+
for (let i = 0; i < segments.length; i++) {
|
|
2442
|
+
const seg = segments[i];
|
|
2443
|
+
if (!seg) continue;
|
|
2444
|
+
let replaced = null;
|
|
2445
|
+
for (const rule of customRules) {
|
|
2446
|
+
replaced = rule(seg);
|
|
2447
|
+
if (replaced) break;
|
|
2448
|
+
}
|
|
2449
|
+
if (replaced) {
|
|
2450
|
+
segments[i] = replaced;
|
|
2451
|
+
continue;
|
|
2452
|
+
}
|
|
2453
|
+
if (PURE_DIGIT_RE.test(seg)) segments[i] = ":id";
|
|
2454
|
+
else if (UUID_RE.test(seg)) segments[i] = ":uuid";
|
|
2455
|
+
else if (LONG_HEX_RE.test(seg)) segments[i] = ":hash";
|
|
2456
|
+
else if (OPAQUE_ID_RE.test(seg)) segments[i] = ":hash";
|
|
2457
|
+
}
|
|
2458
|
+
return segments.join("/");
|
|
2459
|
+
}
|
|
2460
|
+
setRevalidationMetricRecorder((event, kind, target) => {
|
|
2461
|
+
(event === "run" ? invalidatorRunsTotal : invalidatorFailuresTotal).inc({
|
|
2462
|
+
kind,
|
|
2463
|
+
target: kind === "path" ? normalizeRoute(target) : target
|
|
2464
|
+
});
|
|
2465
|
+
});
|
|
2466
|
+
/** 一行调用更新所有计数 —— 给 isrCacheMiddleware / 中间件用 */
|
|
2467
|
+
function recordHttpRequest(opts) {
|
|
2468
|
+
const route = normalizeRoute(opts.route);
|
|
2469
|
+
httpRequestsTotal.inc({
|
|
2470
|
+
method: opts.method,
|
|
2471
|
+
route,
|
|
2472
|
+
status: String(opts.status),
|
|
2473
|
+
mode: opts.mode,
|
|
2474
|
+
cache: opts.cache
|
|
2475
|
+
});
|
|
2476
|
+
httpRequestDurationSeconds.observe({
|
|
2477
|
+
method: opts.method,
|
|
2478
|
+
route,
|
|
2479
|
+
mode: opts.mode,
|
|
2480
|
+
cache: opts.cache
|
|
2481
|
+
}, opts.durationMs / 1e3);
|
|
2482
|
+
if (opts.cache) cacheHitsTotal.inc({ status: opts.cache });
|
|
2483
|
+
}
|
|
2484
|
+
/**
|
|
2485
|
+
* Express / connect 中间件:暴露 /metrics 端点(Prometheus text exposition format)
|
|
2486
|
+
*
|
|
2487
|
+
* 认证:可选 Bearer token —— 未设 token 时保持旧行为(匿名可访问)。
|
|
2488
|
+
* 生产建议:`createPrometheusMetricsMiddleware({ token: process.env.METRICS_TOKEN })`。
|
|
2489
|
+
*/
|
|
2490
|
+
function createPrometheusMetricsMiddleware(pathOrOptions = {}) {
|
|
2491
|
+
const options = typeof pathOrOptions === "string" ? { path: pathOrOptions } : pathOrOptions;
|
|
2492
|
+
const path = options.path ?? "/metrics";
|
|
2493
|
+
const token = options.token && options.token !== "" ? options.token : null;
|
|
2494
|
+
const unauthorizedStatus = options.unauthorizedStatus ?? 401;
|
|
2495
|
+
return async function(req, res, next) {
|
|
2496
|
+
if (req.url !== path || req.method !== "GET") return next();
|
|
2497
|
+
if (token) {
|
|
2498
|
+
const authHeader = req.headers?.["authorization"];
|
|
2499
|
+
const raw = Array.isArray(authHeader) ? authHeader[0] : authHeader;
|
|
2500
|
+
if (!(typeof raw === "string" && raw === `Bearer ${token}`)) {
|
|
2501
|
+
res.statusCode = unauthorizedStatus;
|
|
2502
|
+
res.setHeader("WWW-Authenticate", "Bearer realm=\"metrics\"");
|
|
2503
|
+
res.end("Unauthorized");
|
|
2504
|
+
return;
|
|
2505
|
+
}
|
|
2506
|
+
}
|
|
2507
|
+
try {
|
|
2508
|
+
const body = await promRegistry.metrics();
|
|
2509
|
+
res.setHeader("content-type", promRegistry.contentType);
|
|
2510
|
+
res.statusCode = 200;
|
|
2511
|
+
res.end(body);
|
|
2512
|
+
} catch (err) {
|
|
2513
|
+
res.statusCode = 500;
|
|
2514
|
+
res.end(`metrics error: ${err instanceof Error ? err.message : String(err)}`);
|
|
2515
|
+
}
|
|
2516
|
+
};
|
|
2517
|
+
}
|
|
2518
|
+
//#endregion
|
|
2320
2519
|
//#region src/config/loadConfig.ts
|
|
2321
2520
|
/**
|
|
2322
2521
|
* 配置加载工具
|
|
@@ -4404,13 +4603,13 @@ function createIsrCacheMiddleware(explicitConfig, options = {}) {
|
|
|
4404
4603
|
development: true
|
|
4405
4604
|
}));
|
|
4406
4605
|
try {
|
|
4407
|
-
const inspector = opsConfig.inventory.enabled ? (await import("./createCacheInspectorMiddleware-
|
|
4606
|
+
const inspector = opsConfig.inventory.enabled ? (await import("./createCacheInspectorMiddleware-BY6MX88X.js")).createCacheInspectorMiddleware(nextHandler, opsConfig) : void 0;
|
|
4408
4607
|
handler = nextHandler;
|
|
4409
4608
|
server.middlewares.use((req, res, next) => {
|
|
4410
4609
|
if (handler !== nextHandler) return next();
|
|
4411
4610
|
if (opsConfig.metrics.enabled && req.url === "/metrics" && req.method === "GET") {
|
|
4412
4611
|
createOpsAuthMiddleware("metrics", opsConfig)(req, res, () => {
|
|
4413
|
-
|
|
4612
|
+
Promise.resolve().then(() => PromMetrics_exports).then(async ({ promRegistry }) => {
|
|
4414
4613
|
const body = await promRegistry.metrics();
|
|
4415
4614
|
res.setHeader("content-type", promRegistry.contentType);
|
|
4416
4615
|
res.end(body);
|
|
@@ -5583,7 +5782,7 @@ async function createProductionRuntime(config, options = {}) {
|
|
|
5583
5782
|
app.use("/assets", (_req, res) => {
|
|
5584
5783
|
res.status(404).set("Cache-Control", "no-store").end();
|
|
5585
5784
|
});
|
|
5586
|
-
const { createImageMiddleware } = await import("./createImagePlugin-
|
|
5785
|
+
const { createImageMiddleware } = await import("./createImagePlugin-Ddo5t3dJ.js").then((n) => n.r);
|
|
5587
5786
|
const { resolveImageOptions } = await Promise.resolve().then(() => resolveImageOptions_exports);
|
|
5588
5787
|
app.use(createImageMiddleware(resolveImageOptions(config.runtime.images), {}, clientDir));
|
|
5589
5788
|
const { createAutoCacheStore } = await Promise.resolve().then(() => createAutoCacheStore_exports);
|
|
@@ -5655,7 +5854,7 @@ async function createProductionRuntime(config, options = {}) {
|
|
|
5655
5854
|
});
|
|
5656
5855
|
cleanups.push(() => cache.destroy());
|
|
5657
5856
|
if (opsConfig.inventory.enabled) {
|
|
5658
|
-
const { createCacheInspectorMiddleware } = await import("./createCacheInspectorMiddleware-
|
|
5857
|
+
const { createCacheInspectorMiddleware } = await import("./createCacheInspectorMiddleware-BY6MX88X.js");
|
|
5659
5858
|
app.use(createCacheInspectorMiddleware(cache, opsConfig));
|
|
5660
5859
|
logger$8.info("🔍 ISR cache inventory 已启用:GET /__isr/cache/inventory");
|
|
5661
5860
|
}
|
|
@@ -5680,7 +5879,7 @@ async function createProductionRuntime(config, options = {}) {
|
|
|
5680
5879
|
if (res.getHeader("X-Resolved-Mode") === "ssg" || ssgAliases.has(decodeHtmlPathname(req.path)) && explicitRoutes.has(decodeHtmlPathname(req.path))) return next();
|
|
5681
5880
|
staticHtml(req, res, next);
|
|
5682
5881
|
});
|
|
5683
|
-
const { promRegistry } = await
|
|
5882
|
+
const { promRegistry } = await Promise.resolve().then(() => PromMetrics_exports);
|
|
5684
5883
|
if (opsConfig.metrics.enabled) app.get("/metrics", createOpsAuthMiddleware("metrics", opsConfig), async (_req, res) => {
|
|
5685
5884
|
try {
|
|
5686
5885
|
res.set("content-type", promRegistry.contentType);
|
|
@@ -7316,6 +7515,6 @@ async function createISRApp(appOption) {
|
|
|
7316
7515
|
};
|
|
7317
7516
|
}
|
|
7318
7517
|
//#endregion
|
|
7319
|
-
export {
|
|
7518
|
+
export { isTestFile as $, createMemoryCacheStore as A, logger$8 as B, loadConfig as C, promRegistry as D, invalidatorRunsTotal as E, FallbackChain as F, scanComponents as G, package_default as H, InternalStrategies as I, parseComponentFromFile as J, scanProject as K, RenderModes as L, getRouteFallbackChain as M, matchRoutePattern as N, recordHttpRequest as O, resolveRenderMode as P, isCodeFile as Q, extractSsgRoutes as R, createOpsAuthMiddleware as S, invalidatorFailuresTotal as T, resolveFetchHandler as U, DEFAULT_PORT as V, DEFAULT_SCAN_CONFIG as W, parseRouteFromFile as X, parseComponents as Y, parseRoutes as Z, RedisInvalidationBus as _, DEFAULT_SEO_CONFIG as a, assertDistinctHtmlRouteIdentities as at, createCoherentCacheStore as b, startAppServer as c, startServer as d, readDirRecursive as et, createProductionRuntime as f, createIsrCacheMiddleware as g, createIsrCacheHandler as h, createSEOEngine as i, CacheCleanup as it, getFallbackChain as j, createHybridCacheStore as k, createABVariantMiddleware as l, generateStaticCspManifest as m, ISREngine as n, isProd as nt, mergeSEOConfig as o, resolveImageOptions as ot, prepareProductionBuild as p, scanRoutes as q, SEOEngine as r, getEnv as rt, shutdownServer as s, createISRApp as t, isDev as tt, closeServer as u, RedisCacheAdapter as v, createPrometheusMetricsMiddleware as w, createDevAssetRequestMiddleware as x, MemoryCacheAdapter as y, spiderSsgRoutes as z };
|
|
7320
7519
|
|
|
7321
|
-
//# sourceMappingURL=createISRApp-
|
|
7520
|
+
//# sourceMappingURL=createISRApp-CS6XfjHl.js.map
|