@farm.js/core 0.1.40 → 0.1.41
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/dist/{agent-mcp-XNF4JqHw.d.mts → agent-mcp-BOqIxJLI.d.mts} +8 -2
- package/dist/{agent-mcp-DRlXq3lM.d.ts → agent-mcp-D0eZKfci.d.ts} +8 -2
- package/dist/agent-runtime.d.mts +2 -2
- package/dist/agent-runtime.d.ts +2 -2
- package/dist/api/client.cjs +3 -3
- package/dist/api/client.mjs +2 -2
- package/dist/api/route-manager.cjs +8 -8
- package/dist/api/route-manager.d.mts +4 -4
- package/dist/api/route-manager.d.ts +4 -4
- package/dist/api/route-manager.mjs +7 -7
- package/dist/api/runtime.cjs +6 -6
- package/dist/api/runtime.d.mts +3 -3
- package/dist/api/runtime.d.ts +3 -3
- package/dist/api/runtime.mjs +5 -5
- package/dist/api.cjs +10 -10
- package/dist/api.d.mts +4 -4
- package/dist/api.d.ts +4 -4
- package/dist/api.mjs +9 -9
- package/dist/{app-CWjCklhF.d.mts → app-CzTSMJaf.d.mts} +5 -5
- package/dist/{app-CDJHPqZn.d.ts → app-DM8e1z3G.d.ts} +5 -5
- package/dist/app-markdown.d.mts +3 -3
- package/dist/app-markdown.d.ts +3 -3
- package/dist/cache.cjs +3 -3
- package/dist/cache.mjs +2 -2
- package/dist/{chunk-UM3ZV5EP.mjs → chunk-24SP5TGU.mjs} +1 -1
- package/dist/{chunk-B6IMBBOS.cjs → chunk-25LPIZSX.cjs} +3 -3
- package/dist/{chunk-WW374SGU.mjs → chunk-26RUNDIR.mjs} +1 -1
- package/dist/{chunk-B77AUCBV.cjs → chunk-2FUIT2G2.cjs} +3 -3
- package/dist/{chunk-54QWHSNR.cjs → chunk-32TZ3QTP.cjs} +149 -155
- package/dist/{chunk-BPGO2IEP.mjs → chunk-35WS7P2V.mjs} +24 -126
- package/dist/{chunk-CKFK3Z2V.mjs → chunk-4C7KTKX7.mjs} +1 -1
- package/dist/{chunk-MNUSIXGS.mjs → chunk-4KQDHTWX.mjs} +1 -1
- package/dist/{chunk-DATEWH3W.cjs → chunk-6IZWX6ES.cjs} +22 -8
- package/dist/{chunk-Y6LRPO2K.mjs → chunk-6LVRDOAW.mjs} +19 -5
- package/dist/{chunk-UMQAK3KP.cjs → chunk-6MVFHNYZ.cjs} +2 -2
- package/dist/{chunk-OLQ73ZO5.mjs → chunk-6PKXK4TY.mjs} +3 -3
- package/dist/{chunk-PYQ3ZG4Z.mjs → chunk-724JLMS4.mjs} +4 -4
- package/dist/{chunk-PNCM5MFD.mjs → chunk-7UEEHAW7.mjs} +1 -1
- package/dist/{chunk-7VAJSSPG.mjs → chunk-B2GSRB3P.mjs} +1 -1
- package/dist/{chunk-ZKVJYQPO.mjs → chunk-BGGWKZ2V.mjs} +11 -10
- package/dist/{chunk-JXB6DVCO.mjs → chunk-BPNRQ5BA.mjs} +1 -1
- package/dist/{chunk-GNVEJUT5.cjs → chunk-C5KVWHIH.cjs} +21 -21
- package/dist/chunk-COABSY3U.mjs +196 -0
- package/dist/{chunk-Y2GNNXGV.cjs → chunk-D64OPY6A.cjs} +5 -5
- package/dist/{chunk-DKU6NXRK.cjs → chunk-EH3464KF.cjs} +1 -1
- package/dist/{chunk-Y4QVEU67.mjs → chunk-ENOBPDKZ.mjs} +2 -2
- package/dist/{chunk-FLZ4H25A.cjs → chunk-EX4MKHXN.cjs} +6 -6
- package/dist/{chunk-I64GEPOB.cjs → chunk-FEYQCYT7.cjs} +3 -3
- package/dist/{chunk-AXB5P7BK.mjs → chunk-FIAPD365.mjs} +1 -1
- package/dist/{chunk-FCOLU5P6.mjs → chunk-FJGIVDA5.mjs} +38 -15
- package/dist/{chunk-7FHZ3E6D.cjs → chunk-GB7LDGY5.cjs} +2 -2
- package/dist/{chunk-45UZKX2J.mjs → chunk-HJ64F4GS.mjs} +2 -2
- package/dist/{chunk-IRYK4Z5M.cjs → chunk-I5MG3TKE.cjs} +2 -2
- package/dist/{chunk-YR2P74F7.cjs → chunk-IFWSR7YZ.cjs} +2 -2
- package/dist/{chunk-5E65AL7P.mjs → chunk-IN6RCKLL.mjs} +5 -4
- package/dist/{chunk-EORXKFLR.cjs → chunk-JEIG3EWE.cjs} +1 -1
- package/dist/{chunk-TAKG7ZCD.cjs → chunk-JOTUZIM4.cjs} +14 -14
- package/dist/{chunk-TFX4RTH2.mjs → chunk-JOW4HDJO.mjs} +1 -1
- package/dist/{chunk-H44XGLFU.cjs → chunk-L6A26QT5.cjs} +9 -9
- package/dist/{chunk-EW4MEVLE.cjs → chunk-L6HYACBE.cjs} +7 -7
- package/dist/{chunk-OZN4XL6L.cjs → chunk-LIZTLA5F.cjs} +7 -6
- package/dist/{chunk-62DY5GKS.mjs → chunk-LLUA2LSC.mjs} +2 -2
- package/dist/{chunk-LDPKAYVS.cjs → chunk-LYIZHJTK.cjs} +2 -2
- package/dist/{chunk-2DMWQWNJ.mjs → chunk-MEASUNVY.mjs} +1 -1
- package/dist/{chunk-T4II4MMW.mjs → chunk-MHHCLYXU.mjs} +1 -1
- package/dist/{chunk-SHFXCE5A.cjs → chunk-MHN4UR5U.cjs} +4 -4
- package/dist/{chunk-5JEC43MQ.cjs → chunk-MN4TQJ3W.cjs} +9 -9
- package/dist/{chunk-5XS5NCVM.cjs → chunk-MY5PZYAD.cjs} +4 -4
- package/dist/{chunk-2JG2LJDI.cjs → chunk-NBPNUQYO.cjs} +2 -2
- package/dist/{chunk-4XO5GSD6.cjs → chunk-NFG4PUPI.cjs} +2 -2
- package/dist/{chunk-5LL6TKII.mjs → chunk-O7USYJ4U.mjs} +1 -1
- package/dist/{chunk-GKQL726H.cjs → chunk-OQ4YXWH4.cjs} +74 -73
- package/dist/{chunk-VBN3UAPQ.mjs → chunk-P2UJF4SS.mjs} +1 -1
- package/dist/{chunk-PGW7HZE2.cjs → chunk-PN676AZF.cjs} +6 -6
- package/dist/{chunk-IMQO6ZUU.mjs → chunk-PYHPXPSW.mjs} +2 -2
- package/dist/{chunk-KK22JPQM.cjs → chunk-QEILRWVV.cjs} +30 -132
- package/dist/{chunk-UXMIFB44.cjs → chunk-QIBP5EFA.cjs} +5 -5
- package/dist/{chunk-XKIUHXHW.mjs → chunk-R65GCA6A.mjs} +45 -51
- package/dist/{chunk-EGCT3AHF.cjs → chunk-ROQ4C4LJ.cjs} +121 -98
- package/dist/{chunk-QJM7A4CR.cjs → chunk-S7MTDRYA.cjs} +10 -10
- package/dist/{chunk-ACLPN56I.mjs → chunk-SGB4IW7K.mjs} +1 -1
- package/dist/{chunk-T6DLMX5V.mjs → chunk-SVPGWJZF.mjs} +3 -3
- package/dist/{chunk-I63UCMXW.mjs → chunk-ULQOP5UI.mjs} +2 -2
- package/dist/{chunk-HBEBV7OZ.mjs → chunk-UQUEANTY.mjs} +1 -1
- package/dist/chunk-VHRS3MCW.cjs +196 -0
- package/dist/{chunk-H56MQYEG.mjs → chunk-VLPII2JJ.mjs} +1 -1
- package/dist/{chunk-WCWV25PG.mjs → chunk-VTBXE6QG.mjs} +2 -2
- package/dist/{chunk-E55H6UKH.cjs → chunk-WLHA5USH.cjs} +9 -9
- package/dist/{chunk-YJBWB6GF.mjs → chunk-WMBRZI5V.mjs} +1 -1
- package/dist/{chunk-AGR7F3LA.cjs → chunk-WROEFVNO.cjs} +3 -3
- package/dist/{chunk-CA62IQY3.cjs → chunk-WU7ZS3EM.cjs} +2 -2
- package/dist/{chunk-ZOABCQGT.mjs → chunk-X3NGFVRF.mjs} +37 -22
- package/dist/{chunk-XJAEZCT6.mjs → chunk-XUC6CFLE.mjs} +1 -1
- package/dist/{chunk-6ILGLCXF.cjs → chunk-YWCYV7QC.cjs} +8 -8
- package/dist/{chunk-T36UJS3X.mjs → chunk-YYQVGKO5.mjs} +2 -2
- package/dist/{chunk-XVIEGKTT.cjs → chunk-ZTP3BJG6.cjs} +41 -26
- package/dist/{client-plugins-B_5QbNrp.d.mts → client-plugins-CkYwvDJ0.d.mts} +1 -1
- package/dist/{client-plugins-DgSfIWIF.d.ts → client-plugins-DfeKd0sD.d.ts} +1 -1
- package/dist/client-plugins.d.mts +2 -2
- package/dist/client-plugins.d.ts +2 -2
- package/dist/client.cjs +5 -5
- package/dist/client.d.mts +6 -6
- package/dist/client.d.ts +6 -6
- package/dist/client.mjs +4 -4
- package/dist/client.react-server.mjs +2 -0
- package/dist/config.d.mts +2 -2
- package/dist/config.d.ts +2 -2
- package/dist/{devtools-ANJ7JAPQ.cjs → devtools-2YHAJYH6.cjs} +5 -5
- package/dist/{devtools-VEQQDVHE.mjs → devtools-N3QLRIQU.mjs} +4 -4
- package/dist/docs.cjs +7 -7
- package/dist/docs.d.mts +3 -3
- package/dist/docs.d.ts +3 -3
- package/dist/docs.mjs +6 -6
- package/dist/headers.cjs +4 -4
- package/dist/headers.mjs +3 -3
- package/dist/image/server.d.mts +1 -1
- package/dist/image/server.d.ts +1 -1
- package/dist/image/sharp.d.mts +1 -1
- package/dist/image/sharp.d.ts +1 -1
- package/dist/{image-config-Duob7wER.d.ts → image-config-BpH1q5R8.d.mts} +4 -1
- package/dist/{image-config-Duob7wER.d.mts → image-config-BpH1q5R8.d.ts} +4 -1
- package/dist/image.d.mts +1 -1
- package/dist/image.d.ts +1 -1
- package/dist/index.cjs +39 -37
- package/dist/index.d.mts +15 -135
- package/dist/index.d.ts +15 -135
- package/dist/index.mjs +38 -36
- package/dist/integrations.d.mts +2 -2
- package/dist/integrations.d.ts +2 -2
- package/dist/internal/app-markdown-runtime.d.mts +3 -3
- package/dist/internal/app-markdown-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.cjs +22 -22
- package/dist/internal/build-runtime.d.mts +4 -4
- package/dist/internal/build-runtime.d.ts +4 -4
- package/dist/internal/build-runtime.mjs +21 -21
- package/dist/internal/cli-runtime.cjs +12 -12
- package/dist/internal/cli-runtime.mjs +11 -11
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/compression-runtime.d.mts +2 -2
- package/dist/internal/compression-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.cjs +5 -5
- package/dist/internal/config-runtime.d.mts +3 -3
- package/dist/internal/config-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.mjs +4 -4
- package/dist/internal/docs-precompiled-runtime.cjs +3 -3
- package/dist/internal/docs-precompiled-runtime.mjs +2 -2
- package/dist/internal/infra-analytics-runtime.cjs +5 -5
- package/dist/internal/infra-analytics-runtime.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +20 -12
- package/dist/internal/production-runtime.d.mts +30 -10
- package/dist/internal/production-runtime.d.ts +30 -10
- package/dist/internal/production-runtime.mjs +20 -12
- package/dist/markdown.d.mts +2 -2
- package/dist/markdown.d.ts +2 -2
- package/dist/middleware.cjs +7 -7
- package/dist/middleware.d.mts +4 -4
- package/dist/middleware.d.ts +4 -4
- package/dist/middleware.mjs +6 -6
- package/dist/navigation.cjs +4 -4
- package/dist/navigation.d.mts +5 -5
- package/dist/navigation.d.ts +5 -5
- package/dist/navigation.mjs +3 -3
- package/dist/{nitro-NFG2LBRC.mjs → nitro-KDACKNHU.mjs} +1 -1
- package/dist/{nitro-S2QABUFA.cjs → nitro-NPGU6VBT.cjs} +2 -2
- package/dist/plugin.cjs +20 -20
- package/dist/plugin.d.mts +4 -3
- package/dist/plugin.d.ts +4 -3
- package/dist/plugin.mjs +19 -19
- package/dist/{production-runtime-j_WCfuwB.d.mts → production-runtime-BTkXQdYy.d.mts} +1 -1
- package/dist/{production-runtime-DfknD3g_.d.ts → production-runtime-DFC7pgbp.d.ts} +1 -1
- package/dist/query/client.cjs +2 -2
- package/dist/query/client.mjs +3 -3
- package/dist/{render-plan-ChUtsymc.d.mts → render-plan-5rFeWmk7.d.mts} +1 -1
- package/dist/{render-plan-CFIhcYYS.d.ts → render-plan-BoAK9xFC.d.ts} +1 -1
- package/dist/renderer-client.d.mts +4 -4
- package/dist/renderer-client.d.ts +4 -4
- package/dist/{request-F4HRwzSd.d.mts → request-BxBWigtl.d.mts} +1 -1
- package/dist/{request-RJvelT8L.d.ts → request-fciwmd3n.d.ts} +1 -1
- package/dist/request.cjs +3 -3
- package/dist/request.d.mts +3 -3
- package/dist/request.d.ts +3 -3
- package/dist/request.mjs +2 -2
- package/dist/{route-rendering-3a4fbNyC.d.mts → route-rendering-BCM1QzEf.d.mts} +1 -1
- package/dist/{route-rendering-D4coJ-kw.d.ts → route-rendering-BLZT0IP0.d.ts} +1 -1
- package/dist/{router-WLEW3Te1.d.ts → router-CkheNX3-.d.ts} +1 -1
- package/dist/{router-DqIssGRO.d.mts → router-DyZJWc1_.d.mts} +1 -1
- package/dist/routes.cjs +4 -4
- package/dist/routes.d.mts +2 -2
- package/dist/routes.d.ts +2 -2
- package/dist/routes.mjs +3 -3
- package/dist/{runtime-BrNdLOq9.d.ts → runtime-DfU4sKa5.d.ts} +1 -1
- package/dist/{runtime-CmE_j-js.d.mts → runtime-wexvUN5J.d.mts} +1 -1
- package/dist/server-fn.cjs +4 -4
- package/dist/server-fn.mjs +3 -3
- package/dist/server-plugins.cjs +5 -5
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server-plugins.mjs +4 -4
- package/dist/server-query.cjs +5 -5
- package/dist/server-query.mjs +4 -4
- package/dist/server.cjs +45 -45
- package/dist/server.d.mts +10 -9
- package/dist/server.d.ts +10 -9
- package/dist/server.mjs +24 -24
- package/dist/{spa-router-D_0VXqPC.d.ts → spa-router-CcejECnG.d.ts} +2 -2
- package/dist/{spa-router-C41zjnFl.d.mts → spa-router-DgsMXqfX.d.mts} +2 -2
- package/dist/ssg-1FGaFISl.d.ts +184 -0
- package/dist/ssg-Bg4bMMhM.d.mts +184 -0
- package/dist/testing.cjs +11 -11
- package/dist/testing.d.mts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.mjs +8 -8
- package/dist/theme/server.cjs +4 -4
- package/dist/theme/server.mjs +3 -3
- package/dist/{utils-BKWSe3S7.d.mts → utils-8wtTYiH4.d.mts} +1 -1
- package/dist/{utils-YYcWsOJp.d.ts → utils-Dxbh6Hgj.d.ts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +37 -21
- package/dist/vite.d.mts +41 -4
- package/dist/vite.d.ts +41 -4
- package/dist/vite.mjs +37 -21
- package/dist/workflows.cjs +2 -2
- package/dist/workflows.mjs +1 -1
- package/package.json +2 -1
- package/dist/chunk-DAO7JGTS.mjs +0 -73
- package/dist/chunk-SYQ3MOWW.cjs +0 -73
- package/dist/programmatic-routes-client-DcoxEaLe.d.mts +0 -55
- package/dist/programmatic-routes-client-DcoxEaLe.d.ts +0 -55
- /package/dist/{chunk-MOSYH4CY.mjs → chunk-FWCGUVVL.mjs} +0 -0
- /package/dist/{chunk-4A3YUB4D.cjs → chunk-KF6VDJH7.cjs} +0 -0
|
@@ -9,7 +9,10 @@ var _chunk4U5XZDLGcjs = require('./chunk-4U5XZDLG.cjs');
|
|
|
9
9
|
var _chunk6D24SDKOcjs = require('./chunk-6D24SDKO.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
var _chunkVHRS3MCWcjs = require('./chunk-VHRS3MCW.cjs');
|
|
13
16
|
|
|
14
17
|
|
|
15
18
|
|
|
@@ -29,13 +32,13 @@ var _chunkWBKEZXWEcjs = require('./chunk-WBKEZXWE.cjs');
|
|
|
29
32
|
var _chunkM7MKQXAFcjs = require('./chunk-M7MKQXAF.cjs');
|
|
30
33
|
|
|
31
34
|
|
|
32
|
-
var
|
|
35
|
+
var _chunkKF6VDJH7cjs = require('./chunk-KF6VDJH7.cjs');
|
|
33
36
|
|
|
34
37
|
|
|
35
38
|
var _chunkUFDAAQFXcjs = require('./chunk-UFDAAQFX.cjs');
|
|
36
39
|
|
|
37
40
|
|
|
38
|
-
var
|
|
41
|
+
var _chunkWU7ZS3EMcjs = require('./chunk-WU7ZS3EM.cjs');
|
|
39
42
|
|
|
40
43
|
|
|
41
44
|
var _chunk5QIKR7RRcjs = require('./chunk-5QIKR7RR.cjs');
|
|
@@ -44,10 +47,8 @@ var _chunk5QIKR7RRcjs = require('./chunk-5QIKR7RR.cjs');
|
|
|
44
47
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
45
48
|
|
|
46
49
|
// src/ssg.ts
|
|
50
|
+
var _fs = require('fs'); var fs = _interopRequireWildcard(_fs); var fs2 = _interopRequireWildcard(_fs);
|
|
47
51
|
var _promises = require('fs/promises');
|
|
48
|
-
var OPTIONAL_CATCH_ALL_SEGMENT = /^\[\[\.\.\.([^\]]+)\]\]$/;
|
|
49
|
-
var REQUIRED_CATCH_ALL_SEGMENT = /^\[\.\.\.([^\]]+)\]$/;
|
|
50
|
-
var REQUIRED_DYNAMIC_SEGMENT = /^\[([^\]]+)\]$/;
|
|
51
52
|
var REQUEST_API_LABELS = /* @__PURE__ */ new Map([
|
|
52
53
|
["cookies", "request cookies"],
|
|
53
54
|
["headers", "request headers"],
|
|
@@ -65,7 +66,7 @@ var ROUTE_PROP_LABELS = /* @__PURE__ */ new Map([
|
|
|
65
66
|
["context", "request context"]
|
|
66
67
|
]);
|
|
67
68
|
function resolveConfiguredRouteRenderingConfig(mod, source, options) {
|
|
68
|
-
return
|
|
69
|
+
return _chunkVHRS3MCWcjs.mergeRouteRenderingDirectiveConfig.call(void 0, parseRouteRenderingDirective(source), mod, options);
|
|
69
70
|
}
|
|
70
71
|
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveConfiguredRouteRenderingConfig, "resolveConfiguredRouteRenderingConfig");
|
|
71
72
|
function resolveRouteRenderingConfig(mod, source, options) {
|
|
@@ -317,6 +318,17 @@ function parseRouteRenderingDirective(source) {
|
|
|
317
318
|
return void 0;
|
|
318
319
|
}
|
|
319
320
|
_chunkS3JO3N4Hcjs.__name.call(void 0, parseRouteRenderingDirective, "parseRouteRenderingDirective");
|
|
321
|
+
function readRouteRenderingDirectiveFromFile(modulePath) {
|
|
322
|
+
try {
|
|
323
|
+
const source = _fs.readFileSync.call(void 0, modulePath, "utf8");
|
|
324
|
+
const directive = parseRouteRenderingDirective(source);
|
|
325
|
+
if (findRequestBoundSourceBlockers(source).length === 0) return directive;
|
|
326
|
+
return { ..._nullishCoalesce(directive, () => ( { ssg: false, ppr: false, directive: "" })), requestBound: true };
|
|
327
|
+
} catch (e) {
|
|
328
|
+
return void 0;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, readRouteRenderingDirectiveFromFile, "readRouteRenderingDirectiveFromFile");
|
|
320
332
|
function parseKnownRenderingDirective(directive) {
|
|
321
333
|
const normalized = directive.trim().toLowerCase();
|
|
322
334
|
const match = normalized.match(
|
|
@@ -454,11 +466,11 @@ async function collectSSGPages(routes, loadModule, options = {}) {
|
|
|
454
466
|
);
|
|
455
467
|
}
|
|
456
468
|
const paths = await getStaticPaths();
|
|
457
|
-
const optionalCatchAllParams = getOptionalCatchAllParameterNames(route.path);
|
|
469
|
+
const optionalCatchAllParams = _chunkVHRS3MCWcjs.getOptionalCatchAllParameterNames.call(void 0, route.path);
|
|
458
470
|
const materializedPages = paths.map((params) => ({
|
|
459
|
-
urlPath: materializeSSGRoutePath(route.path, params),
|
|
471
|
+
urlPath: _chunkVHRS3MCWcjs.materializeSSGRoutePath.call(void 0, route.path, params),
|
|
460
472
|
filePath: route.filePath,
|
|
461
|
-
params: normalizeStaticPathParams(params, optionalCatchAllParams),
|
|
473
|
+
params: _chunkVHRS3MCWcjs.normalizeStaticPathParams.call(void 0, params, optionalCatchAllParams),
|
|
462
474
|
revalidate: rendering.revalidate
|
|
463
475
|
}));
|
|
464
476
|
ssgPages.push(...materializedPages);
|
|
@@ -495,121 +507,6 @@ Add \`export const dynamic = "force-static";\` after verifying that imported cod
|
|
|
495
507
|
return { ssg: ssgPages, ssr: ssrRoutes };
|
|
496
508
|
}
|
|
497
509
|
_chunkS3JO3N4Hcjs.__name.call(void 0, collectSSGPages, "collectSSGPages");
|
|
498
|
-
function materializeSSGRoutePath(routePattern, params) {
|
|
499
|
-
const outputSegments = [];
|
|
500
|
-
for (const segment of routePattern.split("/")) {
|
|
501
|
-
if (!segment) {
|
|
502
|
-
continue;
|
|
503
|
-
}
|
|
504
|
-
const optionalCatchAll = segment.match(OPTIONAL_CATCH_ALL_SEGMENT);
|
|
505
|
-
if (optionalCatchAll) {
|
|
506
|
-
const parameterName = optionalCatchAll[1];
|
|
507
|
-
const value = params[parameterName];
|
|
508
|
-
const values = readCatchAllSegments(value, {
|
|
509
|
-
optional: true,
|
|
510
|
-
parameterName,
|
|
511
|
-
routePattern
|
|
512
|
-
});
|
|
513
|
-
outputSegments.push(...values.map(encodePathSegment));
|
|
514
|
-
continue;
|
|
515
|
-
}
|
|
516
|
-
const requiredCatchAll = segment.match(REQUIRED_CATCH_ALL_SEGMENT);
|
|
517
|
-
if (requiredCatchAll) {
|
|
518
|
-
const parameterName = requiredCatchAll[1];
|
|
519
|
-
const value = params[parameterName];
|
|
520
|
-
const values = readCatchAllSegments(value, {
|
|
521
|
-
optional: false,
|
|
522
|
-
parameterName,
|
|
523
|
-
routePattern
|
|
524
|
-
});
|
|
525
|
-
outputSegments.push(...values.map(encodePathSegment));
|
|
526
|
-
continue;
|
|
527
|
-
}
|
|
528
|
-
const requiredDynamic = segment.match(REQUIRED_DYNAMIC_SEGMENT);
|
|
529
|
-
if (requiredDynamic) {
|
|
530
|
-
const parameterName = requiredDynamic[1];
|
|
531
|
-
const value = params[parameterName];
|
|
532
|
-
if (isStaticPathArray(value)) {
|
|
533
|
-
throw new Error(
|
|
534
|
-
`Cannot materialize SSG route "${routePattern}": parameter "${parameterName}" must be a scalar value; arrays are only supported for catch-all segments.`
|
|
535
|
-
);
|
|
536
|
-
}
|
|
537
|
-
if (isMissingPathValue(value)) {
|
|
538
|
-
throw missingRequiredParameterError(routePattern, parameterName);
|
|
539
|
-
}
|
|
540
|
-
outputSegments.push(encodePathSegment(value));
|
|
541
|
-
continue;
|
|
542
|
-
}
|
|
543
|
-
outputSegments.push(segment);
|
|
544
|
-
}
|
|
545
|
-
return outputSegments.length > 0 ? `/${outputSegments.join("/")}` : "/";
|
|
546
|
-
}
|
|
547
|
-
_chunkS3JO3N4Hcjs.__name.call(void 0, materializeSSGRoutePath, "materializeSSGRoutePath");
|
|
548
|
-
function readCatchAllSegments(value, options) {
|
|
549
|
-
if (isMissingPathValue(value) || isStaticPathArray(value) && value.length === 0) {
|
|
550
|
-
if (options.optional) {
|
|
551
|
-
return [];
|
|
552
|
-
}
|
|
553
|
-
throw missingRequiredParameterError(options.routePattern, options.parameterName);
|
|
554
|
-
}
|
|
555
|
-
const segments = isStaticPathArray(value) ? [...value] : [value];
|
|
556
|
-
if (segments.some(isMissingPathValue)) {
|
|
557
|
-
throw new Error(
|
|
558
|
-
`Cannot materialize SSG route "${options.routePattern}": catch-all parameter "${options.parameterName}" contains an empty path segment.`
|
|
559
|
-
);
|
|
560
|
-
}
|
|
561
|
-
return segments;
|
|
562
|
-
}
|
|
563
|
-
_chunkS3JO3N4Hcjs.__name.call(void 0, readCatchAllSegments, "readCatchAllSegments");
|
|
564
|
-
function getOptionalCatchAllParameterNames(routePattern) {
|
|
565
|
-
return new Set(
|
|
566
|
-
routePattern.split("/").map((segment) => _optionalChain([segment, 'access', _41 => _41.match, 'call', _42 => _42(OPTIONAL_CATCH_ALL_SEGMENT), 'optionalAccess', _43 => _43[1]])).filter((name) => Boolean(name))
|
|
567
|
-
);
|
|
568
|
-
}
|
|
569
|
-
_chunkS3JO3N4Hcjs.__name.call(void 0, getOptionalCatchAllParameterNames, "getOptionalCatchAllParameterNames");
|
|
570
|
-
function normalizeStaticPathParams(params, optionalCatchAllParams) {
|
|
571
|
-
const entries = Object.entries(params).map(([key, value]) => {
|
|
572
|
-
const emptyOptionalCatchAll = optionalCatchAllParams.has(key) && (isMissingPathValue(value) || isStaticPathArray(value) && value.length === 0);
|
|
573
|
-
return [
|
|
574
|
-
key,
|
|
575
|
-
emptyOptionalCatchAll ? "" : isStaticPathArray(value) ? value.map(String).join("/") : String(value)
|
|
576
|
-
];
|
|
577
|
-
});
|
|
578
|
-
for (const name of optionalCatchAllParams) {
|
|
579
|
-
if (!Object.prototype.hasOwnProperty.call(params, name)) {
|
|
580
|
-
entries.push([name, ""]);
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
return Object.fromEntries(entries);
|
|
584
|
-
}
|
|
585
|
-
_chunkS3JO3N4Hcjs.__name.call(void 0, normalizeStaticPathParams, "normalizeStaticPathParams");
|
|
586
|
-
function isMissingPathValue(value) {
|
|
587
|
-
return value === "" || value === null || typeof value === "undefined";
|
|
588
|
-
}
|
|
589
|
-
_chunkS3JO3N4Hcjs.__name.call(void 0, isMissingPathValue, "isMissingPathValue");
|
|
590
|
-
function isStaticPathArray(value) {
|
|
591
|
-
return Array.isArray(value);
|
|
592
|
-
}
|
|
593
|
-
_chunkS3JO3N4Hcjs.__name.call(void 0, isStaticPathArray, "isStaticPathArray");
|
|
594
|
-
function missingRequiredParameterError(routePattern, parameterName) {
|
|
595
|
-
return new Error(
|
|
596
|
-
`Cannot materialize SSG route "${routePattern}": required parameter "${parameterName}" is missing or empty.`
|
|
597
|
-
);
|
|
598
|
-
}
|
|
599
|
-
_chunkS3JO3N4Hcjs.__name.call(void 0, missingRequiredParameterError, "missingRequiredParameterError");
|
|
600
|
-
function encodePathSegment(value) {
|
|
601
|
-
const encoded = encodeURIComponent(String(value)).replace(
|
|
602
|
-
/[!'()*]/g,
|
|
603
|
-
(character) => `%${character.charCodeAt(0).toString(16).toUpperCase()}`
|
|
604
|
-
);
|
|
605
|
-
if (encoded === "." || encoded === "..") {
|
|
606
|
-
throw new Error(
|
|
607
|
-
`Cannot materialize SSG path segment "${encoded}": dot-only segments are unsafe to prerender.`
|
|
608
|
-
);
|
|
609
|
-
}
|
|
610
|
-
return encoded;
|
|
611
|
-
}
|
|
612
|
-
_chunkS3JO3N4Hcjs.__name.call(void 0, encodePathSegment, "encodePathSegment");
|
|
613
510
|
function isSSGModule(mod) {
|
|
614
511
|
return resolveRouteRenderingConfig(mod).ssg;
|
|
615
512
|
}
|
|
@@ -647,7 +544,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, matchSSGPage, "matchSSGPage");
|
|
|
647
544
|
|
|
648
545
|
// src/routing/generate-route-types.ts
|
|
649
546
|
var _path = require('path'); var path = _interopRequireWildcard(_path); var path3 = _interopRequireWildcard(_path);
|
|
650
|
-
|
|
547
|
+
|
|
651
548
|
function routeSegmentsToTsTypeLiteral(segments) {
|
|
652
549
|
if (segments.length === 0) return '"/"';
|
|
653
550
|
const hasDynamic = segments.some((s) => s.startsWith("["));
|
|
@@ -736,7 +633,7 @@ async function createRouteTypeDeclarations(options, outPath) {
|
|
|
736
633
|
}
|
|
737
634
|
}
|
|
738
635
|
}
|
|
739
|
-
for (const route of await
|
|
636
|
+
for (const route of await _chunkKF6VDJH7cjs.discoverProgrammaticRoutePaths.call(void 0, source.root, source.srcDir)) {
|
|
740
637
|
patterns.add(route);
|
|
741
638
|
routeModulePatterns.add(route);
|
|
742
639
|
}
|
|
@@ -1061,7 +958,7 @@ function fieldTsType(field) {
|
|
|
1061
958
|
case "json":
|
|
1062
959
|
return "unknown";
|
|
1063
960
|
case "enum":
|
|
1064
|
-
return _optionalChain([field, 'access',
|
|
961
|
+
return _optionalChain([field, 'access', _41 => _41.values, 'optionalAccess', _42 => _42.length]) ? field.values.map((value) => JSON.stringify(value)).join(" | ") : "string";
|
|
1065
962
|
// id, uuid, string, text, datetime all travel as strings over JSON.
|
|
1066
963
|
default:
|
|
1067
964
|
return "string";
|
|
@@ -1088,7 +985,7 @@ async function generateFarmTypeArtifacts(options) {
|
|
|
1088
985
|
const shouldGenerateApi = options.api !== false;
|
|
1089
986
|
const shouldGenerateEnv = options.env !== false;
|
|
1090
987
|
const shouldGenerateImages = options.images !== false;
|
|
1091
|
-
const shouldGenerateI18n = options.i18n !== false && _optionalChain([options, 'access',
|
|
988
|
+
const shouldGenerateI18n = options.i18n !== false && _optionalChain([options, 'access', _43 => _43.i18nConfig, 'optionalAccess', _44 => _44.enabled]);
|
|
1092
989
|
const sourceRoots = _chunkWBKEZXWEcjs.getFarmSourceRoots.call(void 0, { root, srcDir, layers: options.layers });
|
|
1093
990
|
const appDirs = _chunkWBKEZXWEcjs.getFarmAppDirectories.call(void 0, { root, srcDir, layers: options.layers });
|
|
1094
991
|
const result = {
|
|
@@ -1132,7 +1029,7 @@ async function generateFarmTypeArtifacts(options) {
|
|
|
1132
1029
|
const generator = new (0, _chunkXSIRSMAScjs.APITypeGenerator)(appDirs);
|
|
1133
1030
|
const apiRoutes = generator.scanAPIRoutes();
|
|
1134
1031
|
const apiTypesPath = options.apiTypesOutFile ? _path.resolve.call(void 0, root, options.apiTypesOutFile) : _path.join.call(void 0, root, srcDir, "lib", "api.generated.ts");
|
|
1135
|
-
const pluginRoutes =
|
|
1032
|
+
const pluginRoutes = _chunkWU7ZS3EMcjs.resolvePluginRoutes.call(void 0, options.plugins);
|
|
1136
1033
|
const configFiles = [
|
|
1137
1034
|
...(_nullishCoalesce(options.layers, () => ( []))).map((layer) => layer.configFile).filter((file) => Boolean(file)),
|
|
1138
1035
|
options.configPath ? _path.resolve.call(void 0, root, options.configPath) : [
|
|
@@ -1208,7 +1105,7 @@ async function generateFarmTypeArtifacts(options) {
|
|
|
1208
1105
|
});
|
|
1209
1106
|
}
|
|
1210
1107
|
}
|
|
1211
|
-
if (shouldRefreshUnifiedTypes && _optionalChain([options, 'access',
|
|
1108
|
+
if (shouldRefreshUnifiedTypes && _optionalChain([options, 'access', _45 => _45.i18nConfig, 'optionalAccess', _46 => _46.enabled]) && !options.i18nTypesOutFile) {
|
|
1212
1109
|
const { signatures } = await _chunkUFDAAQFXcjs.readFarmI18nCatalogs.call(void 0, options.i18nConfig);
|
|
1213
1110
|
unifiedSections.push(renderFarmI18nTypes(options.i18nConfig.locales, signatures));
|
|
1214
1111
|
result.i18nTypesPath = unifiedTypesPath;
|
|
@@ -1341,4 +1238,5 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, collectLegacyTypeArtifacts, "collectLegacy
|
|
|
1341
1238
|
|
|
1342
1239
|
|
|
1343
1240
|
|
|
1344
|
-
|
|
1241
|
+
|
|
1242
|
+
exports.resolveRouteRenderingConfig = resolveRouteRenderingConfig; exports.resolveRouteRenderingConfigFromFile = resolveRouteRenderingConfigFromFile; exports.analyzeStaticRouteCandidate = analyzeStaticRouteCandidate; exports.findRequestBoundSourceBlockers = findRequestBoundSourceBlockers; exports.parseRouteRenderingDirective = parseRouteRenderingDirective; exports.readRouteRenderingDirectiveFromFile = readRouteRenderingDirectiveFromFile; exports.collectSSGPages = collectSSGPages; exports.isSSGModule = isSSGModule; exports.hasISR = hasISR; exports.getRevalidateInterval = getRevalidateInterval; exports.hasPPR = hasPPR; exports.generateSSGManifest = generateSSGManifest; exports.matchSSGPage = matchSSGPage; exports.generateRouteTypes = generateRouteTypes; exports.generateFarmImageTypes = generateFarmImageTypes; exports.createFarmImageTypeDeclarations = createFarmImageTypeDeclarations; exports.generateFarmI18nTypes = generateFarmI18nTypes; exports.generateFarmTypeArtifacts = generateFarmTypeArtifacts;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkWU7ZS3EMcjs = require('./chunk-WU7ZS3EM.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkWMAPPDMMcjs = require('./chunk-WMAPPDMM.cjs');
|
|
@@ -36,7 +36,7 @@ var _chunkS3A45T7Fcjs = require('./chunk-S3A45T7F.cjs');
|
|
|
36
36
|
var _chunkZEG3OPIBcjs = require('./chunk-ZEG3OPIB.cjs');
|
|
37
37
|
|
|
38
38
|
|
|
39
|
-
var
|
|
39
|
+
var _chunkZTP3BJG6cjs = require('./chunk-ZTP3BJG6.cjs');
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
@@ -55,7 +55,7 @@ function mergePluginAPIRoutes(existing, plugins, expected, options = {}) {
|
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
const api = createPluginLocalAPI(existing, options.bodySizeLimit, options.dispatch);
|
|
58
|
-
for (const definition of
|
|
58
|
+
for (const definition of _chunkWU7ZS3EMcjs.resolvePluginRoutes.call(void 0, plugins, { api })) {
|
|
59
59
|
_chunkWMAPPDMMcjs.registerAPIRouteShape.call(void 0, shapes, definition.path, `plugin:${definition.path}`, "app");
|
|
60
60
|
let route = routes.get(definition.path);
|
|
61
61
|
if (_optionalChain([route, 'optionalAccess', _ => _.methods, 'access', _2 => _2.includes, 'call', _3 => _3(definition.method)])) {
|
|
@@ -197,7 +197,7 @@ async function invokeAPIRouteEndpoint(endpoint, request, params = {}, bodySizeLi
|
|
|
197
197
|
if (response2) return response2;
|
|
198
198
|
throw error;
|
|
199
199
|
}
|
|
200
|
-
const response = await
|
|
200
|
+
const response = await _chunkZTP3BJG6cjs._runWithCurrentRequest.call(void 0,
|
|
201
201
|
request,
|
|
202
202
|
() => invokeAPIRouteEndpointInContext(endpoint, request, params)
|
|
203
203
|
);
|
|
@@ -262,7 +262,7 @@ async function invokeAPIRouteEndpointInContext(endpoint, request, params) {
|
|
|
262
262
|
invalidations: []
|
|
263
263
|
};
|
|
264
264
|
} catch (error) {
|
|
265
|
-
if (
|
|
265
|
+
if (_chunkWU7ZS3EMcjs.isEndpointFailure.call(void 0, error)) {
|
|
266
266
|
return createEndpointFailureResponse(error);
|
|
267
267
|
}
|
|
268
268
|
throw error;
|
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
import {
|
|
12
12
|
generateNativeMCPPluginSource,
|
|
13
13
|
layoutsCanCoverSamePage
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-4C7KTKX7.mjs";
|
|
15
15
|
import {
|
|
16
16
|
assertFarmDocsAdapterServesNoGuardedPages,
|
|
17
17
|
compileFarmDocsAdapterEdgeManifest,
|
|
18
18
|
createFarmDocsAPIHandler,
|
|
19
19
|
hasFarmDocsRuntimeAdapter
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-PYHPXPSW.mjs";
|
|
21
21
|
import {
|
|
22
22
|
FARM_DOCS_LAST_MODIFIED_MANIFEST,
|
|
23
23
|
createFarmDocsHandler,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
loadFarmDocsPage,
|
|
29
29
|
resolveFarmDocsContentDir,
|
|
30
30
|
toFarmDocsMarkdownPage
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-UQUEANTY.mjs";
|
|
32
32
|
import {
|
|
33
33
|
generateFarmDocsSearchClientRuntime,
|
|
34
34
|
isFarmDocsSearchEnabled,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
} from "./chunk-UP4CW6WP.mjs";
|
|
37
37
|
import {
|
|
38
38
|
FARM_PRERENDER_ENV
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-WMBRZI5V.mjs";
|
|
40
40
|
import {
|
|
41
41
|
loadFarmDocsEngine
|
|
42
42
|
} from "./chunk-2VQKKQ6D.mjs";
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
getDeployTargetForPreset,
|
|
46
46
|
hasCustomFarmRouteContext,
|
|
47
47
|
resolveDeployOutputPath
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-ENOBPDKZ.mjs";
|
|
49
49
|
import {
|
|
50
50
|
resolveFarmInstrumentationFile
|
|
51
51
|
} from "./chunk-ZZSRYEYU.mjs";
|
|
@@ -79,19 +79,19 @@ import {
|
|
|
79
79
|
resolveFarmAppPackages,
|
|
80
80
|
resolveFarmClientCacheAdapterEntry,
|
|
81
81
|
resolveFarmImageProviderForRuntime,
|
|
82
|
+
resolveFarmImageServerRuntime,
|
|
82
83
|
resolveFarmIsolatedClientHydrationMode,
|
|
83
84
|
resolveFarmNotFoundComponentPath,
|
|
84
85
|
usesFarmServerTree
|
|
85
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-FJGIVDA5.mjs";
|
|
86
87
|
import {
|
|
87
88
|
PluginManager
|
|
88
89
|
} from "./chunk-FGH3ZXTP.mjs";
|
|
89
90
|
import {
|
|
90
|
-
findRequestBoundSourceBlockers,
|
|
91
91
|
generateFarmTypeArtifacts,
|
|
92
|
-
|
|
92
|
+
readRouteRenderingDirectiveFromFile,
|
|
93
93
|
resolveRouteRenderingConfigFromFile
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-35WS7P2V.mjs";
|
|
95
95
|
import {
|
|
96
96
|
FARM_API_CATALOG_PATH,
|
|
97
97
|
FARM_APP_MANIFEST_LEGACY_PATH,
|
|
@@ -107,7 +107,7 @@ import {
|
|
|
107
107
|
resolveFarmAppManifestInput,
|
|
108
108
|
routeBoundaryCoversDirectory,
|
|
109
109
|
stripRouteGroups
|
|
110
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-SVPGWJZF.mjs";
|
|
111
111
|
import {
|
|
112
112
|
FARM_DEFAULT_MCP_PATH,
|
|
113
113
|
createFarmDefaultMCPServer,
|
|
@@ -145,7 +145,7 @@ import {
|
|
|
145
145
|
import {
|
|
146
146
|
applyFarmCspHashesToHtml,
|
|
147
147
|
createFarmCspNonce
|
|
148
|
-
} from "./chunk-
|
|
148
|
+
} from "./chunk-7UEEHAW7.mjs";
|
|
149
149
|
import {
|
|
150
150
|
getFarmAppDirectories
|
|
151
151
|
} from "./chunk-BUGNQIHC.mjs";
|
|
@@ -171,7 +171,7 @@ import {
|
|
|
171
171
|
import {
|
|
172
172
|
applyFarmWorkflowVercelCrons,
|
|
173
173
|
prepareFarmWorkflowsForNitro
|
|
174
|
-
} from "./chunk-
|
|
174
|
+
} from "./chunk-BPNRQ5BA.mjs";
|
|
175
175
|
import {
|
|
176
176
|
_collectFarmStorageModules
|
|
177
177
|
} from "./chunk-JGHCKIRI.mjs";
|
|
@@ -187,7 +187,7 @@ import {
|
|
|
187
187
|
} from "./chunk-LFHCG2DU.mjs";
|
|
188
188
|
import {
|
|
189
189
|
APIRouteManager
|
|
190
|
-
} from "./chunk-
|
|
190
|
+
} from "./chunk-YYQVGKO5.mjs";
|
|
191
191
|
import {
|
|
192
192
|
readFarmI18nCatalogs
|
|
193
193
|
} from "./chunk-QCFBDFRS.mjs";
|
|
@@ -214,13 +214,13 @@ import {
|
|
|
214
214
|
} from "./chunk-BTHHUD7Q.mjs";
|
|
215
215
|
import {
|
|
216
216
|
FARM_VERSION
|
|
217
|
-
} from "./chunk-
|
|
217
|
+
} from "./chunk-VLPII2JJ.mjs";
|
|
218
218
|
import {
|
|
219
219
|
getFarmPresetRuntime
|
|
220
220
|
} from "./chunk-2A3EQHXX.mjs";
|
|
221
221
|
import {
|
|
222
222
|
_runWithFarmCspNonce
|
|
223
|
-
} from "./chunk-
|
|
223
|
+
} from "./chunk-X3NGFVRF.mjs";
|
|
224
224
|
import {
|
|
225
225
|
compareRoutePatternSpecificity
|
|
226
226
|
} from "./chunk-55YI3RRB.mjs";
|
|
@@ -1140,13 +1140,26 @@ function resolveNitroRuntimeDependency(root, specifier) {
|
|
|
1140
1140
|
}
|
|
1141
1141
|
__name(resolveNitroRuntimeDependency, "resolveNitroRuntimeDependency");
|
|
1142
1142
|
function resolveNitroInternalRuntimeAliases(root) {
|
|
1143
|
-
const
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1143
|
+
const nitroEntry = resolveNitroPackageEntry(root);
|
|
1144
|
+
const runtimeDir = path9.dirname(nitroEntry);
|
|
1145
|
+
const nitroRequire = createRequire(nitroEntry);
|
|
1146
|
+
return {
|
|
1147
|
+
...Object.fromEntries(
|
|
1148
|
+
["app", "error/hooks", "runtime-config", "shutdown", "task"].map((moduleName) => [
|
|
1149
|
+
`#nitro/runtime/${moduleName}`,
|
|
1150
|
+
path9.join(runtimeDir, "internal", `${moduleName}.mjs`).split(path9.sep).join("/")
|
|
1151
|
+
])
|
|
1152
|
+
),
|
|
1153
|
+
// Farm's generated workflow and cron wrappers live under `.farm/` and
|
|
1154
|
+
// import these. An app that only depends on @farm.js/core (pnpm) cannot
|
|
1155
|
+
// resolve them from there, and an unresolved id ships as a bare import.
|
|
1156
|
+
...Object.fromEntries(
|
|
1157
|
+
["nitro/app", "nitro/h3", "nitro/task"].map((specifier) => [
|
|
1158
|
+
specifier,
|
|
1159
|
+
nitroRequire.resolve(specifier).split(path9.sep).join("/")
|
|
1160
|
+
])
|
|
1161
|
+
)
|
|
1162
|
+
};
|
|
1150
1163
|
}
|
|
1151
1164
|
__name(resolveNitroInternalRuntimeAliases, "resolveNitroInternalRuntimeAliases");
|
|
1152
1165
|
function createPrerenderRuntimeResolverPlugin(root, resolveNitroEntry = resolveNitroPackageEntry) {
|
|
@@ -1301,18 +1314,6 @@ function shouldUseExternalMetadataImageRuntime(preset, usesImageRuntime) {
|
|
|
1301
1314
|
return usesImageRuntime && preset !== "vercel-edge" && !isCloudflareImagePreset(preset);
|
|
1302
1315
|
}
|
|
1303
1316
|
__name(shouldUseExternalMetadataImageRuntime, "shouldUseExternalMetadataImageRuntime");
|
|
1304
|
-
function resolveImageRuntime(config, preset) {
|
|
1305
|
-
if (config.images.provider === "none") return "none";
|
|
1306
|
-
const cloudflarePreset = isCloudflareImagePreset(preset);
|
|
1307
|
-
if (config.images.provider === "node" && cloudflarePreset) {
|
|
1308
|
-
throw new Error('images.provider "node" cannot run in a Cloudflare deployment');
|
|
1309
|
-
}
|
|
1310
|
-
if (config.images.provider === "cloudflare" && !cloudflarePreset) {
|
|
1311
|
-
throw new Error('images.provider "cloudflare" requires a Cloudflare deployment preset');
|
|
1312
|
-
}
|
|
1313
|
-
return config.images.provider === "cloudflare" || config.images.provider === "auto" && cloudflarePreset ? "cloudflare" : "node";
|
|
1314
|
-
}
|
|
1315
|
-
__name(resolveImageRuntime, "resolveImageRuntime");
|
|
1316
1317
|
function isNitroRollupExternal(id) {
|
|
1317
1318
|
const normalizedId = id.replace(/\\/g, "/");
|
|
1318
1319
|
return NODE_BUILTIN_MODULES.has(id) || NITRO_EXTERNAL_MODULES.has(id) || normalizedId.startsWith(".prisma/") || normalizedId.includes("/node_modules/@prisma/client/") || normalizedId.includes("/node_modules/.prisma/client/");
|
|
@@ -5296,17 +5297,6 @@ function applyConfiguredResponseHeaders(response, pathname) {
|
|
|
5296
5297
|
`.trim();
|
|
5297
5298
|
}
|
|
5298
5299
|
__name(generateConfiguredResponseHeadersRuntimeSource, "generateConfiguredResponseHeadersRuntimeSource");
|
|
5299
|
-
function parseRouteRenderingDirectiveFromDisk(modulePath) {
|
|
5300
|
-
try {
|
|
5301
|
-
const source = readFileSync(modulePath, "utf8");
|
|
5302
|
-
const directive = parseRouteRenderingDirective(source);
|
|
5303
|
-
if (findRequestBoundSourceBlockers(source).length === 0) return directive;
|
|
5304
|
-
return { ...directive ?? { ssg: false, ppr: false, directive: "" }, requestBound: true };
|
|
5305
|
-
} catch {
|
|
5306
|
-
return void 0;
|
|
5307
|
-
}
|
|
5308
|
-
}
|
|
5309
|
-
__name(parseRouteRenderingDirectiveFromDisk, "parseRouteRenderingDirectiveFromDisk");
|
|
5310
5300
|
function generatePreloadResponseRuntimeSource() {
|
|
5311
5301
|
return `
|
|
5312
5302
|
// Farm builds buffered HTML responses from strings it already holds. Remember
|
|
@@ -5670,7 +5660,7 @@ function renderFarmRouteServerTree(element) { return element; }`;
|
|
|
5670
5660
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(route.modulePath)};`
|
|
5671
5661
|
);
|
|
5672
5662
|
const clientMetadata = pageHydrationPlans.get(route.modulePath);
|
|
5673
|
-
const renderingDirective =
|
|
5663
|
+
const renderingDirective = readRouteRenderingDirectiveFromFile(route.modulePath);
|
|
5674
5664
|
pageRegistrations.push(`
|
|
5675
5665
|
{
|
|
5676
5666
|
pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
|
|
@@ -5937,7 +5927,7 @@ ${integrationRuntimeImport}
|
|
|
5937
5927
|
${nativeAuth.importSource}
|
|
5938
5928
|
${nativeMCP.importSource}
|
|
5939
5929
|
`;
|
|
5940
|
-
const imageRuntime =
|
|
5930
|
+
const imageRuntime = resolveFarmImageServerRuntime(config.images, preset);
|
|
5941
5931
|
const imageRuntimeImport = imageRuntime === "none" ? "" : `import { _withFarmImageSourceClientAddress, createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
|
|
5942
5932
|
const imageNodeRuntimeImport = imageRuntime === "node" ? `import { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } from "@farm.js/core/image/sharp";` : "";
|
|
5943
5933
|
const apiHandlerCode = apiRoutes.length > 0 ? `
|
|
@@ -6898,7 +6888,7 @@ function stripFarmDocumentWrappers(markup) {
|
|
|
6898
6888
|
function peelFarmDocumentPrefix(markup) {
|
|
6899
6889
|
let inner = markup.replace(/^\\s+/, "");
|
|
6900
6890
|
let hoisted = "";
|
|
6901
|
-
const wrapper = /^<div\\b[^>]*style=["']display\\s*:\\s*contents["'][^>]*>/i;
|
|
6891
|
+
const wrapper = /^<div\\b[^>]*style=["']display\\s*:\\s*contents;?\\s*["'][^>]*>/i;
|
|
6902
6892
|
const hoistable = /${HOISTED_HEAD_ELEMENT.source}/i;
|
|
6903
6893
|
let match;
|
|
6904
6894
|
while ((match = wrapper.exec(inner) || hoistable.exec(inner))) {
|
|
@@ -9951,7 +9941,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
9951
9941
|
const outputDir = resolveDeployOutputPath(root, config.deploy.outputDir);
|
|
9952
9942
|
const runtimeServerOutputDir = isVercel ? path9.join(outputDir, "functions", "__nitro.func") : path9.join(outputDir, "server");
|
|
9953
9943
|
const ssrOutputDir = path9.join(root, distDir, "ssr");
|
|
9954
|
-
const imageRuntime =
|
|
9944
|
+
const imageRuntime = resolveFarmImageServerRuntime(config.images, preset);
|
|
9955
9945
|
const hasGeneratedMetadataImages = Array.from(routeManager.getMetadataImages().values()).some(
|
|
9956
9946
|
(image) => image.sourceType === "module"
|
|
9957
9947
|
);
|
|
@@ -10348,7 +10338,11 @@ function toFarmNodeResponse(request, response) {
|
|
|
10348
10338
|
...farmWorkflows.tasks,
|
|
10349
10339
|
...farmCron.tasks
|
|
10350
10340
|
},
|
|
10351
|
-
|
|
10341
|
+
// Vercel crons call Farm's own secret-checked workflow and cron routes
|
|
10342
|
+
// (postProcessVercelOutput). Nitro's Vercel preset would also turn
|
|
10343
|
+
// scheduledTasks into a `/_vercel/cron` route that runs tasks without a
|
|
10344
|
+
// secret check unless CRON_SECRET is set, and double-schedules them when it is.
|
|
10345
|
+
scheduledTasks: isVercel ? {} : scheduledTasks,
|
|
10352
10346
|
...isCloudflareWorker && cloudflareCronConfig ? {
|
|
10353
10347
|
cloudflare: cloudflareCronConfig
|
|
10354
10348
|
} : {},
|
|
@@ -11379,7 +11373,7 @@ function resolveLegacyPageEntry(config, root, srcDir) {
|
|
|
11379
11373
|
__name(resolveLegacyPageEntry, "resolveLegacyPageEntry");
|
|
11380
11374
|
async function buildNitro(config, routeManager, apiRouteManager, serverRenderer, preset, root, distDir, pluginManager) {
|
|
11381
11375
|
const [{ createNitroConfig }, { createNitro, build: nitroBuild }] = await Promise.all([
|
|
11382
|
-
import("./nitro-
|
|
11376
|
+
import("./nitro-KDACKNHU.mjs"),
|
|
11383
11377
|
import("nitro/builder")
|
|
11384
11378
|
]);
|
|
11385
11379
|
let nitroConfig = await createNitroConfig(
|