@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
|
@@ -43,7 +43,7 @@ var _chunkRDADQG5Scjs = require('./chunk-RDADQG5S.cjs');
|
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
|
|
46
|
-
var
|
|
46
|
+
var _chunkJHRJ5V2Fcjs = require('./chunk-JHRJ5V2F.cjs');
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
|
|
@@ -55,7 +55,7 @@ var _chunkVACYUMXWcjs = require('./chunk-VACYUMXW.cjs');
|
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
|
|
58
|
-
var
|
|
58
|
+
var _chunkHRH7OKBQcjs = require('./chunk-HRH7OKBQ.cjs');
|
|
59
59
|
|
|
60
60
|
|
|
61
61
|
var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
@@ -73,7 +73,7 @@ var _chunkNEKO3HM2cjs = require('./chunk-NEKO3HM2.cjs');
|
|
|
73
73
|
var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
|
|
74
74
|
|
|
75
75
|
|
|
76
|
-
var
|
|
76
|
+
var _chunkOM6JIIJUcjs = require('./chunk-OM6JIIJU.cjs');
|
|
77
77
|
|
|
78
78
|
|
|
79
79
|
|
|
@@ -88,13 +88,13 @@ var _chunkCD5Z7RR5cjs = require('./chunk-CD5Z7RR5.cjs');
|
|
|
88
88
|
|
|
89
89
|
|
|
90
90
|
|
|
91
|
-
var
|
|
91
|
+
var _chunkWCSBYQOTcjs = require('./chunk-WCSBYQOT.cjs');
|
|
92
92
|
|
|
93
93
|
|
|
94
94
|
var _chunkW53Z4WDIcjs = require('./chunk-W53Z4WDI.cjs');
|
|
95
95
|
|
|
96
96
|
|
|
97
|
-
var
|
|
97
|
+
var _chunkIABI62FHcjs = require('./chunk-IABI62FH.cjs');
|
|
98
98
|
|
|
99
99
|
|
|
100
100
|
|
|
@@ -145,18 +145,20 @@ var _chunk7EPYN7GWcjs = require('./chunk-7EPYN7GW.cjs');
|
|
|
145
145
|
|
|
146
146
|
|
|
147
147
|
|
|
148
|
-
var
|
|
148
|
+
var _chunkEFI6QWBQcjs = require('./chunk-EFI6QWBQ.cjs');
|
|
149
149
|
|
|
150
150
|
|
|
151
151
|
|
|
152
|
-
var
|
|
152
|
+
var _chunkXJDB564Acjs = require('./chunk-XJDB564A.cjs');
|
|
153
153
|
|
|
154
154
|
|
|
155
155
|
|
|
156
156
|
var _chunkERMUL73Lcjs = require('./chunk-ERMUL73L.cjs');
|
|
157
157
|
|
|
158
158
|
|
|
159
|
-
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
var _chunkL2GUEYHRcjs = require('./chunk-L2GUEYHR.cjs');
|
|
160
162
|
|
|
161
163
|
|
|
162
164
|
var _chunkIIHZ2BEEcjs = require('./chunk-IIHZ2BEE.cjs');
|
|
@@ -190,7 +192,7 @@ var _chunk52Q4OB4Acjs = require('./chunk-52Q4OB4A.cjs');
|
|
|
190
192
|
|
|
191
193
|
|
|
192
194
|
|
|
193
|
-
var
|
|
195
|
+
var _chunkNGTZHWBGcjs = require('./chunk-NGTZHWBG.cjs');
|
|
194
196
|
|
|
195
197
|
|
|
196
198
|
|
|
@@ -310,7 +312,7 @@ var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
|
|
|
310
312
|
var _chunkPLJMEUANcjs = require('./chunk-PLJMEUAN.cjs');
|
|
311
313
|
|
|
312
314
|
|
|
313
|
-
var
|
|
315
|
+
var _chunk3CZ4MJHWcjs = require('./chunk-3CZ4MJHW.cjs');
|
|
314
316
|
|
|
315
317
|
|
|
316
318
|
var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
|
|
@@ -711,7 +713,7 @@ function findClientServerFnViolation(code, id) {
|
|
|
711
713
|
return null;
|
|
712
714
|
}
|
|
713
715
|
function createServerFnBoundaryDiagnostic(violation, id, location) {
|
|
714
|
-
return
|
|
716
|
+
return _chunkEFI6QWBQcjs.createFarmDiagnostic.call(void 0,
|
|
715
717
|
"CLIENT_SERVER_FUNCTION",
|
|
716
718
|
id,
|
|
717
719
|
`${violation.factory} handlers run only on the server, but this module is bundled into the client, so the handler and its Node-only imports would run in the browser.`,
|
|
@@ -970,21 +972,21 @@ function readPropertyKey(property) {
|
|
|
970
972
|
function createClientBoundaryDiagnostic(file, finding, location) {
|
|
971
973
|
switch (finding.kind) {
|
|
972
974
|
case "server-env":
|
|
973
|
-
return
|
|
975
|
+
return _chunkEFI6QWBQcjs.createFarmDiagnostic.call(void 0,
|
|
974
976
|
"CLIENT_SERVER_ENV",
|
|
975
977
|
file,
|
|
976
978
|
`process.env.${finding.name} is read at module scope in a module compiled for the browser, where it is undefined.`,
|
|
977
979
|
location
|
|
978
980
|
);
|
|
979
981
|
case "public-env":
|
|
980
|
-
return
|
|
982
|
+
return _chunkEFI6QWBQcjs.createFarmDiagnostic.call(void 0,
|
|
981
983
|
"CLIENT_PROCESS_ENV_PUBLIC",
|
|
982
984
|
file,
|
|
983
985
|
`process.env.${finding.name} is declared public, but process.env is not populated in the browser, so this module-scope read is undefined there.`,
|
|
984
986
|
location
|
|
985
987
|
);
|
|
986
988
|
case "builtin":
|
|
987
|
-
return
|
|
989
|
+
return _chunkEFI6QWBQcjs.createFarmDiagnostic.call(void 0,
|
|
988
990
|
"CLIENT_NODE_BUILTIN",
|
|
989
991
|
file,
|
|
990
992
|
`"${finding.name}" is imported into a module compiled for the browser, which gets a stub whose exports without a Web API equivalent are undefined.`,
|
|
@@ -1286,7 +1288,7 @@ function loadFarmWorkflowsDevRuntime() {
|
|
|
1286
1288
|
return import("./workflows.cjs");
|
|
1287
1289
|
}
|
|
1288
1290
|
function loadFarmDevtoolsSnapshotRuntime() {
|
|
1289
|
-
return import("./devtools-
|
|
1291
|
+
return import("./devtools-ZM2AR36W.cjs");
|
|
1290
1292
|
}
|
|
1291
1293
|
function loadFarmDevtoolsUIRuntime() {
|
|
1292
1294
|
return import("./devtools-ui-C2EMF2SO.cjs");
|
|
@@ -1311,7 +1313,7 @@ function farmI18nClientBridgePlugin() {
|
|
|
1311
1313
|
};
|
|
1312
1314
|
}
|
|
1313
1315
|
function farmNavigationPlugin(renderer) {
|
|
1314
|
-
const otherRenderer = !
|
|
1316
|
+
const otherRenderer = !_chunkNGTZHWBGcjs.isFarmRendererDisabled.call(void 0, renderer) && !_chunkNGTZHWBGcjs.isReactRenderer.call(void 0, renderer || void 0) && _optionalChain([(renderer || void 0), 'optionalAccess', _69 => _69.name]) !== "preact";
|
|
1315
1317
|
return {
|
|
1316
1318
|
name: "farm:navigation",
|
|
1317
1319
|
config() {
|
|
@@ -1336,16 +1338,16 @@ var FARM_SERVER_ONLY_PACKAGE_ID = "\0farm:server-only";
|
|
|
1336
1338
|
var FARM_PLATFORM_ENTRY = "@farm.js/core/platform";
|
|
1337
1339
|
var FARM_PLATFORM_CLIENT_ID = "\0farm:platform-client";
|
|
1338
1340
|
var FARM_SERVER_ONLY_ENTRIES_RESOLVE_FILTER = [
|
|
1339
|
-
|
|
1340
|
-
new RegExp(`^${
|
|
1341
|
+
_chunkJHRJ5V2Fcjs.exactIdPattern.call(void 0, [FARM_PLATFORM_ENTRY, SERVER_ONLY_PACKAGE, ...FARM_SERVER_ONLY_ENTRIES]),
|
|
1342
|
+
new RegExp(`^${_chunkEFI6QWBQcjs.FARM_RESOLVE_FROM_PREFIX}`),
|
|
1341
1343
|
// What isBuiltin() accepts: `node:` ids and the builtin names, subpaths such as fs/promises
|
|
1342
1344
|
// included.
|
|
1343
1345
|
/^node:/,
|
|
1344
|
-
|
|
1346
|
+
_chunkJHRJ5V2Fcjs.exactIdPattern.call(void 0, _module.builtinModules)
|
|
1345
1347
|
];
|
|
1346
1348
|
var FARM_SERVER_ONLY_ENTRIES_LOAD_FILTER = [
|
|
1347
|
-
|
|
1348
|
-
new RegExp(`^${
|
|
1349
|
+
_chunkJHRJ5V2Fcjs.exactIdPattern.call(void 0, [FARM_SERVER_ONLY_PACKAGE_ID, FARM_PLATFORM_CLIENT_ID]),
|
|
1350
|
+
new RegExp(`^${_chunkEFI6QWBQcjs.FARM_BROWSER_BUILTIN_PREFIX}`)
|
|
1349
1351
|
];
|
|
1350
1352
|
function createFarmPlatformClientModule(platform) {
|
|
1351
1353
|
return `export function platform() { return ${JSON.stringify(platform)}; }
|
|
@@ -1381,18 +1383,18 @@ function farmIslandContainersPlugin(config) {
|
|
|
1381
1383
|
if (id.startsWith("\0") || id.includes("/node_modules/") || !/\.[jt]sx(?:$|\?)/.test(id)) {
|
|
1382
1384
|
return null;
|
|
1383
1385
|
}
|
|
1384
|
-
if (
|
|
1386
|
+
if (_chunkEFI6QWBQcjs.hasUseClientDirective.call(void 0, code)) return null;
|
|
1385
1387
|
const file = id.split("?", 1)[0];
|
|
1386
|
-
const bindings =
|
|
1388
|
+
const bindings = _chunkEFI6QWBQcjs.getFarmClientRenderingBindings.call(void 0, code, file, root);
|
|
1387
1389
|
if (bindings.length === 0) return null;
|
|
1388
|
-
const grown =
|
|
1390
|
+
const grown = _chunkEFI6QWBQcjs.wrapFarmIslandContainers.call(void 0, {
|
|
1389
1391
|
code,
|
|
1390
1392
|
file,
|
|
1391
1393
|
bindings,
|
|
1392
|
-
reference:
|
|
1394
|
+
reference: _chunkEFI6QWBQcjs.farmIslandContainerReferencePath.call(void 0, root)
|
|
1393
1395
|
});
|
|
1394
1396
|
if (grown === null) return null;
|
|
1395
|
-
|
|
1397
|
+
_chunkEFI6QWBQcjs.ensureFarmIslandContainerReference.call(void 0, root);
|
|
1396
1398
|
return { code: grown, map: null };
|
|
1397
1399
|
}
|
|
1398
1400
|
};
|
|
@@ -1406,15 +1408,15 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1406
1408
|
config(config) {
|
|
1407
1409
|
const appRoot = path6.resolve(_nullishCoalesce(config.root, () => ( process.cwd())));
|
|
1408
1410
|
if (options.distDir) {
|
|
1409
|
-
|
|
1411
|
+
_chunkEFI6QWBQcjs.usePackageScanCacheFile.call(void 0,
|
|
1410
1412
|
path6.resolve(appRoot, options.distDir, "cache", "package-scans.json")
|
|
1411
1413
|
);
|
|
1412
1414
|
}
|
|
1413
|
-
const bundledPackages =
|
|
1415
|
+
const bundledPackages = _chunkEFI6QWBQcjs.collectFarmServerBundledPackageInfo.call(void 0, appRoot);
|
|
1414
1416
|
const prebundle = options.prebundleServerPackages ? createFarmServerPrebundleConfig(bundledPackages) : {};
|
|
1415
|
-
|
|
1417
|
+
_chunkEFI6QWBQcjs.persistPackageScanCache.call(void 0, );
|
|
1416
1418
|
return {
|
|
1417
|
-
optimizeDeps: { rolldownOptions: { plugins: [
|
|
1419
|
+
optimizeDeps: { rolldownOptions: { plugins: [_chunkEFI6QWBQcjs.farmBrowserBuiltinsOptimizerPlugin.call(void 0, )] } },
|
|
1418
1420
|
ssr: {
|
|
1419
1421
|
noExternal: [
|
|
1420
1422
|
// Resolve `server-only` here rather than in Node, which would load its throwing build.
|
|
@@ -1438,8 +1440,8 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1438
1440
|
return FARM_SERVER_ONLY_PACKAGE_ID;
|
|
1439
1441
|
}
|
|
1440
1442
|
this.error(
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
+
_chunkEFI6QWBQcjs.formatFarmDiagnostic.call(void 0,
|
|
1444
|
+
_chunkEFI6QWBQcjs.createFarmDiagnostic.call(void 0,
|
|
1443
1445
|
"CLIENT_SERVER_ONLY_IMPORT",
|
|
1444
1446
|
_nullishCoalesce(importer, () => ( "<unknown module>")),
|
|
1445
1447
|
`${importer ? "This module" : "A module"} imports "server-only", so it must not reach the browser, but client code imports it.`
|
|
@@ -1449,9 +1451,9 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1449
1451
|
);
|
|
1450
1452
|
}
|
|
1451
1453
|
if (!_optionalChain([options2, 'optionalAccess', _75 => _75.ssr]) && _module.isBuiltin.call(void 0, id)) {
|
|
1452
|
-
return
|
|
1454
|
+
return _chunkEFI6QWBQcjs.resolveFarmBrowserBuiltin.call(void 0, this, id, importer, options2);
|
|
1453
1455
|
}
|
|
1454
|
-
const resolveFrom = importer ?
|
|
1456
|
+
const resolveFrom = importer ? _chunkEFI6QWBQcjs.parseFarmResolveFrom.call(void 0, id, importer.split("?", 1)[0]) : null;
|
|
1455
1457
|
if (resolveFrom) {
|
|
1456
1458
|
const directory = path6.dirname(resolveFrom.importer);
|
|
1457
1459
|
return this.resolve(resolveFrom.specifier, resolveFrom.importer, {
|
|
@@ -1468,8 +1470,8 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1468
1470
|
const importedBy = importer ? ` (imported by ${importer})` : "";
|
|
1469
1471
|
if (!_optionalChain([options2, 'optionalAccess', _76 => _76.ssr])) {
|
|
1470
1472
|
this.error(
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
+
_chunkEFI6QWBQcjs.formatFarmDiagnostic.call(void 0,
|
|
1474
|
+
_chunkEFI6QWBQcjs.createFarmDiagnostic.call(void 0,
|
|
1473
1475
|
"CLIENT_SERVER_ONLY_ENTRY",
|
|
1474
1476
|
_nullishCoalesce(importer, () => ( id)),
|
|
1475
1477
|
`${id} is server-only and cannot be imported into client code.`
|
|
@@ -1494,7 +1496,7 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1494
1496
|
if (id === FARM_PLATFORM_CLIENT_ID) {
|
|
1495
1497
|
return createFarmPlatformClientModule(_nullishCoalesce(options.platform, () => ( _chunkAQLHD6HZcjs.resolveFarmPlatform.call(void 0, ))));
|
|
1496
1498
|
}
|
|
1497
|
-
return _nullishCoalesce(
|
|
1499
|
+
return _nullishCoalesce(_chunkEFI6QWBQcjs.loadFarmBrowserBuiltin.call(void 0, id), () => ( null));
|
|
1498
1500
|
}
|
|
1499
1501
|
}
|
|
1500
1502
|
};
|
|
@@ -1975,7 +1977,7 @@ function getEnvDefines(config, configEnv) {
|
|
|
1975
1977
|
_chunkMCSRMEQVcjs.getPublicFarmImageConfig.call(void 0,
|
|
1976
1978
|
_chunkMCSRMEQVcjs.resolveFarmImageConfig.call(void 0,
|
|
1977
1979
|
config.images,
|
|
1978
|
-
|
|
1980
|
+
_chunkNGTZHWBGcjs.isFarmRendererDisabled.call(void 0, config.renderer) ? "none" : void 0
|
|
1979
1981
|
)
|
|
1980
1982
|
)
|
|
1981
1983
|
)
|
|
@@ -2108,7 +2110,7 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
2108
2110
|
return null;
|
|
2109
2111
|
}
|
|
2110
2112
|
const body = Array.isArray(ast.body) ? ast.body : [];
|
|
2111
|
-
const everyExportIsComponent = options.code.includes(
|
|
2113
|
+
const everyExportIsComponent = options.code.includes(_chunkEFI6QWBQcjs.FARM_CLIENT_REFERENCE_PRAGMA) || options.moduleReference.includes(_chunkEFI6QWBQcjs.FARM_CLIENT_REFERENCE_DIRECTORY);
|
|
2112
2114
|
const replacements = [];
|
|
2113
2115
|
const wrapperStatements = [];
|
|
2114
2116
|
const originalEntries = [];
|
|
@@ -2259,16 +2261,16 @@ async function warnClientBoundaryOnce(context, id, code, config) {
|
|
|
2259
2261
|
for (const finding of analyzeClientBoundary(program, publicKeys)) {
|
|
2260
2262
|
if (finding.kind === "builtin" && !finding.name.startsWith("node:")) {
|
|
2261
2263
|
const resolved = await context.resolve(finding.name, id).catch(() => null);
|
|
2262
|
-
if (!_optionalChain([resolved, 'optionalAccess', _103 => _103.id, 'access', _104 => _104.startsWith, 'call', _105 => _105(
|
|
2264
|
+
if (!_optionalChain([resolved, 'optionalAccess', _103 => _103.id, 'access', _104 => _104.startsWith, 'call', _105 => _105(_chunkEFI6QWBQcjs.FARM_BROWSER_BUILTIN_PREFIX)])) continue;
|
|
2263
2265
|
}
|
|
2264
2266
|
findings.push(finding);
|
|
2265
2267
|
}
|
|
2266
2268
|
if (findings.length === 0) return;
|
|
2267
2269
|
warnedClientBoundaryIds.add(id);
|
|
2268
|
-
const locate =
|
|
2270
|
+
const locate = _chunkEFI6QWBQcjs.createFarmSourceLocator.call(void 0, code, () => context.getCombinedSourcemap());
|
|
2269
2271
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
2270
2272
|
findings.map(
|
|
2271
|
-
(finding) =>
|
|
2273
|
+
(finding) => _chunkEFI6QWBQcjs.formatFarmDiagnostic.call(void 0,
|
|
2272
2274
|
createClientBoundaryDiagnostic(id, finding, locate(finding.start)),
|
|
2273
2275
|
config.root
|
|
2274
2276
|
)
|
|
@@ -2285,7 +2287,7 @@ function isFarmAppRuntimeFile(file, appDirs, routeModuleExtensions) {
|
|
|
2285
2287
|
);
|
|
2286
2288
|
}
|
|
2287
2289
|
function shouldEmitFarmClientRootHmr(renderer) {
|
|
2288
|
-
return
|
|
2290
|
+
return _chunkNGTZHWBGcjs.getFarmRendererCapabilities.call(void 0, _chunkNGTZHWBGcjs.resolveFarmRenderer.call(void 0, renderer)).reconcilesRerenders;
|
|
2289
2291
|
}
|
|
2290
2292
|
var FARM_RUNTIME_MODULE_PREFIX = "/@farm/runtime/";
|
|
2291
2293
|
function toFarmRuntimeModuleId(specifier) {
|
|
@@ -2316,9 +2318,9 @@ function hasFarmSourceAliasOverride(alias) {
|
|
|
2316
2318
|
);
|
|
2317
2319
|
}
|
|
2318
2320
|
function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
2319
|
-
const rendererDisabled =
|
|
2321
|
+
const rendererDisabled = _chunkNGTZHWBGcjs.isFarmRendererDisabled.call(void 0, options.renderer);
|
|
2320
2322
|
const imageImports = farmImageImportsPlugin();
|
|
2321
|
-
const fontImports =
|
|
2323
|
+
const fontImports = _chunkJHRJ5V2Fcjs.farmFontImportsPlugin.call(void 0, {
|
|
2322
2324
|
root: options.root,
|
|
2323
2325
|
basePath: options.basePath,
|
|
2324
2326
|
publicDir: options.publicDir
|
|
@@ -2352,8 +2354,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2352
2354
|
if (mdxComponents) files.add(mdxComponents);
|
|
2353
2355
|
return files;
|
|
2354
2356
|
};
|
|
2355
|
-
const islxActionsMode = () =>
|
|
2356
|
-
const islandsServerFns = () =>
|
|
2357
|
+
const islxActionsMode = () => _chunkJHRJ5V2Fcjs.resolveFarmIslxActionsMode.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _111 => _111.getConfig, 'call', _112 => _112()]), () => ( options)));
|
|
2358
|
+
const islandsServerFns = () => _chunkJHRJ5V2Fcjs.farmBrowserServerFnsEnabled.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _113 => _113.getConfig, 'call', _114 => _114()]), () => ( options)));
|
|
2357
2359
|
let reactRefreshActive = false;
|
|
2358
2360
|
let server;
|
|
2359
2361
|
let deferredGates;
|
|
@@ -2396,11 +2398,11 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2396
2398
|
isBuild = configEnv.command === "build";
|
|
2397
2399
|
const farmAliases = {
|
|
2398
2400
|
..._chunk52Q4OB4Acjs.getFarmLayerAliases.call(void 0, options.layers),
|
|
2399
|
-
...hasFarmSourceAliasOverride(_optionalChain([userConfig, 'access', _124 => _124.resolve, 'optionalAccess', _125 => _125.alias])) ? {} :
|
|
2401
|
+
...hasFarmSourceAliasOverride(_optionalChain([userConfig, 'access', _124 => _124.resolve, 'optionalAccess', _125 => _125.alias])) ? {} : _chunkJHRJ5V2Fcjs.createFarmSourceAlias.call(void 0, options.root || process.cwd(), options.srcDir)
|
|
2400
2402
|
};
|
|
2401
2403
|
if (Object.keys(farmAliases).length > 0) {
|
|
2402
2404
|
_nullishCoalesce(userConfig.resolve, () => ( (userConfig.resolve = {})));
|
|
2403
|
-
userConfig.resolve.alias =
|
|
2405
|
+
userConfig.resolve.alias = _chunkJHRJ5V2Fcjs.mergeFarmViteAlias.call(void 0, farmAliases, userConfig.resolve.alias);
|
|
2404
2406
|
}
|
|
2405
2407
|
const layerRoots = (_nullishCoalesce(options.layers, () => ( []))).map((layer) => layer.root);
|
|
2406
2408
|
farmOwnsDevCors = !isBuild && _optionalChain([userConfig, 'access', _126 => _126.server, 'optionalAccess', _127 => _127.cors]) === void 0;
|
|
@@ -2474,7 +2476,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2474
2476
|
} catch (e21) {
|
|
2475
2477
|
}
|
|
2476
2478
|
};
|
|
2477
|
-
farmApp = new (0,
|
|
2479
|
+
farmApp = new (0, _chunkJHRJ5V2Fcjs.FarmApp)(
|
|
2478
2480
|
{
|
|
2479
2481
|
...options,
|
|
2480
2482
|
root: resolveDevelopmentRoot(options.root, server.config.root)
|
|
@@ -2482,7 +2484,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2482
2484
|
server
|
|
2483
2485
|
);
|
|
2484
2486
|
farmApp.getRouteManager().usePackageClientBoundaryCacheFile(
|
|
2485
|
-
|
|
2487
|
+
_chunkEFI6QWBQcjs.resolvePackageClientBoundaryCacheFile.call(void 0,
|
|
2486
2488
|
farmApp.getConfig().root,
|
|
2487
2489
|
options.distDir || ".farm"
|
|
2488
2490
|
)
|
|
@@ -2493,7 +2495,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2493
2495
|
let farmAppPackages;
|
|
2494
2496
|
if (_optionalChain([farmConfig, 'access', _149 => _149.agent, 'optionalAccess', _150 => _150.noindexPreviews])) {
|
|
2495
2497
|
farmMiddlewares.use((_req, res, next) => {
|
|
2496
|
-
if (
|
|
2498
|
+
if (_chunkIABI62FHcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
|
|
2497
2499
|
res.setHeader("X-Robots-Tag", _chunkEACD6ND7cjs.FARM_PREVIEW_ROBOTS_TAG);
|
|
2498
2500
|
}
|
|
2499
2501
|
next();
|
|
@@ -2501,7 +2503,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2501
2503
|
}
|
|
2502
2504
|
const apiServerBasePath = _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, farmConfig.api);
|
|
2503
2505
|
const devBuiltInRoutePaths = new Set(
|
|
2504
|
-
|
|
2506
|
+
_chunkWCSBYQOTcjs.listFarmBuiltInRoutePaths.call(void 0, {
|
|
2505
2507
|
agent: {
|
|
2506
2508
|
apiCatalog: true,
|
|
2507
2509
|
mcp: true,
|
|
@@ -2551,7 +2553,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2551
2553
|
);
|
|
2552
2554
|
const generateTypeArtifacts = async (reason, selection = ALL_TYPE_ARTIFACTS, log = false) => {
|
|
2553
2555
|
try {
|
|
2554
|
-
const result = await
|
|
2556
|
+
const result = await _chunkHRH7OKBQcjs.generateFarmTypeArtifacts.call(void 0, {
|
|
2555
2557
|
root: farmConfig.root,
|
|
2556
2558
|
srcDir: farmConfig.srcDir,
|
|
2557
2559
|
layers: farmConfig.layers,
|
|
@@ -2560,6 +2562,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2560
2562
|
extraRoutes: getExtraRouteTypes(),
|
|
2561
2563
|
suppressLintOnLink: farmConfig.suppressLintOnLink,
|
|
2562
2564
|
componentExtensions: farmConfig.renderer.componentExtensions,
|
|
2565
|
+
renderer: farmConfig.renderer,
|
|
2563
2566
|
i18nConfig: farmConfig.i18n,
|
|
2564
2567
|
...selection
|
|
2565
2568
|
});
|
|
@@ -2595,7 +2598,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2595
2598
|
farmConfig.layers.map((layer) => _optionalChain([layer, 'access', _158 => _158.configFile, 'optionalAccess', _159 => _159.replace, 'call', _160 => _160(/\\/g, "/")])).filter((file) => Boolean(file))
|
|
2596
2599
|
);
|
|
2597
2600
|
const routeModuleExtensions = /* @__PURE__ */ new Set([
|
|
2598
|
-
...
|
|
2601
|
+
..._chunkNGTZHWBGcjs.resolveFarmComponentExtensions.call(void 0, farmConfig.renderer.componentExtensions),
|
|
2599
2602
|
".md",
|
|
2600
2603
|
".mdx"
|
|
2601
2604
|
]);
|
|
@@ -2619,6 +2622,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2619
2622
|
);
|
|
2620
2623
|
};
|
|
2621
2624
|
const isAppRuntimeFile = (file) => isFarmAppRuntimeFile(file, appDirSlugs, routeModuleExtensions);
|
|
2625
|
+
const isRendererRouteFile = (file) => routeModuleExtensions.has(path6.extname(file).toLowerCase()) && _optionalChain([farmApp, 'optionalAccess', _161 => _161.getRouteManager, 'call', _162 => _162(), 'access', _163 => _163.isRendererRouteFile, 'call', _164 => _164(file)]) === true;
|
|
2622
2626
|
const isStaticMetadataImageFile = (file) => /\/(?:opengraph-image|twitter-image)(?:\.(?:png|jpg|jpeg|gif|webp)|\.alt\.txt)$/.test(
|
|
2623
2627
|
file.replace(/\\/g, "/")
|
|
2624
2628
|
);
|
|
@@ -2655,7 +2659,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2655
2659
|
const configChanged = isFarmConfigFile(file, farmConfig.root) || layerConfigFiles.has(normalizedFile);
|
|
2656
2660
|
const programmaticRouteChanged = isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file));
|
|
2657
2661
|
const typeArtifacts = configChanged ? ALL_TYPE_ARTIFACTS : {
|
|
2658
|
-
routes: ev !== "change" && isRouteModuleFile(file) || programmaticRouteChanged,
|
|
2662
|
+
routes: ev !== "change" && (isRouteModuleFile(file) || isRendererRouteFile(file)) || programmaticRouteChanged,
|
|
2659
2663
|
api: isApiRouteFile(file) || programmaticRouteChanged,
|
|
2660
2664
|
env: false,
|
|
2661
2665
|
images: false,
|
|
@@ -2665,9 +2669,9 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2665
2669
|
scheduleTypeArtifactGen(file, ev, typeArtifacts);
|
|
2666
2670
|
}
|
|
2667
2671
|
if (isI18nCatalogFile(file)) {
|
|
2668
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
2672
|
+
_optionalChain([farmApp, 'optionalAccess', _165 => _165.getI18nRuntime, 'call', _166 => _166(), 'access', _167 => _167.reload, 'call', _168 => _168(), 'access', _169 => _169.then, 'call', _170 => _170(() => server.ws.send({ type: "full-reload", path: "*" })), 'access', _171 => _171.catch, 'call', _172 => _172((error) => _chunk7U4XF76Rcjs.logger.warn(`i18n catalog reload failed: ${error.message}`))]);
|
|
2669
2673
|
}
|
|
2670
|
-
const isRouteRefreshEvent = (ev !== "change" || isStaticMetadataImageFile(file)) && (isAppRuntimeFile(file) || isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file)));
|
|
2674
|
+
const isRouteRefreshEvent = (ev !== "change" || isStaticMetadataImageFile(file)) && (isAppRuntimeFile(file) || isRendererRouteFile(file) || isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file)));
|
|
2671
2675
|
if (isRouteRefreshEvent) {
|
|
2672
2676
|
if (!queuedRouteFiles) {
|
|
2673
2677
|
const files = /* @__PURE__ */ new Set();
|
|
@@ -2677,8 +2681,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2677
2681
|
queuedRouteFiles = void 0;
|
|
2678
2682
|
try {
|
|
2679
2683
|
await Promise.all([
|
|
2680
|
-
_optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
2681
|
-
[...files].some((path7) => path7.includes("middleware.")) ? _optionalChain([middlewareManager, 'optionalAccess',
|
|
2684
|
+
_optionalChain([refreshRouteDiscovery, 'optionalCall', _173 => _173(`${ev} ${file}`)]),
|
|
2685
|
+
[...files].some((path7) => path7.includes("middleware.")) ? _optionalChain([middlewareManager, 'optionalAccess', _174 => _174.reload, 'call', _175 => _175()]) : void 0
|
|
2682
2686
|
]);
|
|
2683
2687
|
if (pendingRouteReloads.size === 1)
|
|
2684
2688
|
server.ws.send({ type: "full-reload", path: "*" });
|
|
@@ -2727,7 +2731,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2727
2731
|
const { FARM_DEV_SERVER_MODULE_LOADER } = await import("./internal/native-server-fns.cjs");
|
|
2728
2732
|
const load = (file) => _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, server, file);
|
|
2729
2733
|
globalThis[FARM_DEV_SERVER_MODULE_LOADER] = load;
|
|
2730
|
-
_optionalChain([server, 'access',
|
|
2734
|
+
_optionalChain([server, 'access', _176 => _176.httpServer, 'optionalAccess', _177 => _177.once, 'call', _178 => _178("close", () => {
|
|
2731
2735
|
const globals = globalThis;
|
|
2732
2736
|
if (globals[FARM_DEV_SERVER_MODULE_LOADER] === load) {
|
|
2733
2737
|
delete globals[FARM_DEV_SERVER_MODULE_LOADER];
|
|
@@ -2801,11 +2805,11 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2801
2805
|
});
|
|
2802
2806
|
}
|
|
2803
2807
|
}
|
|
2804
|
-
if (_optionalChain([options, 'access',
|
|
2808
|
+
if (_optionalChain([options, 'access', _179 => _179.openapi, 'optionalAccess', _180 => _180.enabled])) {
|
|
2805
2809
|
const { OpenAPIManager } = await loadFarmOpenAPIDevRuntime();
|
|
2806
2810
|
openAPIManager = new OpenAPIManager(appDirs, options.openapi, {
|
|
2807
2811
|
mode: "development",
|
|
2808
|
-
apiBaseURL: typeof _optionalChain([options, 'access',
|
|
2812
|
+
apiBaseURL: typeof _optionalChain([options, 'access', _181 => _181.api, 'optionalAccess', _182 => _182.baseURL]) === "string" ? options.api.baseURL : void 0,
|
|
2809
2813
|
routes: () => apiRouteManager.getRoutes().values(),
|
|
2810
2814
|
loadModule: (filePath) => apiRouteManager.loadModule(filePath)
|
|
2811
2815
|
});
|
|
@@ -2847,22 +2851,23 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2847
2851
|
root: farmConfig.root,
|
|
2848
2852
|
srcDir: farmConfig.srcDir,
|
|
2849
2853
|
clientEntry: "/@farm/client.js",
|
|
2854
|
+
rendererServer: farmConfig.renderer.server,
|
|
2850
2855
|
resolveLayoutFonts: resolveDocsLayoutFonts,
|
|
2851
2856
|
fontStylesheetHref: "/@farm/fonts.css",
|
|
2852
|
-
globalStylesheetHref:
|
|
2857
|
+
globalStylesheetHref: _chunkJHRJ5V2Fcjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
2853
2858
|
farmConfig.root,
|
|
2854
2859
|
farmConfig.srcDir
|
|
2855
2860
|
),
|
|
2856
2861
|
loadModule: async (specifier) => {
|
|
2857
2862
|
const resolved = await server.environments.ssr.pluginContainer.resolveId(specifier);
|
|
2858
|
-
if (specifier === _optionalChain([farmConfig, 'access',
|
|
2863
|
+
if (specifier === _optionalChain([farmConfig, 'access', _183 => _183.docs, 'access', _184 => _184.adapter, 'optionalAccess', _185 => _185.server]) && _optionalChain([resolved, 'optionalAccess', _186 => _186.id])) {
|
|
2859
2864
|
const file = resolved.id.split("?", 1)[0];
|
|
2860
2865
|
return import(
|
|
2861
2866
|
/* @vite-ignore */
|
|
2862
2867
|
_url.pathToFileURL.call(void 0, file).href
|
|
2863
2868
|
);
|
|
2864
2869
|
}
|
|
2865
|
-
return _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess',
|
|
2870
|
+
return _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess', _187 => _187.id]), () => ( specifier)));
|
|
2866
2871
|
},
|
|
2867
2872
|
registerMCPServer: (mcpServer) => {
|
|
2868
2873
|
const dispose = _chunkRKQOMG2Xcjs.registerFarmMCPServer.call(void 0, mcpServer);
|
|
@@ -2880,7 +2885,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2880
2885
|
fontAssets: _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, farmDocsFontAssetList),
|
|
2881
2886
|
resolveLayoutFonts: resolveDocsLayoutFonts,
|
|
2882
2887
|
fontStylesheetHref: "/@farm/fonts.css",
|
|
2883
|
-
globalStylesheetHref:
|
|
2888
|
+
globalStylesheetHref: _chunkJHRJ5V2Fcjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
2884
2889
|
farmConfig.root,
|
|
2885
2890
|
farmConfig.srcDir
|
|
2886
2891
|
),
|
|
@@ -2888,7 +2893,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2888
2893
|
basePath: farmConfig.basePath
|
|
2889
2894
|
}) : null;
|
|
2890
2895
|
const farmDocsListsPages = Boolean(
|
|
2891
|
-
farmDocsDevRuntime && _optionalChain([pm, 'optionalAccess',
|
|
2896
|
+
farmDocsDevRuntime && _optionalChain([pm, 'optionalAccess', _188 => _188.getPlugins, 'call', _189 => _189(), 'access', _190 => _190.some, 'call', _191 => _191((plugin2) => plugin2.name === "farm:infra-analytics")])
|
|
2892
2897
|
);
|
|
2893
2898
|
let farmDocsPagePaths;
|
|
2894
2899
|
const getFarmDocsPagePaths = () => {
|
|
@@ -2915,22 +2920,22 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2915
2920
|
});
|
|
2916
2921
|
}
|
|
2917
2922
|
}
|
|
2918
|
-
const farmInfraAnalyticsPlugin = _optionalChain([pm, 'optionalAccess',
|
|
2923
|
+
const farmInfraAnalyticsPlugin = _optionalChain([pm, 'optionalAccess', _192 => _192.getPlugins, 'call', _193 => _193(), 'access', _194 => _194.find, 'call', _195 => _195((plugin2) => plugin2.name === "farm:infra-analytics")]);
|
|
2919
2924
|
if (farmInfraAnalyticsPlugin) {
|
|
2920
|
-
|
|
2925
|
+
_chunkOM6JIIJUcjs._setFarmInfraAnalyticsWebMCPRoute.call(void 0, farmInfraAnalyticsPlugin, async (pathname) => {
|
|
2921
2926
|
if (farmDocsDevRuntime) {
|
|
2922
|
-
const label =
|
|
2927
|
+
const label = _chunkWCSBYQOTcjs.resolveFarmDocsRouteLabel.call(void 0,
|
|
2923
2928
|
_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, pathname, farmConfig.basePath),
|
|
2924
2929
|
{
|
|
2925
|
-
path: _optionalChain([farmConfig, 'access',
|
|
2926
|
-
roots: _optionalChain([farmConfig, 'access',
|
|
2930
|
+
path: _optionalChain([farmConfig, 'access', _196 => _196.docs, 'optionalAccess', _197 => _197.entry]) || "/docs",
|
|
2931
|
+
roots: _optionalChain([farmConfig, 'access', _198 => _198.docs, 'optionalAccess', _199 => _199.roots, 'optionalAccess', _200 => _200.map, 'call', _201 => _201((root) => root.entry)]),
|
|
2927
2932
|
pages: await getFarmDocsPagePaths()
|
|
2928
2933
|
}
|
|
2929
2934
|
);
|
|
2930
|
-
if (label) return
|
|
2935
|
+
if (label) return _chunkWCSBYQOTcjs.setFarmRouteLabel.call(void 0, { pathname }, label);
|
|
2931
2936
|
}
|
|
2932
2937
|
const match = farmApp.getRouteManager().matchRoute(pathname);
|
|
2933
|
-
return { pathname, pattern: _optionalChain([match, 'access',
|
|
2938
|
+
return { pathname, pattern: _optionalChain([match, 'access', _202 => _202.route, 'optionalAccess', _203 => _203.pattern]) || null };
|
|
2934
2939
|
});
|
|
2935
2940
|
}
|
|
2936
2941
|
if (farmDocsDevRuntime && !farmDocsDevRuntime.hasFarmDocsRuntimeAdapter(farmConfig.docs)) {
|
|
@@ -3005,7 +3010,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3005
3010
|
}
|
|
3006
3011
|
},
|
|
3007
3012
|
(request) => {
|
|
3008
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3013
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _204 => _204.getConfig, 'call', _205 => _205()]), () => ( options));
|
|
3009
3014
|
const currentServerConfig = _chunk7Q7UB4TLcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
|
|
3010
3015
|
return _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, request, {
|
|
3011
3016
|
trustProxy: currentServerConfig.trustProxy
|
|
@@ -3021,7 +3026,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3021
3026
|
withAPIRequestTracing(async function handleFarmDevRequest(req, res, next) {
|
|
3022
3027
|
const requestUrl = req.url || "/";
|
|
3023
3028
|
const requestMethod = req.method || "GET";
|
|
3024
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3029
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _206 => _206.getConfig, 'call', _207 => _207()]), () => ( options));
|
|
3025
3030
|
const currentServerConfig = _chunk7Q7UB4TLcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
|
|
3026
3031
|
const parsedRequestUrl = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
3027
3032
|
trustProxy: currentServerConfig.trustProxy
|
|
@@ -3091,7 +3096,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3091
3096
|
if (!rendererDisabled && (requestMethod === "GET" || requestMethod === "HEAD") && requestPathname === _chunkY3DO7BIJcjs.FARM_VIDEO_PLAYER_PATH) {
|
|
3092
3097
|
res.statusCode = 200;
|
|
3093
3098
|
res.setHeader("Content-Type", "text/html; charset=utf-8");
|
|
3094
|
-
res.end(requestMethod === "HEAD" ? void 0 :
|
|
3099
|
+
res.end(requestMethod === "HEAD" ? void 0 : _chunkJHRJ5V2Fcjs.FARM_VIDEO_PLAYER_HTML);
|
|
3095
3100
|
return;
|
|
3096
3101
|
}
|
|
3097
3102
|
const farmDocsFontPath = farmDocsFontAssets.get(requestPathname);
|
|
@@ -3146,7 +3151,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3146
3151
|
openapi: options.openapi
|
|
3147
3152
|
},
|
|
3148
3153
|
workflows: discoveredWorkflows,
|
|
3149
|
-
plugins: _optionalChain([pm, 'optionalAccess',
|
|
3154
|
+
plugins: _optionalChain([pm, 'optionalAccess', _208 => _208.getSortedPlugins, 'call', _209 => _209()])
|
|
3150
3155
|
});
|
|
3151
3156
|
res.statusCode = 200;
|
|
3152
3157
|
res.setHeader(
|
|
@@ -3181,10 +3186,10 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3181
3186
|
render: {
|
|
3182
3187
|
pathname: pathname2,
|
|
3183
3188
|
method: requestMethod,
|
|
3184
|
-
routePattern: _optionalChain([match, 'optionalAccess',
|
|
3185
|
-
params: _optionalChain([match, 'optionalAccess',
|
|
3189
|
+
routePattern: _optionalChain([match, 'optionalAccess', _210 => _210.route, 'optionalAccess', _211 => _211.pattern]) || null,
|
|
3190
|
+
params: _optionalChain([match, 'optionalAccess', _212 => _212.params]) || {}
|
|
3186
3191
|
},
|
|
3187
|
-
layoutPatterns: (_optionalChain([match, 'optionalAccess',
|
|
3192
|
+
layoutPatterns: (_optionalChain([match, 'optionalAccess', _213 => _213.layouts]) || []).map((layout) => layout.pattern)
|
|
3188
3193
|
};
|
|
3189
3194
|
return pageHookRouteMatch;
|
|
3190
3195
|
};
|
|
@@ -3272,7 +3277,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3272
3277
|
}
|
|
3273
3278
|
}
|
|
3274
3279
|
const runAppMiddlewareForContentRoute = async () => {
|
|
3275
|
-
if (!_optionalChain([middlewareManager, 'optionalAccess',
|
|
3280
|
+
if (!_optionalChain([middlewareManager, 'optionalAccess', _214 => _214.hasMiddleware, 'call', _215 => _215()])) return false;
|
|
3276
3281
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
3277
3282
|
return runFarmMiddlewareWithNavigation(
|
|
3278
3283
|
farmApp.getServerRenderer(),
|
|
@@ -3310,7 +3315,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3310
3315
|
return response.status;
|
|
3311
3316
|
};
|
|
3312
3317
|
const runAppMiddlewareInRuntimeSession = async (runtimeSession2, logResponse2) => {
|
|
3313
|
-
const interceptor = runtimeSession2 && _optionalChain([pm, 'optionalAccess',
|
|
3318
|
+
const interceptor = runtimeSession2 && _optionalChain([pm, 'optionalAccess', _216 => _216.hasRuntimeHook, 'call', _217 => _217("after")]) && _optionalChain([middlewareManager, 'optionalAccess', _218 => _218.hasMiddleware, 'call', _219 => _219()]) ? interceptFarmDevPageResponse({
|
|
3314
3319
|
req,
|
|
3315
3320
|
res,
|
|
3316
3321
|
pm,
|
|
@@ -3323,7 +3328,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3323
3328
|
urlPath: requestUrl,
|
|
3324
3329
|
pathname: requestPathname,
|
|
3325
3330
|
startTime: Date.now(),
|
|
3326
|
-
logResponse: (_method, _path, status) => _optionalChain([logResponse2, 'optionalCall',
|
|
3331
|
+
logResponse: (_method, _path, status) => _optionalChain([logResponse2, 'optionalCall', _220 => _220(status)]),
|
|
3327
3332
|
// The runtime reports a runtime.after failure itself.
|
|
3328
3333
|
emitError: async () => {
|
|
3329
3334
|
},
|
|
@@ -3334,7 +3339,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3334
3339
|
handled = await runAppMiddlewareForContentRoute();
|
|
3335
3340
|
} catch (error) {
|
|
3336
3341
|
if (runtimeHookErrorAnswersJSON || res.headersSent) {
|
|
3337
|
-
_optionalChain([interceptor, 'optionalAccess',
|
|
3342
|
+
_optionalChain([interceptor, 'optionalAccess', _221 => _221.release, 'call', _222 => _222()]);
|
|
3338
3343
|
throw error;
|
|
3339
3344
|
}
|
|
3340
3345
|
if (runtimeSession2) await pm.reportRuntimeRequestError(runtimeSession2, error);
|
|
@@ -3342,10 +3347,10 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3342
3347
|
return true;
|
|
3343
3348
|
}
|
|
3344
3349
|
if (!handled) {
|
|
3345
|
-
_optionalChain([interceptor, 'optionalAccess',
|
|
3350
|
+
_optionalChain([interceptor, 'optionalAccess', _223 => _223.release, 'call', _224 => _224()]);
|
|
3346
3351
|
return false;
|
|
3347
3352
|
}
|
|
3348
|
-
if (!_optionalChain([interceptor, 'optionalAccess',
|
|
3353
|
+
if (!_optionalChain([interceptor, 'optionalAccess', _225 => _225.isEnded, 'call', _226 => _226()])) _optionalChain([logResponse2, 'optionalCall', _227 => _227(res.statusCode || 200)]);
|
|
3349
3354
|
return true;
|
|
3350
3355
|
};
|
|
3351
3356
|
const serveBuiltInRoute = async (respond, {
|
|
@@ -3354,7 +3359,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3354
3359
|
label
|
|
3355
3360
|
} = {}) => {
|
|
3356
3361
|
const discard = async () => {
|
|
3357
|
-
await _optionalChain([computed, 'optionalAccess',
|
|
3362
|
+
await _optionalChain([computed, 'optionalAccess', _228 => _228.body, 'optionalAccess', _229 => _229.cancel, 'call', _230 => _230(), 'access', _231 => _231.catch, 'call', _232 => _232(() => {
|
|
3358
3363
|
})]);
|
|
3359
3364
|
};
|
|
3360
3365
|
const sendRuntimeResponse = async (runtimeSession3, response2) => {
|
|
@@ -3371,9 +3376,9 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3371
3376
|
if (pm && opensFarmDevRuntimeSession(pm)) {
|
|
3372
3377
|
try {
|
|
3373
3378
|
const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath);
|
|
3374
|
-
const route =
|
|
3379
|
+
const route = _chunkWCSBYQOTcjs.setFarmRouteLabel.call(void 0,
|
|
3375
3380
|
{ pathname: requestPathname },
|
|
3376
|
-
label !== void 0 ? label : devBuiltInRoutePaths.has(routePathname) ? routePathname :
|
|
3381
|
+
label !== void 0 ? label : devBuiltInRoutePaths.has(routePathname) ? routePathname : _chunkWCSBYQOTcjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath)
|
|
3377
3382
|
);
|
|
3378
3383
|
runtimeSession2 = await pm.beginRuntimeRequest(
|
|
3379
3384
|
createRequestFromNodeRequest(req, new URL(fullUrl)),
|
|
@@ -3411,7 +3416,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3411
3416
|
}
|
|
3412
3417
|
responding = true;
|
|
3413
3418
|
response = await respond(
|
|
3414
|
-
_nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess',
|
|
3419
|
+
_nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess', _233 => _233.request]), () => ( createRequestFromNodeRequest(req, new URL(fullUrl))))
|
|
3415
3420
|
);
|
|
3416
3421
|
} catch (error) {
|
|
3417
3422
|
if (!responding && !res.headersSent) {
|
|
@@ -3431,7 +3436,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3431
3436
|
else await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, response);
|
|
3432
3437
|
};
|
|
3433
3438
|
const openAPIRequestPathname = openAPIManager ? _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) : requestPathname;
|
|
3434
|
-
if (openAPIManager && _optionalChain([options, 'access',
|
|
3439
|
+
if (openAPIManager && _optionalChain([options, 'access', _234 => _234.openapi, 'optionalAccess', _235 => _235.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
|
|
3435
3440
|
const specManager = openAPIManager;
|
|
3436
3441
|
await serveBuiltInRoute(async () => {
|
|
3437
3442
|
if (requestMethod !== "GET" && requestMethod !== "HEAD") {
|
|
@@ -3451,7 +3456,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3451
3456
|
});
|
|
3452
3457
|
return;
|
|
3453
3458
|
}
|
|
3454
|
-
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access',
|
|
3459
|
+
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _236 => _236.openapi, 'optionalAccess', _237 => _237.route])) {
|
|
3455
3460
|
const docsManager = openAPIManager;
|
|
3456
3461
|
await serveBuiltInRoute(
|
|
3457
3462
|
async () => {
|
|
@@ -3462,7 +3467,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3462
3467
|
);
|
|
3463
3468
|
return;
|
|
3464
3469
|
}
|
|
3465
|
-
if (_optionalChain([options, 'access',
|
|
3470
|
+
if (_optionalChain([options, 'access', _238 => _238.agent, 'optionalAccess', _239 => _239.manifest]) !== false && _chunkWCSBYQOTcjs.isFarmAppManifestPath.call(void 0, _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath))) {
|
|
3466
3471
|
const manifestGuardCoversPath = (path7) => _chunkNEKO3HM2cjs.farmPathGuardCoversEndpoint.call(void 0,
|
|
3467
3472
|
{
|
|
3468
3473
|
config: farmConfig,
|
|
@@ -3472,18 +3477,18 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3472
3477
|
apiServerBasePath
|
|
3473
3478
|
);
|
|
3474
3479
|
await serveBuiltInRoute(async () => {
|
|
3475
|
-
_nullishCoalesce(farmAppPackages, () => ( (farmAppPackages =
|
|
3476
|
-
const manifest = await
|
|
3480
|
+
_nullishCoalesce(farmAppPackages, () => ( (farmAppPackages = _chunkJHRJ5V2Fcjs.resolveFarmAppPackages.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd()))))));
|
|
3481
|
+
const manifest = await _chunkWCSBYQOTcjs.createFarmAppManifestResponse.call(void 0,
|
|
3477
3482
|
new Request(parsedRequestUrl, {
|
|
3478
3483
|
method: requestMethod,
|
|
3479
3484
|
headers: { "if-none-match": String(_nullishCoalesce(req.headers["if-none-match"], () => ( ""))) }
|
|
3480
3485
|
}),
|
|
3481
3486
|
{
|
|
3482
|
-
...
|
|
3487
|
+
..._chunkWCSBYQOTcjs.resolveFarmAppManifestInput.call(void 0, farmConfig, {
|
|
3483
3488
|
build: "development",
|
|
3484
3489
|
packages: farmAppPackages,
|
|
3485
3490
|
// Read again on each request; unchanged files come from a cache.
|
|
3486
|
-
webmcpTools: _optionalChain([farmConfig, 'access',
|
|
3491
|
+
webmcpTools: _optionalChain([farmConfig, 'access', _240 => _240.plugins, 'optionalAccess', _241 => _241.some, 'call', _242 => _242(({ name }) => name === "farm:webmcp")]) ? _chunkJHRJ5V2Fcjs.collectFarmWebMCPTools.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd())), farmConfig.srcDir) : []
|
|
3487
3492
|
}),
|
|
3488
3493
|
defaultMCP: () => farmApp.getServerRenderer().getDefaultMCPServer(),
|
|
3489
3494
|
// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
@@ -3501,11 +3506,11 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3501
3506
|
});
|
|
3502
3507
|
return;
|
|
3503
3508
|
}
|
|
3504
|
-
if (_optionalChain([options, 'access',
|
|
3509
|
+
if (_optionalChain([options, 'access', _243 => _243.agent, 'optionalAccess', _244 => _244.apiCatalog]) && _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunkWCSBYQOTcjs.FARM_API_CATALOG_PATH) {
|
|
3505
3510
|
await serveBuiltInRoute(
|
|
3506
|
-
() =>
|
|
3511
|
+
() => _chunkWCSBYQOTcjs.createFarmApiCatalogResponse.call(void 0,
|
|
3507
3512
|
requestMethod,
|
|
3508
|
-
|
|
3513
|
+
_chunkWCSBYQOTcjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
|
|
3509
3514
|
new Request(parsedRequestUrl, {
|
|
3510
3515
|
headers: { "user-agent": String(_nullishCoalesce(req.headers["user-agent"], () => ( ""))) }
|
|
3511
3516
|
})
|
|
@@ -3513,8 +3518,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3513
3518
|
);
|
|
3514
3519
|
return;
|
|
3515
3520
|
}
|
|
3516
|
-
if (_optionalChain([options, 'access',
|
|
3517
|
-
const aiCatalog =
|
|
3521
|
+
if (_optionalChain([options, 'access', _245 => _245.agent, 'optionalAccess', _246 => _246.aiCatalog]) !== false) {
|
|
3522
|
+
const aiCatalog = _chunkWCSBYQOTcjs.createFarmAiCatalogResponse.call(void 0,
|
|
3518
3523
|
new Request(parsedRequestUrl, {
|
|
3519
3524
|
method: requestMethod,
|
|
3520
3525
|
headers: {
|
|
@@ -3562,7 +3567,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3562
3567
|
);
|
|
3563
3568
|
const docsResponse = await farmDocsHandler(docsHandlerRequest);
|
|
3564
3569
|
if (docsResponse) {
|
|
3565
|
-
const docsPage = _optionalChain([docsResponse, 'access',
|
|
3570
|
+
const docsPage = _optionalChain([docsResponse, 'access', _247 => _247.headers, 'access', _248 => _248.get, 'call', _249 => _249("content-type"), 'optionalAccess', _250 => _250.toLowerCase, 'call', _251 => _251(), 'access', _252 => _252.includes, 'call', _253 => _253("text/html")]);
|
|
3566
3571
|
await serveBuiltInRoute(
|
|
3567
3572
|
async (request) => {
|
|
3568
3573
|
if (!docsPage) {
|
|
@@ -3580,7 +3585,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3580
3585
|
farmConfig.deploymentId
|
|
3581
3586
|
);
|
|
3582
3587
|
if (deploymentMismatch) {
|
|
3583
|
-
await _optionalChain([docsResponse, 'access',
|
|
3588
|
+
await _optionalChain([docsResponse, 'access', _254 => _254.body, 'optionalAccess', _255 => _255.cancel, 'call', _256 => _256()]);
|
|
3584
3589
|
return _chunkNLBHLPEOcjs.createFarmDeploymentMismatchResponse.call(void 0, deploymentMismatch);
|
|
3585
3590
|
}
|
|
3586
3591
|
return _chunkNLBHLPEOcjs.withFarmDeploymentResponse.call(void 0,
|
|
@@ -3596,11 +3601,11 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3596
3601
|
{
|
|
3597
3602
|
kind: "docs",
|
|
3598
3603
|
computed: docsResponse,
|
|
3599
|
-
label:
|
|
3604
|
+
label: _chunkWCSBYQOTcjs.resolveFarmDocsEngineRouteLabel.call(void 0,
|
|
3600
3605
|
_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath),
|
|
3601
3606
|
{
|
|
3602
|
-
path: _optionalChain([farmConfig, 'access',
|
|
3603
|
-
roots: _optionalChain([farmConfig, 'access',
|
|
3607
|
+
path: _optionalChain([farmConfig, 'access', _257 => _257.docs, 'optionalAccess', _258 => _258.entry]) || "/docs",
|
|
3608
|
+
roots: _optionalChain([farmConfig, 'access', _259 => _259.docs, 'optionalAccess', _260 => _260.roots, 'optionalAccess', _261 => _261.map, 'call', _262 => _262((root) => root.entry)]),
|
|
3604
3609
|
pages: await getFarmDocsPagePaths()
|
|
3605
3610
|
}
|
|
3606
3611
|
)
|
|
@@ -3609,7 +3614,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3609
3614
|
return;
|
|
3610
3615
|
}
|
|
3611
3616
|
}
|
|
3612
|
-
if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD" || requestMethod === "POST") && _optionalChain([req, 'access',
|
|
3617
|
+
if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD" || requestMethod === "POST") && _optionalChain([req, 'access', _263 => _263.headers, 'access', _264 => _264.accept, 'optionalAccess', _265 => _265.includes, 'call', _266 => _266(_chunk3HLQTOVUcjs.FARM_NATIVE_TREE_CONTENT_TYPE)])) {
|
|
3613
3618
|
const { createFarmNativeTreeResponse } = await import("./native-tree-5TENEQ7Y.cjs");
|
|
3614
3619
|
const treeBodyInit = requestMethod === "POST" ? { body: _chunk7Q7UB4TLcjs.createFarmNodeRequestBodyStream.call(void 0, req), duplex: "half" } : {};
|
|
3615
3620
|
const treeResponse = await createFarmNativeTreeResponse({
|
|
@@ -3627,15 +3632,15 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3627
3632
|
});
|
|
3628
3633
|
await serveBuiltInRoute(() => treeResponse, {
|
|
3629
3634
|
computed: treeResponse,
|
|
3630
|
-
label: _nullishCoalesce(_optionalChain([farmApp, 'access',
|
|
3635
|
+
label: _nullishCoalesce(_optionalChain([farmApp, 'access', _267 => _267.getRouteManager, 'call', _268 => _268(), 'access', _269 => _269.matchRoute, 'call', _270 => _270(_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath)), 'access', _271 => _271.route, 'optionalAccess', _272 => _272.pattern]), () => ( null))
|
|
3631
3636
|
});
|
|
3632
3637
|
return;
|
|
3633
3638
|
}
|
|
3634
3639
|
const markdownRouteLabel = () => (
|
|
3635
3640
|
// On the route path, as production labels it: /fr/index.md is /index.md.
|
|
3636
|
-
|
|
3641
|
+
_chunkWCSBYQOTcjs.resolveFarmMarkdownRouteLabel.call(void 0,
|
|
3637
3642
|
toRoutePathname(requestPathname),
|
|
3638
|
-
(page) => _optionalChain([farmApp, 'access',
|
|
3643
|
+
(page) => _optionalChain([farmApp, 'access', _273 => _273.getRouteManager, 'call', _274 => _274(), 'access', _275 => _275.matchRoute, 'call', _276 => _276(page), 'access', _277 => _277.route, 'optionalAccess', _278 => _278.pattern])
|
|
3639
3644
|
)
|
|
3640
3645
|
);
|
|
3641
3646
|
const markdownSourceResponse = viteModuleRequest ? null : await _chunk26WP75W5cjs.createFarmMarkdownSourceResponse.call(void 0, {
|
|
@@ -3647,14 +3652,14 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3647
3652
|
routePathname: toRoutePathname,
|
|
3648
3653
|
resolveSource: async (pathname2) => {
|
|
3649
3654
|
const match = farmApp.getRouteManager().matchRoute(pathname2);
|
|
3650
|
-
const sourcePath = _optionalChain([match, 'access',
|
|
3655
|
+
const sourcePath = _optionalChain([match, 'access', _279 => _279.route, 'optionalAccess', _280 => _280.markdownSourcePath]) || (match.route && _chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
|
|
3651
3656
|
if (!sourcePath) {
|
|
3652
3657
|
return null;
|
|
3653
3658
|
}
|
|
3654
3659
|
return {
|
|
3655
3660
|
source: await fs2.promises.readFile(sourcePath, "utf8"),
|
|
3656
3661
|
// Project-relative, as production sends it: never the machine's path.
|
|
3657
|
-
filePath:
|
|
3662
|
+
filePath: _chunkJHRJ5V2Fcjs.toBakedMarkdownSourcePath.call(void 0, farmApp.getConfig().root, sourcePath)
|
|
3658
3663
|
};
|
|
3659
3664
|
},
|
|
3660
3665
|
// The anonymous check goes through this server, so its guards and
|
|
@@ -3804,7 +3809,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3804
3809
|
"beforeRequest",
|
|
3805
3810
|
(plugin2) => {
|
|
3806
3811
|
const owner = _chunkB3HQTGXScjs.getFarmIntegrationPluginOwner.call(void 0, plugin2);
|
|
3807
|
-
return !isFarmConfigRoutePlugin(plugin2) && (_optionalChain([owner, 'optionalAccess',
|
|
3812
|
+
return !isFarmConfigRoutePlugin(plugin2) && (_optionalChain([owner, 'optionalAccess', _281 => _281.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
|
|
3808
3813
|
},
|
|
3809
3814
|
req,
|
|
3810
3815
|
res
|
|
@@ -3841,7 +3846,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3841
3846
|
isProd: false
|
|
3842
3847
|
},
|
|
3843
3848
|
request,
|
|
3844
|
-
{ clientAddress: _optionalChain([req, 'access',
|
|
3849
|
+
{ clientAddress: _optionalChain([req, 'access', _282 => _282.socket, 'optionalAccess', _283 => _283.remoteAddress]) }
|
|
3845
3850
|
);
|
|
3846
3851
|
if (!result) {
|
|
3847
3852
|
throw new Error(`Matched integration route did not return a response`);
|
|
@@ -3849,7 +3854,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3849
3854
|
return result;
|
|
3850
3855
|
} catch (error) {
|
|
3851
3856
|
_chunk7U4XF76Rcjs.logger.error(`Integration route error: ${error}`);
|
|
3852
|
-
await _optionalChain([runtime, 'optionalAccess',
|
|
3857
|
+
await _optionalChain([runtime, 'optionalAccess', _284 => _284.reportError, 'call', _285 => _285(error)]);
|
|
3853
3858
|
return _chunkJYQ6DGPWcjs.createFarmInternalServerErrorResponse.call(void 0, );
|
|
3854
3859
|
}
|
|
3855
3860
|
};
|
|
@@ -3903,7 +3908,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3903
3908
|
_chunkB3HQTGXScjs.matchIntegrationRoute.call(void 0, configuredIntegrations, {
|
|
3904
3909
|
pathname: requestPathname,
|
|
3905
3910
|
method: requestMethod
|
|
3906
|
-
}) || routeManager3.matchRedirect(requestPathname) || apiRouteManager.matchRoute(requestPathname) || farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
3911
|
+
}) || routeManager3.matchRedirect(requestPathname) || apiRouteManager.matchRoute(requestPathname) || farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _286 => _286.isFarmDocsAPIRequest, 'call', _287 => _287(requestPathname)]) || routeManager3.matchRoute(requestPathname).route || routeManager3.matchMetadataRoute(requestPathname) || routeManager3.matchMetadataImage(requestPathname)
|
|
3907
3912
|
);
|
|
3908
3913
|
};
|
|
3909
3914
|
try {
|
|
@@ -3993,15 +3998,15 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3993
3998
|
);
|
|
3994
3999
|
};
|
|
3995
4000
|
const isDocsAPIRequest = Boolean(
|
|
3996
|
-
farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
4001
|
+
farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _288 => _288.isFarmDocsAPIRequest, 'call', _289 => _289(pathname2)])
|
|
3997
4002
|
);
|
|
3998
4003
|
const docsRuntimeOptions = () => ({
|
|
3999
4004
|
kind: "docs",
|
|
4000
|
-
route:
|
|
4005
|
+
route: _chunkWCSBYQOTcjs.setFarmRouteLabel.call(void 0,
|
|
4001
4006
|
{ pathname: pathname2, pattern: urlPath2 },
|
|
4002
|
-
|
|
4003
|
-
path: _optionalChain([farmConfig, 'access',
|
|
4004
|
-
roots: _optionalChain([farmConfig, 'access',
|
|
4007
|
+
_chunkWCSBYQOTcjs.resolveFarmDocsRouteLabel.call(void 0, pathname2, {
|
|
4008
|
+
path: _optionalChain([farmConfig, 'access', _290 => _290.docs, 'optionalAccess', _291 => _291.entry]) || "/docs",
|
|
4009
|
+
roots: _optionalChain([farmConfig, 'access', _292 => _292.docs, 'optionalAccess', _293 => _293.roots, 'optionalAccess', _294 => _294.map, 'call', _295 => _295((root) => root.entry)])
|
|
4005
4010
|
})
|
|
4006
4011
|
)
|
|
4007
4012
|
});
|
|
@@ -4083,7 +4088,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4083
4088
|
const routedApiRoute = rewritten ? apiRouteManager.matchRoute(routedPathname) : matchedApiRoute || apiRouteManager.matchRoute(pathname2);
|
|
4084
4089
|
const hasExplicitAPIRoute = Boolean(routedApiRoute);
|
|
4085
4090
|
if (apiHandler && hasExplicitAPIRoute) {
|
|
4086
|
-
const apiRoutePattern = _optionalChain([routedApiRoute, 'optionalAccess',
|
|
4091
|
+
const apiRoutePattern = _optionalChain([routedApiRoute, 'optionalAccess', _296 => _296.route, 'access', _297 => _297.path]) || urlPath2;
|
|
4087
4092
|
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
4088
4093
|
type: "route.matched",
|
|
4089
4094
|
pathname: pathname2,
|
|
@@ -4133,7 +4138,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4133
4138
|
error
|
|
4134
4139
|
});
|
|
4135
4140
|
_chunk7U4XF76Rcjs.logger.error(`API route error: ${error}`);
|
|
4136
|
-
await _optionalChain([runtime, 'optionalAccess',
|
|
4141
|
+
await _optionalChain([runtime, 'optionalAccess', _298 => _298.reportError, 'call', _299 => _299(error)]);
|
|
4137
4142
|
response = _chunkJYQ6DGPWcjs.createFarmInternalServerErrorResponse.call(void 0, );
|
|
4138
4143
|
}
|
|
4139
4144
|
return pm ? await pm.runHookSerial("afterApiHandler", response, apiLifecyclePayload) : response;
|
|
@@ -4238,12 +4243,12 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4238
4243
|
}
|
|
4239
4244
|
return;
|
|
4240
4245
|
}
|
|
4241
|
-
if (_optionalChain([req, 'access',
|
|
4246
|
+
if (_optionalChain([req, 'access', _300 => _300.url, 'optionalAccess', _301 => _301.startsWith, 'call', _302 => _302("/@")]) || _optionalChain([req, 'access', _303 => _303.url, 'optionalAccess', _304 => _304.startsWith, 'call', _305 => _305("/node_modules")])) {
|
|
4242
4247
|
return next();
|
|
4243
4248
|
}
|
|
4244
4249
|
if (!deferredDottedRequests.has(req) && shouldBypassFarmRouterForDottedPath(
|
|
4245
4250
|
requestPathname,
|
|
4246
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
4251
|
+
_optionalChain([farmApp, 'optionalAccess', _306 => _306.getRouteManager, 'call', _307 => _307()]),
|
|
4247
4252
|
[server.config.publicDir, server.config.root],
|
|
4248
4253
|
farmAgentGeneratedPaths(farmConfig),
|
|
4249
4254
|
requestMethod
|
|
@@ -4251,7 +4256,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4251
4256
|
if (!viteModuleRequest) deferredDottedRequests.set(req, requestUrl);
|
|
4252
4257
|
return next();
|
|
4253
4258
|
}
|
|
4254
|
-
if (_optionalChain([req, 'access',
|
|
4259
|
+
if (_optionalChain([req, 'access', _308 => _308.url, 'optionalAccess', _309 => _309.startsWith, 'call', _310 => _310("/__farm/page-data")])) {
|
|
4255
4260
|
const urlObj = parsedRequestUrl;
|
|
4256
4261
|
const targetPath = urlObj.searchParams.get("path") || "/";
|
|
4257
4262
|
let renderedRequest;
|
|
@@ -4281,7 +4286,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4281
4286
|
renderedRequest = targetRequest;
|
|
4282
4287
|
let middlewareMap = /* @__PURE__ */ new Map();
|
|
4283
4288
|
let middlewareContext = /* @__PURE__ */ new Map();
|
|
4284
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
4289
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _311 => _311.hasMiddleware, 'call', _312 => _312()])) {
|
|
4285
4290
|
const targetNodeRequest = createPageDataMiddlewareRequest(req, targetRequestUrl);
|
|
4286
4291
|
const targetNodeResponse = createPageDataMiddlewareResponse(res);
|
|
4287
4292
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
@@ -4315,10 +4320,10 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4315
4320
|
if (pm) {
|
|
4316
4321
|
await pm.runHookParallel("afterRouteMatch", {
|
|
4317
4322
|
pathname: targetPath,
|
|
4318
|
-
matched: !!_optionalChain([match, 'optionalAccess',
|
|
4319
|
-
routePattern: _optionalChain([match, 'optionalAccess',
|
|
4320
|
-
params: _optionalChain([match, 'optionalAccess',
|
|
4321
|
-
layoutPatterns: (_optionalChain([match, 'optionalAccess',
|
|
4323
|
+
matched: !!_optionalChain([match, 'optionalAccess', _313 => _313.route]),
|
|
4324
|
+
routePattern: _optionalChain([match, 'optionalAccess', _314 => _314.route, 'optionalAccess', _315 => _315.pattern]) || null,
|
|
4325
|
+
params: _optionalChain([match, 'optionalAccess', _316 => _316.params]) || {},
|
|
4326
|
+
layoutPatterns: (_optionalChain([match, 'optionalAccess', _317 => _317.layouts]) || []).map((l) => l.pattern)
|
|
4322
4327
|
});
|
|
4323
4328
|
}
|
|
4324
4329
|
if (!match) {
|
|
@@ -4353,7 +4358,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4353
4358
|
);
|
|
4354
4359
|
const loadingModule = loadingBoundary ? await routeManager3.loadRouteModule(loadingBoundary.modulePath) : null;
|
|
4355
4360
|
const navigationManifest = routeManager3.generateClientManifest(server.config.root);
|
|
4356
|
-
const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => (
|
|
4361
|
+
const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => ( _chunkEFI6QWBQcjs.getClientModuleMetadata.call(void 0, route.modulePath, server.config.root)));
|
|
4357
4362
|
const isClientComponent = moduleMetadata.isClientComponent;
|
|
4358
4363
|
const shouldHydrate = moduleMetadata.shouldHydrate;
|
|
4359
4364
|
let mergedMetadata = {};
|
|
@@ -4364,7 +4369,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4364
4369
|
(layout) => _nullishCoalesce(navigationManifest.layouts.find(
|
|
4365
4370
|
(entry) => entry.pattern === layout.pattern
|
|
4366
4371
|
), () => ( {
|
|
4367
|
-
...
|
|
4372
|
+
..._chunkEFI6QWBQcjs.getClientModuleMetadata.call(void 0, layout.modulePath, server.config.root),
|
|
4368
4373
|
serverTree: false
|
|
4369
4374
|
}))
|
|
4370
4375
|
);
|
|
@@ -4378,17 +4383,17 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4378
4383
|
)
|
|
4379
4384
|
];
|
|
4380
4385
|
const hydrationIslandStrategy = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0,
|
|
4381
|
-
_optionalChain([(_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
4382
|
-
) === "islands" ?
|
|
4386
|
+
_optionalChain([(_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _318 => _318.getConfig, 'call', _319 => _319()]), () => ( options))), 'access', _320 => _320.experimental, 'optionalAccess', _321 => _321.serverComponents])
|
|
4387
|
+
) === "islands" ? _chunkJHRJ5V2Fcjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
4383
4388
|
route,
|
|
4384
4389
|
{ shouldHydrate, islandStrategy: _nullishCoalesce(moduleMetadata.islandStrategy, () => ( null)) },
|
|
4385
4390
|
layouts.map((layout, index) => ({
|
|
4386
4391
|
pattern: layout.pattern,
|
|
4387
4392
|
modulePath: layout.modulePath,
|
|
4388
|
-
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access',
|
|
4393
|
+
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _322 => _322[index], 'optionalAccess', _323 => _323.shouldHydrate]) === true,
|
|
4389
4394
|
// Manifest entries carry it; metadata read from source does not.
|
|
4390
|
-
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access',
|
|
4391
|
-
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access',
|
|
4395
|
+
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access', _324 => _324[index], 'optionalAccess', _325 => _325.hasIsolatedClientBoundaries]) === true,
|
|
4396
|
+
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _326 => _326[index], 'optionalAccess', _327 => _327.islandStrategy]), () => ( null))
|
|
4392
4397
|
})),
|
|
4393
4398
|
server.config.root,
|
|
4394
4399
|
true
|
|
@@ -4445,7 +4450,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4445
4450
|
const slotModule = await routeManager3.loadRouteModule(slot.route.modulePath);
|
|
4446
4451
|
const slotMetadata = _nullishCoalesce(navigationManifest.slots.find(
|
|
4447
4452
|
(entry) => entry.name === slot.name && entry.ownerPattern === slot.ownerPattern && entry.pattern === slot.route.pattern
|
|
4448
|
-
), () => (
|
|
4453
|
+
), () => ( _chunkEFI6QWBQcjs.getClientModuleMetadata.call(void 0, slot.route.modulePath, server.config.root)));
|
|
4449
4454
|
const slotContext = await _chunkX333W5KVcjs.resolveFarmRouteContext.call(void 0, farmApp.getConfig(), {
|
|
4450
4455
|
request: targetRequest,
|
|
4451
4456
|
params: slot.params,
|
|
@@ -4495,7 +4500,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4495
4500
|
pageShouldHydrate: shouldHydrate,
|
|
4496
4501
|
layoutShouldHydrate: shouldHydrateLayout,
|
|
4497
4502
|
islandStrategy: hydrationIslandStrategy,
|
|
4498
|
-
rendering:
|
|
4503
|
+
rendering: _chunkHRH7OKBQcjs.resolveRouteRenderingConfig.call(void 0, routeModule)
|
|
4499
4504
|
});
|
|
4500
4505
|
const destinationLayoutPatterns = layouts.map((layout) => layout.pattern);
|
|
4501
4506
|
const layoutStartIndex = _chunkNEKO3HM2cjs.getSharedLayoutPrefixLength.call(void 0,
|
|
@@ -4509,13 +4514,13 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4509
4514
|
middlewareContext,
|
|
4510
4515
|
() => renderer.renderNavigationFragment({
|
|
4511
4516
|
PageComponent: routeModule.default,
|
|
4512
|
-
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess',
|
|
4517
|
+
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _328 => _328.default]),
|
|
4513
4518
|
pageProps: routeProps,
|
|
4514
4519
|
params,
|
|
4515
4520
|
layouts: layouts.map((layout, index) => ({
|
|
4516
4521
|
pattern: layout.pattern,
|
|
4517
4522
|
module: layoutModules[index],
|
|
4518
|
-
serverTree: _optionalChain([layoutHydrationMetadata, 'access',
|
|
4523
|
+
serverTree: _optionalChain([layoutHydrationMetadata, 'access', _329 => _329[index], 'optionalAccess', _330 => _330.serverTree])
|
|
4519
4524
|
})),
|
|
4520
4525
|
layoutStartIndex,
|
|
4521
4526
|
slots: routeSlots.map((slot) => ({
|
|
@@ -4623,14 +4628,14 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4623
4628
|
trustProxy: currentServerConfig.trustProxy
|
|
4624
4629
|
}).pathname;
|
|
4625
4630
|
const routeManager2 = farmApp.getRouteManager();
|
|
4626
|
-
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
4627
|
-
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
4628
|
-
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
4631
|
+
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _331 => _331.hasHook, 'call', _332 => _332("beforeRequest")]), () => ( false));
|
|
4632
|
+
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _333 => _333.hasHook, 'call', _334 => _334("afterResponse")]), () => ( false));
|
|
4633
|
+
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _335 => _335.hasHook, 'call', _336 => _336("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _337 => _337.hasHook, 'call', _338 => _338("afterRender")]), () => ( false)));
|
|
4629
4634
|
const opensRuntimeSession = pm ? opensFarmDevRuntimeSession(pm) : false;
|
|
4630
|
-
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
4635
|
+
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _339 => _339.hasRuntimeHook, 'call', _340 => _340("after")]), () => ( false));
|
|
4631
4636
|
const pageBuiltInRouteLabel = (pathname2) => {
|
|
4632
4637
|
const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, pathname2, farmConfig.basePath);
|
|
4633
|
-
const mcpLabel =
|
|
4638
|
+
const mcpLabel = _chunkWCSBYQOTcjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath);
|
|
4634
4639
|
if (mcpLabel) return mcpLabel;
|
|
4635
4640
|
if (farmAgentGeneratedPaths(farmConfig).includes(routePathname)) return routePathname;
|
|
4636
4641
|
return routePathname === _chunkW53Z4WDIcjs.FARM_DEFAULT_MCP_PATH && farmApp.getServerRenderer().getDefaultMCPServer() ? _chunkW53Z4WDIcjs.FARM_DEFAULT_MCP_PATH : null;
|
|
@@ -4639,13 +4644,13 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4639
4644
|
const match = routeManager2.matchRoute(pathname2);
|
|
4640
4645
|
return {
|
|
4641
4646
|
kind: "page",
|
|
4642
|
-
route:
|
|
4647
|
+
route: _chunkWCSBYQOTcjs.setFarmRouteLabel.call(void 0,
|
|
4643
4648
|
{
|
|
4644
4649
|
pathname: pathname2,
|
|
4645
|
-
pattern: _optionalChain([match, 'optionalAccess',
|
|
4646
|
-
params: _optionalChain([match, 'optionalAccess',
|
|
4650
|
+
pattern: _optionalChain([match, 'optionalAccess', _341 => _341.route, 'optionalAccess', _342 => _342.pattern]) || null,
|
|
4651
|
+
params: _optionalChain([match, 'optionalAccess', _343 => _343.params]) || {}
|
|
4647
4652
|
},
|
|
4648
|
-
_optionalChain([match, 'optionalAccess',
|
|
4653
|
+
_optionalChain([match, 'optionalAccess', _344 => _344.route]) ? null : pageBuiltInRouteLabel(pathname2)
|
|
4649
4654
|
)
|
|
4650
4655
|
};
|
|
4651
4656
|
};
|
|
@@ -4725,7 +4730,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4725
4730
|
}) : void 0;
|
|
4726
4731
|
let middlewareFailed = false;
|
|
4727
4732
|
try {
|
|
4728
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
4733
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _345 => _345.hasMiddleware, 'call', _346 => _346()])) {
|
|
4729
4734
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
4730
4735
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
4731
4736
|
farmApp.getServerRenderer(),
|
|
@@ -4738,7 +4743,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4738
4743
|
throw error;
|
|
4739
4744
|
});
|
|
4740
4745
|
if (handled) {
|
|
4741
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
4746
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _347 => _347.isEnded, 'call', _348 => _348()])) {
|
|
4742
4747
|
const duration = Date.now() - startTime;
|
|
4743
4748
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
4744
4749
|
}
|
|
@@ -4753,8 +4758,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4753
4758
|
res
|
|
4754
4759
|
);
|
|
4755
4760
|
}
|
|
4756
|
-
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess',
|
|
4757
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
4761
|
+
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _349 => _349.isEnded, 'call', _350 => _350()])) {
|
|
4762
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _351 => _351.isEnded, 'call', _352 => _352()])) {
|
|
4758
4763
|
const duration = Date.now() - startTime;
|
|
4759
4764
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
4760
4765
|
}
|
|
@@ -4773,8 +4778,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4773
4778
|
await pm.reportRuntimeRequestError(runtimeSession, error);
|
|
4774
4779
|
} else {
|
|
4775
4780
|
await pm.failRuntimeRequest(runtimeSession, error);
|
|
4776
|
-
if (!res.headersSent && !_optionalChain([responseInterceptor, 'optionalAccess',
|
|
4777
|
-
_optionalChain([responseInterceptor, 'optionalAccess',
|
|
4781
|
+
if (!res.headersSent && !_optionalChain([responseInterceptor, 'optionalAccess', _353 => _353.isEnded, 'call', _354 => _354()])) {
|
|
4782
|
+
_optionalChain([responseInterceptor, 'optionalAccess', _355 => _355.release, 'call', _356 => _356()]);
|
|
4778
4783
|
console.error("[FARM] Page error:", error);
|
|
4779
4784
|
sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
|
|
4780
4785
|
return;
|
|
@@ -4791,7 +4796,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4791
4796
|
}
|
|
4792
4797
|
})
|
|
4793
4798
|
);
|
|
4794
|
-
const farmRequestMiddleware = _optionalChain([farmMiddlewares, 'access',
|
|
4799
|
+
const farmRequestMiddleware = _optionalChain([farmMiddlewares, 'access', _357 => _357.stack, 'access', _358 => _358.at, 'call', _359 => _359(-1), 'optionalAccess', _360 => _360.handle]);
|
|
4795
4800
|
if (farmOwnsDevCors && viteServer.config.server.cors === false) {
|
|
4796
4801
|
farmMiddlewares.use(createFarmDevViteCorsMiddleware());
|
|
4797
4802
|
}
|
|
@@ -4820,7 +4825,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4820
4825
|
});
|
|
4821
4826
|
}
|
|
4822
4827
|
if (id.startsWith("@farm.js/core/internal/") && importer && isOutsideAppRoot(importer)) {
|
|
4823
|
-
const root = _optionalChain([farmApp, 'optionalAccess',
|
|
4828
|
+
const root = _optionalChain([farmApp, 'optionalAccess', _361 => _361.getConfig, 'call', _362 => _362(), 'access', _363 => _363.root]) || _optionalChain([server, 'optionalAccess', _364 => _364.config, 'access', _365 => _365.root]) || options.root;
|
|
4824
4829
|
return this.resolve(id, path6.join(root, "package.json"), {
|
|
4825
4830
|
...resolveOptions,
|
|
4826
4831
|
skipSelf: true
|
|
@@ -4848,7 +4853,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4848
4853
|
}
|
|
4849
4854
|
},
|
|
4850
4855
|
async load(id, loadOptions) {
|
|
4851
|
-
if (pendingClientSetup && !_optionalChain([loadOptions, 'optionalAccess',
|
|
4856
|
+
if (pendingClientSetup && !_optionalChain([loadOptions, 'optionalAccess', _366 => _366.ssr]) && !farmSetupContext.getStore()) {
|
|
4852
4857
|
await pendingClientSetup;
|
|
4853
4858
|
}
|
|
4854
4859
|
if (_chunkPIUTGRDIcjs.isFarmServerFnBoundaryId.call(void 0, id) && islandsServerFns()) {
|
|
@@ -4866,8 +4871,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4866
4871
|
if (imageModule) return imageModule;
|
|
4867
4872
|
}
|
|
4868
4873
|
if (_chunkYUCU6XB4cjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
|
|
4869
|
-
const renderer = _optionalChain([farmApp, 'optionalAccess',
|
|
4870
|
-
const root = _optionalChain([server, 'optionalAccess',
|
|
4874
|
+
const renderer = _optionalChain([farmApp, 'optionalAccess', _367 => _367.getConfig, 'call', _368 => _368(), 'access', _369 => _369.renderer]) || _chunkNGTZHWBGcjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
4875
|
+
const root = _optionalChain([server, 'optionalAccess', _370 => _370.config, 'access', _371 => _371.root]) || options.root;
|
|
4871
4876
|
if (isClientEnvironment(this, loadOptions)) {
|
|
4872
4877
|
return generateProgrammaticClientRouteModuleForId(
|
|
4873
4878
|
id,
|
|
@@ -4883,32 +4888,30 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4883
4888
|
return FARM_DEV_CLIENT_BOOT_MODULE;
|
|
4884
4889
|
}
|
|
4885
4890
|
if (isFarmClientVirtualId(id)) {
|
|
4886
|
-
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
4887
|
-
const renderer = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4888
|
-
const integrations = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4889
|
-
const root = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4890
|
-
const docs = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4891
|
-
const adapterOwnsDocsRuntime =
|
|
4892
|
-
|
|
4893
|
-
);
|
|
4894
|
-
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _378 => _378.devtools]), () => ( _chunkSTF6VDYQcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
|
|
4891
|
+
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _372 => _372.getConfig, 'call', _373 => _373()]);
|
|
4892
|
+
const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _374 => _374.renderer]) || _chunkNGTZHWBGcjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
4893
|
+
const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _375 => _375.integrations]) || options.integrations;
|
|
4894
|
+
const root = _optionalChain([resolvedConfig, 'optionalAccess', _376 => _376.root]) || _optionalChain([server, 'optionalAccess', _377 => _377.config, 'access', _378 => _378.root]) || process.cwd();
|
|
4895
|
+
const docs = _optionalChain([resolvedConfig, 'optionalAccess', _379 => _379.docs]);
|
|
4896
|
+
const adapterOwnsDocsRuntime = _chunkL2GUEYHRcjs.hasFarmDocsRuntimeAdapter.call(void 0, docs);
|
|
4897
|
+
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _380 => _380.devtools]), () => ( _chunkSTF6VDYQcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
|
|
4895
4898
|
const [docsRuntime, docsSearchRuntime, devtoolsClientRuntime] = await Promise.all([
|
|
4896
|
-
_optionalChain([docs, 'optionalAccess',
|
|
4897
|
-
_optionalChain([docs, 'optionalAccess',
|
|
4899
|
+
_optionalChain([docs, 'optionalAccess', _381 => _381.enabled]) ? loadFarmDocsDevRuntime() : null,
|
|
4900
|
+
_optionalChain([docs, 'optionalAccess', _382 => _382.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
|
|
4898
4901
|
devtools.enabled ? loadFarmDevtoolsClientRuntime() : null
|
|
4899
4902
|
]);
|
|
4900
|
-
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess',
|
|
4903
|
+
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _383 => _383.isFarmDocsSearchEnabled, 'call', _384 => _384(docs)]), () => ( false));
|
|
4901
4904
|
const generatedDocsSearchRuntime = docsSearchRuntime ? docsSearchRuntime.generateFarmDocsSearchClientRuntime(
|
|
4902
4905
|
docsSearchEnabled,
|
|
4903
4906
|
docsSearchEnabled ? docsSearchRuntime.resolveFarmDocsSearchClientModule(root) : void 0
|
|
4904
4907
|
) : EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME;
|
|
4905
4908
|
const generatedDevtoolsClientRuntime = devtoolsClientRuntime ? devtoolsClientRuntime.generateFarmDevtoolsClientRuntime(devtools) : "";
|
|
4906
|
-
const generatedDevIndicatorsClientRuntime = farmApp ?
|
|
4909
|
+
const generatedDevIndicatorsClientRuntime = farmApp ? _chunkL2GUEYHRcjs.generateFarmDevIndicatorsClientRuntime.call(void 0, farmApp.getConfig().devIndicators) : "";
|
|
4907
4910
|
const integrationProviders = _chunkB3HQTGXScjs.getIntegrationProviders.call(void 0, integrations);
|
|
4908
|
-
const isolatedHydrationMode =
|
|
4909
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4911
|
+
const isolatedHydrationMode = _chunkEFI6QWBQcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
4912
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _385 => _385.experimental, 'optionalAccess', _386 => _386.isolatedClientHydration]),
|
|
4910
4913
|
{
|
|
4911
|
-
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4914
|
+
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _387 => _387.experimental, 'optionalAccess', _388 => _388.serverComponents])) === "rsc",
|
|
4912
4915
|
hasUnsupportedIntegrationProvider: integrationProviders.filter((provider) => provider.component || provider.type === "clerk").some((provider) => provider.supportsIsolatedHydration !== true)
|
|
4913
4916
|
}
|
|
4914
4917
|
);
|
|
@@ -4916,32 +4919,32 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4916
4919
|
integrationProviders,
|
|
4917
4920
|
[
|
|
4918
4921
|
..._chunkB3HQTGXScjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
|
|
4919
|
-
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess',
|
|
4922
|
+
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _389 => _389.getFarmDocsDocumentNavigationMatchers, 'call', _390 => _390(docs)]), () => ( []))
|
|
4920
4923
|
],
|
|
4921
4924
|
generatedDocsSearchRuntime,
|
|
4922
4925
|
`${generatedDevtoolsClientRuntime}
|
|
4923
4926
|
${generatedDevIndicatorsClientRuntime}`,
|
|
4924
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4927
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _391 => _391.plugins]) || [],
|
|
4925
4928
|
root,
|
|
4926
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4927
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4928
|
-
|
|
4929
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _392 => _392.srcDir]) || options.srcDir || "src",
|
|
4930
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _393 => _393.publicRuntimeConfig]) || options.publicRuntimeConfig,
|
|
4931
|
+
adapterOwnsDocsRuntime ? _chunkL2GUEYHRcjs.getFarmDocsAdapterUIModule.call(void 0, _optionalChain([docs, 'optionalAccess', _394 => _394.adapter])) : void 0,
|
|
4929
4932
|
renderer,
|
|
4930
|
-
isolatedHydrationMode === "enabled" ||
|
|
4931
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4932
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4933
|
-
|
|
4934
|
-
|
|
4933
|
+
isolatedHydrationMode === "enabled" || _chunkNGTZHWBGcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _395 => _395.getRouteManager, 'call', _396 => _396(), 'access', _397 => _397.getIsolatedClientBoundaryModules, 'call', _398 => _398(root)])))), 'optionalAccess', _399 => _399.size]) > 0,
|
|
4934
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _400 => _400.trailingSlash]), () => ( false)),
|
|
4935
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _401 => _401.basePath]), () => ( "/")),
|
|
4936
|
+
_chunkJHRJ5V2Fcjs.generateClientCachePersistenceCode.call(void 0,
|
|
4937
|
+
_chunkJHRJ5V2Fcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, _optionalChain([resolvedConfig, 'optionalAccess', _402 => _402.cache]))
|
|
4935
4938
|
),
|
|
4936
|
-
|
|
4937
|
-
_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4939
|
+
adapterOwnsDocsRuntime ? _chunkXJDB564Acjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0,
|
|
4940
|
+
_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _403 => _403.experimental, 'optionalAccess', _404 => _404.serverComponents])) === "islands"
|
|
4938
4941
|
);
|
|
4939
4942
|
}
|
|
4940
4943
|
if (id === "/@farm/server") {
|
|
4941
4944
|
return generateServerCode();
|
|
4942
4945
|
}
|
|
4943
4946
|
if (id === "/@farm/manifest") {
|
|
4944
|
-
const routeManager = _optionalChain([farmApp, 'optionalAccess',
|
|
4947
|
+
const routeManager = _optionalChain([farmApp, 'optionalAccess', _405 => _405.getRouteManager, 'call', _406 => _406()]);
|
|
4945
4948
|
if (!routeManager) {
|
|
4946
4949
|
return `
|
|
4947
4950
|
export const getManifest = () => ({
|
|
@@ -4953,11 +4956,11 @@ export const getManifest = () => ({
|
|
|
4953
4956
|
});
|
|
4954
4957
|
`;
|
|
4955
4958
|
}
|
|
4956
|
-
const globalStylesheetHref =
|
|
4959
|
+
const globalStylesheetHref = _chunkJHRJ5V2Fcjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
4957
4960
|
server.config.root,
|
|
4958
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
4961
|
+
_optionalChain([farmApp, 'optionalAccess', _407 => _407.getConfig, 'call', _408 => _408(), 'access', _409 => _409.srcDir])
|
|
4959
4962
|
);
|
|
4960
|
-
const fullManifest =
|
|
4963
|
+
const fullManifest = _chunkJHRJ5V2Fcjs.createFarmDevClientManifest.call(void 0,
|
|
4961
4964
|
routeManager.generateClientManifest(server.config.root),
|
|
4962
4965
|
{
|
|
4963
4966
|
sharedAssets: globalStylesheetHref ? [{ tag: "link", attrs: { rel: "stylesheet", href: globalStylesheetHref } }] : []
|
|
@@ -4973,64 +4976,64 @@ export { manifest };
|
|
|
4973
4976
|
}
|
|
4974
4977
|
},
|
|
4975
4978
|
async transform(code, id, transformOptions) {
|
|
4976
|
-
if (pendingClientSetup && !_optionalChain([transformOptions, 'optionalAccess',
|
|
4979
|
+
if (pendingClientSetup && !_optionalChain([transformOptions, 'optionalAccess', _410 => _410.ssr]) && !farmSetupContext.getStore()) {
|
|
4977
4980
|
await pendingClientSetup;
|
|
4978
4981
|
}
|
|
4979
|
-
const runtimeModule = !isBuild && _optionalChain([transformOptions, 'optionalAccess',
|
|
4980
|
-
const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
4982
|
+
const runtimeModule = !isBuild && _optionalChain([transformOptions, 'optionalAccess', _411 => _411.ssr]) === true && isOutsideAppRoot(id) ? toFarmRuntimeModuleId : void 0;
|
|
4983
|
+
const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _412 => _412.getConfig, 'call', _413 => _413()]), () => ( options));
|
|
4981
4984
|
let rewrotePackageImports = false;
|
|
4982
|
-
if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access',
|
|
4985
|
+
if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access', _414 => _414.experimental, 'optionalAccess', _415 => _415.serverComponents])) === "islands" && (!id.includes("/node_modules/") || _optionalChain([transformOptions, 'optionalAccess', _416 => _416.ssr]) === true && farmReactServerFiles.has(id.split("?", 1)[0])) && !id.startsWith("\0") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id) && !_chunkEFI6QWBQcjs.hasUseClientDirective.call(void 0, code)) {
|
|
4983
4986
|
const file = id.split("?", 1)[0];
|
|
4984
|
-
const projectRoot = actionConfig.root || _optionalChain([server, 'optionalAccess',
|
|
4987
|
+
const projectRoot = actionConfig.root || _optionalChain([server, 'optionalAccess', _417 => _417.config, 'access', _418 => _418.root]) || process.cwd();
|
|
4985
4988
|
const buildSnapshot = isBuild ? options.sourceSnapshot : void 0;
|
|
4986
4989
|
const rewrite = () => {
|
|
4987
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
4990
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _419 => _419.ssr]) === true) {
|
|
4988
4991
|
if (farmReactServerFiles.has(file)) {
|
|
4989
|
-
for (const child of
|
|
4992
|
+
for (const child of _chunkEFI6QWBQcjs.farmRelativeImportFiles.call(void 0, code, file))
|
|
4990
4993
|
farmReactServerFiles.add(child);
|
|
4991
4994
|
}
|
|
4992
|
-
const serverModule = farmReactServerFiles.has(file) || !
|
|
4995
|
+
const serverModule = farmReactServerFiles.has(file) || !_chunkEFI6QWBQcjs.getFarmClientReachableModules.call(void 0,
|
|
4993
4996
|
path6.resolve(projectRoot, actionConfig.srcDir || "src"),
|
|
4994
4997
|
projectRoot
|
|
4995
4998
|
).has(path6.resolve(file));
|
|
4996
|
-
const reactServer = !serverModule ? null :
|
|
4999
|
+
const reactServer = !serverModule ? null : _chunkEFI6QWBQcjs.rewriteFarmReactServerImports.call(void 0, {
|
|
4997
5000
|
code,
|
|
4998
5001
|
file,
|
|
4999
|
-
reference: (specifier, exportName) =>
|
|
5002
|
+
reference: (specifier, exportName) => _chunkEFI6QWBQcjs.ensureFarmPackageClientReference.call(void 0, projectRoot, specifier, exportName, file),
|
|
5000
5003
|
onServerFile: (serverFile) => farmReactServerFiles.add(serverFile)
|
|
5001
5004
|
});
|
|
5002
5005
|
if (reactServer !== null) {
|
|
5003
5006
|
code = reactServer;
|
|
5004
5007
|
rewrotePackageImports = true;
|
|
5005
5008
|
}
|
|
5006
|
-
const internal = farmReactServerFiles.has(file) ?
|
|
5009
|
+
const internal = farmReactServerFiles.has(file) ? _chunkEFI6QWBQcjs.rewriteFarmReactServerClientModuleImports.call(void 0, {
|
|
5007
5010
|
code,
|
|
5008
5011
|
file,
|
|
5009
|
-
reference: (clientFile) =>
|
|
5012
|
+
reference: (clientFile) => _chunkEFI6QWBQcjs.ensureFarmInternalClientReference.call(void 0, projectRoot, clientFile)
|
|
5010
5013
|
}) : null;
|
|
5011
5014
|
if (internal !== null) {
|
|
5012
5015
|
code = internal;
|
|
5013
5016
|
rewrotePackageImports = true;
|
|
5014
5017
|
}
|
|
5015
5018
|
}
|
|
5016
|
-
const rewritePackageImports = (source2) =>
|
|
5019
|
+
const rewritePackageImports = (source2) => _chunkEFI6QWBQcjs.rewriteFarmPackageClientImports.call(void 0, {
|
|
5017
5020
|
code: source2,
|
|
5018
5021
|
file,
|
|
5019
5022
|
root: projectRoot,
|
|
5020
|
-
isClientPackage: (specifier) =>
|
|
5023
|
+
isClientPackage: (specifier) => _chunkEFI6QWBQcjs.isFarmPackageClientBoundary.call(void 0, file, specifier, projectRoot)
|
|
5021
5024
|
});
|
|
5022
|
-
const routeManager = _optionalChain([farmApp, 'optionalAccess',
|
|
5025
|
+
const routeManager = _optionalChain([farmApp, 'optionalAccess', _420 => _420.getRouteManager, 'call', _421 => _421()]);
|
|
5023
5026
|
const source = code;
|
|
5024
5027
|
const referenced = routeManager ? routeManager.inspectPackages(() => rewritePackageImports(source)) : rewritePackageImports(source);
|
|
5025
5028
|
if (referenced !== null) {
|
|
5026
5029
|
code = referenced;
|
|
5027
5030
|
rewrotePackageImports = true;
|
|
5028
5031
|
}
|
|
5029
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
5032
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _422 => _422.ssr]) === true) {
|
|
5030
5033
|
const cached = rewriteFarmReactCacheImport(
|
|
5031
5034
|
code,
|
|
5032
5035
|
file,
|
|
5033
|
-
_optionalChain([runtimeModule, 'optionalCall',
|
|
5036
|
+
_optionalChain([runtimeModule, 'optionalCall', _423 => _423(FARM_REACT_CACHE_MODULE)])
|
|
5034
5037
|
);
|
|
5035
5038
|
if (cached !== null) {
|
|
5036
5039
|
code = cached;
|
|
@@ -5038,12 +5041,12 @@ export { manifest };
|
|
|
5038
5041
|
}
|
|
5039
5042
|
}
|
|
5040
5043
|
};
|
|
5041
|
-
if (buildSnapshot)
|
|
5044
|
+
if (buildSnapshot) _chunkEFI6QWBQcjs.withFarmSourceSnapshotOf.call(void 0, buildSnapshot, rewrite);
|
|
5042
5045
|
else rewrite();
|
|
5043
5046
|
}
|
|
5044
5047
|
if (islandsServerFns() && !_chunkPIUTGRDIcjs.isFarmServerFnBoundaryId.call(void 0, id) && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
|
|
5045
5048
|
const serverFns = _chunkPIUTGRDIcjs.transformFarmServerFns.call(void 0, code, id, {
|
|
5046
|
-
environment: _optionalChain([transformOptions, 'optionalAccess',
|
|
5049
|
+
environment: _optionalChain([transformOptions, 'optionalAccess', _424 => _424.ssr]) === true ? "rsc" : "client"
|
|
5047
5050
|
});
|
|
5048
5051
|
if (serverFns) {
|
|
5049
5052
|
if (!serverFns.code.includes("use server")) return { code: serverFns.code, map: null };
|
|
@@ -5056,8 +5059,8 @@ export { manifest };
|
|
|
5056
5059
|
const actionModule = transformFarmFormActionModule({
|
|
5057
5060
|
code,
|
|
5058
5061
|
id,
|
|
5059
|
-
root: actionConfig.root || _optionalChain([server, 'optionalAccess',
|
|
5060
|
-
ssr: _optionalChain([transformOptions, 'optionalAccess',
|
|
5062
|
+
root: actionConfig.root || _optionalChain([server, 'optionalAccess', _425 => _425.config, 'access', _426 => _426.root]) || process.cwd(),
|
|
5063
|
+
ssr: _optionalChain([transformOptions, 'optionalAccess', _427 => _427.ssr]) === true,
|
|
5061
5064
|
// Parsed by file type: page components are TSX.
|
|
5062
5065
|
parse: (source) => _vite.parseSync.call(void 0, file, source).program,
|
|
5063
5066
|
runtimeModule,
|
|
@@ -5065,21 +5068,21 @@ export { manifest };
|
|
|
5065
5068
|
});
|
|
5066
5069
|
if (actionModule) return { code: actionModule, map: null };
|
|
5067
5070
|
}
|
|
5068
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
5069
|
-
const docsConfigModule =
|
|
5070
|
-
if (
|
|
5071
|
-
const redacted =
|
|
5071
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _428 => _428.ssr])) {
|
|
5072
|
+
const docsConfigModule = _chunkXJDB564Acjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess', _429 => _429.getConfig, 'call', _430 => _430(), 'optionalAccess', _431 => _431.docs]));
|
|
5073
|
+
if (_chunkJHRJ5V2Fcjs.isFarmDocsClientConfigModule.call(void 0, id, docsConfigModule)) {
|
|
5074
|
+
const redacted = _chunkJHRJ5V2Fcjs.redactFarmDocsClientConfig.call(void 0, code, id.split("?")[0]);
|
|
5072
5075
|
if (redacted !== null) return { code: redacted, map: null };
|
|
5073
5076
|
}
|
|
5074
5077
|
}
|
|
5075
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
5076
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
5077
|
-
if ((_optionalChain([currentConfig, 'access',
|
|
5078
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _432 => _432.ssr])) {
|
|
5079
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _433 => _433.getConfig, 'call', _434 => _434()]), () => ( options));
|
|
5080
|
+
if ((_optionalChain([currentConfig, 'access', _435 => _435.experimental, 'optionalAccess', _436 => _436.serverActions]) !== true || !serverFnTransformActive) && !islandsServerFns()) {
|
|
5078
5081
|
const violation = findClientServerFnViolation(code, id);
|
|
5079
5082
|
if (violation) {
|
|
5080
|
-
const locate =
|
|
5083
|
+
const locate = _chunkEFI6QWBQcjs.createFarmSourceLocator.call(void 0, code, () => this.getCombinedSourcemap());
|
|
5081
5084
|
this.error(
|
|
5082
|
-
|
|
5085
|
+
_chunkEFI6QWBQcjs.formatFarmDiagnostic.call(void 0,
|
|
5083
5086
|
createServerFnBoundaryDiagnostic(violation, id, locate(violation.start)),
|
|
5084
5087
|
currentConfig.root
|
|
5085
5088
|
)
|
|
@@ -5087,8 +5090,8 @@ export { manifest };
|
|
|
5087
5090
|
}
|
|
5088
5091
|
}
|
|
5089
5092
|
}
|
|
5090
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
5091
|
-
await warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
5093
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _437 => _437.ssr]) && shouldInspectClientBoundary(id, code)) {
|
|
5094
|
+
await warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _438 => _438.getConfig, 'call', _439 => _439()]), () => ( options)));
|
|
5092
5095
|
}
|
|
5093
5096
|
if (typeof imageImports.transform === "function") {
|
|
5094
5097
|
const imageModule = await imageImports.transform.call(this, code, id, transformOptions);
|
|
@@ -5103,13 +5106,13 @@ export { manifest };
|
|
|
5103
5106
|
id,
|
|
5104
5107
|
transformOptions
|
|
5105
5108
|
);
|
|
5106
|
-
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess',
|
|
5109
|
+
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _440 => _440.code, 'optionalAccess', _441 => _441.toString, 'call', _442 => _442()]);
|
|
5107
5110
|
if (fontCode) {
|
|
5108
5111
|
transformedCode = fontCode;
|
|
5109
5112
|
transformed = true;
|
|
5110
5113
|
}
|
|
5111
5114
|
}
|
|
5112
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
5115
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _443 => _443.ssr]) && server) {
|
|
5113
5116
|
const rewrittenImports = rewriteEarlySsrRelativeImports({
|
|
5114
5117
|
code: transformedCode,
|
|
5115
5118
|
id,
|
|
@@ -5121,26 +5124,26 @@ export { manifest };
|
|
|
5121
5124
|
transformed = true;
|
|
5122
5125
|
}
|
|
5123
5126
|
}
|
|
5124
|
-
if (
|
|
5127
|
+
if (_chunkEFI6QWBQcjs.hasUseClientDirective.call(void 0, transformedCode)) {
|
|
5125
5128
|
const clientBoundarySource = transformedCode;
|
|
5126
5129
|
const moduleInfo = this.getModuleInfo(id);
|
|
5127
5130
|
if (moduleInfo) {
|
|
5128
5131
|
moduleInfo.isClientComponent = true;
|
|
5129
5132
|
}
|
|
5130
|
-
transformedCode =
|
|
5133
|
+
transformedCode = _chunkEFI6QWBQcjs.stripUseClientDirective.call(void 0, transformedCode);
|
|
5131
5134
|
transformed = true;
|
|
5132
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
5135
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _444 => _444.getConfig, 'call', _445 => _445()]), () => ( options));
|
|
5133
5136
|
let isolatedModuleReference = null;
|
|
5134
|
-
const root = currentConfig.root || _optionalChain([server, 'optionalAccess',
|
|
5137
|
+
const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _446 => _446.config, 'access', _447 => _447.root]) || process.cwd();
|
|
5135
5138
|
const cleanId = id.split("?", 1)[0];
|
|
5136
|
-
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
5137
|
-
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess',
|
|
5138
|
-
if (
|
|
5139
|
-
cleanId.replace(/\\/g, "/").includes(
|
|
5139
|
+
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _448 => _448.getRouteManager, 'call', _449 => _449(), 'access', _450 => _450.getIsolatedClientBoundaryModules, 'call', _451 => _451(root)])));
|
|
5140
|
+
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _452 => _452.has, 'call', _453 => _453(path6.resolve(cleanId))]) === true;
|
|
5141
|
+
if (_chunkNGTZHWBGcjs.isReactRenderer.call(void 0, _chunkNGTZHWBGcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && (_chunkEFI6QWBQcjs.isIsolatableClientBoundarySource.call(void 0, clientBoundarySource) || // A generated client reference, whose marker comment compiled TSX no longer has.
|
|
5142
|
+
cleanId.replace(/\\/g, "/").includes(_chunkEFI6QWBQcjs.FARM_CLIENT_REFERENCE_DIRECTORY))) {
|
|
5140
5143
|
isolatedModuleReference = _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, cleanId, root);
|
|
5141
|
-
const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([currentConfig, 'access',
|
|
5142
|
-
const explicitStrategy =
|
|
5143
|
-
const inference = islandsMode && explicitStrategy === null ?
|
|
5144
|
+
const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([currentConfig, 'access', _454 => _454.experimental, 'optionalAccess', _455 => _455.serverComponents])) === "islands";
|
|
5145
|
+
const explicitStrategy = _chunkEFI6QWBQcjs.getIslandStrategyExport.call(void 0, clientBoundarySource);
|
|
5146
|
+
const inference = islandsMode && explicitStrategy === null ? _chunkJHRJ5V2Fcjs.inferFarmIslandStrategy.call(void 0, cleanId, root) : null;
|
|
5144
5147
|
if (inference) {
|
|
5145
5148
|
for (const file of inference.files) {
|
|
5146
5149
|
if (file !== path6.resolve(cleanId)) this.addWatchFile(file);
|
|
@@ -5153,8 +5156,8 @@ export { manifest };
|
|
|
5153
5156
|
islandStrategy: _nullishCoalesce(explicitStrategy, () => ( "load")),
|
|
5154
5157
|
parse: (source) => this.parse(source),
|
|
5155
5158
|
slots: islandsMode,
|
|
5156
|
-
browser: _optionalChain([transformOptions, 'optionalAccess',
|
|
5157
|
-
inferredInteraction: _optionalChain([inference, 'optionalAccess',
|
|
5159
|
+
browser: _optionalChain([transformOptions, 'optionalAccess', _456 => _456.ssr]) !== true,
|
|
5160
|
+
inferredInteraction: _optionalChain([inference, 'optionalAccess', _457 => _457.strategy]) === "interaction",
|
|
5158
5161
|
runtimeModule
|
|
5159
5162
|
});
|
|
5160
5163
|
if (!transformedBoundary) {
|
|
@@ -5185,7 +5188,7 @@ export { manifest };
|
|
|
5185
5188
|
);
|
|
5186
5189
|
return;
|
|
5187
5190
|
}` : "";
|
|
5188
|
-
const hmrCode = _optionalChain([transformOptions, 'optionalAccess',
|
|
5191
|
+
const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _458 => _458.ssr]) || reactRefreshActive || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
|
|
5189
5192
|
if (import.meta.hot) {
|
|
5190
5193
|
import.meta.hot.accept((newModule) => {
|
|
5191
5194
|
${isolatedHmrUpdate}
|
|
@@ -5241,14 +5244,14 @@ if (import.meta.hot) {
|
|
|
5241
5244
|
}
|
|
5242
5245
|
_chunk7U4XF76Rcjs.logger.info(`Found ${ssgPages.length} SSG pages, ${ssrRoutes.length} SSR routes`);
|
|
5243
5246
|
_chunk7U4XF76Rcjs.logger.info("Pre-rendering SSG pages...");
|
|
5244
|
-
const outDir = path6.join(_optionalChain([server, 'optionalAccess',
|
|
5247
|
+
const outDir = path6.join(_optionalChain([server, 'optionalAccess', _459 => _459.config, 'access', _460 => _460.root]) || process.cwd(), options.outDir || "dist");
|
|
5245
5248
|
const clientDir = path6.join(outDir, "client");
|
|
5246
5249
|
for (const page of ssgPages) {
|
|
5247
5250
|
try {
|
|
5248
5251
|
const staticRequest = new Request(new URL(page.urlPath, "http://farm.static"));
|
|
5249
5252
|
await farmApp.getServerRenderer().runWithRequestContext(staticRequest, async () => {
|
|
5250
5253
|
const mod = await routeManager.loadRouteModule(page.filePath);
|
|
5251
|
-
if (!_optionalChain([mod, 'optionalAccess',
|
|
5254
|
+
if (!_optionalChain([mod, 'optionalAccess', _461 => _461.default])) return;
|
|
5252
5255
|
const { layouts } = routeManager.matchRoute(page.urlPath);
|
|
5253
5256
|
const layoutModules = await Promise.all(
|
|
5254
5257
|
layouts.map((l) => routeManager.loadLayoutModule(l.modulePath))
|
|
@@ -5280,7 +5283,7 @@ if (import.meta.hot) {
|
|
|
5280
5283
|
const i18nSnapshot = _chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
5281
5284
|
const i18nHead = renderFarmI18nStaticHead(page.urlPath, i18nSnapshot);
|
|
5282
5285
|
const fullHtml = `<!DOCTYPE html>
|
|
5283
|
-
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
5286
|
+
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _462 => _462.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
|
|
5284
5287
|
<head>
|
|
5285
5288
|
<meta charset="utf-8">
|
|
5286
5289
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
@@ -5325,12 +5328,12 @@ if (import.meta.hot) {
|
|
|
5325
5328
|
watchChange(id, change) {
|
|
5326
5329
|
const watched = _chunk7U4XF76Rcjs.toPosixPath.call(void 0, id);
|
|
5327
5330
|
if (!watched.includes("/node_modules/") && !isFarmGeneratedOutput(watched)) {
|
|
5328
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
5331
|
+
_optionalChain([farmApp, 'optionalAccess', _463 => _463.getRouteManager, 'call', _464 => _464(), 'access', _465 => _465.noteSourceChange, 'call', _466 => _466(id, change.event)]);
|
|
5329
5332
|
}
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5333
|
+
_chunkEFI6QWBQcjs.invalidateFarmClientReachableModules.call(void 0, );
|
|
5334
|
+
_chunkEFI6QWBQcjs.invalidateFarmClientOnlyScan.call(void 0, );
|
|
5335
|
+
_chunkJHRJ5V2Fcjs.invalidateFarmRouteRootInferences.call(void 0, );
|
|
5336
|
+
_chunkEFI6QWBQcjs.dropLatestPackageClientBoundaryCache.call(void 0, );
|
|
5334
5337
|
},
|
|
5335
5338
|
async handleHotUpdate(ctx) {
|
|
5336
5339
|
if (pendingClientSetup && !farmSetupContext.getStore()) await pendingClientSetup;
|
|
@@ -5355,7 +5358,7 @@ if (import.meta.hot) {
|
|
|
5355
5358
|
server2.moduleGraph.invalidateModule(mod);
|
|
5356
5359
|
}
|
|
5357
5360
|
}
|
|
5358
|
-
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
5361
|
+
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _467 => _467.getConfig, 'call', _468 => _468()]);
|
|
5359
5362
|
const normalizedFile = file.replace(/\\/g, "/");
|
|
5360
5363
|
const reloadAfterEdit = () => {
|
|
5361
5364
|
for (const files of pendingRouteReloads) {
|
|
@@ -5363,10 +5366,10 @@ if (import.meta.hot) {
|
|
|
5363
5366
|
}
|
|
5364
5367
|
server2.ws.send({ type: "full-reload", path: "*" });
|
|
5365
5368
|
};
|
|
5366
|
-
if (normalizedFile.includes(
|
|
5369
|
+
if (normalizedFile.includes(_chunkEFI6QWBQcjs.FARM_CLIENT_REFERENCE_DIRECTORY) && normalizedFile.startsWith(
|
|
5367
5370
|
path6.posix.join(
|
|
5368
|
-
_chunk7U4XF76Rcjs.toPosixPath.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
5369
|
-
|
|
5371
|
+
_chunk7U4XF76Rcjs.toPosixPath.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _469 => _469.root]) || options.root || server2.config.root),
|
|
5372
|
+
_chunkEFI6QWBQcjs.FARM_CLIENT_REFERENCE_DIRECTORY
|
|
5370
5373
|
)
|
|
5371
5374
|
))
|
|
5372
5375
|
return modules;
|
|
@@ -5374,7 +5377,7 @@ if (import.meta.hot) {
|
|
|
5374
5377
|
(appDir) => normalizedFile.startsWith(`${_chunk7U4XF76Rcjs.toPosixPath.call(void 0, appDir)}/api/`)
|
|
5375
5378
|
)) {
|
|
5376
5379
|
for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
|
|
5377
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
5380
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _470 => _470(`updated ${file}`)]);
|
|
5378
5381
|
reloadAfterEdit();
|
|
5379
5382
|
return [];
|
|
5380
5383
|
}
|
|
@@ -5384,7 +5387,7 @@ if (import.meta.hot) {
|
|
|
5384
5387
|
for (const mod of modules) {
|
|
5385
5388
|
server2.moduleGraph.invalidateModule(mod);
|
|
5386
5389
|
}
|
|
5387
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
5390
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _471 => _471(`updated ${file}`)]);
|
|
5388
5391
|
reloadAfterEdit();
|
|
5389
5392
|
return [];
|
|
5390
5393
|
}
|
|
@@ -5394,22 +5397,22 @@ if (import.meta.hot) {
|
|
|
5394
5397
|
for (const mod of modules) {
|
|
5395
5398
|
server2.moduleGraph.invalidateModule(mod);
|
|
5396
5399
|
}
|
|
5397
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
5400
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _472 => _472(`updated ${file}`)]);
|
|
5398
5401
|
reloadAfterEdit();
|
|
5399
5402
|
return [];
|
|
5400
5403
|
}
|
|
5401
5404
|
if (apiRouteManager && _chunk25JGHAGHcjs.invalidateFarmDevDependents.call(void 0, server2, file, apiRouteManager.getSourceFiles()).length > 0) {
|
|
5402
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
5405
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _473 => _473(`updated ${file}`)]);
|
|
5403
5406
|
}
|
|
5404
|
-
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
5405
|
-
const planRouteManager = _optionalChain([farmApp, 'optionalAccess',
|
|
5407
|
+
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _474 => _474.experimental, 'optionalAccess', _475 => _475.isolatedClientHydration]);
|
|
5408
|
+
const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _476 => _476.getRouteManager, 'call', _477 => _477()]);
|
|
5406
5409
|
const isHydrationPlanSource = /\.[cm]?[jt]sx?$/.test(normalizedFile) && !normalizedFile.includes("/node_modules/") && !isFarmGeneratedOutput(normalizedFile);
|
|
5407
|
-
const tracksAsyncOwnerIslands =
|
|
5410
|
+
const tracksAsyncOwnerIslands = _chunkNGTZHWBGcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _478 => _478.renderer])) && planRouteManager !== void 0;
|
|
5408
5411
|
let clientPlanCurrent = false;
|
|
5409
5412
|
if (isHydrationPlanSource && (isolatedHydrationMode === "enabled" || isolatedHydrationMode === "analyze" || tracksAsyncOwnerIslands)) {
|
|
5410
5413
|
const routeManager = planRouteManager;
|
|
5411
|
-
await _optionalChain([ctx, 'access',
|
|
5412
|
-
if (_optionalChain([routeManager, 'optionalAccess',
|
|
5414
|
+
await _optionalChain([ctx, 'access', _479 => _479.read, 'optionalCall', _480 => _480()]);
|
|
5415
|
+
if (_optionalChain([routeManager, 'optionalAccess', _481 => _481.isEditPlanNeutral, 'call', _482 => _482(file)])) {
|
|
5413
5416
|
clientPlanCurrent = true;
|
|
5414
5417
|
} else if (routeManager) {
|
|
5415
5418
|
routeManager.noteSourceChange(file, "update");
|
|
@@ -5453,7 +5456,8 @@ if (import.meta.hot) {
|
|
|
5453
5456
|
}
|
|
5454
5457
|
}
|
|
5455
5458
|
}
|
|
5456
|
-
|
|
5459
|
+
const rendererRouteFile = _optionalChain([farmApp, 'optionalAccess', _483 => _483.getRouteManager, 'call', _484 => _484(), 'access', _485 => _485.isRendererRouteModule, 'call', _486 => _486(normalizedFile)]) === true;
|
|
5460
|
+
if (normalizedFile.includes("/app/") || rendererRouteFile) {
|
|
5457
5461
|
if (normalizedFile.includes("middleware.")) {
|
|
5458
5462
|
if (middlewareManager) {
|
|
5459
5463
|
await middlewareManager.reload();
|
|
@@ -5470,12 +5474,12 @@ if (import.meta.hot) {
|
|
|
5470
5474
|
}
|
|
5471
5475
|
return [];
|
|
5472
5476
|
}
|
|
5473
|
-
if (!clientPlanCurrent) _optionalChain([farmApp, 'optionalAccess',
|
|
5477
|
+
if (!clientPlanCurrent) _optionalChain([farmApp, 'optionalAccess', _487 => _487.getRouteManager, 'call', _488 => _488(), 'access', _489 => _489.invalidateClientManifest, 'call', _490 => _490()]);
|
|
5474
5478
|
const manifestModule = server2.moduleGraph.getModuleById("/@farm/manifest");
|
|
5475
5479
|
if (manifestModule) {
|
|
5476
5480
|
server2.moduleGraph.invalidateModule(manifestModule);
|
|
5477
5481
|
}
|
|
5478
|
-
if (normalizedFile.includes("page.") || normalizedFile.includes("layout.")) {
|
|
5482
|
+
if (normalizedFile.includes("page.") || normalizedFile.includes("layout.") || rendererRouteFile) {
|
|
5479
5483
|
const shortPath = normalizedFile.split("/app/")[1] || normalizedFile;
|
|
5480
5484
|
logUpdate("PAGE", `updated ${shortPath}`);
|
|
5481
5485
|
for (const mod of modules) {
|
|
@@ -5485,7 +5489,7 @@ if (import.meta.hot) {
|
|
|
5485
5489
|
return [];
|
|
5486
5490
|
}
|
|
5487
5491
|
}
|
|
5488
|
-
if (/\.[cm]?[jt]sx?$/.test(normalizedFile) && !_optionalChain([server2, 'access',
|
|
5492
|
+
if (/\.[cm]?[jt]sx?$/.test(normalizedFile) && !_optionalChain([server2, 'access', _491 => _491.environments, 'access', _492 => _492.client, 'optionalAccess', _493 => _493.moduleGraph, 'access', _494 => _494.getModulesByFile, 'call', _495 => _495(normalizedFile), 'optionalAccess', _496 => _496.size]) && _chunk25JGHAGHcjs.invalidateFarmDevDependents.call(void 0, server2, file, getFarmRenderedServerModules()).length > 0) {
|
|
5489
5493
|
logUpdate("PAGE", `updated ${path6.basename(file)}`);
|
|
5490
5494
|
reloadAfterEdit();
|
|
5491
5495
|
return [];
|
|
@@ -5583,7 +5587,7 @@ function createPageDataMiddlewareResponse(res) {
|
|
|
5583
5587
|
return (...args) => {
|
|
5584
5588
|
if (captures(target.statusCode, target.getHeader("location"))) {
|
|
5585
5589
|
const callback = args.find((arg) => typeof arg === "function");
|
|
5586
|
-
_optionalChain([callback, 'optionalCall',
|
|
5590
|
+
_optionalChain([callback, 'optionalCall', _497 => _497()]);
|
|
5587
5591
|
return property === "write" ? true : response;
|
|
5588
5592
|
}
|
|
5589
5593
|
return target[property](...args);
|
|
@@ -5647,12 +5651,12 @@ function isFarmClientVirtualId(id) {
|
|
|
5647
5651
|
}
|
|
5648
5652
|
function isClientEnvironment(context, loadOptions) {
|
|
5649
5653
|
const environment = context.environment;
|
|
5650
|
-
if (_optionalChain([environment, 'optionalAccess',
|
|
5651
|
-
if (_optionalChain([environment, 'optionalAccess',
|
|
5652
|
-
return _optionalChain([loadOptions, 'optionalAccess',
|
|
5654
|
+
if (_optionalChain([environment, 'optionalAccess', _498 => _498.config, 'optionalAccess', _499 => _499.consumer])) return environment.config.consumer === "client";
|
|
5655
|
+
if (_optionalChain([environment, 'optionalAccess', _500 => _500.name])) return environment.name === "client";
|
|
5656
|
+
return _optionalChain([loadOptions, 'optionalAccess', _501 => _501.ssr]) !== true;
|
|
5653
5657
|
}
|
|
5654
5658
|
function invalidateProgrammaticClientRouteModules(server) {
|
|
5655
|
-
const graph = _optionalChain([server, 'access',
|
|
5659
|
+
const graph = _optionalChain([server, 'access', _502 => _502.environments, 'optionalAccess', _503 => _503.client, 'optionalAccess', _504 => _504.moduleGraph]);
|
|
5656
5660
|
if (!graph) return;
|
|
5657
5661
|
for (const [id, module] of graph.idToModuleMap) {
|
|
5658
5662
|
if (_chunkYUCU6XB4cjs.parseProgrammaticRouteModuleId.call(void 0, id)) graph.invalidateModule(module);
|
|
@@ -5662,27 +5666,27 @@ function generateProgrammaticClientRouteModuleForId(moduleId, root, renderer, cl
|
|
|
5662
5666
|
const parsed = _chunkYUCU6XB4cjs.parseProgrammaticRouteModuleId.call(void 0, moduleId);
|
|
5663
5667
|
const routesFile = resolveRealModuleFile(parsed.filePath, root);
|
|
5664
5668
|
watchFile(routesFile);
|
|
5665
|
-
return
|
|
5669
|
+
return _chunkEFI6QWBQcjs.generateProgrammaticClientRouteModule.call(void 0, {
|
|
5666
5670
|
kind: parsed.kind,
|
|
5667
5671
|
routePath: parsed.routePath,
|
|
5668
5672
|
routesFile,
|
|
5669
|
-
route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess',
|
|
5670
|
-
|
|
5673
|
+
route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess', _505 => _505.routes, 'access', _506 => _506.get, 'call', _507 => _507(
|
|
5674
|
+
_chunkEFI6QWBQcjs.programmaticClientRouteKey.call(void 0, routesFile, parsed.kind, parsed.routePath)
|
|
5671
5675
|
)]),
|
|
5672
5676
|
// React's client module exports no createElement; the main client entry imports React too.
|
|
5673
|
-
rendererClient:
|
|
5677
|
+
rendererClient: _chunkNGTZHWBGcjs.isReactRenderer.call(void 0, renderer) ? "react" : renderer.client,
|
|
5674
5678
|
toImportSpecifier: (file) => toProgrammaticRouteImportSpecifier(file, root)
|
|
5675
5679
|
});
|
|
5676
5680
|
}
|
|
5677
5681
|
function resolveRealModuleFile(filePath, root) {
|
|
5678
|
-
const resolved = _nullishCoalesce(
|
|
5682
|
+
const resolved = _nullishCoalesce(_chunkEFI6QWBQcjs.resolveModuleSourcePath.call(void 0, filePath, root), () => ( filePath));
|
|
5679
5683
|
try {
|
|
5680
5684
|
return _chunk7U4XF76Rcjs.toPosixPath.call(void 0, fs2.realpathSync(resolved));
|
|
5681
5685
|
} catch (e29) {
|
|
5682
5686
|
return _chunk7U4XF76Rcjs.toPosixPath.call(void 0, resolved);
|
|
5683
5687
|
}
|
|
5684
5688
|
}
|
|
5685
|
-
function generateProgrammaticRouteModule(moduleId, root, renderer =
|
|
5689
|
+
function generateProgrammaticRouteModule(moduleId, root, renderer = _chunkNGTZHWBGcjs.REACT_RENDERER) {
|
|
5686
5690
|
const parsed = _chunkYUCU6XB4cjs.parseProgrammaticRouteModuleId.call(void 0, moduleId);
|
|
5687
5691
|
if (!parsed) {
|
|
5688
5692
|
return "";
|
|
@@ -5989,12 +5993,12 @@ async function parseRouteModuleProps(routeModule, input) {
|
|
|
5989
5993
|
}
|
|
5990
5994
|
const schemas = routeModule.__farmRouteSchemas;
|
|
5991
5995
|
const params = parseRouteModuleSchema(
|
|
5992
|
-
_optionalChain([schemas, 'optionalAccess',
|
|
5996
|
+
_optionalChain([schemas, 'optionalAccess', _508 => _508.params]),
|
|
5993
5997
|
input.props.params,
|
|
5994
5998
|
"params",
|
|
5995
5999
|
input.routePath
|
|
5996
6000
|
);
|
|
5997
|
-
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess',
|
|
6001
|
+
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _509 => _509.search]), input.search, "search", input.routePath);
|
|
5998
6002
|
return {
|
|
5999
6003
|
...input.props,
|
|
6000
6004
|
params,
|
|
@@ -6013,8 +6017,8 @@ function parseRouteModuleSchema(schema, value, label, routePath) {
|
|
|
6013
6017
|
throw new Error(`Invalid ${label} for route "${routePath}": ${message}`);
|
|
6014
6018
|
}
|
|
6015
6019
|
}
|
|
6016
|
-
function generateClientCode(integrationProviders = [], documentNavigationMatchers = [], docsSearchClientRuntime = EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME, devtoolsClientRuntime = "", plugins = [], root = process.cwd(), srcDir = "src", publicRuntimeConfig = void 0,
|
|
6017
|
-
const providerClientCode =
|
|
6020
|
+
function generateClientCode(integrationProviders = [], documentNavigationMatchers = [], docsSearchClientRuntime = EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME, devtoolsClientRuntime = "", plugins = [], root = process.cwd(), srcDir = "src", publicRuntimeConfig = void 0, docsAdapterUI, renderer = _chunkNGTZHWBGcjs.REACT_RENDERER, isolatedHydrationEnabled = false, trailingSlash = false, basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false) {
|
|
6021
|
+
const providerClientCode = _chunkJHRJ5V2Fcjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
6018
6022
|
integrationProviders,
|
|
6019
6023
|
root,
|
|
6020
6024
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
@@ -6025,8 +6029,8 @@ function generateClientCode(integrationProviders = [], documentNavigationMatcher
|
|
|
6025
6029
|
srcDir,
|
|
6026
6030
|
publicRuntimeConfig
|
|
6027
6031
|
);
|
|
6028
|
-
const appSetupPath =
|
|
6029
|
-
const rendererClientImports =
|
|
6032
|
+
const appSetupPath = _chunkNGTZHWBGcjs.resolveFarmRendererAppSetup.call(void 0, root, renderer);
|
|
6033
|
+
const rendererClientImports = _chunkNGTZHWBGcjs.isReactRenderer.call(void 0, renderer) ? `import React from 'react'
|
|
6030
6034
|
import { hydrateRoot, createRoot } from 'react-dom/client'
|
|
6031
6035
|
import { restorePagePosition } from '@farm.js/core/internal/client-runtime'` : (
|
|
6032
6036
|
// Named exports only: a renderer's client module needs no default export. `React` is a
|
|
@@ -6041,9 +6045,11 @@ import { hydrateRoot, createRoot } from ${JSON.stringify(renderer.client)}
|
|
|
6041
6045
|
const React = { ...__farmRendererClient }`
|
|
6042
6046
|
);
|
|
6043
6047
|
const isolatedHydrationImport = isolatedHydrationEnabled ? `${islandValues ? "import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph, createFarmServerTreeElement, createFarmServerTreeLayout } from '@farm.js/core/internal/islands-runtime'" : "import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph } from '@farm.js/core/internal/isolated-boundary'\nimport { createFarmServerTreeElement } from '@farm.js/core/internal/server-tree'"}` : "";
|
|
6044
|
-
const docsAdapterImportBlock =
|
|
6045
|
-
|
|
6046
|
-
docsConfigModule
|
|
6048
|
+
const docsAdapterImportBlock = _chunkXJDB564Acjs.generateFarmDocsAdapterClientRuntime.call(void 0,
|
|
6049
|
+
docsAdapterUI,
|
|
6050
|
+
docsConfigModule,
|
|
6051
|
+
// Config resolution keeps an adapter to its UI's renderer, so this is the UI's renderer too.
|
|
6052
|
+
_chunkNGTZHWBGcjs.isReactRenderer.call(void 0, renderer) ? void 0 : renderer.client
|
|
6047
6053
|
);
|
|
6048
6054
|
const isolatedHydrationRuntime = isolatedHydrationEnabled ? `const farmIsolatedHydrationRuntime = createFarmIsolatedHydrationRuntime({
|
|
6049
6055
|
ReactRuntime: React,
|
|
@@ -6078,7 +6084,7 @@ async function createFarmServerTreePageElement(source, pathname) {
|
|
|
6078
6084
|
return null;
|
|
6079
6085
|
}
|
|
6080
6086
|
}
|
|
6081
|
-
${islandValues ? `${
|
|
6087
|
+
${islandValues ? `${_chunkJHRJ5V2Fcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
|
|
6082
6088
|
let farmLastRouteState = null;
|
|
6083
6089
|
|
|
6084
6090
|
// A hot update to a layout tree's client module renders the route again.
|
|
@@ -6919,7 +6925,7 @@ async function loadLayoutComponents(layouts = [], params = {}, source) {
|
|
|
6919
6925
|
return loadedLayouts;
|
|
6920
6926
|
}
|
|
6921
6927
|
|
|
6922
|
-
${
|
|
6928
|
+
${_chunkJHRJ5V2Fcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
6923
6929
|
function wrapWithLoadedLayouts(element, loadedLayouts, params) {
|
|
6924
6930
|
let wrapped = element;
|
|
6925
6931
|
for (let index = loadedLayouts.length - 1; index >= 0; index--) {
|
|
@@ -6998,7 +7004,7 @@ async function buildWrappedHydrationElement(PageComponent, pageProps, layouts =
|
|
|
6998
7004
|
|
|
6999
7005
|
function hydrateFarmRoute(container, route) {
|
|
7000
7006
|
farmLastRouteState = route;
|
|
7001
|
-
${
|
|
7007
|
+
${_chunkNGTZHWBGcjs.isReactRenderer.call(void 0, renderer) ? "return hydrateRoot(container, route.element);" : "return route.layouts.length > 0 ? hydrateRoot(container, route.element, route) : hydrateRoot(container, route.element);"}
|
|
7002
7008
|
}
|
|
7003
7009
|
|
|
7004
7010
|
function renderFarmRoute(root, route) {
|
|
@@ -7142,7 +7148,7 @@ async function tryHydrateImportedPage(
|
|
|
7142
7148
|
wrap: wrapFarmClientRouteGraph,
|
|
7143
7149
|
};
|
|
7144
7150
|
} else if (useHydrate && container?.id === '__farm_page__') {
|
|
7145
|
-
wrappedElement = wrapFarmClientRouteGraph(${
|
|
7151
|
+
wrappedElement = wrapFarmClientRouteGraph(${_chunkNGTZHWBGcjs.isReactRenderer.call(void 0, renderer) ? "restorePagePosition(React, container, pageElement)" : "pageElement"});
|
|
7146
7152
|
} else {
|
|
7147
7153
|
wrappedElement = await buildWrappedHydrationElement(
|
|
7148
7154
|
currentPageComponent,
|
|
@@ -7219,7 +7225,7 @@ function readActiveLayoutPatterns() {
|
|
|
7219
7225
|
);
|
|
7220
7226
|
}
|
|
7221
7227
|
|
|
7222
|
-
${
|
|
7228
|
+
${_chunkJHRJ5V2Fcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
|
|
7223
7229
|
|
|
7224
7230
|
function activateFragmentScripts(root) {
|
|
7225
7231
|
for (const script of Array.from(root.querySelectorAll?.('script') || [])) {
|
|
@@ -7278,7 +7284,7 @@ function getLayoutShell(root, patterns, index, find) {
|
|
|
7278
7284
|
return shell.innerHTML;
|
|
7279
7285
|
}
|
|
7280
7286
|
|
|
7281
|
-
${islandValues ?
|
|
7287
|
+
${islandValues ? _chunkJHRJ5V2Fcjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceNavigationBoundary(
|
|
7282
7288
|
container,
|
|
7283
7289
|
fragment,
|
|
7284
7290
|
currentPatterns,
|
|
@@ -7353,9 +7359,9 @@ ${islandValues ? `
|
|
|
7353
7359
|
return nextTarget;
|
|
7354
7360
|
}
|
|
7355
7361
|
|
|
7356
|
-
${islandValues ? `${
|
|
7362
|
+
${islandValues ? `${_chunkJHRJ5V2Fcjs.FARM_NAVIGATION_STREAM_READER_SOURCE}
|
|
7357
7363
|
|
|
7358
|
-
${
|
|
7364
|
+
${_chunkJHRJ5V2Fcjs.FARM_EARLY_NAVIGATION_SOURCE}
|
|
7359
7365
|
|
|
7360
7366
|
// Islands mode navigates as the production client does: it fetches the page itself, names the
|
|
7361
7367
|
// layouts it shows by key (F-Layouts), and asks for flush markers (F-Stream), so the shell arrives
|
|
@@ -8062,7 +8068,7 @@ function generateClientManifest(bundle) {
|
|
|
8062
8068
|
async function defineConfig(config = {}) {
|
|
8063
8069
|
const tailwindVitePlugin = await _chunkDMSXZNQRcjs.loadTailwindVitePlugin.call(void 0, );
|
|
8064
8070
|
const appRoot = path6.resolve(config.root || process.cwd());
|
|
8065
|
-
if (_optionalChain([config, 'access',
|
|
8071
|
+
if (_optionalChain([config, 'access', _510 => _510.extends, 'optionalAccess', _511 => _511.length])) {
|
|
8066
8072
|
const { config: layeredConfig } = await import("./layers-XLOMMQP7.cjs").then(
|
|
8067
8073
|
({ resolveFarmLayers }) => resolveFarmLayers(config, {
|
|
8068
8074
|
root: appRoot,
|
|
@@ -8071,12 +8077,12 @@ async function defineConfig(config = {}) {
|
|
|
8071
8077
|
);
|
|
8072
8078
|
config = layeredConfig;
|
|
8073
8079
|
}
|
|
8074
|
-
config.renderer =
|
|
8075
|
-
config.images =
|
|
8076
|
-
const rendererVitePlugins = await
|
|
8080
|
+
config.renderer = _chunkNGTZHWBGcjs.resolveFarmRenderer.call(void 0, config.renderer);
|
|
8081
|
+
config.images = _chunkJHRJ5V2Fcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, { root: appRoot, dev: true });
|
|
8082
|
+
const rendererVitePlugins = await _chunkNGTZHWBGcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, appRoot, {
|
|
8077
8083
|
ssr: true
|
|
8078
8084
|
});
|
|
8079
|
-
const reactRefreshPlugins =
|
|
8085
|
+
const reactRefreshPlugins = _chunkNGTZHWBGcjs.isReactRenderer.call(void 0, config.renderer) ? await _chunkY2FEFQAYcjs.createFarmReactRefreshPlugins.call(void 0, ) : [];
|
|
8080
8086
|
const nodeBuiltinStubs = {
|
|
8081
8087
|
"node:string_decoder": "data:text/javascript,export class StringDecoder { write(buf) { return ''; } end() { return ''; } }; export default StringDecoder;",
|
|
8082
8088
|
"node:buffer": "data:text/javascript,export const Buffer = { from: () => ({}), alloc: () => ({}), isBuffer: () => false }; export default { Buffer };",
|
|
@@ -8164,13 +8170,13 @@ async function defineConfig(config = {}) {
|
|
|
8164
8170
|
if (!serverStarted) {
|
|
8165
8171
|
serverStarted = true;
|
|
8166
8172
|
const elapsed = Date.now() - startTime;
|
|
8167
|
-
const address = _optionalChain([server, 'access',
|
|
8173
|
+
const address = _optionalChain([server, 'access', _512 => _512.httpServer, 'optionalAccess', _513 => _513.address, 'call', _514 => _514()]);
|
|
8168
8174
|
const resolvedPort = typeof address === "object" && address ? address.port : server.config.server.port || port || 3e3;
|
|
8169
8175
|
const hostConfig = server.config.server.host;
|
|
8170
8176
|
const isExposed = hostConfig === true || hostConfig === "0.0.0.0";
|
|
8171
8177
|
console.log("");
|
|
8172
8178
|
console.log(
|
|
8173
|
-
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${
|
|
8179
|
+
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunk3CZ4MJHWcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
|
|
8174
8180
|
);
|
|
8175
8181
|
console.log("");
|
|
8176
8182
|
console.log(
|
|
@@ -8204,7 +8210,7 @@ async function defineConfig(config = {}) {
|
|
|
8204
8210
|
plugins: [
|
|
8205
8211
|
// `farm dev --desktop`: only the desktop window gets an answer, as in the packaged app.
|
|
8206
8212
|
_chunkY2FEFQAYcjs.farmDesktopDevGuardPlugin.call(void 0, config.basePath),
|
|
8207
|
-
|
|
8213
|
+
_chunkJHRJ5V2Fcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
8208
8214
|
tailwindVitePlugin,
|
|
8209
8215
|
...rendererVitePlugins,
|
|
8210
8216
|
...reactRefreshPlugins,
|
|
@@ -8214,14 +8220,14 @@ async function defineConfig(config = {}) {
|
|
|
8214
8220
|
farmNavigationPlugin(config.renderer),
|
|
8215
8221
|
farmIslandContainersPlugin(config),
|
|
8216
8222
|
farmPlugin(config),
|
|
8217
|
-
|
|
8223
|
+
_chunkEFI6QWBQcjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
|
|
8218
8224
|
farmBrandingPlugin
|
|
8219
8225
|
],
|
|
8220
8226
|
customLogger: farmLogger,
|
|
8221
8227
|
clearScreen: false,
|
|
8222
8228
|
optimizeDeps: {
|
|
8223
|
-
...
|
|
8224
|
-
|
|
8229
|
+
..._chunkJHRJ5V2Fcjs.createFarmClientOptimizeDepsConfig.call(void 0,
|
|
8230
|
+
_chunkJHRJ5V2Fcjs.createFarmClientOptimizeDepsEntries.call(void 0,
|
|
8225
8231
|
appRoot,
|
|
8226
8232
|
_chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, { ...config, root: appRoot })
|
|
8227
8233
|
),
|
|
@@ -8265,7 +8271,7 @@ async function defineConfig(config = {}) {
|
|
|
8265
8271
|
// Stub out problematic server-only modules during dev mode
|
|
8266
8272
|
alias: {
|
|
8267
8273
|
..._chunk52Q4OB4Acjs.getFarmLayerAliases.call(void 0, config.layers),
|
|
8268
|
-
...
|
|
8274
|
+
..._chunkJHRJ5V2Fcjs.createFarmSourceAlias.call(void 0, appRoot, config.srcDir),
|
|
8269
8275
|
// Nitro internals that should not be resolved in browser
|
|
8270
8276
|
"supports-color": "data:text/javascript,export default false; export const supportsColor = false; export const stdout = false; export const stderr = false;",
|
|
8271
8277
|
"@poppinss/dumper": "data:text/javascript,export default {};",
|