@farm.js/core 0.1.81 → 0.1.82
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-Cxi3214_.d.ts → agent-mcp.d-C2Su3x4D.d.ts} +1 -1
- package/dist/{agent-mcp.d-DMqOqnOA.d.mts → agent-mcp.d-Yak-LqRd.d.mts} +1 -1
- package/dist/agent-runtime.cjs +4 -3
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/agent-runtime.mjs +3 -2
- package/dist/analyzer-LV23T6QN.cjs +17 -0
- package/dist/{analyzer-IC66UJCU.mjs → analyzer-RPU2KG4J.mjs} +2 -2
- package/dist/api/node.cjs +5 -4
- package/dist/api/node.d.mts +3 -3
- package/dist/api/node.d.ts +3 -3
- package/dist/api/node.mjs +4 -3
- package/dist/api/route-manager.cjs +5 -4
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/route-manager.mjs +4 -3
- package/dist/api/runtime.cjs +4 -3
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api/runtime.mjs +3 -2
- package/dist/api.cjs +7 -6
- package/dist/api.d.mts +4 -4
- package/dist/api.d.ts +4 -4
- package/dist/api.mjs +6 -5
- package/dist/{app-manifest.d-Bbxp5kes.d.mts → app-manifest.d-BcyOFMrg.d.mts} +1 -1
- package/dist/{app-manifest.d-C8Cswd31.d.ts → app-manifest.d-DZyXaICz.d.ts} +1 -1
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/{app.d-BJuSurgy.d.mts → app.d-C0ePpuaG.d.mts} +21 -4
- package/dist/{app.d-DGIoFt5D.d.ts → app.d-CIoXsAbN.d.ts} +21 -4
- package/dist/chunk-3DE6RK7K.cjs +36 -0
- package/dist/{chunk-NOYKBGUK.mjs → chunk-47I2MYIR.mjs} +130 -46
- package/dist/{chunk-GY63XD6K.mjs → chunk-4X7LSGM6.mjs} +1 -1
- package/dist/{chunk-BPWTSPK6.mjs → chunk-5AL2GXAU.mjs} +1 -1
- package/dist/{chunk-GAWSWJJ2.cjs → chunk-5GFTMTX3.cjs} +2 -2
- package/dist/{chunk-CPZZBCPO.cjs → chunk-5MUFW5UU.cjs} +2 -2
- package/dist/{chunk-LKIG5SM6.cjs → chunk-5P65LXGU.cjs} +9 -9
- package/dist/{chunk-XOXCQGAF.mjs → chunk-63ZE6B6M.mjs} +1 -1
- package/dist/{chunk-XOGCNKB7.cjs → chunk-6BPFIYGY.cjs} +3 -3
- package/dist/{chunk-UF4BNKKJ.mjs → chunk-6QYPP5KC.mjs} +2 -2
- package/dist/{chunk-ATISIC6G.mjs → chunk-7VJXYB6S.mjs} +7 -1
- package/dist/{chunk-2Y2HRZQY.cjs → chunk-AIPZDBP6.cjs} +312 -228
- package/dist/{chunk-CL7BUGVB.cjs → chunk-ARORZ3MH.cjs} +286 -240
- package/dist/{chunk-ONSZP5JK.mjs → chunk-AUFEM3FB.mjs} +1 -1
- package/dist/{chunk-FYZD7DUS.cjs → chunk-B2PGVHBG.cjs} +4 -4
- package/dist/{chunk-WGWWRV2M.cjs → chunk-B3HQTGXS.cjs} +6 -4
- package/dist/{chunk-M6DAIE4T.cjs → chunk-BCTHOQPP.cjs} +10 -8
- package/dist/{chunk-S3IWDDQ3.mjs → chunk-C3VCYOU4.mjs} +1 -1
- package/dist/{chunk-OO4GVGM3.mjs → chunk-CA2HBLXP.mjs} +11 -1
- package/dist/{chunk-W6C3LEXX.cjs → chunk-CD5Z7RR5.cjs} +155 -20
- package/dist/{chunk-YH7ENV3K.mjs → chunk-CJDBTTLB.mjs} +4 -4
- package/dist/{chunk-5N526T7Q.mjs → chunk-DAXU2NBE.mjs} +74 -18
- package/dist/{chunk-Z5BANEQD.cjs → chunk-DMSXZNQR.cjs} +2 -2
- package/dist/{chunk-46UV2E7I.cjs → chunk-DRO3NXA3.cjs} +9 -9
- package/dist/{chunk-4OFWG4IK.cjs → chunk-EACD6ND7.cjs} +8 -2
- package/dist/{chunk-HTNJ7A4D.mjs → chunk-EL2Z6YFZ.mjs} +2 -2
- package/dist/{chunk-IM3UINTZ.mjs → chunk-GXLNARPO.mjs} +151 -16
- package/dist/{chunk-E3HBD2K3.cjs → chunk-HHQEKLZL.cjs} +2 -2
- package/dist/{chunk-5ZHC6QGD.cjs → chunk-HQKCSJEH.cjs} +8 -2
- package/dist/{chunk-RHI67C2V.cjs → chunk-HUGPJFOC.cjs} +1 -35
- package/dist/{chunk-BJWJP5A4.mjs → chunk-I4DR3HCH.mjs} +3 -3
- package/dist/{chunk-C2OLXVUC.mjs → chunk-IVP5Q4BX.mjs} +10 -3
- package/dist/{chunk-NSLRK5DK.cjs → chunk-JK26IMT7.cjs} +1 -1
- package/dist/{chunk-WIZRYFB2.cjs → chunk-JYQ6DGPW.cjs} +8 -6
- package/dist/{chunk-TYHWZOA2.mjs → chunk-KWI3SQFX.mjs} +4 -2
- package/dist/{chunk-POVHO46S.mjs → chunk-L3RDECA5.mjs} +1 -1
- package/dist/{chunk-MOGRRZMW.cjs → chunk-LM2ZDNDD.cjs} +16 -16
- package/dist/{chunk-RPA45OQS.mjs → chunk-MO4UTDQ6.mjs} +1 -1
- package/dist/{chunk-ZIYJWJV2.cjs → chunk-N2EFMN2K.cjs} +8 -8
- package/dist/{chunk-6WVRVGKC.mjs → chunk-NAHDG6UX.mjs} +1 -1
- package/dist/{chunk-OFVCWV2D.cjs → chunk-NEKO3HM2.cjs} +11 -1
- package/dist/{chunk-SLEHAGGV.mjs → chunk-NQ3Y6E2T.mjs} +7 -1
- package/dist/{chunk-IPG6B25T.mjs → chunk-NRCKBDYP.mjs} +78 -32
- package/dist/{chunk-POL5RCVU.mjs → chunk-OMB7UGVW.mjs} +1 -1
- package/dist/{chunk-D77OGI6X.mjs → chunk-OP5VI4TP.mjs} +1 -1
- package/dist/{chunk-7VCLTNED.mjs → chunk-PNMAD3OS.mjs} +1 -35
- package/dist/{chunk-OIWDEDUO.cjs → chunk-Q2VOT3K2.cjs} +392 -336
- package/dist/{chunk-RZ6XUEQS.mjs → chunk-QSMUMK7Y.mjs} +2 -2
- package/dist/{chunk-2HMSSPCZ.mjs → chunk-RMLR5RMH.mjs} +4 -2
- package/dist/{chunk-ADQ2LATR.cjs → chunk-RMPUEH5T.cjs} +2 -2
- package/dist/{chunk-AHVF5GI2.cjs → chunk-S7WZUK3B.cjs} +2 -2
- package/dist/{chunk-ZKNXCRUQ.cjs → chunk-U54REWMJ.cjs} +23 -23
- package/dist/chunk-U6XYBTUT.mjs +36 -0
- package/dist/{chunk-TCMRLW3K.cjs → chunk-VACYUMXW.cjs} +10 -3
- package/dist/{chunk-OUDNUFVR.cjs → chunk-VMBIKDKW.cjs} +4 -4
- package/dist/{chunk-UGLTOLTJ.cjs → chunk-W76C7TCW.cjs} +2 -2
- package/dist/{chunk-6JWXHPVR.mjs → chunk-XRSNW4IU.mjs} +4 -2
- package/dist/{chunk-TLSGRK7E.mjs → chunk-ZIZRIZLP.mjs} +1 -1
- package/dist/{cli-runtime.d-D8O1v2_X.d.mts → cli-runtime.d-Hnvvadz7.d.mts} +5 -5
- package/dist/{cli-runtime.d-hf4L1MNP.d.ts → cli-runtime.d-I0MphTbc.d.ts} +5 -5
- package/dist/{client-component.d-CX8UCQh-.d.ts → client-component.d-5QEvtJsg.d.ts} +1 -1
- package/dist/{client-component.d-DFwUHlOz.d.mts → client-component.d-DapRqtSC.d.mts} +1 -1
- package/dist/{client-plugins.d-BflSNO-b.d.mts → client-plugins.d-C1WM3ieD.d.mts} +6 -1
- package/dist/{client-plugins.d-qWp8hNwd.d.ts → client-plugins.d-DcmDzcSC.d.ts} +6 -1
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.d.mts +7 -7
- package/dist/client.d.ts +7 -7
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/cron.cjs +2 -2
- package/dist/cron.mjs +1 -1
- package/dist/desktop.d.mts +2 -2
- package/dist/desktop.d.ts +2 -2
- package/dist/{devtools-EI5N366Z.cjs → devtools-5B7NZE6F.cjs} +10 -9
- package/dist/{devtools-XJHODO5H.mjs → devtools-C5GXZZ7E.mjs} +7 -6
- package/dist/docs.cjs +9 -8
- package/dist/docs.d.mts +3 -3
- package/dist/docs.d.ts +3 -3
- package/dist/docs.mjs +8 -7
- package/dist/environment/vite.cjs +4 -4
- package/dist/environment/vite.mjs +3 -3
- package/dist/{handler.d-DoH5Krkq.d.mts → handler.d-B8bPCBzl.d.mts} +1 -1
- package/dist/{handler.d-C2oRihfa.d.ts → handler.d-Cliwo6Nu.d.ts} +1 -1
- package/dist/{headers.d-BrX53wFQ.d.mts → headers.d-CVwSpSGX.d.mts} +1 -1
- package/dist/{headers.d-Dj0mfYpb.d.ts → headers.d-C_btqjV6.d.ts} +1 -1
- package/dist/index.cjs +28 -27
- package/dist/{index.d-DzDHOttz.d.mts → index.d-DFuMZk9-.d.mts} +1 -1
- package/dist/{index.d-Dhc2scRl.d.ts → index.d-hOEbMcLk.d.ts} +1 -1
- package/dist/index.d.mts +22 -22
- package/dist/index.d.ts +22 -22
- package/dist/index.mjs +27 -26
- package/dist/integrations/orm.d.mts +1 -1
- package/dist/integrations/orm.d.ts +1 -1
- package/dist/integrations.cjs +4 -3
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/integrations.mjs +3 -2
- package/dist/internal/app-markdown-runtime.d.mts +2 -2
- package/dist/internal/app-markdown-runtime.d.ts +2 -2
- package/dist/internal/build-runtime.cjs +26 -25
- package/dist/internal/build-runtime.d.mts +4 -4
- package/dist/internal/build-runtime.d.ts +4 -4
- package/dist/internal/build-runtime.mjs +25 -24
- package/dist/internal/cli-runtime.cjs +11 -10
- package/dist/internal/cli-runtime.d.mts +7 -7
- package/dist/internal/cli-runtime.d.ts +7 -7
- package/dist/internal/cli-runtime.mjs +10 -9
- 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 +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +9 -8
- package/dist/internal/config-runtime.d.mts +3 -3
- package/dist/internal/config-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.mjs +8 -7
- package/dist/internal/infra-analytics-runtime.cjs +8 -6
- package/dist/internal/infra-analytics-runtime.d.mts +8 -2
- package/dist/internal/infra-analytics-runtime.d.ts +8 -2
- package/dist/internal/infra-analytics-runtime.mjs +8 -6
- package/dist/internal/islands-boot.cjs +54 -20
- package/dist/internal/islands-boot.d.mts +5 -3
- package/dist/internal/islands-boot.d.ts +5 -3
- package/dist/internal/islands-boot.mjs +49 -15
- 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 +11 -6
- package/dist/internal/production-runtime.d.mts +13 -11
- package/dist/internal/production-runtime.d.ts +13 -11
- package/dist/internal/production-runtime.mjs +10 -5
- 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 +1 -1
- package/dist/internal/start-manifest.d.ts +1 -1
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/middleware.d.mts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/{mount.d-DwXjaOHY.d.ts → mount.d-CAovYKfs.d.ts} +1 -1
- package/dist/{mount.d-DOaeUoWq.d.mts → mount.d-DLeYxeRR.d.mts} +1 -1
- package/dist/{navigation-delegate.d-o3pPd9VI.d.ts → navigation-delegate.d-BLM-8Q3Z.d.ts} +1 -1
- package/dist/{navigation-delegate.d-BElGUMgt.d.mts → navigation-delegate.d-Chv93QS6.d.mts} +1 -1
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/{nitro-YLTGVGK4.mjs → nitro-FK3SZM4H.mjs} +1 -1
- package/dist/{nitro-XGIO6EQN.cjs → nitro-YDFMH5PY.cjs} +4 -4
- package/dist/{plugin-LN3JBZRR.cjs → plugin-3PT7I26P.cjs} +2 -2
- package/dist/{plugin-33I3V42N.mjs → plugin-QOTAPTVV.mjs} +1 -1
- package/dist/plugin.cjs +21 -19
- package/dist/plugin.d.mts +5 -5
- package/dist/plugin.d.ts +5 -5
- package/dist/plugin.mjs +20 -18
- package/dist/{render-plan.d-BD06tqFA.d.ts → render-plan.d-BSTjTH8h.d.ts} +1 -1
- package/dist/{render-plan.d-xWCRAJeR.d.mts → render-plan.d-CK5Lggyb.d.mts} +1 -1
- package/dist/renderer-client.cjs +48 -5
- package/dist/renderer-client.d.mts +5 -5
- package/dist/renderer-client.d.ts +5 -5
- package/dist/renderer-client.mjs +48 -5
- package/dist/renderer.cjs +2 -2
- package/dist/renderer.d.mts +10 -0
- package/dist/renderer.d.ts +10 -0
- package/dist/renderer.mjs +1 -1
- package/dist/{request.d-Dx82V8bz.d.mts → request.d-BhggxQf3.d.mts} +1 -1
- package/dist/{request.d-DUMuWxSN.d.ts → request.d-CyJS9bjm.d.ts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering.d-BwBVpLtD.d.ts → route-rendering.d-BLPPmI5I.d.ts} +1 -1
- package/dist/{route-rendering.d-DJh6GauM.d.mts → route-rendering.d-CUpG2mZJ.d.mts} +1 -1
- package/dist/{router.d-CJBSG5jr.d.ts → router.d-0X2Ki6rf.d.ts} +1 -1
- package/dist/{router.d-BtkKDxUB.d.mts → router.d-2NQM1Kgw.d.mts} +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/{rsc-pipeline-H5AXQA7A.cjs → rsc-pipeline-5AOF64FL.cjs} +10 -9
- package/dist/{rsc-pipeline-GD6KLOIG.mjs → rsc-pipeline-DNRLYOJ7.mjs} +9 -8
- package/dist/{runtime-OJ7FXFUI.mjs → runtime-EHG2FRXZ.mjs} +9 -8
- package/dist/{runtime-YWQVBC3V.cjs → runtime-ZVHG5SRB.cjs} +13 -12
- package/dist/{runtime.d-BQnD0cfC.d.ts → runtime.d-CXuwkUgr.d.ts} +1 -1
- package/dist/{runtime.d-C4SuZXf6.d.mts → runtime.d-CaFXcu_Q.d.mts} +1 -1
- package/dist/{server-components-status.d-rfKOcE0N.d.ts → server-components-status.d-BdeFD8ZH.d.ts} +1 -1
- package/dist/{server-components-status.d-9rH7ZoEq.d.mts → server-components-status.d-Cp7zvBm5.d.mts} +1 -1
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server.cjs +54 -48
- package/dist/server.d.mts +11 -11
- package/dist/server.d.ts +11 -11
- package/dist/server.mjs +30 -24
- package/dist/{spa-router.d-DMKiBsHH.d.ts → spa-router.d-Bjgl-Osi.d.ts} +2 -2
- package/dist/{spa-router.d-V6XLSTCy.d.mts → spa-router.d-l3G38xHa.d.mts} +2 -2
- package/dist/{ssg.d-MNedvvMB.d.ts → ssg.d-DDca17Lc.d.ts} +2 -2
- package/dist/{ssg.d-BnCKPQL0.d.mts → ssg.d-RnlHOqUL.d.mts} +2 -2
- package/dist/{store-core.d-BqJI1-ix.d.mts → store-core.d-BZjuC6Zc.d.mts} +11 -3
- package/dist/{store-core.d-Ad5biajo.d.ts → store-core.d-BaOUOPf7.d.ts} +11 -3
- package/dist/testing.cjs +5 -4
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.mjs +4 -3
- package/dist/{utils.d-BdjHKDuT.d.ts → utils.d-D8TWmpWo.d.ts} +1 -1
- package/dist/{utils.d-BEKLWa0Z.d.mts → utils.d-tdzw0_zQ.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +21 -19
- package/dist/vite.d.mts +6 -6
- package/dist/vite.d.ts +6 -6
- package/dist/vite.mjs +20 -18
- package/package.json +2 -2
- package/dist/analyzer-435DCIQ6.cjs +0 -17
|
@@ -43,19 +43,19 @@ var _chunkRDADQG5Scjs = require('./chunk-RDADQG5S.cjs');
|
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
|
|
46
|
-
var
|
|
46
|
+
var _chunkARORZ3MHcjs = require('./chunk-ARORZ3MH.cjs');
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
|
|
51
|
-
var
|
|
51
|
+
var _chunkDMSXZNQRcjs = require('./chunk-DMSXZNQR.cjs');
|
|
52
52
|
|
|
53
53
|
|
|
54
|
-
var
|
|
54
|
+
var _chunkVACYUMXWcjs = require('./chunk-VACYUMXW.cjs');
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
|
|
58
|
-
var
|
|
58
|
+
var _chunkVMBIKDKWcjs = require('./chunk-VMBIKDKW.cjs');
|
|
59
59
|
|
|
60
60
|
|
|
61
61
|
var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
@@ -67,12 +67,13 @@ var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
|
67
67
|
|
|
68
68
|
|
|
69
69
|
|
|
70
|
-
var
|
|
70
|
+
var _chunkNEKO3HM2cjs = require('./chunk-NEKO3HM2.cjs');
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
|
|
74
74
|
|
|
75
75
|
|
|
76
|
+
var _chunkCD5Z7RR5cjs = require('./chunk-CD5Z7RR5.cjs');
|
|
76
77
|
|
|
77
78
|
|
|
78
79
|
|
|
@@ -85,13 +86,15 @@ var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
|
|
|
85
86
|
|
|
86
87
|
|
|
87
88
|
|
|
88
|
-
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
var _chunkB2PGVHBGcjs = require('./chunk-B2PGVHBG.cjs');
|
|
89
92
|
|
|
90
93
|
|
|
91
94
|
var _chunkW53Z4WDIcjs = require('./chunk-W53Z4WDI.cjs');
|
|
92
95
|
|
|
93
96
|
|
|
94
|
-
var
|
|
97
|
+
var _chunkRMPUEH5Tcjs = require('./chunk-RMPUEH5T.cjs');
|
|
95
98
|
|
|
96
99
|
|
|
97
100
|
|
|
@@ -142,7 +145,7 @@ var _chunk7EPYN7GWcjs = require('./chunk-7EPYN7GW.cjs');
|
|
|
142
145
|
|
|
143
146
|
|
|
144
147
|
|
|
145
|
-
var
|
|
148
|
+
var _chunkDRO3NXA3cjs = require('./chunk-DRO3NXA3.cjs');
|
|
146
149
|
|
|
147
150
|
|
|
148
151
|
|
|
@@ -166,7 +169,7 @@ var _chunkSTF6VDYQcjs = require('./chunk-STF6VDYQ.cjs');
|
|
|
166
169
|
|
|
167
170
|
|
|
168
171
|
|
|
169
|
-
var
|
|
172
|
+
var _chunkEACD6ND7cjs = require('./chunk-EACD6ND7.cjs');
|
|
170
173
|
|
|
171
174
|
|
|
172
175
|
var _chunkOLKYHTLNcjs = require('./chunk-OLKYHTLN.cjs');
|
|
@@ -187,13 +190,16 @@ var _chunk52Q4OB4Acjs = require('./chunk-52Q4OB4A.cjs');
|
|
|
187
190
|
|
|
188
191
|
|
|
189
192
|
|
|
190
|
-
var
|
|
193
|
+
var _chunkBCTHOQPPcjs = require('./chunk-BCTHOQPP.cjs');
|
|
191
194
|
|
|
192
195
|
|
|
193
196
|
|
|
194
197
|
var _chunkMCSRMEQVcjs = require('./chunk-MCSRMEQV.cjs');
|
|
195
198
|
|
|
196
199
|
|
|
200
|
+
var _chunkHQKCSJEHcjs = require('./chunk-HQKCSJEH.cjs');
|
|
201
|
+
|
|
202
|
+
|
|
197
203
|
var _chunk3EIPOTZVcjs = require('./chunk-3EIPOTZV.cjs');
|
|
198
204
|
|
|
199
205
|
|
|
@@ -218,7 +224,7 @@ var _chunk2NOHVIJ3cjs = require('./chunk-2NOHVIJ3.cjs');
|
|
|
218
224
|
|
|
219
225
|
|
|
220
226
|
|
|
221
|
-
var
|
|
227
|
+
var _chunkB3HQTGXScjs = require('./chunk-B3HQTGXS.cjs');
|
|
222
228
|
|
|
223
229
|
|
|
224
230
|
|
|
@@ -241,7 +247,7 @@ var _chunkKBGZ5FD6cjs = require('./chunk-KBGZ5FD6.cjs');
|
|
|
241
247
|
var _chunkP2355C6Ecjs = require('./chunk-P2355C6E.cjs');
|
|
242
248
|
|
|
243
249
|
|
|
244
|
-
var
|
|
250
|
+
var _chunk5P65LXGUcjs = require('./chunk-5P65LXGU.cjs');
|
|
245
251
|
|
|
246
252
|
|
|
247
253
|
var _chunkSXXSQVKKcjs = require('./chunk-SXXSQVKK.cjs');
|
|
@@ -253,7 +259,7 @@ var _chunkKORZ6PREcjs = require('./chunk-KORZ6PRE.cjs');
|
|
|
253
259
|
|
|
254
260
|
|
|
255
261
|
|
|
256
|
-
var
|
|
262
|
+
var _chunkJYQ6DGPWcjs = require('./chunk-JYQ6DGPW.cjs');
|
|
257
263
|
|
|
258
264
|
|
|
259
265
|
var _chunkRKQOMG2Xcjs = require('./chunk-RKQOMG2X.cjs');
|
|
@@ -304,7 +310,7 @@ var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
|
|
|
304
310
|
var _chunkPLJMEUANcjs = require('./chunk-PLJMEUAN.cjs');
|
|
305
311
|
|
|
306
312
|
|
|
307
|
-
var
|
|
313
|
+
var _chunkJK26IMT7cjs = require('./chunk-JK26IMT7.cjs');
|
|
308
314
|
|
|
309
315
|
|
|
310
316
|
var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
|
|
@@ -386,9 +392,8 @@ var _module = require('module');
|
|
|
386
392
|
// src/dev-preview-guard.ts
|
|
387
393
|
var _fs = require('fs'); var fs2 = _interopRequireWildcard(_fs); var fs = _interopRequireWildcard(_fs);
|
|
388
394
|
|
|
389
|
-
var FARM_PREVIEW_REQUEST_HEADER = "x-farm-preview";
|
|
390
395
|
function isFarmPreviewTunnelRequest(headers) {
|
|
391
|
-
return headers[FARM_PREVIEW_REQUEST_HEADER] !== void 0;
|
|
396
|
+
return headers[_chunkHQKCSJEHcjs.FARM_PREVIEW_REQUEST_HEADER] !== void 0;
|
|
392
397
|
}
|
|
393
398
|
var VITE_DEFAULT_FS_DENY = [
|
|
394
399
|
".env",
|
|
@@ -706,7 +711,7 @@ function findClientServerFnViolation(code, id) {
|
|
|
706
711
|
return null;
|
|
707
712
|
}
|
|
708
713
|
function createServerFnBoundaryDiagnostic(violation, id, location) {
|
|
709
|
-
return
|
|
714
|
+
return _chunkDRO3NXA3cjs.createFarmDiagnostic.call(void 0,
|
|
710
715
|
"CLIENT_SERVER_FUNCTION",
|
|
711
716
|
id,
|
|
712
717
|
`${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.`,
|
|
@@ -965,21 +970,21 @@ function readPropertyKey(property) {
|
|
|
965
970
|
function createClientBoundaryDiagnostic(file, finding, location) {
|
|
966
971
|
switch (finding.kind) {
|
|
967
972
|
case "server-env":
|
|
968
|
-
return
|
|
973
|
+
return _chunkDRO3NXA3cjs.createFarmDiagnostic.call(void 0,
|
|
969
974
|
"CLIENT_SERVER_ENV",
|
|
970
975
|
file,
|
|
971
976
|
`process.env.${finding.name} is read at module scope in a module compiled for the browser, where it is undefined.`,
|
|
972
977
|
location
|
|
973
978
|
);
|
|
974
979
|
case "public-env":
|
|
975
|
-
return
|
|
980
|
+
return _chunkDRO3NXA3cjs.createFarmDiagnostic.call(void 0,
|
|
976
981
|
"CLIENT_PROCESS_ENV_PUBLIC",
|
|
977
982
|
file,
|
|
978
983
|
`process.env.${finding.name} is declared public, but process.env is not populated in the browser, so this module-scope read is undefined there.`,
|
|
979
984
|
location
|
|
980
985
|
);
|
|
981
986
|
case "builtin":
|
|
982
|
-
return
|
|
987
|
+
return _chunkDRO3NXA3cjs.createFarmDiagnostic.call(void 0,
|
|
983
988
|
"CLIENT_NODE_BUILTIN",
|
|
984
989
|
file,
|
|
985
990
|
`"${finding.name}" is imported into a module compiled for the browser, which gets a stub whose exports without a Web API equivalent are undefined.`,
|
|
@@ -1235,8 +1240,8 @@ function farmLlmsTxtGeneratedPaths(config) {
|
|
|
1235
1240
|
return llms.full ? ["/llms.txt", "/llms-full.txt"] : ["/llms.txt"];
|
|
1236
1241
|
}
|
|
1237
1242
|
function farmAgentGeneratedPaths(config) {
|
|
1238
|
-
const crawlers =
|
|
1239
|
-
const sitemap =
|
|
1243
|
+
const crawlers = _chunkEACD6ND7cjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access', _64 => _64.agent, 'optionalAccess', _65 => _65.crawlers]));
|
|
1244
|
+
const sitemap = _chunkEACD6ND7cjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([config, 'access', _66 => _66.agent, 'optionalAccess', _67 => _67.sitemap]));
|
|
1240
1245
|
return [
|
|
1241
1246
|
...farmLlmsTxtGeneratedPaths(config),
|
|
1242
1247
|
...sitemap.enabled ? ["/sitemap.xml"] : [],
|
|
@@ -1281,7 +1286,7 @@ function loadFarmWorkflowsDevRuntime() {
|
|
|
1281
1286
|
return import("./workflows.cjs");
|
|
1282
1287
|
}
|
|
1283
1288
|
function loadFarmDevtoolsSnapshotRuntime() {
|
|
1284
|
-
return import("./devtools-
|
|
1289
|
+
return import("./devtools-5B7NZE6F.cjs");
|
|
1285
1290
|
}
|
|
1286
1291
|
function loadFarmDevtoolsUIRuntime() {
|
|
1287
1292
|
return import("./devtools-ui-C2EMF2SO.cjs");
|
|
@@ -1306,7 +1311,7 @@ function farmI18nClientBridgePlugin() {
|
|
|
1306
1311
|
};
|
|
1307
1312
|
}
|
|
1308
1313
|
function farmNavigationPlugin(renderer) {
|
|
1309
|
-
const otherRenderer = !
|
|
1314
|
+
const otherRenderer = !_chunkBCTHOQPPcjs.isFarmRendererDisabled.call(void 0, renderer) && !_chunkBCTHOQPPcjs.isReactRenderer.call(void 0, renderer || void 0) && _optionalChain([(renderer || void 0), 'optionalAccess', _69 => _69.name]) !== "preact";
|
|
1310
1315
|
return {
|
|
1311
1316
|
name: "farm:navigation",
|
|
1312
1317
|
config() {
|
|
@@ -1331,16 +1336,16 @@ var FARM_SERVER_ONLY_PACKAGE_ID = "\0farm:server-only";
|
|
|
1331
1336
|
var FARM_PLATFORM_ENTRY = "@farm.js/core/platform";
|
|
1332
1337
|
var FARM_PLATFORM_CLIENT_ID = "\0farm:platform-client";
|
|
1333
1338
|
var FARM_SERVER_ONLY_ENTRIES_RESOLVE_FILTER = [
|
|
1334
|
-
|
|
1335
|
-
new RegExp(`^${
|
|
1339
|
+
_chunkARORZ3MHcjs.exactIdPattern.call(void 0, [FARM_PLATFORM_ENTRY, SERVER_ONLY_PACKAGE, ...FARM_SERVER_ONLY_ENTRIES]),
|
|
1340
|
+
new RegExp(`^${_chunkDRO3NXA3cjs.FARM_RESOLVE_FROM_PREFIX}`),
|
|
1336
1341
|
// What isBuiltin() accepts: `node:` ids and the builtin names, subpaths such as fs/promises
|
|
1337
1342
|
// included.
|
|
1338
1343
|
/^node:/,
|
|
1339
|
-
|
|
1344
|
+
_chunkARORZ3MHcjs.exactIdPattern.call(void 0, _module.builtinModules)
|
|
1340
1345
|
];
|
|
1341
1346
|
var FARM_SERVER_ONLY_ENTRIES_LOAD_FILTER = [
|
|
1342
|
-
|
|
1343
|
-
new RegExp(`^${
|
|
1347
|
+
_chunkARORZ3MHcjs.exactIdPattern.call(void 0, [FARM_SERVER_ONLY_PACKAGE_ID, FARM_PLATFORM_CLIENT_ID]),
|
|
1348
|
+
new RegExp(`^${_chunkDRO3NXA3cjs.FARM_BROWSER_BUILTIN_PREFIX}`)
|
|
1344
1349
|
];
|
|
1345
1350
|
function createFarmPlatformClientModule(platform) {
|
|
1346
1351
|
return `export function platform() { return ${JSON.stringify(platform)}; }
|
|
@@ -1376,18 +1381,18 @@ function farmIslandContainersPlugin(config) {
|
|
|
1376
1381
|
if (id.startsWith("\0") || id.includes("/node_modules/") || !/\.[jt]sx(?:$|\?)/.test(id)) {
|
|
1377
1382
|
return null;
|
|
1378
1383
|
}
|
|
1379
|
-
if (
|
|
1384
|
+
if (_chunkDRO3NXA3cjs.hasUseClientDirective.call(void 0, code)) return null;
|
|
1380
1385
|
const file = id.split("?", 1)[0];
|
|
1381
|
-
const bindings =
|
|
1386
|
+
const bindings = _chunkDRO3NXA3cjs.getFarmClientRenderingBindings.call(void 0, code, file, root);
|
|
1382
1387
|
if (bindings.length === 0) return null;
|
|
1383
|
-
const grown =
|
|
1388
|
+
const grown = _chunkDRO3NXA3cjs.wrapFarmIslandContainers.call(void 0, {
|
|
1384
1389
|
code,
|
|
1385
1390
|
file,
|
|
1386
1391
|
bindings,
|
|
1387
|
-
reference:
|
|
1392
|
+
reference: _chunkDRO3NXA3cjs.farmIslandContainerReferencePath.call(void 0, root)
|
|
1388
1393
|
});
|
|
1389
1394
|
if (grown === null) return null;
|
|
1390
|
-
|
|
1395
|
+
_chunkDRO3NXA3cjs.ensureFarmIslandContainerReference.call(void 0, root);
|
|
1391
1396
|
return { code: grown, map: null };
|
|
1392
1397
|
}
|
|
1393
1398
|
};
|
|
@@ -1401,15 +1406,15 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1401
1406
|
config(config) {
|
|
1402
1407
|
const appRoot = path6.resolve(_nullishCoalesce(config.root, () => ( process.cwd())));
|
|
1403
1408
|
if (options.distDir) {
|
|
1404
|
-
|
|
1409
|
+
_chunkDRO3NXA3cjs.usePackageScanCacheFile.call(void 0,
|
|
1405
1410
|
path6.resolve(appRoot, options.distDir, "cache", "package-scans.json")
|
|
1406
1411
|
);
|
|
1407
1412
|
}
|
|
1408
|
-
const bundledPackages =
|
|
1413
|
+
const bundledPackages = _chunkDRO3NXA3cjs.collectFarmServerBundledPackageInfo.call(void 0, appRoot);
|
|
1409
1414
|
const prebundle = options.prebundleServerPackages ? createFarmServerPrebundleConfig(bundledPackages) : {};
|
|
1410
|
-
|
|
1415
|
+
_chunkDRO3NXA3cjs.persistPackageScanCache.call(void 0, );
|
|
1411
1416
|
return {
|
|
1412
|
-
optimizeDeps: { rolldownOptions: { plugins: [
|
|
1417
|
+
optimizeDeps: { rolldownOptions: { plugins: [_chunkDRO3NXA3cjs.farmBrowserBuiltinsOptimizerPlugin.call(void 0, )] } },
|
|
1413
1418
|
ssr: {
|
|
1414
1419
|
noExternal: [
|
|
1415
1420
|
// Resolve `server-only` here rather than in Node, which would load its throwing build.
|
|
@@ -1433,8 +1438,8 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1433
1438
|
return FARM_SERVER_ONLY_PACKAGE_ID;
|
|
1434
1439
|
}
|
|
1435
1440
|
this.error(
|
|
1436
|
-
|
|
1437
|
-
|
|
1441
|
+
_chunkDRO3NXA3cjs.formatFarmDiagnostic.call(void 0,
|
|
1442
|
+
_chunkDRO3NXA3cjs.createFarmDiagnostic.call(void 0,
|
|
1438
1443
|
"CLIENT_SERVER_ONLY_IMPORT",
|
|
1439
1444
|
_nullishCoalesce(importer, () => ( "<unknown module>")),
|
|
1440
1445
|
`${importer ? "This module" : "A module"} imports "server-only", so it must not reach the browser, but client code imports it.`
|
|
@@ -1444,9 +1449,9 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1444
1449
|
);
|
|
1445
1450
|
}
|
|
1446
1451
|
if (!_optionalChain([options2, 'optionalAccess', _75 => _75.ssr]) && _module.isBuiltin.call(void 0, id)) {
|
|
1447
|
-
return
|
|
1452
|
+
return _chunkDRO3NXA3cjs.resolveFarmBrowserBuiltin.call(void 0, this, id, importer, options2);
|
|
1448
1453
|
}
|
|
1449
|
-
const resolveFrom = importer ?
|
|
1454
|
+
const resolveFrom = importer ? _chunkDRO3NXA3cjs.parseFarmResolveFrom.call(void 0, id, importer.split("?", 1)[0]) : null;
|
|
1450
1455
|
if (resolveFrom) {
|
|
1451
1456
|
const directory = path6.dirname(resolveFrom.importer);
|
|
1452
1457
|
return this.resolve(resolveFrom.specifier, resolveFrom.importer, {
|
|
@@ -1463,8 +1468,8 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1463
1468
|
const importedBy = importer ? ` (imported by ${importer})` : "";
|
|
1464
1469
|
if (!_optionalChain([options2, 'optionalAccess', _76 => _76.ssr])) {
|
|
1465
1470
|
this.error(
|
|
1466
|
-
|
|
1467
|
-
|
|
1471
|
+
_chunkDRO3NXA3cjs.formatFarmDiagnostic.call(void 0,
|
|
1472
|
+
_chunkDRO3NXA3cjs.createFarmDiagnostic.call(void 0,
|
|
1468
1473
|
"CLIENT_SERVER_ONLY_ENTRY",
|
|
1469
1474
|
_nullishCoalesce(importer, () => ( id)),
|
|
1470
1475
|
`${id} is server-only and cannot be imported into client code.`
|
|
@@ -1489,7 +1494,7 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1489
1494
|
if (id === FARM_PLATFORM_CLIENT_ID) {
|
|
1490
1495
|
return createFarmPlatformClientModule(_nullishCoalesce(options.platform, () => ( _chunkAQLHD6HZcjs.resolveFarmPlatform.call(void 0, ))));
|
|
1491
1496
|
}
|
|
1492
|
-
return _nullishCoalesce(
|
|
1497
|
+
return _nullishCoalesce(_chunkDRO3NXA3cjs.loadFarmBrowserBuiltin.call(void 0, id), () => ( null));
|
|
1493
1498
|
}
|
|
1494
1499
|
}
|
|
1495
1500
|
};
|
|
@@ -1522,7 +1527,7 @@ function renderFarmI18nStaticHead(requestPath, snapshot) {
|
|
|
1522
1527
|
if (!snapshot) return "";
|
|
1523
1528
|
const runtime = `<script>window.__FARM_I18N__ = ${serializeFarmInlineValue(snapshot)};</script>`;
|
|
1524
1529
|
if (snapshot.routing === "none") return runtime;
|
|
1525
|
-
return `${
|
|
1530
|
+
return `${_chunkNEKO3HM2cjs.renderFarmLocaleAlternateLinks.call(void 0, requestPath, snapshot)}${runtime}`;
|
|
1526
1531
|
}
|
|
1527
1532
|
function getPublicEnvDefine(config) {
|
|
1528
1533
|
const publicEnv = _optionalChain([config, 'access', _77 => _77.env, 'optionalAccess', _78 => _78.public]);
|
|
@@ -1569,7 +1574,7 @@ function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request)
|
|
|
1569
1574
|
}
|
|
1570
1575
|
res.statusCode = 500;
|
|
1571
1576
|
res.setHeader("Content-Type", "application/json");
|
|
1572
|
-
res.end(
|
|
1577
|
+
res.end(_chunkJYQ6DGPWcjs.FARM_INTERNAL_SERVER_ERROR_BODY);
|
|
1573
1578
|
});
|
|
1574
1579
|
};
|
|
1575
1580
|
}
|
|
@@ -1577,10 +1582,10 @@ function sendFarmDevErrorJSON(res) {
|
|
|
1577
1582
|
res.statusCode = 500;
|
|
1578
1583
|
res.setHeader("Content-Type", "application/json");
|
|
1579
1584
|
res.setHeader("Cache-Control", "private, no-store");
|
|
1580
|
-
res.end(
|
|
1585
|
+
res.end(_chunkJYQ6DGPWcjs.FARM_INTERNAL_SERVER_ERROR_BODY);
|
|
1581
1586
|
}
|
|
1582
1587
|
function createFarmDevMiddlewareErrorResponse() {
|
|
1583
|
-
return new Response(
|
|
1588
|
+
return new Response(_chunkJYQ6DGPWcjs.FARM_INTERNAL_SERVER_ERROR_BODY, {
|
|
1584
1589
|
status: 500,
|
|
1585
1590
|
headers: { "Content-Type": "application/json", "Cache-Control": "private, no-store" }
|
|
1586
1591
|
});
|
|
@@ -1592,10 +1597,10 @@ function setFarmDevRuntimeHookErrorHead(res, json) {
|
|
|
1592
1597
|
}
|
|
1593
1598
|
function sendFarmDevRuntimeHookError(res, json) {
|
|
1594
1599
|
setFarmDevRuntimeHookErrorHead(res, json);
|
|
1595
|
-
res.end(json ?
|
|
1600
|
+
res.end(json ? _chunkJYQ6DGPWcjs.FARM_INTERNAL_SERVER_ERROR_BODY : "Internal Server Error");
|
|
1596
1601
|
}
|
|
1597
1602
|
function opensFarmDevRuntimeSession(pm) {
|
|
1598
|
-
return pm.hasRuntimeRequestHooks() ||
|
|
1603
|
+
return pm.hasRuntimeRequestHooks() || _chunkDMSXZNQRcjs.hasFarmServerRuntimePlugins.call(void 0, pm.getPlugins());
|
|
1599
1604
|
}
|
|
1600
1605
|
var FARM_CONFIG_ROUTE_PLUGIN_NAMES = /* @__PURE__ */ new Set([
|
|
1601
1606
|
_chunkH7OFZJCVcjs.FARM_CONFIG_HEADERS_PLUGIN_NAME,
|
|
@@ -1708,7 +1713,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1708
1713
|
res.end = originalEnd;
|
|
1709
1714
|
res.writeHead = originalWriteHead;
|
|
1710
1715
|
if (originalFlushHeaders) res.flushHeaders = originalFlushHeaders;
|
|
1711
|
-
delete res[
|
|
1716
|
+
delete res[_chunkVACYUMXWcjs.FARM_NODE_RESPONSE_END_PENDING];
|
|
1712
1717
|
};
|
|
1713
1718
|
let runtimeHookFailed = false;
|
|
1714
1719
|
const endRuntimeRequest = (response) => pm.endRuntimeRequest(runtimeSession, response).catch((error) => {
|
|
@@ -1722,7 +1727,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1722
1727
|
const writeRuntimeHookFailure = () => {
|
|
1723
1728
|
setFarmDevRuntimeHookErrorHead(res, Boolean(options.jsonError));
|
|
1724
1729
|
originalWriteHead(500);
|
|
1725
|
-
originalWrite(options.jsonError ?
|
|
1730
|
+
originalWrite(options.jsonError ? _chunkJYQ6DGPWcjs.FARM_INTERNAL_SERVER_ERROR_BODY : "Internal Server Error");
|
|
1726
1731
|
};
|
|
1727
1732
|
const htmlChunks = [];
|
|
1728
1733
|
const responseChunks = [];
|
|
@@ -1832,7 +1837,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1832
1837
|
});
|
|
1833
1838
|
res.end = ((...args) => {
|
|
1834
1839
|
interceptedEnd = true;
|
|
1835
|
-
res[
|
|
1840
|
+
res[_chunkVACYUMXWcjs.FARM_NODE_RESPONSE_END_PENDING] = true;
|
|
1836
1841
|
if (afterResponseCalled) return res;
|
|
1837
1842
|
afterResponseCalled = true;
|
|
1838
1843
|
options.logResponse(method, urlPath, res.statusCode || 200, Date.now() - startTime, "PAGE");
|
|
@@ -1915,7 +1920,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1915
1920
|
res.end = originalEnd;
|
|
1916
1921
|
res.writeHead = originalWriteHead;
|
|
1917
1922
|
if (originalFlushHeaders) res.flushHeaders = originalFlushHeaders;
|
|
1918
|
-
delete res[
|
|
1923
|
+
delete res[_chunkVACYUMXWcjs.FARM_NODE_RESPONSE_END_PENDING];
|
|
1919
1924
|
originalEnd(...originalEndArgs);
|
|
1920
1925
|
}).catch((error) => {
|
|
1921
1926
|
reportFailure(error);
|
|
@@ -1932,14 +1937,14 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1932
1937
|
res.end = originalEnd;
|
|
1933
1938
|
res.writeHead = originalWriteHead;
|
|
1934
1939
|
if (originalFlushHeaders) res.flushHeaders = originalFlushHeaders;
|
|
1935
|
-
delete res[
|
|
1940
|
+
delete res[_chunkVACYUMXWcjs.FARM_NODE_RESPONSE_END_PENDING];
|
|
1936
1941
|
originalEnd(body, callback);
|
|
1937
1942
|
} else {
|
|
1938
1943
|
res.write = originalWrite;
|
|
1939
1944
|
res.end = originalEnd;
|
|
1940
1945
|
res.writeHead = originalWriteHead;
|
|
1941
1946
|
if (originalFlushHeaders) res.flushHeaders = originalFlushHeaders;
|
|
1942
|
-
delete res[
|
|
1947
|
+
delete res[_chunkVACYUMXWcjs.FARM_NODE_RESPONSE_END_PENDING];
|
|
1943
1948
|
originalEnd(...originalEndArgs);
|
|
1944
1949
|
}
|
|
1945
1950
|
});
|
|
@@ -1970,7 +1975,7 @@ function getEnvDefines(config, configEnv) {
|
|
|
1970
1975
|
_chunkMCSRMEQVcjs.getPublicFarmImageConfig.call(void 0,
|
|
1971
1976
|
_chunkMCSRMEQVcjs.resolveFarmImageConfig.call(void 0,
|
|
1972
1977
|
config.images,
|
|
1973
|
-
|
|
1978
|
+
_chunkBCTHOQPPcjs.isFarmRendererDisabled.call(void 0, config.renderer) ? "none" : void 0
|
|
1974
1979
|
)
|
|
1975
1980
|
)
|
|
1976
1981
|
)
|
|
@@ -2103,7 +2108,7 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
2103
2108
|
return null;
|
|
2104
2109
|
}
|
|
2105
2110
|
const body = Array.isArray(ast.body) ? ast.body : [];
|
|
2106
|
-
const everyExportIsComponent = options.code.includes(
|
|
2111
|
+
const everyExportIsComponent = options.code.includes(_chunkDRO3NXA3cjs.FARM_CLIENT_REFERENCE_PRAGMA) || options.moduleReference.includes(_chunkDRO3NXA3cjs.FARM_CLIENT_REFERENCE_DIRECTORY);
|
|
2107
2112
|
const replacements = [];
|
|
2108
2113
|
const wrapperStatements = [];
|
|
2109
2114
|
const originalEntries = [];
|
|
@@ -2254,16 +2259,16 @@ async function warnClientBoundaryOnce(context, id, code, config) {
|
|
|
2254
2259
|
for (const finding of analyzeClientBoundary(program, publicKeys)) {
|
|
2255
2260
|
if (finding.kind === "builtin" && !finding.name.startsWith("node:")) {
|
|
2256
2261
|
const resolved = await context.resolve(finding.name, id).catch(() => null);
|
|
2257
|
-
if (!_optionalChain([resolved, 'optionalAccess', _103 => _103.id, 'access', _104 => _104.startsWith, 'call', _105 => _105(
|
|
2262
|
+
if (!_optionalChain([resolved, 'optionalAccess', _103 => _103.id, 'access', _104 => _104.startsWith, 'call', _105 => _105(_chunkDRO3NXA3cjs.FARM_BROWSER_BUILTIN_PREFIX)])) continue;
|
|
2258
2263
|
}
|
|
2259
2264
|
findings.push(finding);
|
|
2260
2265
|
}
|
|
2261
2266
|
if (findings.length === 0) return;
|
|
2262
2267
|
warnedClientBoundaryIds.add(id);
|
|
2263
|
-
const locate =
|
|
2268
|
+
const locate = _chunkDRO3NXA3cjs.createFarmSourceLocator.call(void 0, code, () => context.getCombinedSourcemap());
|
|
2264
2269
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
2265
2270
|
findings.map(
|
|
2266
|
-
(finding) =>
|
|
2271
|
+
(finding) => _chunkDRO3NXA3cjs.formatFarmDiagnostic.call(void 0,
|
|
2267
2272
|
createClientBoundaryDiagnostic(id, finding, locate(finding.start)),
|
|
2268
2273
|
config.root
|
|
2269
2274
|
)
|
|
@@ -2280,7 +2285,7 @@ function isFarmAppRuntimeFile(file, appDirs, routeModuleExtensions) {
|
|
|
2280
2285
|
);
|
|
2281
2286
|
}
|
|
2282
2287
|
function shouldEmitFarmClientRootHmr(renderer) {
|
|
2283
|
-
return
|
|
2288
|
+
return _chunkBCTHOQPPcjs.getFarmRendererCapabilities.call(void 0, _chunkBCTHOQPPcjs.resolveFarmRenderer.call(void 0, renderer)).reconcilesRerenders;
|
|
2284
2289
|
}
|
|
2285
2290
|
var FARM_RUNTIME_MODULE_PREFIX = "/@farm/runtime/";
|
|
2286
2291
|
function toFarmRuntimeModuleId(specifier) {
|
|
@@ -2311,9 +2316,9 @@ function hasFarmSourceAliasOverride(alias) {
|
|
|
2311
2316
|
);
|
|
2312
2317
|
}
|
|
2313
2318
|
function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
2314
|
-
const rendererDisabled =
|
|
2319
|
+
const rendererDisabled = _chunkBCTHOQPPcjs.isFarmRendererDisabled.call(void 0, options.renderer);
|
|
2315
2320
|
const imageImports = farmImageImportsPlugin();
|
|
2316
|
-
const fontImports =
|
|
2321
|
+
const fontImports = _chunkARORZ3MHcjs.farmFontImportsPlugin.call(void 0, {
|
|
2317
2322
|
root: options.root,
|
|
2318
2323
|
basePath: options.basePath,
|
|
2319
2324
|
publicDir: options.publicDir
|
|
@@ -2347,8 +2352,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2347
2352
|
if (mdxComponents) files.add(mdxComponents);
|
|
2348
2353
|
return files;
|
|
2349
2354
|
};
|
|
2350
|
-
const islxActionsMode = () =>
|
|
2351
|
-
const islandsServerFns = () =>
|
|
2355
|
+
const islxActionsMode = () => _chunkARORZ3MHcjs.resolveFarmIslxActionsMode.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _111 => _111.getConfig, 'call', _112 => _112()]), () => ( options)));
|
|
2356
|
+
const islandsServerFns = () => _chunkARORZ3MHcjs.farmBrowserServerFnsEnabled.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _113 => _113.getConfig, 'call', _114 => _114()]), () => ( options)));
|
|
2352
2357
|
let reactRefreshActive = false;
|
|
2353
2358
|
let server;
|
|
2354
2359
|
let deferredGates;
|
|
@@ -2391,11 +2396,11 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2391
2396
|
isBuild = configEnv.command === "build";
|
|
2392
2397
|
const farmAliases = {
|
|
2393
2398
|
..._chunk52Q4OB4Acjs.getFarmLayerAliases.call(void 0, options.layers),
|
|
2394
|
-
...hasFarmSourceAliasOverride(_optionalChain([userConfig, 'access', _124 => _124.resolve, 'optionalAccess', _125 => _125.alias])) ? {} :
|
|
2399
|
+
...hasFarmSourceAliasOverride(_optionalChain([userConfig, 'access', _124 => _124.resolve, 'optionalAccess', _125 => _125.alias])) ? {} : _chunkARORZ3MHcjs.createFarmSourceAlias.call(void 0, options.root || process.cwd(), options.srcDir)
|
|
2395
2400
|
};
|
|
2396
2401
|
if (Object.keys(farmAliases).length > 0) {
|
|
2397
2402
|
_nullishCoalesce(userConfig.resolve, () => ( (userConfig.resolve = {})));
|
|
2398
|
-
userConfig.resolve.alias =
|
|
2403
|
+
userConfig.resolve.alias = _chunkARORZ3MHcjs.mergeFarmViteAlias.call(void 0, farmAliases, userConfig.resolve.alias);
|
|
2399
2404
|
}
|
|
2400
2405
|
const layerRoots = (_nullishCoalesce(options.layers, () => ( []))).map((layer) => layer.root);
|
|
2401
2406
|
farmOwnsDevCors = !isBuild && _optionalChain([userConfig, 'access', _126 => _126.server, 'optionalAccess', _127 => _127.cors]) === void 0;
|
|
@@ -2469,7 +2474,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2469
2474
|
} catch (e21) {
|
|
2470
2475
|
}
|
|
2471
2476
|
};
|
|
2472
|
-
farmApp = new (0,
|
|
2477
|
+
farmApp = new (0, _chunkARORZ3MHcjs.FarmApp)(
|
|
2473
2478
|
{
|
|
2474
2479
|
...options,
|
|
2475
2480
|
root: resolveDevelopmentRoot(options.root, server.config.root)
|
|
@@ -2477,7 +2482,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2477
2482
|
server
|
|
2478
2483
|
);
|
|
2479
2484
|
farmApp.getRouteManager().usePackageClientBoundaryCacheFile(
|
|
2480
|
-
|
|
2485
|
+
_chunkDRO3NXA3cjs.resolvePackageClientBoundaryCacheFile.call(void 0,
|
|
2481
2486
|
farmApp.getConfig().root,
|
|
2482
2487
|
options.distDir || ".farm"
|
|
2483
2488
|
)
|
|
@@ -2488,15 +2493,15 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2488
2493
|
let farmAppPackages;
|
|
2489
2494
|
if (_optionalChain([farmConfig, 'access', _149 => _149.agent, 'optionalAccess', _150 => _150.noindexPreviews])) {
|
|
2490
2495
|
farmMiddlewares.use((_req, res, next) => {
|
|
2491
|
-
if (
|
|
2492
|
-
res.setHeader("X-Robots-Tag",
|
|
2496
|
+
if (_chunkRMPUEH5Tcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
|
|
2497
|
+
res.setHeader("X-Robots-Tag", _chunkEACD6ND7cjs.FARM_PREVIEW_ROBOTS_TAG);
|
|
2493
2498
|
}
|
|
2494
2499
|
next();
|
|
2495
2500
|
});
|
|
2496
2501
|
}
|
|
2497
2502
|
const apiServerBasePath = _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, farmConfig.api);
|
|
2498
2503
|
const devBuiltInRoutePaths = new Set(
|
|
2499
|
-
|
|
2504
|
+
_chunkB2PGVHBGcjs.listFarmBuiltInRoutePaths.call(void 0, {
|
|
2500
2505
|
agent: {
|
|
2501
2506
|
apiCatalog: true,
|
|
2502
2507
|
mcp: true,
|
|
@@ -2546,7 +2551,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2546
2551
|
);
|
|
2547
2552
|
const generateTypeArtifacts = async (reason, selection = ALL_TYPE_ARTIFACTS, log = false) => {
|
|
2548
2553
|
try {
|
|
2549
|
-
const result = await
|
|
2554
|
+
const result = await _chunkVMBIKDKWcjs.generateFarmTypeArtifacts.call(void 0, {
|
|
2550
2555
|
root: farmConfig.root,
|
|
2551
2556
|
srcDir: farmConfig.srcDir,
|
|
2552
2557
|
layers: farmConfig.layers,
|
|
@@ -2590,7 +2595,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2590
2595
|
farmConfig.layers.map((layer) => _optionalChain([layer, 'access', _158 => _158.configFile, 'optionalAccess', _159 => _159.replace, 'call', _160 => _160(/\\/g, "/")])).filter((file) => Boolean(file))
|
|
2591
2596
|
);
|
|
2592
2597
|
const routeModuleExtensions = /* @__PURE__ */ new Set([
|
|
2593
|
-
...
|
|
2598
|
+
..._chunkBCTHOQPPcjs.resolveFarmComponentExtensions.call(void 0, farmConfig.renderer.componentExtensions),
|
|
2594
2599
|
".md",
|
|
2595
2600
|
".mdx"
|
|
2596
2601
|
]);
|
|
@@ -2729,7 +2734,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2729
2734
|
}
|
|
2730
2735
|
})]);
|
|
2731
2736
|
}
|
|
2732
|
-
apiRouteManager = new (0,
|
|
2737
|
+
apiRouteManager = new (0, _chunk5P65LXGUcjs.APIRouteManager)(appDirs, server, {
|
|
2733
2738
|
plugins: farmConfig.plugins,
|
|
2734
2739
|
i18n: farmApp.getI18nRuntime(),
|
|
2735
2740
|
bodySizeLimit: serverConfig.bodySizeLimit,
|
|
@@ -2831,7 +2836,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2831
2836
|
return _chunk7EPYN7GWcjs.resolveFarmLayoutFonts.call(void 0, layoutModules);
|
|
2832
2837
|
};
|
|
2833
2838
|
releaseDocsMCPServers();
|
|
2834
|
-
const isFarmDocsPathGuarded = (href) =>
|
|
2839
|
+
const isFarmDocsPathGuarded = (href) => _chunkNEKO3HM2cjs.farmPathGuardCoversPage.call(void 0,
|
|
2835
2840
|
{
|
|
2836
2841
|
config: farmConfig,
|
|
2837
2842
|
middlewareRoutes: middlewareManager.getMiddlewares().filter((entry) => entry.source !== "config")
|
|
@@ -2844,7 +2849,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2844
2849
|
clientEntry: "/@farm/client.js",
|
|
2845
2850
|
resolveLayoutFonts: resolveDocsLayoutFonts,
|
|
2846
2851
|
fontStylesheetHref: "/@farm/fonts.css",
|
|
2847
|
-
globalStylesheetHref:
|
|
2852
|
+
globalStylesheetHref: _chunkARORZ3MHcjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
2848
2853
|
farmConfig.root,
|
|
2849
2854
|
farmConfig.srcDir
|
|
2850
2855
|
),
|
|
@@ -2875,7 +2880,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2875
2880
|
fontAssets: _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, farmDocsFontAssetList),
|
|
2876
2881
|
resolveLayoutFonts: resolveDocsLayoutFonts,
|
|
2877
2882
|
fontStylesheetHref: "/@farm/fonts.css",
|
|
2878
|
-
globalStylesheetHref:
|
|
2883
|
+
globalStylesheetHref: _chunkARORZ3MHcjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
2879
2884
|
farmConfig.root,
|
|
2880
2885
|
farmConfig.srcDir
|
|
2881
2886
|
),
|
|
@@ -2910,6 +2915,24 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2910
2915
|
});
|
|
2911
2916
|
}
|
|
2912
2917
|
}
|
|
2918
|
+
const farmInfraAnalyticsPlugin = _optionalChain([pm, 'optionalAccess', _188 => _188.getPlugins, 'call', _189 => _189(), 'access', _190 => _190.find, 'call', _191 => _191((plugin2) => plugin2.name === "farm:infra-analytics")]);
|
|
2919
|
+
if (farmInfraAnalyticsPlugin) {
|
|
2920
|
+
_chunkCD5Z7RR5cjs._setFarmInfraAnalyticsWebMCPRoute.call(void 0, farmInfraAnalyticsPlugin, async (pathname) => {
|
|
2921
|
+
if (farmDocsDevRuntime) {
|
|
2922
|
+
const label = _chunkB2PGVHBGcjs.resolveFarmDocsRouteLabel.call(void 0,
|
|
2923
|
+
_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, pathname, farmConfig.basePath),
|
|
2924
|
+
{
|
|
2925
|
+
path: _optionalChain([farmConfig, 'access', _192 => _192.docs, 'optionalAccess', _193 => _193.entry]) || "/docs",
|
|
2926
|
+
roots: _optionalChain([farmConfig, 'access', _194 => _194.docs, 'optionalAccess', _195 => _195.roots, 'optionalAccess', _196 => _196.map, 'call', _197 => _197((root) => root.entry)]),
|
|
2927
|
+
pages: await getFarmDocsPagePaths()
|
|
2928
|
+
}
|
|
2929
|
+
);
|
|
2930
|
+
if (label) return _chunkB2PGVHBGcjs.setFarmRouteLabel.call(void 0, { pathname }, label);
|
|
2931
|
+
}
|
|
2932
|
+
const match = farmApp.getRouteManager().matchRoute(pathname);
|
|
2933
|
+
return { pathname, pattern: _optionalChain([match, 'access', _198 => _198.route, 'optionalAccess', _199 => _199.pattern]) || null };
|
|
2934
|
+
});
|
|
2935
|
+
}
|
|
2913
2936
|
if (farmDocsDevRuntime && !farmDocsDevRuntime.hasFarmDocsRuntimeAdapter(farmConfig.docs)) {
|
|
2914
2937
|
const docsContentDirs = farmDocsDevRuntime.getFarmDocsContentDirs(farmConfig.docs, {
|
|
2915
2938
|
root: farmConfig.root,
|
|
@@ -2982,7 +3005,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2982
3005
|
}
|
|
2983
3006
|
},
|
|
2984
3007
|
(request) => {
|
|
2985
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3008
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _200 => _200.getConfig, 'call', _201 => _201()]), () => ( options));
|
|
2986
3009
|
const currentServerConfig = _chunk7Q7UB4TLcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
|
|
2987
3010
|
return _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, request, {
|
|
2988
3011
|
trustProxy: currentServerConfig.trustProxy
|
|
@@ -2998,7 +3021,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2998
3021
|
withAPIRequestTracing(async function handleFarmDevRequest(req, res, next) {
|
|
2999
3022
|
const requestUrl = req.url || "/";
|
|
3000
3023
|
const requestMethod = req.method || "GET";
|
|
3001
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3024
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _202 => _202.getConfig, 'call', _203 => _203()]), () => ( options));
|
|
3002
3025
|
const currentServerConfig = _chunk7Q7UB4TLcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
|
|
3003
3026
|
const parsedRequestUrl = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
3004
3027
|
trustProxy: currentServerConfig.trustProxy
|
|
@@ -3040,10 +3063,35 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3040
3063
|
return;
|
|
3041
3064
|
}
|
|
3042
3065
|
}
|
|
3066
|
+
if (pm && requestMethod !== "GET" && requestMethod !== "HEAD" && pm._hasRuntimeEndpoint(requestPathname)) {
|
|
3067
|
+
let body;
|
|
3068
|
+
try {
|
|
3069
|
+
body = await _chunk7Q7UB4TLcjs.readNodeRequestBody.call(void 0, req, currentServerConfig.bodySizeLimit);
|
|
3070
|
+
} catch (error) {
|
|
3071
|
+
res.statusCode = _nullishCoalesce(error.status, () => ( 400));
|
|
3072
|
+
res.end();
|
|
3073
|
+
return;
|
|
3074
|
+
}
|
|
3075
|
+
let response;
|
|
3076
|
+
try {
|
|
3077
|
+
const endpointRequest = createRequestFromNodeRequest(req, parsedRequestUrl);
|
|
3078
|
+
response = await pm.runRuntimeRequest(
|
|
3079
|
+
new Request(endpointRequest, { method: requestMethod, body: toRequestBody(body) }),
|
|
3080
|
+
// An endpoint answers before the handler would run.
|
|
3081
|
+
() => new Response(null, { status: 404 }),
|
|
3082
|
+
{ kind: "request", route: { pathname: requestPathname } }
|
|
3083
|
+
);
|
|
3084
|
+
} catch (e22) {
|
|
3085
|
+
sendFarmDevRuntimeHookError(res, true);
|
|
3086
|
+
return;
|
|
3087
|
+
}
|
|
3088
|
+
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, response);
|
|
3089
|
+
return;
|
|
3090
|
+
}
|
|
3043
3091
|
if (!rendererDisabled && (requestMethod === "GET" || requestMethod === "HEAD") && requestPathname === _chunkY3DO7BIJcjs.FARM_VIDEO_PLAYER_PATH) {
|
|
3044
3092
|
res.statusCode = 200;
|
|
3045
3093
|
res.setHeader("Content-Type", "text/html; charset=utf-8");
|
|
3046
|
-
res.end(requestMethod === "HEAD" ? void 0 :
|
|
3094
|
+
res.end(requestMethod === "HEAD" ? void 0 : _chunkARORZ3MHcjs.FARM_VIDEO_PLAYER_HTML);
|
|
3047
3095
|
return;
|
|
3048
3096
|
}
|
|
3049
3097
|
const farmDocsFontPath = farmDocsFontAssets.get(requestPathname);
|
|
@@ -3072,7 +3120,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3072
3120
|
if (referrerUrl.origin === parsedRequestUrl.origin && !referrerUrl.pathname.startsWith(_chunkSTF6VDYQcjs.FARM_DEVTOOLS_PATH)) {
|
|
3073
3121
|
launchUrl = referrerUrl;
|
|
3074
3122
|
}
|
|
3075
|
-
} catch (
|
|
3123
|
+
} catch (e23) {
|
|
3076
3124
|
}
|
|
3077
3125
|
}
|
|
3078
3126
|
launchUrl.searchParams.set(_chunkSTF6VDYQcjs.FARM_DEVTOOLS_LAUNCH_PARAM, "1");
|
|
@@ -3098,7 +3146,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3098
3146
|
openapi: options.openapi
|
|
3099
3147
|
},
|
|
3100
3148
|
workflows: discoveredWorkflows,
|
|
3101
|
-
plugins: _optionalChain([pm, 'optionalAccess',
|
|
3149
|
+
plugins: _optionalChain([pm, 'optionalAccess', _204 => _204.getSortedPlugins, 'call', _205 => _205()])
|
|
3102
3150
|
});
|
|
3103
3151
|
res.statusCode = 200;
|
|
3104
3152
|
res.setHeader(
|
|
@@ -3122,7 +3170,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3122
3170
|
}
|
|
3123
3171
|
const isViteOwnedRequest = () => requestUrl.startsWith("/@") || requestUrl.startsWith("/node_modules/") || requestUrl.startsWith("/__farm/") || isViteModuleRequest(parsedRequestUrl, req.headers) || (requestMethod === "GET" || requestMethod === "HEAD") && requestPathname.includes(".") && (devServableFileExists(requestPathname, [server.config.publicDir]) || isViteDevClientRequest(parsedRequestUrl, req.headers) && devServableFileExists(requestPathname, [server.config.root]));
|
|
3124
3172
|
const configRewriteSource = req[FARM_DEV_CONFIG_REWRITE_SOURCE];
|
|
3125
|
-
const runtimeHookErrorAnswersJSON = rendererDisabled ||
|
|
3173
|
+
const runtimeHookErrorAnswersJSON = rendererDisabled || _chunkJYQ6DGPWcjs.isFarmAPIPathname.call(void 0, requestPathname, apiServerBasePath);
|
|
3126
3174
|
const requestedPagePathname = configRewriteSource === void 0 ? requestPathname : new URL(configRewriteSource).pathname;
|
|
3127
3175
|
let pageHookRouteMatch;
|
|
3128
3176
|
const pageHookRoute = () => {
|
|
@@ -3133,10 +3181,10 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3133
3181
|
render: {
|
|
3134
3182
|
pathname: pathname2,
|
|
3135
3183
|
method: requestMethod,
|
|
3136
|
-
routePattern: _optionalChain([match, 'optionalAccess',
|
|
3137
|
-
params: _optionalChain([match, 'optionalAccess',
|
|
3184
|
+
routePattern: _optionalChain([match, 'optionalAccess', _206 => _206.route, 'optionalAccess', _207 => _207.pattern]) || null,
|
|
3185
|
+
params: _optionalChain([match, 'optionalAccess', _208 => _208.params]) || {}
|
|
3138
3186
|
},
|
|
3139
|
-
layoutPatterns: (_optionalChain([match, 'optionalAccess',
|
|
3187
|
+
layoutPatterns: (_optionalChain([match, 'optionalAccess', _209 => _209.layouts]) || []).map((layout) => layout.pattern)
|
|
3140
3188
|
};
|
|
3141
3189
|
return pageHookRouteMatch;
|
|
3142
3190
|
};
|
|
@@ -3203,7 +3251,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3203
3251
|
const redirectResponse = response;
|
|
3204
3252
|
try {
|
|
3205
3253
|
const metadataRoute = matchAppMetadataRoute(requestPathname);
|
|
3206
|
-
const kind = metadataRoute ? "asset" :
|
|
3254
|
+
const kind = metadataRoute ? "asset" : _chunkJYQ6DGPWcjs.isFarmAPIPathname.call(void 0, requestPathname, apiServerBasePath) ? "api" : requestMethod === "GET" || requestMethod === "HEAD" ? "page" : "request";
|
|
3207
3255
|
response = await pm.runRuntimeRequest(
|
|
3208
3256
|
createRequestFromNodeRequest(req, parsedRequestUrl),
|
|
3209
3257
|
async () => {
|
|
@@ -3212,7 +3260,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3212
3260
|
},
|
|
3213
3261
|
{ kind, route: { pathname: requestPathname, ...metadataRoute } }
|
|
3214
3262
|
);
|
|
3215
|
-
} catch (
|
|
3263
|
+
} catch (e24) {
|
|
3216
3264
|
sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
|
|
3217
3265
|
logResponse(requestMethod, requestUrl, 500, 0, "PAGE");
|
|
3218
3266
|
return;
|
|
@@ -3224,7 +3272,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3224
3272
|
}
|
|
3225
3273
|
}
|
|
3226
3274
|
const runAppMiddlewareForContentRoute = async () => {
|
|
3227
|
-
if (!_optionalChain([middlewareManager, 'optionalAccess',
|
|
3275
|
+
if (!_optionalChain([middlewareManager, 'optionalAccess', _210 => _210.hasMiddleware, 'call', _211 => _211()])) return false;
|
|
3228
3276
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
3229
3277
|
return runFarmMiddlewareWithNavigation(
|
|
3230
3278
|
farmApp.getServerRenderer(),
|
|
@@ -3253,7 +3301,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3253
3301
|
return errorResponse;
|
|
3254
3302
|
}
|
|
3255
3303
|
);
|
|
3256
|
-
} catch (
|
|
3304
|
+
} catch (e25) {
|
|
3257
3305
|
sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
|
|
3258
3306
|
return 500;
|
|
3259
3307
|
}
|
|
@@ -3262,7 +3310,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3262
3310
|
return response.status;
|
|
3263
3311
|
};
|
|
3264
3312
|
const runAppMiddlewareInRuntimeSession = async (runtimeSession2, logResponse2) => {
|
|
3265
|
-
const interceptor = runtimeSession2 && _optionalChain([pm, 'optionalAccess',
|
|
3313
|
+
const interceptor = runtimeSession2 && _optionalChain([pm, 'optionalAccess', _212 => _212.hasRuntimeHook, 'call', _213 => _213("after")]) && _optionalChain([middlewareManager, 'optionalAccess', _214 => _214.hasMiddleware, 'call', _215 => _215()]) ? interceptFarmDevPageResponse({
|
|
3266
3314
|
req,
|
|
3267
3315
|
res,
|
|
3268
3316
|
pm,
|
|
@@ -3275,7 +3323,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3275
3323
|
urlPath: requestUrl,
|
|
3276
3324
|
pathname: requestPathname,
|
|
3277
3325
|
startTime: Date.now(),
|
|
3278
|
-
logResponse: (_method, _path, status) => _optionalChain([logResponse2, 'optionalCall',
|
|
3326
|
+
logResponse: (_method, _path, status) => _optionalChain([logResponse2, 'optionalCall', _216 => _216(status)]),
|
|
3279
3327
|
// The runtime reports a runtime.after failure itself.
|
|
3280
3328
|
emitError: async () => {
|
|
3281
3329
|
},
|
|
@@ -3286,7 +3334,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3286
3334
|
handled = await runAppMiddlewareForContentRoute();
|
|
3287
3335
|
} catch (error) {
|
|
3288
3336
|
if (runtimeHookErrorAnswersJSON || res.headersSent) {
|
|
3289
|
-
_optionalChain([interceptor, 'optionalAccess',
|
|
3337
|
+
_optionalChain([interceptor, 'optionalAccess', _217 => _217.release, 'call', _218 => _218()]);
|
|
3290
3338
|
throw error;
|
|
3291
3339
|
}
|
|
3292
3340
|
if (runtimeSession2) await pm.reportRuntimeRequestError(runtimeSession2, error);
|
|
@@ -3294,10 +3342,10 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3294
3342
|
return true;
|
|
3295
3343
|
}
|
|
3296
3344
|
if (!handled) {
|
|
3297
|
-
_optionalChain([interceptor, 'optionalAccess',
|
|
3345
|
+
_optionalChain([interceptor, 'optionalAccess', _219 => _219.release, 'call', _220 => _220()]);
|
|
3298
3346
|
return false;
|
|
3299
3347
|
}
|
|
3300
|
-
if (!_optionalChain([interceptor, 'optionalAccess',
|
|
3348
|
+
if (!_optionalChain([interceptor, 'optionalAccess', _221 => _221.isEnded, 'call', _222 => _222()])) _optionalChain([logResponse2, 'optionalCall', _223 => _223(res.statusCode || 200)]);
|
|
3301
3349
|
return true;
|
|
3302
3350
|
};
|
|
3303
3351
|
const serveBuiltInRoute = async (respond, {
|
|
@@ -3306,14 +3354,14 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3306
3354
|
label
|
|
3307
3355
|
} = {}) => {
|
|
3308
3356
|
const discard = async () => {
|
|
3309
|
-
await _optionalChain([computed, 'optionalAccess',
|
|
3357
|
+
await _optionalChain([computed, 'optionalAccess', _224 => _224.body, 'optionalAccess', _225 => _225.cancel, 'call', _226 => _226(), 'access', _227 => _227.catch, 'call', _228 => _228(() => {
|
|
3310
3358
|
})]);
|
|
3311
3359
|
};
|
|
3312
3360
|
const sendRuntimeResponse = async (runtimeSession3, response2) => {
|
|
3313
3361
|
let runtimeResponse;
|
|
3314
3362
|
try {
|
|
3315
3363
|
runtimeResponse = await pm.endRuntimeRequest(runtimeSession3, response2);
|
|
3316
|
-
} catch (
|
|
3364
|
+
} catch (e26) {
|
|
3317
3365
|
sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
|
|
3318
3366
|
return;
|
|
3319
3367
|
}
|
|
@@ -3323,15 +3371,15 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3323
3371
|
if (pm && opensFarmDevRuntimeSession(pm)) {
|
|
3324
3372
|
try {
|
|
3325
3373
|
const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath);
|
|
3326
|
-
const route =
|
|
3374
|
+
const route = _chunkB2PGVHBGcjs.setFarmRouteLabel.call(void 0,
|
|
3327
3375
|
{ pathname: requestPathname },
|
|
3328
|
-
label !== void 0 ? label : devBuiltInRoutePaths.has(routePathname) ? routePathname :
|
|
3376
|
+
label !== void 0 ? label : devBuiltInRoutePaths.has(routePathname) ? routePathname : _chunkB2PGVHBGcjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath)
|
|
3329
3377
|
);
|
|
3330
3378
|
runtimeSession2 = await pm.beginRuntimeRequest(
|
|
3331
3379
|
createRequestFromNodeRequest(req, new URL(fullUrl)),
|
|
3332
3380
|
{ kind, route }
|
|
3333
3381
|
);
|
|
3334
|
-
} catch (
|
|
3382
|
+
} catch (e27) {
|
|
3335
3383
|
await discard();
|
|
3336
3384
|
sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
|
|
3337
3385
|
return;
|
|
@@ -3363,7 +3411,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3363
3411
|
}
|
|
3364
3412
|
responding = true;
|
|
3365
3413
|
response = await respond(
|
|
3366
|
-
_nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess',
|
|
3414
|
+
_nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess', _229 => _229.request]), () => ( createRequestFromNodeRequest(req, new URL(fullUrl))))
|
|
3367
3415
|
);
|
|
3368
3416
|
} catch (error) {
|
|
3369
3417
|
if (!responding && !res.headersSent) {
|
|
@@ -3383,7 +3431,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3383
3431
|
else await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, response);
|
|
3384
3432
|
};
|
|
3385
3433
|
const openAPIRequestPathname = openAPIManager ? _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) : requestPathname;
|
|
3386
|
-
if (openAPIManager && _optionalChain([options, 'access',
|
|
3434
|
+
if (openAPIManager && _optionalChain([options, 'access', _230 => _230.openapi, 'optionalAccess', _231 => _231.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
|
|
3387
3435
|
const specManager = openAPIManager;
|
|
3388
3436
|
await serveBuiltInRoute(async () => {
|
|
3389
3437
|
if (requestMethod !== "GET" && requestMethod !== "HEAD") {
|
|
@@ -3403,7 +3451,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3403
3451
|
});
|
|
3404
3452
|
return;
|
|
3405
3453
|
}
|
|
3406
|
-
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access',
|
|
3454
|
+
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _232 => _232.openapi, 'optionalAccess', _233 => _233.route])) {
|
|
3407
3455
|
const docsManager = openAPIManager;
|
|
3408
3456
|
await serveBuiltInRoute(
|
|
3409
3457
|
async () => {
|
|
@@ -3414,8 +3462,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3414
3462
|
);
|
|
3415
3463
|
return;
|
|
3416
3464
|
}
|
|
3417
|
-
if (_optionalChain([options, 'access',
|
|
3418
|
-
const manifestGuardCoversPath = (path7) =>
|
|
3465
|
+
if (_optionalChain([options, 'access', _234 => _234.agent, 'optionalAccess', _235 => _235.manifest]) !== false && _chunkB2PGVHBGcjs.isFarmAppManifestPath.call(void 0, _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath))) {
|
|
3466
|
+
const manifestGuardCoversPath = (path7) => _chunkNEKO3HM2cjs.farmPathGuardCoversEndpoint.call(void 0,
|
|
3419
3467
|
{
|
|
3420
3468
|
config: farmConfig,
|
|
3421
3469
|
middlewareRoutes: middlewareManager.getMiddlewares().filter((entry) => entry.source !== "config")
|
|
@@ -3424,18 +3472,18 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3424
3472
|
apiServerBasePath
|
|
3425
3473
|
);
|
|
3426
3474
|
await serveBuiltInRoute(async () => {
|
|
3427
|
-
_nullishCoalesce(farmAppPackages, () => ( (farmAppPackages =
|
|
3428
|
-
const manifest = await
|
|
3475
|
+
_nullishCoalesce(farmAppPackages, () => ( (farmAppPackages = _chunkARORZ3MHcjs.resolveFarmAppPackages.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd()))))));
|
|
3476
|
+
const manifest = await _chunkB2PGVHBGcjs.createFarmAppManifestResponse.call(void 0,
|
|
3429
3477
|
new Request(parsedRequestUrl, {
|
|
3430
3478
|
method: requestMethod,
|
|
3431
3479
|
headers: { "if-none-match": String(_nullishCoalesce(req.headers["if-none-match"], () => ( ""))) }
|
|
3432
3480
|
}),
|
|
3433
3481
|
{
|
|
3434
|
-
...
|
|
3482
|
+
..._chunkB2PGVHBGcjs.resolveFarmAppManifestInput.call(void 0, farmConfig, {
|
|
3435
3483
|
build: "development",
|
|
3436
3484
|
packages: farmAppPackages,
|
|
3437
3485
|
// Read again on each request; unchanged files come from a cache.
|
|
3438
|
-
webmcpTools: _optionalChain([farmConfig, 'access',
|
|
3486
|
+
webmcpTools: _optionalChain([farmConfig, 'access', _236 => _236.plugins, 'optionalAccess', _237 => _237.some, 'call', _238 => _238(({ name }) => name === "farm:webmcp")]) ? _chunkARORZ3MHcjs.collectFarmWebMCPTools.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd())), farmConfig.srcDir) : []
|
|
3439
3487
|
}),
|
|
3440
3488
|
defaultMCP: () => farmApp.getServerRenderer().getDefaultMCPServer(),
|
|
3441
3489
|
// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
@@ -3453,11 +3501,11 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3453
3501
|
});
|
|
3454
3502
|
return;
|
|
3455
3503
|
}
|
|
3456
|
-
if (_optionalChain([options, 'access',
|
|
3504
|
+
if (_optionalChain([options, 'access', _239 => _239.agent, 'optionalAccess', _240 => _240.apiCatalog]) && _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunkB2PGVHBGcjs.FARM_API_CATALOG_PATH) {
|
|
3457
3505
|
await serveBuiltInRoute(
|
|
3458
|
-
() =>
|
|
3506
|
+
() => _chunkB2PGVHBGcjs.createFarmApiCatalogResponse.call(void 0,
|
|
3459
3507
|
requestMethod,
|
|
3460
|
-
|
|
3508
|
+
_chunkB2PGVHBGcjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
|
|
3461
3509
|
new Request(parsedRequestUrl, {
|
|
3462
3510
|
headers: { "user-agent": String(_nullishCoalesce(req.headers["user-agent"], () => ( ""))) }
|
|
3463
3511
|
})
|
|
@@ -3465,8 +3513,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3465
3513
|
);
|
|
3466
3514
|
return;
|
|
3467
3515
|
}
|
|
3468
|
-
if (_optionalChain([options, 'access',
|
|
3469
|
-
const aiCatalog =
|
|
3516
|
+
if (_optionalChain([options, 'access', _241 => _241.agent, 'optionalAccess', _242 => _242.aiCatalog]) !== false) {
|
|
3517
|
+
const aiCatalog = _chunkB2PGVHBGcjs.createFarmAiCatalogResponse.call(void 0,
|
|
3470
3518
|
new Request(parsedRequestUrl, {
|
|
3471
3519
|
method: requestMethod,
|
|
3472
3520
|
headers: {
|
|
@@ -3514,7 +3562,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3514
3562
|
);
|
|
3515
3563
|
const docsResponse = await farmDocsHandler(docsHandlerRequest);
|
|
3516
3564
|
if (docsResponse) {
|
|
3517
|
-
const docsPage = _optionalChain([docsResponse, 'access',
|
|
3565
|
+
const docsPage = _optionalChain([docsResponse, 'access', _243 => _243.headers, 'access', _244 => _244.get, 'call', _245 => _245("content-type"), 'optionalAccess', _246 => _246.toLowerCase, 'call', _247 => _247(), 'access', _248 => _248.includes, 'call', _249 => _249("text/html")]);
|
|
3518
3566
|
await serveBuiltInRoute(
|
|
3519
3567
|
async (request) => {
|
|
3520
3568
|
if (!docsPage) {
|
|
@@ -3532,7 +3580,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3532
3580
|
farmConfig.deploymentId
|
|
3533
3581
|
);
|
|
3534
3582
|
if (deploymentMismatch) {
|
|
3535
|
-
await _optionalChain([docsResponse, 'access',
|
|
3583
|
+
await _optionalChain([docsResponse, 'access', _250 => _250.body, 'optionalAccess', _251 => _251.cancel, 'call', _252 => _252()]);
|
|
3536
3584
|
return _chunkNLBHLPEOcjs.createFarmDeploymentMismatchResponse.call(void 0, deploymentMismatch);
|
|
3537
3585
|
}
|
|
3538
3586
|
return _chunkNLBHLPEOcjs.withFarmDeploymentResponse.call(void 0,
|
|
@@ -3548,11 +3596,11 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3548
3596
|
{
|
|
3549
3597
|
kind: "docs",
|
|
3550
3598
|
computed: docsResponse,
|
|
3551
|
-
label:
|
|
3599
|
+
label: _chunkB2PGVHBGcjs.resolveFarmDocsEngineRouteLabel.call(void 0,
|
|
3552
3600
|
_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath),
|
|
3553
3601
|
{
|
|
3554
|
-
path: _optionalChain([farmConfig, 'access',
|
|
3555
|
-
roots: _optionalChain([farmConfig, 'access',
|
|
3602
|
+
path: _optionalChain([farmConfig, 'access', _253 => _253.docs, 'optionalAccess', _254 => _254.entry]) || "/docs",
|
|
3603
|
+
roots: _optionalChain([farmConfig, 'access', _255 => _255.docs, 'optionalAccess', _256 => _256.roots, 'optionalAccess', _257 => _257.map, 'call', _258 => _258((root) => root.entry)]),
|
|
3556
3604
|
pages: await getFarmDocsPagePaths()
|
|
3557
3605
|
}
|
|
3558
3606
|
)
|
|
@@ -3561,7 +3609,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3561
3609
|
return;
|
|
3562
3610
|
}
|
|
3563
3611
|
}
|
|
3564
|
-
if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD" || requestMethod === "POST") && _optionalChain([req, 'access',
|
|
3612
|
+
if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD" || requestMethod === "POST") && _optionalChain([req, 'access', _259 => _259.headers, 'access', _260 => _260.accept, 'optionalAccess', _261 => _261.includes, 'call', _262 => _262(_chunk3HLQTOVUcjs.FARM_NATIVE_TREE_CONTENT_TYPE)])) {
|
|
3565
3613
|
const { createFarmNativeTreeResponse } = await import("./native-tree-5TENEQ7Y.cjs");
|
|
3566
3614
|
const treeBodyInit = requestMethod === "POST" ? { body: _chunk7Q7UB4TLcjs.createFarmNodeRequestBodyStream.call(void 0, req), duplex: "half" } : {};
|
|
3567
3615
|
const treeResponse = await createFarmNativeTreeResponse({
|
|
@@ -3579,15 +3627,15 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3579
3627
|
});
|
|
3580
3628
|
await serveBuiltInRoute(() => treeResponse, {
|
|
3581
3629
|
computed: treeResponse,
|
|
3582
|
-
label: _nullishCoalesce(_optionalChain([farmApp, 'access',
|
|
3630
|
+
label: _nullishCoalesce(_optionalChain([farmApp, 'access', _263 => _263.getRouteManager, 'call', _264 => _264(), 'access', _265 => _265.matchRoute, 'call', _266 => _266(_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath)), 'access', _267 => _267.route, 'optionalAccess', _268 => _268.pattern]), () => ( null))
|
|
3583
3631
|
});
|
|
3584
3632
|
return;
|
|
3585
3633
|
}
|
|
3586
3634
|
const markdownRouteLabel = () => (
|
|
3587
3635
|
// On the route path, as production labels it: /fr/index.md is /index.md.
|
|
3588
|
-
|
|
3636
|
+
_chunkB2PGVHBGcjs.resolveFarmMarkdownRouteLabel.call(void 0,
|
|
3589
3637
|
toRoutePathname(requestPathname),
|
|
3590
|
-
(page) => _optionalChain([farmApp, 'access',
|
|
3638
|
+
(page) => _optionalChain([farmApp, 'access', _269 => _269.getRouteManager, 'call', _270 => _270(), 'access', _271 => _271.matchRoute, 'call', _272 => _272(page), 'access', _273 => _273.route, 'optionalAccess', _274 => _274.pattern])
|
|
3591
3639
|
)
|
|
3592
3640
|
);
|
|
3593
3641
|
const markdownSourceResponse = viteModuleRequest ? null : await _chunk26WP75W5cjs.createFarmMarkdownSourceResponse.call(void 0, {
|
|
@@ -3599,14 +3647,14 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3599
3647
|
routePathname: toRoutePathname,
|
|
3600
3648
|
resolveSource: async (pathname2) => {
|
|
3601
3649
|
const match = farmApp.getRouteManager().matchRoute(pathname2);
|
|
3602
|
-
const sourcePath = _optionalChain([match, 'access',
|
|
3650
|
+
const sourcePath = _optionalChain([match, 'access', _275 => _275.route, 'optionalAccess', _276 => _276.markdownSourcePath]) || (match.route && _chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
|
|
3603
3651
|
if (!sourcePath) {
|
|
3604
3652
|
return null;
|
|
3605
3653
|
}
|
|
3606
3654
|
return {
|
|
3607
3655
|
source: await fs2.promises.readFile(sourcePath, "utf8"),
|
|
3608
3656
|
// Project-relative, as production sends it: never the machine's path.
|
|
3609
|
-
filePath:
|
|
3657
|
+
filePath: _chunkARORZ3MHcjs.toBakedMarkdownSourcePath.call(void 0, farmApp.getConfig().root, sourcePath)
|
|
3610
3658
|
};
|
|
3611
3659
|
},
|
|
3612
3660
|
// The anonymous check goes through this server, so its guards and
|
|
@@ -3741,7 +3789,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3741
3789
|
}
|
|
3742
3790
|
const configuredIntegrations = currentConfig.integrations;
|
|
3743
3791
|
const tryConfiguredIntegrationRoute = async () => {
|
|
3744
|
-
const matchedRoute =
|
|
3792
|
+
const matchedRoute = _chunkB3HQTGXScjs.matchIntegrationRoute.call(void 0, configuredIntegrations, {
|
|
3745
3793
|
pathname: requestPathname,
|
|
3746
3794
|
method: requestMethod
|
|
3747
3795
|
});
|
|
@@ -3755,8 +3803,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3755
3803
|
await pm.runHookParallelFiltered(
|
|
3756
3804
|
"beforeRequest",
|
|
3757
3805
|
(plugin2) => {
|
|
3758
|
-
const owner =
|
|
3759
|
-
return !isFarmConfigRoutePlugin(plugin2) && (_optionalChain([owner, 'optionalAccess',
|
|
3806
|
+
const owner = _chunkB3HQTGXScjs.getFarmIntegrationPluginOwner.call(void 0, plugin2);
|
|
3807
|
+
return !isFarmConfigRoutePlugin(plugin2) && (_optionalChain([owner, 'optionalAccess', _277 => _277.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
|
|
3760
3808
|
},
|
|
3761
3809
|
req,
|
|
3762
3810
|
res
|
|
@@ -3785,7 +3833,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3785
3833
|
});
|
|
3786
3834
|
const dispatchIntegration = async (request, runtime) => {
|
|
3787
3835
|
try {
|
|
3788
|
-
const result = await
|
|
3836
|
+
const result = await _chunkB3HQTGXScjs.dispatchIntegrationRequest.call(void 0,
|
|
3789
3837
|
{
|
|
3790
3838
|
integration: matchedRoute.integration,
|
|
3791
3839
|
config: currentConfig,
|
|
@@ -3793,7 +3841,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3793
3841
|
isProd: false
|
|
3794
3842
|
},
|
|
3795
3843
|
request,
|
|
3796
|
-
{ clientAddress: _optionalChain([req, 'access',
|
|
3844
|
+
{ clientAddress: _optionalChain([req, 'access', _278 => _278.socket, 'optionalAccess', _279 => _279.remoteAddress]) }
|
|
3797
3845
|
);
|
|
3798
3846
|
if (!result) {
|
|
3799
3847
|
throw new Error(`Matched integration route did not return a response`);
|
|
@@ -3801,8 +3849,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3801
3849
|
return result;
|
|
3802
3850
|
} catch (error) {
|
|
3803
3851
|
_chunk7U4XF76Rcjs.logger.error(`Integration route error: ${error}`);
|
|
3804
|
-
await _optionalChain([runtime, 'optionalAccess',
|
|
3805
|
-
return
|
|
3852
|
+
await _optionalChain([runtime, 'optionalAccess', _280 => _280.reportError, 'call', _281 => _281(error)]);
|
|
3853
|
+
return _chunkJYQ6DGPWcjs.createFarmInternalServerErrorResponse.call(void 0, );
|
|
3806
3854
|
}
|
|
3807
3855
|
};
|
|
3808
3856
|
runtimeReportsErrors = Boolean(pm);
|
|
@@ -3843,7 +3891,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3843
3891
|
} else if (!res.writableEnded) {
|
|
3844
3892
|
res.statusCode = 500;
|
|
3845
3893
|
res.setHeader("Content-Type", "application/json");
|
|
3846
|
-
res.end(
|
|
3894
|
+
res.end(_chunkJYQ6DGPWcjs.FARM_INTERNAL_SERVER_ERROR_BODY);
|
|
3847
3895
|
}
|
|
3848
3896
|
return true;
|
|
3849
3897
|
}
|
|
@@ -3852,10 +3900,10 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3852
3900
|
const hasLocalDevRoute = () => {
|
|
3853
3901
|
const routeManager3 = farmApp.getRouteManager();
|
|
3854
3902
|
return Boolean(
|
|
3855
|
-
|
|
3903
|
+
_chunkB3HQTGXScjs.matchIntegrationRoute.call(void 0, configuredIntegrations, {
|
|
3856
3904
|
pathname: requestPathname,
|
|
3857
3905
|
method: requestMethod
|
|
3858
|
-
}) || routeManager3.matchRedirect(requestPathname) || apiRouteManager.matchRoute(requestPathname) || farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
3906
|
+
}) || routeManager3.matchRedirect(requestPathname) || apiRouteManager.matchRoute(requestPathname) || farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _282 => _282.isFarmDocsAPIRequest, 'call', _283 => _283(requestPathname)]) || routeManager3.matchRoute(requestPathname).route || routeManager3.matchMetadataRoute(requestPathname) || routeManager3.matchMetadataImage(requestPathname)
|
|
3859
3907
|
);
|
|
3860
3908
|
};
|
|
3861
3909
|
try {
|
|
@@ -3889,7 +3937,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3889
3937
|
}
|
|
3890
3938
|
const matchedApiRoute = apiRouteManager.matchRoute(requestPathname);
|
|
3891
3939
|
const hasMatchedApiRoute = Boolean(matchedApiRoute);
|
|
3892
|
-
if (hasMatchedApiRoute ||
|
|
3940
|
+
if (hasMatchedApiRoute || _chunkJYQ6DGPWcjs.isFarmAPIPathname.call(void 0, requestPathname, apiServerBasePath)) {
|
|
3893
3941
|
const startTime2 = Date.now();
|
|
3894
3942
|
const method2 = req.method || "GET";
|
|
3895
3943
|
const urlPath2 = req.url || "/";
|
|
@@ -3918,7 +3966,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3918
3966
|
_chunk7U4XF76Rcjs.logger.error(`Request hook error: ${error}`);
|
|
3919
3967
|
res.statusCode = 500;
|
|
3920
3968
|
res.setHeader("Content-Type", "application/json");
|
|
3921
|
-
res.end(
|
|
3969
|
+
res.end(_chunkJYQ6DGPWcjs.FARM_INTERNAL_SERVER_ERROR_BODY);
|
|
3922
3970
|
return;
|
|
3923
3971
|
}
|
|
3924
3972
|
const createAPIRequest = async () => {
|
|
@@ -3945,15 +3993,15 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3945
3993
|
);
|
|
3946
3994
|
};
|
|
3947
3995
|
const isDocsAPIRequest = Boolean(
|
|
3948
|
-
farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
3996
|
+
farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _284 => _284.isFarmDocsAPIRequest, 'call', _285 => _285(pathname2)])
|
|
3949
3997
|
);
|
|
3950
3998
|
const docsRuntimeOptions = () => ({
|
|
3951
3999
|
kind: "docs",
|
|
3952
|
-
route:
|
|
4000
|
+
route: _chunkB2PGVHBGcjs.setFarmRouteLabel.call(void 0,
|
|
3953
4001
|
{ pathname: pathname2, pattern: urlPath2 },
|
|
3954
|
-
|
|
3955
|
-
path: _optionalChain([farmConfig, 'access',
|
|
3956
|
-
roots: _optionalChain([farmConfig, 'access',
|
|
4002
|
+
_chunkB2PGVHBGcjs.resolveFarmDocsRouteLabel.call(void 0, pathname2, {
|
|
4003
|
+
path: _optionalChain([farmConfig, 'access', _286 => _286.docs, 'optionalAccess', _287 => _287.entry]) || "/docs",
|
|
4004
|
+
roots: _optionalChain([farmConfig, 'access', _288 => _288.docs, 'optionalAccess', _289 => _289.roots, 'optionalAccess', _290 => _290.map, 'call', _291 => _291((root) => root.entry)])
|
|
3957
4005
|
})
|
|
3958
4006
|
)
|
|
3959
4007
|
});
|
|
@@ -4035,7 +4083,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4035
4083
|
const routedApiRoute = rewritten ? apiRouteManager.matchRoute(routedPathname) : matchedApiRoute || apiRouteManager.matchRoute(pathname2);
|
|
4036
4084
|
const hasExplicitAPIRoute = Boolean(routedApiRoute);
|
|
4037
4085
|
if (apiHandler && hasExplicitAPIRoute) {
|
|
4038
|
-
const apiRoutePattern = _optionalChain([routedApiRoute, 'optionalAccess',
|
|
4086
|
+
const apiRoutePattern = _optionalChain([routedApiRoute, 'optionalAccess', _292 => _292.route, 'access', _293 => _293.path]) || urlPath2;
|
|
4039
4087
|
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
4040
4088
|
type: "route.matched",
|
|
4041
4089
|
pathname: pathname2,
|
|
@@ -4085,8 +4133,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4085
4133
|
error
|
|
4086
4134
|
});
|
|
4087
4135
|
_chunk7U4XF76Rcjs.logger.error(`API route error: ${error}`);
|
|
4088
|
-
await _optionalChain([runtime, 'optionalAccess',
|
|
4089
|
-
response =
|
|
4136
|
+
await _optionalChain([runtime, 'optionalAccess', _294 => _294.reportError, 'call', _295 => _295(error)]);
|
|
4137
|
+
response = _chunkJYQ6DGPWcjs.createFarmInternalServerErrorResponse.call(void 0, );
|
|
4090
4138
|
}
|
|
4091
4139
|
return pm ? await pm.runHookSerial("afterApiHandler", response, apiLifecyclePayload) : response;
|
|
4092
4140
|
};
|
|
@@ -4190,12 +4238,12 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4190
4238
|
}
|
|
4191
4239
|
return;
|
|
4192
4240
|
}
|
|
4193
|
-
if (_optionalChain([req, 'access',
|
|
4241
|
+
if (_optionalChain([req, 'access', _296 => _296.url, 'optionalAccess', _297 => _297.startsWith, 'call', _298 => _298("/@")]) || _optionalChain([req, 'access', _299 => _299.url, 'optionalAccess', _300 => _300.startsWith, 'call', _301 => _301("/node_modules")])) {
|
|
4194
4242
|
return next();
|
|
4195
4243
|
}
|
|
4196
4244
|
if (!deferredDottedRequests.has(req) && shouldBypassFarmRouterForDottedPath(
|
|
4197
4245
|
requestPathname,
|
|
4198
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
4246
|
+
_optionalChain([farmApp, 'optionalAccess', _302 => _302.getRouteManager, 'call', _303 => _303()]),
|
|
4199
4247
|
[server.config.publicDir, server.config.root],
|
|
4200
4248
|
farmAgentGeneratedPaths(farmConfig),
|
|
4201
4249
|
requestMethod
|
|
@@ -4203,7 +4251,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4203
4251
|
if (!viteModuleRequest) deferredDottedRequests.set(req, requestUrl);
|
|
4204
4252
|
return next();
|
|
4205
4253
|
}
|
|
4206
|
-
if (_optionalChain([req, 'access',
|
|
4254
|
+
if (_optionalChain([req, 'access', _304 => _304.url, 'optionalAccess', _305 => _305.startsWith, 'call', _306 => _306("/__farm/page-data")])) {
|
|
4207
4255
|
const urlObj = parsedRequestUrl;
|
|
4208
4256
|
const targetPath = urlObj.searchParams.get("path") || "/";
|
|
4209
4257
|
let renderedRequest;
|
|
@@ -4233,7 +4281,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4233
4281
|
renderedRequest = targetRequest;
|
|
4234
4282
|
let middlewareMap = /* @__PURE__ */ new Map();
|
|
4235
4283
|
let middlewareContext = /* @__PURE__ */ new Map();
|
|
4236
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
4284
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _307 => _307.hasMiddleware, 'call', _308 => _308()])) {
|
|
4237
4285
|
const targetNodeRequest = createPageDataMiddlewareRequest(req, targetRequestUrl);
|
|
4238
4286
|
const targetNodeResponse = createPageDataMiddlewareResponse(res);
|
|
4239
4287
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
@@ -4267,10 +4315,10 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4267
4315
|
if (pm) {
|
|
4268
4316
|
await pm.runHookParallel("afterRouteMatch", {
|
|
4269
4317
|
pathname: targetPath,
|
|
4270
|
-
matched: !!_optionalChain([match, 'optionalAccess',
|
|
4271
|
-
routePattern: _optionalChain([match, 'optionalAccess',
|
|
4272
|
-
params: _optionalChain([match, 'optionalAccess',
|
|
4273
|
-
layoutPatterns: (_optionalChain([match, 'optionalAccess',
|
|
4318
|
+
matched: !!_optionalChain([match, 'optionalAccess', _309 => _309.route]),
|
|
4319
|
+
routePattern: _optionalChain([match, 'optionalAccess', _310 => _310.route, 'optionalAccess', _311 => _311.pattern]) || null,
|
|
4320
|
+
params: _optionalChain([match, 'optionalAccess', _312 => _312.params]) || {},
|
|
4321
|
+
layoutPatterns: (_optionalChain([match, 'optionalAccess', _313 => _313.layouts]) || []).map((l) => l.pattern)
|
|
4274
4322
|
});
|
|
4275
4323
|
}
|
|
4276
4324
|
if (!match) {
|
|
@@ -4305,7 +4353,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4305
4353
|
);
|
|
4306
4354
|
const loadingModule = loadingBoundary ? await routeManager3.loadRouteModule(loadingBoundary.modulePath) : null;
|
|
4307
4355
|
const navigationManifest = routeManager3.generateClientManifest(server.config.root);
|
|
4308
|
-
const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => (
|
|
4356
|
+
const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => ( _chunkDRO3NXA3cjs.getClientModuleMetadata.call(void 0, route.modulePath, server.config.root)));
|
|
4309
4357
|
const isClientComponent = moduleMetadata.isClientComponent;
|
|
4310
4358
|
const shouldHydrate = moduleMetadata.shouldHydrate;
|
|
4311
4359
|
let mergedMetadata = {};
|
|
@@ -4316,7 +4364,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4316
4364
|
(layout) => _nullishCoalesce(navigationManifest.layouts.find(
|
|
4317
4365
|
(entry) => entry.pattern === layout.pattern
|
|
4318
4366
|
), () => ( {
|
|
4319
|
-
...
|
|
4367
|
+
..._chunkDRO3NXA3cjs.getClientModuleMetadata.call(void 0, layout.modulePath, server.config.root),
|
|
4320
4368
|
serverTree: false
|
|
4321
4369
|
}))
|
|
4322
4370
|
);
|
|
@@ -4330,17 +4378,17 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4330
4378
|
)
|
|
4331
4379
|
];
|
|
4332
4380
|
const hydrationIslandStrategy = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0,
|
|
4333
|
-
_optionalChain([(_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
4334
|
-
) === "islands" ?
|
|
4381
|
+
_optionalChain([(_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _314 => _314.getConfig, 'call', _315 => _315()]), () => ( options))), 'access', _316 => _316.experimental, 'optionalAccess', _317 => _317.serverComponents])
|
|
4382
|
+
) === "islands" ? _chunkARORZ3MHcjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
4335
4383
|
route,
|
|
4336
4384
|
{ shouldHydrate, islandStrategy: _nullishCoalesce(moduleMetadata.islandStrategy, () => ( null)) },
|
|
4337
4385
|
layouts.map((layout, index) => ({
|
|
4338
4386
|
pattern: layout.pattern,
|
|
4339
4387
|
modulePath: layout.modulePath,
|
|
4340
|
-
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access',
|
|
4388
|
+
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _318 => _318[index], 'optionalAccess', _319 => _319.shouldHydrate]) === true,
|
|
4341
4389
|
// Manifest entries carry it; metadata read from source does not.
|
|
4342
|
-
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access',
|
|
4343
|
-
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access',
|
|
4390
|
+
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access', _320 => _320[index], 'optionalAccess', _321 => _321.hasIsolatedClientBoundaries]) === true,
|
|
4391
|
+
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _322 => _322[index], 'optionalAccess', _323 => _323.islandStrategy]), () => ( null))
|
|
4344
4392
|
})),
|
|
4345
4393
|
server.config.root,
|
|
4346
4394
|
true
|
|
@@ -4397,7 +4445,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4397
4445
|
const slotModule = await routeManager3.loadRouteModule(slot.route.modulePath);
|
|
4398
4446
|
const slotMetadata = _nullishCoalesce(navigationManifest.slots.find(
|
|
4399
4447
|
(entry) => entry.name === slot.name && entry.ownerPattern === slot.ownerPattern && entry.pattern === slot.route.pattern
|
|
4400
|
-
), () => (
|
|
4448
|
+
), () => ( _chunkDRO3NXA3cjs.getClientModuleMetadata.call(void 0, slot.route.modulePath, server.config.root)));
|
|
4401
4449
|
const slotContext = await _chunkX333W5KVcjs.resolveFarmRouteContext.call(void 0, farmApp.getConfig(), {
|
|
4402
4450
|
request: targetRequest,
|
|
4403
4451
|
params: slot.params,
|
|
@@ -4443,15 +4491,15 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4443
4491
|
);
|
|
4444
4492
|
const projectRoot = server.config.root;
|
|
4445
4493
|
const toUrlPath = (absolutePath) => _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, absolutePath, projectRoot);
|
|
4446
|
-
const renderPlan =
|
|
4494
|
+
const renderPlan = _chunkNEKO3HM2cjs.createFarmRouteRenderPlan.call(void 0, {
|
|
4447
4495
|
pageShouldHydrate: shouldHydrate,
|
|
4448
4496
|
layoutShouldHydrate: shouldHydrateLayout,
|
|
4449
4497
|
islandStrategy: hydrationIslandStrategy,
|
|
4450
|
-
rendering:
|
|
4498
|
+
rendering: _chunkVMBIKDKWcjs.resolveRouteRenderingConfig.call(void 0, routeModule)
|
|
4451
4499
|
});
|
|
4452
4500
|
const destinationLayoutPatterns = layouts.map((layout) => layout.pattern);
|
|
4453
|
-
const layoutStartIndex =
|
|
4454
|
-
|
|
4501
|
+
const layoutStartIndex = _chunkNEKO3HM2cjs.getSharedLayoutPrefixLength.call(void 0,
|
|
4502
|
+
_chunkNEKO3HM2cjs.parseFarmLayoutChainHeader.call(void 0, request.headers.get("x-farm-layout-chain")),
|
|
4455
4503
|
destinationLayoutPatterns
|
|
4456
4504
|
);
|
|
4457
4505
|
const renderer = farmApp.getServerRenderer();
|
|
@@ -4461,13 +4509,13 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4461
4509
|
middlewareContext,
|
|
4462
4510
|
() => renderer.renderNavigationFragment({
|
|
4463
4511
|
PageComponent: routeModule.default,
|
|
4464
|
-
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess',
|
|
4512
|
+
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _324 => _324.default]),
|
|
4465
4513
|
pageProps: routeProps,
|
|
4466
4514
|
params,
|
|
4467
4515
|
layouts: layouts.map((layout, index) => ({
|
|
4468
4516
|
pattern: layout.pattern,
|
|
4469
4517
|
module: layoutModules[index],
|
|
4470
|
-
serverTree: _optionalChain([layoutHydrationMetadata, 'access',
|
|
4518
|
+
serverTree: _optionalChain([layoutHydrationMetadata, 'access', _325 => _325[index], 'optionalAccess', _326 => _326.serverTree])
|
|
4471
4519
|
})),
|
|
4472
4520
|
layoutStartIndex,
|
|
4473
4521
|
slots: routeSlots.map((slot) => ({
|
|
@@ -4533,7 +4581,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4533
4581
|
{
|
|
4534
4582
|
status: 200,
|
|
4535
4583
|
headers: {
|
|
4536
|
-
"Cache-Control":
|
|
4584
|
+
"Cache-Control": _chunkNEKO3HM2cjs.getFarmFragmentCacheControl.call(void 0, renderPlan),
|
|
4537
4585
|
"X-Farm-Navigation": "html-fragment",
|
|
4538
4586
|
Vary: "X-Farm-Layout-Chain",
|
|
4539
4587
|
[_chunkNLBHLPEOcjs.FARM_DEPLOYMENT_ID_HEADER]: farmConfig.deploymentId
|
|
@@ -4575,14 +4623,14 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4575
4623
|
trustProxy: currentServerConfig.trustProxy
|
|
4576
4624
|
}).pathname;
|
|
4577
4625
|
const routeManager2 = farmApp.getRouteManager();
|
|
4578
|
-
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
4579
|
-
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
4580
|
-
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
4626
|
+
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _327 => _327.hasHook, 'call', _328 => _328("beforeRequest")]), () => ( false));
|
|
4627
|
+
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _329 => _329.hasHook, 'call', _330 => _330("afterResponse")]), () => ( false));
|
|
4628
|
+
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _331 => _331.hasHook, 'call', _332 => _332("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _333 => _333.hasHook, 'call', _334 => _334("afterRender")]), () => ( false)));
|
|
4581
4629
|
const opensRuntimeSession = pm ? opensFarmDevRuntimeSession(pm) : false;
|
|
4582
|
-
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
4630
|
+
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _335 => _335.hasRuntimeHook, 'call', _336 => _336("after")]), () => ( false));
|
|
4583
4631
|
const pageBuiltInRouteLabel = (pathname2) => {
|
|
4584
4632
|
const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, pathname2, farmConfig.basePath);
|
|
4585
|
-
const mcpLabel =
|
|
4633
|
+
const mcpLabel = _chunkB2PGVHBGcjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath);
|
|
4586
4634
|
if (mcpLabel) return mcpLabel;
|
|
4587
4635
|
if (farmAgentGeneratedPaths(farmConfig).includes(routePathname)) return routePathname;
|
|
4588
4636
|
return routePathname === _chunkW53Z4WDIcjs.FARM_DEFAULT_MCP_PATH && farmApp.getServerRenderer().getDefaultMCPServer() ? _chunkW53Z4WDIcjs.FARM_DEFAULT_MCP_PATH : null;
|
|
@@ -4591,13 +4639,13 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4591
4639
|
const match = routeManager2.matchRoute(pathname2);
|
|
4592
4640
|
return {
|
|
4593
4641
|
kind: "page",
|
|
4594
|
-
route:
|
|
4642
|
+
route: _chunkB2PGVHBGcjs.setFarmRouteLabel.call(void 0,
|
|
4595
4643
|
{
|
|
4596
4644
|
pathname: pathname2,
|
|
4597
|
-
pattern: _optionalChain([match, 'optionalAccess',
|
|
4598
|
-
params: _optionalChain([match, 'optionalAccess',
|
|
4645
|
+
pattern: _optionalChain([match, 'optionalAccess', _337 => _337.route, 'optionalAccess', _338 => _338.pattern]) || null,
|
|
4646
|
+
params: _optionalChain([match, 'optionalAccess', _339 => _339.params]) || {}
|
|
4599
4647
|
},
|
|
4600
|
-
_optionalChain([match, 'optionalAccess',
|
|
4648
|
+
_optionalChain([match, 'optionalAccess', _340 => _340.route]) ? null : pageBuiltInRouteLabel(pathname2)
|
|
4601
4649
|
)
|
|
4602
4650
|
};
|
|
4603
4651
|
};
|
|
@@ -4677,7 +4725,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4677
4725
|
}) : void 0;
|
|
4678
4726
|
let middlewareFailed = false;
|
|
4679
4727
|
try {
|
|
4680
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
4728
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _341 => _341.hasMiddleware, 'call', _342 => _342()])) {
|
|
4681
4729
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
4682
4730
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
4683
4731
|
farmApp.getServerRenderer(),
|
|
@@ -4690,7 +4738,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4690
4738
|
throw error;
|
|
4691
4739
|
});
|
|
4692
4740
|
if (handled) {
|
|
4693
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
4741
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _343 => _343.isEnded, 'call', _344 => _344()])) {
|
|
4694
4742
|
const duration = Date.now() - startTime;
|
|
4695
4743
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
4696
4744
|
}
|
|
@@ -4705,8 +4753,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4705
4753
|
res
|
|
4706
4754
|
);
|
|
4707
4755
|
}
|
|
4708
|
-
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess',
|
|
4709
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
4756
|
+
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _345 => _345.isEnded, 'call', _346 => _346()])) {
|
|
4757
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _347 => _347.isEnded, 'call', _348 => _348()])) {
|
|
4710
4758
|
const duration = Date.now() - startTime;
|
|
4711
4759
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
4712
4760
|
}
|
|
@@ -4725,8 +4773,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4725
4773
|
await pm.reportRuntimeRequestError(runtimeSession, error);
|
|
4726
4774
|
} else {
|
|
4727
4775
|
await pm.failRuntimeRequest(runtimeSession, error);
|
|
4728
|
-
if (!res.headersSent && !_optionalChain([responseInterceptor, 'optionalAccess',
|
|
4729
|
-
_optionalChain([responseInterceptor, 'optionalAccess',
|
|
4776
|
+
if (!res.headersSent && !_optionalChain([responseInterceptor, 'optionalAccess', _349 => _349.isEnded, 'call', _350 => _350()])) {
|
|
4777
|
+
_optionalChain([responseInterceptor, 'optionalAccess', _351 => _351.release, 'call', _352 => _352()]);
|
|
4730
4778
|
console.error("[FARM] Page error:", error);
|
|
4731
4779
|
sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
|
|
4732
4780
|
return;
|
|
@@ -4743,7 +4791,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4743
4791
|
}
|
|
4744
4792
|
})
|
|
4745
4793
|
);
|
|
4746
|
-
const farmRequestMiddleware = _optionalChain([farmMiddlewares, 'access',
|
|
4794
|
+
const farmRequestMiddleware = _optionalChain([farmMiddlewares, 'access', _353 => _353.stack, 'access', _354 => _354.at, 'call', _355 => _355(-1), 'optionalAccess', _356 => _356.handle]);
|
|
4747
4795
|
if (farmOwnsDevCors && viteServer.config.server.cors === false) {
|
|
4748
4796
|
farmMiddlewares.use(createFarmDevViteCorsMiddleware());
|
|
4749
4797
|
}
|
|
@@ -4772,7 +4820,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4772
4820
|
});
|
|
4773
4821
|
}
|
|
4774
4822
|
if (id.startsWith("@farm.js/core/internal/") && importer && isOutsideAppRoot(importer)) {
|
|
4775
|
-
const root = _optionalChain([farmApp, 'optionalAccess',
|
|
4823
|
+
const root = _optionalChain([farmApp, 'optionalAccess', _357 => _357.getConfig, 'call', _358 => _358(), 'access', _359 => _359.root]) || _optionalChain([server, 'optionalAccess', _360 => _360.config, 'access', _361 => _361.root]) || options.root;
|
|
4776
4824
|
return this.resolve(id, path6.join(root, "package.json"), {
|
|
4777
4825
|
...resolveOptions,
|
|
4778
4826
|
skipSelf: true
|
|
@@ -4800,7 +4848,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4800
4848
|
}
|
|
4801
4849
|
},
|
|
4802
4850
|
async load(id, loadOptions) {
|
|
4803
|
-
if (pendingClientSetup && !_optionalChain([loadOptions, 'optionalAccess',
|
|
4851
|
+
if (pendingClientSetup && !_optionalChain([loadOptions, 'optionalAccess', _362 => _362.ssr]) && !farmSetupContext.getStore()) {
|
|
4804
4852
|
await pendingClientSetup;
|
|
4805
4853
|
}
|
|
4806
4854
|
if (_chunkPIUTGRDIcjs.isFarmServerFnBoundaryId.call(void 0, id) && islandsServerFns()) {
|
|
@@ -4818,8 +4866,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4818
4866
|
if (imageModule) return imageModule;
|
|
4819
4867
|
}
|
|
4820
4868
|
if (_chunkYUCU6XB4cjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
|
|
4821
|
-
const renderer = _optionalChain([farmApp, 'optionalAccess',
|
|
4822
|
-
const root = _optionalChain([server, 'optionalAccess',
|
|
4869
|
+
const renderer = _optionalChain([farmApp, 'optionalAccess', _363 => _363.getConfig, 'call', _364 => _364(), 'access', _365 => _365.renderer]) || _chunkBCTHOQPPcjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
4870
|
+
const root = _optionalChain([server, 'optionalAccess', _366 => _366.config, 'access', _367 => _367.root]) || options.root;
|
|
4823
4871
|
if (isClientEnvironment(this, loadOptions)) {
|
|
4824
4872
|
return generateProgrammaticClientRouteModuleForId(
|
|
4825
4873
|
id,
|
|
@@ -4835,65 +4883,65 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4835
4883
|
return FARM_DEV_CLIENT_BOOT_MODULE;
|
|
4836
4884
|
}
|
|
4837
4885
|
if (isFarmClientVirtualId(id)) {
|
|
4838
|
-
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
4839
|
-
const renderer = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4840
|
-
const integrations = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4841
|
-
const root = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4842
|
-
const docs = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4886
|
+
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _368 => _368.getConfig, 'call', _369 => _369()]);
|
|
4887
|
+
const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _370 => _370.renderer]) || _chunkBCTHOQPPcjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
4888
|
+
const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _371 => _371.integrations]) || options.integrations;
|
|
4889
|
+
const root = _optionalChain([resolvedConfig, 'optionalAccess', _372 => _372.root]) || _optionalChain([server, 'optionalAccess', _373 => _373.config, 'access', _374 => _374.root]) || process.cwd();
|
|
4890
|
+
const docs = _optionalChain([resolvedConfig, 'optionalAccess', _375 => _375.docs]);
|
|
4843
4891
|
const adapterOwnsDocsRuntime = Boolean(
|
|
4844
|
-
|
|
4892
|
+
_chunkBCTHOQPPcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _376 => _376.adapter, 'optionalAccess', _377 => _377.server]) && docs.adapter.react
|
|
4845
4893
|
);
|
|
4846
|
-
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4894
|
+
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _378 => _378.devtools]), () => ( _chunkSTF6VDYQcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
|
|
4847
4895
|
const [docsRuntime, docsSearchRuntime, devtoolsClientRuntime] = await Promise.all([
|
|
4848
|
-
_optionalChain([docs, 'optionalAccess',
|
|
4849
|
-
_optionalChain([docs, 'optionalAccess',
|
|
4896
|
+
_optionalChain([docs, 'optionalAccess', _379 => _379.enabled]) ? loadFarmDocsDevRuntime() : null,
|
|
4897
|
+
_optionalChain([docs, 'optionalAccess', _380 => _380.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
|
|
4850
4898
|
devtools.enabled ? loadFarmDevtoolsClientRuntime() : null
|
|
4851
4899
|
]);
|
|
4852
|
-
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess',
|
|
4900
|
+
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _381 => _381.isFarmDocsSearchEnabled, 'call', _382 => _382(docs)]), () => ( false));
|
|
4853
4901
|
const generatedDocsSearchRuntime = docsSearchRuntime ? docsSearchRuntime.generateFarmDocsSearchClientRuntime(
|
|
4854
4902
|
docsSearchEnabled,
|
|
4855
4903
|
docsSearchEnabled ? docsSearchRuntime.resolveFarmDocsSearchClientModule(root) : void 0
|
|
4856
4904
|
) : EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME;
|
|
4857
4905
|
const generatedDevtoolsClientRuntime = devtoolsClientRuntime ? devtoolsClientRuntime.generateFarmDevtoolsClientRuntime(devtools) : "";
|
|
4858
4906
|
const generatedDevIndicatorsClientRuntime = farmApp ? _chunkUVV3I5QAcjs.generateFarmDevIndicatorsClientRuntime.call(void 0, farmApp.getConfig().devIndicators) : "";
|
|
4859
|
-
const integrationProviders =
|
|
4860
|
-
const isolatedHydrationMode =
|
|
4861
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4907
|
+
const integrationProviders = _chunkB3HQTGXScjs.getIntegrationProviders.call(void 0, integrations);
|
|
4908
|
+
const isolatedHydrationMode = _chunkDRO3NXA3cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
4909
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _383 => _383.experimental, 'optionalAccess', _384 => _384.isolatedClientHydration]),
|
|
4862
4910
|
{
|
|
4863
|
-
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4911
|
+
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _385 => _385.experimental, 'optionalAccess', _386 => _386.serverComponents])) === "rsc",
|
|
4864
4912
|
hasUnsupportedIntegrationProvider: integrationProviders.filter((provider) => provider.component || provider.type === "clerk").some((provider) => provider.supportsIsolatedHydration !== true)
|
|
4865
4913
|
}
|
|
4866
4914
|
);
|
|
4867
4915
|
return generateClientCode(
|
|
4868
4916
|
integrationProviders,
|
|
4869
4917
|
[
|
|
4870
|
-
...
|
|
4871
|
-
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess',
|
|
4918
|
+
..._chunkB3HQTGXScjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
|
|
4919
|
+
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _387 => _387.getFarmDocsDocumentNavigationMatchers, 'call', _388 => _388(docs)]), () => ( []))
|
|
4872
4920
|
],
|
|
4873
4921
|
generatedDocsSearchRuntime,
|
|
4874
4922
|
`${generatedDevtoolsClientRuntime}
|
|
4875
4923
|
${generatedDevIndicatorsClientRuntime}`,
|
|
4876
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4924
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _389 => _389.plugins]) || [],
|
|
4877
4925
|
root,
|
|
4878
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4879
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4880
|
-
|
|
4926
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _390 => _390.srcDir]) || options.srcDir || "src",
|
|
4927
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _391 => _391.publicRuntimeConfig]) || options.publicRuntimeConfig,
|
|
4928
|
+
_chunkBCTHOQPPcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _392 => _392.adapter, 'optionalAccess', _393 => _393.react]) : void 0,
|
|
4881
4929
|
renderer,
|
|
4882
|
-
isolatedHydrationMode === "enabled" ||
|
|
4883
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4884
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4885
|
-
|
|
4886
|
-
|
|
4930
|
+
isolatedHydrationMode === "enabled" || _chunkBCTHOQPPcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _394 => _394.getRouteManager, 'call', _395 => _395(), 'access', _396 => _396.getIsolatedClientBoundaryModules, 'call', _397 => _397(root)])))), 'optionalAccess', _398 => _398.size]) > 0,
|
|
4931
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _399 => _399.trailingSlash]), () => ( false)),
|
|
4932
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _400 => _400.basePath]), () => ( "/")),
|
|
4933
|
+
_chunkARORZ3MHcjs.generateClientCachePersistenceCode.call(void 0,
|
|
4934
|
+
_chunkARORZ3MHcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, _optionalChain([resolvedConfig, 'optionalAccess', _401 => _401.cache]))
|
|
4887
4935
|
),
|
|
4888
|
-
|
|
4889
|
-
_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4936
|
+
_chunkBCTHOQPPcjs.isReactRenderer.call(void 0, renderer) ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0,
|
|
4937
|
+
_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _402 => _402.experimental, 'optionalAccess', _403 => _403.serverComponents])) === "islands"
|
|
4890
4938
|
);
|
|
4891
4939
|
}
|
|
4892
4940
|
if (id === "/@farm/server") {
|
|
4893
4941
|
return generateServerCode();
|
|
4894
4942
|
}
|
|
4895
4943
|
if (id === "/@farm/manifest") {
|
|
4896
|
-
const routeManager = _optionalChain([farmApp, 'optionalAccess',
|
|
4944
|
+
const routeManager = _optionalChain([farmApp, 'optionalAccess', _404 => _404.getRouteManager, 'call', _405 => _405()]);
|
|
4897
4945
|
if (!routeManager) {
|
|
4898
4946
|
return `
|
|
4899
4947
|
export const getManifest = () => ({
|
|
@@ -4905,11 +4953,11 @@ export const getManifest = () => ({
|
|
|
4905
4953
|
});
|
|
4906
4954
|
`;
|
|
4907
4955
|
}
|
|
4908
|
-
const globalStylesheetHref =
|
|
4956
|
+
const globalStylesheetHref = _chunkARORZ3MHcjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
4909
4957
|
server.config.root,
|
|
4910
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
4958
|
+
_optionalChain([farmApp, 'optionalAccess', _406 => _406.getConfig, 'call', _407 => _407(), 'access', _408 => _408.srcDir])
|
|
4911
4959
|
);
|
|
4912
|
-
const fullManifest =
|
|
4960
|
+
const fullManifest = _chunkARORZ3MHcjs.createFarmDevClientManifest.call(void 0,
|
|
4913
4961
|
routeManager.generateClientManifest(server.config.root),
|
|
4914
4962
|
{
|
|
4915
4963
|
sharedAssets: globalStylesheetHref ? [{ tag: "link", attrs: { rel: "stylesheet", href: globalStylesheetHref } }] : []
|
|
@@ -4925,64 +4973,64 @@ export { manifest };
|
|
|
4925
4973
|
}
|
|
4926
4974
|
},
|
|
4927
4975
|
async transform(code, id, transformOptions) {
|
|
4928
|
-
if (pendingClientSetup && !_optionalChain([transformOptions, 'optionalAccess',
|
|
4976
|
+
if (pendingClientSetup && !_optionalChain([transformOptions, 'optionalAccess', _409 => _409.ssr]) && !farmSetupContext.getStore()) {
|
|
4929
4977
|
await pendingClientSetup;
|
|
4930
4978
|
}
|
|
4931
|
-
const runtimeModule = !isBuild && _optionalChain([transformOptions, 'optionalAccess',
|
|
4932
|
-
const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
4979
|
+
const runtimeModule = !isBuild && _optionalChain([transformOptions, 'optionalAccess', _410 => _410.ssr]) === true && isOutsideAppRoot(id) ? toFarmRuntimeModuleId : void 0;
|
|
4980
|
+
const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _411 => _411.getConfig, 'call', _412 => _412()]), () => ( options));
|
|
4933
4981
|
let rewrotePackageImports = false;
|
|
4934
|
-
if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access',
|
|
4982
|
+
if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access', _413 => _413.experimental, 'optionalAccess', _414 => _414.serverComponents])) === "islands" && (!id.includes("/node_modules/") || _optionalChain([transformOptions, 'optionalAccess', _415 => _415.ssr]) === true && farmReactServerFiles.has(id.split("?", 1)[0])) && !id.startsWith("\0") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id) && !_chunkDRO3NXA3cjs.hasUseClientDirective.call(void 0, code)) {
|
|
4935
4983
|
const file = id.split("?", 1)[0];
|
|
4936
|
-
const projectRoot = actionConfig.root || _optionalChain([server, 'optionalAccess',
|
|
4984
|
+
const projectRoot = actionConfig.root || _optionalChain([server, 'optionalAccess', _416 => _416.config, 'access', _417 => _417.root]) || process.cwd();
|
|
4937
4985
|
const buildSnapshot = isBuild ? options.sourceSnapshot : void 0;
|
|
4938
4986
|
const rewrite = () => {
|
|
4939
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
4987
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _418 => _418.ssr]) === true) {
|
|
4940
4988
|
if (farmReactServerFiles.has(file)) {
|
|
4941
|
-
for (const child of
|
|
4989
|
+
for (const child of _chunkDRO3NXA3cjs.farmRelativeImportFiles.call(void 0, code, file))
|
|
4942
4990
|
farmReactServerFiles.add(child);
|
|
4943
4991
|
}
|
|
4944
|
-
const serverModule = farmReactServerFiles.has(file) || !
|
|
4992
|
+
const serverModule = farmReactServerFiles.has(file) || !_chunkDRO3NXA3cjs.getFarmClientReachableModules.call(void 0,
|
|
4945
4993
|
path6.resolve(projectRoot, actionConfig.srcDir || "src"),
|
|
4946
4994
|
projectRoot
|
|
4947
4995
|
).has(path6.resolve(file));
|
|
4948
|
-
const reactServer = !serverModule ? null :
|
|
4996
|
+
const reactServer = !serverModule ? null : _chunkDRO3NXA3cjs.rewriteFarmReactServerImports.call(void 0, {
|
|
4949
4997
|
code,
|
|
4950
4998
|
file,
|
|
4951
|
-
reference: (specifier, exportName) =>
|
|
4999
|
+
reference: (specifier, exportName) => _chunkDRO3NXA3cjs.ensureFarmPackageClientReference.call(void 0, projectRoot, specifier, exportName, file),
|
|
4952
5000
|
onServerFile: (serverFile) => farmReactServerFiles.add(serverFile)
|
|
4953
5001
|
});
|
|
4954
5002
|
if (reactServer !== null) {
|
|
4955
5003
|
code = reactServer;
|
|
4956
5004
|
rewrotePackageImports = true;
|
|
4957
5005
|
}
|
|
4958
|
-
const internal = farmReactServerFiles.has(file) ?
|
|
5006
|
+
const internal = farmReactServerFiles.has(file) ? _chunkDRO3NXA3cjs.rewriteFarmReactServerClientModuleImports.call(void 0, {
|
|
4959
5007
|
code,
|
|
4960
5008
|
file,
|
|
4961
|
-
reference: (clientFile) =>
|
|
5009
|
+
reference: (clientFile) => _chunkDRO3NXA3cjs.ensureFarmInternalClientReference.call(void 0, projectRoot, clientFile)
|
|
4962
5010
|
}) : null;
|
|
4963
5011
|
if (internal !== null) {
|
|
4964
5012
|
code = internal;
|
|
4965
5013
|
rewrotePackageImports = true;
|
|
4966
5014
|
}
|
|
4967
5015
|
}
|
|
4968
|
-
const rewritePackageImports = (source2) =>
|
|
5016
|
+
const rewritePackageImports = (source2) => _chunkDRO3NXA3cjs.rewriteFarmPackageClientImports.call(void 0, {
|
|
4969
5017
|
code: source2,
|
|
4970
5018
|
file,
|
|
4971
5019
|
root: projectRoot,
|
|
4972
|
-
isClientPackage: (specifier) =>
|
|
5020
|
+
isClientPackage: (specifier) => _chunkDRO3NXA3cjs.isFarmPackageClientBoundary.call(void 0, file, specifier, projectRoot)
|
|
4973
5021
|
});
|
|
4974
|
-
const routeManager = _optionalChain([farmApp, 'optionalAccess',
|
|
5022
|
+
const routeManager = _optionalChain([farmApp, 'optionalAccess', _419 => _419.getRouteManager, 'call', _420 => _420()]);
|
|
4975
5023
|
const source = code;
|
|
4976
5024
|
const referenced = routeManager ? routeManager.inspectPackages(() => rewritePackageImports(source)) : rewritePackageImports(source);
|
|
4977
5025
|
if (referenced !== null) {
|
|
4978
5026
|
code = referenced;
|
|
4979
5027
|
rewrotePackageImports = true;
|
|
4980
5028
|
}
|
|
4981
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
5029
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _421 => _421.ssr]) === true) {
|
|
4982
5030
|
const cached = rewriteFarmReactCacheImport(
|
|
4983
5031
|
code,
|
|
4984
5032
|
file,
|
|
4985
|
-
_optionalChain([runtimeModule, 'optionalCall',
|
|
5033
|
+
_optionalChain([runtimeModule, 'optionalCall', _422 => _422(FARM_REACT_CACHE_MODULE)])
|
|
4986
5034
|
);
|
|
4987
5035
|
if (cached !== null) {
|
|
4988
5036
|
code = cached;
|
|
@@ -4990,12 +5038,12 @@ export { manifest };
|
|
|
4990
5038
|
}
|
|
4991
5039
|
}
|
|
4992
5040
|
};
|
|
4993
|
-
if (buildSnapshot)
|
|
5041
|
+
if (buildSnapshot) _chunkDRO3NXA3cjs.withFarmSourceSnapshotOf.call(void 0, buildSnapshot, rewrite);
|
|
4994
5042
|
else rewrite();
|
|
4995
5043
|
}
|
|
4996
5044
|
if (islandsServerFns() && !_chunkPIUTGRDIcjs.isFarmServerFnBoundaryId.call(void 0, id) && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
|
|
4997
5045
|
const serverFns = _chunkPIUTGRDIcjs.transformFarmServerFns.call(void 0, code, id, {
|
|
4998
|
-
environment: _optionalChain([transformOptions, 'optionalAccess',
|
|
5046
|
+
environment: _optionalChain([transformOptions, 'optionalAccess', _423 => _423.ssr]) === true ? "rsc" : "client"
|
|
4999
5047
|
});
|
|
5000
5048
|
if (serverFns) {
|
|
5001
5049
|
if (!serverFns.code.includes("use server")) return { code: serverFns.code, map: null };
|
|
@@ -5008,8 +5056,8 @@ export { manifest };
|
|
|
5008
5056
|
const actionModule = transformFarmFormActionModule({
|
|
5009
5057
|
code,
|
|
5010
5058
|
id,
|
|
5011
|
-
root: actionConfig.root || _optionalChain([server, 'optionalAccess',
|
|
5012
|
-
ssr: _optionalChain([transformOptions, 'optionalAccess',
|
|
5059
|
+
root: actionConfig.root || _optionalChain([server, 'optionalAccess', _424 => _424.config, 'access', _425 => _425.root]) || process.cwd(),
|
|
5060
|
+
ssr: _optionalChain([transformOptions, 'optionalAccess', _426 => _426.ssr]) === true,
|
|
5013
5061
|
// Parsed by file type: page components are TSX.
|
|
5014
5062
|
parse: (source) => _vite.parseSync.call(void 0, file, source).program,
|
|
5015
5063
|
runtimeModule,
|
|
@@ -5017,21 +5065,21 @@ export { manifest };
|
|
|
5017
5065
|
});
|
|
5018
5066
|
if (actionModule) return { code: actionModule, map: null };
|
|
5019
5067
|
}
|
|
5020
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
5021
|
-
const docsConfigModule = _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess',
|
|
5022
|
-
if (
|
|
5023
|
-
const redacted =
|
|
5068
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _427 => _427.ssr])) {
|
|
5069
|
+
const docsConfigModule = _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess', _428 => _428.getConfig, 'call', _429 => _429(), 'optionalAccess', _430 => _430.docs]));
|
|
5070
|
+
if (_chunkARORZ3MHcjs.isFarmDocsClientConfigModule.call(void 0, id, docsConfigModule)) {
|
|
5071
|
+
const redacted = _chunkARORZ3MHcjs.redactFarmDocsClientConfig.call(void 0, code, id.split("?")[0]);
|
|
5024
5072
|
if (redacted !== null) return { code: redacted, map: null };
|
|
5025
5073
|
}
|
|
5026
5074
|
}
|
|
5027
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
5028
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
5029
|
-
if ((_optionalChain([currentConfig, 'access',
|
|
5075
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _431 => _431.ssr])) {
|
|
5076
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _432 => _432.getConfig, 'call', _433 => _433()]), () => ( options));
|
|
5077
|
+
if ((_optionalChain([currentConfig, 'access', _434 => _434.experimental, 'optionalAccess', _435 => _435.serverActions]) !== true || !serverFnTransformActive) && !islandsServerFns()) {
|
|
5030
5078
|
const violation = findClientServerFnViolation(code, id);
|
|
5031
5079
|
if (violation) {
|
|
5032
|
-
const locate =
|
|
5080
|
+
const locate = _chunkDRO3NXA3cjs.createFarmSourceLocator.call(void 0, code, () => this.getCombinedSourcemap());
|
|
5033
5081
|
this.error(
|
|
5034
|
-
|
|
5082
|
+
_chunkDRO3NXA3cjs.formatFarmDiagnostic.call(void 0,
|
|
5035
5083
|
createServerFnBoundaryDiagnostic(violation, id, locate(violation.start)),
|
|
5036
5084
|
currentConfig.root
|
|
5037
5085
|
)
|
|
@@ -5039,8 +5087,8 @@ export { manifest };
|
|
|
5039
5087
|
}
|
|
5040
5088
|
}
|
|
5041
5089
|
}
|
|
5042
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
5043
|
-
await warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
5090
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _436 => _436.ssr]) && shouldInspectClientBoundary(id, code)) {
|
|
5091
|
+
await warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _437 => _437.getConfig, 'call', _438 => _438()]), () => ( options)));
|
|
5044
5092
|
}
|
|
5045
5093
|
if (typeof imageImports.transform === "function") {
|
|
5046
5094
|
const imageModule = await imageImports.transform.call(this, code, id, transformOptions);
|
|
@@ -5055,13 +5103,13 @@ export { manifest };
|
|
|
5055
5103
|
id,
|
|
5056
5104
|
transformOptions
|
|
5057
5105
|
);
|
|
5058
|
-
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess',
|
|
5106
|
+
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _439 => _439.code, 'optionalAccess', _440 => _440.toString, 'call', _441 => _441()]);
|
|
5059
5107
|
if (fontCode) {
|
|
5060
5108
|
transformedCode = fontCode;
|
|
5061
5109
|
transformed = true;
|
|
5062
5110
|
}
|
|
5063
5111
|
}
|
|
5064
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
5112
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _442 => _442.ssr]) && server) {
|
|
5065
5113
|
const rewrittenImports = rewriteEarlySsrRelativeImports({
|
|
5066
5114
|
code: transformedCode,
|
|
5067
5115
|
id,
|
|
@@ -5073,26 +5121,26 @@ export { manifest };
|
|
|
5073
5121
|
transformed = true;
|
|
5074
5122
|
}
|
|
5075
5123
|
}
|
|
5076
|
-
if (
|
|
5124
|
+
if (_chunkDRO3NXA3cjs.hasUseClientDirective.call(void 0, transformedCode)) {
|
|
5077
5125
|
const clientBoundarySource = transformedCode;
|
|
5078
5126
|
const moduleInfo = this.getModuleInfo(id);
|
|
5079
5127
|
if (moduleInfo) {
|
|
5080
5128
|
moduleInfo.isClientComponent = true;
|
|
5081
5129
|
}
|
|
5082
|
-
transformedCode =
|
|
5130
|
+
transformedCode = _chunkDRO3NXA3cjs.stripUseClientDirective.call(void 0, transformedCode);
|
|
5083
5131
|
transformed = true;
|
|
5084
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
5132
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _443 => _443.getConfig, 'call', _444 => _444()]), () => ( options));
|
|
5085
5133
|
let isolatedModuleReference = null;
|
|
5086
|
-
const root = currentConfig.root || _optionalChain([server, 'optionalAccess',
|
|
5134
|
+
const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _445 => _445.config, 'access', _446 => _446.root]) || process.cwd();
|
|
5087
5135
|
const cleanId = id.split("?", 1)[0];
|
|
5088
|
-
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
5089
|
-
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess',
|
|
5090
|
-
if (
|
|
5091
|
-
cleanId.replace(/\\/g, "/").includes(
|
|
5136
|
+
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _447 => _447.getRouteManager, 'call', _448 => _448(), 'access', _449 => _449.getIsolatedClientBoundaryModules, 'call', _450 => _450(root)])));
|
|
5137
|
+
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _451 => _451.has, 'call', _452 => _452(path6.resolve(cleanId))]) === true;
|
|
5138
|
+
if (_chunkBCTHOQPPcjs.isReactRenderer.call(void 0, _chunkBCTHOQPPcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && (_chunkDRO3NXA3cjs.isIsolatableClientBoundarySource.call(void 0, clientBoundarySource) || // A generated client reference, whose marker comment compiled TSX no longer has.
|
|
5139
|
+
cleanId.replace(/\\/g, "/").includes(_chunkDRO3NXA3cjs.FARM_CLIENT_REFERENCE_DIRECTORY))) {
|
|
5092
5140
|
isolatedModuleReference = _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, cleanId, root);
|
|
5093
|
-
const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([currentConfig, 'access',
|
|
5094
|
-
const explicitStrategy =
|
|
5095
|
-
const inference = islandsMode && explicitStrategy === null ?
|
|
5141
|
+
const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([currentConfig, 'access', _453 => _453.experimental, 'optionalAccess', _454 => _454.serverComponents])) === "islands";
|
|
5142
|
+
const explicitStrategy = _chunkDRO3NXA3cjs.getIslandStrategyExport.call(void 0, clientBoundarySource);
|
|
5143
|
+
const inference = islandsMode && explicitStrategy === null ? _chunkARORZ3MHcjs.inferFarmIslandStrategy.call(void 0, cleanId, root) : null;
|
|
5096
5144
|
if (inference) {
|
|
5097
5145
|
for (const file of inference.files) {
|
|
5098
5146
|
if (file !== path6.resolve(cleanId)) this.addWatchFile(file);
|
|
@@ -5105,8 +5153,8 @@ export { manifest };
|
|
|
5105
5153
|
islandStrategy: _nullishCoalesce(explicitStrategy, () => ( "load")),
|
|
5106
5154
|
parse: (source) => this.parse(source),
|
|
5107
5155
|
slots: islandsMode,
|
|
5108
|
-
browser: _optionalChain([transformOptions, 'optionalAccess',
|
|
5109
|
-
inferredInteraction: _optionalChain([inference, 'optionalAccess',
|
|
5156
|
+
browser: _optionalChain([transformOptions, 'optionalAccess', _455 => _455.ssr]) !== true,
|
|
5157
|
+
inferredInteraction: _optionalChain([inference, 'optionalAccess', _456 => _456.strategy]) === "interaction",
|
|
5110
5158
|
runtimeModule
|
|
5111
5159
|
});
|
|
5112
5160
|
if (!transformedBoundary) {
|
|
@@ -5137,7 +5185,7 @@ export { manifest };
|
|
|
5137
5185
|
);
|
|
5138
5186
|
return;
|
|
5139
5187
|
}` : "";
|
|
5140
|
-
const hmrCode = _optionalChain([transformOptions, 'optionalAccess',
|
|
5188
|
+
const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _457 => _457.ssr]) || reactRefreshActive || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
|
|
5141
5189
|
if (import.meta.hot) {
|
|
5142
5190
|
import.meta.hot.accept((newModule) => {
|
|
5143
5191
|
${isolatedHmrUpdate}
|
|
@@ -5193,14 +5241,14 @@ if (import.meta.hot) {
|
|
|
5193
5241
|
}
|
|
5194
5242
|
_chunk7U4XF76Rcjs.logger.info(`Found ${ssgPages.length} SSG pages, ${ssrRoutes.length} SSR routes`);
|
|
5195
5243
|
_chunk7U4XF76Rcjs.logger.info("Pre-rendering SSG pages...");
|
|
5196
|
-
const outDir = path6.join(_optionalChain([server, 'optionalAccess',
|
|
5244
|
+
const outDir = path6.join(_optionalChain([server, 'optionalAccess', _458 => _458.config, 'access', _459 => _459.root]) || process.cwd(), options.outDir || "dist");
|
|
5197
5245
|
const clientDir = path6.join(outDir, "client");
|
|
5198
5246
|
for (const page of ssgPages) {
|
|
5199
5247
|
try {
|
|
5200
5248
|
const staticRequest = new Request(new URL(page.urlPath, "http://farm.static"));
|
|
5201
5249
|
await farmApp.getServerRenderer().runWithRequestContext(staticRequest, async () => {
|
|
5202
5250
|
const mod = await routeManager.loadRouteModule(page.filePath);
|
|
5203
|
-
if (!_optionalChain([mod, 'optionalAccess',
|
|
5251
|
+
if (!_optionalChain([mod, 'optionalAccess', _460 => _460.default])) return;
|
|
5204
5252
|
const { layouts } = routeManager.matchRoute(page.urlPath);
|
|
5205
5253
|
const layoutModules = await Promise.all(
|
|
5206
5254
|
layouts.map((l) => routeManager.loadLayoutModule(l.modulePath))
|
|
@@ -5232,7 +5280,7 @@ if (import.meta.hot) {
|
|
|
5232
5280
|
const i18nSnapshot = _chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
5233
5281
|
const i18nHead = renderFarmI18nStaticHead(page.urlPath, i18nSnapshot);
|
|
5234
5282
|
const fullHtml = `<!DOCTYPE html>
|
|
5235
|
-
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
5283
|
+
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _461 => _461.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
|
|
5236
5284
|
<head>
|
|
5237
5285
|
<meta charset="utf-8">
|
|
5238
5286
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
@@ -5277,12 +5325,12 @@ if (import.meta.hot) {
|
|
|
5277
5325
|
watchChange(id, change) {
|
|
5278
5326
|
const watched = _chunk7U4XF76Rcjs.toPosixPath.call(void 0, id);
|
|
5279
5327
|
if (!watched.includes("/node_modules/") && !isFarmGeneratedOutput(watched)) {
|
|
5280
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
5328
|
+
_optionalChain([farmApp, 'optionalAccess', _462 => _462.getRouteManager, 'call', _463 => _463(), 'access', _464 => _464.noteSourceChange, 'call', _465 => _465(id, change.event)]);
|
|
5281
5329
|
}
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5330
|
+
_chunkDRO3NXA3cjs.invalidateFarmClientReachableModules.call(void 0, );
|
|
5331
|
+
_chunkDRO3NXA3cjs.invalidateFarmClientOnlyScan.call(void 0, );
|
|
5332
|
+
_chunkARORZ3MHcjs.invalidateFarmRouteRootInferences.call(void 0, );
|
|
5333
|
+
_chunkDRO3NXA3cjs.dropLatestPackageClientBoundaryCache.call(void 0, );
|
|
5286
5334
|
},
|
|
5287
5335
|
async handleHotUpdate(ctx) {
|
|
5288
5336
|
if (pendingClientSetup && !farmSetupContext.getStore()) await pendingClientSetup;
|
|
@@ -5307,7 +5355,7 @@ if (import.meta.hot) {
|
|
|
5307
5355
|
server2.moduleGraph.invalidateModule(mod);
|
|
5308
5356
|
}
|
|
5309
5357
|
}
|
|
5310
|
-
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
5358
|
+
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _466 => _466.getConfig, 'call', _467 => _467()]);
|
|
5311
5359
|
const normalizedFile = file.replace(/\\/g, "/");
|
|
5312
5360
|
const reloadAfterEdit = () => {
|
|
5313
5361
|
for (const files of pendingRouteReloads) {
|
|
@@ -5315,10 +5363,10 @@ if (import.meta.hot) {
|
|
|
5315
5363
|
}
|
|
5316
5364
|
server2.ws.send({ type: "full-reload", path: "*" });
|
|
5317
5365
|
};
|
|
5318
|
-
if (normalizedFile.includes(
|
|
5366
|
+
if (normalizedFile.includes(_chunkDRO3NXA3cjs.FARM_CLIENT_REFERENCE_DIRECTORY) && normalizedFile.startsWith(
|
|
5319
5367
|
path6.posix.join(
|
|
5320
|
-
_chunk7U4XF76Rcjs.toPosixPath.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
5321
|
-
|
|
5368
|
+
_chunk7U4XF76Rcjs.toPosixPath.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _468 => _468.root]) || options.root || server2.config.root),
|
|
5369
|
+
_chunkDRO3NXA3cjs.FARM_CLIENT_REFERENCE_DIRECTORY
|
|
5322
5370
|
)
|
|
5323
5371
|
))
|
|
5324
5372
|
return modules;
|
|
@@ -5326,7 +5374,7 @@ if (import.meta.hot) {
|
|
|
5326
5374
|
(appDir) => normalizedFile.startsWith(`${_chunk7U4XF76Rcjs.toPosixPath.call(void 0, appDir)}/api/`)
|
|
5327
5375
|
)) {
|
|
5328
5376
|
for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
|
|
5329
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
5377
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _469 => _469(`updated ${file}`)]);
|
|
5330
5378
|
reloadAfterEdit();
|
|
5331
5379
|
return [];
|
|
5332
5380
|
}
|
|
@@ -5336,7 +5384,7 @@ if (import.meta.hot) {
|
|
|
5336
5384
|
for (const mod of modules) {
|
|
5337
5385
|
server2.moduleGraph.invalidateModule(mod);
|
|
5338
5386
|
}
|
|
5339
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
5387
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _470 => _470(`updated ${file}`)]);
|
|
5340
5388
|
reloadAfterEdit();
|
|
5341
5389
|
return [];
|
|
5342
5390
|
}
|
|
@@ -5346,22 +5394,22 @@ if (import.meta.hot) {
|
|
|
5346
5394
|
for (const mod of modules) {
|
|
5347
5395
|
server2.moduleGraph.invalidateModule(mod);
|
|
5348
5396
|
}
|
|
5349
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
5397
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _471 => _471(`updated ${file}`)]);
|
|
5350
5398
|
reloadAfterEdit();
|
|
5351
5399
|
return [];
|
|
5352
5400
|
}
|
|
5353
5401
|
if (apiRouteManager && _chunk25JGHAGHcjs.invalidateFarmDevDependents.call(void 0, server2, file, apiRouteManager.getSourceFiles()).length > 0) {
|
|
5354
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
5402
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _472 => _472(`updated ${file}`)]);
|
|
5355
5403
|
}
|
|
5356
|
-
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
5357
|
-
const planRouteManager = _optionalChain([farmApp, 'optionalAccess',
|
|
5404
|
+
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _473 => _473.experimental, 'optionalAccess', _474 => _474.isolatedClientHydration]);
|
|
5405
|
+
const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _475 => _475.getRouteManager, 'call', _476 => _476()]);
|
|
5358
5406
|
const isHydrationPlanSource = /\.[cm]?[jt]sx?$/.test(normalizedFile) && !normalizedFile.includes("/node_modules/") && !isFarmGeneratedOutput(normalizedFile);
|
|
5359
|
-
const tracksAsyncOwnerIslands =
|
|
5407
|
+
const tracksAsyncOwnerIslands = _chunkBCTHOQPPcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _477 => _477.renderer])) && planRouteManager !== void 0;
|
|
5360
5408
|
let clientPlanCurrent = false;
|
|
5361
5409
|
if (isHydrationPlanSource && (isolatedHydrationMode === "enabled" || isolatedHydrationMode === "analyze" || tracksAsyncOwnerIslands)) {
|
|
5362
5410
|
const routeManager = planRouteManager;
|
|
5363
|
-
await _optionalChain([ctx, 'access',
|
|
5364
|
-
if (_optionalChain([routeManager, 'optionalAccess',
|
|
5411
|
+
await _optionalChain([ctx, 'access', _478 => _478.read, 'optionalCall', _479 => _479()]);
|
|
5412
|
+
if (_optionalChain([routeManager, 'optionalAccess', _480 => _480.isEditPlanNeutral, 'call', _481 => _481(file)])) {
|
|
5365
5413
|
clientPlanCurrent = true;
|
|
5366
5414
|
} else if (routeManager) {
|
|
5367
5415
|
routeManager.noteSourceChange(file, "update");
|
|
@@ -5422,7 +5470,7 @@ if (import.meta.hot) {
|
|
|
5422
5470
|
}
|
|
5423
5471
|
return [];
|
|
5424
5472
|
}
|
|
5425
|
-
if (!clientPlanCurrent) _optionalChain([farmApp, 'optionalAccess',
|
|
5473
|
+
if (!clientPlanCurrent) _optionalChain([farmApp, 'optionalAccess', _482 => _482.getRouteManager, 'call', _483 => _483(), 'access', _484 => _484.invalidateClientManifest, 'call', _485 => _485()]);
|
|
5426
5474
|
const manifestModule = server2.moduleGraph.getModuleById("/@farm/manifest");
|
|
5427
5475
|
if (manifestModule) {
|
|
5428
5476
|
server2.moduleGraph.invalidateModule(manifestModule);
|
|
@@ -5437,7 +5485,7 @@ if (import.meta.hot) {
|
|
|
5437
5485
|
return [];
|
|
5438
5486
|
}
|
|
5439
5487
|
}
|
|
5440
|
-
if (/\.[cm]?[jt]sx?$/.test(normalizedFile) && !_optionalChain([server2, 'access',
|
|
5488
|
+
if (/\.[cm]?[jt]sx?$/.test(normalizedFile) && !_optionalChain([server2, 'access', _486 => _486.environments, 'access', _487 => _487.client, 'optionalAccess', _488 => _488.moduleGraph, 'access', _489 => _489.getModulesByFile, 'call', _490 => _490(normalizedFile), 'optionalAccess', _491 => _491.size]) && _chunk25JGHAGHcjs.invalidateFarmDevDependents.call(void 0, server2, file, getFarmRenderedServerModules()).length > 0) {
|
|
5441
5489
|
logUpdate("PAGE", `updated ${path6.basename(file)}`);
|
|
5442
5490
|
reloadAfterEdit();
|
|
5443
5491
|
return [];
|
|
@@ -5535,7 +5583,7 @@ function createPageDataMiddlewareResponse(res) {
|
|
|
5535
5583
|
return (...args) => {
|
|
5536
5584
|
if (captures(target.statusCode, target.getHeader("location"))) {
|
|
5537
5585
|
const callback = args.find((arg) => typeof arg === "function");
|
|
5538
|
-
_optionalChain([callback, 'optionalCall',
|
|
5586
|
+
_optionalChain([callback, 'optionalCall', _492 => _492()]);
|
|
5539
5587
|
return property === "write" ? true : response;
|
|
5540
5588
|
}
|
|
5541
5589
|
return target[property](...args);
|
|
@@ -5580,7 +5628,7 @@ function resolveDevelopmentRoot(farmRoot, viteRoot) {
|
|
|
5580
5628
|
if (fs2.realpathSync(farmRoot) === fs2.realpathSync(viteRoot)) {
|
|
5581
5629
|
return path6.resolve(viteRoot);
|
|
5582
5630
|
}
|
|
5583
|
-
} catch (
|
|
5631
|
+
} catch (e28) {
|
|
5584
5632
|
}
|
|
5585
5633
|
return farmRoot;
|
|
5586
5634
|
}
|
|
@@ -5599,12 +5647,12 @@ function isFarmClientVirtualId(id) {
|
|
|
5599
5647
|
}
|
|
5600
5648
|
function isClientEnvironment(context, loadOptions) {
|
|
5601
5649
|
const environment = context.environment;
|
|
5602
|
-
if (_optionalChain([environment, 'optionalAccess',
|
|
5603
|
-
if (_optionalChain([environment, 'optionalAccess',
|
|
5604
|
-
return _optionalChain([loadOptions, 'optionalAccess',
|
|
5650
|
+
if (_optionalChain([environment, 'optionalAccess', _493 => _493.config, 'optionalAccess', _494 => _494.consumer])) return environment.config.consumer === "client";
|
|
5651
|
+
if (_optionalChain([environment, 'optionalAccess', _495 => _495.name])) return environment.name === "client";
|
|
5652
|
+
return _optionalChain([loadOptions, 'optionalAccess', _496 => _496.ssr]) !== true;
|
|
5605
5653
|
}
|
|
5606
5654
|
function invalidateProgrammaticClientRouteModules(server) {
|
|
5607
|
-
const graph = _optionalChain([server, 'access',
|
|
5655
|
+
const graph = _optionalChain([server, 'access', _497 => _497.environments, 'optionalAccess', _498 => _498.client, 'optionalAccess', _499 => _499.moduleGraph]);
|
|
5608
5656
|
if (!graph) return;
|
|
5609
5657
|
for (const [id, module] of graph.idToModuleMap) {
|
|
5610
5658
|
if (_chunkYUCU6XB4cjs.parseProgrammaticRouteModuleId.call(void 0, id)) graph.invalidateModule(module);
|
|
@@ -5614,27 +5662,27 @@ function generateProgrammaticClientRouteModuleForId(moduleId, root, renderer, cl
|
|
|
5614
5662
|
const parsed = _chunkYUCU6XB4cjs.parseProgrammaticRouteModuleId.call(void 0, moduleId);
|
|
5615
5663
|
const routesFile = resolveRealModuleFile(parsed.filePath, root);
|
|
5616
5664
|
watchFile(routesFile);
|
|
5617
|
-
return
|
|
5665
|
+
return _chunkDRO3NXA3cjs.generateProgrammaticClientRouteModule.call(void 0, {
|
|
5618
5666
|
kind: parsed.kind,
|
|
5619
5667
|
routePath: parsed.routePath,
|
|
5620
5668
|
routesFile,
|
|
5621
|
-
route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess',
|
|
5622
|
-
|
|
5669
|
+
route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess', _500 => _500.routes, 'access', _501 => _501.get, 'call', _502 => _502(
|
|
5670
|
+
_chunkDRO3NXA3cjs.programmaticClientRouteKey.call(void 0, routesFile, parsed.kind, parsed.routePath)
|
|
5623
5671
|
)]),
|
|
5624
5672
|
// React's client module exports no createElement; the main client entry imports React too.
|
|
5625
|
-
rendererClient:
|
|
5673
|
+
rendererClient: _chunkBCTHOQPPcjs.isReactRenderer.call(void 0, renderer) ? "react" : renderer.client,
|
|
5626
5674
|
toImportSpecifier: (file) => toProgrammaticRouteImportSpecifier(file, root)
|
|
5627
5675
|
});
|
|
5628
5676
|
}
|
|
5629
5677
|
function resolveRealModuleFile(filePath, root) {
|
|
5630
|
-
const resolved = _nullishCoalesce(
|
|
5678
|
+
const resolved = _nullishCoalesce(_chunkDRO3NXA3cjs.resolveModuleSourcePath.call(void 0, filePath, root), () => ( filePath));
|
|
5631
5679
|
try {
|
|
5632
5680
|
return _chunk7U4XF76Rcjs.toPosixPath.call(void 0, fs2.realpathSync(resolved));
|
|
5633
|
-
} catch (
|
|
5681
|
+
} catch (e29) {
|
|
5634
5682
|
return _chunk7U4XF76Rcjs.toPosixPath.call(void 0, resolved);
|
|
5635
5683
|
}
|
|
5636
5684
|
}
|
|
5637
|
-
function generateProgrammaticRouteModule(moduleId, root, renderer =
|
|
5685
|
+
function generateProgrammaticRouteModule(moduleId, root, renderer = _chunkBCTHOQPPcjs.REACT_RENDERER) {
|
|
5638
5686
|
const parsed = _chunkYUCU6XB4cjs.parseProgrammaticRouteModuleId.call(void 0, moduleId);
|
|
5639
5687
|
if (!parsed) {
|
|
5640
5688
|
return "";
|
|
@@ -5941,12 +5989,12 @@ async function parseRouteModuleProps(routeModule, input) {
|
|
|
5941
5989
|
}
|
|
5942
5990
|
const schemas = routeModule.__farmRouteSchemas;
|
|
5943
5991
|
const params = parseRouteModuleSchema(
|
|
5944
|
-
_optionalChain([schemas, 'optionalAccess',
|
|
5992
|
+
_optionalChain([schemas, 'optionalAccess', _503 => _503.params]),
|
|
5945
5993
|
input.props.params,
|
|
5946
5994
|
"params",
|
|
5947
5995
|
input.routePath
|
|
5948
5996
|
);
|
|
5949
|
-
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess',
|
|
5997
|
+
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _504 => _504.search]), input.search, "search", input.routePath);
|
|
5950
5998
|
return {
|
|
5951
5999
|
...input.props,
|
|
5952
6000
|
params,
|
|
@@ -5965,20 +6013,20 @@ function parseRouteModuleSchema(schema, value, label, routePath) {
|
|
|
5965
6013
|
throw new Error(`Invalid ${label} for route "${routePath}": ${message}`);
|
|
5966
6014
|
}
|
|
5967
6015
|
}
|
|
5968
|
-
function generateClientCode(integrationProviders = [], documentNavigationMatchers = [], docsSearchClientRuntime = EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME, devtoolsClientRuntime = "", plugins = [], root = process.cwd(), srcDir = "src", publicRuntimeConfig = void 0, docsAdapterReact, renderer =
|
|
5969
|
-
const providerClientCode =
|
|
6016
|
+
function generateClientCode(integrationProviders = [], documentNavigationMatchers = [], docsSearchClientRuntime = EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME, devtoolsClientRuntime = "", plugins = [], root = process.cwd(), srcDir = "src", publicRuntimeConfig = void 0, docsAdapterReact, renderer = _chunkBCTHOQPPcjs.REACT_RENDERER, isolatedHydrationEnabled = false, trailingSlash = false, basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false) {
|
|
6017
|
+
const providerClientCode = _chunkARORZ3MHcjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
5970
6018
|
integrationProviders,
|
|
5971
6019
|
root,
|
|
5972
6020
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
5973
6021
|
);
|
|
5974
|
-
const clientPluginEntry =
|
|
6022
|
+
const clientPluginEntry = _chunkDMSXZNQRcjs.generateFarmClientPluginEntryCode.call(void 0,
|
|
5975
6023
|
plugins,
|
|
5976
6024
|
root,
|
|
5977
6025
|
srcDir,
|
|
5978
6026
|
publicRuntimeConfig
|
|
5979
6027
|
);
|
|
5980
|
-
const appSetupPath =
|
|
5981
|
-
const rendererClientImports =
|
|
6028
|
+
const appSetupPath = _chunkBCTHOQPPcjs.resolveFarmRendererAppSetup.call(void 0, root, renderer);
|
|
6029
|
+
const rendererClientImports = _chunkBCTHOQPPcjs.isReactRenderer.call(void 0, renderer) ? `import React from 'react'
|
|
5982
6030
|
import { hydrateRoot, createRoot } from 'react-dom/client'
|
|
5983
6031
|
import { restorePagePosition } from '@farm.js/core/internal/client-runtime'` : (
|
|
5984
6032
|
// Named exports only: a renderer's client module needs no default export. `React` is a
|
|
@@ -6030,7 +6078,7 @@ async function createFarmServerTreePageElement(source, pathname) {
|
|
|
6030
6078
|
return null;
|
|
6031
6079
|
}
|
|
6032
6080
|
}
|
|
6033
|
-
${islandValues ? `${
|
|
6081
|
+
${islandValues ? `${_chunkARORZ3MHcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
|
|
6034
6082
|
let farmLastRouteState = null;
|
|
6035
6083
|
|
|
6036
6084
|
// A hot update to a layout tree's client module renders the route again.
|
|
@@ -6871,7 +6919,7 @@ async function loadLayoutComponents(layouts = [], params = {}, source) {
|
|
|
6871
6919
|
return loadedLayouts;
|
|
6872
6920
|
}
|
|
6873
6921
|
|
|
6874
|
-
${
|
|
6922
|
+
${_chunkARORZ3MHcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
6875
6923
|
function wrapWithLoadedLayouts(element, loadedLayouts, params) {
|
|
6876
6924
|
let wrapped = element;
|
|
6877
6925
|
for (let index = loadedLayouts.length - 1; index >= 0; index--) {
|
|
@@ -6950,7 +6998,7 @@ async function buildWrappedHydrationElement(PageComponent, pageProps, layouts =
|
|
|
6950
6998
|
|
|
6951
6999
|
function hydrateFarmRoute(container, route) {
|
|
6952
7000
|
farmLastRouteState = route;
|
|
6953
|
-
${
|
|
7001
|
+
${_chunkBCTHOQPPcjs.isReactRenderer.call(void 0, renderer) ? "return hydrateRoot(container, route.element);" : "return route.layouts.length > 0 ? hydrateRoot(container, route.element, route) : hydrateRoot(container, route.element);"}
|
|
6954
7002
|
}
|
|
6955
7003
|
|
|
6956
7004
|
function renderFarmRoute(root, route) {
|
|
@@ -7094,7 +7142,7 @@ async function tryHydrateImportedPage(
|
|
|
7094
7142
|
wrap: wrapFarmClientRouteGraph,
|
|
7095
7143
|
};
|
|
7096
7144
|
} else if (useHydrate && container?.id === '__farm_page__') {
|
|
7097
|
-
wrappedElement = wrapFarmClientRouteGraph(${
|
|
7145
|
+
wrappedElement = wrapFarmClientRouteGraph(${_chunkBCTHOQPPcjs.isReactRenderer.call(void 0, renderer) ? "restorePagePosition(React, container, pageElement)" : "pageElement"});
|
|
7098
7146
|
} else {
|
|
7099
7147
|
wrappedElement = await buildWrappedHydrationElement(
|
|
7100
7148
|
currentPageComponent,
|
|
@@ -7114,6 +7162,8 @@ async function tryHydrateImportedPage(
|
|
|
7114
7162
|
window.__FARM_REACT_ROOT__ = reactRoot;
|
|
7115
7163
|
return true;
|
|
7116
7164
|
} catch (error) {
|
|
7165
|
+
// The page still works, but the server's DOM, focus, and typed input are gone, so say so.
|
|
7166
|
+
console.error('[Farm.js] Hydration error; rendering the page on the client instead:', error);
|
|
7117
7167
|
appRoot = createRoot(container);
|
|
7118
7168
|
if (routeState) renderFarmRoute(appRoot, routeState);
|
|
7119
7169
|
else appRoot.render(wrappedElement);
|
|
@@ -7169,7 +7219,7 @@ function readActiveLayoutPatterns() {
|
|
|
7169
7219
|
);
|
|
7170
7220
|
}
|
|
7171
7221
|
|
|
7172
|
-
${
|
|
7222
|
+
${_chunkARORZ3MHcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
|
|
7173
7223
|
|
|
7174
7224
|
function activateFragmentScripts(root) {
|
|
7175
7225
|
for (const script of Array.from(root.querySelectorAll?.('script') || [])) {
|
|
@@ -7228,7 +7278,7 @@ function getLayoutShell(root, patterns, index, find) {
|
|
|
7228
7278
|
return shell.innerHTML;
|
|
7229
7279
|
}
|
|
7230
7280
|
|
|
7231
|
-
${islandValues ?
|
|
7281
|
+
${islandValues ? _chunkARORZ3MHcjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceNavigationBoundary(
|
|
7232
7282
|
container,
|
|
7233
7283
|
fragment,
|
|
7234
7284
|
currentPatterns,
|
|
@@ -7250,6 +7300,8 @@ ${islandValues ? _chunkCL7BUGVBcjs.FARM_REFRESH_FIELDS_SOURCE : ""}function repl
|
|
|
7250
7300
|
) {
|
|
7251
7301
|
sharedCount++;
|
|
7252
7302
|
}
|
|
7303
|
+
// After the comparison: a noscript turned to text serializes escaped in the template's document.
|
|
7304
|
+
adoptFarmParsedNodes(fragment);
|
|
7253
7305
|
|
|
7254
7306
|
const fragmentTreeRoot = nextPatterns.length > 0
|
|
7255
7307
|
? find(fragment, nextPatterns[0])
|
|
@@ -7301,9 +7353,9 @@ ${islandValues ? `
|
|
|
7301
7353
|
return nextTarget;
|
|
7302
7354
|
}
|
|
7303
7355
|
|
|
7304
|
-
${islandValues ? `${
|
|
7356
|
+
${islandValues ? `${_chunkARORZ3MHcjs.FARM_NAVIGATION_STREAM_READER_SOURCE}
|
|
7305
7357
|
|
|
7306
|
-
${
|
|
7358
|
+
${_chunkARORZ3MHcjs.FARM_EARLY_NAVIGATION_SOURCE}
|
|
7307
7359
|
|
|
7308
7360
|
// Islands mode navigates as the production client does: it fetches the page itself, names the
|
|
7309
7361
|
// layouts it shows by key (F-Layouts), and asks for flush markers (F-Stream), so the shell arrives
|
|
@@ -7473,9 +7525,12 @@ async function streamFarmDevNavigation(stream, root, generation) {
|
|
|
7473
7525
|
observer.disconnect();
|
|
7474
7526
|
return stream.cancel();
|
|
7475
7527
|
}
|
|
7476
|
-
const parsed = new DOMParser()
|
|
7528
|
+
const parsed = new DOMParser()
|
|
7529
|
+
.parseFromString('<div id="root">' + flush, 'text/html')
|
|
7530
|
+
.getElementById('root');
|
|
7531
|
+
adoptFarmParsedNodes(parsed);
|
|
7477
7532
|
const fragment = document.createDocumentFragment();
|
|
7478
|
-
for (const node of Array.from(parsed.
|
|
7533
|
+
for (const node of Array.from(parsed.childNodes)) fragment.appendChild(node);
|
|
7479
7534
|
activateFragmentScripts(fragment);
|
|
7480
7535
|
root.appendChild(fragment);
|
|
7481
7536
|
}
|
|
@@ -7628,6 +7683,7 @@ async function renderPage(pageData, info) {
|
|
|
7628
7683
|
${isolatedHydrationEnabled ? "disposeFarmIsolatedClientBoundaries(container);" : ""}
|
|
7629
7684
|
if (appRoot) { try { appRoot.unmount(); } catch (error) {} appRoot = null; }
|
|
7630
7685
|
if (reactRoot) { try { reactRoot.unmount(); } catch (error) {} reactRoot = null; }
|
|
7686
|
+
adoptFarmParsedNodes(fragment);
|
|
7631
7687
|
container.replaceChildren(fragment);
|
|
7632
7688
|
activateFragmentScripts(container);
|
|
7633
7689
|
} else {
|
|
@@ -8004,9 +8060,9 @@ function generateClientManifest(bundle) {
|
|
|
8004
8060
|
return manifest;
|
|
8005
8061
|
}
|
|
8006
8062
|
async function defineConfig(config = {}) {
|
|
8007
|
-
const tailwindVitePlugin = await
|
|
8063
|
+
const tailwindVitePlugin = await _chunkDMSXZNQRcjs.loadTailwindVitePlugin.call(void 0, );
|
|
8008
8064
|
const appRoot = path6.resolve(config.root || process.cwd());
|
|
8009
|
-
if (_optionalChain([config, 'access',
|
|
8065
|
+
if (_optionalChain([config, 'access', _505 => _505.extends, 'optionalAccess', _506 => _506.length])) {
|
|
8010
8066
|
const { config: layeredConfig } = await import("./layers-XLOMMQP7.cjs").then(
|
|
8011
8067
|
({ resolveFarmLayers }) => resolveFarmLayers(config, {
|
|
8012
8068
|
root: appRoot,
|
|
@@ -8015,12 +8071,12 @@ async function defineConfig(config = {}) {
|
|
|
8015
8071
|
);
|
|
8016
8072
|
config = layeredConfig;
|
|
8017
8073
|
}
|
|
8018
|
-
config.renderer =
|
|
8019
|
-
config.images =
|
|
8020
|
-
const rendererVitePlugins = await
|
|
8074
|
+
config.renderer = _chunkBCTHOQPPcjs.resolveFarmRenderer.call(void 0, config.renderer);
|
|
8075
|
+
config.images = _chunkARORZ3MHcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, { root: appRoot, dev: true });
|
|
8076
|
+
const rendererVitePlugins = await _chunkBCTHOQPPcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, appRoot, {
|
|
8021
8077
|
ssr: true
|
|
8022
8078
|
});
|
|
8023
|
-
const reactRefreshPlugins =
|
|
8079
|
+
const reactRefreshPlugins = _chunkBCTHOQPPcjs.isReactRenderer.call(void 0, config.renderer) ? await _chunkY2FEFQAYcjs.createFarmReactRefreshPlugins.call(void 0, ) : [];
|
|
8024
8080
|
const nodeBuiltinStubs = {
|
|
8025
8081
|
"node:string_decoder": "data:text/javascript,export class StringDecoder { write(buf) { return ''; } end() { return ''; } }; export default StringDecoder;",
|
|
8026
8082
|
"node:buffer": "data:text/javascript,export const Buffer = { from: () => ({}), alloc: () => ({}), isBuffer: () => false }; export default { Buffer };",
|
|
@@ -8108,13 +8164,13 @@ async function defineConfig(config = {}) {
|
|
|
8108
8164
|
if (!serverStarted) {
|
|
8109
8165
|
serverStarted = true;
|
|
8110
8166
|
const elapsed = Date.now() - startTime;
|
|
8111
|
-
const address = _optionalChain([server, 'access',
|
|
8167
|
+
const address = _optionalChain([server, 'access', _507 => _507.httpServer, 'optionalAccess', _508 => _508.address, 'call', _509 => _509()]);
|
|
8112
8168
|
const resolvedPort = typeof address === "object" && address ? address.port : server.config.server.port || port || 3e3;
|
|
8113
8169
|
const hostConfig = server.config.server.host;
|
|
8114
8170
|
const isExposed = hostConfig === true || hostConfig === "0.0.0.0";
|
|
8115
8171
|
console.log("");
|
|
8116
8172
|
console.log(
|
|
8117
|
-
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${
|
|
8173
|
+
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkJK26IMT7cjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
|
|
8118
8174
|
);
|
|
8119
8175
|
console.log("");
|
|
8120
8176
|
console.log(
|
|
@@ -8148,7 +8204,7 @@ async function defineConfig(config = {}) {
|
|
|
8148
8204
|
plugins: [
|
|
8149
8205
|
// `farm dev --desktop`: only the desktop window gets an answer, as in the packaged app.
|
|
8150
8206
|
_chunkY2FEFQAYcjs.farmDesktopDevGuardPlugin.call(void 0, config.basePath),
|
|
8151
|
-
|
|
8207
|
+
_chunkARORZ3MHcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
8152
8208
|
tailwindVitePlugin,
|
|
8153
8209
|
...rendererVitePlugins,
|
|
8154
8210
|
...reactRefreshPlugins,
|
|
@@ -8158,14 +8214,14 @@ async function defineConfig(config = {}) {
|
|
|
8158
8214
|
farmNavigationPlugin(config.renderer),
|
|
8159
8215
|
farmIslandContainersPlugin(config),
|
|
8160
8216
|
farmPlugin(config),
|
|
8161
|
-
|
|
8217
|
+
_chunkDRO3NXA3cjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
|
|
8162
8218
|
farmBrandingPlugin
|
|
8163
8219
|
],
|
|
8164
8220
|
customLogger: farmLogger,
|
|
8165
8221
|
clearScreen: false,
|
|
8166
8222
|
optimizeDeps: {
|
|
8167
|
-
...
|
|
8168
|
-
|
|
8223
|
+
..._chunkARORZ3MHcjs.createFarmClientOptimizeDepsConfig.call(void 0,
|
|
8224
|
+
_chunkARORZ3MHcjs.createFarmClientOptimizeDepsEntries.call(void 0,
|
|
8169
8225
|
appRoot,
|
|
8170
8226
|
_chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, { ...config, root: appRoot })
|
|
8171
8227
|
),
|
|
@@ -8209,7 +8265,7 @@ async function defineConfig(config = {}) {
|
|
|
8209
8265
|
// Stub out problematic server-only modules during dev mode
|
|
8210
8266
|
alias: {
|
|
8211
8267
|
..._chunk52Q4OB4Acjs.getFarmLayerAliases.call(void 0, config.layers),
|
|
8212
|
-
...
|
|
8268
|
+
..._chunkARORZ3MHcjs.createFarmSourceAlias.call(void 0, appRoot, config.srcDir),
|
|
8213
8269
|
// Nitro internals that should not be resolved in browser
|
|
8214
8270
|
"supports-color": "data:text/javascript,export default false; export const supportsColor = false; export const stdout = false; export const stderr = false;",
|
|
8215
8271
|
"@poppinss/dumper": "data:text/javascript,export default {};",
|