@farm.js/core 0.1.82 → 0.1.83
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.d-C2Su3x4D.d.ts → agent-mcp.d-7uKdOttc.d.ts} +1 -1
- package/dist/{agent-mcp.d-Yak-LqRd.d.mts → agent-mcp.d-LChlR2au.d.mts} +1 -1
- package/dist/agent-runtime.d.mts +2 -1
- package/dist/agent-runtime.d.ts +2 -1
- package/dist/analyzer-WGH6J2HN.cjs +17 -0
- package/dist/{analyzer-RPU2KG4J.mjs → analyzer-Y6IY26HI.mjs} +2 -2
- package/dist/api/node.d.mts +4 -3
- package/dist/api/node.d.ts +4 -3
- package/dist/api/route-manager.d.mts +4 -3
- package/dist/api/route-manager.d.ts +4 -3
- package/dist/api/runtime.d.mts +3 -2
- package/dist/api/runtime.d.ts +3 -2
- package/dist/api.d.mts +5 -4
- package/dist/api.d.ts +5 -4
- package/dist/{app-manifest.d-DZyXaICz.d.ts → app-manifest.d-CRp21oAz.d.ts} +1 -1
- package/dist/{app-manifest.d-BcyOFMrg.d.mts → app-manifest.d-QMdmqqCr.d.mts} +1 -1
- package/dist/app-markdown.d.mts +3 -2
- package/dist/app-markdown.d.ts +3 -2
- package/dist/{app.d-CIoXsAbN.d.ts → app.d-CVPu_hoD.d.ts} +34 -4
- package/dist/{app.d-C0ePpuaG.d.mts → app.d-eSm7jgoc.d.mts} +34 -4
- package/dist/{chunk-JK26IMT7.cjs → chunk-3CZ4MJHW.cjs} +1 -1
- package/dist/{chunk-5MUFW5UU.cjs → chunk-3DAJXBSL.cjs} +2 -2
- package/dist/{chunk-XMHERKSE.mjs → chunk-42IBGQTN.mjs} +5 -12
- package/dist/{chunk-4X7LSGM6.mjs → chunk-43N3X6OO.mjs} +1 -1
- package/dist/{chunk-LM2ZDNDD.cjs → chunk-55UJGUBP.cjs} +24 -19
- package/dist/{chunk-TPA2PV5J.mjs → chunk-5V6HSJFG.mjs} +24 -1
- package/dist/chunk-5X5GJU5A.cjs +426 -0
- package/dist/{chunk-Q2VOT3K2.cjs → chunk-7X2CYE66.cjs} +316 -310
- package/dist/{chunk-6BPFIYGY.cjs → chunk-A5BHJHDF.cjs} +3 -3
- package/dist/{chunk-EL2Z6YFZ.mjs → chunk-B5SJYXJK.mjs} +177 -67
- package/dist/chunk-BUQR7KKO.mjs +17 -0
- package/dist/{chunk-724WT3NI.mjs → chunk-CRE642TW.mjs} +1 -1
- package/dist/{chunk-NRCKBDYP.mjs → chunk-DPUZVGXH.mjs} +130 -27
- package/dist/{chunk-N2EFMN2K.cjs → chunk-DZTWUEBB.cjs} +2 -2
- package/dist/{chunk-DRO3NXA3.cjs → chunk-EFI6QWBQ.cjs} +200 -90
- package/dist/chunk-ELNRKD4V.mjs +426 -0
- package/dist/{chunk-63ZE6B6M.mjs → chunk-FFWSER54.mjs} +1 -1
- package/dist/chunk-FZ7OUN5M.cjs +30 -0
- package/dist/{chunk-5MMKNW7Q.cjs → chunk-H7REG7OX.cjs} +15 -8
- package/dist/{chunk-VMBIKDKW.cjs → chunk-HRH7OKBQ.cjs} +6 -4
- package/dist/{chunk-RMPUEH5T.cjs → chunk-IABI62FH.cjs} +2 -2
- package/dist/{chunk-ZIZRIZLP.mjs → chunk-IAIRQAHA.mjs} +3 -1
- package/dist/{chunk-EX6ZSN5P.cjs → chunk-IZYFP7IN.cjs} +17 -24
- package/dist/chunk-J6RFB324.cjs +17 -0
- package/dist/{chunk-ARORZ3MH.cjs → chunk-JHRJ5V2F.cjs} +366 -263
- package/dist/{chunk-OMB7UGVW.mjs → chunk-K3GHY7GY.mjs} +14 -9
- package/dist/{chunk-UVV3I5QA.cjs → chunk-L2GUEYHR.cjs} +29 -6
- package/dist/{chunk-HHQEKLZL.cjs → chunk-LN6FAYNB.cjs} +36 -31
- package/dist/chunk-M6AJZ4XR.mjs +30 -0
- package/dist/{chunk-47I2MYIR.mjs → chunk-NDWI6FDH.mjs} +442 -180
- package/dist/{chunk-BCTHOQPP.cjs → chunk-NGTZHWBG.cjs} +68 -1
- package/dist/{chunk-OP5VI4TP.mjs → chunk-NKVBWPXR.mjs} +1 -1
- package/dist/{chunk-CD5Z7RR5.cjs → chunk-OM6JIIJU.cjs} +4 -4
- package/dist/{chunk-C3VCYOU4.mjs → chunk-ORBBAA7B.mjs} +1 -1
- package/dist/{chunk-I4DR3HCH.mjs → chunk-R3VLM2MW.mjs} +1 -1
- package/dist/{chunk-I4WZRG73.mjs → chunk-RB5IGN3N.mjs} +13 -6
- package/dist/{chunk-RMLR5RMH.mjs → chunk-RGTZAM6Y.mjs} +67 -0
- package/dist/{chunk-GXLNARPO.mjs → chunk-RNJX3MD6.mjs} +1 -1
- package/dist/{chunk-EJCVG25Z.mjs → chunk-S3R4JDRO.mjs} +17 -9
- package/dist/{chunk-AIPZDBP6.cjs → chunk-SLIXHUMS.cjs} +780 -518
- package/dist/{chunk-WFVSAT7Y.cjs → chunk-T7HGXF7D.cjs} +3 -3
- package/dist/{chunk-CJDBTTLB.mjs → chunk-U56Z3755.mjs} +10 -5
- package/dist/{chunk-QSMUMK7Y.mjs → chunk-VQ6IXALL.mjs} +2 -2
- package/dist/{chunk-B2PGVHBG.cjs → chunk-WCSBYQOT.cjs} +4 -4
- package/dist/{chunk-DAXU2NBE.mjs → chunk-WZV2G2A6.mjs} +30 -24
- package/dist/{chunk-SM2SYWAR.cjs → chunk-XJDB564A.cjs} +18 -10
- package/dist/{cli-runtime.d-Hnvvadz7.d.mts → cli-runtime.d-C7aMfoTq.d.mts} +8 -6
- package/dist/{cli-runtime.d-I0MphTbc.d.ts → cli-runtime.d-DaElKjaL.d.ts} +8 -6
- package/dist/{client-component.d-DapRqtSC.d.mts → client-component.d-DLMCzmUx.d.mts} +1 -1
- package/dist/{client-component.d-5QEvtJsg.d.ts → client-component.d-DLknFP8l.d.ts} +1 -1
- package/dist/{client-plugins.d-DcmDzcSC.d.ts → client-plugins.d-BVXjyIkY.d.ts} +14 -0
- package/dist/{client-plugins.d-C1WM3ieD.d.mts → client-plugins.d-BwKwuO_0.d.mts} +14 -0
- package/dist/client-plugins.d.mts +2 -1
- package/dist/client-plugins.d.ts +2 -1
- package/dist/client.cjs +4 -3
- package/dist/client.d.mts +10 -9
- package/dist/client.d.ts +10 -9
- package/dist/client.mjs +3 -2
- package/dist/config.d.mts +2 -1
- package/dist/config.d.ts +2 -1
- package/dist/desktop.d.mts +3 -2
- package/dist/desktop.d.ts +3 -2
- package/dist/{devtools-C5GXZZ7E.mjs → devtools-OI52TCSD.mjs} +3 -3
- package/dist/{devtools-5B7NZE6F.cjs → devtools-ZM2AR36W.cjs} +5 -5
- package/dist/docs.cjs +8 -7
- package/dist/docs.d.mts +15 -6
- package/dist/docs.d.ts +15 -6
- package/dist/docs.mjs +7 -6
- package/dist/environment/vite.cjs +4 -4
- package/dist/environment/vite.d.mts +1 -0
- package/dist/environment/vite.d.ts +1 -0
- package/dist/environment/vite.mjs +3 -3
- package/dist/{generate-route-types.d-CaGMIaNI.d.mts → generate-route-types.d-BFOMM8Ef.d.mts} +3 -0
- package/dist/{generate-route-types.d-B76M5R11.d.ts → generate-route-types.d-C2m8myHb.d.ts} +3 -0
- package/dist/{handler.d-B8bPCBzl.d.mts → handler.d-BKTWzzNA.d.mts} +1 -1
- package/dist/{handler.d-Cliwo6Nu.d.ts → handler.d-Dzpyg3-N.d.ts} +1 -1
- package/dist/{headers.d-CVwSpSGX.d.mts → headers.d-5opjyhXw.d.mts} +1 -1
- package/dist/{headers.d-C_btqjV6.d.ts → headers.d-PZyXcDAH.d.ts} +1 -1
- package/dist/index.cjs +25 -23
- package/dist/{index.d-DFuMZk9-.d.mts → index.d-C0Mie66f.d.mts} +1 -1
- package/dist/{index.d-hOEbMcLk.d.ts → index.d-DV2q-0mE.d.ts} +1 -1
- package/dist/index.d.mts +26 -25
- package/dist/index.d.ts +26 -25
- package/dist/index.mjs +25 -23
- package/dist/integrations/orm.d.mts +2 -1
- package/dist/integrations/orm.d.ts +2 -1
- package/dist/integrations.d.mts +2 -1
- package/dist/integrations.d.ts +2 -1
- package/dist/internal/app-markdown-runtime.d.mts +3 -2
- package/dist/internal/app-markdown-runtime.d.ts +3 -2
- package/dist/internal/build-runtime.cjs +21 -21
- package/dist/internal/build-runtime.d.mts +5 -4
- package/dist/internal/build-runtime.d.ts +5 -4
- package/dist/internal/build-runtime.mjs +20 -20
- package/dist/internal/cli-runtime.cjs +6 -6
- package/dist/internal/cli-runtime.d.mts +8 -7
- package/dist/internal/cli-runtime.d.ts +8 -7
- package/dist/internal/cli-runtime.mjs +5 -5
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.d.mts +5 -5
- package/dist/internal/client-runtime.d.ts +5 -5
- package/dist/internal/compression-runtime.d.mts +2 -1
- package/dist/internal/compression-runtime.d.ts +2 -1
- package/dist/internal/config-runtime.cjs +5 -5
- package/dist/internal/config-runtime.d.mts +6 -5
- package/dist/internal/config-runtime.d.ts +6 -5
- package/dist/internal/config-runtime.mjs +4 -4
- package/dist/internal/infra-analytics-runtime.cjs +6 -6
- package/dist/internal/infra-analytics-runtime.mjs +4 -4
- package/dist/internal/islands-action-client.cjs +18 -0
- package/dist/internal/islands-action-client.d.mts +18 -0
- package/dist/internal/islands-action-client.d.ts +18 -0
- package/dist/internal/islands-action-client.mjs +18 -0
- package/dist/internal/islands-runtime.cjs +3 -8
- package/dist/internal/islands-runtime.mjs +4 -9
- package/dist/internal/islx-actions-client.cjs +4 -3
- package/dist/internal/islx-actions-client.mjs +3 -2
- package/dist/internal/islx-actions-server.d.mts +0 -2
- package/dist/internal/islx-actions-server.d.ts +0 -2
- package/dist/internal/islx-client.cjs +13 -1
- package/dist/internal/islx-client.d.mts +11 -0
- package/dist/internal/islx-client.d.ts +11 -0
- package/dist/internal/islx-client.mjs +14 -0
- package/dist/internal/metadata-image-runtime.d.mts +1 -0
- package/dist/internal/metadata-image-runtime.d.ts +1 -0
- package/dist/internal/native-server-fns.cjs +4 -4
- package/dist/internal/native-server-fns.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-runtime.cjs +5 -5
- package/dist/internal/production-runtime.d.mts +11 -11
- package/dist/internal/production-runtime.d.ts +11 -11
- package/dist/internal/production-runtime.mjs +4 -4
- package/dist/internal/spa-router.d.mts +3 -3
- package/dist/internal/spa-router.d.ts +3 -3
- package/dist/internal/start-manifest.d.mts +2 -1
- package/dist/internal/start-manifest.d.ts +2 -1
- package/dist/markdown.d.mts +2 -1
- package/dist/markdown.d.ts +2 -1
- package/dist/middleware.d.mts +2 -1
- package/dist/middleware.d.ts +2 -1
- package/dist/mobile.d.mts +6 -3
- package/dist/mobile.d.ts +6 -3
- package/dist/{mount.d-DLeYxeRR.d.mts → mount.d-CZ_qL1iS.d.mts} +1 -1
- package/dist/{mount.d-CAovYKfs.d.ts → mount.d-gWul1GA1.d.ts} +1 -1
- package/dist/{navigation-delegate.d-Chv93QS6.d.mts → navigation-delegate.d-BBTzhJLj.d.mts} +1 -1
- package/dist/{navigation-delegate.d-BLM-8Q3Z.d.ts → navigation-delegate.d-BZsYEAet.d.ts} +1 -1
- package/dist/navigation.d.mts +5 -5
- package/dist/navigation.d.ts +5 -5
- package/dist/plugin.cjs +15 -15
- package/dist/plugin.d.mts +6 -6
- package/dist/plugin.d.ts +6 -6
- package/dist/plugin.mjs +14 -14
- package/dist/{render-plan.d-BSTjTH8h.d.ts → render-plan.d-AaJsYPX-.d.ts} +1 -1
- package/dist/{render-plan.d-CK5Lggyb.d.mts → render-plan.d-bnWxS12w.d.mts} +1 -1
- package/dist/renderer-client.cjs +6 -5
- package/dist/renderer-client.d.mts +8 -7
- package/dist/renderer-client.d.ts +8 -7
- package/dist/renderer-client.mjs +2 -1
- package/dist/renderer.cjs +6 -2
- package/dist/renderer.d.mts +87 -4
- package/dist/renderer.d.ts +87 -4
- package/dist/renderer.mjs +5 -1
- package/dist/{request.d-BhggxQf3.d.mts → request.d-C2HOn3Hi.d.mts} +1 -1
- package/dist/{request.d-CyJS9bjm.d.ts → request.d-CAeitOG1.d.ts} +1 -1
- package/dist/request.d.mts +3 -2
- package/dist/request.d.ts +3 -2
- package/dist/{route-rendering.d-BLPPmI5I.d.ts → route-rendering.d-A1dIkUK5.d.ts} +1 -1
- package/dist/{route-rendering.d-CUpG2mZJ.d.mts → route-rendering.d-CYA-ulnX.d.mts} +1 -1
- package/dist/{router.d-2NQM1Kgw.d.mts → router.d-8lxnzlkr.d.mts} +1 -1
- package/dist/{router.d-0X2Ki6rf.d.ts → router.d-A_Yt6jYz.d.ts} +1 -1
- package/dist/{routes.d-CCccJRrp.d.mts → routes.d-BWvpUoYu.d.mts} +1 -1
- package/dist/{routes.d-b7khoRoU.d.ts → routes.d-D7RWvfqL.d.ts} +1 -1
- package/dist/routes.d.mts +2 -1
- package/dist/routes.d.ts +2 -1
- package/dist/{rsc-pipeline-5AOF64FL.cjs → rsc-pipeline-MFJZGDPE.cjs} +5 -5
- package/dist/{rsc-pipeline-DNRLYOJ7.mjs → rsc-pipeline-TRZVFCBX.mjs} +4 -4
- package/dist/{runtime-ZVHG5SRB.cjs → runtime-MJUG2HGR.cjs} +10 -9
- package/dist/{runtime-EHG2FRXZ.mjs → runtime-O4Y3Z6V3.mjs} +6 -5
- package/dist/{runtime.d-CXuwkUgr.d.ts → runtime.d-BPyvWrgQ.d.ts} +1 -1
- package/dist/{runtime.d-CaFXcu_Q.d.mts → runtime.d-C_rZ9_DD.d.mts} +1 -1
- package/dist/{server-components-status.d-Cp7zvBm5.d.mts → server-components-status.d-BpxiEMQE.d.mts} +1 -1
- package/dist/{server-components-status.d-BdeFD8ZH.d.ts → server-components-status.d-C2UEKJn7.d.ts} +1 -1
- package/dist/server-plugins.d.mts +4 -3
- package/dist/server-plugins.d.ts +4 -3
- package/dist/server-query-call.d-rVM_lsYk.d.mts +15 -0
- package/dist/server-query-call.d-rVM_lsYk.d.ts +15 -0
- package/dist/server-query-client.cjs +5 -3
- package/dist/server-query-client.d.mts +3 -2
- package/dist/server-query-client.d.ts +3 -2
- package/dist/server-query-client.mjs +5 -3
- package/dist/{server-query-runtime.d-DXRNhX_3.d.ts → server-query-runtime.d-BlHd90D0.d.ts} +2 -8
- package/dist/{server-query-runtime.d-aP52iuL5.d.mts → server-query-runtime.d-CCLGkQtE.d.mts} +2 -8
- package/dist/server.cjs +39 -39
- package/dist/server.d.mts +12 -12
- package/dist/server.d.ts +12 -12
- package/dist/server.mjs +16 -16
- package/dist/{spa-router.d-l3G38xHa.d.mts → spa-router.d-BD-6WX1R.d.mts} +2 -2
- package/dist/{spa-router.d-Bjgl-Osi.d.ts → spa-router.d-Cw5i_15e.d.ts} +2 -2
- package/dist/{ssg.d-DDca17Lc.d.ts → ssg.d-Bifiq0EL.d.ts} +2 -2
- package/dist/{ssg.d-RnlHOqUL.d.mts → ssg.d-CCE9aob5.d.mts} +2 -2
- package/dist/{store-core.d-BaOUOPf7.d.ts → store-core.d-5tVn5vi1.d.ts} +3 -3
- package/dist/{store-core.d-BZjuC6Zc.d.mts → store-core.d-BN2MxSG9.d.mts} +3 -3
- package/dist/testing.d.mts +2 -1
- package/dist/testing.d.ts +2 -1
- package/dist/{utils.d-D8TWmpWo.d.ts → utils.d-BUjpSNIO.d.ts} +1 -1
- package/dist/{utils.d-tdzw0_zQ.d.mts → utils.d-wGPLeVbq.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +15 -15
- package/dist/vite.d.mts +6 -6
- package/dist/vite.d.ts +6 -6
- package/dist/vite.mjs +14 -14
- package/package.json +6 -1
- package/dist/analyzer-LV23T6QN.cjs +0 -17
- package/dist/chunk-AUFEM3FB.mjs +0 -229
- package/dist/chunk-S7WZUK3B.cjs +0 -229
|
@@ -6,12 +6,19 @@ var _chunkDMSXZNQRcjs = require('./chunk-DMSXZNQR.cjs');
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkHRH7OKBQcjs = require('./chunk-HRH7OKBQ.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _chunkBBVLOENDcjs = require('./chunk-BBVLOEND.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
+
var _chunk5X5GJU5Acjs = require('./chunk-5X5GJU5A.cjs');
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
var _chunkVS7HLH4Scjs = require('./chunk-VS7HLH4S.cjs');
|
|
20
|
+
|
|
21
|
+
|
|
15
22
|
var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
16
23
|
|
|
17
24
|
|
|
@@ -57,7 +64,7 @@ var _chunkNEKO3HM2cjs = require('./chunk-NEKO3HM2.cjs');
|
|
|
57
64
|
var _chunkOZUINP2Pcjs = require('./chunk-OZUINP2P.cjs');
|
|
58
65
|
|
|
59
66
|
|
|
60
|
-
var
|
|
67
|
+
var _chunkWCSBYQOTcjs = require('./chunk-WCSBYQOT.cjs');
|
|
61
68
|
|
|
62
69
|
|
|
63
70
|
|
|
@@ -69,10 +76,6 @@ var _chunkW53Z4WDIcjs = require('./chunk-W53Z4WDI.cjs');
|
|
|
69
76
|
|
|
70
77
|
|
|
71
78
|
|
|
72
|
-
var _chunkVS7HLH4Scjs = require('./chunk-VS7HLH4S.cjs');
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
79
|
var _chunkWOAXQ5MZcjs = require('./chunk-WOAXQ5MZ.cjs');
|
|
77
80
|
|
|
78
81
|
|
|
@@ -100,18 +103,19 @@ var _chunkWOAXQ5MZcjs = require('./chunk-WOAXQ5MZ.cjs');
|
|
|
100
103
|
|
|
101
104
|
|
|
102
105
|
|
|
103
|
-
|
|
106
|
+
|
|
107
|
+
var _chunkEFI6QWBQcjs = require('./chunk-EFI6QWBQ.cjs');
|
|
104
108
|
|
|
105
109
|
|
|
106
110
|
|
|
107
111
|
var _chunk5AMH6AFAcjs = require('./chunk-5AMH6AFA.cjs');
|
|
108
112
|
|
|
109
113
|
|
|
110
|
-
var
|
|
114
|
+
var _chunkXJDB564Acjs = require('./chunk-XJDB564A.cjs');
|
|
111
115
|
|
|
112
116
|
|
|
113
117
|
|
|
114
|
-
var
|
|
118
|
+
var _chunkL2GUEYHRcjs = require('./chunk-L2GUEYHR.cjs');
|
|
115
119
|
|
|
116
120
|
|
|
117
121
|
var _chunkIIHZ2BEEcjs = require('./chunk-IIHZ2BEE.cjs');
|
|
@@ -163,7 +167,7 @@ var _chunk52Q4OB4Acjs = require('./chunk-52Q4OB4A.cjs');
|
|
|
163
167
|
|
|
164
168
|
|
|
165
169
|
|
|
166
|
-
var
|
|
170
|
+
var _chunkNGTZHWBGcjs = require('./chunk-NGTZHWBG.cjs');
|
|
167
171
|
|
|
168
172
|
|
|
169
173
|
var _chunkMCSRMEQVcjs = require('./chunk-MCSRMEQV.cjs');
|
|
@@ -304,7 +308,7 @@ var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
|
|
|
304
308
|
var _chunkPLJMEUANcjs = require('./chunk-PLJMEUAN.cjs');
|
|
305
309
|
|
|
306
310
|
|
|
307
|
-
var
|
|
311
|
+
var _chunk3CZ4MJHWcjs = require('./chunk-3CZ4MJHW.cjs');
|
|
308
312
|
|
|
309
313
|
|
|
310
314
|
var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
|
|
@@ -505,7 +509,15 @@ var RouteManager = class _RouteManager {
|
|
|
505
509
|
this.redirects = /* @__PURE__ */ new Map();
|
|
506
510
|
this.programmaticPages = /* @__PURE__ */ new Map();
|
|
507
511
|
this.programmaticLayouts = /* @__PURE__ */ new Map();
|
|
508
|
-
this.programmaticClientRoutes =
|
|
512
|
+
this.programmaticClientRoutes = _chunkEFI6QWBQcjs.mergeProgrammaticClientRoutes.call(void 0, []);
|
|
513
|
+
// The hydration settings each route rule returned, by file.
|
|
514
|
+
this.rendererRouteHydration = /* @__PURE__ */ new Map();
|
|
515
|
+
this.disposeRendererHydration = () => {
|
|
516
|
+
};
|
|
517
|
+
// The directories a renderer's route rules scan, and the files they mapped, absolute with `/`
|
|
518
|
+
// separators.
|
|
519
|
+
this.rendererRouteDirs = [];
|
|
520
|
+
this.rendererRouteModules = /* @__PURE__ */ new Set();
|
|
509
521
|
this.discovery = Promise.resolve();
|
|
510
522
|
this.reportedIslandsErrors = /* @__PURE__ */ new Set();
|
|
511
523
|
// Each route module's hydration plan from the last plan, with the source files it read, so a dev
|
|
@@ -556,10 +568,65 @@ var RouteManager = class _RouteManager {
|
|
|
556
568
|
this.programmaticPages = next.programmaticPages;
|
|
557
569
|
this.programmaticLayouts = next.programmaticLayouts;
|
|
558
570
|
this.programmaticClientRoutes = next.programmaticClientRoutes;
|
|
571
|
+
this.rendererNotFoundPath = next.rendererNotFoundPath;
|
|
572
|
+
this.rendererRouteHydration = next.rendererRouteHydration;
|
|
573
|
+
this.rendererRouteDirs = next.rendererRouteDirs;
|
|
574
|
+
this.rendererRouteModules = next.rendererRouteModules;
|
|
575
|
+
this.recordRendererHydration();
|
|
559
576
|
});
|
|
560
577
|
this.discovery = discovery;
|
|
561
578
|
return discovery;
|
|
562
579
|
}
|
|
580
|
+
/**
|
|
581
|
+
* Hands the client-module reader the renderer's hydration levels for this scan's pages and
|
|
582
|
+
* layouts (`hydration` and route rules on the renderer descriptor).
|
|
583
|
+
*/
|
|
584
|
+
recordRendererHydration() {
|
|
585
|
+
this.disposeRendererHydration();
|
|
586
|
+
const renderer = this.config.renderer;
|
|
587
|
+
const routeModules = [];
|
|
588
|
+
for (const [kind, entries] of [
|
|
589
|
+
["page", this.routes.values()],
|
|
590
|
+
["layout", this.layouts.values()]
|
|
591
|
+
]) {
|
|
592
|
+
for (const entry of entries) {
|
|
593
|
+
if (entry.source === "programmatic") continue;
|
|
594
|
+
routeModules.push({
|
|
595
|
+
modulePath: entry.modulePath,
|
|
596
|
+
kind,
|
|
597
|
+
hydration: this.rendererRouteHydration.get(entry.modulePath)
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
this.disposeRendererHydration = _chunkEFI6QWBQcjs.setFarmRendererHydrationScope.call(void 0,
|
|
602
|
+
_chunk52Q4OB4Acjs.getFarmSourceRoots.call(void 0, this.config).map((source) => source.root),
|
|
603
|
+
renderer,
|
|
604
|
+
routeModules
|
|
605
|
+
);
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* The not-found page a renderer's `routes()` mapped, null when it mapped none, or undefined when
|
|
609
|
+
* the renderer has no route rules and Farm looks for `src/app/not-found.*` itself.
|
|
610
|
+
*/
|
|
611
|
+
getRendererNotFoundPath() {
|
|
612
|
+
return this.rendererNotFoundPath;
|
|
613
|
+
}
|
|
614
|
+
/**
|
|
615
|
+
* Whether `file` is under a directory a renderer's route rules scan, where adding or removing a
|
|
616
|
+
* file can change the routes.
|
|
617
|
+
*/
|
|
618
|
+
isRendererRouteFile(file) {
|
|
619
|
+
if (this.rendererRouteDirs.length === 0) return false;
|
|
620
|
+
const normalized = file.replace(/\\/g, "/");
|
|
621
|
+
return this.rendererRouteDirs.some((dir) => normalized.startsWith(`${dir}/`));
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* Whether `file` is a page, layout, loading, error or not-found file a renderer's route rules
|
|
625
|
+
* mapped, where an edit can change what the route renders or whether it hydrates.
|
|
626
|
+
*/
|
|
627
|
+
isRendererRouteModule(file) {
|
|
628
|
+
return this.rendererRouteModules.size > 0 && this.rendererRouteModules.has(file.replace(/\\/g, "/"));
|
|
629
|
+
}
|
|
563
630
|
/** Fill this manager's empty route tables. Only a fresh manager made by discoverRoutes runs it. */
|
|
564
631
|
async discoverInto() {
|
|
565
632
|
const programmaticClientRoutes = [];
|
|
@@ -567,7 +634,7 @@ var RouteManager = class _RouteManager {
|
|
|
567
634
|
await this.discoverFileRoutes(source);
|
|
568
635
|
await this.discoverProgrammaticRoutes(source, programmaticClientRoutes);
|
|
569
636
|
}
|
|
570
|
-
this.programmaticClientRoutes =
|
|
637
|
+
this.programmaticClientRoutes = _chunkEFI6QWBQcjs.mergeProgrammaticClientRoutes.call(void 0, programmaticClientRoutes);
|
|
571
638
|
for (const slot of this.routeSlots.values()) {
|
|
572
639
|
if (slot.interception && !this.pageRouteShapes.has(_chunkML4TOUZPcjs.getRoutePatternShape.call(void 0, slot.pattern))) {
|
|
573
640
|
throw new (0, _chunkML4TOUZPcjs.AmbiguousRouteError)(
|
|
@@ -860,11 +927,11 @@ var RouteManager = class _RouteManager {
|
|
|
860
927
|
return this.clientManifestCache.manifest;
|
|
861
928
|
}
|
|
862
929
|
const cacheFile = this.packageClientBoundaryCacheFile;
|
|
863
|
-
const compute = () =>
|
|
930
|
+
const compute = () => _chunkEFI6QWBQcjs.withFarmSourceSnapshot.call(void 0,
|
|
864
931
|
() => this.computeClientManifest(normalizedProjectRoot),
|
|
865
932
|
this.sourceSnapshot
|
|
866
933
|
);
|
|
867
|
-
return cacheFile ?
|
|
934
|
+
return cacheFile ? _chunkEFI6QWBQcjs.runWithPackageClientBoundaryCacheFile.call(void 0, cacheFile, compute) : compute();
|
|
868
935
|
}
|
|
869
936
|
/**
|
|
870
937
|
* @internal The dev server reports every watched change (`noteSourceChange`), so a replan can
|
|
@@ -873,7 +940,7 @@ var RouteManager = class _RouteManager {
|
|
|
873
940
|
*/
|
|
874
941
|
trackSourceChanges() {
|
|
875
942
|
this.sourceChangeTracking = true;
|
|
876
|
-
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0,
|
|
943
|
+
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0, _chunkEFI6QWBQcjs.FarmSourceSnapshotStore)())));
|
|
877
944
|
}
|
|
878
945
|
/**
|
|
879
946
|
* @internal A production build edits no source while it runs, so what the plan reads, parses and
|
|
@@ -882,7 +949,7 @@ var RouteManager = class _RouteManager {
|
|
|
882
949
|
*/
|
|
883
950
|
keepBuildSourceSnapshot() {
|
|
884
951
|
if (this.sourceChangeTracking) return;
|
|
885
|
-
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0,
|
|
952
|
+
_nullishCoalesce(this.sourceSnapshot, () => ( (this.sourceSnapshot = new (0, _chunkEFI6QWBQcjs.FarmSourceSnapshotStore)(false))));
|
|
886
953
|
}
|
|
887
954
|
/**
|
|
888
955
|
* @internal Hands the snapshot keepBuildSourceSnapshot kept to the build, which clears it once
|
|
@@ -925,7 +992,7 @@ var RouteManager = class _RouteManager {
|
|
|
925
992
|
return false;
|
|
926
993
|
}
|
|
927
994
|
const previous = _optionalChain([this, 'access', _18 => _18.sourceSnapshot, 'optionalAccess', _19 => _19.peekSource, 'call', _20 => _20(path4.default.resolve(file))]);
|
|
928
|
-
return previous !== void 0 &&
|
|
995
|
+
return previous !== void 0 && _chunkEFI6QWBQcjs.isFarmClientModulePlanUnchanged.call(void 0, file, previous);
|
|
929
996
|
}
|
|
930
997
|
/**
|
|
931
998
|
* A route module's plan: the last one when it read none of `edited`, recomputed otherwise.
|
|
@@ -936,7 +1003,7 @@ var RouteManager = class _RouteManager {
|
|
|
936
1003
|
if (previous && edited && ![...edited].some((file) => previous.files.has(file))) {
|
|
937
1004
|
return { ...previous.plan };
|
|
938
1005
|
}
|
|
939
|
-
const { result, files } =
|
|
1006
|
+
const { result, files } = _chunkEFI6QWBQcjs.traceFarmSourceReads.call(void 0, compute);
|
|
940
1007
|
const sources = /* @__PURE__ */ new Set();
|
|
941
1008
|
for (const file of files) {
|
|
942
1009
|
const source = this.planSourcePath(file);
|
|
@@ -944,7 +1011,7 @@ var RouteManager = class _RouteManager {
|
|
|
944
1011
|
}
|
|
945
1012
|
if (!this.sourceChangeTracking) {
|
|
946
1013
|
for (const source of sources) {
|
|
947
|
-
if (!this.planStamps.has(source)) this.planStamps.set(source,
|
|
1014
|
+
if (!this.planStamps.has(source)) this.planStamps.set(source, _chunkEFI6QWBQcjs.getFarmSourceStamp.call(void 0, source));
|
|
948
1015
|
}
|
|
949
1016
|
}
|
|
950
1017
|
this.ownerPlans.set(key, { plan: result, files: sources, planKey });
|
|
@@ -964,7 +1031,7 @@ var RouteManager = class _RouteManager {
|
|
|
964
1031
|
const isUnchanged = (file) => {
|
|
965
1032
|
let result = unchanged.get(file);
|
|
966
1033
|
if (result === void 0) {
|
|
967
|
-
result = this.planStamps.get(file) ===
|
|
1034
|
+
result = this.planStamps.get(file) === _chunkEFI6QWBQcjs.getFarmSourceStamp.call(void 0, file);
|
|
968
1035
|
unchanged.set(file, result);
|
|
969
1036
|
}
|
|
970
1037
|
return result;
|
|
@@ -1011,7 +1078,7 @@ var RouteManager = class _RouteManager {
|
|
|
1011
1078
|
*/
|
|
1012
1079
|
inspectPackages(operation) {
|
|
1013
1080
|
const file = this.packageClientBoundaryCacheFile;
|
|
1014
|
-
return file ?
|
|
1081
|
+
return file ? _chunkEFI6QWBQcjs.runWithLatestPackageClientBoundaryCache.call(void 0, file, operation) : operation();
|
|
1015
1082
|
}
|
|
1016
1083
|
computeClientManifest(normalizedProjectRoot) {
|
|
1017
1084
|
const toUrlPath = (absolutePath) => {
|
|
@@ -1034,14 +1101,14 @@ var RouteManager = class _RouteManager {
|
|
|
1034
1101
|
`[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
|
|
1035
1102
|
);
|
|
1036
1103
|
}
|
|
1037
|
-
const isolatedMode =
|
|
1104
|
+
const isolatedMode = _chunkEFI6QWBQcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
1038
1105
|
_optionalChain([this, 'access', _27 => _27.config, 'access', _28 => _28.experimental, 'optionalAccess', _29 => _29.isolatedClientHydration]),
|
|
1039
1106
|
{
|
|
1040
1107
|
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _30 => _30.config, 'access', _31 => _31.experimental, 'optionalAccess', _32 => _32.serverComponents])) === "rsc",
|
|
1041
1108
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
1042
1109
|
}
|
|
1043
1110
|
);
|
|
1044
|
-
const planOptions =
|
|
1111
|
+
const planOptions = _chunkEFI6QWBQcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
1045
1112
|
this.config.renderer,
|
|
1046
1113
|
Boolean(unsupportedIntegrationProvider)
|
|
1047
1114
|
);
|
|
@@ -1051,7 +1118,7 @@ var RouteManager = class _RouteManager {
|
|
|
1051
1118
|
if (this.sourceChangeTracking && this.editedSources && this.ownerPlans.size > 0) {
|
|
1052
1119
|
edited = /* @__PURE__ */ new Set();
|
|
1053
1120
|
for (const [file, previous] of _nullishCoalesce(changed, () => ( []))) {
|
|
1054
|
-
if (
|
|
1121
|
+
if (_chunkEFI6QWBQcjs.isFarmClientModulePlanUnchanged.call(void 0, file, previous)) continue;
|
|
1055
1122
|
const source = this.planSourcePath(file);
|
|
1056
1123
|
if (source) edited.add(source);
|
|
1057
1124
|
}
|
|
@@ -1066,13 +1133,13 @@ var RouteManager = class _RouteManager {
|
|
|
1066
1133
|
metadata: this.planRouteModule(
|
|
1067
1134
|
`layout:${entry.modulePath}`,
|
|
1068
1135
|
edited,
|
|
1069
|
-
() =>
|
|
1136
|
+
() => _chunkEFI6QWBQcjs.getClientModuleHydrationPlan.call(void 0,
|
|
1070
1137
|
entry.modulePath,
|
|
1071
1138
|
normalizedProjectRoot,
|
|
1072
1139
|
isolatedMode,
|
|
1073
1140
|
layoutPlanOptions
|
|
1074
1141
|
),
|
|
1075
|
-
|
|
1142
|
+
_chunkEFI6QWBQcjs.getClientModuleHydrationPlanKey.call(void 0,
|
|
1076
1143
|
entry.modulePath,
|
|
1077
1144
|
normalizedProjectRoot,
|
|
1078
1145
|
isolatedMode,
|
|
@@ -1080,7 +1147,7 @@ var RouteManager = class _RouteManager {
|
|
|
1080
1147
|
)
|
|
1081
1148
|
)
|
|
1082
1149
|
}));
|
|
1083
|
-
const markdownComponentsPlan =
|
|
1150
|
+
const markdownComponentsPlan = _chunkEFI6QWBQcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
1084
1151
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, this.config.mdx), normalizedProjectRoot),
|
|
1085
1152
|
normalizedProjectRoot,
|
|
1086
1153
|
isolatedMode,
|
|
@@ -1096,13 +1163,13 @@ var RouteManager = class _RouteManager {
|
|
|
1096
1163
|
metadata: _chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : this.planRouteModule(
|
|
1097
1164
|
`page:${entry.modulePath}`,
|
|
1098
1165
|
edited,
|
|
1099
|
-
() =>
|
|
1166
|
+
() => _chunkEFI6QWBQcjs.getClientModuleHydrationPlan.call(void 0,
|
|
1100
1167
|
entry.modulePath,
|
|
1101
1168
|
normalizedProjectRoot,
|
|
1102
1169
|
isolatedMode,
|
|
1103
1170
|
pagePlanOptions
|
|
1104
1171
|
),
|
|
1105
|
-
|
|
1172
|
+
_chunkEFI6QWBQcjs.getClientModuleHydrationPlanKey.call(void 0,
|
|
1106
1173
|
entry.modulePath,
|
|
1107
1174
|
normalizedProjectRoot,
|
|
1108
1175
|
isolatedMode,
|
|
@@ -1132,7 +1199,7 @@ var RouteManager = class _RouteManager {
|
|
|
1132
1199
|
`[Farm.js] ${entry.pattern} renders client components from ${metadata.staticPackageBoundaries.join(", ")} as static HTML: package client components cannot be isolated yet.`
|
|
1133
1200
|
);
|
|
1134
1201
|
}
|
|
1135
|
-
|
|
1202
|
+
_chunkEFI6QWBQcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
1136
1203
|
layoutEntries.map(({ entry, metadata }) => ({
|
|
1137
1204
|
pattern: entry.pattern,
|
|
1138
1205
|
depth: _chunkNEKO3HM2cjs.getRouteDirectoryDepth.call(void 0, entry.pattern),
|
|
@@ -1179,7 +1246,7 @@ var RouteManager = class _RouteManager {
|
|
|
1179
1246
|
modulePath: toUrlPath(boundary.modulePath)
|
|
1180
1247
|
}))
|
|
1181
1248
|
} : {},
|
|
1182
|
-
...
|
|
1249
|
+
..._chunkEFI6QWBQcjs.usesFarmServerTree.call(void 0, metadata) ? { serverTree: true } : {},
|
|
1183
1250
|
renderPlan: _chunkNEKO3HM2cjs.createFarmRouteRenderPlan.call(void 0, {
|
|
1184
1251
|
pageShouldHydrate: metadata.shouldHydrate,
|
|
1185
1252
|
layoutShouldHydrate,
|
|
@@ -1221,7 +1288,7 @@ var RouteManager = class _RouteManager {
|
|
|
1221
1288
|
...metadata.suppressedAsyncHydration && metadata.fallbackReason ? { suppressedAsyncHydrationReason: metadata.fallbackReason } : {}
|
|
1222
1289
|
}));
|
|
1223
1290
|
const slots = Array.from(this.routeSlots.values()).map((entry) => {
|
|
1224
|
-
const metadata =
|
|
1291
|
+
const metadata = _chunkEFI6QWBQcjs.getClientModuleMetadata.call(void 0, entry.modulePath, normalizedProjectRoot);
|
|
1225
1292
|
return {
|
|
1226
1293
|
name: entry.name,
|
|
1227
1294
|
ownerPattern: entry.ownerPattern,
|
|
@@ -1237,7 +1304,7 @@ var RouteManager = class _RouteManager {
|
|
|
1237
1304
|
};
|
|
1238
1305
|
});
|
|
1239
1306
|
const slotPlans = islandsMode ? Array.from(this.routeSlots.values()).map((entry) => ({
|
|
1240
|
-
metadata:
|
|
1307
|
+
metadata: _chunkEFI6QWBQcjs.getClientModuleHydrationPlan.call(void 0,
|
|
1241
1308
|
entry.modulePath,
|
|
1242
1309
|
normalizedProjectRoot,
|
|
1243
1310
|
isolatedMode,
|
|
@@ -1339,7 +1406,7 @@ var RouteManager = class _RouteManager {
|
|
|
1339
1406
|
loadModule: viteServer ? (componentModulePath) => _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, viteServer, componentModulePath) : void 0
|
|
1340
1407
|
}),
|
|
1341
1408
|
config: mdxConfig,
|
|
1342
|
-
renderer:
|
|
1409
|
+
renderer: _chunkNGTZHWBGcjs.isReactRenderer.call(void 0, this.config.renderer) ? void 0 : this.rendererRuntime
|
|
1343
1410
|
});
|
|
1344
1411
|
}
|
|
1345
1412
|
if (this.viteServer) {
|
|
@@ -1406,15 +1473,42 @@ var RouteManager = class _RouteManager {
|
|
|
1406
1473
|
}
|
|
1407
1474
|
async discoverFileRoutes(source) {
|
|
1408
1475
|
const appDir = _chunk7U4XF76Rcjs.resolveAppPath.call(void 0, source.root, source.srcDir, "app");
|
|
1409
|
-
const componentExtensions =
|
|
1476
|
+
const componentExtensions = _chunkNGTZHWBGcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer).map(
|
|
1410
1477
|
(extension) => extension.slice(1)
|
|
1411
1478
|
);
|
|
1412
1479
|
const componentGlob = componentExtensions.join(",");
|
|
1413
|
-
const
|
|
1480
|
+
const rendererRoutes = await _chunk5X5GJU5Acjs.resolveFarmRendererRoutes.call(void 0, {
|
|
1481
|
+
renderer: this.config.renderer,
|
|
1482
|
+
root: source.root,
|
|
1483
|
+
srcDir: source.srcDir
|
|
1484
|
+
});
|
|
1485
|
+
const routeModulePaths = /* @__PURE__ */ new Map();
|
|
1486
|
+
const modulePathOf = (file) => _nullishCoalesce(routeModulePaths.get(file), () => ( path4.default.join(appDir, file)));
|
|
1487
|
+
const rendererFiles = (kind) => (_nullishCoalesce(_optionalChain([rendererRoutes, 'optionalAccess', _48 => _48.entries]), () => ( []))).filter((entry) => entry.kind === kind).map((entry) => {
|
|
1488
|
+
routeModulePaths.set(entry.routeFile, entry.modulePath);
|
|
1489
|
+
if (entry.hydration.hydrate !== void 0 || entry.hydration.strategy !== void 0) {
|
|
1490
|
+
this.rendererRouteHydration.set(entry.modulePath, entry.hydration);
|
|
1491
|
+
}
|
|
1492
|
+
return entry.routeFile;
|
|
1493
|
+
});
|
|
1494
|
+
if (rendererRoutes) {
|
|
1495
|
+
this.rendererRouteDirs.push(rendererRoutes.dir.replace(/\\/g, "/"));
|
|
1496
|
+
for (const entry of rendererRoutes.entries) {
|
|
1497
|
+
this.rendererRouteModules.add(entry.modulePath.replace(/\\/g, "/"));
|
|
1498
|
+
}
|
|
1499
|
+
const notFound = rendererRoutes.entries.find((entry) => entry.kind === "not-found");
|
|
1500
|
+
if (notFound || this.rendererNotFoundPath === void 0) {
|
|
1501
|
+
this.rendererNotFoundPath = _nullishCoalesce(_optionalChain([notFound, 'optionalAccess', _49 => _49.modulePath]), () => ( null));
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
const pageFiles = rendererRoutes ? [
|
|
1505
|
+
...rendererFiles("page"),
|
|
1506
|
+
...await safeGlobFiles(`**/@*/**/page.{${componentGlob},md,mdx}`, appDir)
|
|
1507
|
+
] : await safeGlobFiles(`**/page.{${componentGlob},md,mdx}`, appDir);
|
|
1414
1508
|
const slotDefaultFiles = await safeGlobFiles(`**/@*/**/default.{${componentGlob}}`, appDir);
|
|
1415
|
-
const layoutFiles = await safeGlobFiles(`**/layout.{${componentGlob}}`, appDir);
|
|
1416
|
-
const loadingFiles = await safeGlobFiles(`**/loading.{${componentGlob}}`, appDir);
|
|
1417
|
-
const errorFiles = await safeGlobFiles(`**/error.{${componentGlob}}`, appDir);
|
|
1509
|
+
const layoutFiles = rendererRoutes ? rendererFiles("layout") : await safeGlobFiles(`**/layout.{${componentGlob}}`, appDir);
|
|
1510
|
+
const loadingFiles = rendererRoutes ? rendererFiles("loading") : await safeGlobFiles(`**/loading.{${componentGlob}}`, appDir);
|
|
1511
|
+
const errorFiles = rendererRoutes ? rendererFiles("error") : await safeGlobFiles(`**/error.{${componentGlob}}`, appDir);
|
|
1418
1512
|
const metadataImageFiles = await safeGlobFiles(
|
|
1419
1513
|
`**/{opengraph-image,twitter-image}.{${componentGlob},png,jpg,jpeg,gif,webp}`,
|
|
1420
1514
|
appDir
|
|
@@ -1442,21 +1536,21 @@ var RouteManager = class _RouteManager {
|
|
|
1442
1536
|
const markdownFiles = group.files.filter(_chunk26WP75W5cjs.isFarmMarkdownPageFile);
|
|
1443
1537
|
if (componentFiles.length > 1) {
|
|
1444
1538
|
throw new Error(
|
|
1445
|
-
`Duplicate page route "${pattern}". Found ${componentFiles.map(
|
|
1539
|
+
`Duplicate page route "${pattern}". Found ${componentFiles.map(modulePathOf).join(" and ")}.`
|
|
1446
1540
|
);
|
|
1447
1541
|
}
|
|
1448
1542
|
if (markdownFiles.length > 1) {
|
|
1449
1543
|
throw new Error(
|
|
1450
|
-
`Duplicate markdown representation for page route "${pattern}". Found ${markdownFiles.map(
|
|
1544
|
+
`Duplicate markdown representation for page route "${pattern}". Found ${markdownFiles.map(modulePathOf).join(" and ")}.`
|
|
1451
1545
|
);
|
|
1452
1546
|
}
|
|
1453
1547
|
const componentFile = componentFiles[0];
|
|
1454
1548
|
const markdownFile = markdownFiles[0];
|
|
1455
1549
|
const primaryFile = componentFile || markdownFile;
|
|
1456
1550
|
if (!primaryFile) continue;
|
|
1457
|
-
const modulePath =
|
|
1551
|
+
const modulePath = modulePathOf(primaryFile);
|
|
1458
1552
|
const existing = this.routes.get(pattern);
|
|
1459
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
1553
|
+
if (_optionalChain([existing, 'optionalAccess', _50 => _50.sourceRoot]) === source.root) {
|
|
1460
1554
|
throw new Error(
|
|
1461
1555
|
`Duplicate page route "${pattern}". Found both ${existing.modulePath} and ${modulePath}.`
|
|
1462
1556
|
);
|
|
@@ -1465,7 +1559,7 @@ var RouteManager = class _RouteManager {
|
|
|
1465
1559
|
route: group.route,
|
|
1466
1560
|
modulePath,
|
|
1467
1561
|
...markdownFile ? {
|
|
1468
|
-
markdownSourcePath:
|
|
1562
|
+
markdownSourcePath: modulePathOf(markdownFile)
|
|
1469
1563
|
} : {},
|
|
1470
1564
|
pattern,
|
|
1471
1565
|
...getPageDirectoryField(group.route, pattern),
|
|
@@ -1480,10 +1574,10 @@ var RouteManager = class _RouteManager {
|
|
|
1480
1574
|
]) {
|
|
1481
1575
|
for (const file of files) {
|
|
1482
1576
|
const route = _chunk7U4XF76Rcjs.parseRoutePath.call(void 0, file);
|
|
1483
|
-
const modulePath =
|
|
1577
|
+
const modulePath = modulePathOf(file);
|
|
1484
1578
|
const pattern = _chunkNEKO3HM2cjs.createRouteDirectoryPattern.call(void 0, route);
|
|
1485
1579
|
const existing = target.get(pattern);
|
|
1486
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
1580
|
+
if (_optionalChain([existing, 'optionalAccess', _51 => _51.sourceRoot]) === source.root) {
|
|
1487
1581
|
throw new Error(
|
|
1488
1582
|
`Duplicate ${kind} route "${pattern}". Found both ${existing.modulePath} and ${modulePath}.`
|
|
1489
1583
|
);
|
|
@@ -1506,7 +1600,7 @@ var RouteManager = class _RouteManager {
|
|
|
1506
1600
|
const ownerDirectory = _chunkNEKO3HM2cjs.createRouteDirectoryPattern.call(void 0, slot.ownerRoute);
|
|
1507
1601
|
const key = `${ownerPattern}:${slot.name}:${slot.interception ? "intercept" : "slot"}:${slot.fallback ? "default" : pattern}`;
|
|
1508
1602
|
const existing = this.routeSlots.get(key);
|
|
1509
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
1603
|
+
if (_optionalChain([existing, 'optionalAccess', _52 => _52.sourceRoot]) === source.root) {
|
|
1510
1604
|
throw new Error(
|
|
1511
1605
|
`Duplicate route slot "${slot.name}" for "${pattern}". Found both ${existing.modulePath} and ${modulePath}.`
|
|
1512
1606
|
);
|
|
@@ -1535,7 +1629,7 @@ var RouteManager = class _RouteManager {
|
|
|
1535
1629
|
const key = `${kind}:${pattern}`;
|
|
1536
1630
|
const existing = this.metadataImages.get(key);
|
|
1537
1631
|
const sourceType = isStaticMetadataImageFile(file) ? "static" : "module";
|
|
1538
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
1632
|
+
if (_optionalChain([existing, 'optionalAccess', _53 => _53.sourceRoot]) === source.root) {
|
|
1539
1633
|
throw new Error(
|
|
1540
1634
|
`Duplicate ${fileName} route "${pattern}". Found both ${existing.modulePath} and ${modulePath}. Keep only one static image or module per route segment.`
|
|
1541
1635
|
);
|
|
@@ -1563,7 +1657,7 @@ var RouteManager = class _RouteManager {
|
|
|
1563
1657
|
const pattern = this.createRoutePattern(route);
|
|
1564
1658
|
const key = `${descriptor.kind}:${pattern}`;
|
|
1565
1659
|
const existing = this.metadataRoutes.get(key);
|
|
1566
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
1660
|
+
if (_optionalChain([existing, 'optionalAccess', _54 => _54.sourceRoot]) === source.root) {
|
|
1567
1661
|
throw new Error(
|
|
1568
1662
|
`Duplicate ${descriptor.fileName} route "${pattern}". Found both ${existing.modulePath} and ${modulePath}. Keep only one .ts or .js metadata route per segment.`
|
|
1569
1663
|
);
|
|
@@ -1585,11 +1679,11 @@ var RouteManager = class _RouteManager {
|
|
|
1585
1679
|
srcDir: source.srcDir,
|
|
1586
1680
|
loadModule: (filePath) => this.loadProgrammaticRoutesModule(filePath)
|
|
1587
1681
|
});
|
|
1588
|
-
const graph = this.viteServer ?
|
|
1682
|
+
const graph = this.viteServer ? _chunkEFI6QWBQcjs.createEvaluatedRouteGraph.call(void 0, this.viteServer) : void 0;
|
|
1589
1683
|
for (const { filePath, manifest } of manifests) {
|
|
1590
1684
|
if (graph) {
|
|
1591
1685
|
clientRoutes.push(
|
|
1592
|
-
|
|
1686
|
+
_chunkEFI6QWBQcjs.resolveProgrammaticClientRoutes.call(void 0, {
|
|
1593
1687
|
graph,
|
|
1594
1688
|
routesFile: toRealPath(filePath),
|
|
1595
1689
|
routes: manifest.routes,
|
|
@@ -1602,7 +1696,7 @@ var RouteManager = class _RouteManager {
|
|
|
1602
1696
|
const route = _chunkYUCU6XB4cjs.parseProgrammaticRoutePath.call(void 0, definition.path, "page");
|
|
1603
1697
|
const pattern = this.createRoutePattern(route);
|
|
1604
1698
|
const existing = this.routes.get(pattern);
|
|
1605
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
1699
|
+
if (_optionalChain([existing, 'optionalAccess', _55 => _55.sourceRoot]) === source.root) {
|
|
1606
1700
|
throw new Error(
|
|
1607
1701
|
`Duplicate page route "${pattern}". Found both ${existing.modulePath} and programmatic route in ${filePath}.`
|
|
1608
1702
|
);
|
|
@@ -1622,7 +1716,7 @@ var RouteManager = class _RouteManager {
|
|
|
1622
1716
|
const route = _chunkYUCU6XB4cjs.parseProgrammaticRoutePath.call(void 0, definition.path, "layout");
|
|
1623
1717
|
const pattern = _chunkNEKO3HM2cjs.createRouteDirectoryPattern.call(void 0, route);
|
|
1624
1718
|
const existing = this.layouts.get(pattern);
|
|
1625
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
1719
|
+
if (_optionalChain([existing, 'optionalAccess', _56 => _56.sourceRoot]) === source.root) {
|
|
1626
1720
|
throw new Error(
|
|
1627
1721
|
`Duplicate layout route "${pattern}". Found both ${existing.modulePath} and programmatic route in ${filePath}.`
|
|
1628
1722
|
);
|
|
@@ -1651,7 +1745,7 @@ var RouteManager = class _RouteManager {
|
|
|
1651
1745
|
}
|
|
1652
1746
|
async loadProgrammaticRoutesModule(filePath) {
|
|
1653
1747
|
if (this.viteServer) {
|
|
1654
|
-
const viteRoot = _optionalChain([this, 'access',
|
|
1748
|
+
const viteRoot = _optionalChain([this, 'access', _57 => _57.viteServer, 'access', _58 => _58.config, 'optionalAccess', _59 => _59.root]) || this.config.root || process.cwd();
|
|
1655
1749
|
return await _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, this.viteServer, _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, filePath, viteRoot));
|
|
1656
1750
|
}
|
|
1657
1751
|
return await import(
|
|
@@ -1754,7 +1848,7 @@ var RouteManager = class _RouteManager {
|
|
|
1754
1848
|
if (!_chunkNEKO3HM2cjs.isInRouteGroupScope.call(void 0, page && getRouteEntryDirectory(page), groupScope)) continue;
|
|
1755
1849
|
}
|
|
1756
1850
|
const depth = boundaryEntry.route.segments.length;
|
|
1757
|
-
const bestDepth = _nullishCoalesce(_optionalChain([bestMatch, 'optionalAccess',
|
|
1851
|
+
const bestDepth = _nullishCoalesce(_optionalChain([bestMatch, 'optionalAccess', _60 => _60.route, 'access', _61 => _61.segments, 'access', _62 => _62.length]), () => ( -1));
|
|
1758
1852
|
if (!bestMatch || depth > bestDepth || depth === bestDepth && _chunkNEKO3HM2cjs.getRouteDirectoryDepth.call(void 0, boundaryEntry.pattern) > _chunkNEKO3HM2cjs.getRouteDirectoryDepth.call(void 0, bestMatch.pattern)) {
|
|
1759
1853
|
bestMatch = boundaryEntry;
|
|
1760
1854
|
}
|
|
@@ -1782,8 +1876,6 @@ var RouteManager = class _RouteManager {
|
|
|
1782
1876
|
getDocsAdapterRoutes() {
|
|
1783
1877
|
const docs = this.config.docs;
|
|
1784
1878
|
if (!docs || typeof docs !== "object" || !docs.enabled) return void 0;
|
|
1785
|
-
const usesAdapter = Boolean(docs.adapter && docs.adapter.server && docs.adapter.react);
|
|
1786
|
-
if (usesAdapter && !_chunkBCTHOQPPcjs.isReactRenderer.call(void 0, this.config.renderer)) return void 0;
|
|
1787
1879
|
const entry = `/${String(docs.entry || "docs").replace(/^\/+|\/+$/g, "")}`;
|
|
1788
1880
|
return {
|
|
1789
1881
|
owns: (routePath) => entry === "/" || routePath === entry || routePath.startsWith(`${entry}/`),
|
|
@@ -1805,7 +1897,7 @@ var RouteManager = class _RouteManager {
|
|
|
1805
1897
|
}));
|
|
1806
1898
|
const i18n = this.getI18nConfig();
|
|
1807
1899
|
const docsAdapterRoutes = this.getDocsAdapterRoutes();
|
|
1808
|
-
const result = await
|
|
1900
|
+
const result = await _chunkHRH7OKBQcjs.collectSSGPages.call(void 0, routes, (filePath) => this.loadRouteModule(filePath), {
|
|
1809
1901
|
suggestStaticRendering: shouldSuggestStaticRenderingForI18n(i18n),
|
|
1810
1902
|
...docsAdapterRoutes ? { docsAdapterRoutes } : {}
|
|
1811
1903
|
});
|
|
@@ -1852,7 +1944,7 @@ var RouteManager = class _RouteManager {
|
|
|
1852
1944
|
async isRouteSSG(modulePath) {
|
|
1853
1945
|
try {
|
|
1854
1946
|
const mod = await this.loadRouteModule(modulePath);
|
|
1855
|
-
const rendering = await
|
|
1947
|
+
const rendering = await _chunkHRH7OKBQcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1856
1948
|
return rendering.ssg;
|
|
1857
1949
|
} catch (e2) {
|
|
1858
1950
|
return false;
|
|
@@ -1864,7 +1956,7 @@ var RouteManager = class _RouteManager {
|
|
|
1864
1956
|
async hasRouteISR(modulePath) {
|
|
1865
1957
|
try {
|
|
1866
1958
|
const mod = await this.loadRouteModule(modulePath);
|
|
1867
|
-
const rendering = await
|
|
1959
|
+
const rendering = await _chunkHRH7OKBQcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1868
1960
|
return rendering.ssg && typeof rendering.revalidate === "number" && rendering.revalidate > 0;
|
|
1869
1961
|
} catch (e3) {
|
|
1870
1962
|
return false;
|
|
@@ -1876,7 +1968,7 @@ var RouteManager = class _RouteManager {
|
|
|
1876
1968
|
async getRouteRevalidateInterval(modulePath) {
|
|
1877
1969
|
try {
|
|
1878
1970
|
const mod = await this.loadRouteModule(modulePath);
|
|
1879
|
-
const rendering = await
|
|
1971
|
+
const rendering = await _chunkHRH7OKBQcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
|
|
1880
1972
|
return rendering.revalidate;
|
|
1881
1973
|
} catch (e4) {
|
|
1882
1974
|
return void 0;
|
|
@@ -2090,7 +2182,7 @@ function farmFontImportsPlugin(options = {}) {
|
|
|
2090
2182
|
return;
|
|
2091
2183
|
}
|
|
2092
2184
|
const resource = registry.getDevResource(pathname);
|
|
2093
|
-
if (!_optionalChain([resource, 'optionalAccess',
|
|
2185
|
+
if (!_optionalChain([resource, 'optionalAccess', _63 => _63.bytes])) {
|
|
2094
2186
|
next();
|
|
2095
2187
|
return;
|
|
2096
2188
|
}
|
|
@@ -2608,7 +2700,7 @@ function readFontOptions(code, id, call) {
|
|
|
2608
2700
|
const declaration = call.ancestors.at(-2);
|
|
2609
2701
|
const statement = call.ancestors.at(-3);
|
|
2610
2702
|
const statementParent = call.ancestors.at(-4);
|
|
2611
|
-
const isModuleScope = _optionalChain([declaration, 'optionalAccess',
|
|
2703
|
+
const isModuleScope = _optionalChain([declaration, 'optionalAccess', _64 => _64.type]) === "VariableDeclaration" && (_optionalChain([statement, 'optionalAccess', _65 => _65.type]) === "Program" || _optionalChain([statement, 'optionalAccess', _66 => _66.type]) === "ExportNamedDeclaration" && _optionalChain([statementParent, 'optionalAccess', _67 => _67.type]) === "Program");
|
|
2612
2704
|
if (!isModuleScope || call.ancestors.some((ancestor) => isFunctionNode(ancestor))) {
|
|
2613
2705
|
throw fontError(id, `${call.kind}() must be declared directly at module scope`);
|
|
2614
2706
|
}
|
|
@@ -3174,17 +3266,17 @@ function resolveProviderModule(moduleId, root) {
|
|
|
3174
3266
|
|
|
3175
3267
|
// src/server-actions-mode.ts
|
|
3176
3268
|
function resolveFarmIslxActionsMode(config) {
|
|
3177
|
-
if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
3269
|
+
if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _68 => _68.experimental, 'optionalAccess', _69 => _69.serverComponents])) === "islands") {
|
|
3178
3270
|
return "islands";
|
|
3179
3271
|
}
|
|
3180
|
-
if (_optionalChain([config, 'access',
|
|
3272
|
+
if (_optionalChain([config, 'access', _70 => _70.experimental, 'optionalAccess', _71 => _71.serverActions]) !== true) return null;
|
|
3181
3273
|
const renderer = config.renderer;
|
|
3182
3274
|
if (renderer === void 0 || renderer === false) return null;
|
|
3183
|
-
if (
|
|
3275
|
+
if (_chunkNGTZHWBGcjs.isFarmRendererDisabled.call(void 0, renderer) || _chunkNGTZHWBGcjs.isReactRenderer.call(void 0, renderer)) return null;
|
|
3184
3276
|
return "renderer";
|
|
3185
3277
|
}
|
|
3186
3278
|
function farmBrowserServerFnsEnabled(config) {
|
|
3187
|
-
return _optionalChain([config, 'access',
|
|
3279
|
+
return _optionalChain([config, 'access', _72 => _72.experimental, 'optionalAccess', _73 => _73.serverActions]) === true && resolveFarmIslxActionsMode(config) !== null;
|
|
3188
3280
|
}
|
|
3189
3281
|
|
|
3190
3282
|
// src/island-inference.ts
|
|
@@ -3227,7 +3319,7 @@ function inferFarmIslandStrategy(filePath, root) {
|
|
|
3227
3319
|
const result = _compiler.inferStrategy.call(void 0, file, code, {
|
|
3228
3320
|
parse: parseFarmIslandSource,
|
|
3229
3321
|
resolve: (specifier, importer) => {
|
|
3230
|
-
const resolved =
|
|
3322
|
+
const resolved = _chunkEFI6QWBQcjs.resolveImportedModule.call(void 0, importer, specifier, root);
|
|
3231
3323
|
return resolved.local ? resolved.path : null;
|
|
3232
3324
|
}
|
|
3233
3325
|
});
|
|
@@ -3247,7 +3339,7 @@ function inferFarmRouteRootStrategy(owners, root) {
|
|
|
3247
3339
|
if (cached && cached.stamps.every(([read2, stamp]) => modifiedAt(read2) === stamp)) {
|
|
3248
3340
|
return cached.result;
|
|
3249
3341
|
}
|
|
3250
|
-
const { result, files } =
|
|
3342
|
+
const { result, files } = _chunkEFI6QWBQcjs.traceFarmSourceReads.call(void 0, () => inferRouteRoot(owners, root));
|
|
3251
3343
|
const read = new Set([...files, ...result.files].filter((file) => !isInstalledPackageFile(file)));
|
|
3252
3344
|
routeRootInferences.set(key, {
|
|
3253
3345
|
stamps: [...read].map((file) => [file, modifiedAt(file)]),
|
|
@@ -3264,7 +3356,7 @@ function inferRouteRoot(owners, root) {
|
|
|
3264
3356
|
const files = [];
|
|
3265
3357
|
const modules = [];
|
|
3266
3358
|
for (const owner of owners) {
|
|
3267
|
-
const rendered =
|
|
3359
|
+
const rendered = _chunkEFI6QWBQcjs.collectFarmRenderedClientModules.call(void 0, owner, root);
|
|
3268
3360
|
if (!rendered) {
|
|
3269
3361
|
return {
|
|
3270
3362
|
strategy: null,
|
|
@@ -3280,7 +3372,7 @@ function inferRouteRoot(owners, root) {
|
|
|
3280
3372
|
source = fs2.default.readFileSync(module, "utf8");
|
|
3281
3373
|
} catch (e11) {
|
|
3282
3374
|
}
|
|
3283
|
-
if (
|
|
3375
|
+
if (_chunkEFI6QWBQcjs.getIslandStrategyExport.call(void 0, source) !== null) return { strategy: null, files, declared: true };
|
|
3284
3376
|
}
|
|
3285
3377
|
for (const module of modules) {
|
|
3286
3378
|
const result = inferFarmIslandStrategy(module, root);
|
|
@@ -3323,9 +3415,9 @@ var _stream = require('stream');
|
|
|
3323
3415
|
// src/not-found.ts
|
|
3324
3416
|
|
|
3325
3417
|
|
|
3326
|
-
function resolveFarmNotFoundComponentPath(config, appDirs) {
|
|
3327
|
-
const extensions =
|
|
3328
|
-
const configuredPath = _optionalChain([config, 'access',
|
|
3418
|
+
function resolveFarmNotFoundComponentPath(config, appDirs, discovered) {
|
|
3419
|
+
const extensions = _chunkNGTZHWBGcjs.getFarmRendererComponentExtensions.call(void 0, config.renderer);
|
|
3420
|
+
const configuredPath = _optionalChain([config, 'access', _74 => _74.notFound, 'optionalAccess', _75 => _75.component, 'optionalAccess', _76 => _76.trim, 'call', _77 => _77()]);
|
|
3329
3421
|
if (configuredPath) {
|
|
3330
3422
|
const componentPath = path4.default.isAbsolute(configuredPath) ? path4.default.normalize(configuredPath) : path4.default.resolve(config.root, configuredPath);
|
|
3331
3423
|
if (!extensions.some((extension) => componentPath.endsWith(extension))) {
|
|
@@ -3338,6 +3430,7 @@ function resolveFarmNotFoundComponentPath(config, appDirs) {
|
|
|
3338
3430
|
}
|
|
3339
3431
|
return componentPath;
|
|
3340
3432
|
}
|
|
3433
|
+
if (discovered !== void 0) return discovered;
|
|
3341
3434
|
let discoveredPath = null;
|
|
3342
3435
|
for (const appDir of appDirs) {
|
|
3343
3436
|
for (const extension of extensions) {
|
|
@@ -3622,7 +3715,7 @@ function createDefaultErrorDiagnostics(error, root) {
|
|
|
3622
3715
|
function canBootFarmIslandsClient(config) {
|
|
3623
3716
|
const docs = config.docs;
|
|
3624
3717
|
const docsEnabled = docs === true || typeof docs === "object" && docs !== null && docs.enabled !== false;
|
|
3625
|
-
return _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
3718
|
+
return _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _78 => _78.experimental, 'optionalAccess', _79 => _79.serverComponents])) === "islands" && !docsEnabled && _chunkDMSXZNQRcjs.resolveFarmClientPlugins.call(void 0, config.plugins, config.root).length === 0 && !_chunkDMSXZNQRcjs.resolveFarmAppClientEntry.call(void 0, config.root, config.srcDir || "src");
|
|
3626
3719
|
}
|
|
3627
3720
|
|
|
3628
3721
|
// src/islands-kept-layouts.ts
|
|
@@ -3670,7 +3763,7 @@ var DECLARATION_STATEMENTS = /* @__PURE__ */ new Set([
|
|
|
3670
3763
|
function parse(code, file) {
|
|
3671
3764
|
const extension = path4.default.extname(file).slice(1);
|
|
3672
3765
|
const lang = extension === "ts" || extension === "mts" || extension === "cts" ? "ts" : extension === "js" || extension === "mjs" || extension === "cjs" || extension === "jsx" ? "jsx" : "tsx";
|
|
3673
|
-
return
|
|
3766
|
+
return _chunkEFI6QWBQcjs.memoizeInFarmSourceSnapshot.call(void 0, `ast:${lang}`, code, () => {
|
|
3674
3767
|
try {
|
|
3675
3768
|
return _parseAst.parseAst.call(void 0, code, { lang });
|
|
3676
3769
|
} catch (e14) {
|
|
@@ -3760,11 +3853,11 @@ function findFarmRequestDecidingConstruct(code, file) {
|
|
|
3760
3853
|
reason = "import.meta";
|
|
3761
3854
|
return;
|
|
3762
3855
|
case "CallExpression":
|
|
3763
|
-
if (_optionalChain([current, 'access',
|
|
3856
|
+
if (_optionalChain([current, 'access', _80 => _80.callee, 'optionalAccess', _81 => _81.type]) === "Identifier" && current.callee.name === "use") {
|
|
3764
3857
|
reason = "a use() call";
|
|
3765
3858
|
return;
|
|
3766
3859
|
}
|
|
3767
|
-
if (_optionalChain([current, 'access',
|
|
3860
|
+
if (_optionalChain([current, 'access', _82 => _82.callee, 'optionalAccess', _83 => _83.type]) === "MemberExpression" && !current.callee.computed && _optionalChain([current, 'access', _84 => _84.callee, 'access', _85 => _85.object, 'optionalAccess', _86 => _86.type]) === "Identifier" && current.callee.object.name === "Math" && _optionalChain([current, 'access', _87 => _87.callee, 'access', _88 => _88.property, 'optionalAccess', _89 => _89.name]) === "random") {
|
|
3768
3861
|
reason = "Math.random()";
|
|
3769
3862
|
return;
|
|
3770
3863
|
}
|
|
@@ -3805,14 +3898,14 @@ function isReference(node, parent, key) {
|
|
|
3805
3898
|
}
|
|
3806
3899
|
function readSource(file) {
|
|
3807
3900
|
try {
|
|
3808
|
-
|
|
3901
|
+
_chunkEFI6QWBQcjs.noteFarmSourceRead.call(void 0, file);
|
|
3809
3902
|
return fs2.default.readFileSync(file, "utf8");
|
|
3810
3903
|
} catch (e15) {
|
|
3811
3904
|
return null;
|
|
3812
3905
|
}
|
|
3813
3906
|
}
|
|
3814
3907
|
function explainFarmKeptLayoutRender(modulePath, root) {
|
|
3815
|
-
const entry =
|
|
3908
|
+
const entry = _chunkEFI6QWBQcjs.resolveModuleSourcePath.call(void 0, modulePath, root);
|
|
3816
3909
|
if (!entry) return `${modulePath} does not resolve`;
|
|
3817
3910
|
const visited = /* @__PURE__ */ new Set();
|
|
3818
3911
|
const check = (file) => {
|
|
@@ -3822,7 +3915,7 @@ function explainFarmKeptLayoutRender(modulePath, root) {
|
|
|
3822
3915
|
if (!SCRIPT_SOURCE.test(file)) return `${path4.default.relative(root, file)} is not a script`;
|
|
3823
3916
|
const code = readSource(file);
|
|
3824
3917
|
if (code === null) return `${path4.default.relative(root, file)} cannot be read`;
|
|
3825
|
-
const { reason, imports } =
|
|
3918
|
+
const { reason, imports } = _chunkEFI6QWBQcjs.memoizeInFarmSourceSnapshot.call(void 0,
|
|
3826
3919
|
"kept-layout-module",
|
|
3827
3920
|
code,
|
|
3828
3921
|
() => findFarmRequestDecidingConstruct(code, file)
|
|
@@ -3835,7 +3928,7 @@ function explainFarmKeptLayoutRender(modulePath, root) {
|
|
|
3835
3928
|
return `${path4.default.relative(root, file)} imports ${imported.names.join(", ")} from ${imported.source}`;
|
|
3836
3929
|
}
|
|
3837
3930
|
if (ASSET_SOURCE.test(imported.source.split("?")[0])) continue;
|
|
3838
|
-
const resolved =
|
|
3931
|
+
const resolved = _chunkEFI6QWBQcjs.resolveImportedModule.call(void 0, file, imported.source, root);
|
|
3839
3932
|
if (!resolved.path || !resolved.local) {
|
|
3840
3933
|
return `${path4.default.relative(root, file)} imports ${imported.source}`;
|
|
3841
3934
|
}
|
|
@@ -3850,15 +3943,15 @@ var answers = /* @__PURE__ */ new Map();
|
|
|
3850
3943
|
function canFarmSkipKeptLayoutRender(modulePath, root) {
|
|
3851
3944
|
const key = `${root}\0${modulePath}`;
|
|
3852
3945
|
const known = answers.get(key);
|
|
3853
|
-
if (known && known.stamps.every(([file, stamp]) =>
|
|
3946
|
+
if (known && known.stamps.every(([file, stamp]) => _chunkEFI6QWBQcjs.getFarmSourceStamp.call(void 0, file) === stamp)) {
|
|
3854
3947
|
return known.skip;
|
|
3855
3948
|
}
|
|
3856
|
-
const { result, files } =
|
|
3949
|
+
const { result, files } = _chunkEFI6QWBQcjs.traceFarmSourceReads.call(void 0,
|
|
3857
3950
|
() => explainFarmKeptLayoutRender(modulePath, root) === null
|
|
3858
3951
|
);
|
|
3859
3952
|
answers.set(key, {
|
|
3860
3953
|
skip: result,
|
|
3861
|
-
stamps: files.map((file) => [file,
|
|
3954
|
+
stamps: files.map((file) => [file, _chunkEFI6QWBQcjs.getFarmSourceStamp.call(void 0, file)])
|
|
3862
3955
|
});
|
|
3863
3956
|
return result;
|
|
3864
3957
|
}
|
|
@@ -3893,7 +3986,7 @@ function pipeFarmRendererWebStream(runtime) {
|
|
|
3893
3986
|
source.once("error", (error) => {
|
|
3894
3987
|
if (settleShell(error)) return;
|
|
3895
3988
|
callbacks.onError(error);
|
|
3896
|
-
_optionalChain([destination, 'optionalAccess',
|
|
3989
|
+
_optionalChain([destination, 'optionalAccess', _90 => _90.end, 'call', _91 => _91()]);
|
|
3897
3990
|
});
|
|
3898
3991
|
},
|
|
3899
3992
|
(error) => settleShell(error)
|
|
@@ -3901,12 +3994,12 @@ function pipeFarmRendererWebStream(runtime) {
|
|
|
3901
3994
|
return {
|
|
3902
3995
|
pipe(target) {
|
|
3903
3996
|
destination = target;
|
|
3904
|
-
_optionalChain([source, 'optionalAccess',
|
|
3997
|
+
_optionalChain([source, 'optionalAccess', _92 => _92.pipe, 'call', _93 => _93(target)]);
|
|
3905
3998
|
},
|
|
3906
3999
|
abort() {
|
|
3907
4000
|
aborted = true;
|
|
3908
|
-
_optionalChain([source, 'optionalAccess',
|
|
3909
|
-
_optionalChain([destination, 'optionalAccess',
|
|
4001
|
+
_optionalChain([source, 'optionalAccess', _94 => _94.destroy, 'call', _95 => _95()]);
|
|
4002
|
+
_optionalChain([destination, 'optionalAccess', _96 => _96.end, 'call', _97 => _97()]);
|
|
3910
4003
|
}
|
|
3911
4004
|
};
|
|
3912
4005
|
};
|
|
@@ -3986,7 +4079,7 @@ var warnedSuppressedAsyncHydrationModules = /* @__PURE__ */ new Set();
|
|
|
3986
4079
|
function warnSuppressedAsyncHydrationOnce(modulePath, reason) {
|
|
3987
4080
|
if (warnedSuppressedAsyncHydrationModules.has(modulePath)) return;
|
|
3988
4081
|
warnedSuppressedAsyncHydrationModules.add(modulePath);
|
|
3989
|
-
_chunk7U4XF76Rcjs.logger.warn(
|
|
4082
|
+
_chunk7U4XF76Rcjs.logger.warn(_chunkEFI6QWBQcjs.describeSuppressedAsyncHydration.call(void 0, modulePath, reason));
|
|
3990
4083
|
}
|
|
3991
4084
|
var fullDocumentRoutes = /* @__PURE__ */ new Set();
|
|
3992
4085
|
var documentLayouts = /* @__PURE__ */ new WeakMap();
|
|
@@ -4023,7 +4116,7 @@ function appendResponseHeader(res, name, value) {
|
|
|
4023
4116
|
}
|
|
4024
4117
|
}
|
|
4025
4118
|
function requestHeader(req, name) {
|
|
4026
|
-
const value = _optionalChain([req, 'access',
|
|
4119
|
+
const value = _optionalChain([req, 'access', _98 => _98.headers, 'optionalAccess', _99 => _99[name]]);
|
|
4027
4120
|
return Array.isArray(value) ? value[0] : value;
|
|
4028
4121
|
}
|
|
4029
4122
|
function appendResponseVary(res, value) {
|
|
@@ -4128,12 +4221,12 @@ async function parseRouteModuleProps(routeModule, input) {
|
|
|
4128
4221
|
}
|
|
4129
4222
|
const schemas = routeModule.__farmRouteSchemas;
|
|
4130
4223
|
const params = parseRouteModuleSchema(
|
|
4131
|
-
_optionalChain([schemas, 'optionalAccess',
|
|
4224
|
+
_optionalChain([schemas, 'optionalAccess', _100 => _100.params]),
|
|
4132
4225
|
input.props.params,
|
|
4133
4226
|
"params",
|
|
4134
4227
|
input.routePath
|
|
4135
4228
|
);
|
|
4136
|
-
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess',
|
|
4229
|
+
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _101 => _101.search]), input.search, "search", input.routePath);
|
|
4137
4230
|
return {
|
|
4138
4231
|
...input.props,
|
|
4139
4232
|
params,
|
|
@@ -4192,25 +4285,25 @@ var ServerRenderer = class {
|
|
|
4192
4285
|
} else {
|
|
4193
4286
|
_chunkWOAXQ5MZcjs.uninstallFarmIslandValues.call(void 0, );
|
|
4194
4287
|
}
|
|
4195
|
-
if (_optionalChain([this, 'access',
|
|
4288
|
+
if (_optionalChain([this, 'access', _102 => _102.config, 'access', _103 => _103.notFound, 'optionalAccess', _104 => _104.component, 'optionalAccess', _105 => _105.trim, 'call', _106 => _106()])) {
|
|
4196
4289
|
resolveFarmNotFoundComponentPath(this.config, _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, this.config));
|
|
4197
4290
|
}
|
|
4198
|
-
const loaded =
|
|
4199
|
-
|
|
4291
|
+
const loaded = _chunkNGTZHWBGcjs.isReactRenderer.call(void 0, this.config.renderer) ? this.reactRenderer = await import("./renderer/react/server.cjs") : _chunkNGTZHWBGcjs.isFarmRendererDisabled.call(void 0, this.config.renderer) ? await import("./renderer/none/server.cjs") : this.viteServer ? await _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, this.viteServer, this.config.renderer.server) : await import(_url.pathToFileURL.call(void 0,
|
|
4292
|
+
_chunkNGTZHWBGcjs.resolveFarmRendererModule.call(void 0,
|
|
4200
4293
|
this.config.root || process.cwd(),
|
|
4201
4294
|
this.config.renderer.server
|
|
4202
4295
|
)
|
|
4203
4296
|
).href);
|
|
4204
4297
|
const runtime = loaded;
|
|
4205
|
-
|
|
4206
|
-
|
|
4298
|
+
_chunkNGTZHWBGcjs.assertFarmRendererServerModule.call(void 0, runtime, this.config.renderer);
|
|
4299
|
+
_chunkNGTZHWBGcjs.assertFarmRendererStreamingRuntime.call(void 0,
|
|
4207
4300
|
this.config.renderer.name,
|
|
4208
4301
|
this.config.renderer,
|
|
4209
4302
|
runtime,
|
|
4210
4303
|
"node"
|
|
4211
4304
|
);
|
|
4212
4305
|
this.rendererRuntime = islands && this.islandValues() ? withFarmIslandsRenders(runtime, islands) : runtime;
|
|
4213
|
-
_optionalChain([this, 'access',
|
|
4306
|
+
_optionalChain([this, 'access', _107 => _107.routeManager, 'access', _108 => _108.setRendererRuntime, 'optionalCall', _109 => _109(this.rendererRuntime)]);
|
|
4214
4307
|
await this.applyRendererAppSetup();
|
|
4215
4308
|
}
|
|
4216
4309
|
/**
|
|
@@ -4219,7 +4312,7 @@ var ServerRenderer = class {
|
|
|
4219
4312
|
* re-applied on the next request without restarting.
|
|
4220
4313
|
*/
|
|
4221
4314
|
async applyRendererAppSetup() {
|
|
4222
|
-
const appSetupPath =
|
|
4315
|
+
const appSetupPath = _chunkNGTZHWBGcjs.resolveFarmRendererAppSetup.call(void 0,
|
|
4223
4316
|
this.config.root || process.cwd(),
|
|
4224
4317
|
this.config.renderer
|
|
4225
4318
|
);
|
|
@@ -4280,7 +4373,7 @@ var ServerRenderer = class {
|
|
|
4280
4373
|
/// Stylesheets the app imported through JS (fontsource packages, component
|
|
4281
4374
|
/// CSS) that the document must link alongside globals.css — see #658.
|
|
4282
4375
|
collectDevStyleHrefs() {
|
|
4283
|
-
const graph = _optionalChain([this, 'access',
|
|
4376
|
+
const graph = _optionalChain([this, 'access', _110 => _110.viteServer, 'optionalAccess', _111 => _111.moduleGraph]);
|
|
4284
4377
|
if (!graph) return [];
|
|
4285
4378
|
return collectDevStylesheetUrls(
|
|
4286
4379
|
graph.idToModuleMap.values(),
|
|
@@ -4331,7 +4424,7 @@ var ServerRenderer = class {
|
|
|
4331
4424
|
"data-farm-layout-boundary": "true",
|
|
4332
4425
|
"data-farm-layout-pattern": pattern,
|
|
4333
4426
|
...segment ? { "data-farm-layout-key": segment.key } : {},
|
|
4334
|
-
..._optionalChain([segment, 'optionalAccess',
|
|
4427
|
+
..._optionalChain([segment, 'optionalAccess', _112 => _112.kept]) ? { "data-farm-layout-kept": "true" } : {},
|
|
4335
4428
|
style: { display: "contents" }
|
|
4336
4429
|
},
|
|
4337
4430
|
layoutElement
|
|
@@ -4362,10 +4455,10 @@ var ServerRenderer = class {
|
|
|
4362
4455
|
return serverTree && this.rendererRuntime.renderServerTreePage ? this.rendererRuntime.renderServerTreePage(element, { values: false }) : this.rendererRuntime.isolateServerPageGraph(element);
|
|
4363
4456
|
}
|
|
4364
4457
|
async renderElementToCompleteHTML(element, options = {}) {
|
|
4365
|
-
const streaming =
|
|
4458
|
+
const streaming = _chunkNGTZHWBGcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0, this.config.renderer, "node");
|
|
4366
4459
|
const renderToPipeableStream = streaming.node ? this.rendererRuntime.renderToPipeableStream : void 0;
|
|
4367
4460
|
if (renderToPipeableStream) {
|
|
4368
|
-
const inlineBoundaries =
|
|
4461
|
+
const inlineBoundaries = _chunkNGTZHWBGcjs.isReactRenderer.call(void 0, this.config.renderer);
|
|
4369
4462
|
return await new Promise((resolve3, reject) => {
|
|
4370
4463
|
const chunks = [];
|
|
4371
4464
|
let shellReady = false;
|
|
@@ -4411,7 +4504,7 @@ var ServerRenderer = class {
|
|
|
4411
4504
|
element,
|
|
4412
4505
|
rendererRenderOptions()
|
|
4413
4506
|
);
|
|
4414
|
-
return await
|
|
4507
|
+
return await _chunkNGTZHWBGcjs.readFarmRendererWebStream.call(void 0, stream);
|
|
4415
4508
|
}
|
|
4416
4509
|
return await this.rendererRuntime.renderToString(element, rendererRenderOptions());
|
|
4417
4510
|
}
|
|
@@ -4435,7 +4528,7 @@ var ServerRenderer = class {
|
|
|
4435
4528
|
}
|
|
4436
4529
|
/** Islands mode sends large prop values once, keyed by content (RFC 0003). */
|
|
4437
4530
|
islandValues() {
|
|
4438
|
-
return _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access',
|
|
4531
|
+
return _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([this, 'access', _113 => _113.config, 'access', _114 => _114.experimental, 'optionalAccess', _115 => _115.serverComponents])) === "islands";
|
|
4439
4532
|
}
|
|
4440
4533
|
/**
|
|
4441
4534
|
* The page's element. Only React renders an async component, so for any other renderer Farm
|
|
@@ -4444,7 +4537,7 @@ var ServerRenderer = class {
|
|
|
4444
4537
|
*/
|
|
4445
4538
|
async createPageElement(PageComponent, pageProps) {
|
|
4446
4539
|
const runtime = this.rendererRuntime;
|
|
4447
|
-
if (
|
|
4540
|
+
if (_chunkNGTZHWBGcjs.isReactRenderer.call(void 0, this.config.renderer) || typeof PageComponent !== "function" || _optionalChain([PageComponent, 'access', _116 => _116.constructor, 'optionalAccess', _117 => _117.name]) !== "AsyncFunction") {
|
|
4448
4541
|
return runtime.createElement(PageComponent, pageProps);
|
|
4449
4542
|
}
|
|
4450
4543
|
const result = await PageComponent(pageProps);
|
|
@@ -4553,7 +4646,7 @@ var ServerRenderer = class {
|
|
|
4553
4646
|
* Any other docs response is sent as it is.
|
|
4554
4647
|
*/
|
|
4555
4648
|
async wrapDocsResponseWithLayouts(request2, response) {
|
|
4556
|
-
if (request2.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access',
|
|
4649
|
+
if (request2.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _118 => _118.headers, 'access', _119 => _119.get, 'call', _120 => _120("content-type"), 'optionalAccess', _121 => _121.toLowerCase, 'call', _122 => _122(), 'access', _123 => _123.includes, 'call', _124 => _124("text/html")])) {
|
|
4557
4650
|
return response;
|
|
4558
4651
|
}
|
|
4559
4652
|
await this.initialize();
|
|
@@ -4568,11 +4661,11 @@ var ServerRenderer = class {
|
|
|
4568
4661
|
return {
|
|
4569
4662
|
pattern: layout.pattern,
|
|
4570
4663
|
modulePath: layout.modulePath,
|
|
4571
|
-
shouldHydrate: _optionalChain([entry, 'optionalAccess',
|
|
4572
|
-
islandStrategy: _nullishCoalesce(_optionalChain([entry, 'optionalAccess',
|
|
4573
|
-
hasIsolatedClientBoundaries: _optionalChain([entry, 'optionalAccess',
|
|
4574
|
-
serverTree: _optionalChain([entry, 'optionalAccess',
|
|
4575
|
-
islands: _optionalChain([entry, 'optionalAccess',
|
|
4664
|
+
shouldHydrate: _optionalChain([entry, 'optionalAccess', _125 => _125.shouldHydrate]) === true,
|
|
4665
|
+
islandStrategy: _nullishCoalesce(_optionalChain([entry, 'optionalAccess', _126 => _126.islandStrategy]), () => ( null)),
|
|
4666
|
+
hasIsolatedClientBoundaries: _optionalChain([entry, 'optionalAccess', _127 => _127.hasIsolatedClientBoundaries]) === true,
|
|
4667
|
+
serverTree: _optionalChain([entry, 'optionalAccess', _128 => _128.serverTree]) === true,
|
|
4668
|
+
islands: _optionalChain([entry, 'optionalAccess', _129 => _129.hasIsolatedClientBoundaries]) === true
|
|
4576
4669
|
};
|
|
4577
4670
|
});
|
|
4578
4671
|
if (!_chunkNEKO3HM2cjs.farmDocsLayoutsWrapPage.call(void 0, layouts)) return response;
|
|
@@ -4594,7 +4687,7 @@ var ServerRenderer = class {
|
|
|
4594
4687
|
);
|
|
4595
4688
|
const treeLayouts = layouts.map((layout, index) => ({
|
|
4596
4689
|
...layout,
|
|
4597
|
-
Component: _optionalChain([modules, 'access',
|
|
4690
|
+
Component: _optionalChain([modules, 'access', _130 => _130[index], 'optionalAccess', _131 => _131.default])
|
|
4598
4691
|
}));
|
|
4599
4692
|
const islandStrategy = _chunkNEKO3HM2cjs.resolveFarmDocsLayoutIslandStrategy.call(void 0, treeLayouts);
|
|
4600
4693
|
const tree = await _chunkNEKO3HM2cjs.createFarmDocsLayoutTree.call(void 0, this.rendererRuntime, {
|
|
@@ -4660,7 +4753,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4660
4753
|
const head = [
|
|
4661
4754
|
...this.collectDevStyleLinks(),
|
|
4662
4755
|
`<script type="module" src="/@vite/client"></script>`,
|
|
4663
|
-
source.includes("window._$HY") ? "" : _optionalChain([this, 'access',
|
|
4756
|
+
source.includes("window._$HY") ? "" : _optionalChain([this, 'access', _132 => _132.rendererRuntime, 'access', _133 => _133.generateHydrationScript, 'optionalCall', _134 => _134()]),
|
|
4664
4757
|
bootstrapScript
|
|
4665
4758
|
].filter(Boolean).map((markup) => _chunk6JHZPB52cjs.stampFarmCspNonce.call(void 0, markup)).concat(rendered.head || []).join("\n ");
|
|
4666
4759
|
const clientScript = source.includes('src="/@farm/client.js"') ? "" : `
|
|
@@ -4679,7 +4772,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4679
4772
|
async runWithRequestContext(request2, fn) {
|
|
4680
4773
|
return _chunk2RSVYJT6cjs._runWithCurrentRequest.call(void 0,
|
|
4681
4774
|
request2,
|
|
4682
|
-
() => _optionalChain([this, 'access',
|
|
4775
|
+
() => _optionalChain([this, 'access', _135 => _135.i18nRuntime, 'optionalAccess', _136 => _136.config, 'access', _137 => _137.enabled]) ? _chunkSXXSQVKKcjs._runWithFarmI18nRequest.call(void 0, this.i18nRuntime, request2, fn, {
|
|
4683
4776
|
redirect: false
|
|
4684
4777
|
}) : fn()
|
|
4685
4778
|
);
|
|
@@ -4710,7 +4803,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4710
4803
|
* Check if a path should be served from SSG cache
|
|
4711
4804
|
*/
|
|
4712
4805
|
async shouldServeSSG(pathname) {
|
|
4713
|
-
const ssgPage =
|
|
4806
|
+
const ssgPage = _chunkHRH7OKBQcjs.matchSSGPage.call(void 0, pathname, this.ssgManifest);
|
|
4714
4807
|
if (!ssgPage) return null;
|
|
4715
4808
|
const cached = await this.getCachedSSGPage(pathname);
|
|
4716
4809
|
if (cached && await this.dataCache.isStaleAsync(cached)) {
|
|
@@ -4828,7 +4921,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4828
4921
|
setImmediate(async () => {
|
|
4829
4922
|
try {
|
|
4830
4923
|
const mod = await this.routeManager.loadRouteModule(page.filePath);
|
|
4831
|
-
if (!_optionalChain([mod, 'optionalAccess',
|
|
4924
|
+
if (!_optionalChain([mod, 'optionalAccess', _138 => _138.default])) return;
|
|
4832
4925
|
const { route, layouts } = this.routeManager.matchRoute(page.urlPath);
|
|
4833
4926
|
const layoutModules = await Promise.all(
|
|
4834
4927
|
layouts.map((l) => this.routeManager.loadLayoutModule(l.modulePath))
|
|
@@ -4842,7 +4935,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4842
4935
|
};
|
|
4843
4936
|
let pageElement = await this.createPageElement(PageComponent, pageProps);
|
|
4844
4937
|
const pageMetadata = _nullishCoalesce(routeManifest.routes.find(
|
|
4845
|
-
(entry) => entry.pattern === _optionalChain([route, 'optionalAccess',
|
|
4938
|
+
(entry) => entry.pattern === _optionalChain([route, 'optionalAccess', _139 => _139.pattern])
|
|
4846
4939
|
), () => ( {
|
|
4847
4940
|
shouldHydrate: false,
|
|
4848
4941
|
islandStrategy: null
|
|
@@ -4950,7 +5043,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4950
5043
|
* such as a partial test double, has none.
|
|
4951
5044
|
*/
|
|
4952
5045
|
publishSearchPreserveRoutes() {
|
|
4953
|
-
_chunkWKVYF2B5cjs._setFarmSearchPreserveRoutes.call(void 0, _nullishCoalesce(_optionalChain([this, 'access',
|
|
5046
|
+
_chunkWKVYF2B5cjs._setFarmSearchPreserveRoutes.call(void 0, _nullishCoalesce(_optionalChain([this, 'access', _140 => _140.routeManager, 'access', _141 => _141.getSearchPreserveRoutes, 'optionalCall', _142 => _142()]), () => ( [])));
|
|
4954
5047
|
}
|
|
4955
5048
|
async renderPage(req, res) {
|
|
4956
5049
|
await this.initialize();
|
|
@@ -4966,7 +5059,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
4966
5059
|
}
|
|
4967
5060
|
const request2 = this.createPageRequest(req, res);
|
|
4968
5061
|
const runtime = this.i18nRuntime;
|
|
4969
|
-
if (_optionalChain([runtime, 'optionalAccess',
|
|
5062
|
+
if (_optionalChain([runtime, 'optionalAccess', _143 => _143.config, 'access', _144 => _144.enabled])) {
|
|
4970
5063
|
const resolution = runtime.resolveRequest(request2);
|
|
4971
5064
|
const varyHeaders = _chunk7Q2YWZF7cjs.getFarmLocaleVaryHeaders.call(void 0, runtime.config, resolution);
|
|
4972
5065
|
for (const header of varyHeaders) appendResponseVary(res, header);
|
|
@@ -5005,7 +5098,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5005
5098
|
createPageRequestOnce(req, res) {
|
|
5006
5099
|
const observable = typeof req.once === "function" && typeof res.once === "function";
|
|
5007
5100
|
return _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
5008
|
-
trustProxy: _optionalChain([this, 'access',
|
|
5101
|
+
trustProxy: _optionalChain([this, 'access', _145 => _145.config, 'access', _146 => _146.server, 'optionalAccess', _147 => _147.trustProxy]),
|
|
5009
5102
|
signal: observable ? _chunk7Q7UB4TLcjs.createFarmNodeRequestAbortSignal.call(void 0,
|
|
5010
5103
|
req,
|
|
5011
5104
|
res
|
|
@@ -5035,7 +5128,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5035
5128
|
};
|
|
5036
5129
|
let pprShellWrite;
|
|
5037
5130
|
try {
|
|
5038
|
-
const url = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access',
|
|
5131
|
+
const url = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _148 => _148.config, 'access', _149 => _149.server, 'optionalAccess', _150 => _150.trustProxy]) });
|
|
5039
5132
|
pathname = url.pathname;
|
|
5040
5133
|
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, { type: "render.start", route: pathname, pathname });
|
|
5041
5134
|
searchParamsObject = _chunkSUCDVKUBcjs.searchParamsToObject.call(void 0, url.searchParams);
|
|
@@ -5198,11 +5291,11 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5198
5291
|
searchParams: _chunkSUCDVKUBcjs.createFarmSearchParams.call(void 0, searchParamsObject),
|
|
5199
5292
|
error
|
|
5200
5293
|
};
|
|
5201
|
-
if (_chunk7JUIK547cjs.isFarmNotFoundError.call(void 0, error) && _optionalChain([programmaticRouteComponents, 'optionalAccess',
|
|
5294
|
+
if (_chunk7JUIK547cjs.isFarmNotFoundError.call(void 0, error) && _optionalChain([programmaticRouteComponents, 'optionalAccess', _151 => _151.notFound])) {
|
|
5202
5295
|
res.statusCode = 404;
|
|
5203
5296
|
PageComponent = programmaticRouteComponents.notFound;
|
|
5204
5297
|
pageProps = routeStateProps;
|
|
5205
|
-
} else if (_optionalChain([programmaticRouteComponents, 'optionalAccess',
|
|
5298
|
+
} else if (_optionalChain([programmaticRouteComponents, 'optionalAccess', _152 => _152.error])) {
|
|
5206
5299
|
res.statusCode = 500;
|
|
5207
5300
|
PageComponent = programmaticRouteComponents.error;
|
|
5208
5301
|
pageProps = routeStateProps;
|
|
@@ -5210,10 +5303,10 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5210
5303
|
throw error;
|
|
5211
5304
|
}
|
|
5212
5305
|
}
|
|
5213
|
-
const renderingConfig = await
|
|
5306
|
+
const renderingConfig = await _chunkHRH7OKBQcjs.resolveRouteRenderingConfigFromFile.call(void 0,
|
|
5214
5307
|
routeModule,
|
|
5215
5308
|
route.modulePath,
|
|
5216
|
-
{ experimentalPPR: _optionalChain([this, 'access',
|
|
5309
|
+
{ experimentalPPR: _optionalChain([this, 'access', _153 => _153.config, 'access', _154 => _154.experimental, 'optionalAccess', _155 => _155.ppr]) === true }
|
|
5217
5310
|
);
|
|
5218
5311
|
const pprBypassReason = renderingConfig.ppr ? this.getPPRShellBypassReason(req, middlewareMap, middlewareContext, pluginExposedContext) : void 0;
|
|
5219
5312
|
const islandsNavigationRequest = Boolean(
|
|
@@ -5224,7 +5317,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5224
5317
|
let pprShellOptions = canCachePPRShell ? {
|
|
5225
5318
|
pathname,
|
|
5226
5319
|
search: url.search,
|
|
5227
|
-
locale: _nullishCoalesce(_optionalChain([pprI18nSnapshot, 'optionalAccess',
|
|
5320
|
+
locale: _nullishCoalesce(_optionalChain([pprI18nSnapshot, 'optionalAccess', _156 => _156.locale]), () => ( "")),
|
|
5228
5321
|
origin: pprI18nSnapshot && pprI18nSnapshot.routing !== "none" ? url.origin : "",
|
|
5229
5322
|
revalidate: renderingConfig.revalidate
|
|
5230
5323
|
} : void 0;
|
|
@@ -5302,7 +5395,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5302
5395
|
const routeManifestEntry = routeManifest.routes.find(
|
|
5303
5396
|
(entry) => entry.pattern === route.pattern
|
|
5304
5397
|
);
|
|
5305
|
-
const moduleMetadata = routeManifestEntry ||
|
|
5398
|
+
const moduleMetadata = routeManifestEntry || _chunkEFI6QWBQcjs.getClientModuleMetadata.call(void 0, route.modulePath, this.config.root);
|
|
5306
5399
|
const isClientComponent = moduleMetadata.isClientComponent;
|
|
5307
5400
|
const renderedRouteSlots = await Promise.all(
|
|
5308
5401
|
routeSlots.map(async (slot) => {
|
|
@@ -5353,20 +5446,20 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5353
5446
|
if (moduleMetadata.suppressedAsyncHydration) {
|
|
5354
5447
|
warnSuppressedAsyncHydrationOnce(
|
|
5355
5448
|
route.modulePath,
|
|
5356
|
-
_optionalChain([routeManifestEntry, 'optionalAccess',
|
|
5449
|
+
_optionalChain([routeManifestEntry, 'optionalAccess', _157 => _157.suppressedAsyncHydrationReason])
|
|
5357
5450
|
);
|
|
5358
5451
|
}
|
|
5359
5452
|
const layoutHydrationMetadata = layouts.map((layout) => {
|
|
5360
5453
|
const manifestEntry = routeManifest.layouts.find(
|
|
5361
5454
|
(entry) => entry.pattern === layout.pattern
|
|
5362
5455
|
);
|
|
5363
|
-
if (_optionalChain([manifestEntry, 'optionalAccess',
|
|
5456
|
+
if (_optionalChain([manifestEntry, 'optionalAccess', _158 => _158.suppressedAsyncHydration])) {
|
|
5364
5457
|
warnSuppressedAsyncHydrationOnce(
|
|
5365
5458
|
layout.modulePath,
|
|
5366
5459
|
manifestEntry.suppressedAsyncHydrationReason
|
|
5367
5460
|
);
|
|
5368
5461
|
}
|
|
5369
|
-
if (typeof _optionalChain([manifestEntry, 'optionalAccess',
|
|
5462
|
+
if (typeof _optionalChain([manifestEntry, 'optionalAccess', _159 => _159.shouldHydrate]) === "boolean") {
|
|
5370
5463
|
return {
|
|
5371
5464
|
isClientComponent: manifestEntry.isClientComponent === true,
|
|
5372
5465
|
shouldHydrate: manifestEntry.shouldHydrate,
|
|
@@ -5387,11 +5480,11 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5387
5480
|
const clientLayouts = layouts.map((layout, index) => ({
|
|
5388
5481
|
pattern: layout.pattern,
|
|
5389
5482
|
modulePath: _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, layout.modulePath, this.config.root),
|
|
5390
|
-
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access',
|
|
5391
|
-
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access',
|
|
5392
|
-
..._optionalChain([layoutHydrationMetadata, 'access',
|
|
5483
|
+
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _160 => _160[index], 'optionalAccess', _161 => _161.shouldHydrate]) === true,
|
|
5484
|
+
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _162 => _162[index], 'optionalAccess', _163 => _163.islandStrategy]), () => ( null)),
|
|
5485
|
+
..._optionalChain([layoutHydrationMetadata, 'access', _164 => _164[index], 'optionalAccess', _165 => _165.hasIsolatedClientBoundaries]) === true ? { hasIsolatedClientBoundaries: true } : {},
|
|
5393
5486
|
// Islands mode: the browser rebuilds this layout from its tree, not its module.
|
|
5394
|
-
...shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access',
|
|
5487
|
+
...shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access', _166 => _166[index], 'optionalAccess', _167 => _167.serverTree]) === true ? { serverTree: true } : {}
|
|
5395
5488
|
}));
|
|
5396
5489
|
const hydrationStrategies = [
|
|
5397
5490
|
...shouldHydrate && moduleMetadata.islandStrategy ? [moduleMetadata.islandStrategy] : [],
|
|
@@ -5405,9 +5498,9 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5405
5498
|
layouts.map((layout, index) => ({
|
|
5406
5499
|
pattern: layout.pattern,
|
|
5407
5500
|
modulePath: layout.modulePath,
|
|
5408
|
-
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access',
|
|
5409
|
-
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access',
|
|
5410
|
-
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access',
|
|
5501
|
+
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _168 => _168[index], 'optionalAccess', _169 => _169.shouldHydrate]) === true,
|
|
5502
|
+
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access', _170 => _170[index], 'optionalAccess', _171 => _171.hasIsolatedClientBoundaries]) === true,
|
|
5503
|
+
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _172 => _172[index], 'optionalAccess', _173 => _173.islandStrategy]), () => ( null))
|
|
5411
5504
|
})),
|
|
5412
5505
|
this.config.root || process.cwd(),
|
|
5413
5506
|
true
|
|
@@ -5415,10 +5508,10 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5415
5508
|
const hasHydratableRouteSlots = renderedRouteSlots.some(
|
|
5416
5509
|
(slot) => slot.isClientComponent || slot.shouldHydrate
|
|
5417
5510
|
);
|
|
5418
|
-
const hasIsolatedClientBoundaries = _optionalChain([routeManifestEntry, 'optionalAccess',
|
|
5511
|
+
const hasIsolatedClientBoundaries = _optionalChain([routeManifestEntry, 'optionalAccess', _174 => _174.hasIsolatedClientBoundaries]) === true || layoutHydrationMetadata.some((metadata) => metadata.hasIsolatedClientBoundaries === true);
|
|
5419
5512
|
req.__FARM_PAGE_PATH__ = route.modulePath;
|
|
5420
5513
|
req.__FARM_ROUTE__ = pathname;
|
|
5421
|
-
req.__FARM_ROOT_LAYOUT_PATH__ = _optionalChain([layouts, 'access',
|
|
5514
|
+
req.__FARM_ROOT_LAYOUT_PATH__ = _optionalChain([layouts, 'access', _175 => _175[0], 'optionalAccess', _176 => _176.modulePath]);
|
|
5422
5515
|
req.__FARM_IS_CLIENT_COMPONENT__ = isClientComponent;
|
|
5423
5516
|
req.__FARM_PAGE_SHOULD_HYDRATE__ = shouldHydrate;
|
|
5424
5517
|
req.__FARM_LAYOUT_SHOULD_HYDRATE__ = shouldHydrateLayout;
|
|
@@ -5429,7 +5522,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5429
5522
|
req.__FARM_SHOULD_HYDRATE__ = shouldHydrate || shouldHydrateLayout || hasIsolatedClientBoundaries;
|
|
5430
5523
|
req.__FARM_ISLAND_STRATEGY__ = hydrationIslandStrategy;
|
|
5431
5524
|
req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ = hasHydratableRouteSlots;
|
|
5432
|
-
req.__FARM_LOADING_MODULE_PATH__ = _optionalChain([loadingBoundaryEntry, 'optionalAccess',
|
|
5525
|
+
req.__FARM_LOADING_MODULE_PATH__ = _optionalChain([loadingBoundaryEntry, 'optionalAccess', _177 => _177.modulePath]) ? _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, loadingBoundaryEntry.modulePath, this.config.root) : null;
|
|
5433
5526
|
req.__FARM_ROUTE_SLOTS__ = renderedRouteSlots.map((slot) => ({
|
|
5434
5527
|
name: slot.name,
|
|
5435
5528
|
ownerPattern: slot.ownerPattern,
|
|
@@ -5501,7 +5594,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5501
5594
|
} else if (shouldHydrateLayout && !(isClientComponent || shouldHydrate) && this.rendererRuntime.isolateServerPageGraph) {
|
|
5502
5595
|
pageElement = await this.isolateServerPage(
|
|
5503
5596
|
pageElement,
|
|
5504
|
-
_optionalChain([routeManifestEntry, 'optionalAccess',
|
|
5597
|
+
_optionalChain([routeManifestEntry, 'optionalAccess', _178 => _178.serverTree]) === true
|
|
5505
5598
|
);
|
|
5506
5599
|
}
|
|
5507
5600
|
pageElement = await this.createPageBoundary(pageElement, {
|
|
@@ -5516,7 +5609,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5516
5609
|
if (keptLayouts > 0 && !layouts.slice(0, keptLayouts).every((layout) => canFarmSkipKeptLayoutRender(layout.modulePath, keptRoot))) {
|
|
5517
5610
|
let keptElement = null;
|
|
5518
5611
|
for (let i = keptLayouts - 1; i >= 0; i--) {
|
|
5519
|
-
const KeptLayout = _optionalChain([layoutModules, 'access',
|
|
5612
|
+
const KeptLayout = _optionalChain([layoutModules, 'access', _179 => _179[i], 'optionalAccess', _180 => _180.default]);
|
|
5520
5613
|
if (KeptLayout) {
|
|
5521
5614
|
keptElement = this.rendererRuntime.createElement(KeptLayout, {
|
|
5522
5615
|
children: keptElement,
|
|
@@ -5569,7 +5662,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5569
5662
|
);
|
|
5570
5663
|
slotProps[slot.name] = slotElement;
|
|
5571
5664
|
}
|
|
5572
|
-
wrappedElement = shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access',
|
|
5665
|
+
wrappedElement = shouldHydrateLayout && _optionalChain([layoutHydrationMetadata, 'access', _181 => _181[i], 'optionalAccess', _182 => _182.serverTree]) === true && islands && this.islandValues() ? await islands.renderFarmServerTreeLayout(
|
|
5573
5666
|
LayoutComponent,
|
|
5574
5667
|
{ params },
|
|
5575
5668
|
{ children: wrappedElement, ...slotProps },
|
|
@@ -5747,7 +5840,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5747
5840
|
}
|
|
5748
5841
|
await this.renderError(req, res, error, errorStatus);
|
|
5749
5842
|
} finally {
|
|
5750
|
-
_optionalChain([pprShellWrite, 'optionalAccess',
|
|
5843
|
+
_optionalChain([pprShellWrite, 'optionalAccess', _183 => _183.release, 'call', _184 => _184()]);
|
|
5751
5844
|
}
|
|
5752
5845
|
}
|
|
5753
5846
|
async wrapWithIntegrationProviders(element) {
|
|
@@ -5756,13 +5849,13 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5756
5849
|
for (let i = providers.length - 1; i >= 0; i--) {
|
|
5757
5850
|
const provider = providers[i];
|
|
5758
5851
|
if (provider.component || provider.type === "clerk") {
|
|
5759
|
-
const rendererCapabilities =
|
|
5852
|
+
const rendererCapabilities = _chunkNGTZHWBGcjs.getFarmRendererCapabilities.call(void 0, this.config.renderer);
|
|
5760
5853
|
if (!rendererCapabilities.functionComponents) {
|
|
5761
5854
|
throw new Error(
|
|
5762
|
-
`Integration provider \`${provider.name}\` requires a renderer that can host function components; \`${_nullishCoalesce(_optionalChain([this, 'access',
|
|
5855
|
+
`Integration provider \`${provider.name}\` requires a renderer that can host function components; \`${_nullishCoalesce(_optionalChain([this, 'access', _185 => _185.config, 'access', _186 => _186.renderer, 'optionalAccess', _187 => _187.name]), () => ( "the configured renderer"))}\` cannot.`
|
|
5763
5856
|
);
|
|
5764
5857
|
}
|
|
5765
|
-
if (provider.type === "clerk" && !
|
|
5858
|
+
if (provider.type === "clerk" && !_chunkNGTZHWBGcjs.isReactRenderer.call(void 0, this.config.renderer)) {
|
|
5766
5859
|
throw new Error(
|
|
5767
5860
|
`Integration provider \`${provider.name}\` uses Clerk's React components, which require the React renderer.`
|
|
5768
5861
|
);
|
|
@@ -5798,7 +5891,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5798
5891
|
}
|
|
5799
5892
|
if (provider.type !== "clerk" && typeof this.rendererRuntime.markFunctionComponent === "function" && !isRendererCompiledComponent(
|
|
5800
5893
|
_nullishCoalesce(providerSourceModule, () => ( "")),
|
|
5801
|
-
|
|
5894
|
+
_chunkNGTZHWBGcjs.resolveFarmComponentExtensions.call(void 0, _optionalChain([this, 'access', _188 => _188.config, 'access', _189 => _189.renderer, 'optionalAccess', _190 => _190.componentExtensions]))
|
|
5802
5895
|
)) {
|
|
5803
5896
|
ProviderComponent = this.rendererRuntime.markFunctionComponent(ProviderComponent);
|
|
5804
5897
|
}
|
|
@@ -5927,7 +6020,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5927
6020
|
);
|
|
5928
6021
|
}
|
|
5929
6022
|
const request2 = _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
5930
|
-
trustProxy: _optionalChain([this, 'access',
|
|
6023
|
+
trustProxy: _optionalChain([this, 'access', _191 => _191.config, 'access', _192 => _192.server, 'optionalAccess', _193 => _193.trustProxy])
|
|
5931
6024
|
});
|
|
5932
6025
|
const url = new URL(request2.url);
|
|
5933
6026
|
const llmsContext = match.metadata.kind === "llms" || match.metadata.kind === "llms-full" ? await this.createLlmsTxtContext(request2, {
|
|
@@ -5963,7 +6056,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5963
6056
|
}
|
|
5964
6057
|
/** `/llms.txt` and `/llms-full.txt` from `agent.llmsTxt` when no file route owns them. */
|
|
5965
6058
|
getGeneratedLlmsKind(pathname) {
|
|
5966
|
-
const config = _chunkOLKYHTLNcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access',
|
|
6059
|
+
const config = _chunkOLKYHTLNcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _194 => _194.config, 'access', _195 => _195.agent, 'optionalAccess', _196 => _196.llmsTxt]));
|
|
5967
6060
|
if (!config.enabled) return null;
|
|
5968
6061
|
if (pathname === "/llms.txt") return "llms";
|
|
5969
6062
|
return pathname === "/llms-full.txt" && config.full ? "llms-full" : null;
|
|
@@ -5971,9 +6064,9 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
5971
6064
|
async renderGeneratedLlmsTxt(req, res, kind) {
|
|
5972
6065
|
try {
|
|
5973
6066
|
const request2 = _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
5974
|
-
trustProxy: _optionalChain([this, 'access',
|
|
6067
|
+
trustProxy: _optionalChain([this, 'access', _197 => _197.config, 'access', _198 => _198.server, 'optionalAccess', _199 => _199.trustProxy])
|
|
5975
6068
|
});
|
|
5976
|
-
const config = _chunkOLKYHTLNcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access',
|
|
6069
|
+
const config = _chunkOLKYHTLNcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _200 => _200.config, 'access', _201 => _201.agent, 'optionalAccess', _202 => _202.llmsTxt]));
|
|
5977
6070
|
const context = await this.createLlmsTxtContext(request2, { full: kind === "llms-full", req });
|
|
5978
6071
|
const body = kind === "llms-full" ? await _chunkOLKYHTLNcjs.renderFarmLlmsFullTxt.call(void 0, context.defaults, {
|
|
5979
6072
|
origin: await this.getAgentOrigin(request2),
|
|
@@ -6000,18 +6093,18 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6000
6093
|
}
|
|
6001
6094
|
}
|
|
6002
6095
|
getAgentCrawlers() {
|
|
6003
|
-
return _chunkEACD6ND7cjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access',
|
|
6096
|
+
return _chunkEACD6ND7cjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access', _203 => _203.config, 'access', _204 => _204.agent, 'optionalAccess', _205 => _205.crawlers]));
|
|
6004
6097
|
}
|
|
6005
6098
|
/** `/robots.txt` from `agent.crawlers` when no robots.ts owns it. */
|
|
6006
6099
|
async renderGeneratedRobotsTxt(req, res) {
|
|
6007
6100
|
try {
|
|
6008
|
-
const sitemapPath = _optionalChain([this, 'access',
|
|
6101
|
+
const sitemapPath = _optionalChain([this, 'access', _206 => _206.routeManager, 'access', _207 => _207.matchMetadataRoute, 'call', _208 => _208("/sitemap.xml"), 'optionalAccess', _209 => _209.metadata, 'access', _210 => _210.kind]) === "sitemap" || this.getAgentSitemap().enabled ? "/sitemap.xml" : void 0;
|
|
6009
6102
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
6010
6103
|
const rootMetadata = sitemapPath && rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
6011
6104
|
const robots = _chunkEACD6ND7cjs.createFarmAgentRobots.call(void 0, {
|
|
6012
6105
|
crawlers: this.getAgentCrawlers(),
|
|
6013
6106
|
sitemapPath,
|
|
6014
|
-
metadataBase: _optionalChain([rootMetadata, 'optionalAccess',
|
|
6107
|
+
metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _211 => _211.metadataBase]),
|
|
6015
6108
|
basePath: this.config.basePath
|
|
6016
6109
|
});
|
|
6017
6110
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
@@ -6030,13 +6123,13 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6030
6123
|
}
|
|
6031
6124
|
}
|
|
6032
6125
|
getAgentSitemap() {
|
|
6033
|
-
return _chunkEACD6ND7cjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([this, 'access',
|
|
6126
|
+
return _chunkEACD6ND7cjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([this, 'access', _212 => _212.config, 'access', _213 => _213.agent, 'optionalAccess', _214 => _214.sitemap]));
|
|
6034
6127
|
}
|
|
6035
6128
|
/** `/sitemap.xml` from `agent.sitemap` when no sitemap.ts owns it. */
|
|
6036
6129
|
async renderGeneratedSitemap(req, res) {
|
|
6037
6130
|
try {
|
|
6038
6131
|
const request2 = _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, {
|
|
6039
|
-
trustProxy: _optionalChain([this, 'access',
|
|
6132
|
+
trustProxy: _optionalChain([this, 'access', _215 => _215.config, 'access', _216 => _216.server, 'optionalAccess', _217 => _217.trustProxy])
|
|
6040
6133
|
});
|
|
6041
6134
|
const sources = await Promise.all(
|
|
6042
6135
|
this.getAgentListedRoutes().map(async ([pattern, route]) => {
|
|
@@ -6047,8 +6140,8 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6047
6140
|
}),
|
|
6048
6141
|
fs7.promises.stat(route.modulePath).catch(() => void 0)
|
|
6049
6142
|
]);
|
|
6050
|
-
if (await this.isAgentPageNoIndex(pattern, _optionalChain([module, 'optionalAccess',
|
|
6051
|
-
return { pattern, module, lastModified: _optionalChain([stat, 'optionalAccess',
|
|
6143
|
+
if (await this.isAgentPageNoIndex(pattern, _optionalChain([module, 'optionalAccess', _218 => _218.metadata]))) return null;
|
|
6144
|
+
return { pattern, module, lastModified: _optionalChain([stat, 'optionalAccess', _219 => _219.mtime, 'access', _220 => _220.toISOString, 'call', _221 => _221()]) };
|
|
6052
6145
|
})
|
|
6053
6146
|
);
|
|
6054
6147
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
@@ -6058,10 +6151,10 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6058
6151
|
{
|
|
6059
6152
|
origin: new URL(request2.url).origin,
|
|
6060
6153
|
config: this.getAgentSitemap(),
|
|
6061
|
-
metadataBase: _optionalChain([rootMetadata, 'optionalAccess',
|
|
6154
|
+
metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _222 => _222.metadataBase]),
|
|
6062
6155
|
basePath: this.config.basePath,
|
|
6063
6156
|
trailingSlash: this.config.trailingSlash,
|
|
6064
|
-
i18n: _optionalChain([this, 'access',
|
|
6157
|
+
i18n: _optionalChain([this, 'access', _223 => _223.i18nRuntime, 'optionalAccess', _224 => _224.config])
|
|
6065
6158
|
}
|
|
6066
6159
|
);
|
|
6067
6160
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0,
|
|
@@ -6093,7 +6186,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6093
6186
|
* matcher) covers, as the production build decides.
|
|
6094
6187
|
*/
|
|
6095
6188
|
getAgentListedRoutes() {
|
|
6096
|
-
const guards = { config: this.config, middlewareRoutes: _nullishCoalesce(_optionalChain([this, 'access',
|
|
6189
|
+
const guards = { config: this.config, middlewareRoutes: _nullishCoalesce(_optionalChain([this, 'access', _225 => _225.middlewareRoutes, 'optionalCall', _226 => _226()]), () => ( [])) };
|
|
6097
6190
|
return [...this.routeManager.getRoutes()].filter(
|
|
6098
6191
|
([pattern]) => !pattern.includes("[") && !_chunkNEKO3HM2cjs.farmPathGuardCoversPage.call(void 0, guards, pattern)
|
|
6099
6192
|
);
|
|
@@ -6119,22 +6212,22 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6119
6212
|
* or a registered server such as the docs engine's. Production applies the same rules.
|
|
6120
6213
|
*/
|
|
6121
6214
|
getDefaultMCPServer() {
|
|
6122
|
-
if (_optionalChain([this, 'access',
|
|
6123
|
-
if (_optionalChain([this, 'access',
|
|
6215
|
+
if (_optionalChain([this, 'access', _227 => _227.config, 'access', _228 => _228.agent, 'optionalAccess', _229 => _229.mcp]) !== true || _chunkW53Z4WDIcjs.farmConfigMountsMCP.call(void 0, this.config)) return void 0;
|
|
6216
|
+
if (_optionalChain([this, 'access', _230 => _230.apiRouteExists, 'optionalCall', _231 => _231("/api/mcp")])) return void 0;
|
|
6124
6217
|
if (this.routeManager.matchRoute(_chunkW53Z4WDIcjs.FARM_DEFAULT_MCP_PATH).route) return void 0;
|
|
6125
6218
|
_nullishCoalesce(this.defaultMCPServer, () => ( (this.defaultMCPServer = _chunkW53Z4WDIcjs.createFarmDefaultMCPServer.call(void 0,
|
|
6126
6219
|
readAppPackageIdentity(this.config.root),
|
|
6127
|
-
|
|
6220
|
+
_chunk3CZ4MJHWcjs.FARM_VERSION
|
|
6128
6221
|
))));
|
|
6129
6222
|
return _chunkW53Z4WDIcjs.resolveFarmDefaultMCPServer.call(void 0, this.defaultMCPServer);
|
|
6130
6223
|
}
|
|
6131
6224
|
async renderDefaultMCP(req, res) {
|
|
6132
6225
|
const server = this.getDefaultMCPServer();
|
|
6133
|
-
const request2 = _nullishCoalesce(_chunk2RSVYJT6cjs.getCurrentRequestOrNull.call(void 0, ), () => ( _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, { trustProxy: _optionalChain([this, 'access',
|
|
6226
|
+
const request2 = _nullishCoalesce(_chunk2RSVYJT6cjs.getCurrentRequestOrNull.call(void 0, ), () => ( _chunk2RSVYJT6cjs.createWebRequestFromFarmRequest.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _232 => _232.config, 'access', _233 => _233.server, 'optionalAccess', _234 => _234.trustProxy]) })));
|
|
6134
6227
|
try {
|
|
6135
6228
|
const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-IUL6OPC3.cjs");
|
|
6136
6229
|
const origin = new URL(request2.url).origin;
|
|
6137
|
-
const i18n = _optionalChain([this, 'access',
|
|
6230
|
+
const i18n = _optionalChain([this, 'access', _235 => _235.i18nRuntime, 'optionalAccess', _236 => _236.config]);
|
|
6138
6231
|
const metadataBase = await this.getRootMetadataBase();
|
|
6139
6232
|
const response = await handleFarmDefaultMCPRequest(request2, {
|
|
6140
6233
|
server,
|
|
@@ -6182,7 +6275,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6182
6275
|
}
|
|
6183
6276
|
/** Same inputs the production server gives llms.txt: static pages and root metadata. */
|
|
6184
6277
|
async createLlmsTxtContext(request2, options = {}) {
|
|
6185
|
-
const config = _chunkOLKYHTLNcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access',
|
|
6278
|
+
const config = _chunkOLKYHTLNcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _237 => _237.config, 'access', _238 => _238.agent, 'optionalAccess', _239 => _239.llmsTxt]));
|
|
6186
6279
|
const origin = await this.getAgentOrigin(request2);
|
|
6187
6280
|
const sources = await Promise.all(
|
|
6188
6281
|
this.getAgentListedRoutes().map(async ([pattern, route]) => {
|
|
@@ -6208,7 +6301,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6208
6301
|
include: config.include,
|
|
6209
6302
|
exclude: config.exclude,
|
|
6210
6303
|
trailingSlash: this.config.trailingSlash,
|
|
6211
|
-
i18n: _optionalChain([this, 'access',
|
|
6304
|
+
i18n: _optionalChain([this, 'access', _240 => _240.i18nRuntime, 'optionalAccess', _241 => _241.config])
|
|
6212
6305
|
}
|
|
6213
6306
|
);
|
|
6214
6307
|
return {
|
|
@@ -6218,7 +6311,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6218
6311
|
pages,
|
|
6219
6312
|
config,
|
|
6220
6313
|
rootMetadata,
|
|
6221
|
-
mcp: _optionalChain([this, 'access',
|
|
6314
|
+
mcp: _optionalChain([this, 'access', _242 => _242.config, 'access', _243 => _243.agent, 'optionalAccess', _244 => _244.aiCatalog]) === false ? [] : _chunkWCSBYQOTcjs.listFarmMCPLlmsTxtLinks.call(void 0, origin, {
|
|
6222
6315
|
basePath: this.config.basePath,
|
|
6223
6316
|
apiServerBasePath: _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0,
|
|
6224
6317
|
_chunkPMJSG4JScjs.normalizeFarmAPIConfig.call(void 0,
|
|
@@ -6248,7 +6341,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6248
6341
|
async getRootMetadataBase() {
|
|
6249
6342
|
const rootLayout = this.routeManager.getLayouts().get("/");
|
|
6250
6343
|
const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
|
|
6251
|
-
return _optionalChain([rootMetadata, 'optionalAccess',
|
|
6344
|
+
return _optionalChain([rootMetadata, 'optionalAccess', _245 => _245.metadataBase]);
|
|
6252
6345
|
}
|
|
6253
6346
|
/**
|
|
6254
6347
|
* Reads page mirrors back through this dev server, the way its .md handler
|
|
@@ -6260,8 +6353,8 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6260
6353
|
* body is discarded.
|
|
6261
6354
|
*/
|
|
6262
6355
|
createDevMarkdownReader(req) {
|
|
6263
|
-
const socket = _optionalChain([req, 'optionalAccess',
|
|
6264
|
-
if (_optionalChain([req, 'optionalAccess',
|
|
6356
|
+
const socket = _optionalChain([req, 'optionalAccess', _246 => _246.socket]);
|
|
6357
|
+
if (_optionalChain([req, 'optionalAccess', _247 => _247.method, 'optionalAccess', _248 => _248.toUpperCase, 'call', _249 => _249()]) === "HEAD" || !_optionalChain([socket, 'optionalAccess', _250 => _250.localAddress]) || !socket.localPort) {
|
|
6265
6358
|
return async () => null;
|
|
6266
6359
|
}
|
|
6267
6360
|
if (socket.encrypted) {
|
|
@@ -6309,7 +6402,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6309
6402
|
renderer: this.getMetadataImageRenderer(),
|
|
6310
6403
|
component: isRendererCompiledComponent(
|
|
6311
6404
|
options.image.modulePath,
|
|
6312
|
-
_nullishCoalesce(_optionalChain([this, 'access',
|
|
6405
|
+
_nullishCoalesce(_optionalChain([this, 'access', _251 => _251.config, 'access', _252 => _252.renderer, 'optionalAccess', _253 => _253.componentExtensions]), () => ( []))
|
|
6313
6406
|
)
|
|
6314
6407
|
});
|
|
6315
6408
|
await this.writeMetadataImageResponse(req, res, handlerResult, imageModule);
|
|
@@ -6325,7 +6418,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6325
6418
|
}
|
|
6326
6419
|
/** The renderer that draws a metadata image: none for React, whose elements Satori reads directly. */
|
|
6327
6420
|
getMetadataImageRenderer() {
|
|
6328
|
-
return
|
|
6421
|
+
return _chunkNGTZHWBGcjs.isReactRenderer.call(void 0, this.config.renderer) ? void 0 : this.rendererRuntime;
|
|
6329
6422
|
}
|
|
6330
6423
|
async writeStaticMetadataImageResponse(req, res, image) {
|
|
6331
6424
|
const method = (req.method || "GET").toUpperCase();
|
|
@@ -6337,7 +6430,7 @@ window.__FARM_I18N__ = ${i18nSnapshot ? serializeInlineValue(i18nSnapshot) : "nu
|
|
|
6337
6430
|
}
|
|
6338
6431
|
const etag = `"${image.staticInfo.hash}"`;
|
|
6339
6432
|
const requestUrl = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
6340
|
-
trustProxy: _optionalChain([this, 'access',
|
|
6433
|
+
trustProxy: _optionalChain([this, 'access', _254 => _254.config, 'access', _255 => _255.server, 'optionalAccess', _256 => _256.trustProxy])
|
|
6341
6434
|
});
|
|
6342
6435
|
const isVersioned = requestUrl.searchParams.get("v") === image.staticInfo.hash;
|
|
6343
6436
|
res.setHeader("Content-Type", image.staticInfo.contentType);
|
|
@@ -6492,7 +6585,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6492
6585
|
</script>`);
|
|
6493
6586
|
const deferredScript = farmScripts(createDeferredHydrationScript(deferredProps.records));
|
|
6494
6587
|
const rendererHydrationScript = farmScripts(
|
|
6495
|
-
_optionalChain([this, 'access',
|
|
6588
|
+
_optionalChain([this, 'access', _257 => _257.rendererRuntime, 'access', _258 => _258.generateHydrationScript, 'optionalCall', _259 => _259()]) || ""
|
|
6496
6589
|
);
|
|
6497
6590
|
const viteClientScript = farmScripts(`<script type="module" src="/@vite/client"></script>`);
|
|
6498
6591
|
const farmClientScript = farmScripts(
|
|
@@ -6503,7 +6596,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6503
6596
|
element,
|
|
6504
6597
|
{
|
|
6505
6598
|
rejectLateNavigation: _chunk2NOHVIJ3cjs._isFarmMarkdownPageCheck.call(void 0,
|
|
6506
|
-
_optionalChain([req, 'access',
|
|
6599
|
+
_optionalChain([req, 'access', _260 => _260.headers, 'optionalAccess', _261 => _261[_chunk2NOHVIJ3cjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])
|
|
6507
6600
|
)
|
|
6508
6601
|
}
|
|
6509
6602
|
);
|
|
@@ -6515,7 +6608,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6515
6608
|
viewport: viewportTags
|
|
6516
6609
|
} = _chunkY3DO7BIJcjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
|
|
6517
6610
|
pathname: getFarmMetadataPathname(req),
|
|
6518
|
-
jsonLd: _optionalChain([this, 'access',
|
|
6611
|
+
jsonLd: _optionalChain([this, 'access', _262 => _262.config, 'access', _263 => _263.agent, 'optionalAccess', _264 => _264.jsonLd])
|
|
6519
6612
|
});
|
|
6520
6613
|
const documentTitleTag = !hasExplicitTitle && /<title[\s>]/i.test(rendererHead) ? "" : `<title>${title}</title>`;
|
|
6521
6614
|
const rendererHasTitle = /<title[\s>]/i.test(rendererHead);
|
|
@@ -6564,7 +6657,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6564
6657
|
});
|
|
6565
6658
|
} else {
|
|
6566
6659
|
html = `<!DOCTYPE html>
|
|
6567
|
-
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
6660
|
+
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _265 => _265.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
|
|
6568
6661
|
<head>
|
|
6569
6662
|
${themeDocument.head}
|
|
6570
6663
|
<meta charset="utf-8">
|
|
@@ -6596,7 +6689,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6596
6689
|
const securedHtml = this.secureDocumentHTML(req, html);
|
|
6597
6690
|
if ((req.method || "GET").toUpperCase() !== "HEAD") res.write(securedHtml);
|
|
6598
6691
|
res.end();
|
|
6599
|
-
if (!options.captureStaticShell) await _optionalChain([options, 'access',
|
|
6692
|
+
if (!options.captureStaticShell) await _optionalChain([options, 'access', _266 => _266.onComplete, 'optionalCall', _267 => _267(securedHtml)]);
|
|
6600
6693
|
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
6601
6694
|
type: "render.stream.complete",
|
|
6602
6695
|
route,
|
|
@@ -6606,7 +6699,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6606
6699
|
emitFarmRenderError(req, route, error);
|
|
6607
6700
|
throw error;
|
|
6608
6701
|
} finally {
|
|
6609
|
-
_optionalChain([clearMiddlewareData, 'optionalCall',
|
|
6702
|
+
_optionalChain([clearMiddlewareData, 'optionalCall', _268 => _268()]);
|
|
6610
6703
|
}
|
|
6611
6704
|
}
|
|
6612
6705
|
/**
|
|
@@ -6616,11 +6709,11 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6616
6709
|
* call (async, a class, or one using hooks) falls back to detection from the stream.
|
|
6617
6710
|
*/
|
|
6618
6711
|
async rootLayoutRendersDocument(req) {
|
|
6619
|
-
const modulePath = _nullishCoalesce(req.__FARM_ROOT_LAYOUT_PATH__, () => ( (typeof this.routeManager.getLayouts === "function" ? _optionalChain([this, 'access',
|
|
6712
|
+
const modulePath = _nullishCoalesce(req.__FARM_ROOT_LAYOUT_PATH__, () => ( (typeof this.routeManager.getLayouts === "function" ? _optionalChain([this, 'access', _269 => _269.routeManager, 'access', _270 => _270.getLayouts, 'call', _271 => _271(), 'access', _272 => _272.get, 'call', _273 => _273("/"), 'optionalAccess', _274 => _274.modulePath]) : void 0)));
|
|
6620
6713
|
if (!modulePath) return false;
|
|
6621
6714
|
try {
|
|
6622
6715
|
const Layout = (await this.routeManager.loadLayoutModule(modulePath)).default;
|
|
6623
|
-
if (typeof Layout !== "function" || _optionalChain([Layout, 'access',
|
|
6716
|
+
if (typeof Layout !== "function" || _optionalChain([Layout, 'access', _275 => _275.prototype, 'optionalAccess', _276 => _276.isReactComponent]) || _optionalChain([Layout, 'access', _277 => _277.constructor, 'optionalAccess', _278 => _278.name]) === "AsyncFunction") {
|
|
6624
6717
|
return false;
|
|
6625
6718
|
}
|
|
6626
6719
|
const cached = documentLayouts.get(Layout);
|
|
@@ -6643,10 +6736,10 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6643
6736
|
}
|
|
6644
6737
|
async renderWithSSR(element, req, res, clearMiddlewareData, options = {}) {
|
|
6645
6738
|
const runtime = this.rendererRuntime;
|
|
6646
|
-
const renderToPipeableStream = _nullishCoalesce(runtime.renderToPipeableStream, () => ( (
|
|
6739
|
+
const renderToPipeableStream = _nullishCoalesce(runtime.renderToPipeableStream, () => ( (_chunkNGTZHWBGcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0, this.config.renderer, "node").web && runtime.renderToReadableStream ? pipeFarmRendererWebStream(runtime) : void 0)));
|
|
6647
6740
|
const fullDocumentRouteKey = options.observabilityRoute || req.__FARM_ROUTE__ || req.url || "/";
|
|
6648
6741
|
const streamDocument = fullDocumentRoutes.has(fullDocumentRouteKey) || await this.rootLayoutRendersDocument(req);
|
|
6649
|
-
if (!renderToPipeableStream || _chunk2NOHVIJ3cjs._isFarmMarkdownPageCheck.call(void 0, _optionalChain([req, 'access',
|
|
6742
|
+
if (!renderToPipeableStream || _chunk2NOHVIJ3cjs._isFarmMarkdownPageCheck.call(void 0, _optionalChain([req, 'access', _279 => _279.headers, 'optionalAccess', _280 => _280[_chunk2NOHVIJ3cjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])) || streamDocument && (options.captureStaticShell || !_chunkNGTZHWBGcjs.isReactRenderer.call(void 0, this.config.renderer))) {
|
|
6650
6743
|
return this.renderBufferedSSR(element, req, res, clearMiddlewareData, options);
|
|
6651
6744
|
}
|
|
6652
6745
|
return new Promise((resolve3, reject) => {
|
|
@@ -6724,7 +6817,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6724
6817
|
const waitingRoot = this.islandValues() && !islandsOnlyPage && req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ !== true && rootStrategy !== void 0 && rootStrategy !== "load" ? req.__FARM_LAYOUT_SHOULD_HYDRATE__ === true ? "root" : "__farm_page__" : null;
|
|
6725
6818
|
const bootClient = (islandsOnlyPage || waitingRoot !== null) && !staticShellParts && _chunkAQLHD6HZcjs.resolveFarmPlatform.call(void 0, ) !== "mobile" && canBootFarmIslandsClient(this.config);
|
|
6726
6819
|
const hydrationClickQueueScript = this.renderPreHydrationHold(req, bootClient);
|
|
6727
|
-
const rendererHydrationScript = _optionalChain([this, 'access',
|
|
6820
|
+
const rendererHydrationScript = _optionalChain([this, 'access', _281 => _281.rendererRuntime, 'access', _282 => _282.generateHydrationScript, 'optionalCall', _283 => _283()]) || "";
|
|
6728
6821
|
const {
|
|
6729
6822
|
title,
|
|
6730
6823
|
tags: metaTags,
|
|
@@ -6733,7 +6826,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6733
6826
|
viewport: viewportTags
|
|
6734
6827
|
} = _chunkY3DO7BIJcjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
|
|
6735
6828
|
pathname: getFarmMetadataPathname(req),
|
|
6736
|
-
jsonLd: _optionalChain([this, 'access',
|
|
6829
|
+
jsonLd: _optionalChain([this, 'access', _284 => _284.config, 'access', _285 => _285.agent, 'optionalAccess', _286 => _286.jsonLd])
|
|
6737
6830
|
});
|
|
6738
6831
|
const i18nSnapshot = _chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
6739
6832
|
const i18nAlternateTags = i18nSnapshot ? renderI18nAlternateLinks(
|
|
@@ -6761,7 +6854,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6761
6854
|
formState: _chunkOZUINP2Pcjs.getFarmFormState.call(void 0, ),
|
|
6762
6855
|
onShellReady() {
|
|
6763
6856
|
if (pendingNavigationError) {
|
|
6764
|
-
_optionalChain([abort, 'optionalCall',
|
|
6857
|
+
_optionalChain([abort, 'optionalCall', _287 => _287(pendingNavigationError)]);
|
|
6765
6858
|
if (clearMiddlewareData) {
|
|
6766
6859
|
clearMiddlewareData();
|
|
6767
6860
|
}
|
|
@@ -6779,7 +6872,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6779
6872
|
console.log(`[FARM STREAM] onShellReady at ${shellReadyMs}ms`);
|
|
6780
6873
|
}
|
|
6781
6874
|
const shell = `<!DOCTYPE html>
|
|
6782
|
-
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
6875
|
+
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _288 => _288.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
|
|
6783
6876
|
<head>
|
|
6784
6877
|
${themeDocument.head}
|
|
6785
6878
|
<meta charset="utf-8">
|
|
@@ -6808,7 +6901,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6808
6901
|
pendingShell = "";
|
|
6809
6902
|
heldHead = "";
|
|
6810
6903
|
htmlParts.push(opened);
|
|
6811
|
-
_optionalChain([staticShellParts, 'optionalAccess',
|
|
6904
|
+
_optionalChain([staticShellParts, 'optionalAccess', _289 => _289.push, 'call', _290 => _290(opened)]);
|
|
6812
6905
|
res.write(opened);
|
|
6813
6906
|
return split.body;
|
|
6814
6907
|
};
|
|
@@ -6884,7 +6977,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6884
6977
|
staticShellClosed = true;
|
|
6885
6978
|
if (!suspenseHoleEmitted) {
|
|
6886
6979
|
suspenseHoleEmitted = true;
|
|
6887
|
-
_optionalChain([options, 'access',
|
|
6980
|
+
_optionalChain([options, 'access', _291 => _291.onSuspenseHoleDetected, 'optionalCall', _292 => _292()]);
|
|
6888
6981
|
}
|
|
6889
6982
|
} else {
|
|
6890
6983
|
staticShellParts.push(chunkText);
|
|
@@ -6936,7 +7029,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6936
7029
|
const body = releaseShell(true);
|
|
6937
7030
|
if (body) {
|
|
6938
7031
|
htmlParts.push(body);
|
|
6939
|
-
_optionalChain([staticShellParts, 'optionalAccess',
|
|
7032
|
+
_optionalChain([staticShellParts, 'optionalAccess', _293 => _293.push, 'call', _294 => _294(body)]);
|
|
6940
7033
|
res.write(body);
|
|
6941
7034
|
}
|
|
6942
7035
|
}
|
|
@@ -6968,8 +7061,8 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6968
7061
|
recordRenderedChunk(tail, rewritten);
|
|
6969
7062
|
if (tail) res.write(tail);
|
|
6970
7063
|
}
|
|
6971
|
-
const documentEnd = _optionalChain([documentTransform, 'optionalAccess',
|
|
6972
|
-
if (_optionalChain([documentEnd, 'optionalAccess',
|
|
7064
|
+
const documentEnd = _optionalChain([documentTransform, 'optionalAccess', _295 => _295.end, 'call', _296 => _296()]);
|
|
7065
|
+
if (_optionalChain([documentEnd, 'optionalAccess', _297 => _297.text])) {
|
|
6973
7066
|
recordRenderedChunk(documentEnd.text, "");
|
|
6974
7067
|
res.write(documentEnd.text);
|
|
6975
7068
|
}
|
|
@@ -6980,7 +7073,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
6980
7073
|
deferredHydrationScript: createDeferredHydrationScript(deferredProps.records),
|
|
6981
7074
|
earlyClient,
|
|
6982
7075
|
// A full document: Farm's #root closes only where Farm opened it.
|
|
6983
|
-
..._optionalChain([documentEnd, 'optionalAccess',
|
|
7076
|
+
..._optionalChain([documentEnd, 'optionalAccess', _298 => _298.document]) ? { closeRoot: documentEnd.rootOpened } : {}
|
|
6984
7077
|
})
|
|
6985
7078
|
);
|
|
6986
7079
|
htmlParts.push(footer);
|
|
@@ -7082,17 +7175,25 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7082
7175
|
const snapshot = _chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
7083
7176
|
return snapshot && url.startsWith("/") && !url.startsWith("//") ? _chunkGYJT2U7Jcjs.localizeFarmHref.call(void 0, url, snapshot.locale, snapshot) : url;
|
|
7084
7177
|
}
|
|
7178
|
+
/**
|
|
7179
|
+
* The not-found page the renderer's `routes()` mapped, or undefined when the renderer has no route
|
|
7180
|
+
* rules and the not-found lookup scans `src/app` as before.
|
|
7181
|
+
*/
|
|
7182
|
+
getRendererNotFoundPath() {
|
|
7183
|
+
return _optionalChain([this, 'access', _299 => _299.config, 'access', _300 => _300.renderer, 'optionalAccess', _301 => _301.routes]) ? this.routeManager.getRendererNotFoundPath() : void 0;
|
|
7184
|
+
}
|
|
7085
7185
|
/** The app's not-found component, or null when it relies on the built-in page. */
|
|
7086
7186
|
async loadNotFoundModule() {
|
|
7087
7187
|
const notFoundPath = resolveFarmNotFoundComponentPath(
|
|
7088
7188
|
this.config,
|
|
7089
|
-
_chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, this.config)
|
|
7189
|
+
_chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, this.config),
|
|
7190
|
+
this.getRendererNotFoundPath()
|
|
7090
7191
|
);
|
|
7091
7192
|
if (!notFoundPath) return null;
|
|
7092
7193
|
return await this.routeManager.loadRouteModule(notFoundPath);
|
|
7093
7194
|
}
|
|
7094
7195
|
async loadNotFoundComponent() {
|
|
7095
|
-
return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async
|
|
7196
|
+
return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async _302 => _302.default]), async () => ( null));
|
|
7096
7197
|
}
|
|
7097
7198
|
/** The not-found document's head: layout and not-found metadata, as production renders it. */
|
|
7098
7199
|
async notFoundMetadataHead(layoutModule, notFoundModule) {
|
|
@@ -7121,7 +7222,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7121
7222
|
);
|
|
7122
7223
|
}
|
|
7123
7224
|
const pathname = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
7124
|
-
trustProxy: _optionalChain([this, 'access',
|
|
7225
|
+
trustProxy: _optionalChain([this, 'access', _303 => _303.config, 'access', _304 => _304.server, 'optionalAccess', _305 => _305.trustProxy])
|
|
7125
7226
|
}).pathname;
|
|
7126
7227
|
let content = this.defaultNotFoundContent();
|
|
7127
7228
|
const NotFoundComponent = await this.loadNotFoundComponent();
|
|
@@ -7141,9 +7242,9 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7141
7242
|
async render404(req, res) {
|
|
7142
7243
|
res.statusCode = 404;
|
|
7143
7244
|
const pathname = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
7144
|
-
trustProxy: _optionalChain([this, 'access',
|
|
7245
|
+
trustProxy: _optionalChain([this, 'access', _306 => _306.config, 'access', _307 => _307.server, 'optionalAccess', _308 => _308.trustProxy])
|
|
7145
7246
|
}).pathname;
|
|
7146
|
-
if (
|
|
7247
|
+
if (_chunkNGTZHWBGcjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) {
|
|
7147
7248
|
res.setHeader("Content-Type", "application/json");
|
|
7148
7249
|
res.end(JSON.stringify({ error: "Not found", pathname }));
|
|
7149
7250
|
return;
|
|
@@ -7166,11 +7267,11 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7166
7267
|
return;
|
|
7167
7268
|
}
|
|
7168
7269
|
const appDir = path10.join(this.config.root, this.config.srcDir, "app");
|
|
7169
|
-
const notFoundExtensions =
|
|
7270
|
+
const notFoundExtensions = _chunkNGTZHWBGcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
|
|
7170
7271
|
let layoutModule = null;
|
|
7272
|
+
const rendererRootLayout = _optionalChain([this, 'access', _309 => _309.config, 'access', _310 => _310.renderer, 'optionalAccess', _311 => _311.routes]) ? _optionalChain([this, 'access', _312 => _312.routeManager, 'access', _313 => _313.getLayouts, 'call', _314 => _314(), 'access', _315 => _315.get, 'call', _316 => _316("/"), 'optionalAccess', _317 => _317.modulePath]) : void 0;
|
|
7171
7273
|
try {
|
|
7172
|
-
for (const
|
|
7173
|
-
const layoutPath = path10.join(appDir, `layout${ext}`);
|
|
7274
|
+
for (const layoutPath of rendererRootLayout ? [rendererRootLayout] : notFoundExtensions.map((ext) => path10.join(appDir, `layout${ext}`))) {
|
|
7174
7275
|
if (fs7.existsSync(layoutPath)) {
|
|
7175
7276
|
layoutModule = await this.routeManager.loadLayoutModule(layoutPath);
|
|
7176
7277
|
break;
|
|
@@ -7178,13 +7279,14 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7178
7279
|
}
|
|
7179
7280
|
const notFoundPath = resolveFarmNotFoundComponentPath(
|
|
7180
7281
|
this.config,
|
|
7181
|
-
_chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, this.config)
|
|
7282
|
+
_chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, this.config),
|
|
7283
|
+
this.getRendererNotFoundPath()
|
|
7182
7284
|
);
|
|
7183
7285
|
if (notFoundPath) {
|
|
7184
7286
|
const notFoundModule = await this.loadNotFoundModule();
|
|
7185
|
-
const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess',
|
|
7287
|
+
const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess', _318 => _318.default]), () => ( null));
|
|
7186
7288
|
if (NotFoundComponent) {
|
|
7187
|
-
const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess',
|
|
7289
|
+
const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess', _319 => _319.default]), () => ( null));
|
|
7188
7290
|
let element = this.rendererRuntime.createElement(NotFoundComponent, { pathname });
|
|
7189
7291
|
if (LayoutComponent) {
|
|
7190
7292
|
element = this.rendererRuntime.createElement(LayoutComponent, {
|
|
@@ -7221,7 +7323,7 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7221
7323
|
res.statusCode = statusCode;
|
|
7222
7324
|
const isDev = process.env.NODE_ENV === "development";
|
|
7223
7325
|
const requestUrl = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
7224
|
-
trustProxy: _optionalChain([this, 'access',
|
|
7326
|
+
trustProxy: _optionalChain([this, 'access', _320 => _320.config, 'access', _321 => _321.server, 'optionalAccess', _322 => _322.trustProxy])
|
|
7225
7327
|
});
|
|
7226
7328
|
const diagnostics = isDev ? createDefaultErrorDiagnostics(error, this.config.root || process.cwd()) : void 0;
|
|
7227
7329
|
const statusText = _chunkNEKO3HM2cjs.getDefaultErrorStatusText.call(void 0, statusCode);
|
|
@@ -7232,12 +7334,12 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7232
7334
|
statusText,
|
|
7233
7335
|
requestPath: requestUrl.pathname,
|
|
7234
7336
|
method: req.method || "GET",
|
|
7235
|
-
message: _optionalChain([diagnostics, 'optionalAccess',
|
|
7236
|
-
errorName: _optionalChain([diagnostics, 'optionalAccess',
|
|
7237
|
-
stack: _optionalChain([diagnostics, 'optionalAccess',
|
|
7238
|
-
sourceFrame: _optionalChain([diagnostics, 'optionalAccess',
|
|
7337
|
+
message: _optionalChain([diagnostics, 'optionalAccess', _323 => _323.message]),
|
|
7338
|
+
errorName: _optionalChain([diagnostics, 'optionalAccess', _324 => _324.name]),
|
|
7339
|
+
stack: _optionalChain([diagnostics, 'optionalAccess', _325 => _325.stack]),
|
|
7340
|
+
sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _326 => _326.sourceFrame]),
|
|
7239
7341
|
development: isDev,
|
|
7240
|
-
farmVersion:
|
|
7342
|
+
farmVersion: _chunk3CZ4MJHWcjs.FARM_VERSION,
|
|
7241
7343
|
nodeVersion: process.version,
|
|
7242
7344
|
mode: isDev ? "development" : "production"
|
|
7243
7345
|
})
|
|
@@ -7263,9 +7365,9 @@ window.__FARM_I18N__ = ${_chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0
|
|
|
7263
7365
|
*/
|
|
7264
7366
|
getI18nAlternateOptions(req, metadata) {
|
|
7265
7367
|
return {
|
|
7266
|
-
metadataBase: _optionalChain([metadata, 'optionalAccess',
|
|
7267
|
-
origin: req ? _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access',
|
|
7268
|
-
languages: _optionalChain([metadata, 'optionalAccess',
|
|
7368
|
+
metadataBase: _optionalChain([metadata, 'optionalAccess', _327 => _327.metadataBase]),
|
|
7369
|
+
origin: req ? _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _328 => _328.config, 'access', _329 => _329.server, 'optionalAccess', _330 => _330.trustProxy]) }).origin : void 0,
|
|
7370
|
+
languages: _optionalChain([metadata, 'optionalAccess', _331 => _331.alternates, 'optionalAccess', _332 => _332.languages])
|
|
7269
7371
|
};
|
|
7270
7372
|
}
|
|
7271
7373
|
createFullHTML(content, isClientComponent = false, requestPath = "/", metadataHead, alternates = {}) {
|
|
@@ -7291,9 +7393,9 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
|
|
|
7291
7393
|
);
|
|
7292
7394
|
themeDocument.head = farmScripts(themeDocument.head);
|
|
7293
7395
|
const rendererHydrationScript = farmScripts(
|
|
7294
|
-
_optionalChain([this, 'access',
|
|
7396
|
+
_optionalChain([this, 'access', _333 => _333.rendererRuntime, 'access', _334 => _334.generateHydrationScript, 'optionalCall', _335 => _335()]) || ""
|
|
7295
7397
|
);
|
|
7296
|
-
const viewportTags = _chunkY3DO7BIJcjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access',
|
|
7398
|
+
const viewportTags = _chunkY3DO7BIJcjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access', _336 => _336.metadata, 'optionalAccess', _337 => _337.viewport]));
|
|
7297
7399
|
const fullDocument = _chunkNEKO3HM2cjs.extractFarmFullDocument.call(void 0, _chunkNEKO3HM2cjs.markFarmDocumentLayouts.call(void 0, content));
|
|
7298
7400
|
if (fullDocument) {
|
|
7299
7401
|
return _chunkNEKO3HM2cjs.composeFarmFullDocument.call(void 0,
|
|
@@ -7323,7 +7425,7 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
|
|
|
7323
7425
|
);
|
|
7324
7426
|
}
|
|
7325
7427
|
return `<!DOCTYPE html>
|
|
7326
|
-
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
7428
|
+
<html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _338 => _338.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
|
|
7327
7429
|
<head>
|
|
7328
7430
|
${themeDocument.head}
|
|
7329
7431
|
<meta charset="utf-8">
|
|
@@ -7364,7 +7466,7 @@ ${clientScript}
|
|
|
7364
7466
|
const deploymentId = this.getDeploymentId();
|
|
7365
7467
|
res.setHeader(_chunkNLBHLPEOcjs.FARM_DEPLOYMENT_ID_HEADER, deploymentId);
|
|
7366
7468
|
if ((req.method || "GET").toUpperCase() !== "GET") return;
|
|
7367
|
-
const isSecure = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access',
|
|
7469
|
+
const isSecure = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _339 => _339.config, 'access', _340 => _340.server, 'optionalAccess', _341 => _341.trustProxy]) }).protocol === "https:";
|
|
7368
7470
|
const cookie = _chunkNLBHLPEOcjs.createFarmDeploymentCookie.call(void 0, deploymentId, this.config.basePath || "/", isSecure);
|
|
7369
7471
|
const existing = res.getHeader("Set-Cookie");
|
|
7370
7472
|
if (Array.isArray(existing)) {
|
|
@@ -7427,7 +7529,7 @@ var FarmApp = class {
|
|
|
7427
7529
|
await this.serverRenderer.initialize();
|
|
7428
7530
|
await this.verifyAppStructure();
|
|
7429
7531
|
await this.routeManager.discoverRoutes();
|
|
7430
|
-
if (
|
|
7532
|
+
if (_chunkNGTZHWBGcjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) this.assertNoPageRoutes();
|
|
7431
7533
|
this.routeManager.generateClientManifest(this.config.root);
|
|
7432
7534
|
if (process.env.FARM_VERBOSE) {
|
|
7433
7535
|
_chunk7U4XF76Rcjs.logger.success("Farm.js application initialized successfully!");
|
|
@@ -7456,13 +7558,13 @@ var FarmApp = class {
|
|
|
7456
7558
|
outDir: config.outDir || "dist",
|
|
7457
7559
|
basePath,
|
|
7458
7560
|
trailingSlash: _nullishCoalesce(config.trailingSlash, () => ( false)),
|
|
7459
|
-
renderer:
|
|
7561
|
+
renderer: _chunkNGTZHWBGcjs.resolveFarmRenderer.call(void 0, config.renderer),
|
|
7460
7562
|
preset: _nullishCoalesce(config.preset, () => ( "node-server")),
|
|
7461
7563
|
deploy: config.deploy || {},
|
|
7462
7564
|
storage: config.storage || {},
|
|
7463
7565
|
schema: config.schema || {},
|
|
7464
7566
|
cache: config.cache || {},
|
|
7465
|
-
auth: isResolvedAuthConfig(config.auth) ? config.auth :
|
|
7567
|
+
auth: isResolvedAuthConfig(config.auth) ? config.auth : _chunkL2GUEYHRcjs.resolveFarmAuthConfig.call(void 0, config.auth),
|
|
7466
7568
|
integrations: config.integrations || {},
|
|
7467
7569
|
plugins: config.plugins || [],
|
|
7468
7570
|
migrations: config.migrations || { commands: [] },
|
|
@@ -7477,7 +7579,7 @@ var FarmApp = class {
|
|
|
7477
7579
|
security: _chunk6JHZPB52cjs.resolveFarmSecurityConfig.call(void 0, config.security),
|
|
7478
7580
|
images: _chunkMCSRMEQVcjs.resolveFarmImageConfig.call(void 0,
|
|
7479
7581
|
config.images,
|
|
7480
|
-
|
|
7582
|
+
_chunkNGTZHWBGcjs.isFarmRendererDisabled.call(void 0, config.renderer) ? "none" : void 0
|
|
7481
7583
|
),
|
|
7482
7584
|
performance: _chunkEACD6ND7cjs.resolveFarmPerformanceConfig.call(void 0, config.performance),
|
|
7483
7585
|
theme: _chunkWT6RAN2Icjs.resolveFarmThemeConfig.call(void 0, config.theme, basePath),
|
|
@@ -7500,17 +7602,17 @@ var FarmApp = class {
|
|
|
7500
7602
|
config.devtools,
|
|
7501
7603
|
process.env.NODE_ENV === "production" ? "production" : "development"
|
|
7502
7604
|
),
|
|
7503
|
-
devIndicators:
|
|
7605
|
+
devIndicators: _chunkL2GUEYHRcjs.resolveFarmDevIndicatorsConfig.call(void 0,
|
|
7504
7606
|
config.devIndicators,
|
|
7505
7607
|
process.env.NODE_ENV === "production" ? "production" : "development"
|
|
7506
7608
|
),
|
|
7507
7609
|
env: config.env || { server: {}, public: {} },
|
|
7508
7610
|
suppressLintOnLink: _nullishCoalesce(config.suppressLintOnLink, () => ( false)),
|
|
7509
7611
|
experimental: {
|
|
7510
|
-
serverComponents: _nullishCoalesce(_optionalChain([config, 'access',
|
|
7511
|
-
serverActions: _nullishCoalesce(_optionalChain([config, 'access',
|
|
7512
|
-
isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access',
|
|
7513
|
-
ppr: _nullishCoalesce(_optionalChain([config, 'access',
|
|
7612
|
+
serverComponents: _nullishCoalesce(_optionalChain([config, 'access', _342 => _342.experimental, 'optionalAccess', _343 => _343.serverComponents]), () => ( false)),
|
|
7613
|
+
serverActions: _nullishCoalesce(_optionalChain([config, 'access', _344 => _344.experimental, 'optionalAccess', _345 => _345.serverActions]), () => ( false)),
|
|
7614
|
+
isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access', _346 => _346.experimental, 'optionalAccess', _347 => _347.isolatedClientHydration]), () => ( "off")),
|
|
7615
|
+
ppr: _nullishCoalesce(_optionalChain([config, 'access', _348 => _348.experimental, 'optionalAccess', _349 => _349.ppr]), () => ( false)),
|
|
7514
7616
|
...config.experimental
|
|
7515
7617
|
},
|
|
7516
7618
|
agent: _nullishCoalesce(config.agent, () => ( {})),
|
|
@@ -7530,6 +7632,7 @@ var FarmApp = class {
|
|
|
7530
7632
|
);
|
|
7531
7633
|
}
|
|
7532
7634
|
async verifyAppStructure() {
|
|
7635
|
+
if (typeof _optionalChain([this, 'access', _350 => _350.config, 'access', _351 => _351.renderer, 'optionalAccess', _352 => _352.routes]) === "function") return;
|
|
7533
7636
|
const appDirs = _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, this.config);
|
|
7534
7637
|
const hasAppDirectory = (await Promise.all(appDirs.map((appDir) => _chunk7U4XF76Rcjs.fileExists.call(void 0, appDir)))).some(
|
|
7535
7638
|
Boolean
|
|
@@ -7546,14 +7649,14 @@ var FarmApp = class {
|
|
|
7546
7649
|
`App directory not found at ${appDir}. Please create a src/app directory or extend a Farm layer containing routes.`
|
|
7547
7650
|
);
|
|
7548
7651
|
}
|
|
7549
|
-
const componentExtensions =
|
|
7652
|
+
const componentExtensions = _chunkNGTZHWBGcjs.getFarmRendererComponentExtensions.call(void 0, this.config.renderer);
|
|
7550
7653
|
const rootLayoutPaths = appDirs.flatMap(
|
|
7551
7654
|
(appDir) => componentExtensions.map((extension) => path4.default.join(appDir, `layout${extension}`))
|
|
7552
7655
|
);
|
|
7553
7656
|
const hasRootLayout = await Promise.all(rootLayoutPaths.map((p) => _chunk7U4XF76Rcjs.fileExists.call(void 0, p))).then(
|
|
7554
7657
|
(results) => results.some(Boolean)
|
|
7555
7658
|
);
|
|
7556
|
-
if (!hasRootLayout && !
|
|
7659
|
+
if (!hasRootLayout && !_chunkNGTZHWBGcjs.isFarmRendererDisabled.call(void 0, this.config.renderer)) {
|
|
7557
7660
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
7558
7661
|
`No root layout found. Consider creating src/app/layout${componentExtensions[0]} for consistent page structure.`
|
|
7559
7662
|
);
|
|
@@ -7569,7 +7672,7 @@ function isResolvedAuthConfig(value) {
|
|
|
7569
7672
|
);
|
|
7570
7673
|
}
|
|
7571
7674
|
function normalizeFarmAppAPIConfig(config) {
|
|
7572
|
-
if (typeof _optionalChain([config, 'optionalAccess',
|
|
7675
|
+
if (typeof _optionalChain([config, 'optionalAccess', _353 => _353.baseURL]) === "function" || typeof _optionalChain([config, 'optionalAccess', _354 => _354.basePath]) === "function") {
|
|
7573
7676
|
throw new Error(
|
|
7574
7677
|
"Farm API config resolver functions must be processed with resolveConfig() before creating a FarmApp."
|
|
7575
7678
|
);
|
|
@@ -7584,7 +7687,7 @@ function createFarmApp(config, viteServer) {
|
|
|
7584
7687
|
var SHARP_INSTALL_HINT = _chunkKORZ6PREcjs.formatOptionalPeerInstallHint.call(void 0, "sharp", "optimize images");
|
|
7585
7688
|
var CLOUDFLARE_IMAGE_PRESETS = /* @__PURE__ */ new Set(["cloudflare", "cloudflare-pages", "cloudflare-module"]);
|
|
7586
7689
|
function resolveFarmImageProviderForRuntime(images, options) {
|
|
7587
|
-
const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess',
|
|
7690
|
+
const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess', _355 => _355.provider]), () => ( "auto"));
|
|
7588
7691
|
if (provider === "none") return images;
|
|
7589
7692
|
const usesSharp = options.dev ? true : provider === "node" || provider === "auto" && !CLOUDFLARE_IMAGE_PRESETS.has(options.preset || "");
|
|
7590
7693
|
if (!usesSharp || _chunkKORZ6PREcjs.isOptionalPeerInstalled.call(void 0, options.root, "sharp")) return images;
|
|
@@ -7725,9 +7828,9 @@ function staticValue(node) {
|
|
|
7725
7828
|
}
|
|
7726
7829
|
}
|
|
7727
7830
|
function property(object, name) {
|
|
7728
|
-
return _optionalChain([object, 'access',
|
|
7831
|
+
return _optionalChain([object, 'access', _356 => _356.properties, 'access', _357 => _357.find, 'call', _358 => _358(
|
|
7729
7832
|
(entry) => entry.type === "Property" && !entry.computed && (entry.key.name === name || entry.key.value === name)
|
|
7730
|
-
), 'optionalAccess',
|
|
7833
|
+
), 'optionalAccess', _359 => _359.value]);
|
|
7731
7834
|
}
|
|
7732
7835
|
function toolFromObject(object) {
|
|
7733
7836
|
const name = staticValue(property(object, "name"));
|
|
@@ -7773,7 +7876,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
|
|
|
7773
7876
|
if (statement.type !== "ImportDeclaration" || statement.source.value !== WEBMCP_CLIENT)
|
|
7774
7877
|
continue;
|
|
7775
7878
|
for (const specifier of statement.specifiers) {
|
|
7776
|
-
const imported = _nullishCoalesce(_optionalChain([specifier, 'access',
|
|
7879
|
+
const imported = _nullishCoalesce(_optionalChain([specifier, 'access', _360 => _360.imported, 'optionalAccess', _361 => _361.name]), () => ( _optionalChain([specifier, 'access', _362 => _362.imported, 'optionalAccess', _363 => _363.value])));
|
|
7777
7880
|
if (specifier.type === "ImportSpecifier" && DEFINERS.has(imported))
|
|
7778
7881
|
locals.set(specifier.local.name, imported);
|
|
7779
7882
|
}
|
|
@@ -7789,7 +7892,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
|
|
|
7789
7892
|
const [argument] = current.arguments;
|
|
7790
7893
|
if (definer && argument) {
|
|
7791
7894
|
const objects = definer === "registerWebMCPTools" ? argument.type === "ArrayExpression" ? argument.elements.filter(
|
|
7792
|
-
(element) => _optionalChain([element, 'optionalAccess',
|
|
7895
|
+
(element) => _optionalChain([element, 'optionalAccess', _364 => _364.type]) === "ObjectExpression"
|
|
7793
7896
|
) : [] : argument.type === "ObjectExpression" ? [argument] : [];
|
|
7794
7897
|
for (const object of objects) {
|
|
7795
7898
|
const tool = toolFromObject(object);
|
|
@@ -7850,8 +7953,8 @@ function collectFarmWebMCPTools(root, srcDir = "src") {
|
|
|
7850
7953
|
|
|
7851
7954
|
var ADAPTER_EXTENSIONS = ["ts", "tsx", "js", "jsx", "mts", "mjs"];
|
|
7852
7955
|
function resolveFarmClientCacheAdapterEntry(root, cache2) {
|
|
7853
|
-
const client = _optionalChain([cache2, 'optionalAccess',
|
|
7854
|
-
const adapter = _optionalChain([client, 'optionalAccess',
|
|
7956
|
+
const client = _optionalChain([cache2, 'optionalAccess', _365 => _365.client]);
|
|
7957
|
+
const adapter = _optionalChain([client, 'optionalAccess', _366 => _366.adapter]);
|
|
7855
7958
|
if (adapter === void 0) return void 0;
|
|
7856
7959
|
if (typeof adapter !== "string" || adapter.trim().length === 0) {
|
|
7857
7960
|
throw new Error(
|
|
@@ -7866,8 +7969,8 @@ function resolveFarmClientCacheAdapterEntry(root, cache2) {
|
|
|
7866
7969
|
);
|
|
7867
7970
|
}
|
|
7868
7971
|
const options = {};
|
|
7869
|
-
if (_optionalChain([client, 'optionalAccess',
|
|
7870
|
-
if (_optionalChain([client, 'optionalAccess',
|
|
7972
|
+
if (_optionalChain([client, 'optionalAccess', _367 => _367.version]) !== void 0) options.version = client.version;
|
|
7973
|
+
if (_optionalChain([client, 'optionalAccess', _368 => _368.flushDelayMs]) !== void 0) options.flushDelayMs = client.flushDelayMs;
|
|
7871
7974
|
return { importPath: found.replace(/\\/g, "/"), options };
|
|
7872
7975
|
}
|
|
7873
7976
|
function resolveAdapterFile(resolved) {
|
|
@@ -8325,8 +8428,8 @@ function redactFarmDocsClientConfig(code, filename) {
|
|
|
8325
8428
|
const current = node;
|
|
8326
8429
|
if (current.type === "Property") {
|
|
8327
8430
|
const name = propertyKeyName(current);
|
|
8328
|
-
const valueType = _optionalChain([current, 'access',
|
|
8329
|
-
const credential = name !== void 0 && (name.toLowerCase() === "headers" ||
|
|
8431
|
+
const valueType = _optionalChain([current, 'access', _369 => _369.value, 'optionalAccess', _370 => _370.type]);
|
|
8432
|
+
const credential = name !== void 0 && (name.toLowerCase() === "headers" || _chunkXJDB564Acjs.isSecretDocsConfigKey.call(void 0, name) && valueType !== "ObjectExpression" && valueType !== "ArrayExpression");
|
|
8330
8433
|
if (name && credential) {
|
|
8331
8434
|
edits.push(
|
|
8332
8435
|
current.shorthand || current.method || current.kind !== "init" ? { start: current.start, end: current.end, text: `${JSON.stringify(name)}: undefined` } : {
|
|
@@ -8368,7 +8471,7 @@ function farmDocsClientConfigPlugin(configModule) {
|
|
|
8368
8471
|
// Never matches without a docs config module, so the bundler never calls the handler.
|
|
8369
8472
|
filter: { id: configModule ? fileNamePattern([configModule]) : /(?!)/ },
|
|
8370
8473
|
handler(code, id, options) {
|
|
8371
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
8474
|
+
if (_optionalChain([options, 'optionalAccess', _371 => _371.ssr]) || !isFarmDocsClientConfigModule(id, configModule)) return null;
|
|
8372
8475
|
const redacted = redactFarmDocsClientConfig(code, id.split("?")[0]);
|
|
8373
8476
|
return redacted === null ? null : { code: redacted, map: null };
|
|
8374
8477
|
}
|
|
@@ -8471,13 +8574,13 @@ function getFarmClientOptimizeDepsInclude(renderer, root) {
|
|
|
8471
8574
|
return Array.from(
|
|
8472
8575
|
/* @__PURE__ */ new Set([
|
|
8473
8576
|
...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE,
|
|
8474
|
-
..._optionalChain([renderer, 'optionalAccess',
|
|
8577
|
+
..._optionalChain([renderer, 'optionalAccess', _372 => _372.optimizeDeps]) || [],
|
|
8475
8578
|
// Farm's browser entry imports a renderer's client module, and no app file does, so Vite's
|
|
8476
8579
|
// scan never sees it and finds it only on the first page request, then bundles again. The
|
|
8477
8580
|
// React entry imports `react-dom/client` instead, which is already listed. A linked
|
|
8478
8581
|
// renderer stays source: pre-bundling it would copy the packages it shares with the app's
|
|
8479
8582
|
// components into the bundle, so a hook would read a different copy than the renderer set.
|
|
8480
|
-
...renderer && root && !
|
|
8583
|
+
...renderer && root && !_chunkNGTZHWBGcjs.isReactRenderer.call(void 0, renderer) && _chunkPWDBWXQIcjs.isPackageSpecifier.call(void 0, renderer.client) && isInstalledPackage(root, renderer.client) ? [renderer.client] : []
|
|
8481
8584
|
])
|
|
8482
8585
|
);
|
|
8483
8586
|
}
|
|
@@ -8490,7 +8593,7 @@ function createFarmClientOptimizeDepsEntries(projectRoot, appDirectories) {
|
|
|
8490
8593
|
});
|
|
8491
8594
|
}
|
|
8492
8595
|
function createFarmClientOptimizeDepsConfig(entries, renderer, root) {
|
|
8493
|
-
if (
|
|
8596
|
+
if (_chunkNGTZHWBGcjs.isFarmRendererDisabled.call(void 0, renderer)) return { noDiscovery: true, include: [] };
|
|
8494
8597
|
const jsxImportSource = renderer ? renderer.jsxImportSource : void 0;
|
|
8495
8598
|
return {
|
|
8496
8599
|
// Keep normal application dependency discovery for CJS-only packages, but
|
|
@@ -8503,7 +8606,7 @@ function createFarmClientOptimizeDepsConfig(entries, renderer, root) {
|
|
|
8503
8606
|
// Farm's HTML boots through a virtual module and imports route UI lazily.
|
|
8504
8607
|
// Explicit entries let Vite finish that crawl before a navigation can
|
|
8505
8608
|
// rotate the optimizer hash underneath a hydrated React runtime.
|
|
8506
|
-
..._optionalChain([entries, 'optionalAccess',
|
|
8609
|
+
..._optionalChain([entries, 'optionalAccess', _373 => _373.length]) ? { entries: [...entries] } : {},
|
|
8507
8610
|
// Vite's dependency scan compiles JSX on its own: with the app tsconfig's `jsxImportSource`
|
|
8508
8611
|
// when there is one, otherwise as React, whatever the renderer's plugin set for its own
|
|
8509
8612
|
// transforms. React is the default already, and naming it here would override a tsconfig
|
|
@@ -8544,8 +8647,8 @@ function mergeFarmViteAlias(farmValue, userValue) {
|
|
|
8544
8647
|
return [...userEntries, ...normalize(farmValue).filter((entry) => !userNames.has(entry.find))];
|
|
8545
8648
|
}
|
|
8546
8649
|
function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
8547
|
-
const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access',
|
|
8548
|
-
const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access',
|
|
8650
|
+
const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _374 => _374.optimizeDeps, 'optionalAccess', _375 => _375.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _376 => _376.optimizeDeps, 'optionalAccess', _377 => _377.noDiscovery])));
|
|
8651
|
+
const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access', _378 => _378.optimizeDeps, 'optionalAccess', _379 => _379.holdUntilCrawlEnd]), () => ( (_optionalChain([userConfig, 'access', _380 => _380.optimizeDeps, 'optionalAccess', _381 => _381.noDiscovery]) === true ? false : _optionalChain([farmConfig, 'access', _382 => _382.optimizeDeps, 'optionalAccess', _383 => _383.holdUntilCrawlEnd]))));
|
|
8549
8652
|
return {
|
|
8550
8653
|
...farmConfig,
|
|
8551
8654
|
...userConfig,
|
|
@@ -8557,9 +8660,9 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
|
8557
8660
|
resolve: {
|
|
8558
8661
|
...farmConfig.resolve,
|
|
8559
8662
|
...userConfig.resolve,
|
|
8560
|
-
alias: mergeFarmViteAlias(_optionalChain([farmConfig, 'access',
|
|
8663
|
+
alias: mergeFarmViteAlias(_optionalChain([farmConfig, 'access', _384 => _384.resolve, 'optionalAccess', _385 => _385.alias]), _optionalChain([userConfig, 'access', _386 => _386.resolve, 'optionalAccess', _387 => _387.alias])),
|
|
8561
8664
|
dedupe: Array.from(
|
|
8562
|
-
/* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access',
|
|
8665
|
+
/* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _388 => _388.resolve, 'optionalAccess', _389 => _389.dedupe]) || [], ..._optionalChain([userConfig, 'access', _390 => _390.resolve, 'optionalAccess', _391 => _391.dedupe]) || []])
|
|
8563
8666
|
)
|
|
8564
8667
|
},
|
|
8565
8668
|
optimizeDeps: {
|
|
@@ -8569,21 +8672,21 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
|
|
|
8569
8672
|
holdUntilCrawlEnd,
|
|
8570
8673
|
include: Array.from(
|
|
8571
8674
|
/* @__PURE__ */ new Set([
|
|
8572
|
-
..._optionalChain([farmConfig, 'access',
|
|
8573
|
-
..._optionalChain([userConfig, 'access',
|
|
8675
|
+
..._optionalChain([farmConfig, 'access', _392 => _392.optimizeDeps, 'optionalAccess', _393 => _393.include]) || [],
|
|
8676
|
+
..._optionalChain([userConfig, 'access', _394 => _394.optimizeDeps, 'optionalAccess', _395 => _395.include]) || []
|
|
8574
8677
|
])
|
|
8575
8678
|
),
|
|
8576
8679
|
exclude: Array.from(
|
|
8577
8680
|
/* @__PURE__ */ new Set([
|
|
8578
|
-
..._optionalChain([farmConfig, 'access',
|
|
8579
|
-
..._optionalChain([userConfig, 'access',
|
|
8681
|
+
..._optionalChain([farmConfig, 'access', _396 => _396.optimizeDeps, 'optionalAccess', _397 => _397.exclude]) || [],
|
|
8682
|
+
..._optionalChain([userConfig, 'access', _398 => _398.optimizeDeps, 'optionalAccess', _399 => _399.exclude]) || []
|
|
8580
8683
|
])
|
|
8581
8684
|
)
|
|
8582
8685
|
},
|
|
8583
8686
|
ssr: {
|
|
8584
8687
|
...farmConfig.ssr,
|
|
8585
8688
|
...userConfig.ssr,
|
|
8586
|
-
noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access',
|
|
8689
|
+
noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access', _400 => _400.ssr, 'optionalAccess', _401 => _401.noExternal]), _optionalChain([userConfig, 'access', _402 => _402.ssr, 'optionalAccess', _403 => _403.noExternal]))
|
|
8587
8690
|
}
|
|
8588
8691
|
};
|
|
8589
8692
|
}
|
|
@@ -8654,8 +8757,8 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}, options = {}
|
|
|
8654
8757
|
...userRolldownOptions
|
|
8655
8758
|
};
|
|
8656
8759
|
const merged = mergeFarmViteConfig(farmConfig, shared);
|
|
8657
|
-
const farmBundlerOptions = _optionalChain([farmConfig, 'access',
|
|
8658
|
-
const output = options.clientOutput ? mergeFarmClientOutputOptions(_optionalChain([farmBundlerOptions, 'optionalAccess',
|
|
8760
|
+
const farmBundlerOptions = _optionalChain([farmConfig, 'access', _404 => _404.build, 'optionalAccess', _405 => _405.rollupOptions]);
|
|
8761
|
+
const output = options.clientOutput ? mergeFarmClientOutputOptions(_optionalChain([farmBundlerOptions, 'optionalAccess', _406 => _406.output]), userOutput) : _optionalChain([farmBundlerOptions, 'optionalAccess', _407 => _407.output]);
|
|
8659
8762
|
return {
|
|
8660
8763
|
...merged,
|
|
8661
8764
|
build: {
|
|
@@ -8672,7 +8775,7 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}, options = {}
|
|
|
8672
8775
|
esbuild: typeof userEsbuild === "object" && farmConfig.esbuild !== false ? { ...userEsbuild, ...farmConfig.esbuild } : _nullishCoalesce(farmConfig.esbuild, () => ( userEsbuild)),
|
|
8673
8776
|
ssr: {
|
|
8674
8777
|
...merged.ssr,
|
|
8675
|
-
external: mergeExternal(_optionalChain([farmConfig, 'access',
|
|
8778
|
+
external: mergeExternal(_optionalChain([farmConfig, 'access', _408 => _408.ssr, 'optionalAccess', _409 => _409.external]), _optionalChain([userConfig, 'access', _410 => _410.ssr, 'optionalAccess', _411 => _411.external]))
|
|
8676
8779
|
}
|
|
8677
8780
|
};
|
|
8678
8781
|
}
|