@farm.js/core 0.1.86 → 0.2.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-mcp.d-7uKdOttc.d.ts → agent-mcp.d-BdM0pIrD.d.ts} +1 -1
- package/dist/{agent-mcp.d-LChlR2au.d.mts → agent-mcp.d-CMGqpUbk.d.mts} +1 -1
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/analyzer-B2TRJT3B.cjs +17 -0
- package/dist/{analyzer-I5S5YKHM.mjs → analyzer-PWHYGER6.mjs} +2 -2
- package/dist/api/node.d.mts +3 -3
- package/dist/api/node.d.ts +3 -3
- package/dist/api/route-manager.cjs +4 -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 +3 -3
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api.cjs +5 -5
- package/dist/api.d.mts +4 -4
- package/dist/api.d.ts +4 -4
- package/dist/api.mjs +4 -4
- package/dist/{app-manifest.d-QMdmqqCr.d.mts → app-manifest.d-BeDB2OVm.d.mts} +1 -1
- package/dist/{app-manifest.d-CRp21oAz.d.ts → app-manifest.d-COhjPgHn.d.ts} +1 -1
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/{app.d-Bvpc2eJq.d.mts → app.d-AVZXCfcO.d.mts} +5 -4
- package/dist/{app.d-DEKpJEp4.d.ts → app.d-b3A4cca5.d.ts} +5 -4
- package/dist/{chunk-B7L24VPX.cjs → chunk-22KXTL3I.cjs} +6 -4
- package/dist/chunk-2HTNASSB.cjs +134 -0
- package/dist/{chunk-FULX5RYX.cjs → chunk-2OR5WAD5.cjs} +19 -13
- package/dist/{chunk-5P65LXGU.cjs → chunk-3MY6TNNE.cjs} +15 -14
- package/dist/{chunk-A4WWKG2B.cjs → chunk-5ZWXTIGE.cjs} +2 -2
- package/dist/{chunk-2NKNP4AH.cjs → chunk-6266WH6X.cjs} +1 -1
- package/dist/chunk-65LZRVCZ.mjs +18 -0
- package/dist/{chunk-L2IULWKV.cjs → chunk-7LBNWL3L.cjs} +3 -3
- package/dist/{chunk-KHIEGVG7.mjs → chunk-BGEA4K7C.mjs} +10 -4
- package/dist/{chunk-CVKTYG4L.mjs → chunk-BJHXFEAF.mjs} +2 -2
- package/dist/chunk-BQHIJOZM.cjs +13 -0
- package/dist/{chunk-IAERD73G.cjs → chunk-CFLRUCN7.cjs} +384 -339
- package/dist/{chunk-NXOZRI3B.cjs → chunk-CNGGEHXY.cjs} +2 -2
- package/dist/{chunk-3RVLJTFZ.mjs → chunk-D7LXBLUW.mjs} +1 -1
- package/dist/{chunk-B5QRNCIE.mjs → chunk-DATICPTO.mjs} +1 -1
- package/dist/{chunk-XMVZXZ32.cjs → chunk-ERV422FO.cjs} +2 -2
- package/dist/{chunk-BAD6T5NU.cjs → chunk-FEWCWBOF.cjs} +4 -4
- package/dist/{chunk-FLMALEY2.mjs → chunk-GGD57DJA.mjs} +3 -25
- package/dist/{chunk-HQ2VAJLW.mjs → chunk-GV5D5EM6.mjs} +1 -1
- package/dist/{chunk-6MZSTPD2.mjs → chunk-H47EH24T.mjs} +1 -1
- package/dist/{chunk-OBVBII5K.cjs → chunk-HU4R2PPW.cjs} +2 -2
- package/dist/{chunk-7H2TXT2K.mjs → chunk-HX5HLFBZ.mjs} +7 -0
- package/dist/{chunk-N3VMHPIY.mjs → chunk-HZY63K5C.mjs} +2 -2
- package/dist/{chunk-25JGHAGH.cjs → chunk-I2RBHZF7.cjs} +15 -8
- package/dist/{chunk-FDU4Q4QP.cjs → chunk-IRPXOTEN.cjs} +10 -4
- package/dist/{chunk-NAHDG6UX.mjs → chunk-JDO3X7RB.mjs} +6 -5
- package/dist/{chunk-TQJ35BBW.cjs → chunk-JGUMFTZT.cjs} +4 -4
- package/dist/chunk-JIGWHFA5.mjs +32 -0
- package/dist/{chunk-YBXIVQCE.cjs → chunk-JP5TWUK2.cjs} +4 -4
- package/dist/chunk-K6RMOB25.mjs +134 -0
- package/dist/{chunk-UGD53SNO.cjs → chunk-KQ6TYQU7.cjs} +16 -12
- package/dist/{chunk-6QYPP5KC.mjs → chunk-L6ZL35ZJ.mjs} +7 -5
- package/dist/{chunk-7UTRNV6R.mjs → chunk-LUGQUU4S.mjs} +1 -1
- package/dist/{chunk-QYWP5KDY.mjs → chunk-M4CNAZMS.mjs} +74 -29
- package/dist/{chunk-3TKGMIPX.mjs → chunk-MM4U2NNI.mjs} +91 -12
- package/dist/{chunk-CFKAYV7B.mjs → chunk-MRULVIH3.mjs} +1 -1
- package/dist/{chunk-UAQQUQWE.mjs → chunk-MZPPT5NA.mjs} +1 -1
- package/dist/{chunk-2UYYXSUS.mjs → chunk-N5NRXLCX.mjs} +4 -2
- package/dist/chunk-NDMPGFKL.cjs +47 -0
- package/dist/{chunk-YHM4PXJY.mjs → chunk-O5YM6GU3.mjs} +1 -1
- package/dist/{chunk-QYDGIXQ5.cjs → chunk-PA3VZNWU.cjs} +9 -9
- package/dist/{chunk-2PJVEL56.cjs → chunk-PCAEJNQF.cjs} +5 -27
- package/dist/{chunk-P253SZJF.cjs → chunk-PQ6DBVJ2.cjs} +360 -281
- package/dist/chunk-PTAGDZ7I.mjs +13 -0
- package/dist/{chunk-3AV4DCXY.mjs → chunk-PWTBXYJY.mjs} +12 -6
- package/dist/{chunk-PO5MZIWK.mjs → chunk-QBXS4TNG.mjs} +6 -2
- package/dist/chunk-QZUCVJZJ.cjs +18 -0
- package/dist/{chunk-45ANSCTO.mjs → chunk-SCOKBXHS.mjs} +98 -56
- package/dist/{chunk-BLZCAFGJ.cjs → chunk-SG5RFGV6.cjs} +2 -2
- package/dist/{chunk-U54REWMJ.cjs → chunk-SUACCCZG.cjs} +18 -16
- package/dist/chunk-TCGPBSVY.mjs +47 -0
- package/dist/{chunk-CN2JOTRO.cjs → chunk-THGSPDFD.cjs} +7 -7
- package/dist/{chunk-FWLXYNWA.cjs → chunk-TQFIZRON.cjs} +387 -345
- package/dist/{chunk-VGHDPEPQ.cjs → chunk-UA77C2ZA.cjs} +2 -2
- package/dist/{chunk-Q3YWQEUS.cjs → chunk-VMGQOP7X.cjs} +2 -2
- package/dist/{chunk-4SJ22WTT.mjs → chunk-W3ZBLFLU.mjs} +1 -1
- package/dist/{chunk-SB74WCKC.mjs → chunk-WOTAU3BN.mjs} +4 -4
- package/dist/{chunk-JB4BHRFK.cjs → chunk-WP77JDKI.cjs} +16 -16
- package/dist/{chunk-YMAE32O7.mjs → chunk-WPB6HJC7.mjs} +1 -1
- package/dist/{chunk-VPGEYX5Y.mjs → chunk-WX752VMN.mjs} +2 -2
- package/dist/{chunk-VTEAUQMT.mjs → chunk-X2SMVPLH.mjs} +19 -3
- package/dist/{chunk-DJ3PVHTW.cjs → chunk-XGPRM7OK.cjs} +3 -3
- package/dist/{chunk-GWPANDW3.mjs → chunk-XJJQAFZX.mjs} +1 -1
- package/dist/{chunk-UDWBTABT.cjs → chunk-XRYLMTYF.cjs} +3 -3
- package/dist/{chunk-PAENAKTC.mjs → chunk-YCHIR3X6.mjs} +1 -1
- package/dist/chunk-YIGUFJMR.cjs +32 -0
- package/dist/{chunk-CPSFDQKJ.cjs → chunk-Z43CIBUR.cjs} +20 -4
- package/dist/{chunk-RA5OUXOJ.mjs → chunk-ZOD6EYWE.mjs} +2 -2
- package/dist/{cli-runtime.d-DaElKjaL.d.ts → cli-runtime.d-jqZ7YCsm.d.ts} +5 -5
- package/dist/{cli-runtime.d-C7aMfoTq.d.mts → cli-runtime.d-qL44rqYO.d.mts} +5 -5
- package/dist/{client-component.d-miqIXyQv.d.mts → client-component.d-B2L2LyAr.d.mts} +1 -1
- package/dist/{client-component.d-CZG02pIh.d.ts → client-component.d-BDD5aiUb.d.ts} +1 -1
- package/dist/{client-plugins.d-BVXjyIkY.d.ts → client-plugins.d-Crct3m_r.d.ts} +14 -5
- package/dist/{client-plugins.d-BwKwuO_0.d.mts → client-plugins.d-Dzc3vOw_.d.mts} +14 -5
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.cjs +8 -6
- package/dist/client.d.mts +8 -7
- package/dist/client.d.ts +8 -7
- package/dist/client.mjs +7 -5
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/desktop.d.mts +2 -2
- package/dist/desktop.d.ts +2 -2
- package/dist/{devtools-DGC2247E.mjs → devtools-2CRVXV7E.mjs} +4 -2
- package/dist/{devtools-A3L7WNTB.cjs → devtools-RL4AU5KD.cjs} +5 -3
- package/dist/docs.cjs +6 -4
- package/dist/docs.d.mts +3 -3
- package/dist/docs.d.ts +3 -3
- package/dist/docs.mjs +5 -3
- package/dist/environment/vite.cjs +4 -4
- package/dist/environment/vite.mjs +3 -3
- package/dist/font.cjs +4 -2
- package/dist/font.d.mts +13 -1
- package/dist/font.d.ts +13 -1
- package/dist/font.mjs +3 -1
- package/dist/{handler.d-BKTWzzNA.d.mts → handler.d-B1S1ZBqS.d.mts} +1 -1
- package/dist/{handler.d-Dzpyg3-N.d.ts → handler.d-ZweCBJD4.d.ts} +1 -1
- package/dist/{headers.d-PZyXcDAH.d.ts → headers.d-BgBdQN8x.d.ts} +1 -1
- package/dist/{headers.d-5opjyhXw.d.mts → headers.d-C-yGl_f6.d.mts} +1 -1
- package/dist/i18n/client.cjs +11 -10
- package/dist/i18n/client.mjs +3 -2
- package/dist/image-attributes.d-BMPDQO1q.d.mts +55 -0
- package/dist/image-attributes.d-BMPDQO1q.d.ts +55 -0
- package/dist/image.cjs +5 -127
- package/dist/image.d.mts +3 -13
- package/dist/image.d.ts +3 -13
- package/dist/image.mjs +5 -127
- package/dist/index.cjs +40 -36
- package/dist/{index.d-C0Mie66f.d.mts → index.d-13h3oDu7.d.mts} +1 -1
- package/dist/{index.d-DV2q-0mE.d.ts → index.d-CtoniAXT.d.ts} +1 -1
- package/dist/index.d.mts +24 -23
- package/dist/index.d.ts +24 -23
- package/dist/index.mjs +35 -31
- package/dist/integrations/orm.d.mts +1 -1
- package/dist/integrations/orm.d.ts +1 -1
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- 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 +22 -22
- package/dist/internal/build-runtime.d.mts +4 -4
- package/dist/internal/build-runtime.d.ts +4 -4
- package/dist/internal/build-runtime.mjs +21 -21
- package/dist/internal/cli-runtime.cjs +8 -6
- package/dist/internal/cli-runtime.d.mts +7 -7
- package/dist/internal/cli-runtime.d.ts +7 -7
- package/dist/internal/cli-runtime.mjs +7 -5
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +77 -52
- package/dist/internal/client-runtime.d.mts +9 -7
- package/dist/internal/client-runtime.d.ts +9 -7
- package/dist/internal/client-runtime.mjs +64 -39
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +6 -4
- package/dist/internal/config-runtime.d.mts +3 -3
- package/dist/internal/config-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.mjs +5 -3
- package/dist/internal/infra-analytics-runtime.cjs +6 -6
- package/dist/internal/infra-analytics-runtime.mjs +4 -4
- package/dist/internal/islands-boot.cjs +51 -18
- package/dist/internal/islands-boot.d.mts +3 -1
- package/dist/internal/islands-boot.d.ts +3 -1
- package/dist/internal/islands-boot.mjs +34 -1
- 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 +6 -6
- package/dist/internal/production-runtime.d.mts +10 -10
- package/dist/internal/production-runtime.d.ts +10 -10
- package/dist/internal/production-runtime.mjs +5 -5
- package/dist/internal/renderer-islands.cjs +35 -8
- package/dist/internal/renderer-islands.d.mts +9 -1
- package/dist/internal/renderer-islands.d.ts +9 -1
- package/dist/internal/renderer-islands.mjs +35 -8
- package/dist/internal/spa-router.cjs +4 -3
- package/dist/internal/spa-router.d.mts +3 -3
- package/dist/internal/spa-router.d.ts +3 -3
- package/dist/internal/spa-router.mjs +3 -2
- package/dist/internal/start-manifest.d.mts +1 -1
- package/dist/internal/start-manifest.d.ts +1 -1
- package/dist/{island-runtime.d-BA7EPo1v.d.ts → island-runtime.d-D2Mh5eTU.d.ts} +5 -1
- package/dist/{island-runtime.d-BBS_YUSX.d.mts → island-runtime.d-lrpEJlgg.d.mts} +5 -1
- package/dist/{manager-PX4QN4HK.cjs → manager-D4DZRBRS.cjs} +4 -4
- package/dist/{manager-OMTC5FOJ.mjs → manager-PKPQGBAE.mjs} +3 -3
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/middleware.cjs +4 -4
- package/dist/middleware.d.mts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/middleware.mjs +3 -3
- package/dist/{mount.d-gWul1GA1.d.ts → mount.d-DyKlRR6z.d.ts} +1 -1
- package/dist/{mount.d-CZ_qL1iS.d.mts → mount.d-_6Un9wdK.d.mts} +1 -1
- package/dist/{navigation-delegate.d-BBTzhJLj.d.mts → navigation-delegate.d-B9GjWbov.d.mts} +1 -1
- package/dist/{navigation-delegate.d-BZsYEAet.d.ts → navigation-delegate.d-BbW1_pf_.d.ts} +1 -1
- package/dist/navigation.cjs +6 -5
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/navigation.mjs +5 -4
- package/dist/{plugin-QOTAPTVV.mjs → plugin-EVKQZBNW.mjs} +1 -1
- package/dist/{plugin-3PT7I26P.cjs → plugin-MWO3G2XM.cjs} +2 -2
- package/dist/plugin.cjs +19 -19
- package/dist/plugin.d.mts +5 -5
- package/dist/plugin.d.ts +5 -5
- package/dist/plugin.mjs +18 -18
- package/dist/query/client.cjs +8 -7
- package/dist/query/client.mjs +3 -2
- package/dist/{render-plan.d-AaJsYPX-.d.ts → render-plan.d-D0FV9lDT.d.ts} +1 -1
- package/dist/{render-plan.d-bnWxS12w.d.mts → render-plan.d-DaM1NPnm.d.mts} +1 -1
- package/dist/renderer-client.cjs +19 -13
- package/dist/renderer-client.d.mts +6 -5
- package/dist/renderer-client.d.ts +6 -5
- package/dist/renderer-client.mjs +10 -4
- package/dist/renderer.cjs +3 -3
- package/dist/renderer.mjs +2 -2
- package/dist/{request.d-CAeitOG1.d.ts → request.d-CrXC7voZ.d.ts} +1 -1
- package/dist/{request.d-C2HOn3Hi.d.mts → request.d-DVSLilGx.d.mts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering.d-CYA-ulnX.d.mts → route-rendering.d-CWi3UYtR.d.mts} +1 -1
- package/dist/{route-rendering.d-A1dIkUK5.d.ts → route-rendering.d-OfbM_rj8.d.ts} +1 -1
- package/dist/{router.d-A_Yt6jYz.d.ts → router.d-Bm9FNSu3.d.ts} +1 -1
- package/dist/{router.d-8lxnzlkr.d.mts → router.d-YKVirmj4.d.mts} +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/{rsc-pipeline-SNGPAXGW.cjs → rsc-pipeline-3DYC5ZXW.cjs} +6 -4
- package/dist/{rsc-pipeline-BROS3NEB.mjs → rsc-pipeline-LRB4ZG6I.mjs} +5 -3
- package/dist/{runtime-SLJLW37A.mjs → runtime-3WJNNAAR.mjs} +5 -3
- package/dist/{runtime-7T5TRAWL.cjs → runtime-CRFF32H6.cjs} +7 -5
- package/dist/{runtime.d-C_rZ9_DD.d.mts → runtime.d-BVj6apd0.d.mts} +1 -1
- package/dist/{runtime.d-BPyvWrgQ.d.ts → runtime.d-D7QYVJGO.d.ts} +1 -1
- package/dist/{server-components-status.d-BpxiEMQE.d.mts → server-components-status.d-BDVcxi0z.d.mts} +1 -1
- package/dist/{server-components-status.d-C2UEKJn7.d.ts → server-components-status.d-CfKDpmCH.d.ts} +1 -1
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server.cjs +54 -40
- package/dist/server.d.mts +11 -11
- package/dist/server.d.ts +11 -11
- package/dist/server.mjs +34 -20
- package/dist/{spa-router.d-BD-6WX1R.d.mts → spa-router.d-DGmropfK.d.mts} +5 -3
- package/dist/{spa-router.d-Cw5i_15e.d.ts → spa-router.d-nE1jHNGt.d.ts} +5 -3
- package/dist/{ssg.d-CCE9aob5.d.mts → ssg.d-DS-gXUbf.d.mts} +2 -2
- package/dist/{ssg.d-Bifiq0EL.d.ts → ssg.d-jXlUAKzg.d.ts} +2 -2
- package/dist/{store-core.d-5tVn5vi1.d.ts → store-core.d-B5cwOd8g.d.ts} +3 -2
- package/dist/{store-core.d-BN2MxSG9.d.mts → store-core.d-C-gATBwd.d.mts} +3 -2
- package/dist/testing.cjs +3 -3
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.mjs +3 -3
- package/dist/{utils.d-BUjpSNIO.d.ts → utils.d-BODwBtkz.d.ts} +1 -1
- package/dist/{utils.d-wGPLeVbq.d.mts → utils.d-Cmj-fzds.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +24 -22
- package/dist/vite.d.mts +21 -7
- package/dist/vite.d.ts +21 -7
- package/dist/vite.mjs +23 -21
- package/package.json +3 -3
- package/dist/analyzer-OEMQSLYT.cjs +0 -17
- package/dist/chunk-7EPYN7GW.cjs +0 -30
- package/dist/chunk-HZOMT5DY.mjs +0 -30
- package/dist/chunk-SBDWCDS6.cjs +0 -8
- package/dist/chunk-YX6AFPXC.mjs +0 -8
- package/dist/{chunk-4B6YJ5DS.cjs → chunk-4ZVKDHS6.cjs} +3 -3
- package/dist/{chunk-4EEAPBNV.mjs → chunk-PEQJ4UUT.mjs} +3 -3
|
@@ -43,7 +43,8 @@ var _chunkRDADQG5Scjs = require('./chunk-RDADQG5S.cjs');
|
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
|
|
47
|
+
var _chunkPQ6DBVJ2cjs = require('./chunk-PQ6DBVJ2.cjs');
|
|
47
48
|
|
|
48
49
|
|
|
49
50
|
|
|
@@ -58,13 +59,10 @@ var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
|
58
59
|
|
|
59
60
|
|
|
60
61
|
|
|
61
|
-
var
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
var _chunkCPSFDQKJcjs = require('./chunk-CPSFDQKJ.cjs');
|
|
62
|
+
var _chunkERV422FOcjs = require('./chunk-ERV422FO.cjs');
|
|
65
63
|
|
|
66
64
|
|
|
67
|
-
var
|
|
65
|
+
var _chunkFEWCWBOFcjs = require('./chunk-FEWCWBOF.cjs');
|
|
68
66
|
|
|
69
67
|
|
|
70
68
|
|
|
@@ -73,7 +71,7 @@ var _chunkBAD6T5NUcjs = require('./chunk-BAD6T5NU.cjs');
|
|
|
73
71
|
|
|
74
72
|
|
|
75
73
|
|
|
76
|
-
var
|
|
74
|
+
var _chunk4ZVKDHS6cjs = require('./chunk-4ZVKDHS6.cjs');
|
|
77
75
|
|
|
78
76
|
|
|
79
77
|
var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
|
|
@@ -91,13 +89,13 @@ var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
|
|
|
91
89
|
|
|
92
90
|
|
|
93
91
|
|
|
94
|
-
var
|
|
92
|
+
var _chunkJGUMFTZTcjs = require('./chunk-JGUMFTZT.cjs');
|
|
95
93
|
|
|
96
94
|
|
|
97
95
|
var _chunkW53Z4WDIcjs = require('./chunk-W53Z4WDI.cjs');
|
|
98
96
|
|
|
99
97
|
|
|
100
|
-
var
|
|
98
|
+
var _chunkCNGGEHXYcjs = require('./chunk-CNGGEHXY.cjs');
|
|
101
99
|
|
|
102
100
|
|
|
103
101
|
|
|
@@ -105,7 +103,7 @@ var _chunkNXOZRI3Bcjs = require('./chunk-NXOZRI3B.cjs');
|
|
|
105
103
|
var _chunkPIUTGRDIcjs = require('./chunk-PIUTGRDI.cjs');
|
|
106
104
|
|
|
107
105
|
|
|
108
|
-
var
|
|
106
|
+
var _chunkNDMPGFKLcjs = require('./chunk-NDMPGFKL.cjs');
|
|
109
107
|
|
|
110
108
|
|
|
111
109
|
|
|
@@ -148,7 +146,7 @@ var _chunk7EPYN7GWcjs = require('./chunk-7EPYN7GW.cjs');
|
|
|
148
146
|
|
|
149
147
|
|
|
150
148
|
|
|
151
|
-
var
|
|
149
|
+
var _chunkPA3VZNWUcjs = require('./chunk-PA3VZNWU.cjs');
|
|
152
150
|
|
|
153
151
|
|
|
154
152
|
|
|
@@ -172,6 +170,9 @@ var _chunkIIHZ2BEEcjs = require('./chunk-IIHZ2BEE.cjs');
|
|
|
172
170
|
var _chunkSTF6VDYQcjs = require('./chunk-STF6VDYQ.cjs');
|
|
173
171
|
|
|
174
172
|
|
|
173
|
+
var _chunkZ43CIBURcjs = require('./chunk-Z43CIBUR.cjs');
|
|
174
|
+
|
|
175
|
+
|
|
175
176
|
|
|
176
177
|
|
|
177
178
|
var _chunkEACD6ND7cjs = require('./chunk-EACD6ND7.cjs');
|
|
@@ -196,10 +197,6 @@ var _chunk52Q4OB4Acjs = require('./chunk-52Q4OB4A.cjs');
|
|
|
196
197
|
var _chunkT7UC2ORAcjs = require('./chunk-T7UC2ORA.cjs');
|
|
197
198
|
|
|
198
199
|
|
|
199
|
-
|
|
200
|
-
var _chunkMCSRMEQVcjs = require('./chunk-MCSRMEQV.cjs');
|
|
201
|
-
|
|
202
|
-
|
|
203
200
|
var _chunkHQKCSJEHcjs = require('./chunk-HQKCSJEH.cjs');
|
|
204
201
|
|
|
205
202
|
|
|
@@ -234,7 +231,7 @@ var _chunkB3HQTGXScjs = require('./chunk-B3HQTGXS.cjs');
|
|
|
234
231
|
var _chunkX333W5KVcjs = require('./chunk-X333W5KV.cjs');
|
|
235
232
|
|
|
236
233
|
|
|
237
|
-
var
|
|
234
|
+
var _chunkUA77C2ZAcjs = require('./chunk-UA77C2ZA.cjs');
|
|
238
235
|
|
|
239
236
|
|
|
240
237
|
|
|
@@ -250,7 +247,11 @@ var _chunkKBGZ5FD6cjs = require('./chunk-KBGZ5FD6.cjs');
|
|
|
250
247
|
var _chunkP2355C6Ecjs = require('./chunk-P2355C6E.cjs');
|
|
251
248
|
|
|
252
249
|
|
|
253
|
-
var
|
|
250
|
+
var _chunk3MY6TNNEcjs = require('./chunk-3MY6TNNE.cjs');
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
var _chunkBQHIJOZMcjs = require('./chunk-BQHIJOZM.cjs');
|
|
254
255
|
|
|
255
256
|
|
|
256
257
|
var _chunkSXXSQVKKcjs = require('./chunk-SXXSQVKK.cjs');
|
|
@@ -283,7 +284,7 @@ var _chunkJRGR5Z4Kcjs = require('./chunk-JRGR5Z4K.cjs');
|
|
|
283
284
|
|
|
284
285
|
|
|
285
286
|
|
|
286
|
-
var
|
|
287
|
+
var _chunkI2RBHZF7cjs = require('./chunk-I2RBHZF7.cjs');
|
|
287
288
|
|
|
288
289
|
|
|
289
290
|
|
|
@@ -313,13 +314,17 @@ var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
|
|
|
313
314
|
var _chunkPLJMEUANcjs = require('./chunk-PLJMEUAN.cjs');
|
|
314
315
|
|
|
315
316
|
|
|
316
|
-
var
|
|
317
|
+
var _chunk6266WH6Xcjs = require('./chunk-6266WH6X.cjs');
|
|
317
318
|
|
|
318
319
|
|
|
319
320
|
var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
|
|
320
321
|
|
|
321
322
|
|
|
322
323
|
|
|
324
|
+
var _chunkMCSRMEQVcjs = require('./chunk-MCSRMEQV.cjs');
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
|
|
323
328
|
var _chunkRWR7SMD7cjs = require('./chunk-RWR7SMD7.cjs');
|
|
324
329
|
|
|
325
330
|
|
|
@@ -714,7 +719,7 @@ function findClientServerFnViolation(code, id) {
|
|
|
714
719
|
return null;
|
|
715
720
|
}
|
|
716
721
|
function createServerFnBoundaryDiagnostic(violation, id, location) {
|
|
717
|
-
return
|
|
722
|
+
return _chunkPA3VZNWUcjs.createFarmDiagnostic.call(void 0,
|
|
718
723
|
"CLIENT_SERVER_FUNCTION",
|
|
719
724
|
id,
|
|
720
725
|
`${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.`,
|
|
@@ -973,21 +978,21 @@ function readPropertyKey(property) {
|
|
|
973
978
|
function createClientBoundaryDiagnostic(file, finding, location) {
|
|
974
979
|
switch (finding.kind) {
|
|
975
980
|
case "server-env":
|
|
976
|
-
return
|
|
981
|
+
return _chunkPA3VZNWUcjs.createFarmDiagnostic.call(void 0,
|
|
977
982
|
"CLIENT_SERVER_ENV",
|
|
978
983
|
file,
|
|
979
984
|
`process.env.${finding.name} is read at module scope in a module compiled for the browser, where it is undefined.`,
|
|
980
985
|
location
|
|
981
986
|
);
|
|
982
987
|
case "public-env":
|
|
983
|
-
return
|
|
988
|
+
return _chunkPA3VZNWUcjs.createFarmDiagnostic.call(void 0,
|
|
984
989
|
"CLIENT_PROCESS_ENV_PUBLIC",
|
|
985
990
|
file,
|
|
986
991
|
`process.env.${finding.name} is declared public, but process.env is not populated in the browser, so this module-scope read is undefined there.`,
|
|
987
992
|
location
|
|
988
993
|
);
|
|
989
994
|
case "builtin":
|
|
990
|
-
return
|
|
995
|
+
return _chunkPA3VZNWUcjs.createFarmDiagnostic.call(void 0,
|
|
991
996
|
"CLIENT_NODE_BUILTIN",
|
|
992
997
|
file,
|
|
993
998
|
`"${finding.name}" is imported into a module compiled for the browser, which gets a stub whose exports without a Web API equivalent are undefined.`,
|
|
@@ -1283,13 +1288,13 @@ function loadFarmDocsSearchDevRuntime() {
|
|
|
1283
1288
|
return import("./search-client-A7YJT7JZ.cjs");
|
|
1284
1289
|
}
|
|
1285
1290
|
function loadFarmOpenAPIDevRuntime() {
|
|
1286
|
-
return import("./manager-
|
|
1291
|
+
return import("./manager-D4DZRBRS.cjs");
|
|
1287
1292
|
}
|
|
1288
1293
|
function loadFarmWorkflowsDevRuntime() {
|
|
1289
1294
|
return import("./workflows.cjs");
|
|
1290
1295
|
}
|
|
1291
1296
|
function loadFarmDevtoolsSnapshotRuntime() {
|
|
1292
|
-
return import("./devtools-
|
|
1297
|
+
return import("./devtools-RL4AU5KD.cjs");
|
|
1293
1298
|
}
|
|
1294
1299
|
function loadFarmDevtoolsUIRuntime() {
|
|
1295
1300
|
return import("./devtools-ui-C2EMF2SO.cjs");
|
|
@@ -1339,16 +1344,16 @@ var FARM_SERVER_ONLY_PACKAGE_ID = "\0farm:server-only";
|
|
|
1339
1344
|
var FARM_PLATFORM_ENTRY = "@farm.js/core/platform";
|
|
1340
1345
|
var FARM_PLATFORM_CLIENT_ID = "\0farm:platform-client";
|
|
1341
1346
|
var FARM_SERVER_ONLY_ENTRIES_RESOLVE_FILTER = [
|
|
1342
|
-
|
|
1343
|
-
new RegExp(`^${
|
|
1347
|
+
_chunkPQ6DBVJ2cjs.exactIdPattern.call(void 0, [FARM_PLATFORM_ENTRY, SERVER_ONLY_PACKAGE, ...FARM_SERVER_ONLY_ENTRIES]),
|
|
1348
|
+
new RegExp(`^${_chunkPA3VZNWUcjs.FARM_RESOLVE_FROM_PREFIX}`),
|
|
1344
1349
|
// What isBuiltin() accepts: `node:` ids and the builtin names, subpaths such as fs/promises
|
|
1345
1350
|
// included.
|
|
1346
1351
|
/^node:/,
|
|
1347
|
-
|
|
1352
|
+
_chunkPQ6DBVJ2cjs.exactIdPattern.call(void 0, _module.builtinModules)
|
|
1348
1353
|
];
|
|
1349
1354
|
var FARM_SERVER_ONLY_ENTRIES_LOAD_FILTER = [
|
|
1350
|
-
|
|
1351
|
-
new RegExp(`^${
|
|
1355
|
+
_chunkPQ6DBVJ2cjs.exactIdPattern.call(void 0, [FARM_SERVER_ONLY_PACKAGE_ID, FARM_PLATFORM_CLIENT_ID]),
|
|
1356
|
+
new RegExp(`^${_chunkPA3VZNWUcjs.FARM_BROWSER_BUILTIN_PREFIX}`)
|
|
1352
1357
|
];
|
|
1353
1358
|
function createFarmPlatformClientModule(platform) {
|
|
1354
1359
|
return `export function platform() { return ${JSON.stringify(platform)}; }
|
|
@@ -1384,18 +1389,18 @@ function farmIslandContainersPlugin(config) {
|
|
|
1384
1389
|
if (id.startsWith("\0") || id.includes("/node_modules/") || !/\.[jt]sx(?:$|\?)/.test(id)) {
|
|
1385
1390
|
return null;
|
|
1386
1391
|
}
|
|
1387
|
-
if (
|
|
1392
|
+
if (_chunkPA3VZNWUcjs.hasUseClientDirective.call(void 0, code)) return null;
|
|
1388
1393
|
const file = id.split("?", 1)[0];
|
|
1389
|
-
const bindings =
|
|
1394
|
+
const bindings = _chunkPA3VZNWUcjs.getFarmClientRenderingBindings.call(void 0, code, file, root);
|
|
1390
1395
|
if (bindings.length === 0) return null;
|
|
1391
|
-
const grown =
|
|
1396
|
+
const grown = _chunkPA3VZNWUcjs.wrapFarmIslandContainers.call(void 0, {
|
|
1392
1397
|
code,
|
|
1393
1398
|
file,
|
|
1394
1399
|
bindings,
|
|
1395
|
-
reference:
|
|
1400
|
+
reference: _chunkPA3VZNWUcjs.farmIslandContainerReferencePath.call(void 0, root)
|
|
1396
1401
|
});
|
|
1397
1402
|
if (grown === null) return null;
|
|
1398
|
-
|
|
1403
|
+
_chunkPA3VZNWUcjs.ensureFarmIslandContainerReference.call(void 0, root);
|
|
1399
1404
|
return { code: grown, map: null };
|
|
1400
1405
|
}
|
|
1401
1406
|
};
|
|
@@ -1409,18 +1414,18 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1409
1414
|
config(config) {
|
|
1410
1415
|
const appRoot = path6.resolve(_nullishCoalesce(config.root, () => ( process.cwd())));
|
|
1411
1416
|
if (options.distDir) {
|
|
1412
|
-
|
|
1417
|
+
_chunkPA3VZNWUcjs.usePackageScanCacheFile.call(void 0,
|
|
1413
1418
|
path6.resolve(appRoot, options.distDir, "cache", "package-scans.json")
|
|
1414
1419
|
);
|
|
1415
1420
|
}
|
|
1416
|
-
const bundledPackages =
|
|
1421
|
+
const bundledPackages = _chunkPA3VZNWUcjs.collectFarmServerBundledPackageInfo.call(void 0, appRoot);
|
|
1417
1422
|
const prebundle = options.prebundleServerPackages ? createFarmServerPrebundleConfig(bundledPackages) : {};
|
|
1418
|
-
|
|
1423
|
+
_chunkPA3VZNWUcjs.persistPackageScanCache.call(void 0, );
|
|
1419
1424
|
return {
|
|
1420
1425
|
optimizeDeps: {
|
|
1421
1426
|
// A package that defines fonts is served unbundled, so Farm's font compiler sees it.
|
|
1422
1427
|
exclude: bundledPackages.filter(({ fonts }) => fonts).map(({ name }) => name),
|
|
1423
|
-
rolldownOptions: { plugins: [
|
|
1428
|
+
rolldownOptions: { plugins: [_chunkPA3VZNWUcjs.farmBrowserBuiltinsOptimizerPlugin.call(void 0, )] }
|
|
1424
1429
|
},
|
|
1425
1430
|
ssr: {
|
|
1426
1431
|
noExternal: [
|
|
@@ -1446,8 +1451,8 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1446
1451
|
return FARM_SERVER_ONLY_PACKAGE_ID;
|
|
1447
1452
|
}
|
|
1448
1453
|
this.error(
|
|
1449
|
-
|
|
1450
|
-
|
|
1454
|
+
_chunkPA3VZNWUcjs.formatFarmDiagnostic.call(void 0,
|
|
1455
|
+
_chunkPA3VZNWUcjs.createFarmDiagnostic.call(void 0,
|
|
1451
1456
|
"CLIENT_SERVER_ONLY_IMPORT",
|
|
1452
1457
|
_nullishCoalesce(importer, () => ( "<unknown module>")),
|
|
1453
1458
|
`${importer ? "This module" : "A module"} imports "server-only", so it must not reach the browser, but client code imports it.`
|
|
@@ -1457,9 +1462,9 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1457
1462
|
);
|
|
1458
1463
|
}
|
|
1459
1464
|
if (!_optionalChain([options2, 'optionalAccess', _75 => _75.ssr]) && _module.isBuiltin.call(void 0, id)) {
|
|
1460
|
-
return
|
|
1465
|
+
return _chunkPA3VZNWUcjs.resolveFarmBrowserBuiltin.call(void 0, this, id, importer, options2);
|
|
1461
1466
|
}
|
|
1462
|
-
const resolveFrom = importer ?
|
|
1467
|
+
const resolveFrom = importer ? _chunkPA3VZNWUcjs.parseFarmResolveFrom.call(void 0, id, importer.split("?", 1)[0]) : null;
|
|
1463
1468
|
if (resolveFrom) {
|
|
1464
1469
|
const directory = path6.dirname(resolveFrom.importer);
|
|
1465
1470
|
return this.resolve(resolveFrom.specifier, resolveFrom.importer, {
|
|
@@ -1476,8 +1481,8 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1476
1481
|
const importedBy = importer ? ` (imported by ${importer})` : "";
|
|
1477
1482
|
if (!_optionalChain([options2, 'optionalAccess', _76 => _76.ssr])) {
|
|
1478
1483
|
this.error(
|
|
1479
|
-
|
|
1480
|
-
|
|
1484
|
+
_chunkPA3VZNWUcjs.formatFarmDiagnostic.call(void 0,
|
|
1485
|
+
_chunkPA3VZNWUcjs.createFarmDiagnostic.call(void 0,
|
|
1481
1486
|
"CLIENT_SERVER_ONLY_ENTRY",
|
|
1482
1487
|
_nullishCoalesce(importer, () => ( id)),
|
|
1483
1488
|
`${id} is server-only and cannot be imported into client code.`
|
|
@@ -1502,7 +1507,7 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1502
1507
|
if (id === FARM_PLATFORM_CLIENT_ID) {
|
|
1503
1508
|
return createFarmPlatformClientModule(_nullishCoalesce(options.platform, () => ( _chunkAQLHD6HZcjs.resolveFarmPlatform.call(void 0, ))));
|
|
1504
1509
|
}
|
|
1505
|
-
return _nullishCoalesce(
|
|
1510
|
+
return _nullishCoalesce(_chunkPA3VZNWUcjs.loadFarmBrowserBuiltin.call(void 0, id), () => ( null));
|
|
1506
1511
|
}
|
|
1507
1512
|
}
|
|
1508
1513
|
};
|
|
@@ -1535,7 +1540,7 @@ function renderFarmI18nStaticHead(requestPath, snapshot) {
|
|
|
1535
1540
|
if (!snapshot) return "";
|
|
1536
1541
|
const runtime = `<script>window.__FARM_I18N__ = ${serializeFarmInlineValue(snapshot)};</script>`;
|
|
1537
1542
|
if (snapshot.routing === "none") return runtime;
|
|
1538
|
-
return `${
|
|
1543
|
+
return `${_chunk4ZVKDHS6cjs.renderFarmLocaleAlternateLinks.call(void 0, requestPath, snapshot)}${runtime}`;
|
|
1539
1544
|
}
|
|
1540
1545
|
function getPublicEnvDefine(config) {
|
|
1541
1546
|
const publicEnv = _optionalChain([config, 'access', _77 => _77.env, 'optionalAccess', _78 => _78.public]);
|
|
@@ -2116,7 +2121,7 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
2116
2121
|
return null;
|
|
2117
2122
|
}
|
|
2118
2123
|
const body = Array.isArray(ast.body) ? ast.body : [];
|
|
2119
|
-
const everyExportIsComponent = options.code.includes(
|
|
2124
|
+
const everyExportIsComponent = options.code.includes(_chunkPA3VZNWUcjs.FARM_CLIENT_REFERENCE_PRAGMA) || options.moduleReference.includes(_chunkPA3VZNWUcjs.FARM_CLIENT_REFERENCE_DIRECTORY);
|
|
2120
2125
|
const replacements = [];
|
|
2121
2126
|
const wrapperStatements = [];
|
|
2122
2127
|
const originalEntries = [];
|
|
@@ -2271,16 +2276,16 @@ async function warnClientBoundaryOnce(context, id, code, config) {
|
|
|
2271
2276
|
for (const finding of analyzeClientBoundary(program, publicKeys)) {
|
|
2272
2277
|
if (finding.kind === "builtin" && !finding.name.startsWith("node:")) {
|
|
2273
2278
|
const resolved = await context.resolve(finding.name, id).catch(() => null);
|
|
2274
|
-
if (!_optionalChain([resolved, 'optionalAccess', _103 => _103.id, 'access', _104 => _104.startsWith, 'call', _105 => _105(
|
|
2279
|
+
if (!_optionalChain([resolved, 'optionalAccess', _103 => _103.id, 'access', _104 => _104.startsWith, 'call', _105 => _105(_chunkPA3VZNWUcjs.FARM_BROWSER_BUILTIN_PREFIX)])) continue;
|
|
2275
2280
|
}
|
|
2276
2281
|
findings.push(finding);
|
|
2277
2282
|
}
|
|
2278
2283
|
if (findings.length === 0) return;
|
|
2279
2284
|
warnedClientBoundaryIds.add(id);
|
|
2280
|
-
const locate =
|
|
2285
|
+
const locate = _chunkPA3VZNWUcjs.createFarmSourceLocator.call(void 0, code, () => context.getCombinedSourcemap());
|
|
2281
2286
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
2282
2287
|
findings.map(
|
|
2283
|
-
(finding) =>
|
|
2288
|
+
(finding) => _chunkPA3VZNWUcjs.formatFarmDiagnostic.call(void 0,
|
|
2284
2289
|
createClientBoundaryDiagnostic(id, finding, locate(finding.start)),
|
|
2285
2290
|
config.root
|
|
2286
2291
|
)
|
|
@@ -2299,6 +2304,22 @@ function isFarmAppRuntimeFile(file, appDirs, routeModuleExtensions) {
|
|
|
2299
2304
|
function shouldEmitFarmClientRootHmr(renderer) {
|
|
2300
2305
|
return _chunkT7UC2ORAcjs.getFarmRendererCapabilities.call(void 0, _chunkT7UC2ORAcjs.resolveFarmRenderer.call(void 0, renderer)).reconcilesRerenders;
|
|
2301
2306
|
}
|
|
2307
|
+
function reachesSharedFarmRendererIsland(graph, file, islandModules) {
|
|
2308
|
+
const queue = Array.from(_nullishCoalesce(_optionalChain([graph, 'optionalAccess', _106 => _106.getModulesByFile, 'call', _107 => _107(file)]), () => ( [])));
|
|
2309
|
+
const seen = new Set(queue);
|
|
2310
|
+
for (const node of queue) {
|
|
2311
|
+
if (node.file && islandModules.has(path6.resolve(node.file))) {
|
|
2312
|
+
if (node.importers.size > 0) return true;
|
|
2313
|
+
continue;
|
|
2314
|
+
}
|
|
2315
|
+
for (const importer of node.importers) {
|
|
2316
|
+
if (seen.has(importer)) continue;
|
|
2317
|
+
seen.add(importer);
|
|
2318
|
+
queue.push(importer);
|
|
2319
|
+
}
|
|
2320
|
+
}
|
|
2321
|
+
return false;
|
|
2322
|
+
}
|
|
2302
2323
|
var FARM_RUNTIME_MODULE_PREFIX = "/@farm/runtime/";
|
|
2303
2324
|
function toFarmRuntimeModuleId(specifier) {
|
|
2304
2325
|
return FARM_RUNTIME_MODULE_PREFIX + specifier;
|
|
@@ -2330,21 +2351,23 @@ function hasFarmSourceAliasOverride(alias) {
|
|
|
2330
2351
|
function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
2331
2352
|
const rendererDisabled = _chunkT7UC2ORAcjs.isFarmRendererDisabled.call(void 0, options.renderer);
|
|
2332
2353
|
const imageImports = farmImageImportsPlugin();
|
|
2333
|
-
const fontImports =
|
|
2354
|
+
const fontImports = _chunkPQ6DBVJ2cjs.farmFontImportsPlugin.call(void 0, {
|
|
2334
2355
|
root: options.root,
|
|
2335
2356
|
basePath: options.basePath,
|
|
2336
|
-
publicDir: options.publicDir
|
|
2357
|
+
publicDir: options.publicDir,
|
|
2358
|
+
// A production build never starts the app, so it reads the directories from these options.
|
|
2359
|
+
isLayoutModule: (id) => _chunkPQ6DBVJ2cjs.isFarmLayoutModule.call(void 0, id, _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _108 => _108.getConfig, 'call', _109 => _109()]), () => ( options))))
|
|
2337
2360
|
});
|
|
2338
2361
|
let farmApp;
|
|
2339
2362
|
const isFarmGeneratedOutput = (file) => {
|
|
2340
|
-
const root = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
2363
|
+
const root = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _110 => _110.getConfig, 'call', _111 => _111(), 'access', _112 => _112.root]), () => ( options.root));
|
|
2341
2364
|
if (!root) return file.includes("/.farm/");
|
|
2342
2365
|
const output = _chunk7U4XF76Rcjs.toPosixPath.call(void 0, path6.resolve(root, options.distDir || ".farm"));
|
|
2343
2366
|
return file === output || file.startsWith(`${output}/`);
|
|
2344
2367
|
};
|
|
2345
2368
|
let serverFnTransformActive = false;
|
|
2346
2369
|
const getFarmRenderedServerModules = () => {
|
|
2347
|
-
const routeManager = _optionalChain([farmApp, 'optionalAccess',
|
|
2370
|
+
const routeManager = _optionalChain([farmApp, 'optionalAccess', _113 => _113.getRouteManager, 'call', _114 => _114()]);
|
|
2348
2371
|
if (!routeManager) return /* @__PURE__ */ new Set();
|
|
2349
2372
|
const files = /* @__PURE__ */ new Set();
|
|
2350
2373
|
for (const entries of [
|
|
@@ -2364,8 +2387,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2364
2387
|
if (mdxComponents) files.add(mdxComponents);
|
|
2365
2388
|
return files;
|
|
2366
2389
|
};
|
|
2367
|
-
const islxActionsMode = () =>
|
|
2368
|
-
const islandsServerFns = () =>
|
|
2390
|
+
const islxActionsMode = () => _chunkPQ6DBVJ2cjs.resolveFarmIslxActionsMode.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _115 => _115.getConfig, 'call', _116 => _116()]), () => ( options)));
|
|
2391
|
+
const islandsServerFns = () => _chunkPQ6DBVJ2cjs.farmBrowserServerFnsEnabled.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _117 => _117.getConfig, 'call', _118 => _118()]), () => ( options)));
|
|
2369
2392
|
let reactRefreshActive = false;
|
|
2370
2393
|
let server;
|
|
2371
2394
|
let deferredGates;
|
|
@@ -2394,9 +2417,9 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2394
2417
|
].join(" ");
|
|
2395
2418
|
console.log(log);
|
|
2396
2419
|
};
|
|
2397
|
-
const getProgrammaticClientRoutes = () => _nullishCoalesce(options.programmaticClientRoutes, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
2420
|
+
const getProgrammaticClientRoutes = () => _nullishCoalesce(options.programmaticClientRoutes, () => ( _optionalChain([farmApp, 'optionalAccess', _119 => _119.getRouteManager, 'call', _120 => _120(), 'access', _121 => _121.getProgrammaticClientRoutes, 'call', _122 => _122()])));
|
|
2398
2421
|
const isOutsideAppRoot = (file) => {
|
|
2399
|
-
const root = _optionalChain([farmApp, 'optionalAccess',
|
|
2422
|
+
const root = _optionalChain([farmApp, 'optionalAccess', _123 => _123.getConfig, 'call', _124 => _124(), 'access', _125 => _125.root]) || _optionalChain([server, 'optionalAccess', _126 => _126.config, 'access', _127 => _127.root]) || options.root;
|
|
2400
2423
|
if (!root) return false;
|
|
2401
2424
|
const relative4 = path6.relative(root, file.split("?", 1)[0]);
|
|
2402
2425
|
return relative4.startsWith("..") || path6.isAbsolute(relative4);
|
|
@@ -2408,14 +2431,14 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2408
2431
|
isBuild = configEnv.command === "build";
|
|
2409
2432
|
const farmAliases = {
|
|
2410
2433
|
..._chunk52Q4OB4Acjs.getFarmLayerAliases.call(void 0, options.layers),
|
|
2411
|
-
...hasFarmSourceAliasOverride(_optionalChain([userConfig, 'access',
|
|
2434
|
+
...hasFarmSourceAliasOverride(_optionalChain([userConfig, 'access', _128 => _128.resolve, 'optionalAccess', _129 => _129.alias])) ? {} : _chunkPQ6DBVJ2cjs.createFarmSourceAlias.call(void 0, options.root || process.cwd(), options.srcDir)
|
|
2412
2435
|
};
|
|
2413
2436
|
if (Object.keys(farmAliases).length > 0) {
|
|
2414
2437
|
_nullishCoalesce(userConfig.resolve, () => ( (userConfig.resolve = {})));
|
|
2415
|
-
userConfig.resolve.alias =
|
|
2438
|
+
userConfig.resolve.alias = _chunkPQ6DBVJ2cjs.mergeFarmViteAlias.call(void 0, farmAliases, userConfig.resolve.alias);
|
|
2416
2439
|
}
|
|
2417
2440
|
const layerRoots = (_nullishCoalesce(options.layers, () => ( []))).map((layer) => layer.root);
|
|
2418
|
-
farmOwnsDevCors = !isBuild && _optionalChain([userConfig, 'access',
|
|
2441
|
+
farmOwnsDevCors = !isBuild && _optionalChain([userConfig, 'access', _130 => _130.server, 'optionalAccess', _131 => _131.cors]) === void 0;
|
|
2419
2442
|
return {
|
|
2420
2443
|
// Honor Farm's publicDir so the dev server serves the same static
|
|
2421
2444
|
// directory the production client build emits.
|
|
@@ -2428,13 +2451,13 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2428
2451
|
...farmOwnsDevCors ? { cors: false } : {},
|
|
2429
2452
|
fs: {
|
|
2430
2453
|
...layerRoots.length ? { allow: [path6.resolve(options.root || process.cwd()), ...layerRoots] } : {},
|
|
2431
|
-
deny: getFarmDevFsDeny(_optionalChain([userConfig, 'access',
|
|
2454
|
+
deny: getFarmDevFsDeny(_optionalChain([userConfig, 'access', _132 => _132.server, 'optionalAccess', _133 => _133.fs, 'optionalAccess', _134 => _134.deny]), options)
|
|
2432
2455
|
}
|
|
2433
2456
|
}
|
|
2434
2457
|
};
|
|
2435
2458
|
},
|
|
2436
2459
|
configEnvironment(name, environmentConfig, env) {
|
|
2437
|
-
if (env.command !== "serve" || name !== "ssr" && name !== "rsc" || _optionalChain([environmentConfig, 'access',
|
|
2460
|
+
if (env.command !== "serve" || name !== "ssr" && name !== "rsc" || _optionalChain([environmentConfig, 'access', _135 => _135.dev, 'optionalAccess', _136 => _136.createEnvironment])) {
|
|
2438
2461
|
return;
|
|
2439
2462
|
}
|
|
2440
2463
|
return {
|
|
@@ -2453,7 +2476,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2453
2476
|
(plugin2) => plugin2.name === SERVER_FN_TRANSFORM_PLUGIN
|
|
2454
2477
|
);
|
|
2455
2478
|
reactRefreshActive = _chunkY2FEFQAYcjs.isFarmReactRefreshActive.call(void 0, config);
|
|
2456
|
-
if (_optionalChain([options, 'access',
|
|
2479
|
+
if (_optionalChain([options, 'access', _137 => _137.experimental, 'optionalAccess', _138 => _138.serverActions]) === true && !serverFnTransformActive && !islandsServerFns()) {
|
|
2457
2480
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
2458
2481
|
"experimental.serverActions has no effect without @farm.js/plugin/rsc in the Vite plugins. Server functions stay server-only, and importing one from client code is a build error."
|
|
2459
2482
|
);
|
|
@@ -2462,20 +2485,20 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2462
2485
|
async configureServer(viteServer) {
|
|
2463
2486
|
viteServer.middlewares.use(
|
|
2464
2487
|
createFarmDevPreviewGuard(viteServer, {
|
|
2465
|
-
getSourceRoots: () => _chunk52Q4OB4Acjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
2488
|
+
getSourceRoots: () => _chunk52Q4OB4Acjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _139 => _139.getConfig, 'call', _140 => _140()]), () => ( options)))
|
|
2466
2489
|
})
|
|
2467
2490
|
);
|
|
2468
2491
|
if (typeof fontImports.configureServer === "function") {
|
|
2469
2492
|
await fontImports.configureServer.call(this, viteServer);
|
|
2470
2493
|
}
|
|
2471
2494
|
server = viteServer;
|
|
2472
|
-
const farmMiddlewares = _nullishCoalesce(_optionalChain([deferredGates, 'optionalAccess',
|
|
2473
|
-
const farmPostMiddlewares = _nullishCoalesce(_optionalChain([deferredGates, 'optionalAccess',
|
|
2495
|
+
const farmMiddlewares = _nullishCoalesce(_optionalChain([deferredGates, 'optionalAccess', _141 => _141.pre, 'access', _142 => _142.target]), () => ( viteServer.middlewares));
|
|
2496
|
+
const farmPostMiddlewares = _nullishCoalesce(_optionalChain([deferredGates, 'optionalAccess', _143 => _143.post, 'access', _144 => _144.target]), () => ( viteServer.middlewares));
|
|
2474
2497
|
const pm = initialPluginManager;
|
|
2475
2498
|
const configRoutePlugins = new Set(
|
|
2476
|
-
_optionalChain([pm, 'optionalAccess',
|
|
2499
|
+
_optionalChain([pm, 'optionalAccess', _145 => _145.getPlugins, 'call', _146 => _146(), 'access', _147 => _147.filter, 'call', _148 => _148(isFarmConfigRoutePlugin), 'access', _149 => _149.map, 'call', _150 => _150((plugin2) => plugin2.name)])
|
|
2477
2500
|
);
|
|
2478
|
-
const configRedirectMatchers = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
2501
|
+
const configRedirectMatchers = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _151 => _151.getPlugins, 'call', _152 => _152()]), () => ( []))).flatMap((plugin2) => {
|
|
2479
2502
|
const matcher = _chunkH7OFZJCVcjs.getConfigRedirectMatcher.call(void 0, plugin2);
|
|
2480
2503
|
return matcher ? [matcher] : [];
|
|
2481
2504
|
});
|
|
@@ -2486,7 +2509,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2486
2509
|
} catch (e21) {
|
|
2487
2510
|
}
|
|
2488
2511
|
};
|
|
2489
|
-
farmApp = new (0,
|
|
2512
|
+
farmApp = new (0, _chunkPQ6DBVJ2cjs.FarmApp)(
|
|
2490
2513
|
{
|
|
2491
2514
|
...options,
|
|
2492
2515
|
root: resolveDevelopmentRoot(options.root, server.config.root)
|
|
@@ -2494,7 +2517,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2494
2517
|
server
|
|
2495
2518
|
);
|
|
2496
2519
|
farmApp.getRouteManager().usePackageClientBoundaryCacheFile(
|
|
2497
|
-
|
|
2520
|
+
_chunkPA3VZNWUcjs.resolvePackageClientBoundaryCacheFile.call(void 0,
|
|
2498
2521
|
farmApp.getConfig().root,
|
|
2499
2522
|
options.distDir || ".farm"
|
|
2500
2523
|
)
|
|
@@ -2503,9 +2526,9 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2503
2526
|
await farmApp.initialize();
|
|
2504
2527
|
const farmConfig = farmApp.getConfig();
|
|
2505
2528
|
let farmAppPackages;
|
|
2506
|
-
if (_optionalChain([farmConfig, 'access',
|
|
2529
|
+
if (_optionalChain([farmConfig, 'access', _153 => _153.agent, 'optionalAccess', _154 => _154.noindexPreviews])) {
|
|
2507
2530
|
farmMiddlewares.use((_req, res, next) => {
|
|
2508
|
-
if (
|
|
2531
|
+
if (_chunkCNGGEHXYcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
|
|
2509
2532
|
res.setHeader("X-Robots-Tag", _chunkEACD6ND7cjs.FARM_PREVIEW_ROBOTS_TAG);
|
|
2510
2533
|
}
|
|
2511
2534
|
next();
|
|
@@ -2513,7 +2536,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2513
2536
|
}
|
|
2514
2537
|
const apiServerBasePath = _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, farmConfig.api);
|
|
2515
2538
|
const devBuiltInRoutePaths = new Set(
|
|
2516
|
-
|
|
2539
|
+
_chunkJGUMFTZTcjs.listFarmBuiltInRoutePaths.call(void 0, {
|
|
2517
2540
|
agent: {
|
|
2518
2541
|
apiCatalog: true,
|
|
2519
2542
|
mcp: true,
|
|
@@ -2535,7 +2558,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2535
2558
|
validateRemoteUrl: createNodeImageUrlValidator(farmConfig.images),
|
|
2536
2559
|
// Vite owns this address. Unlike request.url, it cannot be replaced by
|
|
2537
2560
|
// a caller-controlled Host header.
|
|
2538
|
-
trustedLocalOrigin: () => _optionalChain([server, 'access',
|
|
2561
|
+
trustedLocalOrigin: () => _optionalChain([server, 'access', _155 => _155.resolvedUrls, 'optionalAccess', _156 => _156.local, 'access', _157 => _157[0]]),
|
|
2539
2562
|
onError(error) {
|
|
2540
2563
|
_chunk7U4XF76Rcjs.logger.error(
|
|
2541
2564
|
`Image optimization failed: ${error instanceof Error ? error.message : String(error)}`
|
|
@@ -2555,15 +2578,15 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2555
2578
|
const workflowConfig = farmConfig.workflows;
|
|
2556
2579
|
const farmDocsDevRuntime = farmConfig.docs.enabled ? await loadFarmDocsDevRuntime() : null;
|
|
2557
2580
|
const getExtraRouteTypes = () => [
|
|
2558
|
-
..._optionalChain([options, 'access',
|
|
2559
|
-
..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
2581
|
+
..._optionalChain([options, 'access', _158 => _158.openapi, 'optionalAccess', _159 => _159.enabled]) && options.openapi.route ? [options.openapi.route] : [],
|
|
2582
|
+
..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess', _160 => _160.getFarmDocsRouteTypeEntries, 'call', _161 => _161(farmConfig.docs)]), () => ( []))
|
|
2560
2583
|
];
|
|
2561
2584
|
const appDirSlugs = sourceRoots.map(
|
|
2562
2585
|
(source) => path6.join(source.root, source.srcDir, "app").replace(/\\/g, "/")
|
|
2563
2586
|
);
|
|
2564
2587
|
const generateTypeArtifacts = async (reason, selection = ALL_TYPE_ARTIFACTS, log = false) => {
|
|
2565
2588
|
try {
|
|
2566
|
-
const result = await
|
|
2589
|
+
const result = await _chunkERV422FOcjs.generateFarmTypeArtifacts.call(void 0, {
|
|
2567
2590
|
root: farmConfig.root,
|
|
2568
2591
|
srcDir: farmConfig.srcDir,
|
|
2569
2592
|
layers: farmConfig.layers,
|
|
@@ -2605,7 +2628,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2605
2628
|
(source) => path6.join(source.root, source.srcDir).replace(/\\/g, "/")
|
|
2606
2629
|
);
|
|
2607
2630
|
const layerConfigFiles = new Set(
|
|
2608
|
-
farmConfig.layers.map((layer) => _optionalChain([layer, 'access',
|
|
2631
|
+
farmConfig.layers.map((layer) => _optionalChain([layer, 'access', _162 => _162.configFile, 'optionalAccess', _163 => _163.replace, 'call', _164 => _164(/\\/g, "/")])).filter((file) => Boolean(file))
|
|
2609
2632
|
);
|
|
2610
2633
|
const routeModuleExtensions = /* @__PURE__ */ new Set([
|
|
2611
2634
|
..._chunkT7UC2ORAcjs.resolveFarmComponentExtensions.call(void 0, farmConfig.renderer.componentExtensions),
|
|
@@ -2617,9 +2640,10 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2617
2640
|
const match = /\/(?:page|layout|loading|error)(\.[^./]+)$/.exec(normalized);
|
|
2618
2641
|
return appDirSlugs.some((appDir) => normalized.startsWith(`${appDir}/`)) && !!match && routeModuleExtensions.has(match[1].toLowerCase());
|
|
2619
2642
|
};
|
|
2643
|
+
const polyroute = _chunkBQHIJOZMcjs.hasPolyroutePlugin.call(void 0, server.config.plugins);
|
|
2620
2644
|
const isApiRouteFile = (file) => {
|
|
2621
2645
|
const normalized = file.replace(/\\/g, "/");
|
|
2622
|
-
return appDirSlugs.some((appDir) => normalized.startsWith(`${appDir}/api/`)) &&
|
|
2646
|
+
return appDirSlugs.some((appDir) => normalized.startsWith(`${appDir}/api/`)) && _chunkBQHIJOZMcjs.isFarmAPIRouteFileName.call(void 0, path6.posix.basename(normalized), polyroute);
|
|
2623
2647
|
};
|
|
2624
2648
|
const isProgrammaticRouteFile = (file) => {
|
|
2625
2649
|
const normalized = file.replace(/\\/g, "/");
|
|
@@ -2632,7 +2656,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2632
2656
|
);
|
|
2633
2657
|
};
|
|
2634
2658
|
const isAppRuntimeFile = (file) => isFarmAppRuntimeFile(file, appDirSlugs, routeModuleExtensions);
|
|
2635
|
-
const isRendererRouteFile = (file) => routeModuleExtensions.has(path6.extname(file).toLowerCase()) && _optionalChain([farmApp, 'optionalAccess',
|
|
2659
|
+
const isRendererRouteFile = (file) => routeModuleExtensions.has(path6.extname(file).toLowerCase()) && _optionalChain([farmApp, 'optionalAccess', _165 => _165.getRouteManager, 'call', _166 => _166(), 'access', _167 => _167.isRendererRouteFile, 'call', _168 => _168(file)]) === true;
|
|
2636
2660
|
const isStaticMetadataImageFile = (file) => /\/(?:opengraph-image|twitter-image)(?:\.(?:png|jpg|jpeg|gif|webp)|\.alt\.txt)$/.test(
|
|
2637
2661
|
file.replace(/\\/g, "/")
|
|
2638
2662
|
);
|
|
@@ -2663,7 +2687,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2663
2687
|
["add", "change", "unlink"].forEach((ev) => {
|
|
2664
2688
|
server.watcher.on(ev, (file) => {
|
|
2665
2689
|
if (ev === "add") {
|
|
2666
|
-
|
|
2690
|
+
_chunkI2RBHZF7cjs.invalidateFailedFarmDevModules.call(void 0, server);
|
|
2667
2691
|
}
|
|
2668
2692
|
const normalizedFile = file.replace(/\\/g, "/");
|
|
2669
2693
|
const configChanged = isFarmConfigFile(file, farmConfig.root) || layerConfigFiles.has(normalizedFile);
|
|
@@ -2679,9 +2703,9 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2679
2703
|
scheduleTypeArtifactGen(file, ev, typeArtifacts);
|
|
2680
2704
|
}
|
|
2681
2705
|
if (isI18nCatalogFile(file)) {
|
|
2682
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
2706
|
+
_optionalChain([farmApp, 'optionalAccess', _169 => _169.getI18nRuntime, 'call', _170 => _170(), 'access', _171 => _171.reload, 'call', _172 => _172(), 'access', _173 => _173.then, 'call', _174 => _174(() => server.ws.send({ type: "full-reload", path: "*" })), 'access', _175 => _175.catch, 'call', _176 => _176((error) => _chunk7U4XF76Rcjs.logger.warn(`i18n catalog reload failed: ${error.message}`))]);
|
|
2683
2707
|
}
|
|
2684
|
-
const isRouteRefreshEvent = (ev !== "change" || isStaticMetadataImageFile(file)) && (isAppRuntimeFile(file) || isRendererRouteFile(file) || isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file)));
|
|
2708
|
+
const isRouteRefreshEvent = (ev !== "change" || isStaticMetadataImageFile(file)) && (isAppRuntimeFile(file) || polyroute && isApiRouteFile(file) || isRendererRouteFile(file) || isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file)));
|
|
2685
2709
|
if (isRouteRefreshEvent) {
|
|
2686
2710
|
if (!queuedRouteFiles) {
|
|
2687
2711
|
const files = /* @__PURE__ */ new Set();
|
|
@@ -2691,8 +2715,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2691
2715
|
queuedRouteFiles = void 0;
|
|
2692
2716
|
try {
|
|
2693
2717
|
await Promise.all([
|
|
2694
|
-
_optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
2695
|
-
[...files].some((path7) => path7.includes("middleware.")) ? _optionalChain([middlewareManager, 'optionalAccess',
|
|
2718
|
+
_optionalChain([refreshRouteDiscovery, 'optionalCall', _177 => _177(`${ev} ${file}`)]),
|
|
2719
|
+
[...files].some((path7) => path7.includes("middleware.")) ? _optionalChain([middlewareManager, 'optionalAccess', _178 => _178.reload, 'call', _179 => _179()]) : void 0
|
|
2696
2720
|
]);
|
|
2697
2721
|
if (pendingRouteReloads.size === 1)
|
|
2698
2722
|
server.ws.send({ type: "full-reload", path: "*" });
|
|
@@ -2739,16 +2763,16 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2739
2763
|
const dispatchToDevServer = _chunkBNH53KOTcjs.createFarmDevServerDispatch.call(void 0, server);
|
|
2740
2764
|
if (options.mobileClient) {
|
|
2741
2765
|
const { FARM_DEV_SERVER_MODULE_LOADER } = await import("./internal/native-server-fns.cjs");
|
|
2742
|
-
const load = (file) =>
|
|
2766
|
+
const load = (file) => _chunkI2RBHZF7cjs.loadFarmDevModule.call(void 0, server, file);
|
|
2743
2767
|
globalThis[FARM_DEV_SERVER_MODULE_LOADER] = load;
|
|
2744
|
-
_optionalChain([server, 'access',
|
|
2768
|
+
_optionalChain([server, 'access', _180 => _180.httpServer, 'optionalAccess', _181 => _181.once, 'call', _182 => _182("close", () => {
|
|
2745
2769
|
const globals = globalThis;
|
|
2746
2770
|
if (globals[FARM_DEV_SERVER_MODULE_LOADER] === load) {
|
|
2747
2771
|
delete globals[FARM_DEV_SERVER_MODULE_LOADER];
|
|
2748
2772
|
}
|
|
2749
2773
|
})]);
|
|
2750
2774
|
}
|
|
2751
|
-
apiRouteManager = new (0,
|
|
2775
|
+
apiRouteManager = new (0, _chunk3MY6TNNEcjs.APIRouteManager)(appDirs, server, {
|
|
2752
2776
|
plugins: farmConfig.plugins,
|
|
2753
2777
|
i18n: farmApp.getI18nRuntime(),
|
|
2754
2778
|
bodySizeLimit: serverConfig.bodySizeLimit,
|
|
@@ -2772,14 +2796,14 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2772
2796
|
discoveredWorkflows = await discoverFarmWorkflows(
|
|
2773
2797
|
{ ...farmConfig, workflows: workflowConfig },
|
|
2774
2798
|
{
|
|
2775
|
-
loadModule: async (filePath) =>
|
|
2799
|
+
loadModule: async (filePath) => _chunkI2RBHZF7cjs.loadFarmDevModule.call(void 0, server, filePath)
|
|
2776
2800
|
}
|
|
2777
2801
|
);
|
|
2778
2802
|
if (discoveredWorkflows.length > 0) {
|
|
2779
2803
|
workflowHandler = createFarmWorkflowRequestHandler({
|
|
2780
2804
|
workflows: discoveredWorkflows,
|
|
2781
2805
|
config: workflowConfig,
|
|
2782
|
-
loadModule: async (workflow) =>
|
|
2806
|
+
loadModule: async (workflow) => _chunkI2RBHZF7cjs.loadFarmDevModule.call(void 0, server, workflow.filePath),
|
|
2783
2807
|
server: farmConfig.server
|
|
2784
2808
|
});
|
|
2785
2809
|
_chunk7U4XF76Rcjs.logger.success(`\u2705 Discovered ${discoveredWorkflows.length} Farm workflow task(s)`);
|
|
@@ -2794,7 +2818,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2794
2818
|
});
|
|
2795
2819
|
}
|
|
2796
2820
|
}
|
|
2797
|
-
middlewareManager = new (0,
|
|
2821
|
+
middlewareManager = new (0, _chunkUA77C2ZAcjs.MiddlewareManager)(
|
|
2798
2822
|
appDirs,
|
|
2799
2823
|
server,
|
|
2800
2824
|
farmConfig.middleware,
|
|
@@ -2815,11 +2839,11 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2815
2839
|
});
|
|
2816
2840
|
}
|
|
2817
2841
|
}
|
|
2818
|
-
if (_optionalChain([options, 'access',
|
|
2842
|
+
if (_optionalChain([options, 'access', _183 => _183.openapi, 'optionalAccess', _184 => _184.enabled])) {
|
|
2819
2843
|
const { OpenAPIManager } = await loadFarmOpenAPIDevRuntime();
|
|
2820
2844
|
openAPIManager = new OpenAPIManager(appDirs, options.openapi, {
|
|
2821
2845
|
mode: "development",
|
|
2822
|
-
apiBaseURL: typeof _optionalChain([options, 'access',
|
|
2846
|
+
apiBaseURL: typeof _optionalChain([options, 'access', _185 => _185.api, 'optionalAccess', _186 => _186.baseURL]) === "string" ? options.api.baseURL : void 0,
|
|
2823
2847
|
routes: () => apiRouteManager.getRoutes().values(),
|
|
2824
2848
|
loadModule: (filePath) => apiRouteManager.loadModule(filePath)
|
|
2825
2849
|
});
|
|
@@ -2847,10 +2871,10 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2847
2871
|
const layoutModules = await Promise.all(
|
|
2848
2872
|
layouts.map((layout) => routeManager.loadLayoutModule(layout.modulePath))
|
|
2849
2873
|
);
|
|
2850
|
-
return
|
|
2874
|
+
return _chunkNDMPGFKLcjs.resolveFarmLayoutFonts.call(void 0, layoutModules);
|
|
2851
2875
|
};
|
|
2852
2876
|
releaseDocsMCPServers();
|
|
2853
|
-
const isFarmDocsPathGuarded = (href) =>
|
|
2877
|
+
const isFarmDocsPathGuarded = (href) => _chunk4ZVKDHS6cjs.farmPathGuardCoversPage.call(void 0,
|
|
2854
2878
|
{
|
|
2855
2879
|
config: farmConfig,
|
|
2856
2880
|
middlewareRoutes: middlewareManager.getMiddlewares().filter((entry) => entry.source !== "config")
|
|
@@ -2864,20 +2888,20 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2864
2888
|
rendererServer: farmConfig.renderer.server,
|
|
2865
2889
|
resolveLayoutFonts: resolveDocsLayoutFonts,
|
|
2866
2890
|
fontStylesheetHref: "/@farm/fonts.css",
|
|
2867
|
-
globalStylesheetHref:
|
|
2891
|
+
globalStylesheetHref: _chunkPQ6DBVJ2cjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
2868
2892
|
farmConfig.root,
|
|
2869
2893
|
farmConfig.srcDir
|
|
2870
2894
|
),
|
|
2871
2895
|
loadModule: async (specifier) => {
|
|
2872
2896
|
const resolved = await server.environments.ssr.pluginContainer.resolveId(specifier);
|
|
2873
|
-
if (specifier === _optionalChain([farmConfig, 'access',
|
|
2897
|
+
if (specifier === _optionalChain([farmConfig, 'access', _187 => _187.docs, 'access', _188 => _188.adapter, 'optionalAccess', _189 => _189.server]) && _optionalChain([resolved, 'optionalAccess', _190 => _190.id])) {
|
|
2874
2898
|
const file = resolved.id.split("?", 1)[0];
|
|
2875
2899
|
return import(
|
|
2876
2900
|
/* @vite-ignore */
|
|
2877
2901
|
_url.pathToFileURL.call(void 0, file).href
|
|
2878
2902
|
);
|
|
2879
2903
|
}
|
|
2880
|
-
return
|
|
2904
|
+
return _chunkI2RBHZF7cjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess', _191 => _191.id]), () => ( specifier)));
|
|
2881
2905
|
},
|
|
2882
2906
|
registerMCPServer: (mcpServer) => {
|
|
2883
2907
|
const dispose = _chunkRKQOMG2Xcjs.registerFarmMCPServer.call(void 0, mcpServer);
|
|
@@ -2895,7 +2919,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2895
2919
|
fontAssets: _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, farmDocsFontAssetList),
|
|
2896
2920
|
resolveLayoutFonts: resolveDocsLayoutFonts,
|
|
2897
2921
|
fontStylesheetHref: "/@farm/fonts.css",
|
|
2898
|
-
globalStylesheetHref:
|
|
2922
|
+
globalStylesheetHref: _chunkPQ6DBVJ2cjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
2899
2923
|
farmConfig.root,
|
|
2900
2924
|
farmConfig.srcDir
|
|
2901
2925
|
),
|
|
@@ -2903,7 +2927,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2903
2927
|
basePath: farmConfig.basePath
|
|
2904
2928
|
}) : null;
|
|
2905
2929
|
const farmDocsListsPages = Boolean(
|
|
2906
|
-
farmDocsDevRuntime && _optionalChain([pm, 'optionalAccess',
|
|
2930
|
+
farmDocsDevRuntime && _optionalChain([pm, 'optionalAccess', _192 => _192.getPlugins, 'call', _193 => _193(), 'access', _194 => _194.some, 'call', _195 => _195((plugin2) => plugin2.name === "farm:infra-analytics")])
|
|
2907
2931
|
);
|
|
2908
2932
|
let farmDocsPagePaths;
|
|
2909
2933
|
const getFarmDocsPagePaths = () => {
|
|
@@ -2930,22 +2954,22 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2930
2954
|
});
|
|
2931
2955
|
}
|
|
2932
2956
|
}
|
|
2933
|
-
const farmInfraAnalyticsPlugin = _optionalChain([pm, 'optionalAccess',
|
|
2957
|
+
const farmInfraAnalyticsPlugin = _optionalChain([pm, 'optionalAccess', _196 => _196.getPlugins, 'call', _197 => _197(), 'access', _198 => _198.find, 'call', _199 => _199((plugin2) => plugin2.name === "farm:infra-analytics")]);
|
|
2934
2958
|
if (farmInfraAnalyticsPlugin) {
|
|
2935
|
-
|
|
2959
|
+
_chunkFEWCWBOFcjs._setFarmInfraAnalyticsWebMCPRoute.call(void 0, farmInfraAnalyticsPlugin, async (pathname) => {
|
|
2936
2960
|
if (farmDocsDevRuntime) {
|
|
2937
|
-
const label =
|
|
2961
|
+
const label = _chunkJGUMFTZTcjs.resolveFarmDocsRouteLabel.call(void 0,
|
|
2938
2962
|
_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, pathname, farmConfig.basePath),
|
|
2939
2963
|
{
|
|
2940
|
-
path: _optionalChain([farmConfig, 'access',
|
|
2941
|
-
roots: _optionalChain([farmConfig, 'access',
|
|
2964
|
+
path: _optionalChain([farmConfig, 'access', _200 => _200.docs, 'optionalAccess', _201 => _201.entry]) || "/docs",
|
|
2965
|
+
roots: _optionalChain([farmConfig, 'access', _202 => _202.docs, 'optionalAccess', _203 => _203.roots, 'optionalAccess', _204 => _204.map, 'call', _205 => _205((root) => root.entry)]),
|
|
2942
2966
|
pages: await getFarmDocsPagePaths()
|
|
2943
2967
|
}
|
|
2944
2968
|
);
|
|
2945
|
-
if (label) return
|
|
2969
|
+
if (label) return _chunkJGUMFTZTcjs.setFarmRouteLabel.call(void 0, { pathname }, label);
|
|
2946
2970
|
}
|
|
2947
2971
|
const match = farmApp.getRouteManager().matchRoute(pathname);
|
|
2948
|
-
return { pathname, pattern: _optionalChain([match, 'access',
|
|
2972
|
+
return { pathname, pattern: _optionalChain([match, 'access', _206 => _206.route, 'optionalAccess', _207 => _207.pattern]) || null };
|
|
2949
2973
|
});
|
|
2950
2974
|
}
|
|
2951
2975
|
if (farmDocsDevRuntime && !farmDocsDevRuntime.hasFarmDocsRuntimeAdapter(farmConfig.docs)) {
|
|
@@ -3020,7 +3044,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3020
3044
|
}
|
|
3021
3045
|
},
|
|
3022
3046
|
(request) => {
|
|
3023
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3047
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _208 => _208.getConfig, 'call', _209 => _209()]), () => ( options));
|
|
3024
3048
|
const currentServerConfig = _chunk7Q7UB4TLcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
|
|
3025
3049
|
return _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, request, {
|
|
3026
3050
|
trustProxy: currentServerConfig.trustProxy
|
|
@@ -3036,7 +3060,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3036
3060
|
withAPIRequestTracing(async function handleFarmDevRequest(req, res, next) {
|
|
3037
3061
|
const requestUrl = req.url || "/";
|
|
3038
3062
|
const requestMethod = req.method || "GET";
|
|
3039
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3063
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _210 => _210.getConfig, 'call', _211 => _211()]), () => ( options));
|
|
3040
3064
|
const currentServerConfig = _chunk7Q7UB4TLcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
|
|
3041
3065
|
const parsedRequestUrl = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req, {
|
|
3042
3066
|
trustProxy: currentServerConfig.trustProxy
|
|
@@ -3106,7 +3130,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3106
3130
|
if (!rendererDisabled && (requestMethod === "GET" || requestMethod === "HEAD") && requestPathname === _chunkY3DO7BIJcjs.FARM_VIDEO_PLAYER_PATH) {
|
|
3107
3131
|
res.statusCode = 200;
|
|
3108
3132
|
res.setHeader("Content-Type", "text/html; charset=utf-8");
|
|
3109
|
-
res.end(requestMethod === "HEAD" ? void 0 :
|
|
3133
|
+
res.end(requestMethod === "HEAD" ? void 0 : _chunkPQ6DBVJ2cjs.FARM_VIDEO_PLAYER_HTML);
|
|
3110
3134
|
return;
|
|
3111
3135
|
}
|
|
3112
3136
|
const farmDocsFontPath = farmDocsFontAssets.get(requestPathname);
|
|
@@ -3161,7 +3185,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3161
3185
|
openapi: options.openapi
|
|
3162
3186
|
},
|
|
3163
3187
|
workflows: discoveredWorkflows,
|
|
3164
|
-
plugins: _optionalChain([pm, 'optionalAccess',
|
|
3188
|
+
plugins: _optionalChain([pm, 'optionalAccess', _212 => _212.getSortedPlugins, 'call', _213 => _213()])
|
|
3165
3189
|
});
|
|
3166
3190
|
res.statusCode = 200;
|
|
3167
3191
|
res.setHeader(
|
|
@@ -3196,10 +3220,10 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3196
3220
|
render: {
|
|
3197
3221
|
pathname: pathname2,
|
|
3198
3222
|
method: requestMethod,
|
|
3199
|
-
routePattern: _optionalChain([match, 'optionalAccess',
|
|
3200
|
-
params: _optionalChain([match, 'optionalAccess',
|
|
3223
|
+
routePattern: _optionalChain([match, 'optionalAccess', _214 => _214.route, 'optionalAccess', _215 => _215.pattern]) || null,
|
|
3224
|
+
params: _optionalChain([match, 'optionalAccess', _216 => _216.params]) || {}
|
|
3201
3225
|
},
|
|
3202
|
-
layoutPatterns: (_optionalChain([match, 'optionalAccess',
|
|
3226
|
+
layoutPatterns: (_optionalChain([match, 'optionalAccess', _217 => _217.layouts]) || []).map((layout) => layout.pattern)
|
|
3203
3227
|
};
|
|
3204
3228
|
return pageHookRouteMatch;
|
|
3205
3229
|
};
|
|
@@ -3287,7 +3311,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3287
3311
|
}
|
|
3288
3312
|
}
|
|
3289
3313
|
const runAppMiddlewareForContentRoute = async () => {
|
|
3290
|
-
if (!_optionalChain([middlewareManager, 'optionalAccess',
|
|
3314
|
+
if (!_optionalChain([middlewareManager, 'optionalAccess', _218 => _218.hasMiddleware, 'call', _219 => _219()])) return false;
|
|
3291
3315
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
3292
3316
|
return runFarmMiddlewareWithNavigation(
|
|
3293
3317
|
farmApp.getServerRenderer(),
|
|
@@ -3325,7 +3349,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3325
3349
|
return response.status;
|
|
3326
3350
|
};
|
|
3327
3351
|
const runAppMiddlewareInRuntimeSession = async (runtimeSession2, logResponse2) => {
|
|
3328
|
-
const interceptor = runtimeSession2 && _optionalChain([pm, 'optionalAccess',
|
|
3352
|
+
const interceptor = runtimeSession2 && _optionalChain([pm, 'optionalAccess', _220 => _220.hasRuntimeHook, 'call', _221 => _221("after")]) && _optionalChain([middlewareManager, 'optionalAccess', _222 => _222.hasMiddleware, 'call', _223 => _223()]) ? interceptFarmDevPageResponse({
|
|
3329
3353
|
req,
|
|
3330
3354
|
res,
|
|
3331
3355
|
pm,
|
|
@@ -3338,7 +3362,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3338
3362
|
urlPath: requestUrl,
|
|
3339
3363
|
pathname: requestPathname,
|
|
3340
3364
|
startTime: Date.now(),
|
|
3341
|
-
logResponse: (_method, _path, status) => _optionalChain([logResponse2, 'optionalCall',
|
|
3365
|
+
logResponse: (_method, _path, status) => _optionalChain([logResponse2, 'optionalCall', _224 => _224(status)]),
|
|
3342
3366
|
// The runtime reports a runtime.after failure itself.
|
|
3343
3367
|
emitError: async () => {
|
|
3344
3368
|
},
|
|
@@ -3349,7 +3373,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3349
3373
|
handled = await runAppMiddlewareForContentRoute();
|
|
3350
3374
|
} catch (error) {
|
|
3351
3375
|
if (runtimeHookErrorAnswersJSON || res.headersSent) {
|
|
3352
|
-
_optionalChain([interceptor, 'optionalAccess',
|
|
3376
|
+
_optionalChain([interceptor, 'optionalAccess', _225 => _225.release, 'call', _226 => _226()]);
|
|
3353
3377
|
throw error;
|
|
3354
3378
|
}
|
|
3355
3379
|
if (runtimeSession2) await pm.reportRuntimeRequestError(runtimeSession2, error);
|
|
@@ -3357,10 +3381,10 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3357
3381
|
return true;
|
|
3358
3382
|
}
|
|
3359
3383
|
if (!handled) {
|
|
3360
|
-
_optionalChain([interceptor, 'optionalAccess',
|
|
3384
|
+
_optionalChain([interceptor, 'optionalAccess', _227 => _227.release, 'call', _228 => _228()]);
|
|
3361
3385
|
return false;
|
|
3362
3386
|
}
|
|
3363
|
-
if (!_optionalChain([interceptor, 'optionalAccess',
|
|
3387
|
+
if (!_optionalChain([interceptor, 'optionalAccess', _229 => _229.isEnded, 'call', _230 => _230()])) _optionalChain([logResponse2, 'optionalCall', _231 => _231(res.statusCode || 200)]);
|
|
3364
3388
|
return true;
|
|
3365
3389
|
};
|
|
3366
3390
|
const serveBuiltInRoute = async (respond, {
|
|
@@ -3369,7 +3393,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3369
3393
|
label
|
|
3370
3394
|
} = {}) => {
|
|
3371
3395
|
const discard = async () => {
|
|
3372
|
-
await _optionalChain([computed, 'optionalAccess',
|
|
3396
|
+
await _optionalChain([computed, 'optionalAccess', _232 => _232.body, 'optionalAccess', _233 => _233.cancel, 'call', _234 => _234(), 'access', _235 => _235.catch, 'call', _236 => _236(() => {
|
|
3373
3397
|
})]);
|
|
3374
3398
|
};
|
|
3375
3399
|
const sendRuntimeResponse = async (runtimeSession3, response2) => {
|
|
@@ -3386,9 +3410,9 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3386
3410
|
if (pm && opensFarmDevRuntimeSession(pm)) {
|
|
3387
3411
|
try {
|
|
3388
3412
|
const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath);
|
|
3389
|
-
const route =
|
|
3413
|
+
const route = _chunkJGUMFTZTcjs.setFarmRouteLabel.call(void 0,
|
|
3390
3414
|
{ pathname: requestPathname },
|
|
3391
|
-
label !== void 0 ? label : devBuiltInRoutePaths.has(routePathname) ? routePathname :
|
|
3415
|
+
label !== void 0 ? label : devBuiltInRoutePaths.has(routePathname) ? routePathname : _chunkJGUMFTZTcjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath)
|
|
3392
3416
|
);
|
|
3393
3417
|
runtimeSession2 = await pm.beginRuntimeRequest(
|
|
3394
3418
|
createRequestFromNodeRequest(req, new URL(fullUrl)),
|
|
@@ -3426,7 +3450,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3426
3450
|
}
|
|
3427
3451
|
responding = true;
|
|
3428
3452
|
response = await respond(
|
|
3429
|
-
_nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess',
|
|
3453
|
+
_nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess', _237 => _237.request]), () => ( createRequestFromNodeRequest(req, new URL(fullUrl))))
|
|
3430
3454
|
);
|
|
3431
3455
|
} catch (error) {
|
|
3432
3456
|
if (!responding && !res.headersSent) {
|
|
@@ -3446,7 +3470,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3446
3470
|
else await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, response);
|
|
3447
3471
|
};
|
|
3448
3472
|
const openAPIRequestPathname = openAPIManager ? _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) : requestPathname;
|
|
3449
|
-
if (openAPIManager && _optionalChain([options, 'access',
|
|
3473
|
+
if (openAPIManager && _optionalChain([options, 'access', _238 => _238.openapi, 'optionalAccess', _239 => _239.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
|
|
3450
3474
|
const specManager = openAPIManager;
|
|
3451
3475
|
await serveBuiltInRoute(async () => {
|
|
3452
3476
|
if (requestMethod !== "GET" && requestMethod !== "HEAD") {
|
|
@@ -3466,7 +3490,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3466
3490
|
});
|
|
3467
3491
|
return;
|
|
3468
3492
|
}
|
|
3469
|
-
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access',
|
|
3493
|
+
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _240 => _240.openapi, 'optionalAccess', _241 => _241.route])) {
|
|
3470
3494
|
const docsManager = openAPIManager;
|
|
3471
3495
|
await serveBuiltInRoute(
|
|
3472
3496
|
async () => {
|
|
@@ -3477,8 +3501,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3477
3501
|
);
|
|
3478
3502
|
return;
|
|
3479
3503
|
}
|
|
3480
|
-
if (_optionalChain([options, 'access',
|
|
3481
|
-
const manifestGuardCoversPath = (path7) =>
|
|
3504
|
+
if (_optionalChain([options, 'access', _242 => _242.agent, 'optionalAccess', _243 => _243.manifest]) !== false && _chunkJGUMFTZTcjs.isFarmAppManifestPath.call(void 0, _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath))) {
|
|
3505
|
+
const manifestGuardCoversPath = (path7) => _chunk4ZVKDHS6cjs.farmPathGuardCoversEndpoint.call(void 0,
|
|
3482
3506
|
{
|
|
3483
3507
|
config: farmConfig,
|
|
3484
3508
|
middlewareRoutes: middlewareManager.getMiddlewares().filter((entry) => entry.source !== "config")
|
|
@@ -3487,18 +3511,18 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3487
3511
|
apiServerBasePath
|
|
3488
3512
|
);
|
|
3489
3513
|
await serveBuiltInRoute(async () => {
|
|
3490
|
-
_nullishCoalesce(farmAppPackages, () => ( (farmAppPackages =
|
|
3491
|
-
const manifest = await
|
|
3514
|
+
_nullishCoalesce(farmAppPackages, () => ( (farmAppPackages = _chunkPQ6DBVJ2cjs.resolveFarmAppPackages.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd()))))));
|
|
3515
|
+
const manifest = await _chunkJGUMFTZTcjs.createFarmAppManifestResponse.call(void 0,
|
|
3492
3516
|
new Request(parsedRequestUrl, {
|
|
3493
3517
|
method: requestMethod,
|
|
3494
3518
|
headers: { "if-none-match": String(_nullishCoalesce(req.headers["if-none-match"], () => ( ""))) }
|
|
3495
3519
|
}),
|
|
3496
3520
|
{
|
|
3497
|
-
...
|
|
3521
|
+
..._chunkJGUMFTZTcjs.resolveFarmAppManifestInput.call(void 0, farmConfig, {
|
|
3498
3522
|
build: "development",
|
|
3499
3523
|
packages: farmAppPackages,
|
|
3500
3524
|
// Read again on each request; unchanged files come from a cache.
|
|
3501
|
-
webmcpTools: _optionalChain([farmConfig, 'access',
|
|
3525
|
+
webmcpTools: _optionalChain([farmConfig, 'access', _244 => _244.plugins, 'optionalAccess', _245 => _245.some, 'call', _246 => _246(({ name }) => name === "farm:webmcp")]) ? _chunkPQ6DBVJ2cjs.collectFarmWebMCPTools.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd())), farmConfig.srcDir) : []
|
|
3502
3526
|
}),
|
|
3503
3527
|
defaultMCP: () => farmApp.getServerRenderer().getDefaultMCPServer(),
|
|
3504
3528
|
// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
@@ -3516,11 +3540,11 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3516
3540
|
});
|
|
3517
3541
|
return;
|
|
3518
3542
|
}
|
|
3519
|
-
if (_optionalChain([options, 'access',
|
|
3543
|
+
if (_optionalChain([options, 'access', _247 => _247.agent, 'optionalAccess', _248 => _248.apiCatalog]) && _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunkJGUMFTZTcjs.FARM_API_CATALOG_PATH) {
|
|
3520
3544
|
await serveBuiltInRoute(
|
|
3521
|
-
() =>
|
|
3545
|
+
() => _chunkJGUMFTZTcjs.createFarmApiCatalogResponse.call(void 0,
|
|
3522
3546
|
requestMethod,
|
|
3523
|
-
|
|
3547
|
+
_chunkJGUMFTZTcjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
|
|
3524
3548
|
new Request(parsedRequestUrl, {
|
|
3525
3549
|
headers: { "user-agent": String(_nullishCoalesce(req.headers["user-agent"], () => ( ""))) }
|
|
3526
3550
|
})
|
|
@@ -3528,8 +3552,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3528
3552
|
);
|
|
3529
3553
|
return;
|
|
3530
3554
|
}
|
|
3531
|
-
if (_optionalChain([options, 'access',
|
|
3532
|
-
const aiCatalog =
|
|
3555
|
+
if (_optionalChain([options, 'access', _249 => _249.agent, 'optionalAccess', _250 => _250.aiCatalog]) !== false) {
|
|
3556
|
+
const aiCatalog = _chunkJGUMFTZTcjs.createFarmAiCatalogResponse.call(void 0,
|
|
3533
3557
|
new Request(parsedRequestUrl, {
|
|
3534
3558
|
method: requestMethod,
|
|
3535
3559
|
headers: {
|
|
@@ -3577,7 +3601,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3577
3601
|
);
|
|
3578
3602
|
const docsResponse = await farmDocsHandler(docsHandlerRequest);
|
|
3579
3603
|
if (docsResponse) {
|
|
3580
|
-
const docsPage = _optionalChain([docsResponse, 'access',
|
|
3604
|
+
const docsPage = _optionalChain([docsResponse, 'access', _251 => _251.headers, 'access', _252 => _252.get, 'call', _253 => _253("content-type"), 'optionalAccess', _254 => _254.toLowerCase, 'call', _255 => _255(), 'access', _256 => _256.includes, 'call', _257 => _257("text/html")]);
|
|
3581
3605
|
await serveBuiltInRoute(
|
|
3582
3606
|
async (request) => {
|
|
3583
3607
|
if (!docsPage) {
|
|
@@ -3595,7 +3619,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3595
3619
|
farmConfig.deploymentId
|
|
3596
3620
|
);
|
|
3597
3621
|
if (deploymentMismatch) {
|
|
3598
|
-
await _optionalChain([docsResponse, 'access',
|
|
3622
|
+
await _optionalChain([docsResponse, 'access', _258 => _258.body, 'optionalAccess', _259 => _259.cancel, 'call', _260 => _260()]);
|
|
3599
3623
|
return _chunkNLBHLPEOcjs.createFarmDeploymentMismatchResponse.call(void 0, deploymentMismatch);
|
|
3600
3624
|
}
|
|
3601
3625
|
return _chunkNLBHLPEOcjs.withFarmDeploymentResponse.call(void 0,
|
|
@@ -3611,11 +3635,11 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3611
3635
|
{
|
|
3612
3636
|
kind: "docs",
|
|
3613
3637
|
computed: docsResponse,
|
|
3614
|
-
label:
|
|
3638
|
+
label: _chunkJGUMFTZTcjs.resolveFarmDocsEngineRouteLabel.call(void 0,
|
|
3615
3639
|
_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath),
|
|
3616
3640
|
{
|
|
3617
|
-
path: _optionalChain([farmConfig, 'access',
|
|
3618
|
-
roots: _optionalChain([farmConfig, 'access',
|
|
3641
|
+
path: _optionalChain([farmConfig, 'access', _261 => _261.docs, 'optionalAccess', _262 => _262.entry]) || "/docs",
|
|
3642
|
+
roots: _optionalChain([farmConfig, 'access', _263 => _263.docs, 'optionalAccess', _264 => _264.roots, 'optionalAccess', _265 => _265.map, 'call', _266 => _266((root) => root.entry)]),
|
|
3619
3643
|
pages: await getFarmDocsPagePaths()
|
|
3620
3644
|
}
|
|
3621
3645
|
)
|
|
@@ -3624,7 +3648,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3624
3648
|
return;
|
|
3625
3649
|
}
|
|
3626
3650
|
}
|
|
3627
|
-
if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD" || requestMethod === "POST") && _optionalChain([req, 'access',
|
|
3651
|
+
if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD" || requestMethod === "POST") && _optionalChain([req, 'access', _267 => _267.headers, 'access', _268 => _268.accept, 'optionalAccess', _269 => _269.includes, 'call', _270 => _270(_chunk3HLQTOVUcjs.FARM_NATIVE_TREE_CONTENT_TYPE)])) {
|
|
3628
3652
|
const { createFarmNativeTreeResponse } = await import("./native-tree-5TENEQ7Y.cjs");
|
|
3629
3653
|
const treeBodyInit = requestMethod === "POST" ? { body: _chunk7Q7UB4TLcjs.createFarmNodeRequestBodyStream.call(void 0, req), duplex: "half" } : {};
|
|
3630
3654
|
const treeResponse = await createFarmNativeTreeResponse({
|
|
@@ -3642,15 +3666,15 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3642
3666
|
});
|
|
3643
3667
|
await serveBuiltInRoute(() => treeResponse, {
|
|
3644
3668
|
computed: treeResponse,
|
|
3645
|
-
label: _nullishCoalesce(_optionalChain([farmApp, 'access',
|
|
3669
|
+
label: _nullishCoalesce(_optionalChain([farmApp, 'access', _271 => _271.getRouteManager, 'call', _272 => _272(), 'access', _273 => _273.matchRoute, 'call', _274 => _274(_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath)), 'access', _275 => _275.route, 'optionalAccess', _276 => _276.pattern]), () => ( null))
|
|
3646
3670
|
});
|
|
3647
3671
|
return;
|
|
3648
3672
|
}
|
|
3649
3673
|
const markdownRouteLabel = () => (
|
|
3650
3674
|
// On the route path, as production labels it: /fr/index.md is /index.md.
|
|
3651
|
-
|
|
3675
|
+
_chunkJGUMFTZTcjs.resolveFarmMarkdownRouteLabel.call(void 0,
|
|
3652
3676
|
toRoutePathname(requestPathname),
|
|
3653
|
-
(page) => _optionalChain([farmApp, 'access',
|
|
3677
|
+
(page) => _optionalChain([farmApp, 'access', _277 => _277.getRouteManager, 'call', _278 => _278(), 'access', _279 => _279.matchRoute, 'call', _280 => _280(page), 'access', _281 => _281.route, 'optionalAccess', _282 => _282.pattern])
|
|
3654
3678
|
)
|
|
3655
3679
|
);
|
|
3656
3680
|
const markdownSourceResponse = viteModuleRequest ? null : await _chunk26WP75W5cjs.createFarmMarkdownSourceResponse.call(void 0, {
|
|
@@ -3662,14 +3686,14 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3662
3686
|
routePathname: toRoutePathname,
|
|
3663
3687
|
resolveSource: async (pathname2) => {
|
|
3664
3688
|
const match = farmApp.getRouteManager().matchRoute(pathname2);
|
|
3665
|
-
const sourcePath = _optionalChain([match, 'access',
|
|
3689
|
+
const sourcePath = _optionalChain([match, 'access', _283 => _283.route, 'optionalAccess', _284 => _284.markdownSourcePath]) || (match.route && _chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
|
|
3666
3690
|
if (!sourcePath) {
|
|
3667
3691
|
return null;
|
|
3668
3692
|
}
|
|
3669
3693
|
return {
|
|
3670
3694
|
source: await fs2.promises.readFile(sourcePath, "utf8"),
|
|
3671
3695
|
// Project-relative, as production sends it: never the machine's path.
|
|
3672
|
-
filePath:
|
|
3696
|
+
filePath: _chunkPQ6DBVJ2cjs.toBakedMarkdownSourcePath.call(void 0, farmApp.getConfig().root, sourcePath)
|
|
3673
3697
|
};
|
|
3674
3698
|
},
|
|
3675
3699
|
// The anonymous check goes through this server, so its guards and
|
|
@@ -3819,7 +3843,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3819
3843
|
"beforeRequest",
|
|
3820
3844
|
(plugin2) => {
|
|
3821
3845
|
const owner = _chunkB3HQTGXScjs.getFarmIntegrationPluginOwner.call(void 0, plugin2);
|
|
3822
|
-
return !isFarmConfigRoutePlugin(plugin2) && (_optionalChain([owner, 'optionalAccess',
|
|
3846
|
+
return !isFarmConfigRoutePlugin(plugin2) && (_optionalChain([owner, 'optionalAccess', _285 => _285.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
|
|
3823
3847
|
},
|
|
3824
3848
|
req,
|
|
3825
3849
|
res
|
|
@@ -3856,7 +3880,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3856
3880
|
isProd: false
|
|
3857
3881
|
},
|
|
3858
3882
|
request,
|
|
3859
|
-
{ clientAddress: _optionalChain([req, 'access',
|
|
3883
|
+
{ clientAddress: _optionalChain([req, 'access', _286 => _286.socket, 'optionalAccess', _287 => _287.remoteAddress]) }
|
|
3860
3884
|
);
|
|
3861
3885
|
if (!result) {
|
|
3862
3886
|
throw new Error(`Matched integration route did not return a response`);
|
|
@@ -3864,7 +3888,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3864
3888
|
return result;
|
|
3865
3889
|
} catch (error) {
|
|
3866
3890
|
_chunk7U4XF76Rcjs.logger.error(`Integration route error: ${error}`);
|
|
3867
|
-
await _optionalChain([runtime, 'optionalAccess',
|
|
3891
|
+
await _optionalChain([runtime, 'optionalAccess', _288 => _288.reportError, 'call', _289 => _289(error)]);
|
|
3868
3892
|
return _chunkJYQ6DGPWcjs.createFarmInternalServerErrorResponse.call(void 0, );
|
|
3869
3893
|
}
|
|
3870
3894
|
};
|
|
@@ -3918,7 +3942,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
3918
3942
|
_chunkB3HQTGXScjs.matchIntegrationRoute.call(void 0, configuredIntegrations, {
|
|
3919
3943
|
pathname: requestPathname,
|
|
3920
3944
|
method: requestMethod
|
|
3921
|
-
}) || routeManager3.matchRedirect(requestPathname) || apiRouteManager.matchRoute(requestPathname) || farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
3945
|
+
}) || routeManager3.matchRedirect(requestPathname) || apiRouteManager.matchRoute(requestPathname) || farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _290 => _290.isFarmDocsAPIRequest, 'call', _291 => _291(requestPathname)]) || routeManager3.matchRoute(requestPathname).route || routeManager3.matchMetadataRoute(requestPathname) || routeManager3.matchMetadataImage(requestPathname)
|
|
3922
3946
|
);
|
|
3923
3947
|
};
|
|
3924
3948
|
try {
|
|
@@ -4008,15 +4032,15 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4008
4032
|
);
|
|
4009
4033
|
};
|
|
4010
4034
|
const isDocsAPIRequest = Boolean(
|
|
4011
|
-
farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
4035
|
+
farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _292 => _292.isFarmDocsAPIRequest, 'call', _293 => _293(pathname2)])
|
|
4012
4036
|
);
|
|
4013
4037
|
const docsRuntimeOptions = () => ({
|
|
4014
4038
|
kind: "docs",
|
|
4015
|
-
route:
|
|
4039
|
+
route: _chunkJGUMFTZTcjs.setFarmRouteLabel.call(void 0,
|
|
4016
4040
|
{ pathname: pathname2, pattern: urlPath2 },
|
|
4017
|
-
|
|
4018
|
-
path: _optionalChain([farmConfig, 'access',
|
|
4019
|
-
roots: _optionalChain([farmConfig, 'access',
|
|
4041
|
+
_chunkJGUMFTZTcjs.resolveFarmDocsRouteLabel.call(void 0, pathname2, {
|
|
4042
|
+
path: _optionalChain([farmConfig, 'access', _294 => _294.docs, 'optionalAccess', _295 => _295.entry]) || "/docs",
|
|
4043
|
+
roots: _optionalChain([farmConfig, 'access', _296 => _296.docs, 'optionalAccess', _297 => _297.roots, 'optionalAccess', _298 => _298.map, 'call', _299 => _299((root) => root.entry)])
|
|
4020
4044
|
})
|
|
4021
4045
|
)
|
|
4022
4046
|
});
|
|
@@ -4098,7 +4122,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4098
4122
|
const routedApiRoute = rewritten ? apiRouteManager.matchRoute(routedPathname) : matchedApiRoute || apiRouteManager.matchRoute(pathname2);
|
|
4099
4123
|
const hasExplicitAPIRoute = Boolean(routedApiRoute);
|
|
4100
4124
|
if (apiHandler && hasExplicitAPIRoute) {
|
|
4101
|
-
const apiRoutePattern = _optionalChain([routedApiRoute, 'optionalAccess',
|
|
4125
|
+
const apiRoutePattern = _optionalChain([routedApiRoute, 'optionalAccess', _300 => _300.route, 'access', _301 => _301.path]) || urlPath2;
|
|
4102
4126
|
_chunkPLJMEUANcjs.emitFarmEvent.call(void 0, {
|
|
4103
4127
|
type: "route.matched",
|
|
4104
4128
|
pathname: pathname2,
|
|
@@ -4148,7 +4172,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4148
4172
|
error
|
|
4149
4173
|
});
|
|
4150
4174
|
_chunk7U4XF76Rcjs.logger.error(`API route error: ${error}`);
|
|
4151
|
-
await _optionalChain([runtime, 'optionalAccess',
|
|
4175
|
+
await _optionalChain([runtime, 'optionalAccess', _302 => _302.reportError, 'call', _303 => _303(error)]);
|
|
4152
4176
|
response = _chunkJYQ6DGPWcjs.createFarmInternalServerErrorResponse.call(void 0, );
|
|
4153
4177
|
}
|
|
4154
4178
|
return pm ? await pm.runHookSerial("afterApiHandler", response, apiLifecyclePayload) : response;
|
|
@@ -4253,12 +4277,12 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4253
4277
|
}
|
|
4254
4278
|
return;
|
|
4255
4279
|
}
|
|
4256
|
-
if (_optionalChain([req, 'access',
|
|
4280
|
+
if (_optionalChain([req, 'access', _304 => _304.url, 'optionalAccess', _305 => _305.startsWith, 'call', _306 => _306("/@")]) || _optionalChain([req, 'access', _307 => _307.url, 'optionalAccess', _308 => _308.startsWith, 'call', _309 => _309("/node_modules")])) {
|
|
4257
4281
|
return next();
|
|
4258
4282
|
}
|
|
4259
4283
|
if (!deferredDottedRequests.has(req) && shouldBypassFarmRouterForDottedPath(
|
|
4260
4284
|
requestPathname,
|
|
4261
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
4285
|
+
_optionalChain([farmApp, 'optionalAccess', _310 => _310.getRouteManager, 'call', _311 => _311()]),
|
|
4262
4286
|
[server.config.publicDir, server.config.root],
|
|
4263
4287
|
farmAgentGeneratedPaths(farmConfig),
|
|
4264
4288
|
requestMethod
|
|
@@ -4266,7 +4290,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4266
4290
|
if (!viteModuleRequest) deferredDottedRequests.set(req, requestUrl);
|
|
4267
4291
|
return next();
|
|
4268
4292
|
}
|
|
4269
|
-
if (_optionalChain([req, 'access',
|
|
4293
|
+
if (_optionalChain([req, 'access', _312 => _312.url, 'optionalAccess', _313 => _313.startsWith, 'call', _314 => _314("/__farm/page-data")])) {
|
|
4270
4294
|
const urlObj = parsedRequestUrl;
|
|
4271
4295
|
const targetPath = urlObj.searchParams.get("path") || "/";
|
|
4272
4296
|
let renderedRequest;
|
|
@@ -4296,7 +4320,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4296
4320
|
renderedRequest = targetRequest;
|
|
4297
4321
|
let middlewareMap = /* @__PURE__ */ new Map();
|
|
4298
4322
|
let middlewareContext = /* @__PURE__ */ new Map();
|
|
4299
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
4323
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _315 => _315.hasMiddleware, 'call', _316 => _316()])) {
|
|
4300
4324
|
const targetNodeRequest = createPageDataMiddlewareRequest(req, targetRequestUrl);
|
|
4301
4325
|
const targetNodeResponse = createPageDataMiddlewareResponse(res);
|
|
4302
4326
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
@@ -4330,10 +4354,10 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4330
4354
|
if (pm) {
|
|
4331
4355
|
await pm.runHookParallel("afterRouteMatch", {
|
|
4332
4356
|
pathname: targetPath,
|
|
4333
|
-
matched: !!_optionalChain([match, 'optionalAccess',
|
|
4334
|
-
routePattern: _optionalChain([match, 'optionalAccess',
|
|
4335
|
-
params: _optionalChain([match, 'optionalAccess',
|
|
4336
|
-
layoutPatterns: (_optionalChain([match, 'optionalAccess',
|
|
4357
|
+
matched: !!_optionalChain([match, 'optionalAccess', _317 => _317.route]),
|
|
4358
|
+
routePattern: _optionalChain([match, 'optionalAccess', _318 => _318.route, 'optionalAccess', _319 => _319.pattern]) || null,
|
|
4359
|
+
params: _optionalChain([match, 'optionalAccess', _320 => _320.params]) || {},
|
|
4360
|
+
layoutPatterns: (_optionalChain([match, 'optionalAccess', _321 => _321.layouts]) || []).map((l) => l.pattern)
|
|
4337
4361
|
});
|
|
4338
4362
|
}
|
|
4339
4363
|
if (!match) {
|
|
@@ -4368,7 +4392,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4368
4392
|
);
|
|
4369
4393
|
const loadingModule = loadingBoundary ? await routeManager3.loadRouteModule(loadingBoundary.modulePath) : null;
|
|
4370
4394
|
const navigationManifest = routeManager3.generateClientManifest(server.config.root);
|
|
4371
|
-
const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => (
|
|
4395
|
+
const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => ( _chunkPA3VZNWUcjs.getClientModuleMetadata.call(void 0, route.modulePath, server.config.root)));
|
|
4372
4396
|
const isClientComponent = moduleMetadata.isClientComponent;
|
|
4373
4397
|
const shouldHydrate = moduleMetadata.shouldHydrate;
|
|
4374
4398
|
let mergedMetadata = {};
|
|
@@ -4379,7 +4403,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4379
4403
|
(layout) => _nullishCoalesce(navigationManifest.layouts.find(
|
|
4380
4404
|
(entry) => entry.pattern === layout.pattern
|
|
4381
4405
|
), () => ( {
|
|
4382
|
-
...
|
|
4406
|
+
..._chunkPA3VZNWUcjs.getClientModuleMetadata.call(void 0, layout.modulePath, server.config.root),
|
|
4383
4407
|
serverTree: false
|
|
4384
4408
|
}))
|
|
4385
4409
|
);
|
|
@@ -4393,17 +4417,17 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4393
4417
|
)
|
|
4394
4418
|
];
|
|
4395
4419
|
const hydrationIslandStrategy = _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0,
|
|
4396
|
-
_optionalChain([(_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
4397
|
-
) === "islands" ?
|
|
4420
|
+
_optionalChain([(_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _322 => _322.getConfig, 'call', _323 => _323()]), () => ( options))), 'access', _324 => _324.experimental, 'optionalAccess', _325 => _325.serverComponents])
|
|
4421
|
+
) === "islands" ? _chunkPQ6DBVJ2cjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
4398
4422
|
route,
|
|
4399
4423
|
{ shouldHydrate, islandStrategy: _nullishCoalesce(moduleMetadata.islandStrategy, () => ( null)) },
|
|
4400
4424
|
layouts.map((layout, index) => ({
|
|
4401
4425
|
pattern: layout.pattern,
|
|
4402
4426
|
modulePath: layout.modulePath,
|
|
4403
|
-
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access',
|
|
4427
|
+
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _326 => _326[index], 'optionalAccess', _327 => _327.shouldHydrate]) === true,
|
|
4404
4428
|
// Manifest entries carry it; metadata read from source does not.
|
|
4405
|
-
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access',
|
|
4406
|
-
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access',
|
|
4429
|
+
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access', _328 => _328[index], 'optionalAccess', _329 => _329.hasIsolatedClientBoundaries]) === true,
|
|
4430
|
+
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _330 => _330[index], 'optionalAccess', _331 => _331.islandStrategy]), () => ( null))
|
|
4407
4431
|
})),
|
|
4408
4432
|
server.config.root,
|
|
4409
4433
|
true
|
|
@@ -4460,7 +4484,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4460
4484
|
const slotModule = await routeManager3.loadRouteModule(slot.route.modulePath);
|
|
4461
4485
|
const slotMetadata = _nullishCoalesce(navigationManifest.slots.find(
|
|
4462
4486
|
(entry) => entry.name === slot.name && entry.ownerPattern === slot.ownerPattern && entry.pattern === slot.route.pattern
|
|
4463
|
-
), () => (
|
|
4487
|
+
), () => ( _chunkPA3VZNWUcjs.getClientModuleMetadata.call(void 0, slot.route.modulePath, server.config.root)));
|
|
4464
4488
|
const slotContext = await _chunkX333W5KVcjs.resolveFarmRouteContext.call(void 0, farmApp.getConfig(), {
|
|
4465
4489
|
request: targetRequest,
|
|
4466
4490
|
params: slot.params,
|
|
@@ -4506,15 +4530,15 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4506
4530
|
);
|
|
4507
4531
|
const projectRoot = server.config.root;
|
|
4508
4532
|
const toUrlPath = (absolutePath) => _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, absolutePath, projectRoot);
|
|
4509
|
-
const renderPlan =
|
|
4533
|
+
const renderPlan = _chunk4ZVKDHS6cjs.createFarmRouteRenderPlan.call(void 0, {
|
|
4510
4534
|
pageShouldHydrate: shouldHydrate,
|
|
4511
4535
|
layoutShouldHydrate: shouldHydrateLayout,
|
|
4512
4536
|
islandStrategy: hydrationIslandStrategy,
|
|
4513
|
-
rendering:
|
|
4537
|
+
rendering: _chunkERV422FOcjs.resolveRouteRenderingConfig.call(void 0, routeModule)
|
|
4514
4538
|
});
|
|
4515
4539
|
const destinationLayoutPatterns = layouts.map((layout) => layout.pattern);
|
|
4516
|
-
const layoutStartIndex =
|
|
4517
|
-
|
|
4540
|
+
const layoutStartIndex = _chunk4ZVKDHS6cjs.getSharedLayoutPrefixLength.call(void 0,
|
|
4541
|
+
_chunk4ZVKDHS6cjs.parseFarmLayoutChainHeader.call(void 0, request.headers.get("x-farm-layout-chain")),
|
|
4518
4542
|
destinationLayoutPatterns
|
|
4519
4543
|
);
|
|
4520
4544
|
const renderer = farmApp.getServerRenderer();
|
|
@@ -4524,13 +4548,13 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4524
4548
|
middlewareContext,
|
|
4525
4549
|
() => renderer.renderNavigationFragment({
|
|
4526
4550
|
PageComponent: routeModule.default,
|
|
4527
|
-
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess',
|
|
4551
|
+
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _332 => _332.default]),
|
|
4528
4552
|
pageProps: routeProps,
|
|
4529
4553
|
params,
|
|
4530
4554
|
layouts: layouts.map((layout, index) => ({
|
|
4531
4555
|
pattern: layout.pattern,
|
|
4532
4556
|
module: layoutModules[index],
|
|
4533
|
-
serverTree: _optionalChain([layoutHydrationMetadata, 'access',
|
|
4557
|
+
serverTree: _optionalChain([layoutHydrationMetadata, 'access', _333 => _333[index], 'optionalAccess', _334 => _334.serverTree])
|
|
4534
4558
|
})),
|
|
4535
4559
|
layoutStartIndex,
|
|
4536
4560
|
slots: routeSlots.map((slot) => ({
|
|
@@ -4596,7 +4620,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4596
4620
|
{
|
|
4597
4621
|
status: 200,
|
|
4598
4622
|
headers: {
|
|
4599
|
-
"Cache-Control":
|
|
4623
|
+
"Cache-Control": _chunk4ZVKDHS6cjs.getFarmFragmentCacheControl.call(void 0, renderPlan),
|
|
4600
4624
|
"X-Farm-Navigation": "html-fragment",
|
|
4601
4625
|
Vary: "X-Farm-Layout-Chain",
|
|
4602
4626
|
[_chunkNLBHLPEOcjs.FARM_DEPLOYMENT_ID_HEADER]: farmConfig.deploymentId
|
|
@@ -4638,14 +4662,14 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4638
4662
|
trustProxy: currentServerConfig.trustProxy
|
|
4639
4663
|
}).pathname;
|
|
4640
4664
|
const routeManager2 = farmApp.getRouteManager();
|
|
4641
|
-
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
4642
|
-
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
4643
|
-
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
4665
|
+
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _335 => _335.hasHook, 'call', _336 => _336("beforeRequest")]), () => ( false));
|
|
4666
|
+
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _337 => _337.hasHook, 'call', _338 => _338("afterResponse")]), () => ( false));
|
|
4667
|
+
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _339 => _339.hasHook, 'call', _340 => _340("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _341 => _341.hasHook, 'call', _342 => _342("afterRender")]), () => ( false)));
|
|
4644
4668
|
const opensRuntimeSession = pm ? opensFarmDevRuntimeSession(pm) : false;
|
|
4645
|
-
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
4669
|
+
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _343 => _343.hasRuntimeHook, 'call', _344 => _344("after")]), () => ( false));
|
|
4646
4670
|
const pageBuiltInRouteLabel = (pathname2) => {
|
|
4647
4671
|
const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, pathname2, farmConfig.basePath);
|
|
4648
|
-
const mcpLabel =
|
|
4672
|
+
const mcpLabel = _chunkJGUMFTZTcjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath);
|
|
4649
4673
|
if (mcpLabel) return mcpLabel;
|
|
4650
4674
|
if (farmAgentGeneratedPaths(farmConfig).includes(routePathname)) return routePathname;
|
|
4651
4675
|
return routePathname === _chunkW53Z4WDIcjs.FARM_DEFAULT_MCP_PATH && farmApp.getServerRenderer().getDefaultMCPServer() ? _chunkW53Z4WDIcjs.FARM_DEFAULT_MCP_PATH : null;
|
|
@@ -4654,13 +4678,13 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4654
4678
|
const match = routeManager2.matchRoute(pathname2);
|
|
4655
4679
|
return {
|
|
4656
4680
|
kind: "page",
|
|
4657
|
-
route:
|
|
4681
|
+
route: _chunkJGUMFTZTcjs.setFarmRouteLabel.call(void 0,
|
|
4658
4682
|
{
|
|
4659
4683
|
pathname: pathname2,
|
|
4660
|
-
pattern: _optionalChain([match, 'optionalAccess',
|
|
4661
|
-
params: _optionalChain([match, 'optionalAccess',
|
|
4684
|
+
pattern: _optionalChain([match, 'optionalAccess', _345 => _345.route, 'optionalAccess', _346 => _346.pattern]) || null,
|
|
4685
|
+
params: _optionalChain([match, 'optionalAccess', _347 => _347.params]) || {}
|
|
4662
4686
|
},
|
|
4663
|
-
_optionalChain([match, 'optionalAccess',
|
|
4687
|
+
_optionalChain([match, 'optionalAccess', _348 => _348.route]) ? null : pageBuiltInRouteLabel(pathname2)
|
|
4664
4688
|
)
|
|
4665
4689
|
};
|
|
4666
4690
|
};
|
|
@@ -4740,7 +4764,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4740
4764
|
}) : void 0;
|
|
4741
4765
|
let middlewareFailed = false;
|
|
4742
4766
|
try {
|
|
4743
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
4767
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _349 => _349.hasMiddleware, 'call', _350 => _350()])) {
|
|
4744
4768
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
4745
4769
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
4746
4770
|
farmApp.getServerRenderer(),
|
|
@@ -4753,7 +4777,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4753
4777
|
throw error;
|
|
4754
4778
|
});
|
|
4755
4779
|
if (handled) {
|
|
4756
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
4780
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _351 => _351.isEnded, 'call', _352 => _352()])) {
|
|
4757
4781
|
const duration = Date.now() - startTime;
|
|
4758
4782
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
4759
4783
|
}
|
|
@@ -4768,8 +4792,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4768
4792
|
res
|
|
4769
4793
|
);
|
|
4770
4794
|
}
|
|
4771
|
-
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess',
|
|
4772
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
4795
|
+
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _353 => _353.isEnded, 'call', _354 => _354()])) {
|
|
4796
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _355 => _355.isEnded, 'call', _356 => _356()])) {
|
|
4773
4797
|
const duration = Date.now() - startTime;
|
|
4774
4798
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
4775
4799
|
}
|
|
@@ -4788,8 +4812,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4788
4812
|
await pm.reportRuntimeRequestError(runtimeSession, error);
|
|
4789
4813
|
} else {
|
|
4790
4814
|
await pm.failRuntimeRequest(runtimeSession, error);
|
|
4791
|
-
if (!res.headersSent && !_optionalChain([responseInterceptor, 'optionalAccess',
|
|
4792
|
-
_optionalChain([responseInterceptor, 'optionalAccess',
|
|
4815
|
+
if (!res.headersSent && !_optionalChain([responseInterceptor, 'optionalAccess', _357 => _357.isEnded, 'call', _358 => _358()])) {
|
|
4816
|
+
_optionalChain([responseInterceptor, 'optionalAccess', _359 => _359.release, 'call', _360 => _360()]);
|
|
4793
4817
|
console.error("[FARM] Page error:", error);
|
|
4794
4818
|
sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
|
|
4795
4819
|
return;
|
|
@@ -4806,7 +4830,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4806
4830
|
}
|
|
4807
4831
|
})
|
|
4808
4832
|
);
|
|
4809
|
-
const farmRequestMiddleware = _optionalChain([farmMiddlewares, 'access',
|
|
4833
|
+
const farmRequestMiddleware = _optionalChain([farmMiddlewares, 'access', _361 => _361.stack, 'access', _362 => _362.at, 'call', _363 => _363(-1), 'optionalAccess', _364 => _364.handle]);
|
|
4810
4834
|
if (farmOwnsDevCors && viteServer.config.server.cors === false) {
|
|
4811
4835
|
farmMiddlewares.use(createFarmDevViteCorsMiddleware());
|
|
4812
4836
|
}
|
|
@@ -4835,7 +4859,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4835
4859
|
});
|
|
4836
4860
|
}
|
|
4837
4861
|
if (id.startsWith("@farm.js/core/internal/") && importer && isOutsideAppRoot(importer)) {
|
|
4838
|
-
const root = _optionalChain([farmApp, 'optionalAccess',
|
|
4862
|
+
const root = _optionalChain([farmApp, 'optionalAccess', _365 => _365.getConfig, 'call', _366 => _366(), 'access', _367 => _367.root]) || _optionalChain([server, 'optionalAccess', _368 => _368.config, 'access', _369 => _369.root]) || options.root;
|
|
4839
4863
|
return this.resolve(id, path6.join(root, "package.json"), {
|
|
4840
4864
|
...resolveOptions,
|
|
4841
4865
|
skipSelf: true
|
|
@@ -4863,7 +4887,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4863
4887
|
}
|
|
4864
4888
|
},
|
|
4865
4889
|
async load(id, loadOptions) {
|
|
4866
|
-
if (pendingClientSetup && !_optionalChain([loadOptions, 'optionalAccess',
|
|
4890
|
+
if (pendingClientSetup && !_optionalChain([loadOptions, 'optionalAccess', _370 => _370.ssr]) && !farmSetupContext.getStore()) {
|
|
4867
4891
|
await pendingClientSetup;
|
|
4868
4892
|
}
|
|
4869
4893
|
if (_chunkPIUTGRDIcjs.isFarmServerFnBoundaryId.call(void 0, id) && islandsServerFns()) {
|
|
@@ -4881,8 +4905,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4881
4905
|
if (imageModule) return imageModule;
|
|
4882
4906
|
}
|
|
4883
4907
|
if (_chunkYUCU6XB4cjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
|
|
4884
|
-
const renderer = _optionalChain([farmApp, 'optionalAccess',
|
|
4885
|
-
const root = _optionalChain([server, 'optionalAccess',
|
|
4908
|
+
const renderer = _optionalChain([farmApp, 'optionalAccess', _371 => _371.getConfig, 'call', _372 => _372(), 'access', _373 => _373.renderer]) || _chunkT7UC2ORAcjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
4909
|
+
const root = _optionalChain([server, 'optionalAccess', _374 => _374.config, 'access', _375 => _375.root]) || options.root;
|
|
4886
4910
|
if (isClientEnvironment(this, loadOptions)) {
|
|
4887
4911
|
return generateProgrammaticClientRouteModuleForId(
|
|
4888
4912
|
id,
|
|
@@ -4898,19 +4922,19 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4898
4922
|
return FARM_DEV_CLIENT_BOOT_MODULE;
|
|
4899
4923
|
}
|
|
4900
4924
|
if (isFarmClientVirtualId(id)) {
|
|
4901
|
-
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
4902
|
-
const renderer = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4903
|
-
const integrations = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4904
|
-
const root = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4905
|
-
const docs = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4925
|
+
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _376 => _376.getConfig, 'call', _377 => _377()]);
|
|
4926
|
+
const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _378 => _378.renderer]) || _chunkT7UC2ORAcjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
4927
|
+
const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _379 => _379.integrations]) || options.integrations;
|
|
4928
|
+
const root = _optionalChain([resolvedConfig, 'optionalAccess', _380 => _380.root]) || _optionalChain([server, 'optionalAccess', _381 => _381.config, 'access', _382 => _382.root]) || process.cwd();
|
|
4929
|
+
const docs = _optionalChain([resolvedConfig, 'optionalAccess', _383 => _383.docs]);
|
|
4906
4930
|
const adapterOwnsDocsRuntime = _chunkL2GUEYHRcjs.hasFarmDocsRuntimeAdapter.call(void 0, docs);
|
|
4907
|
-
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4931
|
+
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _384 => _384.devtools]), () => ( _chunkSTF6VDYQcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
|
|
4908
4932
|
const [docsRuntime, docsSearchRuntime, devtoolsClientRuntime] = await Promise.all([
|
|
4909
|
-
_optionalChain([docs, 'optionalAccess',
|
|
4910
|
-
_optionalChain([docs, 'optionalAccess',
|
|
4933
|
+
_optionalChain([docs, 'optionalAccess', _385 => _385.enabled]) ? loadFarmDocsDevRuntime() : null,
|
|
4934
|
+
_optionalChain([docs, 'optionalAccess', _386 => _386.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
|
|
4911
4935
|
devtools.enabled ? loadFarmDevtoolsClientRuntime() : null
|
|
4912
4936
|
]);
|
|
4913
|
-
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess',
|
|
4937
|
+
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _387 => _387.isFarmDocsSearchEnabled, 'call', _388 => _388(docs)]), () => ( false));
|
|
4914
4938
|
const generatedDocsSearchRuntime = docsSearchRuntime ? docsSearchRuntime.generateFarmDocsSearchClientRuntime(
|
|
4915
4939
|
docsSearchEnabled,
|
|
4916
4940
|
docsSearchEnabled ? docsSearchRuntime.resolveFarmDocsSearchClientModule(root) : void 0
|
|
@@ -4918,10 +4942,10 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4918
4942
|
const generatedDevtoolsClientRuntime = devtoolsClientRuntime ? devtoolsClientRuntime.generateFarmDevtoolsClientRuntime(devtools) : "";
|
|
4919
4943
|
const generatedDevIndicatorsClientRuntime = farmApp ? _chunkL2GUEYHRcjs.generateFarmDevIndicatorsClientRuntime.call(void 0, farmApp.getConfig().devIndicators) : "";
|
|
4920
4944
|
const integrationProviders = _chunkB3HQTGXScjs.getIntegrationProviders.call(void 0, integrations);
|
|
4921
|
-
const isolatedHydrationMode =
|
|
4922
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4945
|
+
const isolatedHydrationMode = _chunkPA3VZNWUcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
4946
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _389 => _389.experimental, 'optionalAccess', _390 => _390.isolatedClientHydration]),
|
|
4923
4947
|
{
|
|
4924
|
-
serverComponents: _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4948
|
+
serverComponents: _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _391 => _391.experimental, 'optionalAccess', _392 => _392.serverComponents])) === "rsc",
|
|
4925
4949
|
hasUnsupportedIntegrationProvider: integrationProviders.filter((provider) => provider.component || provider.type === "clerk").some((provider) => provider.supportsIsolatedHydration !== true)
|
|
4926
4950
|
}
|
|
4927
4951
|
);
|
|
@@ -4929,32 +4953,32 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
4929
4953
|
integrationProviders,
|
|
4930
4954
|
[
|
|
4931
4955
|
..._chunkB3HQTGXScjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
|
|
4932
|
-
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess',
|
|
4956
|
+
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _393 => _393.getFarmDocsDocumentNavigationMatchers, 'call', _394 => _394(docs)]), () => ( []))
|
|
4933
4957
|
],
|
|
4934
4958
|
generatedDocsSearchRuntime,
|
|
4935
4959
|
`${generatedDevtoolsClientRuntime}
|
|
4936
4960
|
${generatedDevIndicatorsClientRuntime}`,
|
|
4937
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4961
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _395 => _395.plugins]) || [],
|
|
4938
4962
|
root,
|
|
4939
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4940
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4941
|
-
adapterOwnsDocsRuntime ? _chunkL2GUEYHRcjs.getFarmDocsAdapterUIModule.call(void 0, _optionalChain([docs, 'optionalAccess',
|
|
4963
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _396 => _396.srcDir]) || options.srcDir || "src",
|
|
4964
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _397 => _397.publicRuntimeConfig]) || options.publicRuntimeConfig,
|
|
4965
|
+
adapterOwnsDocsRuntime ? _chunkL2GUEYHRcjs.getFarmDocsAdapterUIModule.call(void 0, _optionalChain([docs, 'optionalAccess', _398 => _398.adapter])) : void 0,
|
|
4942
4966
|
renderer,
|
|
4943
|
-
isolatedHydrationMode === "enabled" || _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
4944
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4945
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4946
|
-
|
|
4947
|
-
|
|
4967
|
+
isolatedHydrationMode === "enabled" || _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _399 => _399.getRouteManager, 'call', _400 => _400(), 'access', _401 => _401.getIsolatedClientBoundaryModules, 'call', _402 => _402(root)])))), 'optionalAccess', _403 => _403.size]) > 0,
|
|
4968
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _404 => _404.trailingSlash]), () => ( false)),
|
|
4969
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _405 => _405.basePath]), () => ( "/")),
|
|
4970
|
+
_chunkPQ6DBVJ2cjs.generateClientCachePersistenceCode.call(void 0,
|
|
4971
|
+
_chunkPQ6DBVJ2cjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, _optionalChain([resolvedConfig, 'optionalAccess', _406 => _406.cache]))
|
|
4948
4972
|
),
|
|
4949
4973
|
adapterOwnsDocsRuntime ? _chunkXJDB564Acjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0,
|
|
4950
|
-
_chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4974
|
+
_chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _407 => _407.experimental, 'optionalAccess', _408 => _408.serverComponents])) === "islands"
|
|
4951
4975
|
);
|
|
4952
4976
|
}
|
|
4953
4977
|
if (id === "/@farm/server") {
|
|
4954
4978
|
return generateServerCode();
|
|
4955
4979
|
}
|
|
4956
4980
|
if (id === "/@farm/manifest") {
|
|
4957
|
-
const routeManager = _optionalChain([farmApp, 'optionalAccess',
|
|
4981
|
+
const routeManager = _optionalChain([farmApp, 'optionalAccess', _409 => _409.getRouteManager, 'call', _410 => _410()]);
|
|
4958
4982
|
if (!routeManager) {
|
|
4959
4983
|
return `
|
|
4960
4984
|
export const getManifest = () => ({
|
|
@@ -4966,11 +4990,11 @@ export const getManifest = () => ({
|
|
|
4966
4990
|
});
|
|
4967
4991
|
`;
|
|
4968
4992
|
}
|
|
4969
|
-
const globalStylesheetHref =
|
|
4993
|
+
const globalStylesheetHref = _chunkPQ6DBVJ2cjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
4970
4994
|
server.config.root,
|
|
4971
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
4995
|
+
_optionalChain([farmApp, 'optionalAccess', _411 => _411.getConfig, 'call', _412 => _412(), 'access', _413 => _413.srcDir])
|
|
4972
4996
|
);
|
|
4973
|
-
const fullManifest =
|
|
4997
|
+
const fullManifest = _chunkPQ6DBVJ2cjs.createFarmDevClientManifest.call(void 0,
|
|
4974
4998
|
routeManager.generateClientManifest(server.config.root),
|
|
4975
4999
|
{
|
|
4976
5000
|
sharedAssets: globalStylesheetHref ? [{ tag: "link", attrs: { rel: "stylesheet", href: globalStylesheetHref } }] : []
|
|
@@ -4986,64 +5010,64 @@ export { manifest };
|
|
|
4986
5010
|
}
|
|
4987
5011
|
},
|
|
4988
5012
|
async transform(code, id, transformOptions) {
|
|
4989
|
-
if (pendingClientSetup && !_optionalChain([transformOptions, 'optionalAccess',
|
|
5013
|
+
if (pendingClientSetup && !_optionalChain([transformOptions, 'optionalAccess', _414 => _414.ssr]) && !farmSetupContext.getStore()) {
|
|
4990
5014
|
await pendingClientSetup;
|
|
4991
5015
|
}
|
|
4992
|
-
const runtimeModule = !isBuild && _optionalChain([transformOptions, 'optionalAccess',
|
|
4993
|
-
const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
5016
|
+
const runtimeModule = !isBuild && _optionalChain([transformOptions, 'optionalAccess', _415 => _415.ssr]) === true && isOutsideAppRoot(id) ? toFarmRuntimeModuleId : void 0;
|
|
5017
|
+
const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _416 => _416.getConfig, 'call', _417 => _417()]), () => ( options));
|
|
4994
5018
|
let rewrotePackageImports = false;
|
|
4995
|
-
if (_chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access',
|
|
5019
|
+
if (_chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access', _418 => _418.experimental, 'optionalAccess', _419 => _419.serverComponents])) === "islands" && (!id.includes("/node_modules/") || _optionalChain([transformOptions, 'optionalAccess', _420 => _420.ssr]) === true && farmReactServerFiles.has(id.split("?", 1)[0])) && !id.startsWith("\0") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id) && !_chunkPA3VZNWUcjs.hasUseClientDirective.call(void 0, code)) {
|
|
4996
5020
|
const file = id.split("?", 1)[0];
|
|
4997
|
-
const projectRoot = actionConfig.root || _optionalChain([server, 'optionalAccess',
|
|
5021
|
+
const projectRoot = actionConfig.root || _optionalChain([server, 'optionalAccess', _421 => _421.config, 'access', _422 => _422.root]) || process.cwd();
|
|
4998
5022
|
const buildSnapshot = isBuild ? options.sourceSnapshot : void 0;
|
|
4999
5023
|
const rewrite = () => {
|
|
5000
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
5024
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _423 => _423.ssr]) === true) {
|
|
5001
5025
|
if (farmReactServerFiles.has(file)) {
|
|
5002
|
-
for (const child of
|
|
5026
|
+
for (const child of _chunkPA3VZNWUcjs.farmRelativeImportFiles.call(void 0, code, file))
|
|
5003
5027
|
farmReactServerFiles.add(child);
|
|
5004
5028
|
}
|
|
5005
|
-
const serverModule = farmReactServerFiles.has(file) || !
|
|
5029
|
+
const serverModule = farmReactServerFiles.has(file) || !_chunkPA3VZNWUcjs.getFarmClientReachableModules.call(void 0,
|
|
5006
5030
|
path6.resolve(projectRoot, actionConfig.srcDir || "src"),
|
|
5007
5031
|
projectRoot
|
|
5008
5032
|
).has(path6.resolve(file));
|
|
5009
|
-
const reactServer = !serverModule ? null :
|
|
5033
|
+
const reactServer = !serverModule ? null : _chunkPA3VZNWUcjs.rewriteFarmReactServerImports.call(void 0, {
|
|
5010
5034
|
code,
|
|
5011
5035
|
file,
|
|
5012
|
-
reference: (specifier, exportName) =>
|
|
5036
|
+
reference: (specifier, exportName) => _chunkPA3VZNWUcjs.ensureFarmPackageClientReference.call(void 0, projectRoot, specifier, exportName, file),
|
|
5013
5037
|
onServerFile: (serverFile) => farmReactServerFiles.add(serverFile)
|
|
5014
5038
|
});
|
|
5015
5039
|
if (reactServer !== null) {
|
|
5016
5040
|
code = reactServer;
|
|
5017
5041
|
rewrotePackageImports = true;
|
|
5018
5042
|
}
|
|
5019
|
-
const internal = farmReactServerFiles.has(file) ?
|
|
5043
|
+
const internal = farmReactServerFiles.has(file) ? _chunkPA3VZNWUcjs.rewriteFarmReactServerClientModuleImports.call(void 0, {
|
|
5020
5044
|
code,
|
|
5021
5045
|
file,
|
|
5022
|
-
reference: (clientFile) =>
|
|
5046
|
+
reference: (clientFile) => _chunkPA3VZNWUcjs.ensureFarmInternalClientReference.call(void 0, projectRoot, clientFile)
|
|
5023
5047
|
}) : null;
|
|
5024
5048
|
if (internal !== null) {
|
|
5025
5049
|
code = internal;
|
|
5026
5050
|
rewrotePackageImports = true;
|
|
5027
5051
|
}
|
|
5028
5052
|
}
|
|
5029
|
-
const rewritePackageImports = (source2) =>
|
|
5053
|
+
const rewritePackageImports = (source2) => _chunkPA3VZNWUcjs.rewriteFarmPackageClientImports.call(void 0, {
|
|
5030
5054
|
code: source2,
|
|
5031
5055
|
file,
|
|
5032
5056
|
root: projectRoot,
|
|
5033
|
-
isClientPackage: (specifier) =>
|
|
5057
|
+
isClientPackage: (specifier) => _chunkPA3VZNWUcjs.isFarmPackageClientBoundary.call(void 0, file, specifier, projectRoot)
|
|
5034
5058
|
});
|
|
5035
|
-
const routeManager = _optionalChain([farmApp, 'optionalAccess',
|
|
5059
|
+
const routeManager = _optionalChain([farmApp, 'optionalAccess', _424 => _424.getRouteManager, 'call', _425 => _425()]);
|
|
5036
5060
|
const source = code;
|
|
5037
5061
|
const referenced = routeManager ? routeManager.inspectPackages(() => rewritePackageImports(source)) : rewritePackageImports(source);
|
|
5038
5062
|
if (referenced !== null) {
|
|
5039
5063
|
code = referenced;
|
|
5040
5064
|
rewrotePackageImports = true;
|
|
5041
5065
|
}
|
|
5042
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
5066
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _426 => _426.ssr]) === true) {
|
|
5043
5067
|
const cached = rewriteFarmReactCacheImport(
|
|
5044
5068
|
code,
|
|
5045
5069
|
file,
|
|
5046
|
-
_optionalChain([runtimeModule, 'optionalCall',
|
|
5070
|
+
_optionalChain([runtimeModule, 'optionalCall', _427 => _427(FARM_REACT_CACHE_MODULE)])
|
|
5047
5071
|
);
|
|
5048
5072
|
if (cached !== null) {
|
|
5049
5073
|
code = cached;
|
|
@@ -5051,12 +5075,12 @@ export { manifest };
|
|
|
5051
5075
|
}
|
|
5052
5076
|
}
|
|
5053
5077
|
};
|
|
5054
|
-
if (buildSnapshot)
|
|
5078
|
+
if (buildSnapshot) _chunkPA3VZNWUcjs.withFarmSourceSnapshotOf.call(void 0, buildSnapshot, rewrite);
|
|
5055
5079
|
else rewrite();
|
|
5056
5080
|
}
|
|
5057
5081
|
if (islandsServerFns() && !_chunkPIUTGRDIcjs.isFarmServerFnBoundaryId.call(void 0, id) && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
|
|
5058
5082
|
const serverFns = _chunkPIUTGRDIcjs.transformFarmServerFns.call(void 0, code, id, {
|
|
5059
|
-
environment: _optionalChain([transformOptions, 'optionalAccess',
|
|
5083
|
+
environment: _optionalChain([transformOptions, 'optionalAccess', _428 => _428.ssr]) === true ? "rsc" : "client"
|
|
5060
5084
|
});
|
|
5061
5085
|
if (serverFns) {
|
|
5062
5086
|
if (!serverFns.code.includes("use server")) return { code: serverFns.code, map: null };
|
|
@@ -5069,8 +5093,8 @@ export { manifest };
|
|
|
5069
5093
|
const actionModule = transformFarmFormActionModule({
|
|
5070
5094
|
code,
|
|
5071
5095
|
id,
|
|
5072
|
-
root: actionConfig.root || _optionalChain([server, 'optionalAccess',
|
|
5073
|
-
ssr: _optionalChain([transformOptions, 'optionalAccess',
|
|
5096
|
+
root: actionConfig.root || _optionalChain([server, 'optionalAccess', _429 => _429.config, 'access', _430 => _430.root]) || process.cwd(),
|
|
5097
|
+
ssr: _optionalChain([transformOptions, 'optionalAccess', _431 => _431.ssr]) === true,
|
|
5074
5098
|
// Parsed by file type: page components are TSX.
|
|
5075
5099
|
parse: (source) => _vite.parseSync.call(void 0, file, source).program,
|
|
5076
5100
|
runtimeModule,
|
|
@@ -5078,21 +5102,21 @@ export { manifest };
|
|
|
5078
5102
|
});
|
|
5079
5103
|
if (actionModule) return { code: actionModule, map: null };
|
|
5080
5104
|
}
|
|
5081
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
5082
|
-
const docsConfigModule = _chunkXJDB564Acjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess',
|
|
5083
|
-
if (
|
|
5084
|
-
const redacted =
|
|
5105
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _432 => _432.ssr])) {
|
|
5106
|
+
const docsConfigModule = _chunkXJDB564Acjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess', _433 => _433.getConfig, 'call', _434 => _434(), 'optionalAccess', _435 => _435.docs]));
|
|
5107
|
+
if (_chunkPQ6DBVJ2cjs.isFarmDocsClientConfigModule.call(void 0, id, docsConfigModule)) {
|
|
5108
|
+
const redacted = _chunkPQ6DBVJ2cjs.redactFarmDocsClientConfig.call(void 0, code, id.split("?")[0]);
|
|
5085
5109
|
if (redacted !== null) return { code: redacted, map: null };
|
|
5086
5110
|
}
|
|
5087
5111
|
}
|
|
5088
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
5089
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
5090
|
-
if ((_optionalChain([currentConfig, 'access',
|
|
5112
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _436 => _436.ssr])) {
|
|
5113
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _437 => _437.getConfig, 'call', _438 => _438()]), () => ( options));
|
|
5114
|
+
if ((_optionalChain([currentConfig, 'access', _439 => _439.experimental, 'optionalAccess', _440 => _440.serverActions]) !== true || !serverFnTransformActive) && !islandsServerFns()) {
|
|
5091
5115
|
const violation = findClientServerFnViolation(code, id);
|
|
5092
5116
|
if (violation) {
|
|
5093
|
-
const locate =
|
|
5117
|
+
const locate = _chunkPA3VZNWUcjs.createFarmSourceLocator.call(void 0, code, () => this.getCombinedSourcemap());
|
|
5094
5118
|
this.error(
|
|
5095
|
-
|
|
5119
|
+
_chunkPA3VZNWUcjs.formatFarmDiagnostic.call(void 0,
|
|
5096
5120
|
createServerFnBoundaryDiagnostic(violation, id, locate(violation.start)),
|
|
5097
5121
|
currentConfig.root
|
|
5098
5122
|
)
|
|
@@ -5100,8 +5124,8 @@ export { manifest };
|
|
|
5100
5124
|
}
|
|
5101
5125
|
}
|
|
5102
5126
|
}
|
|
5103
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
5104
|
-
await warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
5127
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _441 => _441.ssr]) && shouldInspectClientBoundary(id, code)) {
|
|
5128
|
+
await warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _442 => _442.getConfig, 'call', _443 => _443()]), () => ( options)));
|
|
5105
5129
|
}
|
|
5106
5130
|
if (typeof imageImports.transform === "function") {
|
|
5107
5131
|
const imageModule = await imageImports.transform.call(this, code, id, transformOptions);
|
|
@@ -5116,13 +5140,13 @@ export { manifest };
|
|
|
5116
5140
|
id,
|
|
5117
5141
|
transformOptions
|
|
5118
5142
|
);
|
|
5119
|
-
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess',
|
|
5143
|
+
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _444 => _444.code, 'optionalAccess', _445 => _445.toString, 'call', _446 => _446()]);
|
|
5120
5144
|
if (fontCode) {
|
|
5121
5145
|
transformedCode = fontCode;
|
|
5122
5146
|
transformed = true;
|
|
5123
5147
|
}
|
|
5124
5148
|
}
|
|
5125
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
5149
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _447 => _447.ssr]) && server) {
|
|
5126
5150
|
const rewrittenImports = rewriteEarlySsrRelativeImports({
|
|
5127
5151
|
code: transformedCode,
|
|
5128
5152
|
id,
|
|
@@ -5134,27 +5158,27 @@ export { manifest };
|
|
|
5134
5158
|
transformed = true;
|
|
5135
5159
|
}
|
|
5136
5160
|
}
|
|
5137
|
-
if (
|
|
5161
|
+
if (_chunkPA3VZNWUcjs.hasUseClientDirective.call(void 0, transformedCode)) {
|
|
5138
5162
|
const clientBoundarySource = transformedCode;
|
|
5139
5163
|
const moduleInfo = this.getModuleInfo(id);
|
|
5140
5164
|
if (moduleInfo) {
|
|
5141
5165
|
moduleInfo.isClientComponent = true;
|
|
5142
5166
|
}
|
|
5143
|
-
transformedCode =
|
|
5167
|
+
transformedCode = _chunkPA3VZNWUcjs.stripUseClientDirective.call(void 0, transformedCode);
|
|
5144
5168
|
transformed = true;
|
|
5145
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
5169
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _448 => _448.getConfig, 'call', _449 => _449()]), () => ( options));
|
|
5146
5170
|
let isolatedModuleReference = null;
|
|
5147
5171
|
let rendererIslandModule = false;
|
|
5148
|
-
const root = currentConfig.root || _optionalChain([server, 'optionalAccess',
|
|
5172
|
+
const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _450 => _450.config, 'access', _451 => _451.root]) || process.cwd();
|
|
5149
5173
|
const cleanId = id.split("?", 1)[0];
|
|
5150
|
-
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
5151
|
-
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess',
|
|
5152
|
-
if (_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, _chunkT7UC2ORAcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && (
|
|
5153
|
-
cleanId.replace(/\\/g, "/").includes(
|
|
5174
|
+
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _452 => _452.getRouteManager, 'call', _453 => _453(), 'access', _454 => _454.getIsolatedClientBoundaryModules, 'call', _455 => _455(root)])));
|
|
5175
|
+
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _456 => _456.has, 'call', _457 => _457(path6.resolve(cleanId))]) === true;
|
|
5176
|
+
if (_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, _chunkT7UC2ORAcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && (_chunkPA3VZNWUcjs.isIsolatableClientBoundarySource.call(void 0, clientBoundarySource) || // A generated client reference, whose marker comment compiled TSX no longer has.
|
|
5177
|
+
cleanId.replace(/\\/g, "/").includes(_chunkPA3VZNWUcjs.FARM_CLIENT_REFERENCE_DIRECTORY))) {
|
|
5154
5178
|
isolatedModuleReference = _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, cleanId, root);
|
|
5155
|
-
const islandsMode = _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([currentConfig, 'access',
|
|
5156
|
-
const explicitStrategy =
|
|
5157
|
-
const inference = islandsMode && explicitStrategy === null ?
|
|
5179
|
+
const islandsMode = _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([currentConfig, 'access', _458 => _458.experimental, 'optionalAccess', _459 => _459.serverComponents])) === "islands";
|
|
5180
|
+
const explicitStrategy = _chunkPA3VZNWUcjs.getIslandStrategyExport.call(void 0, clientBoundarySource);
|
|
5181
|
+
const inference = islandsMode && explicitStrategy === null ? _chunkPQ6DBVJ2cjs.inferFarmIslandStrategy.call(void 0, cleanId, root) : null;
|
|
5158
5182
|
if (inference) {
|
|
5159
5183
|
for (const file of inference.files) {
|
|
5160
5184
|
if (file !== path6.resolve(cleanId)) this.addWatchFile(file);
|
|
@@ -5167,8 +5191,8 @@ export { manifest };
|
|
|
5167
5191
|
islandStrategy: _nullishCoalesce(explicitStrategy, () => ( "load")),
|
|
5168
5192
|
parse: (source) => this.parse(source),
|
|
5169
5193
|
slots: islandsMode,
|
|
5170
|
-
browser: _optionalChain([transformOptions, 'optionalAccess',
|
|
5171
|
-
inferredInteraction: _optionalChain([inference, 'optionalAccess',
|
|
5194
|
+
browser: _optionalChain([transformOptions, 'optionalAccess', _460 => _460.ssr]) !== true,
|
|
5195
|
+
inferredInteraction: _optionalChain([inference, 'optionalAccess', _461 => _461.strategy]) === "interaction",
|
|
5172
5196
|
runtimeModule
|
|
5173
5197
|
});
|
|
5174
5198
|
if (!transformedBoundary) {
|
|
@@ -5177,14 +5201,14 @@ export { manifest };
|
|
|
5177
5201
|
);
|
|
5178
5202
|
}
|
|
5179
5203
|
transformedCode = transformedBoundary;
|
|
5180
|
-
} else if (selectedForIsolatedHydration &&
|
|
5204
|
+
} else if (selectedForIsolatedHydration && _chunkZ43CIBURcjs.usesFarmRendererIslands.call(void 0, currentConfig) && (_chunkPA3VZNWUcjs.isIsolatableClientBoundarySource.call(void 0, clientBoundarySource) || cleanId.replace(/\\/g, "/").includes(_chunkPA3VZNWUcjs.FARM_CLIENT_REFERENCE_DIRECTORY))) {
|
|
5181
5205
|
rendererIslandModule = true;
|
|
5182
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
5206
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _462 => _462.ssr]) === true) {
|
|
5183
5207
|
const renderer = _chunkT7UC2ORAcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer);
|
|
5184
5208
|
const transformedBoundary = transformIsolatedClientBoundaryModule({
|
|
5185
5209
|
code: transformedCode,
|
|
5186
5210
|
moduleReference: _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, cleanId, root),
|
|
5187
|
-
islandStrategy: _nullishCoalesce(
|
|
5211
|
+
islandStrategy: _nullishCoalesce(_chunkPA3VZNWUcjs.getIslandStrategyExport.call(void 0, clientBoundarySource), () => ( "load")),
|
|
5188
5212
|
parse: (source) => this.parse(source),
|
|
5189
5213
|
withIsland: renderer.server
|
|
5190
5214
|
});
|
|
@@ -5217,7 +5241,17 @@ export { manifest };
|
|
|
5217
5241
|
);
|
|
5218
5242
|
return;
|
|
5219
5243
|
}` : "";
|
|
5220
|
-
const
|
|
5244
|
+
const rendererIslandHmr = rendererIslandModule && !_optionalChain([transformOptions, 'optionalAccess', _463 => _463.ssr]) && !/\bimport\.meta\.hot\b/.test(transformedCode) && shouldEmitFarmClientRootHmr(currentConfig.renderer);
|
|
5245
|
+
const hmrCode = rendererIslandHmr ? `
|
|
5246
|
+
if (import.meta.hot) {
|
|
5247
|
+
import.meta.hot.accept((newModule) => {
|
|
5248
|
+
const runtime = window.__FARM_ISOLATED_HYDRATION_RUNTIME__;
|
|
5249
|
+
if (!newModule || !runtime?.updateModule?.(${JSON.stringify(_chunk7U4XF76Rcjs.toViteModuleId.call(void 0, cleanId, root))}, newModule)) {
|
|
5250
|
+
import.meta.hot.invalidate();
|
|
5251
|
+
}
|
|
5252
|
+
});
|
|
5253
|
+
}
|
|
5254
|
+
` : _optionalChain([transformOptions, 'optionalAccess', _464 => _464.ssr]) || reactRefreshActive || rendererIslandModule || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
|
|
5221
5255
|
if (import.meta.hot) {
|
|
5222
5256
|
import.meta.hot.accept((newModule) => {
|
|
5223
5257
|
${isolatedHmrUpdate}
|
|
@@ -5273,14 +5307,14 @@ if (import.meta.hot) {
|
|
|
5273
5307
|
}
|
|
5274
5308
|
_chunk7U4XF76Rcjs.logger.info(`Found ${ssgPages.length} SSG pages, ${ssrRoutes.length} SSR routes`);
|
|
5275
5309
|
_chunk7U4XF76Rcjs.logger.info("Pre-rendering SSG pages...");
|
|
5276
|
-
const outDir = path6.join(_optionalChain([server, 'optionalAccess',
|
|
5310
|
+
const outDir = path6.join(_optionalChain([server, 'optionalAccess', _465 => _465.config, 'access', _466 => _466.root]) || process.cwd(), options.outDir || "dist");
|
|
5277
5311
|
const clientDir = path6.join(outDir, "client");
|
|
5278
5312
|
for (const page of ssgPages) {
|
|
5279
5313
|
try {
|
|
5280
5314
|
const staticRequest = new Request(new URL(page.urlPath, "http://farm.static"));
|
|
5281
5315
|
await farmApp.getServerRenderer().runWithRequestContext(staticRequest, async () => {
|
|
5282
5316
|
const mod = await routeManager.loadRouteModule(page.filePath);
|
|
5283
|
-
if (!_optionalChain([mod, 'optionalAccess',
|
|
5317
|
+
if (!_optionalChain([mod, 'optionalAccess', _467 => _467.default])) return;
|
|
5284
5318
|
const { layouts } = routeManager.matchRoute(page.urlPath);
|
|
5285
5319
|
const layoutModules = await Promise.all(
|
|
5286
5320
|
layouts.map((l) => routeManager.loadLayoutModule(l.modulePath))
|
|
@@ -5312,7 +5346,7 @@ if (import.meta.hot) {
|
|
|
5312
5346
|
const i18nSnapshot = _chunkSXXSQVKKcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
5313
5347
|
const i18nHead = renderFarmI18nStaticHead(page.urlPath, i18nSnapshot);
|
|
5314
5348
|
const fullHtml = `<!DOCTYPE html>
|
|
5315
|
-
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
5349
|
+
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _468 => _468.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
|
|
5316
5350
|
<head>
|
|
5317
5351
|
<meta charset="utf-8">
|
|
5318
5352
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
@@ -5357,12 +5391,12 @@ if (import.meta.hot) {
|
|
|
5357
5391
|
watchChange(id, change) {
|
|
5358
5392
|
const watched = _chunk7U4XF76Rcjs.toPosixPath.call(void 0, id);
|
|
5359
5393
|
if (!watched.includes("/node_modules/") && !isFarmGeneratedOutput(watched)) {
|
|
5360
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
5394
|
+
_optionalChain([farmApp, 'optionalAccess', _469 => _469.getRouteManager, 'call', _470 => _470(), 'access', _471 => _471.noteSourceChange, 'call', _472 => _472(id, change.event)]);
|
|
5361
5395
|
}
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
|
|
5365
|
-
|
|
5396
|
+
_chunkPA3VZNWUcjs.invalidateFarmClientReachableModules.call(void 0, );
|
|
5397
|
+
_chunkPA3VZNWUcjs.invalidateFarmClientOnlyScan.call(void 0, );
|
|
5398
|
+
_chunkPQ6DBVJ2cjs.invalidateFarmRouteRootInferences.call(void 0, );
|
|
5399
|
+
_chunkPA3VZNWUcjs.dropLatestPackageClientBoundaryCache.call(void 0, );
|
|
5366
5400
|
},
|
|
5367
5401
|
async handleHotUpdate(ctx) {
|
|
5368
5402
|
if (pendingClientSetup && !farmSetupContext.getStore()) await pendingClientSetup;
|
|
@@ -5387,7 +5421,7 @@ if (import.meta.hot) {
|
|
|
5387
5421
|
server2.moduleGraph.invalidateModule(mod);
|
|
5388
5422
|
}
|
|
5389
5423
|
}
|
|
5390
|
-
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
5424
|
+
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _473 => _473.getConfig, 'call', _474 => _474()]);
|
|
5391
5425
|
const normalizedFile = file.replace(/\\/g, "/");
|
|
5392
5426
|
const reloadAfterEdit = () => {
|
|
5393
5427
|
for (const files of pendingRouteReloads) {
|
|
@@ -5395,18 +5429,21 @@ if (import.meta.hot) {
|
|
|
5395
5429
|
}
|
|
5396
5430
|
server2.ws.send({ type: "full-reload", path: "*" });
|
|
5397
5431
|
};
|
|
5398
|
-
if (normalizedFile.includes(
|
|
5432
|
+
if (normalizedFile.includes(_chunkPA3VZNWUcjs.FARM_CLIENT_REFERENCE_DIRECTORY) && normalizedFile.startsWith(
|
|
5399
5433
|
path6.posix.join(
|
|
5400
|
-
_chunk7U4XF76Rcjs.toPosixPath.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
5401
|
-
|
|
5434
|
+
_chunk7U4XF76Rcjs.toPosixPath.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _475 => _475.root]) || options.root || server2.config.root),
|
|
5435
|
+
_chunkPA3VZNWUcjs.FARM_CLIENT_REFERENCE_DIRECTORY
|
|
5402
5436
|
)
|
|
5403
5437
|
))
|
|
5404
5438
|
return modules;
|
|
5405
|
-
if (currentFarmConfig &&
|
|
5439
|
+
if (currentFarmConfig && _chunkBQHIJOZMcjs.isFarmAPIRouteFileName.call(void 0,
|
|
5440
|
+
path6.posix.basename(normalizedFile),
|
|
5441
|
+
_chunkBQHIJOZMcjs.hasPolyroutePlugin.call(void 0, server2.config.plugins)
|
|
5442
|
+
) && _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, currentFarmConfig).some(
|
|
5406
5443
|
(appDir) => normalizedFile.startsWith(`${_chunk7U4XF76Rcjs.toPosixPath.call(void 0, appDir)}/api/`)
|
|
5407
5444
|
)) {
|
|
5408
5445
|
for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
|
|
5409
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
5446
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _476 => _476(`updated ${file}`)]);
|
|
5410
5447
|
reloadAfterEdit();
|
|
5411
5448
|
return [];
|
|
5412
5449
|
}
|
|
@@ -5416,7 +5453,7 @@ if (import.meta.hot) {
|
|
|
5416
5453
|
for (const mod of modules) {
|
|
5417
5454
|
server2.moduleGraph.invalidateModule(mod);
|
|
5418
5455
|
}
|
|
5419
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
5456
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _477 => _477(`updated ${file}`)]);
|
|
5420
5457
|
reloadAfterEdit();
|
|
5421
5458
|
return [];
|
|
5422
5459
|
}
|
|
@@ -5426,22 +5463,22 @@ if (import.meta.hot) {
|
|
|
5426
5463
|
for (const mod of modules) {
|
|
5427
5464
|
server2.moduleGraph.invalidateModule(mod);
|
|
5428
5465
|
}
|
|
5429
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
5466
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _478 => _478(`updated ${file}`)]);
|
|
5430
5467
|
reloadAfterEdit();
|
|
5431
5468
|
return [];
|
|
5432
5469
|
}
|
|
5433
|
-
if (apiRouteManager &&
|
|
5434
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
5470
|
+
if (apiRouteManager && _chunkI2RBHZF7cjs.invalidateFarmDevDependents.call(void 0, server2, file, apiRouteManager.getSourceFiles()).length > 0) {
|
|
5471
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _479 => _479(`updated ${file}`)]);
|
|
5435
5472
|
}
|
|
5436
|
-
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
5437
|
-
const planRouteManager = _optionalChain([farmApp, 'optionalAccess',
|
|
5473
|
+
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _480 => _480.experimental, 'optionalAccess', _481 => _481.isolatedClientHydration]);
|
|
5474
|
+
const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _482 => _482.getRouteManager, 'call', _483 => _483()]);
|
|
5438
5475
|
const isHydrationPlanSource = /\.[cm]?[jt]sx?$/.test(normalizedFile) && !normalizedFile.includes("/node_modules/") && !isFarmGeneratedOutput(normalizedFile);
|
|
5439
|
-
const tracksAsyncOwnerIslands = _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
5476
|
+
const tracksAsyncOwnerIslands = _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _484 => _484.renderer])) && planRouteManager !== void 0;
|
|
5440
5477
|
let clientPlanCurrent = false;
|
|
5441
5478
|
if (isHydrationPlanSource && (isolatedHydrationMode === "enabled" || isolatedHydrationMode === "analyze" || tracksAsyncOwnerIslands)) {
|
|
5442
5479
|
const routeManager = planRouteManager;
|
|
5443
|
-
await _optionalChain([ctx, 'access',
|
|
5444
|
-
if (_optionalChain([routeManager, 'optionalAccess',
|
|
5480
|
+
await _optionalChain([ctx, 'access', _485 => _485.read, 'optionalCall', _486 => _486()]);
|
|
5481
|
+
if (_optionalChain([routeManager, 'optionalAccess', _487 => _487.isEditPlanNeutral, 'call', _488 => _488(file)])) {
|
|
5445
5482
|
clientPlanCurrent = true;
|
|
5446
5483
|
} else if (routeManager) {
|
|
5447
5484
|
routeManager.noteSourceChange(file, "update");
|
|
@@ -5485,7 +5522,7 @@ if (import.meta.hot) {
|
|
|
5485
5522
|
}
|
|
5486
5523
|
}
|
|
5487
5524
|
}
|
|
5488
|
-
const rendererRouteFile = _optionalChain([farmApp, 'optionalAccess',
|
|
5525
|
+
const rendererRouteFile = _optionalChain([farmApp, 'optionalAccess', _489 => _489.getRouteManager, 'call', _490 => _490(), 'access', _491 => _491.isRendererRouteModule, 'call', _492 => _492(normalizedFile)]) === true;
|
|
5489
5526
|
if (normalizedFile.includes("/app/") || rendererRouteFile) {
|
|
5490
5527
|
if (normalizedFile.includes("middleware.")) {
|
|
5491
5528
|
if (middlewareManager) {
|
|
@@ -5503,7 +5540,7 @@ if (import.meta.hot) {
|
|
|
5503
5540
|
}
|
|
5504
5541
|
return [];
|
|
5505
5542
|
}
|
|
5506
|
-
if (!clientPlanCurrent) _optionalChain([farmApp, 'optionalAccess',
|
|
5543
|
+
if (!clientPlanCurrent) _optionalChain([farmApp, 'optionalAccess', _493 => _493.getRouteManager, 'call', _494 => _494(), 'access', _495 => _495.invalidateClientManifest, 'call', _496 => _496()]);
|
|
5507
5544
|
const manifestModule = server2.moduleGraph.getModuleById("/@farm/manifest");
|
|
5508
5545
|
if (manifestModule) {
|
|
5509
5546
|
server2.moduleGraph.invalidateModule(manifestModule);
|
|
@@ -5518,7 +5555,15 @@ if (import.meta.hot) {
|
|
|
5518
5555
|
return [];
|
|
5519
5556
|
}
|
|
5520
5557
|
}
|
|
5521
|
-
if (
|
|
5558
|
+
if (currentFarmConfig && planRouteManager && _chunkZ43CIBURcjs.usesFarmRendererIslands.call(void 0, currentFarmConfig) && shouldEmitFarmClientRootHmr(currentFarmConfig.renderer) && reachesSharedFarmRendererIsland(
|
|
5559
|
+
_optionalChain([server2, 'access', _497 => _497.environments, 'access', _498 => _498.client, 'optionalAccess', _499 => _499.moduleGraph]),
|
|
5560
|
+
normalizedFile,
|
|
5561
|
+
planRouteManager.getIsolatedClientBoundaryModules(currentFarmConfig.root)
|
|
5562
|
+
)) {
|
|
5563
|
+
reloadAfterEdit();
|
|
5564
|
+
return [];
|
|
5565
|
+
}
|
|
5566
|
+
if (/\.[cm]?[jt]sx?$/.test(normalizedFile) && !_optionalChain([server2, 'access', _500 => _500.environments, 'access', _501 => _501.client, 'optionalAccess', _502 => _502.moduleGraph, 'access', _503 => _503.getModulesByFile, 'call', _504 => _504(normalizedFile), 'optionalAccess', _505 => _505.size]) && _chunkI2RBHZF7cjs.invalidateFarmDevDependents.call(void 0, server2, file, getFarmRenderedServerModules()).length > 0) {
|
|
5522
5567
|
logUpdate("PAGE", `updated ${path6.basename(file)}`);
|
|
5523
5568
|
reloadAfterEdit();
|
|
5524
5569
|
return [];
|
|
@@ -5616,7 +5661,7 @@ function createPageDataMiddlewareResponse(res) {
|
|
|
5616
5661
|
return (...args) => {
|
|
5617
5662
|
if (captures(target.statusCode, target.getHeader("location"))) {
|
|
5618
5663
|
const callback = args.find((arg) => typeof arg === "function");
|
|
5619
|
-
_optionalChain([callback, 'optionalCall',
|
|
5664
|
+
_optionalChain([callback, 'optionalCall', _506 => _506()]);
|
|
5620
5665
|
return property === "write" ? true : response;
|
|
5621
5666
|
}
|
|
5622
5667
|
return target[property](...args);
|
|
@@ -5680,12 +5725,12 @@ function isFarmClientVirtualId(id) {
|
|
|
5680
5725
|
}
|
|
5681
5726
|
function isClientEnvironment(context, loadOptions) {
|
|
5682
5727
|
const environment = context.environment;
|
|
5683
|
-
if (_optionalChain([environment, 'optionalAccess',
|
|
5684
|
-
if (_optionalChain([environment, 'optionalAccess',
|
|
5685
|
-
return _optionalChain([loadOptions, 'optionalAccess',
|
|
5728
|
+
if (_optionalChain([environment, 'optionalAccess', _507 => _507.config, 'optionalAccess', _508 => _508.consumer])) return environment.config.consumer === "client";
|
|
5729
|
+
if (_optionalChain([environment, 'optionalAccess', _509 => _509.name])) return environment.name === "client";
|
|
5730
|
+
return _optionalChain([loadOptions, 'optionalAccess', _510 => _510.ssr]) !== true;
|
|
5686
5731
|
}
|
|
5687
5732
|
function invalidateProgrammaticClientRouteModules(server) {
|
|
5688
|
-
const graph = _optionalChain([server, 'access',
|
|
5733
|
+
const graph = _optionalChain([server, 'access', _511 => _511.environments, 'optionalAccess', _512 => _512.client, 'optionalAccess', _513 => _513.moduleGraph]);
|
|
5689
5734
|
if (!graph) return;
|
|
5690
5735
|
for (const [id, module] of graph.idToModuleMap) {
|
|
5691
5736
|
if (_chunkYUCU6XB4cjs.parseProgrammaticRouteModuleId.call(void 0, id)) graph.invalidateModule(module);
|
|
@@ -5695,12 +5740,12 @@ function generateProgrammaticClientRouteModuleForId(moduleId, root, renderer, cl
|
|
|
5695
5740
|
const parsed = _chunkYUCU6XB4cjs.parseProgrammaticRouteModuleId.call(void 0, moduleId);
|
|
5696
5741
|
const routesFile = resolveRealModuleFile(parsed.filePath, root);
|
|
5697
5742
|
watchFile(routesFile);
|
|
5698
|
-
return
|
|
5743
|
+
return _chunkPA3VZNWUcjs.generateProgrammaticClientRouteModule.call(void 0, {
|
|
5699
5744
|
kind: parsed.kind,
|
|
5700
5745
|
routePath: parsed.routePath,
|
|
5701
5746
|
routesFile,
|
|
5702
|
-
route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess',
|
|
5703
|
-
|
|
5747
|
+
route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess', _514 => _514.routes, 'access', _515 => _515.get, 'call', _516 => _516(
|
|
5748
|
+
_chunkPA3VZNWUcjs.programmaticClientRouteKey.call(void 0, routesFile, parsed.kind, parsed.routePath)
|
|
5704
5749
|
)]),
|
|
5705
5750
|
// React's client module exports no createElement; the main client entry imports React too.
|
|
5706
5751
|
rendererClient: _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, renderer) ? "react" : renderer.client,
|
|
@@ -5708,7 +5753,7 @@ function generateProgrammaticClientRouteModuleForId(moduleId, root, renderer, cl
|
|
|
5708
5753
|
});
|
|
5709
5754
|
}
|
|
5710
5755
|
function resolveRealModuleFile(filePath, root) {
|
|
5711
|
-
const resolved = _nullishCoalesce(
|
|
5756
|
+
const resolved = _nullishCoalesce(_chunkPA3VZNWUcjs.resolveModuleSourcePath.call(void 0, filePath, root), () => ( filePath));
|
|
5712
5757
|
try {
|
|
5713
5758
|
return _chunk7U4XF76Rcjs.toPosixPath.call(void 0, fs2.realpathSync(resolved));
|
|
5714
5759
|
} catch (e29) {
|
|
@@ -6022,12 +6067,12 @@ async function parseRouteModuleProps(routeModule, input) {
|
|
|
6022
6067
|
}
|
|
6023
6068
|
const schemas = routeModule.__farmRouteSchemas;
|
|
6024
6069
|
const params = parseRouteModuleSchema(
|
|
6025
|
-
_optionalChain([schemas, 'optionalAccess',
|
|
6070
|
+
_optionalChain([schemas, 'optionalAccess', _517 => _517.params]),
|
|
6026
6071
|
input.props.params,
|
|
6027
6072
|
"params",
|
|
6028
6073
|
input.routePath
|
|
6029
6074
|
);
|
|
6030
|
-
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess',
|
|
6075
|
+
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _518 => _518.search]), input.search, "search", input.routePath);
|
|
6031
6076
|
return {
|
|
6032
6077
|
...input.props,
|
|
6033
6078
|
params,
|
|
@@ -6047,7 +6092,7 @@ function parseRouteModuleSchema(schema, value, label, routePath) {
|
|
|
6047
6092
|
}
|
|
6048
6093
|
}
|
|
6049
6094
|
function generateClientCode(integrationProviders = [], documentNavigationMatchers = [], docsSearchClientRuntime = EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME, devtoolsClientRuntime = "", plugins = [], root = process.cwd(), srcDir = "src", publicRuntimeConfig = void 0, docsAdapterUI, renderer = _chunkT7UC2ORAcjs.REACT_RENDERER, isolatedHydrationEnabled = false, trailingSlash = false, basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false) {
|
|
6050
|
-
const providerClientCode =
|
|
6095
|
+
const providerClientCode = _chunkPQ6DBVJ2cjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
6051
6096
|
integrationProviders,
|
|
6052
6097
|
root,
|
|
6053
6098
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
@@ -6145,7 +6190,7 @@ async function createFarmServerTreePageElement(source, pathname) {
|
|
|
6145
6190
|
return null;
|
|
6146
6191
|
}
|
|
6147
6192
|
}
|
|
6148
|
-
${islandValues ? `${
|
|
6193
|
+
${islandValues ? `${_chunkPQ6DBVJ2cjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
|
|
6149
6194
|
let farmLastRouteState = null;
|
|
6150
6195
|
|
|
6151
6196
|
// A hot update to a layout tree's client module renders the route again.
|
|
@@ -6166,7 +6211,7 @@ import { createClientPluginManager } from '@farm.js/core/plugin/client'
|
|
|
6166
6211
|
// Not @farm.js/core/client: that module's graph imports react, which other renderers' apps lack.
|
|
6167
6212
|
import { SPARouter } from '@farm.js/core/internal/spa-router'
|
|
6168
6213
|
import { isFarmRouteActive } from '@farm.js/core/router'
|
|
6169
|
-
import { installChunkErrorRecovery, installFarmLinkPrefetch, isFarmBlockedNavigationURL, readFarmLinkNavigateOptions, rememberFarmLinkLocale, replayFarmQueuedInteraction, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from '@farm.js/core/internal/client-runtime'
|
|
6214
|
+
import { installChunkErrorRecovery, installFarmLinkPrefetch, isFarmBlockedNavigationURL, readFarmLinkNavigateOptions, targetsCurrentContext, rememberFarmLinkLocale, replayFarmQueuedInteraction, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from '@farm.js/core/internal/client-runtime'
|
|
6170
6215
|
import { reviveDeferredData } from '@farm.js/core/deferred'
|
|
6171
6216
|
import {
|
|
6172
6217
|
createFarmDeploymentMismatchError,
|
|
@@ -6986,7 +7031,7 @@ async function loadLayoutComponents(layouts = [], params = {}, source) {
|
|
|
6986
7031
|
return loadedLayouts;
|
|
6987
7032
|
}
|
|
6988
7033
|
|
|
6989
|
-
${
|
|
7034
|
+
${_chunkPQ6DBVJ2cjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
6990
7035
|
function wrapWithLoadedLayouts(element, loadedLayouts, params) {
|
|
6991
7036
|
let wrapped = element;
|
|
6992
7037
|
for (let index = loadedLayouts.length - 1; index >= 0; index--) {
|
|
@@ -7286,7 +7331,7 @@ function readActiveLayoutPatterns() {
|
|
|
7286
7331
|
);
|
|
7287
7332
|
}
|
|
7288
7333
|
|
|
7289
|
-
${
|
|
7334
|
+
${_chunkPQ6DBVJ2cjs.FARM_NAVIGATION_SCRIPT_SOURCE}
|
|
7290
7335
|
|
|
7291
7336
|
function activateFragmentScripts(root) {
|
|
7292
7337
|
for (const script of Array.from(root.querySelectorAll?.('script') || [])) {
|
|
@@ -7345,7 +7390,7 @@ function getLayoutShell(root, patterns, index, find) {
|
|
|
7345
7390
|
return shell.innerHTML;
|
|
7346
7391
|
}
|
|
7347
7392
|
|
|
7348
|
-
${islandValues ?
|
|
7393
|
+
${islandValues ? _chunkPQ6DBVJ2cjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceNavigationBoundary(
|
|
7349
7394
|
container,
|
|
7350
7395
|
fragment,
|
|
7351
7396
|
currentPatterns,
|
|
@@ -7420,9 +7465,9 @@ ${islandValues ? `
|
|
|
7420
7465
|
return nextTarget;
|
|
7421
7466
|
}
|
|
7422
7467
|
|
|
7423
|
-
${islandValues ? `${
|
|
7468
|
+
${islandValues ? `${_chunkPQ6DBVJ2cjs.FARM_NAVIGATION_STREAM_READER_SOURCE}
|
|
7424
7469
|
|
|
7425
|
-
${
|
|
7470
|
+
${_chunkPQ6DBVJ2cjs.FARM_EARLY_NAVIGATION_SOURCE}
|
|
7426
7471
|
|
|
7427
7472
|
// Islands mode navigates as the production client does: it fetches the page itself, names the
|
|
7428
7473
|
// layouts it shows by key (F-Layouts), and asks for flush markers (F-Stream), so the shell arrives
|
|
@@ -8076,8 +8121,7 @@ document.addEventListener('click', function(event) {
|
|
|
8076
8121
|
if (href.startsWith('#')) return;
|
|
8077
8122
|
|
|
8078
8123
|
// Don't intercept if target is set to open in new window
|
|
8079
|
-
|
|
8080
|
-
if (linkTarget && linkTarget !== '_self') return;
|
|
8124
|
+
if (!targetsCurrentContext(target)) return;
|
|
8081
8125
|
|
|
8082
8126
|
// Don't intercept modifier clicks (Ctrl+Click = new tab)
|
|
8083
8127
|
if (isModifierEvent(event)) return;
|
|
@@ -8129,7 +8173,7 @@ function generateClientManifest(bundle) {
|
|
|
8129
8173
|
async function defineConfig(config = {}) {
|
|
8130
8174
|
const tailwindVitePlugin = await _chunkDMSXZNQRcjs.loadTailwindVitePlugin.call(void 0, );
|
|
8131
8175
|
const appRoot = path6.resolve(config.root || process.cwd());
|
|
8132
|
-
if (_optionalChain([config, 'access',
|
|
8176
|
+
if (_optionalChain([config, 'access', _519 => _519.extends, 'optionalAccess', _520 => _520.length])) {
|
|
8133
8177
|
const { config: layeredConfig } = await import("./layers-XLOMMQP7.cjs").then(
|
|
8134
8178
|
({ resolveFarmLayers }) => resolveFarmLayers(config, {
|
|
8135
8179
|
root: appRoot,
|
|
@@ -8139,7 +8183,7 @@ async function defineConfig(config = {}) {
|
|
|
8139
8183
|
config = layeredConfig;
|
|
8140
8184
|
}
|
|
8141
8185
|
config.renderer = _chunkT7UC2ORAcjs.resolveFarmRenderer.call(void 0, config.renderer);
|
|
8142
|
-
config.images =
|
|
8186
|
+
config.images = _chunkPQ6DBVJ2cjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, { root: appRoot, dev: true });
|
|
8143
8187
|
const rendererVitePlugins = await _chunkT7UC2ORAcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, appRoot, {
|
|
8144
8188
|
ssr: true
|
|
8145
8189
|
});
|
|
@@ -8231,13 +8275,13 @@ async function defineConfig(config = {}) {
|
|
|
8231
8275
|
if (!serverStarted) {
|
|
8232
8276
|
serverStarted = true;
|
|
8233
8277
|
const elapsed = Date.now() - startTime;
|
|
8234
|
-
const address = _optionalChain([server, 'access',
|
|
8278
|
+
const address = _optionalChain([server, 'access', _521 => _521.httpServer, 'optionalAccess', _522 => _522.address, 'call', _523 => _523()]);
|
|
8235
8279
|
const resolvedPort = typeof address === "object" && address ? address.port : server.config.server.port || port || 3e3;
|
|
8236
8280
|
const hostConfig = server.config.server.host;
|
|
8237
8281
|
const isExposed = hostConfig === true || hostConfig === "0.0.0.0";
|
|
8238
8282
|
console.log("");
|
|
8239
8283
|
console.log(
|
|
8240
|
-
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${
|
|
8284
|
+
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunk6266WH6Xcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
|
|
8241
8285
|
);
|
|
8242
8286
|
console.log("");
|
|
8243
8287
|
console.log(
|
|
@@ -8271,7 +8315,7 @@ async function defineConfig(config = {}) {
|
|
|
8271
8315
|
plugins: [
|
|
8272
8316
|
// `farm dev --desktop`: only the desktop window gets an answer, as in the packaged app.
|
|
8273
8317
|
_chunkY2FEFQAYcjs.farmDesktopDevGuardPlugin.call(void 0, config.basePath),
|
|
8274
|
-
|
|
8318
|
+
_chunkPQ6DBVJ2cjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
8275
8319
|
tailwindVitePlugin,
|
|
8276
8320
|
...rendererVitePlugins,
|
|
8277
8321
|
...reactRefreshPlugins,
|
|
@@ -8281,14 +8325,14 @@ async function defineConfig(config = {}) {
|
|
|
8281
8325
|
farmNavigationPlugin(config.renderer),
|
|
8282
8326
|
farmIslandContainersPlugin(config),
|
|
8283
8327
|
farmPlugin(config),
|
|
8284
|
-
|
|
8328
|
+
_chunkPA3VZNWUcjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
|
|
8285
8329
|
farmBrandingPlugin
|
|
8286
8330
|
],
|
|
8287
8331
|
customLogger: farmLogger,
|
|
8288
8332
|
clearScreen: false,
|
|
8289
8333
|
optimizeDeps: {
|
|
8290
|
-
...
|
|
8291
|
-
|
|
8334
|
+
..._chunkPQ6DBVJ2cjs.createFarmClientOptimizeDepsConfig.call(void 0,
|
|
8335
|
+
_chunkPQ6DBVJ2cjs.createFarmClientOptimizeDepsEntries.call(void 0,
|
|
8292
8336
|
appRoot,
|
|
8293
8337
|
_chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, { ...config, root: appRoot })
|
|
8294
8338
|
),
|
|
@@ -8332,7 +8376,7 @@ async function defineConfig(config = {}) {
|
|
|
8332
8376
|
// Stub out problematic server-only modules during dev mode
|
|
8333
8377
|
alias: {
|
|
8334
8378
|
..._chunk52Q4OB4Acjs.getFarmLayerAliases.call(void 0, config.layers),
|
|
8335
|
-
...
|
|
8379
|
+
..._chunkPQ6DBVJ2cjs.createFarmSourceAlias.call(void 0, appRoot, config.srcDir),
|
|
8336
8380
|
// Nitro internals that should not be resolved in browser
|
|
8337
8381
|
"supports-color": "data:text/javascript,export default false; export const supportsColor = false; export const stdout = false; export const stderr = false;",
|
|
8338
8382
|
"@poppinss/dumper": "data:text/javascript,export default {};",
|
|
@@ -8366,4 +8410,5 @@ async function defineConfig(config = {}) {
|
|
|
8366
8410
|
|
|
8367
8411
|
|
|
8368
8412
|
|
|
8369
|
-
|
|
8413
|
+
|
|
8414
|
+
exports.isViteModuleRequest = isViteModuleRequest; exports.isViteDevClientRequest = isViteDevClientRequest; exports.farmImageImportsPlugin = farmImageImportsPlugin; exports.farmI18nClientBridgePlugin = farmI18nClientBridgePlugin; exports.farmNavigationPlugin = farmNavigationPlugin; exports.farmIslandContainersPlugin = farmIslandContainersPlugin; exports.farmServerOnlyEntriesPlugin = farmServerOnlyEntriesPlugin; exports.withFarmRequestTracing = withFarmRequestTracing; exports.rewriteEarlySsrRelativeImports = rewriteEarlySsrRelativeImports; exports.transformIsolatedClientBoundaryModule = transformIsolatedClientBoundaryModule; exports.isFarmAppRuntimeFile = isFarmAppRuntimeFile; exports.shouldEmitFarmClientRootHmr = shouldEmitFarmClientRootHmr; exports.reachesSharedFarmRendererIsland = reachesSharedFarmRendererIsland; exports.farmPlugin = farmPlugin; exports.defineConfig = defineConfig;
|