@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
|
@@ -32,7 +32,7 @@ var _chunkMHKPXX3Jcjs = require('./chunk-MHKPXX3J.cjs');
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
var
|
|
35
|
+
var _chunkXRYLMTYFcjs = require('./chunk-XRYLMTYF.cjs');
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
|
|
@@ -40,7 +40,7 @@ var _chunkUDWBTABTcjs = require('./chunk-UDWBTABT.cjs');
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
var
|
|
43
|
+
var _chunkSG5RFGV6cjs = require('./chunk-SG5RFGV6.cjs');
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
|
|
@@ -70,7 +70,7 @@ var _chunkNDOE76QCcjs = require('./chunk-NDOE76QC.cjs');
|
|
|
70
70
|
|
|
71
71
|
|
|
72
72
|
|
|
73
|
-
var
|
|
73
|
+
var _chunkIRPXOTENcjs = require('./chunk-IRPXOTEN.cjs');
|
|
74
74
|
|
|
75
75
|
|
|
76
76
|
var _chunk3BTN3NP7cjs = require('./chunk-3BTN3NP7.cjs');
|
|
@@ -115,7 +115,8 @@ var _chunkO4JYMU5Ncjs = require('./chunk-O4JYMU5N.cjs');
|
|
|
115
115
|
|
|
116
116
|
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
|
|
119
|
+
var _chunkPQ6DBVJ2cjs = require('./chunk-PQ6DBVJ2.cjs');
|
|
119
120
|
|
|
120
121
|
|
|
121
122
|
|
|
@@ -131,14 +132,12 @@ var _chunkVACYUMXWcjs = require('./chunk-VACYUMXW.cjs');
|
|
|
131
132
|
|
|
132
133
|
|
|
133
134
|
|
|
134
|
-
var
|
|
135
|
-
|
|
135
|
+
var _chunkERV422FOcjs = require('./chunk-ERV422FO.cjs');
|
|
136
136
|
|
|
137
|
-
var _chunkCPSFDQKJcjs = require('./chunk-CPSFDQKJ.cjs');
|
|
138
137
|
|
|
139
138
|
|
|
139
|
+
var _chunkFEWCWBOFcjs = require('./chunk-FEWCWBOF.cjs');
|
|
140
140
|
|
|
141
|
-
var _chunkBAD6T5NUcjs = require('./chunk-BAD6T5NU.cjs');
|
|
142
141
|
|
|
143
142
|
|
|
144
143
|
|
|
@@ -150,8 +149,7 @@ var _chunkBAD6T5NUcjs = require('./chunk-BAD6T5NU.cjs');
|
|
|
150
149
|
|
|
151
150
|
|
|
152
151
|
|
|
153
|
-
|
|
154
|
-
var _chunk4B6YJ5DScjs = require('./chunk-4B6YJ5DS.cjs');
|
|
152
|
+
var _chunk4ZVKDHS6cjs = require('./chunk-4ZVKDHS6.cjs');
|
|
155
153
|
|
|
156
154
|
|
|
157
155
|
var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
|
|
@@ -165,7 +163,7 @@ var _chunk47JV57DAcjs = require('./chunk-47JV57DA.cjs');
|
|
|
165
163
|
|
|
166
164
|
|
|
167
165
|
|
|
168
|
-
var
|
|
166
|
+
var _chunkJGUMFTZTcjs = require('./chunk-JGUMFTZT.cjs');
|
|
169
167
|
|
|
170
168
|
|
|
171
169
|
|
|
@@ -173,7 +171,7 @@ var _chunkTQJ35BBWcjs = require('./chunk-TQJ35BBW.cjs');
|
|
|
173
171
|
var _chunkW53Z4WDIcjs = require('./chunk-W53Z4WDI.cjs');
|
|
174
172
|
|
|
175
173
|
|
|
176
|
-
var
|
|
174
|
+
var _chunkCNGGEHXYcjs = require('./chunk-CNGGEHXY.cjs');
|
|
177
175
|
|
|
178
176
|
|
|
179
177
|
var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
|
|
@@ -194,7 +192,7 @@ var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
|
|
|
194
192
|
|
|
195
193
|
|
|
196
194
|
|
|
197
|
-
var
|
|
195
|
+
var _chunkPA3VZNWUcjs = require('./chunk-PA3VZNWU.cjs');
|
|
198
196
|
|
|
199
197
|
|
|
200
198
|
|
|
@@ -214,6 +212,9 @@ var _chunkL2GUEYHRcjs = require('./chunk-L2GUEYHR.cjs');
|
|
|
214
212
|
var _chunkIIHZ2BEEcjs = require('./chunk-IIHZ2BEE.cjs');
|
|
215
213
|
|
|
216
214
|
|
|
215
|
+
var _chunkZ43CIBURcjs = require('./chunk-Z43CIBUR.cjs');
|
|
216
|
+
|
|
217
|
+
|
|
217
218
|
|
|
218
219
|
var _chunk6JHZPB52cjs = require('./chunk-6JHZPB52.cjs');
|
|
219
220
|
|
|
@@ -280,7 +281,10 @@ var _chunkNW3DL2PMcjs = require('./chunk-NW3DL2PM.cjs');
|
|
|
280
281
|
var _chunkSHDCKRP4cjs = require('./chunk-SHDCKRP4.cjs');
|
|
281
282
|
|
|
282
283
|
|
|
283
|
-
var
|
|
284
|
+
var _chunk3MY6TNNEcjs = require('./chunk-3MY6TNNE.cjs');
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
var _chunkBQHIJOZMcjs = require('./chunk-BQHIJOZM.cjs');
|
|
284
288
|
|
|
285
289
|
|
|
286
290
|
var _chunkCYOTNHDFcjs = require('./chunk-CYOTNHDF.cjs');
|
|
@@ -308,7 +312,7 @@ var _chunk7U4XF76Rcjs = require('./chunk-7U4XF76R.cjs');
|
|
|
308
312
|
var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
|
|
309
313
|
|
|
310
314
|
|
|
311
|
-
var
|
|
315
|
+
var _chunk6266WH6Xcjs = require('./chunk-6266WH6X.cjs');
|
|
312
316
|
|
|
313
317
|
|
|
314
318
|
var _chunkY3DO7BIJcjs = require('./chunk-Y3DO7BIJ.cjs');
|
|
@@ -661,7 +665,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
661
665
|
isPathGuarded: options.isPathGuarded,
|
|
662
666
|
basePath
|
|
663
667
|
});
|
|
664
|
-
const apiHandler =
|
|
668
|
+
const apiHandler = _chunkSG5RFGV6cjs.createFarmDocsAPIHandler.call(void 0, {
|
|
665
669
|
rootDir: options.root,
|
|
666
670
|
srcDir: options.srcDir,
|
|
667
671
|
docs,
|
|
@@ -896,15 +900,26 @@ function encodeFarmBuildJSONPlaceholder(value) {
|
|
|
896
900
|
|
|
897
901
|
// src/nitro/islands-react-chunk.ts
|
|
898
902
|
var REACT_MODULE = /[\\/]node_modules[\\/](?:react|react-dom|scheduler)[\\/]/;
|
|
899
|
-
|
|
903
|
+
var REACT_DOM_MODULE = /[\\/]node_modules[\\/]react-dom[\\/]/;
|
|
904
|
+
var FARM_EAGER_COMPILE_HINT = "//# allFunctionsCalledOnLoad";
|
|
905
|
+
function createFarmIslandsReactOutput() {
|
|
900
906
|
let entryImportsReact;
|
|
901
907
|
return {
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
+
codeSplitting: {
|
|
909
|
+
groups: [
|
|
910
|
+
{
|
|
911
|
+
debugName: "react",
|
|
912
|
+
name(moduleId, context) {
|
|
913
|
+
if (!REACT_MODULE.test(moduleId)) return null;
|
|
914
|
+
_nullishCoalesce(entryImportsReact, () => ( (entryImportsReact = reactLoadsWithAnEntry(moduleId, context))));
|
|
915
|
+
return entryImportsReact ? null : "react";
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
]
|
|
919
|
+
},
|
|
920
|
+
// After minification, so the hint stays the chunk's first line; its source map accounts for it.
|
|
921
|
+
// Rolldown adds a line after any string, an empty one too, so other chunks get none.
|
|
922
|
+
postBanner: ((chunk) => entryImportsReact === false && chunk.moduleIds.some((id) => REACT_DOM_MODULE.test(id)) ? FARM_EAGER_COMPILE_HINT : void 0)
|
|
908
923
|
};
|
|
909
924
|
}
|
|
910
925
|
function reactLoadsWithAnEntry(moduleId, context) {
|
|
@@ -928,14 +943,25 @@ function reactLoadsWithAnEntry(moduleId, context) {
|
|
|
928
943
|
}
|
|
929
944
|
return false;
|
|
930
945
|
}
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
946
|
+
var CHUNKING_OPTIONS = [
|
|
947
|
+
"manualChunks",
|
|
948
|
+
"advancedChunks",
|
|
949
|
+
"codeSplitting",
|
|
950
|
+
"inlineDynamicImports"
|
|
951
|
+
];
|
|
952
|
+
function createFarmIslandsReactChunkPlugin() {
|
|
953
|
+
return {
|
|
954
|
+
name: "farm-islands-react-chunk",
|
|
955
|
+
enforce: "post",
|
|
956
|
+
outputOptions: {
|
|
957
|
+
order: "post",
|
|
958
|
+
handler(options) {
|
|
959
|
+
if (CHUNKING_OPTIONS.some((key) => options[key] !== void 0)) return null;
|
|
960
|
+
const { codeSplitting, postBanner } = createFarmIslandsReactOutput();
|
|
961
|
+
return { ...options, codeSplitting, postBanner: _nullishCoalesce(options.postBanner, () => ( postBanner)) };
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
};
|
|
939
965
|
}
|
|
940
966
|
|
|
941
967
|
// src/nitro/client-route-table.ts
|
|
@@ -1105,7 +1131,7 @@ async function createFarmRouteRuntimeManifest(options) {
|
|
|
1105
1131
|
const routes = [];
|
|
1106
1132
|
for (const [pattern, entry] of options.routeManager.getRoutes()) {
|
|
1107
1133
|
const routeModule = await options.routeManager.loadRouteModule(entry.modulePath);
|
|
1108
|
-
const rendering = await
|
|
1134
|
+
const rendering = await _chunkERV422FOcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
|
|
1109
1135
|
const runtimeConfig = await options.routeManager.resolveRouteRuntimeConfig(pattern);
|
|
1110
1136
|
routes.push({
|
|
1111
1137
|
kind: "page",
|
|
@@ -1192,7 +1218,7 @@ function validateFarmRouteRuntimeDeployment(manifest, preset) {
|
|
|
1192
1218
|
`Route "${route.pattern}" requires the ${route.runtime} runtime, but preset "${preset}" emits ${runtime} functions. Choose a compatible preset or change the route runtime.`
|
|
1193
1219
|
);
|
|
1194
1220
|
}
|
|
1195
|
-
if (_optionalChain([route, 'access',
|
|
1221
|
+
if (_optionalChain([route, 'access', _10 => _10.regions, 'optionalAccess', _11 => _11.length]) && preset !== "vercel") {
|
|
1196
1222
|
warnings.add(
|
|
1197
1223
|
`Preset "${preset}" does not map per-route regions; Farm kept them in ${FARM_ROUTE_RUNTIME_MANIFEST} for deployment adapters.`
|
|
1198
1224
|
);
|
|
@@ -1239,7 +1265,7 @@ async function createFarmVercelRouteRuntimeFunctions(outputDir, manifest, fs5, b
|
|
|
1239
1265
|
const destinations = /* @__PURE__ */ new Map();
|
|
1240
1266
|
let groupIndex = 0;
|
|
1241
1267
|
for (const [key, group] of groups) {
|
|
1242
|
-
if (!_optionalChain([group, 'access',
|
|
1268
|
+
if (!_optionalChain([group, 'access', _12 => _12.config, 'access', _13 => _13.regions, 'optionalAccess', _14 => _14.length]) && !group.config.maxDuration) {
|
|
1243
1269
|
destinations.set(key, "/__nitro");
|
|
1244
1270
|
continue;
|
|
1245
1271
|
}
|
|
@@ -1289,14 +1315,14 @@ async function configureVercelFunction(functionDir, config, fs5) {
|
|
|
1289
1315
|
const current = JSON.parse(await fs5.readFile(configPath, "utf8"));
|
|
1290
1316
|
const next = {
|
|
1291
1317
|
...current,
|
|
1292
|
-
..._optionalChain([config, 'access',
|
|
1318
|
+
..._optionalChain([config, 'access', _15 => _15.regions, 'optionalAccess', _16 => _16.length]) ? { regions: config.regions } : {},
|
|
1293
1319
|
...config.maxDuration ? { maxDuration: config.maxDuration } : {}
|
|
1294
1320
|
};
|
|
1295
1321
|
await fs5.writeFile(configPath, `${JSON.stringify(next, null, 2)}
|
|
1296
1322
|
`);
|
|
1297
1323
|
}
|
|
1298
1324
|
function hasVercelFunctionControls(route) {
|
|
1299
|
-
return Boolean(_optionalChain([route, 'access',
|
|
1325
|
+
return Boolean(_optionalChain([route, 'access', _17 => _17.regions, 'optionalAccess', _18 => _18.length]) || route.maxDuration);
|
|
1300
1326
|
}
|
|
1301
1327
|
function compareRuntimeRoutes(left, right) {
|
|
1302
1328
|
const kindOrder = { page: 0, api: 0, metadata: 0, rule: 1 };
|
|
@@ -1341,7 +1367,7 @@ var FARM_HASHED_ASSET_DIRS = ["assets", "chunks"];
|
|
|
1341
1367
|
var LITERAL_ROUTE_PATH = /^\/[\w.~@/-]+$/;
|
|
1342
1368
|
function planFarmImmutableAssets(options) {
|
|
1343
1369
|
const cacheRulePatterns = Object.entries(_nullishCoalesce(options.routeRules, () => ( {}))).filter(
|
|
1344
|
-
([, rule]) => Object.keys(_nullishCoalesce(_optionalChain([rule, 'optionalAccess',
|
|
1370
|
+
([, rule]) => Object.keys(_nullishCoalesce(_optionalChain([rule, 'optionalAccess', _19 => _19.headers]), () => ( {}))).some((name) => name.toLowerCase() === "cache-control")
|
|
1345
1371
|
).map(([pattern]) => pattern);
|
|
1346
1372
|
const isImmutable = (file) => isFarmImmutableAssetPath(file) && !cacheRulePatterns.some((pattern) => _chunkIUKBPBM7cjs.farmRouteRuleMatches.call(void 0, pattern, file));
|
|
1347
1373
|
const routeDirs = new Set(
|
|
@@ -1469,7 +1495,7 @@ function resolveBundleFileName(chunkFileName, relativeUrl) {
|
|
|
1469
1495
|
function replaceServerFileReferences(bundle, chunkFileName, code, replace) {
|
|
1470
1496
|
return code.replace(SERVER_FILE_URL_RE, (reference, _quote, relativeUrl) => {
|
|
1471
1497
|
const target = resolveBundleFileName(chunkFileName, relativeUrl);
|
|
1472
|
-
return target && _optionalChain([bundle, 'access',
|
|
1498
|
+
return target && _optionalChain([bundle, 'access', _20 => _20[target], 'optionalAccess', _21 => _21.type]) === "asset" ? replace(target) : reference;
|
|
1473
1499
|
});
|
|
1474
1500
|
}
|
|
1475
1501
|
function collectServerReadSSRAssets(bundle) {
|
|
@@ -1483,7 +1509,7 @@ function collectServerReadSSRAssets(bundle) {
|
|
|
1483
1509
|
}
|
|
1484
1510
|
return assets;
|
|
1485
1511
|
}
|
|
1486
|
-
function collectServerOnlySSRAssets(bundle) {
|
|
1512
|
+
function collectServerOnlySSRAssets(bundle, polyroute = false) {
|
|
1487
1513
|
const serverOnly = /* @__PURE__ */ new Set();
|
|
1488
1514
|
const publicReferenceSources = [];
|
|
1489
1515
|
for (const [fileName, output] of Object.entries(bundle)) {
|
|
@@ -1506,6 +1532,7 @@ function collectServerOnlySSRAssets(bundle) {
|
|
|
1506
1532
|
}
|
|
1507
1533
|
}
|
|
1508
1534
|
for (const fileName of serverOnly) {
|
|
1535
|
+
if (polyroute && /(?:^|\/)polyroute\/[a-f0-9]+\/[^/]+\.wasm$/.test(fileName)) continue;
|
|
1509
1536
|
const name = _path2.default.posix.basename(fileName);
|
|
1510
1537
|
if (publicReferenceSources.some((source) => source.includes(name))) {
|
|
1511
1538
|
serverOnly.delete(fileName);
|
|
@@ -1522,7 +1549,7 @@ function assertServerReadSSRAssetsSupported(bundle, preset, root) {
|
|
|
1522
1549
|
if (assets.length === 0) return;
|
|
1523
1550
|
const sources = assets.map((fileName) => {
|
|
1524
1551
|
const output = bundle[fileName];
|
|
1525
|
-
const original = _optionalChain([output, 'optionalAccess',
|
|
1552
|
+
const original = _optionalChain([output, 'optionalAccess', _22 => _22.type]) === "asset" ? _optionalChain([output, 'access', _23 => _23.originalFileNames, 'optionalAccess', _24 => _24[0]]) : void 0;
|
|
1526
1553
|
if (!original) return fileName;
|
|
1527
1554
|
return _path2.default.relative(root, _path2.default.resolve(root, original)).split(_path2.default.sep).join("/");
|
|
1528
1555
|
});
|
|
@@ -1541,7 +1568,7 @@ function createServerReadSSRAssetsPlugin(bundle, ssrOutputDir) {
|
|
|
1541
1568
|
transform(code, id) {
|
|
1542
1569
|
if (!code.includes("import.meta.url")) return null;
|
|
1543
1570
|
const chunkFileName = _path2.default.relative(ssrOutputDir, id.split("?", 1)[0]).split(_path2.default.sep).join("/");
|
|
1544
|
-
if (_optionalChain([bundle, 'access',
|
|
1571
|
+
if (_optionalChain([bundle, 'access', _25 => _25[chunkFileName], 'optionalAccess', _26 => _26.type]) !== "chunk") return null;
|
|
1545
1572
|
let changed = false;
|
|
1546
1573
|
const transformed = replaceServerFileReferences(
|
|
1547
1574
|
bundle,
|
|
@@ -1637,7 +1664,7 @@ export default async function farmNetlifyHandler(request, context) {
|
|
|
1637
1664
|
var PLATFORM_CONFIG_KEYS = /* @__PURE__ */ new Set(["desktop", "mobile"]);
|
|
1638
1665
|
var CONFIG_FACTORIES = /* @__PURE__ */ new Set(["defineConfig", "defineFarmConfig"]);
|
|
1639
1666
|
function isConfigObject(node) {
|
|
1640
|
-
return _optionalChain([node, 'optionalAccess',
|
|
1667
|
+
return _optionalChain([node, 'optionalAccess', _27 => _27.type]) === "ObjectExpression";
|
|
1641
1668
|
}
|
|
1642
1669
|
function propertyName(property) {
|
|
1643
1670
|
if (property.type !== "Property" || property.computed) return void 0;
|
|
@@ -1658,7 +1685,7 @@ function collectConfigObjects(node, found) {
|
|
|
1658
1685
|
}
|
|
1659
1686
|
if (current.type === "CallExpression") {
|
|
1660
1687
|
const callee = current.callee;
|
|
1661
|
-
const name = callee.type === "Identifier" ? callee.name : _optionalChain([callee, 'access',
|
|
1688
|
+
const name = callee.type === "Identifier" ? callee.name : _optionalChain([callee, 'access', _28 => _28.property, 'optionalAccess', _29 => _29.name]);
|
|
1662
1689
|
const argument = current.arguments[0];
|
|
1663
1690
|
if (name && CONFIG_FACTORIES.has(name) && isConfigObject(argument)) found.push(argument);
|
|
1664
1691
|
}
|
|
@@ -1691,7 +1718,7 @@ function stripPlatformConfigSource(code, parse) {
|
|
|
1691
1718
|
const trailingComma = /^\s*,/.exec(code.slice(properties[last].end));
|
|
1692
1719
|
removals.push([
|
|
1693
1720
|
properties[first].start,
|
|
1694
|
-
properties[last].end + (_nullishCoalesce(_optionalChain([trailingComma, 'optionalAccess',
|
|
1721
|
+
properties[last].end + (_nullishCoalesce(_optionalChain([trailingComma, 'optionalAccess', _30 => _30[0], 'access', _31 => _31.length]), () => ( 0)))
|
|
1695
1722
|
]);
|
|
1696
1723
|
}
|
|
1697
1724
|
first = last;
|
|
@@ -1718,7 +1745,7 @@ function farmStripPlatformConfigPlugin(configFiles) {
|
|
|
1718
1745
|
// removed block used (`readFileSync` for a version, say).
|
|
1719
1746
|
enforce: "pre",
|
|
1720
1747
|
transform: {
|
|
1721
|
-
filter: { id:
|
|
1748
|
+
filter: { id: _chunkPQ6DBVJ2cjs.fileNamePattern.call(void 0, configFiles) },
|
|
1722
1749
|
async handler(code, id) {
|
|
1723
1750
|
const file = id.split("?", 1)[0];
|
|
1724
1751
|
if (!files.has(_path2.default.resolve(file)) && !files.has(realPath(file))) return null;
|
|
@@ -1771,7 +1798,7 @@ function precompileFarmMarkdownPages(bodies, coreRoot) {
|
|
|
1771
1798
|
return;
|
|
1772
1799
|
}
|
|
1773
1800
|
worker.once("message", (entries) => {
|
|
1774
|
-
void _optionalChain([worker, 'optionalAccess',
|
|
1801
|
+
void _optionalChain([worker, 'optionalAccess', _32 => _32.terminate, 'call', _33 => _33()]);
|
|
1775
1802
|
done(entries);
|
|
1776
1803
|
});
|
|
1777
1804
|
worker.once("error", () => done());
|
|
@@ -1780,7 +1807,7 @@ function precompileFarmMarkdownPages(bodies, coreRoot) {
|
|
|
1780
1807
|
return {
|
|
1781
1808
|
pages,
|
|
1782
1809
|
dispose() {
|
|
1783
|
-
void _optionalChain([worker, 'optionalAccess',
|
|
1810
|
+
void _optionalChain([worker, 'optionalAccess', _34 => _34.terminate, 'call', _35 => _35()]);
|
|
1784
1811
|
}
|
|
1785
1812
|
};
|
|
1786
1813
|
}
|
|
@@ -1862,7 +1889,7 @@ function literalMatcher(node) {
|
|
|
1862
1889
|
if (node.type === "Literal" && node.regex)
|
|
1863
1890
|
return new RegExp(node.regex.pattern, node.regex.flags);
|
|
1864
1891
|
if (node.type === "TemplateLiteral" && node.expressions.length === 0) {
|
|
1865
|
-
return _nullishCoalesce(_optionalChain([node, 'access',
|
|
1892
|
+
return _nullishCoalesce(_optionalChain([node, 'access', _36 => _36.quasis, 'access', _37 => _37[0], 'optionalAccess', _38 => _38.value, 'optionalAccess', _39 => _39.cooked]), () => ( void 0));
|
|
1866
1893
|
}
|
|
1867
1894
|
return void 0;
|
|
1868
1895
|
}
|
|
@@ -1886,7 +1913,7 @@ function readStaticMiddlewareConfig(program) {
|
|
|
1886
1913
|
let found = null;
|
|
1887
1914
|
for (const statement of program.body) {
|
|
1888
1915
|
if (statement.type === "ExportNamedDeclaration" && !statement.declaration) {
|
|
1889
|
-
if (statement.specifiers.some((specifier) => _optionalChain([specifier, 'access',
|
|
1916
|
+
if (statement.specifiers.some((specifier) => _optionalChain([specifier, 'access', _40 => _40.exported, 'optionalAccess', _41 => _41.name]) === "config")) {
|
|
1890
1917
|
return "unknown";
|
|
1891
1918
|
}
|
|
1892
1919
|
continue;
|
|
@@ -1894,14 +1921,14 @@ function readStaticMiddlewareConfig(program) {
|
|
|
1894
1921
|
const declaration = statement.type === "ExportNamedDeclaration" ? statement.declaration : null;
|
|
1895
1922
|
if (!declaration || declaration.type !== "VariableDeclaration") continue;
|
|
1896
1923
|
for (const declarator of declaration.declarations) {
|
|
1897
|
-
if (_optionalChain([declarator, 'access',
|
|
1924
|
+
if (_optionalChain([declarator, 'access', _42 => _42.id, 'optionalAccess', _43 => _43.type]) !== "Identifier" || declarator.id.name !== "config") continue;
|
|
1898
1925
|
if (declaration.kind !== "const" || !declarator.init) return "unknown";
|
|
1899
1926
|
const init = unwrap(declarator.init);
|
|
1900
1927
|
if (init.type !== "ObjectExpression") return "unknown";
|
|
1901
1928
|
const config = {};
|
|
1902
1929
|
for (const property of init.properties) {
|
|
1903
1930
|
if (property.type !== "Property" || property.computed) return "unknown";
|
|
1904
|
-
const key = _nullishCoalesce(_optionalChain([property, 'access',
|
|
1931
|
+
const key = _nullishCoalesce(_optionalChain([property, 'access', _44 => _44.key, 'optionalAccess', _45 => _45.name]), () => ( _optionalChain([property, 'access', _46 => _46.key, 'optionalAccess', _47 => _47.value])));
|
|
1905
1932
|
if (key === "runtime") {
|
|
1906
1933
|
const runtime = literalMatcher(unwrap(property.value));
|
|
1907
1934
|
if (runtime === "edge" || runtime === "nodejs") config.runtime = runtime;
|
|
@@ -1922,7 +1949,7 @@ async function readMiddlewareFileConfig(filePath) {
|
|
|
1922
1949
|
try {
|
|
1923
1950
|
const [{ readFile: readFile2 }, vite] = await Promise.all([import("fs/promises"), import("vite")]);
|
|
1924
1951
|
const parsed = vite.parseSync(filePath, await readFile2(filePath, "utf8"));
|
|
1925
|
-
if (_optionalChain([parsed, 'access',
|
|
1952
|
+
if (_optionalChain([parsed, 'access', _48 => _48.errors, 'optionalAccess', _49 => _49.length])) return "unknown";
|
|
1926
1953
|
return readStaticMiddlewareConfig(parsed.program);
|
|
1927
1954
|
} catch (e14) {
|
|
1928
1955
|
return "unknown";
|
|
@@ -1941,7 +1968,7 @@ function farmTargetRunsEdgeMiddleware(preset) {
|
|
|
1941
1968
|
return preset === "vercel";
|
|
1942
1969
|
}
|
|
1943
1970
|
function isFarmEdgeMiddlewareRoute(route) {
|
|
1944
|
-
return typeof route.config === "object" && _optionalChain([route, 'access',
|
|
1971
|
+
return typeof route.config === "object" && _optionalChain([route, 'access', _50 => _50.config, 'optionalAccess', _51 => _51.runtime]) === "edge";
|
|
1945
1972
|
}
|
|
1946
1973
|
function escapeRegExp3(value) {
|
|
1947
1974
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
@@ -1978,7 +2005,7 @@ export default createFarmVercelEdgeMiddleware({
|
|
|
1978
2005
|
${modules.join("\n")}
|
|
1979
2006
|
],
|
|
1980
2007
|
i18n: ${JSON.stringify(config.i18n)},
|
|
1981
|
-
server: ${JSON.stringify({ trustProxy: _optionalChain([config, 'access',
|
|
2008
|
+
server: ${JSON.stringify({ trustProxy: _optionalChain([config, 'access', _52 => _52.server, 'optionalAccess', _53 => _53.trustProxy]) === true })},
|
|
1982
2009
|
apiBasePath: ${JSON.stringify(_chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, config.api))},
|
|
1983
2010
|
notFoundPath: ${JSON.stringify(_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, FARM_VERCEL_EDGE_NOT_FOUND_PATH, config.basePath))},
|
|
1984
2011
|
pages: ${JSON.stringify(toFarmVercelEdgeGuardedUrls(guardedPages, config.basePath))},
|
|
@@ -2037,7 +2064,7 @@ async function writeFarmVercelEdgeMiddlewareFunction(options) {
|
|
|
2037
2064
|
logLevel: "silent",
|
|
2038
2065
|
plugins: [edgeNodeModulesPlugin(coreDir, unsupported)],
|
|
2039
2066
|
resolve: {
|
|
2040
|
-
alias:
|
|
2067
|
+
alias: _chunkPQ6DBVJ2cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
2041
2068
|
conditionNames: ["edge-light", "worker", "browser", "import", "module", "default"]
|
|
2042
2069
|
},
|
|
2043
2070
|
transform: {
|
|
@@ -2269,7 +2296,7 @@ function createPrerenderRuntimeResolverPlugin(root, resolveNitroEntry = resolveN
|
|
|
2269
2296
|
return {
|
|
2270
2297
|
name: "farm-prerender-runtime-resolver",
|
|
2271
2298
|
async resolveId(id, _importer, options) {
|
|
2272
|
-
if (_optionalChain([options, 'access',
|
|
2299
|
+
if (_optionalChain([options, 'access', _54 => _54.custom, 'optionalAccess', _55 => _55.farmPrerenderRuntimeResolve])) return null;
|
|
2273
2300
|
if (id.startsWith("\0") || id.startsWith(".") || id.startsWith("#") || id.startsWith("virtual:") || _path2.default.isAbsolute(id) || NODE_BUILTIN_MODULES.has(id)) {
|
|
2274
2301
|
return null;
|
|
2275
2302
|
}
|
|
@@ -2439,7 +2466,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
|
|
|
2439
2466
|
return {
|
|
2440
2467
|
name: "farm-omitted-metadata-image-runtime",
|
|
2441
2468
|
resolveId: {
|
|
2442
|
-
filter: { id:
|
|
2469
|
+
filter: { id: _chunkPQ6DBVJ2cjs.exactIdPattern.call(void 0, ["@vercel/og"]) },
|
|
2443
2470
|
handler(source, importer) {
|
|
2444
2471
|
if (source !== "@vercel/og") return null;
|
|
2445
2472
|
const fromCoreRuntime = importer !== void 0 && isFarmCoreModule(importer) && !/^og\.[cm]?[jt]sx?$/.test(_path2.default.basename(importer.split("?", 1)[0]));
|
|
@@ -2448,7 +2475,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
|
|
|
2448
2475
|
}
|
|
2449
2476
|
},
|
|
2450
2477
|
load: {
|
|
2451
|
-
filter: { id:
|
|
2478
|
+
filter: { id: _chunkPQ6DBVJ2cjs.exactIdPattern.call(void 0, [FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID]) },
|
|
2452
2479
|
handler(id) {
|
|
2453
2480
|
if (id !== FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID) return null;
|
|
2454
2481
|
return `
|
|
@@ -2476,8 +2503,8 @@ function readVercelOgManifest(file) {
|
|
|
2476
2503
|
}
|
|
2477
2504
|
function resolveVercelOgConditionEntry(resolvedId, condition) {
|
|
2478
2505
|
const vercelOg = readVercelOgManifest(resolvedId);
|
|
2479
|
-
const entry = _optionalChain([vercelOg, 'optionalAccess',
|
|
2480
|
-
const file = typeof entry === "string" ? entry : _optionalChain([entry, 'optionalAccess',
|
|
2506
|
+
const entry = _optionalChain([vercelOg, 'optionalAccess', _56 => _56.manifest, 'access', _57 => _57.exports, 'optionalAccess', _58 => _58["."], 'optionalAccess', _59 => _59[condition]]);
|
|
2507
|
+
const file = typeof entry === "string" ? entry : _optionalChain([entry, 'optionalAccess', _60 => _60.default]);
|
|
2481
2508
|
return vercelOg && typeof file === "string" ? _path2.default.join(vercelOg.dir, file) : null;
|
|
2482
2509
|
}
|
|
2483
2510
|
function createEdgeMetadataImageRuntimePlugin({
|
|
@@ -2493,7 +2520,7 @@ function createEdgeMetadataImageRuntimePlugin({
|
|
|
2493
2520
|
const edgeEntry = resolveVercelOgConditionEntry(resolved.id, condition);
|
|
2494
2521
|
return edgeEntry ? { ...resolved, id: edgeEntry } : resolved;
|
|
2495
2522
|
}
|
|
2496
|
-
if (wasm !== "module" || !source.endsWith(".wasm?module") || !_optionalChain([importer, 'optionalAccess',
|
|
2523
|
+
if (wasm !== "module" || !source.endsWith(".wasm?module") || !_optionalChain([importer, 'optionalAccess', _61 => _61.replace, 'call', _62 => _62(/\\/g, "/"), 'access', _63 => _63.includes, 'call', _64 => _64("/@vercel/og/")])) {
|
|
2497
2524
|
return null;
|
|
2498
2525
|
}
|
|
2499
2526
|
const resolvedPath = _path2.default.resolve(_path2.default.dirname(importer.split("?", 1)[0]), source);
|
|
@@ -2515,7 +2542,7 @@ function createVercelOgFontInlinePlugin(runtime = "Cloudflare Workers") {
|
|
|
2515
2542
|
return `Promise.resolve({ arrayBuffer: () => Uint8Array.from(atob(${JSON.stringify(encoded)}), (character) => character.charCodeAt(0)).buffer })`;
|
|
2516
2543
|
});
|
|
2517
2544
|
if (inlined !== code) return { code: inlined, map: null };
|
|
2518
|
-
const version = _nullishCoalesce(_optionalChain([readVercelOgManifest, 'call',
|
|
2545
|
+
const version = _nullishCoalesce(_optionalChain([readVercelOgManifest, 'call', _65 => _65(file), 'optionalAccess', _66 => _66.manifest, 'access', _67 => _67.version]), () => ( "(unknown version)"));
|
|
2519
2546
|
this.error(
|
|
2520
2547
|
`@vercel/og ${version} cannot be bundled for ${runtime}: ${file} does not load its default font with fetch(new URL("./<font>.ttf", import.meta.url)), the pattern Farm inlines because an edge function cannot fetch it. Install a @vercel/og version whose edge build does, such as 1.0.1.`
|
|
2521
2548
|
);
|
|
@@ -2526,7 +2553,7 @@ function createMetadataImageWasmPlugin() {
|
|
|
2526
2553
|
return {
|
|
2527
2554
|
name: "farm-metadata-image-wasm",
|
|
2528
2555
|
resolveId(source, importer) {
|
|
2529
|
-
if (!source.endsWith(".wasm?module") || !_optionalChain([importer, 'optionalAccess',
|
|
2556
|
+
if (!source.endsWith(".wasm?module") || !_optionalChain([importer, 'optionalAccess', _68 => _68.replace, 'call', _69 => _69(/\\/g, "/"), 'access', _70 => _70.includes, 'call', _71 => _71("/@vercel/og/")])) {
|
|
2530
2557
|
return null;
|
|
2531
2558
|
}
|
|
2532
2559
|
const requestPath = source.slice(0, -"?module".length);
|
|
@@ -2602,9 +2629,9 @@ function hasFarmRuntimeConfigModule(config, configModulePath) {
|
|
|
2602
2629
|
return Boolean(configModulePath || (config.layers || []).some((layer) => layer.configFile));
|
|
2603
2630
|
}
|
|
2604
2631
|
function nameCodeSplittingGroups(bundlerConfig) {
|
|
2605
|
-
const outputs = _optionalChain([bundlerConfig, 'optionalAccess',
|
|
2632
|
+
const outputs = _optionalChain([bundlerConfig, 'optionalAccess', _72 => _72.output]);
|
|
2606
2633
|
for (const output of Array.isArray(outputs) ? outputs : [outputs]) {
|
|
2607
|
-
const groups = _optionalChain([output, 'optionalAccess',
|
|
2634
|
+
const groups = _optionalChain([output, 'optionalAccess', _73 => _73.codeSplitting, 'optionalAccess', _74 => _74.groups]);
|
|
2608
2635
|
if (!Array.isArray(groups)) continue;
|
|
2609
2636
|
groups.forEach((group, index) => {
|
|
2610
2637
|
if (group && typeof group.name === "function" && !group.debugName) {
|
|
@@ -2665,9 +2692,9 @@ function restoreLiteralModuleSpecifiers(code, fileName, { parseSync, Visitor })
|
|
|
2665
2692
|
throw new Error(`Failed to minify ${fileName}: ${parsed.errors[0].message}`);
|
|
2666
2693
|
}
|
|
2667
2694
|
const restore = (node) => {
|
|
2668
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
2695
|
+
if (_optionalChain([node, 'optionalAccess', _75 => _75.type]) !== "TemplateLiteral") return;
|
|
2669
2696
|
const template = node;
|
|
2670
|
-
const value = _optionalChain([template, 'access',
|
|
2697
|
+
const value = _optionalChain([template, 'access', _76 => _76.quasis, 'access', _77 => _77[0], 'optionalAccess', _78 => _78.value, 'access', _79 => _79.cooked]);
|
|
2671
2698
|
if (template.expressions.length > 0 || typeof value !== "string") return;
|
|
2672
2699
|
replacements.push({
|
|
2673
2700
|
start: template.start,
|
|
@@ -2825,7 +2852,7 @@ async function discoverMiddlewareRoutes(appDir) {
|
|
|
2825
2852
|
return Array.from(routes.values()).sort(_chunkSHDCKRP4cjs.compareMiddlewareRouteLocations).map(({ path: routePath, filePath }) => ({ path: routePath, filePath }));
|
|
2826
2853
|
}
|
|
2827
2854
|
function assertFarmDocsRuntimeSupported(config, preset) {
|
|
2828
|
-
if (!_optionalChain([config, 'access',
|
|
2855
|
+
if (!_optionalChain([config, 'access', _80 => _80.docs, 'optionalAccess', _81 => _81.enabled]) || !_optionalChain([config, 'access', _82 => _82.docs, 'access', _83 => _83.adapter, 'optionalAccess', _84 => _84.server]) || _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) !== "edge" || Boolean(config.docs.adapter.edgeCompiler)) {
|
|
2829
2856
|
return;
|
|
2830
2857
|
}
|
|
2831
2858
|
throw new Error(
|
|
@@ -3006,7 +3033,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
3006
3033
|
);
|
|
3007
3034
|
}
|
|
3008
3035
|
}
|
|
3009
|
-
_optionalChain([sourceSnapshot, 'optionalAccess',
|
|
3036
|
+
_optionalChain([sourceSnapshot, 'optionalAccess', _85 => _85.clear, 'call', _86 => _86()]);
|
|
3010
3037
|
const ssrResult = ssrBuildResult.value;
|
|
3011
3038
|
const routeRuntimeManifest = routeRuntimeManifestResult.value;
|
|
3012
3039
|
const runtimeValidation = validateFarmRouteRuntimeDeployment(routeRuntimeManifest, preset);
|
|
@@ -3015,7 +3042,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
3015
3042
|
}
|
|
3016
3043
|
const { bundle: ssrBundle, entryFile: ssrEntryFile, configuredHeaderRoutes } = ssrResult;
|
|
3017
3044
|
assertServerReadSSRAssetsSupported(ssrBundle, preset, root);
|
|
3018
|
-
await writeSSRAssetsToClient(ssrBundle, clientOutputDir);
|
|
3045
|
+
await writeSSRAssetsToClient(ssrBundle, clientOutputDir, ssrResult.polyroute);
|
|
3019
3046
|
if (!rendererDisabled) {
|
|
3020
3047
|
await writeFarmVideoPlayerToClient(clientOutputDir);
|
|
3021
3048
|
}
|
|
@@ -3038,7 +3065,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
3038
3065
|
configuredHeaderRoutes,
|
|
3039
3066
|
nitroBuilderResultPromise,
|
|
3040
3067
|
lifecyclePluginManager,
|
|
3041
|
-
_optionalChain([markdownPrecompile, 'optionalAccess',
|
|
3068
|
+
_optionalChain([markdownPrecompile, 'optionalAccess', _87 => _87.pages])
|
|
3042
3069
|
);
|
|
3043
3070
|
const runtimeManifestPath = await writeFarmRouteRuntimeManifest(
|
|
3044
3071
|
_path2.default.join(root, distDir),
|
|
@@ -3059,8 +3086,8 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
3059
3086
|
_chunk7U4XF76Rcjs.logger.error(`\u274C Build failed: ${error}`);
|
|
3060
3087
|
throw error;
|
|
3061
3088
|
} finally {
|
|
3062
|
-
_optionalChain([rendererBuild, 'optionalAccess',
|
|
3063
|
-
_optionalChain([markdownPrecompile, 'optionalAccess',
|
|
3089
|
+
_optionalChain([rendererBuild, 'optionalAccess', _88 => _88.abort, 'call', _89 => _89()]);
|
|
3090
|
+
_optionalChain([markdownPrecompile, 'optionalAccess', _90 => _90.dispose, 'call', _91 => _91()]);
|
|
3064
3091
|
}
|
|
3065
3092
|
}
|
|
3066
3093
|
function collectFarmPrerenderedMarkdownBodies(pageRoutes) {
|
|
@@ -3068,7 +3095,7 @@ function collectFarmPrerenderedMarkdownBodies(pageRoutes) {
|
|
|
3068
3095
|
for (const route of pageRoutes) {
|
|
3069
3096
|
if (route.source === void 0 || !_chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) continue;
|
|
3070
3097
|
const { body } = _chunk26WP75W5cjs.parseMarkdownFrontmatter.call(void 0, route.source);
|
|
3071
|
-
const rendering =
|
|
3098
|
+
const rendering = _chunkERV422FOcjs.resolveRouteRenderingConfig.call(void 0,
|
|
3072
3099
|
_chunk26WP75W5cjs.readFarmMarkdownRouteConfig.call(void 0, body),
|
|
3073
3100
|
route.source
|
|
3074
3101
|
);
|
|
@@ -3083,7 +3110,7 @@ function varyFarmNitroCacheRules(rules, headerNames) {
|
|
|
3083
3110
|
if (headerNames.length === 0) return rules;
|
|
3084
3111
|
return Object.fromEntries(
|
|
3085
3112
|
Object.entries(rules).map(([source, rule]) => {
|
|
3086
|
-
const cached = _optionalChain([rule, 'optionalAccess',
|
|
3113
|
+
const cached = _optionalChain([rule, 'optionalAccess', _92 => _92.swr]) !== void 0 && rule.swr !== false || _optionalChain([rule, 'optionalAccess', _93 => _93.cache]) !== void 0 && rule.cache !== false;
|
|
3087
3114
|
if (!cached || rule.cache === false) return [source, rule];
|
|
3088
3115
|
const cache = rule.cache && typeof rule.cache === "object" ? rule.cache : {};
|
|
3089
3116
|
const varies = [
|
|
@@ -3093,9 +3120,9 @@ function varyFarmNitroCacheRules(rules, headerNames) {
|
|
|
3093
3120
|
})
|
|
3094
3121
|
);
|
|
3095
3122
|
}
|
|
3096
|
-
async function writeSSRAssetsToClient(bundle, outputDir) {
|
|
3123
|
+
async function writeSSRAssetsToClient(bundle, outputDir, polyroute) {
|
|
3097
3124
|
const fs5 = await import("fs/promises");
|
|
3098
|
-
const serverOnlyAssets = collectServerOnlySSRAssets(bundle);
|
|
3125
|
+
const serverOnlyAssets = collectServerOnlySSRAssets(bundle, polyroute);
|
|
3099
3126
|
for (const [fileName, output] of Object.entries(bundle)) {
|
|
3100
3127
|
if (output.type !== "asset" || serverOnlyAssets.has(fileName)) continue;
|
|
3101
3128
|
if (fileName === "farm-fonts.css") {
|
|
@@ -3112,7 +3139,7 @@ async function writeFarmVideoPlayerToClient(outputDir) {
|
|
|
3112
3139
|
const filePath = _path2.default.join(outputDir, _chunkY3DO7BIJcjs.FARM_VIDEO_PLAYER_PATH.slice(1));
|
|
3113
3140
|
await fs5.mkdir(_path2.default.dirname(filePath), { recursive: true });
|
|
3114
3141
|
try {
|
|
3115
|
-
await fs5.writeFile(filePath,
|
|
3142
|
+
await fs5.writeFile(filePath, _chunkPQ6DBVJ2cjs.FARM_VIDEO_PLAYER_HTML, { flag: "wx" });
|
|
3116
3143
|
} catch (error) {
|
|
3117
3144
|
if (error.code !== "EEXIST") throw error;
|
|
3118
3145
|
}
|
|
@@ -3146,7 +3173,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
|
|
|
3146
3173
|
}
|
|
3147
3174
|
const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
|
|
3148
3175
|
await fs5.writeFile(fontCssPath, normalizedFontCss);
|
|
3149
|
-
await fs5.writeFile(clientCssPath,
|
|
3176
|
+
await fs5.writeFile(clientCssPath, _chunkPQ6DBVJ2cjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
|
|
3150
3177
|
}
|
|
3151
3178
|
function importsFarmClientBlockedPackage(id, packageName) {
|
|
3152
3179
|
return id === packageName || id.startsWith(`${packageName}/`);
|
|
@@ -3196,10 +3223,10 @@ async function validateClientBuildOutput(root, srcDir, outputDir) {
|
|
|
3196
3223
|
}
|
|
3197
3224
|
}
|
|
3198
3225
|
function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, options = {}) {
|
|
3199
|
-
const key =
|
|
3226
|
+
const key = _chunkPA3VZNWUcjs.getClientModuleHydrationPlanKey.call(void 0, modulePath, root, mode, options);
|
|
3200
3227
|
let plan = cache.get(key);
|
|
3201
3228
|
if (!plan) {
|
|
3202
|
-
plan =
|
|
3229
|
+
plan = _chunkPA3VZNWUcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
|
|
3203
3230
|
cache.set(key, plan);
|
|
3204
3231
|
}
|
|
3205
3232
|
return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
|
|
@@ -3213,7 +3240,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3213
3240
|
farmPlugin,
|
|
3214
3241
|
farmServerOnlyEntriesPlugin
|
|
3215
3242
|
} = await import("./vite.cjs");
|
|
3216
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
3243
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-MWO3G2XM.cjs");
|
|
3217
3244
|
const fs5 = await import("fs/promises");
|
|
3218
3245
|
const pluginManager = new PluginManager2({
|
|
3219
3246
|
config,
|
|
@@ -3228,44 +3255,44 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3228
3255
|
const unsupportedIntegrationProvider = integrationProviders.find(
|
|
3229
3256
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
3230
3257
|
);
|
|
3231
|
-
if (_optionalChain([config, 'access',
|
|
3258
|
+
if (_optionalChain([config, 'access', _94 => _94.experimental, 'optionalAccess', _95 => _95.isolatedClientHydration]) === "enabled" && _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _96 => _96.experimental, 'optionalAccess', _97 => _97.serverComponents])) !== "rsc" && unsupportedIntegrationProvider) {
|
|
3232
3259
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
3233
3260
|
`[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
|
|
3234
3261
|
);
|
|
3235
3262
|
}
|
|
3236
|
-
const isolatedMode =
|
|
3237
|
-
_optionalChain([config, 'access',
|
|
3263
|
+
const isolatedMode = _chunkPA3VZNWUcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
3264
|
+
_optionalChain([config, 'access', _98 => _98.experimental, 'optionalAccess', _99 => _99.isolatedClientHydration]),
|
|
3238
3265
|
{
|
|
3239
|
-
serverComponents: _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
3266
|
+
serverComponents: _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _100 => _100.experimental, 'optionalAccess', _101 => _101.serverComponents])) === "rsc",
|
|
3240
3267
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
3241
3268
|
}
|
|
3242
3269
|
);
|
|
3243
|
-
const planOptions =
|
|
3270
|
+
const planOptions = _chunkPA3VZNWUcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
3244
3271
|
config.renderer,
|
|
3245
3272
|
Boolean(unsupportedIntegrationProvider)
|
|
3246
3273
|
);
|
|
3247
3274
|
const pagePlanOptions = {
|
|
3248
3275
|
...planOptions,
|
|
3249
|
-
serverOwners: _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
3276
|
+
serverOwners: _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _102 => _102.experimental, 'optionalAccess', _103 => _103.serverComponents])) === "islands"
|
|
3250
3277
|
};
|
|
3251
3278
|
const layoutPlanOptions = {
|
|
3252
3279
|
...planOptions,
|
|
3253
3280
|
serverTreeLayouts: pagePlanOptions.serverOwners
|
|
3254
3281
|
};
|
|
3255
|
-
const layoutAppliesToRoute =
|
|
3282
|
+
const layoutAppliesToRoute = _chunk4ZVKDHS6cjs.routeBoundaryCoversDirectory;
|
|
3256
3283
|
const routeDirectory = (route) => _nullishCoalesce(route.directory, () => ( route.pattern));
|
|
3257
|
-
const islandsMode = _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
3284
|
+
const islandsMode = _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _104 => _104.experimental, 'optionalAccess', _105 => _105.serverComponents])) === "islands";
|
|
3258
3285
|
const adapterOwnsDocsRuntime = _chunkL2GUEYHRcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs);
|
|
3259
|
-
const docsEntries = _optionalChain([config, 'access',
|
|
3286
|
+
const docsEntries = _optionalChain([config, 'access', _106 => _106.docs, 'optionalAccess', _107 => _107.enabled]) ? _chunkHR5GU4UUcjs.getFarmDocsRoots.call(void 0, config.docs).map(
|
|
3260
3287
|
(docsRoot) => `/${docsRoot.entry || "docs"}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/"
|
|
3261
3288
|
) : [];
|
|
3262
3289
|
const adapterDocsEntry = _nullishCoalesce(docsEntries[0], () => ( null));
|
|
3263
3290
|
const isAdapterDocsRoute = (routePattern) => adapterOwnsDocsRuntime && docsEntries.some(
|
|
3264
3291
|
(docsEntry) => docsEntry === "/" || routePattern === docsEntry || routePattern.startsWith(`${docsEntry}/`)
|
|
3265
3292
|
);
|
|
3266
|
-
const syntheticDocsEntry = _optionalChain([config, 'access',
|
|
3293
|
+
const syntheticDocsEntry = _optionalChain([config, 'access', _108 => _108.docs, 'optionalAccess', _109 => _109.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
|
|
3267
3294
|
const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
|
|
3268
|
-
const plan = (operation) => sourceSnapshot ?
|
|
3295
|
+
const plan = (operation) => sourceSnapshot ? _chunkPA3VZNWUcjs.withFarmSourceSnapshotOf.call(void 0, sourceSnapshot, operation) : _chunkPA3VZNWUcjs.withFarmSourceSnapshot.call(void 0, operation);
|
|
3269
3296
|
const { clientLayouts, clientRouteSlots } = plan(() => {
|
|
3270
3297
|
const clientLayouts2 = layoutRoutes.map((layout) => {
|
|
3271
3298
|
try {
|
|
@@ -3312,7 +3339,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3312
3339
|
};
|
|
3313
3340
|
}
|
|
3314
3341
|
});
|
|
3315
|
-
const markdownPagePlan =
|
|
3342
|
+
const markdownPagePlan = _chunkPA3VZNWUcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
3316
3343
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), root),
|
|
3317
3344
|
root,
|
|
3318
3345
|
isolatedMode,
|
|
@@ -3328,7 +3355,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3328
3355
|
pagePlanOptions
|
|
3329
3356
|
)
|
|
3330
3357
|
}));
|
|
3331
|
-
|
|
3358
|
+
_chunkPA3VZNWUcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
3332
3359
|
clientLayouts2.map((layout) => ({
|
|
3333
3360
|
pattern: layout.pattern,
|
|
3334
3361
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -3337,7 +3364,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3337
3364
|
[
|
|
3338
3365
|
...routePlans.map(({ route, metadata }) => ({
|
|
3339
3366
|
pattern: routeDirectory(route),
|
|
3340
|
-
depth:
|
|
3367
|
+
depth: _chunk4ZVKDHS6cjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
|
|
3341
3368
|
metadata
|
|
3342
3369
|
})),
|
|
3343
3370
|
...syntheticDocsPatterns.map((pattern) => ({
|
|
@@ -3362,7 +3389,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3362
3389
|
const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || docsEntries.some((docsEntry) => layoutAppliesToRoute(layout.pattern, docsEntry));
|
|
3363
3390
|
if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
|
|
3364
3391
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
3365
|
-
`\u26A0\uFE0F ${
|
|
3392
|
+
`\u26A0\uFE0F ${_chunkPA3VZNWUcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`
|
|
3366
3393
|
);
|
|
3367
3394
|
}
|
|
3368
3395
|
}
|
|
@@ -3397,7 +3424,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3397
3424
|
);
|
|
3398
3425
|
if (metadata.suppressedAsyncHydration) {
|
|
3399
3426
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
3400
|
-
`\u26A0\uFE0F ${
|
|
3427
|
+
`\u26A0\uFE0F ${_chunkPA3VZNWUcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
|
|
3401
3428
|
);
|
|
3402
3429
|
}
|
|
3403
3430
|
const slotBoundaries = serverSlotPlans.filter(
|
|
@@ -3405,7 +3432,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3405
3432
|
).flatMap(({ plan: plan2 }) => plan2.isolatedBoundaries);
|
|
3406
3433
|
if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0 || slotBoundaries.length > 0) {
|
|
3407
3434
|
const relativePath = route.modulePath.replace(root, "").replace(/^\//, "");
|
|
3408
|
-
const islandStrategy =
|
|
3435
|
+
const islandStrategy = _chunkPQ6DBVJ2cjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
3409
3436
|
route,
|
|
3410
3437
|
metadata,
|
|
3411
3438
|
clientLayouts2,
|
|
@@ -3424,7 +3451,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3424
3451
|
...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries || layout.serverTreeLayout).flatMap((layout) => layout.isolatedBoundaries)
|
|
3425
3452
|
],
|
|
3426
3453
|
// The server renders a server tree only below a hydrating layout.
|
|
3427
|
-
...
|
|
3454
|
+
..._chunkPA3VZNWUcjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
|
|
3428
3455
|
});
|
|
3429
3456
|
_chunk7U4XF76Rcjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
|
|
3430
3457
|
}
|
|
@@ -3461,7 +3488,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3461
3488
|
}
|
|
3462
3489
|
const clientRouteSlots2 = routeSlots.filter((slot) => {
|
|
3463
3490
|
try {
|
|
3464
|
-
const metadata =
|
|
3491
|
+
const metadata = _chunkPA3VZNWUcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root);
|
|
3465
3492
|
return metadata.shouldHydrate && (!islandsMode || metadata.isClientComponent);
|
|
3466
3493
|
} catch (error) {
|
|
3467
3494
|
_chunk7U4XF76Rcjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
|
|
@@ -3505,7 +3532,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3505
3532
|
srcDir,
|
|
3506
3533
|
adapterOwnsDocsRuntime ? false : _chunkN3H7UPBMcjs.isFarmDocsSearchEnabled.call(void 0, config.docs),
|
|
3507
3534
|
adapterOwnsDocsRuntime ? void 0 : _chunkN3H7UPBMcjs.resolveFarmDocsSearchClientModule.call(void 0, root),
|
|
3508
|
-
_optionalChain([config, 'access',
|
|
3535
|
+
_optionalChain([config, 'access', _110 => _110.docs, 'optionalAccess', _111 => _111.enabled]) ? _chunkHR5GU4UUcjs.getFarmDocsRoots.call(void 0, config.docs).map((docsRoot) => docsRoot.entry) : void 0,
|
|
3509
3536
|
adapterOwnsDocsRuntime ? _chunkL2GUEYHRcjs.getFarmDocsAdapterUIModule.call(void 0, config.docs.adapter) : void 0,
|
|
3510
3537
|
config.i18n,
|
|
3511
3538
|
config.plugins,
|
|
@@ -3514,11 +3541,11 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3514
3541
|
config.trailingSlash,
|
|
3515
3542
|
_chunkB3HQTGXScjs.getIntegrationProviders.call(void 0, config.integrations),
|
|
3516
3543
|
config.basePath,
|
|
3517
|
-
|
|
3544
|
+
_chunkPQ6DBVJ2cjs.generateClientCachePersistenceCode.call(void 0, _chunkPQ6DBVJ2cjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
|
|
3518
3545
|
adapterOwnsDocsRuntime ? _chunkXJDB564Acjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0,
|
|
3519
|
-
_chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
3546
|
+
_chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _112 => _112.experimental, 'optionalAccess', _113 => _113.serverComponents])) === "islands",
|
|
3520
3547
|
platform,
|
|
3521
|
-
islandsMode ?
|
|
3548
|
+
islandsMode ? _chunkPA3VZNWUcjs.collectFarmServerStylesheets.call(void 0,
|
|
3522
3549
|
[
|
|
3523
3550
|
...layoutRoutes.map((layout) => layout.modulePath),
|
|
3524
3551
|
...pageRoutes.filter((route) => !isAdapterDocsRoute(route.pattern)).map((route) => route.modulePath)
|
|
@@ -3542,7 +3569,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3542
3569
|
await fs5.writeFile(_path2.default.join(clientEntryDir, "farm-client-root.tsx"), clientEntry.root);
|
|
3543
3570
|
}
|
|
3544
3571
|
const clientInput = { [entryName]: clientEntryPath };
|
|
3545
|
-
if (platform === "web" &&
|
|
3572
|
+
if (platform === "web" && _chunkPQ6DBVJ2cjs.canBootFarmIslandsClient.call(void 0, config)) {
|
|
3546
3573
|
const clientBootPath = _path2.default.join(clientEntryDir, "farm-client-boot.tsx");
|
|
3547
3574
|
await fs5.writeFile(
|
|
3548
3575
|
clientBootPath,
|
|
@@ -3584,11 +3611,11 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3584
3611
|
target: FARM_CLIENT_BUILD_TARGET,
|
|
3585
3612
|
// Tailwind CSS 4 already requires newer browsers than that baseline. An app's own
|
|
3586
3613
|
// `build.target` or `build.cssTarget` still decides, as Vite derives one from the other.
|
|
3587
|
-
..._optionalChain([config, 'access',
|
|
3614
|
+
..._optionalChain([config, 'access', _114 => _114.vite, 'optionalAccess', _115 => _115.build, 'optionalAccess', _116 => _116.target]) === void 0 && _optionalChain([config, 'access', _117 => _117.vite, 'optionalAccess', _118 => _118.build, 'optionalAccess', _119 => _119.cssTarget]) === void 0 && (_chunkDMSXZNQRcjs.includesTailwindVitePlugin.call(void 0, tailwindVitePlugin) || _chunkDMSXZNQRcjs.includesTailwindVitePlugin.call(void 0, _optionalChain([config, 'access', _120 => _120.vite, 'optionalAccess', _121 => _121.plugins]))) ? { cssTarget: _chunkDMSXZNQRcjs.TAILWIND_CSS_BROWSER_TARGET } : {},
|
|
3588
3615
|
outDir: outputDir,
|
|
3589
3616
|
emptyOutDir: platform === "web",
|
|
3590
3617
|
// Never public: see resolveFarmClientSourcemap.
|
|
3591
|
-
sourcemap: resolveFarmClientSourcemap(_optionalChain([config, 'access',
|
|
3618
|
+
sourcemap: resolveFarmClientSourcemap(_optionalChain([config, 'access', _122 => _122.vite, 'optionalAccess', _123 => _123.build, 'optionalAccess', _124 => _124.sourcemap])),
|
|
3592
3619
|
assetsInlineLimit: 0,
|
|
3593
3620
|
cssCodeSplit: false,
|
|
3594
3621
|
// Bundle all CSS into one file
|
|
@@ -3598,10 +3625,9 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3598
3625
|
entryFileNames: "[name]-h[hash].js",
|
|
3599
3626
|
chunkFileNames: "chunks/[name]-h[hash].js",
|
|
3600
3627
|
hashCharacters: "hex",
|
|
3601
|
-
...islandsMode && _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, config.renderer) && !configuresFarmClientChunks(config.vite) ? { codeSplitting: { groups: [createFarmIslandsReactChunkGroup()] } } : {},
|
|
3602
3628
|
// Use predictable name for CSS so we can reference it in SSR HTML
|
|
3603
3629
|
assetFileNames: (assetInfo) => {
|
|
3604
|
-
if (_optionalChain([assetInfo, 'access',
|
|
3630
|
+
if (_optionalChain([assetInfo, 'access', _125 => _125.name, 'optionalAccess', _126 => _126.endsWith, 'call', _127 => _127(".css")])) {
|
|
3605
3631
|
return `${entryName}.css`;
|
|
3606
3632
|
}
|
|
3607
3633
|
return "assets/[name]-h[hash][extname]";
|
|
@@ -3618,7 +3644,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3618
3644
|
}
|
|
3619
3645
|
},
|
|
3620
3646
|
plugins: [
|
|
3621
|
-
|
|
3647
|
+
_chunkPQ6DBVJ2cjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
3622
3648
|
createFarmPrivateClientSourcemapsPlugin({
|
|
3623
3649
|
outDir: _path2.default.join(
|
|
3624
3650
|
_path2.default.dirname(outputDir),
|
|
@@ -3668,9 +3694,11 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3668
3694
|
...tailwindVitePlugin ? [tailwindVitePlugin] : [],
|
|
3669
3695
|
...rendererVitePlugins,
|
|
3670
3696
|
...config.vite.plugins || [],
|
|
3697
|
+
// React in one chunk, unless the app's config or one of its plugins splits chunks.
|
|
3698
|
+
...islandsMode && _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, config.renderer) ? [createFarmIslandsReactChunkPlugin()] : [],
|
|
3671
3699
|
farmServerOnlyEntriesPlugin({ platform, distDir: config.distDir || ".farm" }),
|
|
3672
3700
|
farmNavigationPlugin(config.renderer),
|
|
3673
|
-
|
|
3701
|
+
_chunkPQ6DBVJ2cjs.farmDocsClientConfigPlugin.call(void 0,
|
|
3674
3702
|
adapterOwnsDocsRuntime ? _chunkXJDB564Acjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
|
|
3675
3703
|
),
|
|
3676
3704
|
// Plugin to redirect @farm.js/core imports to client-only exports
|
|
@@ -3703,7 +3731,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3703
3731
|
},
|
|
3704
3732
|
load: {
|
|
3705
3733
|
filter: {
|
|
3706
|
-
id:
|
|
3734
|
+
id: _chunkPQ6DBVJ2cjs.exactIdPattern.call(void 0, [
|
|
3707
3735
|
"\0empty-module",
|
|
3708
3736
|
"\0empty-api-route",
|
|
3709
3737
|
"\0farm-i18n-client-bridge",
|
|
@@ -3741,7 +3769,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3741
3769
|
{ ...config, isolatedClientBoundaryModules, programmaticClientRoutes, sourceSnapshot },
|
|
3742
3770
|
pluginManager
|
|
3743
3771
|
),
|
|
3744
|
-
|
|
3772
|
+
_chunkPA3VZNWUcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
3745
3773
|
],
|
|
3746
3774
|
mode: "production",
|
|
3747
3775
|
css: postcssSearchPath ? {
|
|
@@ -3749,7 +3777,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3749
3777
|
} : void 0,
|
|
3750
3778
|
// Ensure React is bundled for client
|
|
3751
3779
|
resolve: {
|
|
3752
|
-
alias:
|
|
3780
|
+
alias: _chunkPQ6DBVJ2cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
3753
3781
|
dedupe: [...config.renderer.dedupe || []]
|
|
3754
3782
|
},
|
|
3755
3783
|
// Optimize dependencies - exclude server-side code from client bundle
|
|
@@ -3763,7 +3791,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
3763
3791
|
}
|
|
3764
3792
|
};
|
|
3765
3793
|
await viteBuild(
|
|
3766
|
-
|
|
3794
|
+
_chunkPQ6DBVJ2cjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite, { clientOutput: true })
|
|
3767
3795
|
);
|
|
3768
3796
|
if (platform === "mobile") {
|
|
3769
3797
|
await fs5.rm(_path2.default.join(outputDir, `${entryName}.css`), { force: true });
|
|
@@ -3857,9 +3885,9 @@ async function fetchFarmNavigationDocument(url, headers, recover = true, signal)
|
|
|
3857
3885
|
return response;
|
|
3858
3886
|
}
|
|
3859
3887
|
|
|
3860
|
-
${streamNavigations ? `${
|
|
3888
|
+
${streamNavigations ? `${_chunkPQ6DBVJ2cjs.FARM_NAVIGATION_STREAM_READER_SOURCE}
|
|
3861
3889
|
|
|
3862
|
-
${
|
|
3890
|
+
${_chunkPQ6DBVJ2cjs.FARM_EARLY_NAVIGATION_SOURCE}` : ""}
|
|
3863
3891
|
|
|
3864
3892
|
function clearFarmPrefetchCacheOnDeploymentMismatch(router, error) {
|
|
3865
3893
|
if (error?.name === "FarmDeploymentMismatchError") {
|
|
@@ -4028,8 +4056,8 @@ for (const type of FARM_ROUTE_TABLE_INTENT_EVENTS) {
|
|
|
4028
4056
|
}`;
|
|
4029
4057
|
}
|
|
4030
4058
|
function getFarmClientLayoutMatch(pattern) {
|
|
4031
|
-
const groupScope =
|
|
4032
|
-
return groupScope ? { pattern, urlPattern:
|
|
4059
|
+
const groupScope = _chunk4ZVKDHS6cjs.getRouteGroupScope.call(void 0, pattern);
|
|
4060
|
+
return groupScope ? { pattern, urlPattern: _chunk4ZVKDHS6cjs.stripRouteGroups.call(void 0, pattern), groupScope } : { pattern };
|
|
4033
4061
|
}
|
|
4034
4062
|
function generateFarmClientLayoutSelectionSource() {
|
|
4035
4063
|
return `function selectFarmClientLayouts(layouts, routePathname, readDirectory) {
|
|
@@ -5032,7 +5060,7 @@ function readFarmEntryImports(source) {
|
|
|
5032
5060
|
for (const match of source.matchAll(/^import\s+([^"';]+?)\s+from\s+(["'][^"']+["'])/gm)) {
|
|
5033
5061
|
const from = match[2];
|
|
5034
5062
|
const named = /\{([^}]*)\}/.exec(match[1]);
|
|
5035
|
-
for (const specifier of _nullishCoalesce(_optionalChain([named, 'optionalAccess',
|
|
5063
|
+
for (const specifier of _nullishCoalesce(_optionalChain([named, 'optionalAccess', _128 => _128[1], 'optionalAccess', _129 => _129.split, 'call', _130 => _130(",")]), () => ( []))) {
|
|
5036
5064
|
const [imported, local] = specifier.trim().split(/\s+as\s+/);
|
|
5037
5065
|
if (imported)
|
|
5038
5066
|
bindings.push({ local: _nullishCoalesce(local, () => ( imported)), clause: `{ ${specifier.trim()} }`, from });
|
|
@@ -5194,7 +5222,7 @@ import { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};
|
|
|
5194
5222
|
const React = { ...__farmRendererClient };`
|
|
5195
5223
|
);
|
|
5196
5224
|
const hydrateFarmRouteCall = _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, renderer) ? "return hydrateRoot(container, route.element);" : "return route.layouts.length > 0 ? hydrateRoot(container, route.element, route) : hydrateRoot(container, route.element);";
|
|
5197
|
-
const providerClientCode =
|
|
5225
|
+
const providerClientCode = _chunkPQ6DBVJ2cjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
5198
5226
|
integrationProviders,
|
|
5199
5227
|
root,
|
|
5200
5228
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
@@ -5218,12 +5246,12 @@ const React = { ...__farmRendererClient };`
|
|
|
5218
5246
|
const layoutRegistrations = [];
|
|
5219
5247
|
const layoutComponents = [];
|
|
5220
5248
|
const hydratingLayoutPatterns = layoutRoutes.filter((layout) => layout.shouldHydrate).map((layout) => layout.pattern);
|
|
5221
|
-
const treeLayoutPatterns = islandValues ?
|
|
5249
|
+
const treeLayoutPatterns = islandValues ? _chunk4ZVKDHS6cjs.getFarmServerTreeLayoutPatterns.call(void 0, layoutRoutes) : /* @__PURE__ */ new Set();
|
|
5222
5250
|
layoutRoutes.forEach((layout, index) => {
|
|
5223
5251
|
const relativePath = toImportPath(layout.modulePath);
|
|
5224
5252
|
const treeLayout = treeLayoutPatterns.has(layout.pattern);
|
|
5225
5253
|
const rendersOnClient = treeLayout || !layout.hasIsolatedClientBoundaries && hydratingLayoutPatterns.some(
|
|
5226
|
-
(pattern) =>
|
|
5254
|
+
(pattern) => _chunk4ZVKDHS6cjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern)
|
|
5227
5255
|
);
|
|
5228
5256
|
if (rendersOnClient && !treeLayout) {
|
|
5229
5257
|
layoutImportStatements.push(`import Layout${index} from "${relativePath}";`);
|
|
@@ -5311,7 +5339,7 @@ function isFarmDocsPath() {
|
|
|
5311
5339
|
// Farm.js Client Runtime (no client components)
|
|
5312
5340
|
${cssImport}
|
|
5313
5341
|
${layoutImports}
|
|
5314
|
-
import { createClientCancellation, createClientPluginManager, createPluginlessClientRuntime, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, installFarmLinkPrefetch, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, readFarmLinkNavigateOptions, rememberFarmLinkLocale, reconcileFarmDocumentHead, runFarmNavigationDelegates, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
5342
|
+
import { createClientCancellation, createClientPluginManager, createPluginlessClientRuntime, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, installFarmLinkPrefetch, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, isFarmSameDocumentFragment, readFarmLinkNavigateOptions, targetsCurrentContext, rememberFarmLinkLocale, reconcileFarmDocumentHead, runFarmNavigationDelegates, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
5315
5343
|
import { createFarmDeploymentMismatchError, createFarmDeploymentRequestHeaders, isFarmDeploymentMismatchResponse } from "@farm.js/core/deployment";
|
|
5316
5344
|
${clientPluginEntry.imports}
|
|
5317
5345
|
${clientCachePersistence.imports}
|
|
@@ -5328,7 +5356,7 @@ mountFarmDocsSearch();
|
|
|
5328
5356
|
|
|
5329
5357
|
${generateUniversalRouterStateRuntime()}
|
|
5330
5358
|
|
|
5331
|
-
${
|
|
5359
|
+
${_chunkPQ6DBVJ2cjs.FARM_NAVIGATION_SCRIPT_SOURCE}
|
|
5332
5360
|
|
|
5333
5361
|
// SPA Router for server-rendered pages (HTML swap)
|
|
5334
5362
|
const spaRouter = {
|
|
@@ -5527,6 +5555,7 @@ ${generateUniversalRouterStateProperties()}
|
|
|
5527
5555
|
}
|
|
5528
5556
|
});
|
|
5529
5557
|
}
|
|
5558
|
+
if (isFarmSameDocumentFragment(url.href, window.location.href)) return;
|
|
5530
5559
|
|
|
5531
5560
|
const pathname = url.pathname + url.search;
|
|
5532
5561
|
if (this.readFreshPrefetch(pathname) !== undefined) return;
|
|
@@ -5598,7 +5627,7 @@ document.addEventListener("click", function(e) {
|
|
|
5598
5627
|
if (anchor.hasAttribute("download")) return;
|
|
5599
5628
|
if (hasAbsoluteNavigationHref(href)) return;
|
|
5600
5629
|
if (href.startsWith("#")) return;
|
|
5601
|
-
if (anchor
|
|
5630
|
+
if (!targetsCurrentContext(anchor)) return;
|
|
5602
5631
|
if (document.documentElement.dataset.farmDocsRuntime === "true") return;
|
|
5603
5632
|
if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) return;
|
|
5604
5633
|
if (e.button !== 0) return;
|
|
@@ -5647,8 +5676,9 @@ let hydrateRoot;
|
|
|
5647
5676
|
let farmRendererLoading = null;
|
|
5648
5677
|
let farmRendererLoaded = false;${isolatedHydrationEnabled ? `
|
|
5649
5678
|
// The boot stops holding interactions once this entry runs. Until islx loads, islands that have not
|
|
5650
|
-
// hydrated hold them here, for their schedulers to replay
|
|
5651
|
-
|
|
5679
|
+
// hydrated hold them here, for their schedulers to replay, and a server component's form waits for
|
|
5680
|
+
// islx to post it without a page load.
|
|
5681
|
+
const releaseFarmIslandInteractions = holdFarmIslandInteractions("f-island", loadFarmRenderer);` : ""}
|
|
5652
5682
|
function loadFarmRenderer() {
|
|
5653
5683
|
return farmRendererLoading || (farmRendererLoading = Promise.all([
|
|
5654
5684
|
import("react"),
|
|
@@ -5822,7 +5852,7 @@ ${lazyRoot ? "" : layoutImports}
|
|
|
5822
5852
|
${rendererClientImports}
|
|
5823
5853
|
${isolatedHydrationImport}
|
|
5824
5854
|
${providerClientCode.imports}
|
|
5825
|
-
import { createClientCancellation, createClientPluginManager, createPluginlessClientRuntime, getFarmIslandValueHeaders, getHashTargetElement, keepFarmIslandValues, installChunkErrorRecovery, installFarmLinkPrefetch, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, readFarmLinkNavigateOptions, rememberFarmLinkLocale, reconcileFarmDocumentHead, replayFarmQueuedInteraction, runFarmNavigationDelegates, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
5855
|
+
import { createClientCancellation, createClientPluginManager, createPluginlessClientRuntime, getFarmIslandValueHeaders, getHashTargetElement, keepFarmIslandValues, installChunkErrorRecovery, installFarmLinkPrefetch, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, isFarmSameDocumentFragment, readFarmLinkNavigateOptions, targetsCurrentContext, rememberFarmLinkLocale, reconcileFarmDocumentHead, replayFarmQueuedInteraction, runFarmNavigationDelegates, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
5826
5856
|
import { createFarmDeploymentMismatchError, createFarmDeploymentRequestHeaders, isFarmDeploymentMismatchResponse } from "@farm.js/core/deployment";
|
|
5827
5857
|
${lazyMatcher ? "" : 'import { createFarmRouter, isFarmRouteActive, matchFarmRoute } from "@farm.js/core/router";'}
|
|
5828
5858
|
${clientPluginEntry.imports}
|
|
@@ -5868,7 +5898,7 @@ ${layoutRegistrations.join(",\n")}
|
|
|
5868
5898
|
${generateFarmClientRouteMatchSource({ lazyMatcher })}
|
|
5869
5899
|
|
|
5870
5900
|
${layoutComponentsRuntime}/*farm-root-start*/
|
|
5871
|
-
${
|
|
5901
|
+
${_chunkPQ6DBVJ2cjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
5872
5902
|
// Wrap a page element with applicable layouts
|
|
5873
5903
|
function wrapWithLayouts(pageElement, pathname, params) {
|
|
5874
5904
|
const layouts = getApplicableLayouts(pathname);
|
|
@@ -5903,7 +5933,7 @@ function createLayoutPageBoundary(route, pageElement, serverHtml) {
|
|
|
5903
5933
|
return React.createElement("div", props, pageElement);
|
|
5904
5934
|
}
|
|
5905
5935
|
let farmLastRouteState = null;
|
|
5906
|
-
${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${
|
|
5936
|
+
${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunkPQ6DBVJ2cjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
|
|
5907
5937
|
function farmTreeLayoutsOf(pathname) {
|
|
5908
5938
|
return getApplicableLayouts(pathname).filter(function(layout) {
|
|
5909
5939
|
return layout.serverTree === true;
|
|
@@ -6537,7 +6567,7 @@ function fitsSegmentResponse(currentRoot, nextRoot) {
|
|
|
6537
6567
|
return true;
|
|
6538
6568
|
}` : ""}
|
|
6539
6569
|
|
|
6540
|
-
${
|
|
6570
|
+
${_chunkPQ6DBVJ2cjs.FARM_NAVIGATION_SCRIPT_SOURCE}
|
|
6541
6571
|
|
|
6542
6572
|
function activateNavigationScripts(root) {
|
|
6543
6573
|
for (const script of Array.from(root?.querySelectorAll?.("script") || [])) {
|
|
@@ -6643,7 +6673,7 @@ function getLayoutShell(root, patterns, index) {
|
|
|
6643
6673
|
return shell.innerHTML;
|
|
6644
6674
|
}
|
|
6645
6675
|
|
|
6646
|
-
${islandValues ?
|
|
6676
|
+
${islandValues ? _chunkPQ6DBVJ2cjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceSharedLayoutBoundary(currentRoot, nextRoot, refresh = false) {
|
|
6647
6677
|
// A refresh keeps the islands still on the page: the ones in streamed Suspense content too.
|
|
6648
6678
|
if (refresh) revealFarmStreamedContent(nextRoot);
|
|
6649
6679
|
const currentPatterns = getLayoutPatterns(currentRoot);
|
|
@@ -7215,6 +7245,7 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
|
|
|
7215
7245
|
}
|
|
7216
7246
|
});
|
|
7217
7247
|
}
|
|
7248
|
+
if (isFarmSameDocumentFragment(url.href, window.location.href)) return;
|
|
7218
7249
|
prefetchFarmClientRouteTable();
|
|
7219
7250
|
|
|
7220
7251
|
// A prefetch warms an ordinary future navigation, which reads the bare
|
|
@@ -7296,7 +7327,7 @@ document.addEventListener("click", function(e) {
|
|
|
7296
7327
|
if (anchor.hasAttribute("download")) return;
|
|
7297
7328
|
if (hasAbsoluteNavigationHref(href)) return;
|
|
7298
7329
|
if (href.startsWith("#")) return;
|
|
7299
|
-
if (anchor
|
|
7330
|
+
if (!targetsCurrentContext(anchor)) return;
|
|
7300
7331
|
if (document.documentElement.dataset.farmDocsRuntime === "true") return;
|
|
7301
7332
|
if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) return;
|
|
7302
7333
|
if (e.button !== 0) return;
|
|
@@ -7322,7 +7353,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7322
7353
|
farmPlugin,
|
|
7323
7354
|
farmServerOnlyEntriesPlugin
|
|
7324
7355
|
} = await import("./vite.cjs");
|
|
7325
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
7356
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-MWO3G2XM.cjs");
|
|
7326
7357
|
const fs5 = await import("fs/promises");
|
|
7327
7358
|
const pluginManager = new PluginManager2({
|
|
7328
7359
|
config,
|
|
@@ -7348,6 +7379,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7348
7379
|
label: "for SSR"
|
|
7349
7380
|
});
|
|
7350
7381
|
}
|
|
7382
|
+
let polyroute = false;
|
|
7351
7383
|
let ssrBundle;
|
|
7352
7384
|
let ssrEntryFile;
|
|
7353
7385
|
const pageRoutes = collectedPageRoutes.map((route) => ({ ...route }));
|
|
@@ -7425,7 +7457,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7425
7457
|
const appDirs = _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, config);
|
|
7426
7458
|
let openAPIReference = null;
|
|
7427
7459
|
if (config.openapi.enabled && config.openapi.route) {
|
|
7428
|
-
const { OpenAPIManager, renderOpenAPIReferenceHTML } = await import("./manager-
|
|
7460
|
+
const { OpenAPIManager, renderOpenAPIReferenceHTML } = await import("./manager-D4DZRBRS.cjs");
|
|
7429
7461
|
const openAPIManager = new OpenAPIManager(appDirs, config.openapi, {
|
|
7430
7462
|
mode: "production",
|
|
7431
7463
|
apiBaseURL: config.api.baseURL,
|
|
@@ -7450,7 +7482,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7450
7482
|
}))
|
|
7451
7483
|
);
|
|
7452
7484
|
const instrumentationPath = _chunk3BTN3NP7cjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
|
|
7453
|
-
const notFoundPath =
|
|
7485
|
+
const notFoundPath = _chunkPQ6DBVJ2cjs.resolveFarmNotFoundComponentPath.call(void 0,
|
|
7454
7486
|
config,
|
|
7455
7487
|
appDirs,
|
|
7456
7488
|
routeManager.getRendererNotFoundPath()
|
|
@@ -7475,9 +7507,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7475
7507
|
(provider) => provider.component || provider.type === "clerk"
|
|
7476
7508
|
);
|
|
7477
7509
|
const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
|
|
7478
|
-
const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access',
|
|
7479
|
-
const hasMiddlewareConfig =
|
|
7480
|
-
const hasRouteContextConfig =
|
|
7510
|
+
const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _131 => _131.mdx, 'optionalAccess', _132 => _132.components]));
|
|
7511
|
+
const hasMiddlewareConfig = _chunk4ZVKDHS6cjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
7512
|
+
const hasRouteContextConfig = _chunkIRPXOTENcjs.hasCustomFarmRouteContext.call(void 0, config);
|
|
7481
7513
|
const hasServerRuntimePlugins = _chunkDMSXZNQRcjs.hasFarmServerRuntimePlugins.call(void 0, config.plugins);
|
|
7482
7514
|
const hasPluginRoutes = hasFarmPluginRoutes(config);
|
|
7483
7515
|
const hasServerCacheConfig = hasFarmServerCacheConfig(config.cache);
|
|
@@ -7489,7 +7521,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7489
7521
|
);
|
|
7490
7522
|
if (_chunkL2GUEYHRcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
|
|
7491
7523
|
const adapterGuardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
|
|
7492
|
-
|
|
7524
|
+
_chunkSG5RFGV6cjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
|
|
7493
7525
|
config.docs,
|
|
7494
7526
|
{ root, srcDir: config.srcDir },
|
|
7495
7527
|
(pathname) => adapterGuardedPaths.has(pathname),
|
|
@@ -7497,9 +7529,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7497
7529
|
);
|
|
7498
7530
|
}
|
|
7499
7531
|
const farmDocsCspNonceMarker = _chunk6JHZPB52cjs.createFarmCspNonce.call(void 0, config.security);
|
|
7500
|
-
const farmDocsPrecompiledManifest = _optionalChain([config, 'access',
|
|
7532
|
+
const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _133 => _133.docs, 'optionalAccess', _134 => _134.enabled]) && _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunk2RSVYJT6cjs._runWithFarmCspNonce.call(void 0,
|
|
7501
7533
|
farmDocsCspNonceMarker,
|
|
7502
|
-
async () => _optionalChain([config, 'access',
|
|
7534
|
+
async () => _optionalChain([config, 'access', _135 => _135.docs, 'access', _136 => _136.adapter, 'optionalAccess', _137 => _137.server]) ? await _chunkSG5RFGV6cjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
|
|
7503
7535
|
root,
|
|
7504
7536
|
srcDir: config.srcDir,
|
|
7505
7537
|
clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
|
|
@@ -7613,7 +7645,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7613
7645
|
// Adapters can render provider scripts by serializing function source.
|
|
7614
7646
|
// keepNames injects helper calls into those functions; after Nitro
|
|
7615
7647
|
// minifies the server chunk the helper is no longer in script scope.
|
|
7616
|
-
keepNames: !(_optionalChain([config, 'access',
|
|
7648
|
+
keepNames: !(_optionalChain([config, 'access', _138 => _138.docs, 'optionalAccess', _139 => _139.enabled]) && _optionalChain([config, 'access', _140 => _140.docs, 'access', _141 => _141.adapter, 'optionalAccess', _142 => _142.server])),
|
|
7617
7649
|
jsxDev: false
|
|
7618
7650
|
},
|
|
7619
7651
|
// SSR configuration to externalize problematic modules
|
|
@@ -7663,10 +7695,10 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7663
7695
|
define: {
|
|
7664
7696
|
__FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
|
|
7665
7697
|
__FARM_ENV__: JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, config.env)),
|
|
7666
|
-
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access',
|
|
7698
|
+
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _143 => _143.env, 'optionalAccess', _144 => _144.public]) || {})
|
|
7667
7699
|
},
|
|
7668
7700
|
plugins: [
|
|
7669
|
-
|
|
7701
|
+
_chunkPQ6DBVJ2cjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
7670
7702
|
...tailwindVitePlugin ? [tailwindVitePlugin] : [],
|
|
7671
7703
|
...rendererVitePlugins,
|
|
7672
7704
|
...config.vite.plugins || [],
|
|
@@ -7698,7 +7730,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7698
7730
|
},
|
|
7699
7731
|
pluginManager
|
|
7700
7732
|
),
|
|
7701
|
-
|
|
7733
|
+
_chunkPA3VZNWUcjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
|
|
7702
7734
|
...hasRuntimeConfigModule ? [
|
|
7703
7735
|
farmStripPlatformConfigPlugin(
|
|
7704
7736
|
[
|
|
@@ -7710,7 +7742,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7710
7742
|
{
|
|
7711
7743
|
name: "farm-virtual-ssr-entry",
|
|
7712
7744
|
resolveId: {
|
|
7713
|
-
filter: { id:
|
|
7745
|
+
filter: { id: _chunkPQ6DBVJ2cjs.exactIdPattern.call(void 0, [virtualEntryId, "\0virtual:farm-ssr-entry"]) },
|
|
7714
7746
|
handler(id) {
|
|
7715
7747
|
if (id === virtualEntryId || id === "\0virtual:farm-ssr-entry") {
|
|
7716
7748
|
return virtualEntryId;
|
|
@@ -7719,7 +7751,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7719
7751
|
}
|
|
7720
7752
|
},
|
|
7721
7753
|
load: {
|
|
7722
|
-
filter: { id:
|
|
7754
|
+
filter: { id: _chunkPQ6DBVJ2cjs.exactIdPattern.call(void 0, [virtualEntryId]) },
|
|
7723
7755
|
handler(id) {
|
|
7724
7756
|
if (id === virtualEntryId) {
|
|
7725
7757
|
return virtualEntryCode;
|
|
@@ -7730,16 +7762,24 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7730
7762
|
},
|
|
7731
7763
|
{
|
|
7732
7764
|
name: "capture-ssr-bundle",
|
|
7733
|
-
|
|
7734
|
-
|
|
7735
|
-
|
|
7736
|
-
|
|
7737
|
-
|
|
7738
|
-
|
|
7765
|
+
configResolved(config2) {
|
|
7766
|
+
polyroute = _chunkBQHIJOZMcjs.hasPolyroutePlugin.call(void 0, config2.plugins);
|
|
7767
|
+
},
|
|
7768
|
+
enforce: "post",
|
|
7769
|
+
generateBundle: {
|
|
7770
|
+
// Retain assets emitted by user plugins, including post-generateBundle hooks.
|
|
7771
|
+
order: "post",
|
|
7772
|
+
handler(_options, bundle) {
|
|
7773
|
+
ssrBundle = bundle;
|
|
7774
|
+
for (const [fileName, file] of Object.entries(bundle)) {
|
|
7775
|
+
if (file.type === "chunk" && file.isEntry) {
|
|
7776
|
+
ssrEntryFile = fileName;
|
|
7777
|
+
break;
|
|
7778
|
+
}
|
|
7779
|
+
}
|
|
7780
|
+
if (!ssrEntryFile) {
|
|
7781
|
+
throw new Error("No entry point found in SSR bundle");
|
|
7739
7782
|
}
|
|
7740
|
-
}
|
|
7741
|
-
if (!ssrEntryFile) {
|
|
7742
|
-
throw new Error("No entry point found in SSR bundle");
|
|
7743
7783
|
}
|
|
7744
7784
|
}
|
|
7745
7785
|
}
|
|
@@ -7751,7 +7791,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7751
7791
|
resolve: {
|
|
7752
7792
|
alias: [
|
|
7753
7793
|
...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
|
|
7754
|
-
...Object.entries(
|
|
7794
|
+
...Object.entries(_chunkPQ6DBVJ2cjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
|
|
7755
7795
|
([find, replacement]) => ({ find, replacement })
|
|
7756
7796
|
)
|
|
7757
7797
|
],
|
|
@@ -7759,7 +7799,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7759
7799
|
dedupe: [...config.renderer.dedupe || []]
|
|
7760
7800
|
}
|
|
7761
7801
|
};
|
|
7762
|
-
await viteBuild(
|
|
7802
|
+
await viteBuild(_chunkPQ6DBVJ2cjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
|
|
7763
7803
|
} finally {
|
|
7764
7804
|
if (postcssConfigDir) {
|
|
7765
7805
|
try {
|
|
@@ -7769,6 +7809,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
7769
7809
|
}
|
|
7770
7810
|
}
|
|
7771
7811
|
return {
|
|
7812
|
+
polyroute,
|
|
7772
7813
|
bundle: ssrBundle,
|
|
7773
7814
|
entryFile: ssrEntryFile,
|
|
7774
7815
|
configuredHeaderRoutes
|
|
@@ -7795,7 +7836,7 @@ function readFarmPageLastModified(pageRoutes) {
|
|
|
7795
7836
|
return lastModified;
|
|
7796
7837
|
}
|
|
7797
7838
|
function getFarmDocsGuardedPaths(config, middlewareRoutes) {
|
|
7798
|
-
if (!_optionalChain([config, 'access',
|
|
7839
|
+
if (!_optionalChain([config, 'access', _145 => _145.docs, 'optionalAccess', _146 => _146.enabled])) return [];
|
|
7799
7840
|
const options = { root: config.root, srcDir: config.srcDir };
|
|
7800
7841
|
const guards = {
|
|
7801
7842
|
config: { middleware: config.middleware, integrations: config.integrations },
|
|
@@ -7803,18 +7844,18 @@ function getFarmDocsGuardedPaths(config, middlewareRoutes) {
|
|
|
7803
7844
|
};
|
|
7804
7845
|
return _chunkHR5GU4UUcjs.getFarmDocsRoots.call(void 0, config.docs).flatMap(
|
|
7805
7846
|
(docsRoot) => _chunkHR5GU4UUcjs.discoverFarmDocsPages.call(void 0, _chunkHR5GU4UUcjs.resolveFarmDocsContentDir.call(void 0, docsRoot, options), docsRoot)
|
|
7806
|
-
).flatMap((page) => [page.href, _chunkHR5GU4UUcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) =>
|
|
7847
|
+
).flatMap((page) => [page.href, _chunkHR5GU4UUcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunk4ZVKDHS6cjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
|
|
7807
7848
|
}
|
|
7808
7849
|
function getFarmAppOwnedDocsEnginePaths(agent, applicationMetadataRoutes) {
|
|
7809
|
-
const llmsTxt = _optionalChain([agent, 'optionalAccess',
|
|
7850
|
+
const llmsTxt = _optionalChain([agent, 'optionalAccess', _147 => _147.llmsTxt]);
|
|
7810
7851
|
const ownedByFile = (kind) => applicationMetadataRoutes.some(
|
|
7811
7852
|
(metadata) => metadata.kind === kind && metadata.pattern === "/"
|
|
7812
7853
|
);
|
|
7813
7854
|
return [
|
|
7814
|
-
..._optionalChain([llmsTxt, 'optionalAccess',
|
|
7815
|
-
..._optionalChain([llmsTxt, 'optionalAccess',
|
|
7816
|
-
..._optionalChain([agent, 'optionalAccess',
|
|
7817
|
-
..._optionalChain([agent, 'optionalAccess',
|
|
7855
|
+
..._optionalChain([llmsTxt, 'optionalAccess', _148 => _148.enabled]) || ownedByFile("llms") ? ["/llms.txt"] : [],
|
|
7856
|
+
..._optionalChain([llmsTxt, 'optionalAccess', _149 => _149.enabled]) && llmsTxt.full || ownedByFile("llms-full") ? ["/llms-full.txt"] : [],
|
|
7857
|
+
..._optionalChain([agent, 'optionalAccess', _150 => _150.sitemap, 'optionalAccess', _151 => _151.enabled]) || ownedByFile("sitemap") ? ["/sitemap.xml"] : [],
|
|
7858
|
+
..._optionalChain([agent, 'optionalAccess', _152 => _152.crawlers, 'optionalAccess', _153 => _153.enabled]) || ownedByFile("robots") ? ["/robots.txt"] : []
|
|
7818
7859
|
];
|
|
7819
7860
|
}
|
|
7820
7861
|
function generateFarmDocsAdapterHandlerArguments(docs, docsConfigModulePath) {
|
|
@@ -7825,7 +7866,7 @@ function generateFarmDocsAdapterHandlerArguments(docs, docsConfigModulePath) {
|
|
|
7825
7866
|
docsPath: ${root}.entry,
|
|
7826
7867
|
contentDir: ${root}.contentDir || ${root}.config?.contentDir,
|
|
7827
7868
|
}`;
|
|
7828
|
-
if (_optionalChain([docs, 'optionalAccess',
|
|
7869
|
+
if (_optionalChain([docs, 'optionalAccess', _154 => _154.roots, 'optionalAccess', _155 => _155.length])) {
|
|
7829
7870
|
return {
|
|
7830
7871
|
factory: "createFarmDocsAdapterMultiRuntimeHandler",
|
|
7831
7872
|
config: `[farmDocsResolvedConfig, ...farmDocsResolvedConfig.roots].map((farmDocsRoot) => (${runtimeConfig("farmDocsRoot")}))`
|
|
@@ -7838,7 +7879,7 @@ function generateFarmDocsAdapterHandlerArguments(docs, docsConfigModulePath) {
|
|
|
7838
7879
|
}
|
|
7839
7880
|
function generateFarmDocsRuntimeConfigExpression(docs, precompiled = false) {
|
|
7840
7881
|
if (!docs.enabled) return "null";
|
|
7841
|
-
const serializableDocs = _optionalChain([docs, 'access',
|
|
7882
|
+
const serializableDocs = _optionalChain([docs, 'access', _156 => _156.roots, 'optionalAccess', _157 => _157.length]) ? {
|
|
7842
7883
|
...docs,
|
|
7843
7884
|
// React elements and functions do not survive JSON; see runtimeConfig below.
|
|
7844
7885
|
roots: docs.roots.map((docsRoot) => ({ ...docsRoot, runtimeConfig: void 0 }))
|
|
@@ -7872,7 +7913,7 @@ function generateFarmDocsRuntimeConfigExpression(docs, precompiled = false) {
|
|
|
7872
7913
|
},
|
|
7873
7914
|
}
|
|
7874
7915
|
: ${JSON.stringify({ ...serializableDocs, runtimeConfig: void 0 })}`;
|
|
7875
|
-
if (!_optionalChain([docs, 'access',
|
|
7916
|
+
if (!_optionalChain([docs, 'access', _158 => _158.roots, 'optionalAccess', _159 => _159.length])) return expression;
|
|
7876
7917
|
return `((farmDocs) => ({
|
|
7877
7918
|
...farmDocs,
|
|
7878
7919
|
roots: farmDocs.roots.map((farmDocsRoot, index) => {
|
|
@@ -7889,7 +7930,7 @@ function toVirtualEntryImportSpecifier(modulePath) {
|
|
|
7889
7930
|
return JSON.stringify(modulePath.replace(/\\/g, "/"));
|
|
7890
7931
|
}
|
|
7891
7932
|
function generateNativeAuthIntegrationSource(auth) {
|
|
7892
|
-
if (_optionalChain([auth, 'optionalAccess',
|
|
7933
|
+
if (_optionalChain([auth, 'optionalAccess', _160 => _160.enabled]) !== true) {
|
|
7893
7934
|
return { importSource: "", registerSource: "" };
|
|
7894
7935
|
}
|
|
7895
7936
|
return {
|
|
@@ -8208,26 +8249,26 @@ function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlot
|
|
|
8208
8249
|
(route) => route.searchPreserve ? [route.searchPreserve] : []
|
|
8209
8250
|
);
|
|
8210
8251
|
const searchPreserveRoutesSource = searchPreserveRoutes.length > 0 ? JSON.stringify(searchPreserveRoutes) : "";
|
|
8211
|
-
const farmIslandsMode = _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
8212
|
-
const farmRendererActions =
|
|
8213
|
-
const farmClientBoot =
|
|
8252
|
+
const farmIslandsMode = _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _161 => _161.experimental, 'optionalAccess', _162 => _162.serverComponents])) === "islands";
|
|
8253
|
+
const farmRendererActions = _chunkPQ6DBVJ2cjs.resolveFarmIslxActionsMode.call(void 0, config) === "renderer";
|
|
8254
|
+
const farmClientBoot = _chunkPQ6DBVJ2cjs.canBootFarmIslandsClient.call(void 0, config);
|
|
8214
8255
|
const farmMobileClient = shouldBuildFarmMobileClient(config);
|
|
8215
8256
|
const farmMobileShells = farmMobileClient && config.mobileShells ? config.mobileShells : null;
|
|
8216
8257
|
const hasCompressionRuntime = config.compress && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) !== "edge";
|
|
8217
|
-
const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access',
|
|
8258
|
+
const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access', _163 => _163.agent, 'optionalAccess', _164 => _164.crawlers, 'optionalAccess', _165 => _165.enabled])) && !applicationMetadataRoutes.some(
|
|
8218
8259
|
(metadata) => metadata.kind === "robots" && metadata.pattern === "/"
|
|
8219
8260
|
);
|
|
8220
|
-
const servesAgentSitemap = Boolean(_optionalChain([config, 'access',
|
|
8261
|
+
const servesAgentSitemap = Boolean(_optionalChain([config, 'access', _166 => _166.agent, 'optionalAccess', _167 => _167.sitemap, 'optionalAccess', _168 => _168.enabled])) && !applicationMetadataRoutes.some(
|
|
8221
8262
|
(metadata) => metadata.kind === "sitemap" && metadata.pattern === "/"
|
|
8222
8263
|
);
|
|
8223
|
-
const servesDefaultMCP = _optionalChain([config, 'access',
|
|
8224
|
-
const servesAiCatalog = _optionalChain([config, 'access',
|
|
8264
|
+
const servesDefaultMCP = _optionalChain([config, 'access', _169 => _169.agent, 'optionalAccess', _170 => _170.mcp]) === true && !_chunkW53Z4WDIcjs.farmConfigMountsMCP.call(void 0, config) && !apiRoutes.some((route) => route.path === "/api/mcp");
|
|
8265
|
+
const servesAiCatalog = _optionalChain([config, 'access', _171 => _171.agent, 'optionalAccess', _172 => _172.aiCatalog]) !== false;
|
|
8225
8266
|
const hasPluginRuntime = hasRuntimeIntegrationConfig || hasServerRuntimePlugins;
|
|
8226
8267
|
const hasInfraAnalyticsRuntime = config.analytics !== false && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
|
|
8227
|
-
const reportsWebMCPCalls = hasInfraAnalyticsRuntime &&
|
|
8268
|
+
const reportsWebMCPCalls = hasInfraAnalyticsRuntime && _chunkFEWCWBOFcjs._farmWebMCPReportsEnabled.call(void 0, config.plugins);
|
|
8228
8269
|
const hasPrecompiledDocs = Boolean(farmDocsPrecompiledManifest);
|
|
8229
8270
|
const adapterOwnsDocsRuntime = _chunkL2GUEYHRcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs);
|
|
8230
|
-
if (_optionalChain([config, 'access',
|
|
8271
|
+
if (_optionalChain([config, 'access', _173 => _173.docs, 'optionalAccess', _174 => _174.enabled]) && _optionalChain([config, 'access', _175 => _175.docs, 'access', _176 => _176.roots, 'optionalAccess', _177 => _177.length]) && !adapterOwnsDocsRuntime) {
|
|
8231
8272
|
throw new Error(
|
|
8232
8273
|
"Several docs roots need a docs adapter; Farm's built-in docs renderer serves a single docs root."
|
|
8233
8274
|
);
|
|
@@ -8235,7 +8276,7 @@ function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlot
|
|
|
8235
8276
|
const docsConfigModulePath = adapterOwnsDocsRuntime && !hasPrecompiledDocs && config.docs.configPath && !config.docs.configPath.endsWith(".json") ? config.docs.configPath : void 0;
|
|
8236
8277
|
const adapterHandler = generateFarmDocsAdapterHandlerArguments(config.docs, docsConfigModulePath);
|
|
8237
8278
|
const hasIsolatedClientGraphRuntime = _chunkT7UC2ORAcjs.isReactRenderer.call(void 0, config.renderer) && isolatedClientBoundaryModules.size > 0;
|
|
8238
|
-
const hasRendererIslandsGraph = isolatedClientBoundaryModules.size > 0 &&
|
|
8279
|
+
const hasRendererIslandsGraph = isolatedClientBoundaryModules.size > 0 && _chunkZ43CIBURcjs.usesFarmRendererIslands.call(void 0, config);
|
|
8239
8280
|
const rendererStreamingCapabilities = _chunkT7UC2ORAcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0,
|
|
8240
8281
|
config.renderer,
|
|
8241
8282
|
_chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset)
|
|
@@ -8299,8 +8340,8 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8299
8340
|
(image) => image.sourceType === "module"
|
|
8300
8341
|
);
|
|
8301
8342
|
const edgeMiddlewareFilePaths = farmTargetRunsEdgeMiddleware(preset) ? middlewareRoutes.filter(isFarmEdgeMiddlewareRoute).map((route) => route.filePath) : [];
|
|
8302
|
-
const hasMiddlewareRuntime = middlewareRoutes.length > 0 ||
|
|
8303
|
-
const farmDocsFontAssets = _optionalChain([config, 'access',
|
|
8343
|
+
const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunk4ZVKDHS6cjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
8344
|
+
const farmDocsFontAssets = _optionalChain([config, 'access', _178 => _178.docs, 'optionalAccess', _179 => _179.enabled]) ? _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkERMUL73Lcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
|
|
8304
8345
|
const integrationProviders = _chunkB3HQTGXScjs.getIntegrationProviders.call(void 0, config.integrations);
|
|
8305
8346
|
const renderedIntegrationProviders = integrationProviders.filter(
|
|
8306
8347
|
(provider) => provider.component || provider.type === "clerk"
|
|
@@ -8310,16 +8351,16 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8310
8351
|
`Integration provider components are not supported by the "${config.renderer.name}" renderer.`
|
|
8311
8352
|
);
|
|
8312
8353
|
}
|
|
8313
|
-
const providerServerModules =
|
|
8354
|
+
const providerServerModules = _chunkPQ6DBVJ2cjs.generateFarmIntegrationProviderServerModules.call(void 0,
|
|
8314
8355
|
renderedIntegrationProviders,
|
|
8315
8356
|
config.root,
|
|
8316
8357
|
_nullishCoalesce(config.renderer.componentExtensions, () => ( []))
|
|
8317
8358
|
);
|
|
8318
8359
|
const resolvedIntegrationProviderFallback = Object.fromEntries(
|
|
8319
8360
|
Object.entries(config.integrations).flatMap(([name, integration]) => {
|
|
8320
|
-
const configuredProviders = _optionalChain([integration, 'optionalAccess',
|
|
8361
|
+
const configuredProviders = _optionalChain([integration, 'optionalAccess', _180 => _180.providers]);
|
|
8321
8362
|
const providers = Array.isArray(configuredProviders) ? configuredProviders : [];
|
|
8322
|
-
if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess',
|
|
8363
|
+
if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess', _181 => _181.component]) === "function")) {
|
|
8323
8364
|
throw new Error(
|
|
8324
8365
|
`Integration provider components in production must use an importable component reference, for example component: { module: "@/components/provider" }.`
|
|
8325
8366
|
);
|
|
@@ -8330,22 +8371,22 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8330
8371
|
const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
|
|
8331
8372
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
8332
8373
|
);
|
|
8333
|
-
const isolatedHydrationMode =
|
|
8334
|
-
_optionalChain([config, 'access',
|
|
8374
|
+
const isolatedHydrationMode = _chunkPA3VZNWUcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
8375
|
+
_optionalChain([config, 'access', _182 => _182.experimental, 'optionalAccess', _183 => _183.isolatedClientHydration]),
|
|
8335
8376
|
{
|
|
8336
|
-
serverComponents: _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
8377
|
+
serverComponents: _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _184 => _184.experimental, 'optionalAccess', _185 => _185.serverComponents])) === "rsc",
|
|
8337
8378
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
8338
8379
|
}
|
|
8339
8380
|
);
|
|
8340
|
-
const hydrationPlanOptions =
|
|
8381
|
+
const hydrationPlanOptions = _chunkPA3VZNWUcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
8341
8382
|
config.renderer,
|
|
8342
8383
|
Boolean(unsupportedIntegrationProvider)
|
|
8343
8384
|
);
|
|
8344
8385
|
const pageHydrationPlanOptions = {
|
|
8345
8386
|
...hydrationPlanOptions,
|
|
8346
|
-
serverOwners: _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
8387
|
+
serverOwners: _chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _186 => _186.experimental, 'optionalAccess', _187 => _187.serverComponents])) === "islands"
|
|
8347
8388
|
};
|
|
8348
|
-
const { layoutHydrationPlans, pageHydrationPlans } =
|
|
8389
|
+
const { layoutHydrationPlans, pageHydrationPlans } = _chunkPA3VZNWUcjs.withFarmSourceSnapshot.call(void 0, () => {
|
|
8349
8390
|
const layoutHydrationPlans2 = layoutRoutes.map((layout) => ({
|
|
8350
8391
|
...layout,
|
|
8351
8392
|
hydration: getCachedClientModuleHydrationPlan(
|
|
@@ -8356,7 +8397,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8356
8397
|
{ ...hydrationPlanOptions, serverTreeLayouts: pageHydrationPlanOptions.serverOwners }
|
|
8357
8398
|
)
|
|
8358
8399
|
}));
|
|
8359
|
-
const markdownPagePlan =
|
|
8400
|
+
const markdownPagePlan = _chunkPA3VZNWUcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
8360
8401
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
|
|
8361
8402
|
config.root,
|
|
8362
8403
|
isolatedHydrationMode,
|
|
@@ -8376,7 +8417,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8376
8417
|
);
|
|
8377
8418
|
return { layoutHydrationPlans: layoutHydrationPlans2, pageHydrationPlans: pageHydrationPlans2 };
|
|
8378
8419
|
});
|
|
8379
|
-
|
|
8420
|
+
_chunkPA3VZNWUcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
8380
8421
|
layoutHydrationPlans.map((layout) => ({
|
|
8381
8422
|
pattern: layout.pattern,
|
|
8382
8423
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -8385,10 +8426,10 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8385
8426
|
pageRoutes.map((route) => ({
|
|
8386
8427
|
// Compared by directory so a grouped layout applies only inside its group.
|
|
8387
8428
|
pattern: _nullishCoalesce(route.directory, () => ( route.pattern)),
|
|
8388
|
-
depth:
|
|
8429
|
+
depth: _chunk4ZVKDHS6cjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
|
|
8389
8430
|
metadata: pageHydrationPlans.get(route.modulePath)
|
|
8390
8431
|
})),
|
|
8391
|
-
|
|
8432
|
+
_chunk4ZVKDHS6cjs.routeBoundaryCoversDirectory,
|
|
8392
8433
|
{ serverOwners: pageHydrationPlanOptions.serverOwners }
|
|
8393
8434
|
);
|
|
8394
8435
|
const providerServerImports = [
|
|
@@ -8406,7 +8447,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8406
8447
|
apiRegistrations.push(`
|
|
8407
8448
|
{
|
|
8408
8449
|
path: ${JSON.stringify(route.path)},
|
|
8409
|
-
methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access',
|
|
8450
|
+
methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access', _188 => _188.pluginMethods, 'optionalAccess', _189 => _189.includes, 'call', _190 => _190(method)])))},
|
|
8410
8451
|
endpoints: ${varName},
|
|
8411
8452
|
}`);
|
|
8412
8453
|
});
|
|
@@ -8420,8 +8461,8 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8420
8461
|
orderedPageRoutes.forEach((route, index) => {
|
|
8421
8462
|
const varName = `pageRoute${index}`;
|
|
8422
8463
|
if (_chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
|
|
8423
|
-
const renderingDirective2 =
|
|
8424
|
-
const markdownServerTree = pageHydrationPlanOptions.serverOwners &&
|
|
8464
|
+
const renderingDirective2 = _chunkERV422FOcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
|
|
8465
|
+
const markdownServerTree = pageHydrationPlanOptions.serverOwners && _chunkPA3VZNWUcjs.usesFarmServerTree.call(void 0, pageHydrationPlans.get(route.modulePath));
|
|
8425
8466
|
pageRegistrations.push(`
|
|
8426
8467
|
{
|
|
8427
8468
|
pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
|
|
@@ -8429,14 +8470,14 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8429
8470
|
rendering: ${JSON.stringify(renderingDirective2)},` : ""}${markdownServerTree ? "\n serverTree: true," : ""}
|
|
8430
8471
|
module: createFarmMarkdownRouteModule({
|
|
8431
8472
|
source: ${JSON.stringify(_nullishCoalesce(route.source, () => ( "")))},
|
|
8432
|
-
filePath: ${JSON.stringify(
|
|
8473
|
+
filePath: ${JSON.stringify(_chunkPQ6DBVJ2cjs.toBakedMarkdownSourcePath.call(void 0, config.root, route.modulePath))},
|
|
8433
8474
|
components: farmMdxComponents,
|
|
8434
8475
|
config: farmMdxConfig,${_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, config.renderer) ? "" : "\n renderer: React,"}
|
|
8435
8476
|
}),
|
|
8436
8477
|
markdownSource: {
|
|
8437
8478
|
source: ${JSON.stringify(_nullishCoalesce(route.source, () => ( "")))},
|
|
8438
8479
|
filePath: ${JSON.stringify(
|
|
8439
|
-
|
|
8480
|
+
_chunkPQ6DBVJ2cjs.toBakedMarkdownSourcePath.call(void 0, config.root, _nullishCoalesce(route.markdownSourcePath, () => ( route.modulePath)))
|
|
8440
8481
|
)},
|
|
8441
8482
|
},
|
|
8442
8483
|
}`);
|
|
@@ -8446,7 +8487,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8446
8487
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(route.modulePath)};`
|
|
8447
8488
|
);
|
|
8448
8489
|
const clientMetadata = pageHydrationPlans.get(route.modulePath);
|
|
8449
|
-
const renderingDirective =
|
|
8490
|
+
const renderingDirective = _chunkERV422FOcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
|
|
8450
8491
|
pageRegistrations.push(`
|
|
8451
8492
|
{
|
|
8452
8493
|
pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
|
|
@@ -8454,8 +8495,8 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8454
8495
|
module: ${varName},
|
|
8455
8496
|
shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},${clientMetadata.shouldHydrate ? `
|
|
8456
8497
|
clientModule: ${JSON.stringify(_chunk7U4XF76Rcjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
|
|
8457
|
-
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${
|
|
8458
|
-
const rootStrategy =
|
|
8498
|
+
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkPA3VZNWUcjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${(() => {
|
|
8499
|
+
const rootStrategy = _chunkPQ6DBVJ2cjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
8459
8500
|
route,
|
|
8460
8501
|
clientMetadata,
|
|
8461
8502
|
layoutHydrationPlans.map((layout) => ({ ...layout, ...layout.hydration })),
|
|
@@ -8468,13 +8509,13 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8468
8509
|
rendering: ${JSON.stringify(renderingDirective)},` : ""}
|
|
8469
8510
|
${route.source !== void 0 ? `markdownSource: {
|
|
8470
8511
|
source: ${JSON.stringify(route.source)},
|
|
8471
|
-
filePath: ${JSON.stringify(
|
|
8512
|
+
filePath: ${JSON.stringify(_chunkPQ6DBVJ2cjs.toBakedMarkdownSourcePath.call(void 0, config.root, route.markdownSourcePath))},
|
|
8472
8513
|
},` : ""}
|
|
8473
8514
|
}`);
|
|
8474
8515
|
});
|
|
8475
8516
|
const layoutImports = [];
|
|
8476
8517
|
const layoutRegistrations = [];
|
|
8477
|
-
const treeLayoutPatterns = farmIslandsMode ?
|
|
8518
|
+
const treeLayoutPatterns = farmIslandsMode ? _chunk4ZVKDHS6cjs.getFarmServerTreeLayoutPatterns.call(void 0,
|
|
8478
8519
|
layoutHydrationPlans.map((layout) => ({
|
|
8479
8520
|
pattern: layout.pattern,
|
|
8480
8521
|
shouldHydrate: layout.hydration.shouldHydrate,
|
|
@@ -8492,7 +8533,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8492
8533
|
pattern: ${JSON.stringify(layout.pattern)},
|
|
8493
8534
|
module: ${varName},
|
|
8494
8535
|
shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},
|
|
8495
|
-
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${treeLayoutPatterns.has(layout.pattern) ? "\n serverTree: true," : ""}${farmIslandsMode &&
|
|
8536
|
+
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${treeLayoutPatterns.has(layout.pattern) ? "\n serverTree: true," : ""}${farmIslandsMode && _chunkPQ6DBVJ2cjs.canFarmSkipKeptLayoutRender.call(void 0, layout.modulePath, config.root) ? "\n skipKeptRender: true," : ""}${// A layout whose client components hydrate as islands of their own (islands mode,
|
|
8496
8537
|
// isolatedClientHydration, or an async layout): it wraps a docs page as an app page.
|
|
8497
8538
|
clientMetadata.hasIsolatedClientBoundaries ? "\n islands: true," : ""}
|
|
8498
8539
|
}`);
|
|
@@ -8520,7 +8561,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8520
8561
|
containerId: ${JSON.stringify(slot.containerId)},
|
|
8521
8562
|
interception: ${JSON.stringify(slot.interception)},
|
|
8522
8563
|
fallback: ${JSON.stringify(slot.fallback)},
|
|
8523
|
-
hydrates: ${!farmIslandsMode ||
|
|
8564
|
+
hydrates: ${!farmIslandsMode || _chunkPA3VZNWUcjs.getClientModuleMetadata.call(void 0, slot.modulePath, config.root).isClientComponent},
|
|
8524
8565
|
module: ${varName},
|
|
8525
8566
|
}`);
|
|
8526
8567
|
});
|
|
@@ -8531,12 +8572,12 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8531
8572
|
errorImports.push(
|
|
8532
8573
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(errorRoute.modulePath)};`
|
|
8533
8574
|
);
|
|
8534
|
-
const groupScope =
|
|
8575
|
+
const groupScope = _chunk4ZVKDHS6cjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
|
|
8535
8576
|
errorRegistrations.push(`
|
|
8536
8577
|
{
|
|
8537
|
-
pattern: ${JSON.stringify(
|
|
8578
|
+
pattern: ${JSON.stringify(_chunk4ZVKDHS6cjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
|
|
8538
8579
|
groupScope: ${JSON.stringify(groupScope)},
|
|
8539
|
-
directoryDepth: ${
|
|
8580
|
+
directoryDepth: ${_chunk4ZVKDHS6cjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
|
|
8540
8581
|
module: ${varName},
|
|
8541
8582
|
}`);
|
|
8542
8583
|
});
|
|
@@ -8548,12 +8589,12 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8548
8589
|
loadingImports.push(
|
|
8549
8590
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(loadingRoute.modulePath)};`
|
|
8550
8591
|
);
|
|
8551
|
-
const groupScope =
|
|
8592
|
+
const groupScope = _chunk4ZVKDHS6cjs.getRouteGroupScope.call(void 0, loadingRoute.pattern);
|
|
8552
8593
|
loadingRegistrations.push(`
|
|
8553
8594
|
{
|
|
8554
|
-
pattern: ${JSON.stringify(
|
|
8595
|
+
pattern: ${JSON.stringify(_chunk4ZVKDHS6cjs.stripRouteGroups.call(void 0, loadingRoute.pattern))},${groupScope ? `
|
|
8555
8596
|
groupScope: ${JSON.stringify(groupScope)},
|
|
8556
|
-
directoryDepth: ${
|
|
8597
|
+
directoryDepth: ${_chunk4ZVKDHS6cjs.getRouteDirectoryDepth.call(void 0, loadingRoute.pattern)},` : ""}
|
|
8557
8598
|
module: ${varName},
|
|
8558
8599
|
}`);
|
|
8559
8600
|
});
|
|
@@ -8566,7 +8607,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8566
8607
|
metadataImageImports.push(
|
|
8567
8608
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(image.modulePath)};`
|
|
8568
8609
|
);
|
|
8569
|
-
const component = !_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, config.renderer) &&
|
|
8610
|
+
const component = !_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, config.renderer) && _chunkPQ6DBVJ2cjs.isRendererCompiledComponent.call(void 0, image.modulePath, _nullishCoalesce(_optionalChain([config, 'access', _191 => _191.renderer, 'optionalAccess', _192 => _192.componentExtensions]), () => ( [])));
|
|
8570
8611
|
metadataImageRegistrations.push(`
|
|
8571
8612
|
{
|
|
8572
8613
|
pattern: ${JSON.stringify(image.pattern)},
|
|
@@ -8642,7 +8683,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8642
8683
|
createDefaultErrorMarkup,
|
|
8643
8684
|
createFarmInstrumentationLifecycle,
|
|
8644
8685
|
createFarmLayoutSelector,
|
|
8645
|
-
createFarmLayoutBoundary,${_optionalChain([config, 'access',
|
|
8686
|
+
createFarmLayoutBoundary,${_optionalChain([config, 'access', _193 => _193.docs, 'optionalAccess', _194 => _194.enabled]) ? "\n createFarmDocsLayoutTree,\n farmDocsLayoutsWrapPage,\n placeFarmDocsLayoutRoot," : ""}
|
|
8646
8687
|
isInFarmRouteGroupScope,
|
|
8647
8688
|
routeBoundaryCoversDirectory,
|
|
8648
8689
|
createFarmCacheKey,
|
|
@@ -8726,7 +8767,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
8726
8767
|
createFarmDeploymentMismatchResponse,
|
|
8727
8768
|
FARM_DEPLOYMENT_ID_HEADER,
|
|
8728
8769
|
getFarmDeploymentMismatch,
|
|
8729
|
-
withoutFarmDeploymentCookie,${config.mobileClient ? "\n createFarmNativeTreeResponse," : ""}${config.trailingSlash && (_optionalChain([config, 'access',
|
|
8770
|
+
withoutFarmDeploymentCookie,${config.mobileClient ? "\n createFarmNativeTreeResponse," : ""}${config.trailingSlash && (_optionalChain([config, 'access', _195 => _195.md, 'optionalAccess', _196 => _196.enabled]) || hasMarkdownPages) ? "\n toFarmTrailingSlashPageRequest," : ""}${hasInfraAnalyticsRuntime ? "\n resolveFarmDocsEngineRouteLabel,\n resolveFarmDocsRouteLabel,\n resolveFarmMarkdownRouteLabel,\n resolveFarmMCPRouteLabel,\n setFarmRouteLabel," : ""}${hasFarmServerStorageConfig(config.storage) ? "\n _registerFarmStorageModules,\n disposeFarmStorage,\n initFarmStorage," : ""}${searchPreserveRoutesSource ? "\n _setFarmSearchPreserveRoutes," : ""}
|
|
8730
8771
|
} from "@farm.js/core/internal/production-runtime";${farmMobileClient ? `
|
|
8731
8772
|
import { _applyFarmMobileShellClient } from "@farm.js/core/internal/production-runtime";
|
|
8732
8773
|
// The mobile client documents load when a mobile shell asks for them (RFC 0004, 7.2), filled in
|
|
@@ -8798,25 +8839,25 @@ function farmFormStateScript() { return ""; }`}`;
|
|
|
8798
8839
|
const infraAnalyticsImport = hasInfraAnalyticsRuntime ? `import { ${hasPluginRuntime ? "createFarmInfraAnalyticsPlugin" : "createFarmInfraAnalyticsRecorder"} } from "@farm.js/core/internal/infra-analytics-runtime";` : "";
|
|
8799
8840
|
const compressionRuntimeImport = hasCompressionRuntime ? `import { compressFarmResponse${hasPluginRuntime ? ", createCompressionPlugin" : ""} } from "@farm.js/core/internal/compression-runtime";` : "";
|
|
8800
8841
|
const i18nServerImport = config.i18n.enabled ? `import { _runWithFarmI18nRequest, _setDefaultFarmI18nRuntime, createFarmI18nRuntime, getFarmI18nClientSnapshot } from "@farm.js/core/i18n/server";` : "";
|
|
8801
|
-
const docsHandlerImport = _optionalChain([config, 'access',
|
|
8842
|
+
const docsHandlerImport = _optionalChain([config, 'access', _197 => _197.docs, 'optionalAccess', _198 => _198.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
|
|
8802
8843
|
const isFarmDocsAPIRequest = (requestOrPathname) => {
|
|
8803
8844
|
const pathname = typeof requestOrPathname === "string"
|
|
8804
8845
|
? requestOrPathname
|
|
8805
8846
|
: new URL(requestOrPathname.url).pathname;
|
|
8806
|
-
const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess',
|
|
8847
|
+
const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _199 => _199.apiPath]) || "/api/docs")};
|
|
8807
8848
|
return pathname === apiPath || pathname.startsWith(apiPath + "/");
|
|
8808
8849
|
};` : adapterOwnsDocsRuntime ? `import { ${docsConfigModulePath ? "getFarmDocsConfigModuleRoot, " : ""}isFarmDocsAPIRequest } from "@farm.js/core/docs";
|
|
8809
|
-
import { ${_optionalChain([config, 'access',
|
|
8850
|
+
import { ${_optionalChain([config, 'access', _200 => _200.docs, 'access', _201 => _201.roots, 'optionalAccess', _202 => _202.length]) ? "createFarmDocsMultiRuntimeHandler as createFarmDocsAdapterMultiRuntimeHandler" : "createFarmDocsRuntimeHandler as createFarmDocsAdapterRuntimeHandler"} } from ${JSON.stringify(config.docs.adapter.server)};
|
|
8810
8851
|
import * as FarmDocsAdapterUI from ${JSON.stringify(_chunkL2GUEYHRcjs.getFarmDocsAdapterUIModule.call(void 0, config.docs.adapter))};${docsConfigModulePath ? `
|
|
8811
8852
|
import * as farmDocsConfigModule from ${toVirtualEntryImportSpecifier(docsConfigModulePath)};` : ""}` : `import { createFarmDocsAPIHandler, createFarmDocsHandler, isFarmDocsAPIRequest } from "@farm.js/core/docs";` : "";
|
|
8812
|
-
const docsFontImport = _optionalChain([config, 'access',
|
|
8813
|
-
const docsRuntimeImport = _optionalChain([config, 'access',
|
|
8853
|
+
const docsFontImport = _optionalChain([config, 'access', _203 => _203.docs, 'optionalAccess', _204 => _204.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
|
|
8854
|
+
const docsRuntimeImport = _optionalChain([config, 'access', _205 => _205.docs, 'optionalAccess', _206 => _206.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
|
|
8814
8855
|
import { dirname as farmDocsDirname, join as farmDocsJoin } from "node:path";
|
|
8815
8856
|
import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
|
|
8816
|
-
const markdownHandlerImport = _optionalChain([config, 'access',
|
|
8857
|
+
const markdownHandlerImport = _optionalChain([config, 'access', _207 => _207.md, 'optionalAccess', _208 => _208.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
|
|
8817
8858
|
const appMarkdownImport = hasMarkdownPages ? `import { FARM_MARKDOWN_ANONYMOUS_CLIENT_ADDRESS, createFarmMarkdownRouteModule, createFarmMarkdownSourceResponse, isFarmMarkdownPublicSourceResponse } from "@farm.js/core/internal/app-markdown-runtime";` : "const createFarmMarkdownSourceResponse = null;\nconst isFarmMarkdownPublicSourceResponse = null;";
|
|
8818
8859
|
const markdownErrorImport = `import { FARM_MARKDOWN_CONTENT_TYPE, FARM_MARKDOWN_PAGE_CHECK_HEADER, _isFarmMarkdownPageCheck, createFarmMarkdownErrorBody, farmRequestWantsMarkdown } from "@farm.js/core/markdown";`;
|
|
8819
|
-
const mdxComponentsPath = typeof _optionalChain([config, 'access',
|
|
8860
|
+
const mdxComponentsPath = typeof _optionalChain([config, 'access', _209 => _209.mdx, 'optionalAccess', _210 => _210.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
|
|
8820
8861
|
const mdxComponentsImport = mdxComponentsPath ? `import * as FarmMdxComponentsModule from ${toVirtualEntryImportSpecifier(mdxComponentsPath)};` : "";
|
|
8821
8862
|
const layerConfigPaths = (config.layers || []).map((layer) => layer.configFile).filter((configFile) => Boolean(configFile)).filter((configFile) => configFile !== configModulePath);
|
|
8822
8863
|
const layerConfigImports = layerConfigPaths.map(
|
|
@@ -8836,14 +8877,14 @@ import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
|
|
|
8836
8877
|
const nativeAuth = generateNativeAuthIntegrationSource(config.auth);
|
|
8837
8878
|
const nativeMCP = _chunkVM57CK74cjs.generateNativeMCPPluginSource.call(void 0, config.mcp);
|
|
8838
8879
|
const mobileSession = (config.plugins || []).some(
|
|
8839
|
-
(plugin) => _optionalChain([plugin, 'optionalAccess',
|
|
8880
|
+
(plugin) => _optionalChain([plugin, 'optionalAccess', _211 => _211.name]) === _chunkMHKPXX3Jcjs.FARM_MOBILE_SESSION_PLUGIN
|
|
8840
8881
|
);
|
|
8841
8882
|
const nativeServerFns = (config.plugins || []).some(
|
|
8842
|
-
(plugin) => _optionalChain([plugin, 'optionalAccess',
|
|
8843
|
-
) ?
|
|
8883
|
+
(plugin) => _optionalChain([plugin, 'optionalAccess', _212 => _212.name]) === _chunk4EBC7EMWcjs.FARM_NATIVE_SERVER_FN_PLUGIN
|
|
8884
|
+
) ? _chunkXRYLMTYFcjs.collectFarmNativeServerFns.call(void 0, {
|
|
8844
8885
|
root: config.root,
|
|
8845
8886
|
srcDir: config.srcDir,
|
|
8846
|
-
entries:
|
|
8887
|
+
entries: _chunkXRYLMTYFcjs.findFarmNativeScreenFiles.call(void 0, _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, config))
|
|
8847
8888
|
}) : void 0;
|
|
8848
8889
|
const integrationImports = `
|
|
8849
8890
|
${configModulePath ? `import * as FarmUserConfigModule from ${toVirtualEntryImportSpecifier(configModulePath)};` : ""}
|
|
@@ -8858,7 +8899,7 @@ ${nativeServerFns ? `const __farmNativeServerFnRegistry = Object.assign(Object.c
|
|
|
8858
8899
|
${nativeServerFns.flatMap((module, index) => module.exports.map((entry) => ` ${JSON.stringify(entry.id)}: __farmNativeServerFns${index}[${JSON.stringify(entry.name)}],`)).join("\n")}
|
|
8859
8900
|
});` : ""}
|
|
8860
8901
|
`;
|
|
8861
|
-
const imageRuntime =
|
|
8902
|
+
const imageRuntime = _chunkPQ6DBVJ2cjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
8862
8903
|
const imageRuntimeImport = imageRuntime === "none" ? "" : `import { _withFarmImageSourceClientAddress, createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
|
|
8863
8904
|
const imageNodeRuntimeImport = imageRuntime === "node" ? `import { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } from "@farm.js/core/image/sharp";` : "";
|
|
8864
8905
|
const apiHandlerCode = apiRoutes.length > 0 ? `
|
|
@@ -9040,7 +9081,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
|
|
|
9040
9081
|
|
|
9041
9082
|
function renderFarmDefault404Page() {
|
|
9042
9083
|
return React.createElement(React.Fragment, null,
|
|
9043
|
-
React.createElement("style", null, ${JSON.stringify(
|
|
9084
|
+
React.createElement("style", null, ${JSON.stringify(_chunkPQ6DBVJ2cjs.DEFAULT_NOT_FOUND_STYLES)}),
|
|
9044
9085
|
React.createElement("main", {
|
|
9045
9086
|
className: "farm-default-not-found",
|
|
9046
9087
|
"aria-labelledby": "farm-default-not-found-title",
|
|
@@ -9196,24 +9237,24 @@ const farmImageHandler = ${imageRuntime === "none" ? "null" : imageRuntime === "
|
|
|
9196
9237
|
validateRemoteUrl: createNodeImageUrlValidator(${JSON.stringify(config.images)}),
|
|
9197
9238
|
onError(error) { console.error("[Farm Image]", error); },
|
|
9198
9239
|
})`};
|
|
9199
|
-
const farmMarkdownConfig = ${JSON.stringify(config.md)};${_optionalChain([config, 'access',
|
|
9240
|
+
const farmMarkdownConfig = ${JSON.stringify(config.md)};${_optionalChain([config, 'access', _213 => _213.md, 'optionalAccess', _214 => _214.enabled]) || hasMarkdownPages ? config.trailingSlash ? `
|
|
9200
9241
|
// A Markdown mirror, and a page.md source's page check, read the page at the URL it answers at
|
|
9201
9242
|
// ('/about/'), so the trailing-slash 308 never answers in its place.
|
|
9202
9243
|
const toFarmMarkdownPageRequest = (request) => toFarmTrailingSlashPageRequest(request, true);` : `
|
|
9203
9244
|
const toFarmMarkdownPageRequest = (request) => request;` : ""}
|
|
9204
|
-
const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access',
|
|
9205
|
-
${_optionalChain([config, 'access',
|
|
9245
|
+
const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _215 => _215.agent, 'optionalAccess', _216 => _216.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
|
|
9246
|
+
${_optionalChain([config, 'access', _217 => _217.agent, 'optionalAccess', _218 => _218.llmsTxt, 'optionalAccess', _219 => _219.enabled]) ? "const farmLlmsFullRenderer = createFarmLlmsFullRenderer({ revalidate: farmLlmsTxtConfig.revalidate });\n" : ""}${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
|
|
9206
9247
|
const farmMdxConfig = ${JSON.stringify({
|
|
9207
9248
|
...config.mdx,
|
|
9208
|
-
components: typeof _optionalChain([config, 'access',
|
|
9249
|
+
components: typeof _optionalChain([config, 'access', _220 => _220.mdx, 'optionalAccess', _221 => _221.components]) === "string" ? config.mdx.components : void 0
|
|
9209
9250
|
})};
|
|
9210
9251
|
const configuredFarmMdxComponents = farmUserConfig?.mdx?.components;
|
|
9211
|
-
${_optionalChain([config, 'access',
|
|
9252
|
+
${_optionalChain([config, 'access', _222 => _222.agent, 'optionalAccess', _223 => _223.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
|
|
9212
9253
|
// environment this was built in, since Netlify exposes its deploy context only
|
|
9213
9254
|
// to the build.
|
|
9214
9255
|
const farmNoindexPreview = resolveFarmPreviewDeployment(
|
|
9215
9256
|
globalThis.process?.env,
|
|
9216
|
-
${JSON.stringify(
|
|
9257
|
+
${JSON.stringify(_chunkCNGGEHXYcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env))},
|
|
9217
9258
|
);` : ""}
|
|
9218
9259
|
const farmMdxComponents = ${mdxComponentsPath ? `(FarmMdxComponentsModule.components || Reflect.get(FarmMdxComponentsModule, "default") || {})` : `(configuredFarmMdxComponents && typeof configuredFarmMdxComponents === "object" ? configuredFarmMdxComponents : {})`};
|
|
9219
9260
|
const farmObservabilityConfig = farmUserConfig?.observability ?? ${JSON.stringify(
|
|
@@ -9259,7 +9300,7 @@ export const farmProductionLifecycle = createFarmProductionLifecycle({
|
|
|
9259
9300
|
});
|
|
9260
9301
|
const farmI18nRuntime = ${config.i18n.enabled ? `createFarmI18nRuntime(farmI18nConfig, ${JSON.stringify(i18nCatalogs)})` : "null"};
|
|
9261
9302
|
${config.i18n.enabled ? "_setDefaultFarmI18nRuntime(farmI18nRuntime);" : ""}
|
|
9262
|
-
const farmDocsBundledContentDir = ${_optionalChain([config, 'access',
|
|
9303
|
+
const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _224 => _224.docs, 'optionalAccess', _225 => _225.enabled]) && !hasPrecompiledDocs ? `(() => {
|
|
9263
9304
|
try {
|
|
9264
9305
|
const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
|
|
9265
9306
|
const candidates = [
|
|
@@ -9271,7 +9312,7 @@ const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _229 => _2
|
|
|
9271
9312
|
} catch {
|
|
9272
9313
|
return null;
|
|
9273
9314
|
}
|
|
9274
|
-
})()` : "null"};${_optionalChain([config, 'access',
|
|
9315
|
+
})()` : "null"};${_optionalChain([config, 'access', _226 => _226.docs, 'optionalAccess', _227 => _227.enabled]) && !hasPrecompiledDocs && _optionalChain([config, 'access', _228 => _228.docs, 'access', _229 => _229.roots, 'optionalAccess', _230 => _230.length]) ? `
|
|
9275
9316
|
const farmDocsBundledRootsDir = (() => {
|
|
9276
9317
|
try {
|
|
9277
9318
|
const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
|
|
@@ -9325,7 +9366,7 @@ const farmDocsModulePreloadPaths = farmDocsModulePreloads
|
|
|
9325
9366
|
: undefined;
|
|
9326
9367
|
${adapterOwnsDocsRuntime && !hasPrecompiledDocs ? `// The renderer contract's server exports, for a docs UI that builds its pages with them.
|
|
9327
9368
|
const farmDocsAppRenderer = ${_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, config.renderer) ? '{ name: "react", createElement: React.createElement, Fragment: React.Fragment, renderToString: ReactDOMServer.renderToString }' : "__farmRendererServer"};
|
|
9328
|
-
` : ""}const farmDocsHandler = ${_optionalChain([config, 'access',
|
|
9369
|
+
` : ""}const farmDocsHandler = ${_optionalChain([config, 'access', _231 => _231.docs, 'optionalAccess', _232 => _232.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `${adapterHandler.factory}(${adapterHandler.config}, {
|
|
9329
9370
|
rootDir: farmDocsRuntimeRoot,
|
|
9330
9371
|
// A production build's content cannot change, so the adapter reads its
|
|
9331
9372
|
// navigation once instead of scanning the content directory per request.
|
|
@@ -9349,7 +9390,7 @@ const farmDocsAppRenderer = ${_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, con
|
|
|
9349
9390
|
registerMCPServer: registerFarmMCPServer,
|
|
9350
9391
|
// A page built with this keeps its HTML string, so the preload budget and the response
|
|
9351
9392
|
// writer use it instead of reading and re-encoding the body. Older adapters ignore it.
|
|
9352
|
-
createHtmlResponse: farmOwnedHtmlResponse,${
|
|
9393
|
+
createHtmlResponse: farmOwnedHtmlResponse,${_chunkSG5RFGV6cjs.farmDocsAdapterServesGuardedPages.call(void 0, config.docs) ? `
|
|
9353
9394
|
// The adapter keeps pages a path guard covers off search, llms.txt, the sitemap and MCP. It
|
|
9354
9395
|
// asks about any path its own content lists, so the guards decide here, not a page list.
|
|
9355
9396
|
isPathGuarded: (pathname) =>
|
|
@@ -9375,7 +9416,7 @@ const farmDocsAppRenderer = ${_chunkT7UC2ORAcjs.isReactRenderer.call(void 0, con
|
|
|
9375
9416
|
isPathGuarded: isFarmDocsPathGuarded,
|
|
9376
9417
|
basePath: ${JSON.stringify(config.basePath)},
|
|
9377
9418
|
})` : "null"};
|
|
9378
|
-
const farmDocsAPIHandler = ${_optionalChain([config, 'access',
|
|
9419
|
+
const farmDocsAPIHandler = ${_optionalChain([config, 'access', _233 => _233.docs, 'optionalAccess', _234 => _234.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig, isPathGuarded: isFarmDocsPathGuarded, basePath: ${JSON.stringify(config.basePath)} })` : "null"};
|
|
9379
9420
|
|
|
9380
9421
|
// API routes bundled at build time
|
|
9381
9422
|
const apiRoutes = ${apiRoutes.length > 0 ? "mergePluginAPIRoutes(" : ""}[${apiRegistrations.join(",")}
|
|
@@ -9410,12 +9451,12 @@ const farmDeploymentCookiePath = ${JSON.stringify(config.basePath || "/")};
|
|
|
9410
9451
|
// runtime request.
|
|
9411
9452
|
const farmRuntimeErrorSlot = Symbol("farm.runtime.error.slot");
|
|
9412
9453
|
const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
|
|
9413
|
-
${_optionalChain([config, 'access',
|
|
9414
|
-
` : ""}${_optionalChain([config, 'access',
|
|
9415
|
-
|
|
9454
|
+
${_optionalChain([config, 'access', _235 => _235.agent, 'optionalAccess', _236 => _236.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkJGUMFTZTcjs.resolveFarmApiCatalogInput.call(void 0, config))};
|
|
9455
|
+
` : ""}${_optionalChain([config, 'access', _237 => _237.agent, 'optionalAccess', _238 => _238.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
|
|
9456
|
+
_chunkJGUMFTZTcjs.resolveFarmAppManifestInput.call(void 0, config, {
|
|
9416
9457
|
build: config.deploymentId,
|
|
9417
|
-
packages:
|
|
9418
|
-
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ?
|
|
9458
|
+
packages: _chunkPQ6DBVJ2cjs.resolveFarmAppPackages.call(void 0, config.root),
|
|
9459
|
+
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkPQ6DBVJ2cjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
|
|
9419
9460
|
})
|
|
9420
9461
|
)};
|
|
9421
9462
|
${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
@@ -9428,7 +9469,7 @@ farmAppManifestInput.guardCoversPath = (path) =>
|
|
|
9428
9469
|
path,
|
|
9429
9470
|
farmLocalAPIBasePath,
|
|
9430
9471
|
);
|
|
9431
|
-
${_optionalChain([config, 'access',
|
|
9472
|
+
${_optionalChain([config, 'access', _239 => _239.docs, 'optionalAccess', _240 => _240.enabled]) ? `// A docs runtime's MCP server lists its tools when asked over MCP, in process. A build
|
|
9432
9473
|
// can't change them, so they are read once.
|
|
9433
9474
|
if (farmDocsHandler) {
|
|
9434
9475
|
farmAppManifestInput.registeredMCP = (request) =>
|
|
@@ -10203,7 +10244,7 @@ function peelFarmDocumentPrefix(markup) {
|
|
|
10203
10244
|
let inner = markup.replace(/^\\s+/, "");
|
|
10204
10245
|
let hoisted = "";
|
|
10205
10246
|
const wrapper = /^<div\\b[^>]*style=["']display\\s*:\\s*contents;?\\s*["'][^>]*>/i;
|
|
10206
|
-
const hoistable = /${
|
|
10247
|
+
const hoistable = /${_chunk4ZVKDHS6cjs.HOISTED_HEAD_ELEMENT.source}/i;
|
|
10207
10248
|
let match;
|
|
10208
10249
|
while ((match = wrapper.exec(inner) || hoistable.exec(inner))) {
|
|
10209
10250
|
if (!/^<div/i.test(match[0])) hoisted += match[0];
|
|
@@ -10232,7 +10273,7 @@ function opensFarmFullDocument(markup) {
|
|
|
10232
10273
|
// them: its own head takes them. Matches the dev renderer's takeFarmHoistedHead.
|
|
10233
10274
|
function takeFarmHoistedHead(markup) {
|
|
10234
10275
|
if (opensFarmFullDocument(markup)) return { head: "", body: markup };
|
|
10235
|
-
const hoistable = /${
|
|
10276
|
+
const hoistable = /${_chunk4ZVKDHS6cjs.HOISTED_HEAD_ELEMENT.source}/i;
|
|
10236
10277
|
let head = "";
|
|
10237
10278
|
let body = markup;
|
|
10238
10279
|
let match;
|
|
@@ -10868,7 +10909,7 @@ function createFarmAgentRobotsResponse(request) {
|
|
|
10868
10909
|
// its nearest layout's.
|
|
10869
10910
|
const farmAgentGuardedPages = new Set(${JSON.stringify(
|
|
10870
10911
|
pageRoutes.map((route) => route.pattern).filter(
|
|
10871
|
-
(pattern) => !pattern.includes("[") &&
|
|
10912
|
+
(pattern) => !pattern.includes("[") && _chunk4ZVKDHS6cjs.farmPathGuardCoversPage.call(void 0,
|
|
10872
10913
|
{
|
|
10873
10914
|
config: { middleware: config.middleware, integrations: config.integrations },
|
|
10874
10915
|
middlewareRoutes
|
|
@@ -10923,7 +10964,7 @@ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as
|
|
|
10923
10964
|
// aside for a page route that answers /mcp and for any MCP server published or
|
|
10924
10965
|
// registered at runtime, such as the docs engine's.
|
|
10925
10966
|
const farmDefaultMCPServer = ${JSON.stringify(
|
|
10926
|
-
_chunkW53Z4WDIcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root),
|
|
10967
|
+
_chunkW53Z4WDIcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunk6266WH6Xcjs.FARM_VERSION)
|
|
10927
10968
|
)};
|
|
10928
10969
|
let farmDefaultMCPRouteFree;
|
|
10929
10970
|
function getFarmDefaultMCPServer() {
|
|
@@ -11117,7 +11158,7 @@ ${edgeMiddlewareFilePaths.length > 0 ? `
|
|
|
11117
11158
|
// middleware guards is never prerendered. Read once: Nitro's prerender worker sets the variable.
|
|
11118
11159
|
const farmEdgeMiddlewareFiles = new Set(${JSON.stringify(edgeMiddlewareFilePaths)});
|
|
11119
11160
|
const farmPrerendering =
|
|
11120
|
-
typeof process !== "undefined" && process.env?.${
|
|
11161
|
+
typeof process !== "undefined" && process.env?.${_chunkFEWCWBOFcjs.FARM_PRERENDER_ENV} === "1";
|
|
11121
11162
|
` : ""}
|
|
11122
11163
|
const farmMiddlewareRunner = ${hasMiddlewareRuntime ? `createProductionMiddlewareRunner({
|
|
11123
11164
|
config: farmMiddlewareConfig,
|
|
@@ -11261,7 +11302,7 @@ function hasLocalRequestRoute(request, routePathname) {
|
|
|
11261
11302
|
if (${imageRuntime === "none" ? "false" : `pathname === ${JSON.stringify(config.images.path)}`}) {
|
|
11262
11303
|
return true;
|
|
11263
11304
|
}
|
|
11264
|
-
${_optionalChain([config, 'access',
|
|
11305
|
+
${_optionalChain([config, 'access', _241 => _241.docs, 'optionalAccess', _242 => _242.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
|
|
11265
11306
|
// The docs answer below the basePath; their API stays at /api/docs, as API routes do.
|
|
11266
11307
|
const docsRoutePathname = stripFarmBasePath(pathname);
|
|
11267
11308
|
if (
|
|
@@ -11289,7 +11330,7 @@ function getFarmPluginRequestOptions(request) {
|
|
|
11289
11330
|
route: { ...route, pattern: normalizeRuntimePath(farmOpenAPIReference.route) },
|
|
11290
11331
|
};
|
|
11291
11332
|
}
|
|
11292
|
-
const isDocsAPIRequest = ${_optionalChain([config, 'access',
|
|
11333
|
+
const isDocsAPIRequest = ${_optionalChain([config, 'access', _243 => _243.docs, 'optionalAccess', _244 => _244.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
|
|
11293
11334
|
const integrationMatch = ${hasServerRuntimeIntegrations ? `matchIntegrationRoute(serverRuntimeIntegrations, {
|
|
11294
11335
|
pathname,
|
|
11295
11336
|
method: request.method,
|
|
@@ -11373,7 +11414,7 @@ ${hasInfraAnalyticsRuntime ? `
|
|
|
11373
11414
|
// endpoints, Markdown mirrors, and docs pages have no app route pattern, so they are
|
|
11374
11415
|
// labeled here; route.pattern keeps meaning the matched app route for plugins.
|
|
11375
11416
|
const farmBuiltInRoutePaths = new Set(${JSON.stringify(
|
|
11376
|
-
|
|
11417
|
+
_chunkJGUMFTZTcjs.listFarmBuiltInRoutePaths.call(void 0, {
|
|
11377
11418
|
agent: {
|
|
11378
11419
|
...config.agent,
|
|
11379
11420
|
aiCatalog: servesAiCatalog,
|
|
@@ -11384,9 +11425,9 @@ const farmBuiltInRoutePaths = new Set(${JSON.stringify(
|
|
|
11384
11425
|
openapi: openAPIReference
|
|
11385
11426
|
})
|
|
11386
11427
|
)});
|
|
11387
|
-
${_optionalChain([config, 'access',
|
|
11428
|
+
${_optionalChain([config, 'access', _245 => _245.docs, 'optionalAccess', _246 => _246.enabled]) ? `const farmDocsRouteLabelInput = {
|
|
11388
11429
|
path: normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs"),
|
|
11389
|
-
apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess',
|
|
11430
|
+
apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _247 => _247.apiPath]) || "/api/docs")},${_optionalChain([config, 'access', _248 => _248.docs, 'access', _249 => _249.roots, 'optionalAccess', _250 => _250.length]) ? "\n roots: farmDocsResolvedConfig.roots.map((farmDocsRoot) => farmDocsRoot.entry)," : ""}${farmDocsAnalyticsPages.length ? `
|
|
11390
11431
|
pages: new Set(${JSON.stringify(farmDocsAnalyticsPages)}),` : ""}
|
|
11391
11432
|
};
|
|
11392
11433
|
` : ""}// The request's route payload, for a handler that learns what answered while it handles.
|
|
@@ -11402,11 +11443,11 @@ function labelFarmRequestOptions(options) {
|
|
|
11402
11443
|
setFarmRouteLabel(options.route, mcpLabel);
|
|
11403
11444
|
return options;
|
|
11404
11445
|
}
|
|
11405
|
-
${_optionalChain([config, 'access',
|
|
11446
|
+
${_optionalChain([config, 'access', _251 => _251.docs, 'optionalAccess', _252 => _252.enabled]) ? `if (options.kind === "docs") {
|
|
11406
11447
|
setFarmRouteLabel(options.route, resolveFarmDocsRouteLabel(routePathname, farmDocsRouteLabelInput));
|
|
11407
11448
|
return options;
|
|
11408
11449
|
}` : ""}
|
|
11409
|
-
${_optionalChain([config, 'access',
|
|
11450
|
+
${_optionalChain([config, 'access', _253 => _253.md, 'optionalAccess', _254 => _254.enabled]) || hasMarkdownPages ? `const markdownLabel = resolveFarmMarkdownRouteLabel(
|
|
11410
11451
|
routePathname,
|
|
11411
11452
|
(page) => matchPageRoute(page)?.route.pattern,
|
|
11412
11453
|
);
|
|
@@ -11441,7 +11482,7 @@ function getApplicableLayouts(pathname, directory) {
|
|
|
11441
11482
|
return applicable;
|
|
11442
11483
|
}
|
|
11443
11484
|
|
|
11444
|
-
${_optionalChain([config, 'access',
|
|
11485
|
+
${_optionalChain([config, 'access', _255 => _255.docs, 'optionalAccess', _256 => _256.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
|
|
11445
11486
|
if (request.method === "HEAD") return response;
|
|
11446
11487
|
if (response.headers.get("x-farm-docs-adapter")) return response;
|
|
11447
11488
|
|
|
@@ -11547,7 +11588,7 @@ ${_optionalChain([config, 'access', _260 => _260.docs, 'optionalAccess', _261 =>
|
|
|
11547
11588
|
|
|
11548
11589
|
// Shells keep their own LRU so query-string variants never evict app cache entries.
|
|
11549
11590
|
const pprShellCache = getFarmDataCache().pprShellCache;
|
|
11550
|
-
const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access',
|
|
11591
|
+
const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _257 => _257.experimental, 'optionalAccess', _258 => _258.ppr]) === true)};
|
|
11551
11592
|
|
|
11552
11593
|
function resolveRouteRenderingView(route) {
|
|
11553
11594
|
// The same merge development uses: baked directive config under the
|
|
@@ -11667,7 +11708,7 @@ async function handleFarmRequest(request, adapterContext) {
|
|
|
11667
11708
|
},
|
|
11668
11709
|
{ redirect: !isFarmLocalAPIPathname(requestUrl.pathname) }
|
|
11669
11710
|
)` : "handleFarmRequestInContext(request, null, false, Date.now(), adapterContext, requestUrl)"};
|
|
11670
|
-
${_optionalChain([config, 'access',
|
|
11711
|
+
${_optionalChain([config, 'access', _259 => _259.md, 'optionalAccess', _260 => _260.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
|
|
11671
11712
|
if (matchPageRoute(pathname)) {
|
|
11672
11713
|
// The Link header advertises the public .md URL, like the head alternate.
|
|
11673
11714
|
return applyMarkdownNegotiationHeaders(response, {
|
|
@@ -11884,7 +11925,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11884
11925
|
return renderFarmErrorJSONResponse();` : `
|
|
11885
11926
|
if (isFarmLocalAPIPathname(pathname)) return renderFarmErrorJSONResponse();
|
|
11886
11927
|
// No page was selected, so only the root error boundary and layouts apply.
|
|
11887
|
-
const errorResponse = await renderFarmErrorResponse(middlewareResult.error, "/", {}, null);${_optionalChain([config, 'access',
|
|
11928
|
+
const errorResponse = await renderFarmErrorResponse(middlewareResult.error, "/", {}, null);${_optionalChain([config, 'access', _261 => _261.md, 'optionalAccess', _262 => _262.enabled]) ? `
|
|
11888
11929
|
// An agent asking for Markdown reads the error document as Markdown, as it
|
|
11889
11930
|
// does when a page throws. The helper answers null when Markdown is off.
|
|
11890
11931
|
const markdownErrorResponse = await createMarkdownMirrorResponse({
|
|
@@ -11926,7 +11967,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
11926
11967
|
}
|
|
11927
11968
|
` : ""}
|
|
11928
11969
|
|
|
11929
|
-
${_optionalChain([config, 'access',
|
|
11970
|
+
${_optionalChain([config, 'access', _263 => _263.docs, 'optionalAccess', _264 => _264.enabled]) ? `
|
|
11930
11971
|
// Docs responses are served after app middleware so route guards and
|
|
11931
11972
|
// middleware headers apply to the docs engine like any other page content.
|
|
11932
11973
|
// An app's own llms.txt, llms-full.txt, sitemap.xml, and robots.txt take
|
|
@@ -12042,7 +12083,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12042
12083
|
}
|
|
12043
12084
|
` : ""}
|
|
12044
12085
|
|
|
12045
|
-
${_optionalChain([config, 'access',
|
|
12086
|
+
${_optionalChain([config, 'access', _265 => _265.md, 'optionalAccess', _266 => _266.enabled]) ? `
|
|
12046
12087
|
if (farmMarkdownConfig?.enabled) {
|
|
12047
12088
|
const markdownResponse = await createMarkdownMirrorResponse({
|
|
12048
12089
|
// The mirror helper only reads metadata and creates its own GET request.
|
|
@@ -12146,11 +12187,11 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12146
12187
|
return applyProductionMiddlewareHeaders(applicationMetadataResponse, middlewareHeaders);
|
|
12147
12188
|
}
|
|
12148
12189
|
` : ""}
|
|
12149
|
-
${_optionalChain([config, 'access',
|
|
12190
|
+
${_optionalChain([config, 'access', _267 => _267.agent, 'optionalAccess', _268 => _268.manifest]) !== false ? `
|
|
12150
12191
|
// agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
|
|
12151
12192
|
// public manifest, the same document for every request.
|
|
12152
12193
|
if (
|
|
12153
|
-
[${JSON.stringify(
|
|
12194
|
+
[${JSON.stringify(_chunkJGUMFTZTcjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkJGUMFTZTcjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
|
|
12154
12195
|
normalizeRuntimePath(routePathname),
|
|
12155
12196
|
)
|
|
12156
12197
|
) {
|
|
@@ -12160,9 +12201,9 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12160
12201
|
);
|
|
12161
12202
|
}
|
|
12162
12203
|
` : ""}
|
|
12163
|
-
${_optionalChain([config, 'access',
|
|
12204
|
+
${_optionalChain([config, 'access', _269 => _269.agent, 'optionalAccess', _270 => _270.apiCatalog]) ? `
|
|
12164
12205
|
// agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
|
|
12165
|
-
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(
|
|
12206
|
+
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkJGUMFTZTcjs.FARM_API_CATALOG_PATH)}) {
|
|
12166
12207
|
return applyProductionMiddlewareHeaders(
|
|
12167
12208
|
createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
|
|
12168
12209
|
middlewareHeaders,
|
|
@@ -12187,11 +12228,11 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12187
12228
|
);
|
|
12188
12229
|
}
|
|
12189
12230
|
` : ""}
|
|
12190
|
-
${_optionalChain([config, 'access',
|
|
12231
|
+
${_optionalChain([config, 'access', _271 => _271.agent, 'optionalAccess', _272 => _272.llmsTxt, 'optionalAccess', _273 => _273.enabled]) ? `
|
|
12191
12232
|
// agent.llmsTxt with no llms.ts or llms-full.ts: serve the generated files.
|
|
12192
12233
|
const farmGeneratedLlmsKind = normalizeRuntimePath(routePathname) === "/llms.txt"
|
|
12193
12234
|
? "llms"
|
|
12194
|
-
: ${_optionalChain([config, 'access',
|
|
12235
|
+
: ${_optionalChain([config, 'access', _274 => _274.agent, 'optionalAccess', _275 => _275.llmsTxt, 'optionalAccess', _276 => _276.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
|
|
12195
12236
|
if (farmGeneratedLlmsKind) {
|
|
12196
12237
|
const llmsContext = createFarmLlmsTxtContext(request, farmGeneratedLlmsKind === "llms-full");
|
|
12197
12238
|
// Renders are shared per origin the request reached, which is where pages are read.
|
|
@@ -12227,7 +12268,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12227
12268
|
}
|
|
12228
12269
|
` : ""}
|
|
12229
12270
|
|
|
12230
|
-
${_optionalChain([config, 'access',
|
|
12271
|
+
${_optionalChain([config, 'access', _277 => _277.docs, 'optionalAccess', _278 => _278.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
|
|
12231
12272
|
const docsAPIResponse = await farmDocsAPIHandler(cloneFarmRequestWithContext(request));
|
|
12232
12273
|
if (docsAPIResponse) {
|
|
12233
12274
|
return applyProductionMiddlewareHeaders(
|
|
@@ -12867,7 +12908,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12867
12908
|
);
|
|
12868
12909
|
}
|
|
12869
12910
|
}
|
|
12870
|
-
${_optionalChain([config, 'access',
|
|
12911
|
+
${_optionalChain([config, 'access', _279 => _279.md, 'optionalAccess', _280 => _280.enabled]) ? `
|
|
12871
12912
|
// Advertise the Markdown mirror in the head as well as the Link header,
|
|
12872
12913
|
// using the public path the .md request will be resolved against.
|
|
12873
12914
|
mergedMetadata = addMetadataMarkdownAlternate(
|
|
@@ -12896,7 +12937,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
12896
12937
|
emitFarmEvent({ type: "cache.bypass", route: pathname, reason: "cookie" });
|
|
12897
12938
|
}
|
|
12898
12939
|
|
|
12899
|
-
const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access',
|
|
12940
|
+
const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _281 => _281.agent, 'optionalAccess', _282 => _282.jsonLd]), () => ( false)))} });
|
|
12900
12941
|
const title = renderedMetadata.title;
|
|
12901
12942
|
const metaTags = renderedMetadata.tags;
|
|
12902
12943
|
const hasFavicon = renderedMetadata.hasFavicon;
|
|
@@ -13741,11 +13782,11 @@ function createFarmRuntimeHookErrorResponse(request, error) {
|
|
|
13741
13782
|
export async function fetch(request, context) {${imageRuntime === "none" ? "" : `
|
|
13742
13783
|
// The image optimizer's fetch of a local source is not a loopback visitor.
|
|
13743
13784
|
context = _withFarmImageSourceClientAddress(request, context);`}
|
|
13744
|
-
${_optionalChain([config, 'access',
|
|
13785
|
+
${_optionalChain([config, 'access', _283 => _283.agent, 'optionalAccess', _284 => _284.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
|
|
13745
13786
|
basePath: farmLocalAPIBasePath,
|
|
13746
13787
|
dispatch: async (localRequest) =>
|
|
13747
13788
|
(await handleAPIRequest(localRequest)) ?? Response.json({ error: "Not Found" }, { status: 404 }),
|
|
13748
|
-
}, () => handleFarmFetch(request, context));${_optionalChain([config, 'access',
|
|
13789
|
+
}, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _285 => _285.agent, 'optionalAccess', _286 => _286.noindexPreviews]) ? `
|
|
13749
13790
|
// Keep every response of a preview deployment out of search indexes.
|
|
13750
13791
|
return farmNoindexPreview ? applyFarmPreviewRobotsTag(response) : response;` : ""}
|
|
13751
13792
|
}
|
|
@@ -13955,7 +13996,7 @@ function getManifestPageEntry(manifest, pathname) {
|
|
|
13955
13996
|
})).sort((left, right) => _chunkML4TOUZPcjs.compareRouteSpecificity.call(void 0, left.specificity, right.specificity)).map(({ entry, matches }) => ({ entry, matches }));
|
|
13956
13997
|
manifestPageMatchers.set(manifest.routes, pages);
|
|
13957
13998
|
}
|
|
13958
|
-
return _optionalChain([pages, 'access',
|
|
13999
|
+
return _optionalChain([pages, 'access', _287 => _287.find, 'call', _288 => _288((page) => page.matches(pathname)), 'optionalAccess', _289 => _289.entry]);
|
|
13959
14000
|
}
|
|
13960
14001
|
function withFarmEdgeGuardedPrerenderHeaders(headers, edgeGuarded) {
|
|
13961
14002
|
if (!edgeGuarded) return headers;
|
|
@@ -13992,13 +14033,13 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
13992
14033
|
if (rewriteSources.some((source) => middlewarePatternMatches(source, pathname))) {
|
|
13993
14034
|
return "rewrite";
|
|
13994
14035
|
}
|
|
13995
|
-
if (
|
|
13996
|
-
if (
|
|
13997
|
-
if (
|
|
14036
|
+
if (_chunk4ZVKDHS6cjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
|
|
14037
|
+
if (_chunk4ZVKDHS6cjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
|
|
14038
|
+
if (_chunkIRPXOTENcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
|
|
13998
14039
|
if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
|
|
13999
14040
|
const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
|
|
14000
|
-
if (_optionalChain([manifestEntry, 'optionalAccess',
|
|
14001
|
-
if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access',
|
|
14041
|
+
if (_optionalChain([manifestEntry, 'optionalAccess', _290 => _290.rendering]) === "dynamic") return "dynamic runtime manifest";
|
|
14042
|
+
if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _291 => _291.regions, 'optionalAccess', _292 => _292.length])) || manifestEntry.maxDuration !== void 0)) {
|
|
14002
14043
|
return "route runtime controls";
|
|
14003
14044
|
}
|
|
14004
14045
|
const routeRule = getEffectiveRouteRule(config, pathname);
|
|
@@ -14011,7 +14052,7 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
14011
14052
|
return void 0;
|
|
14012
14053
|
}
|
|
14013
14054
|
async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
14014
|
-
if (!_optionalChain([config, 'access',
|
|
14055
|
+
if (!_optionalChain([config, 'access', _293 => _293.docs, 'optionalAccess', _294 => _294.enabled]) || !config.docs.prerender) return [];
|
|
14015
14056
|
if (_chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge") {
|
|
14016
14057
|
_chunk7U4XF76Rcjs.logger.info(
|
|
14017
14058
|
`\u21AA Keeping docs pages in the edge docs snapshot: docs.prerender writes static files on Node and serverless targets, not "${preset}".`
|
|
@@ -14030,7 +14071,7 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
|
14030
14071
|
}
|
|
14031
14072
|
return pages2;
|
|
14032
14073
|
}
|
|
14033
|
-
const pages = await
|
|
14074
|
+
const pages = await _chunkSG5RFGV6cjs.listFarmDocsAdapterPages.call(void 0, config.docs, { root, srcDir: config.srcDir });
|
|
14034
14075
|
if (!pages) {
|
|
14035
14076
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
14036
14077
|
`The docs adapter ${JSON.stringify(config.docs.adapter.id)} does not list its pages for prerendering; upgrade it to prerender docs pages. They render on request until then.`
|
|
@@ -14040,11 +14081,11 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
|
14040
14081
|
return pages;
|
|
14041
14082
|
}
|
|
14042
14083
|
async function listFarmDocsAnalyticsPages(config, root, preset) {
|
|
14043
|
-
if (!_optionalChain([config, 'access',
|
|
14084
|
+
if (!_optionalChain([config, 'access', _295 => _295.docs, 'optionalAccess', _296 => _296.enabled]) || config.analytics === false || _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) !== "nodejs") {
|
|
14044
14085
|
return [];
|
|
14045
14086
|
}
|
|
14046
14087
|
try {
|
|
14047
|
-
return await
|
|
14088
|
+
return await _chunkSG5RFGV6cjs.listFarmDocsPagePaths.call(void 0, config.docs, {
|
|
14048
14089
|
root,
|
|
14049
14090
|
srcDir: config.srcDir,
|
|
14050
14091
|
adapter: _chunkL2GUEYHRcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)
|
|
@@ -14058,9 +14099,9 @@ async function listFarmDocsAnalyticsPages(config, root, preset) {
|
|
|
14058
14099
|
}
|
|
14059
14100
|
function hasFarmNitroCacheRouteRule(routeRules) {
|
|
14060
14101
|
return Object.values(routeRules || {}).some((rule) => {
|
|
14061
|
-
const swr = _optionalChain([rule, 'optionalAccess',
|
|
14062
|
-
const cache = _optionalChain([rule, 'optionalAccess',
|
|
14063
|
-
const headers = _optionalChain([rule, 'optionalAccess',
|
|
14102
|
+
const swr = _optionalChain([rule, 'optionalAccess', _297 => _297.swr]);
|
|
14103
|
+
const cache = _optionalChain([rule, 'optionalAccess', _298 => _298.cache]);
|
|
14104
|
+
const headers = _optionalChain([rule, 'optionalAccess', _299 => _299.headers]);
|
|
14064
14105
|
return swr !== void 0 && swr !== false || cache !== void 0 && cache !== false || !!headers && typeof headers === "object" && Object.keys(headers).length > 0;
|
|
14065
14106
|
});
|
|
14066
14107
|
}
|
|
@@ -14073,10 +14114,10 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
14073
14114
|
const nitroBuilder = nitroBuilderResult.value;
|
|
14074
14115
|
const isVercel = preset === "vercel";
|
|
14075
14116
|
const isCloudflareWorker = preset === "cloudflare-module";
|
|
14076
|
-
const outputDir =
|
|
14117
|
+
const outputDir = _chunkIRPXOTENcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
14077
14118
|
const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
|
|
14078
14119
|
const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
|
|
14079
|
-
const imageRuntime =
|
|
14120
|
+
const imageRuntime = _chunkPQ6DBVJ2cjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
14080
14121
|
const hasGeneratedMetadataImages = Array.from(routeManager.getMetadataImages().values()).some(
|
|
14081
14122
|
(image) => image.sourceType === "module"
|
|
14082
14123
|
);
|
|
@@ -14132,7 +14173,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
14132
14173
|
const edgeGuardedPrerenderRoutes = [];
|
|
14133
14174
|
const addPrerenderRoute = (pathname) => {
|
|
14134
14175
|
prerenderRoutes.push(pathname);
|
|
14135
|
-
if (
|
|
14176
|
+
if (_chunk4ZVKDHS6cjs.appMiddlewareMayHandlePath.call(void 0, edgeMiddlewareRoutes, pathname)) {
|
|
14136
14177
|
edgeGuardedPrerenderRoutes.push(pathname);
|
|
14137
14178
|
}
|
|
14138
14179
|
};
|
|
@@ -14226,7 +14267,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
14226
14267
|
webEntry: clientJsSrc,
|
|
14227
14268
|
webBoot: clientBootSrc,
|
|
14228
14269
|
stylesheet: clientCssHref,
|
|
14229
|
-
webFiles: _nullishCoalesce(_optionalChain([clientModulePreloads, 'optionalAccess',
|
|
14270
|
+
webFiles: _nullishCoalesce(_optionalChain([clientModulePreloads, 'optionalAccess', _300 => _300.files]), () => ( []))
|
|
14230
14271
|
})
|
|
14231
14272
|
) : null;
|
|
14232
14273
|
for (const output of Object.values(ssrBundle)) {
|
|
@@ -14552,7 +14593,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
14552
14593
|
varyFarmNitroCacheRules(_chunkIIHZ2BEEcjs.routeRulesToNitroRouteRules.call(void 0, config.routeRules), [
|
|
14553
14594
|
...config.md.enabled ? ["accept"] : [],
|
|
14554
14595
|
...shouldBuildFarmMobileClient(config) ? ["x-farm-shell"] : [],
|
|
14555
|
-
..._chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
14596
|
+
..._chunkT7UC2ORAcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _301 => _301.experimental, 'optionalAccess', _302 => _302.serverComponents])) === "islands" ? ["f-layouts"] : []
|
|
14556
14597
|
]),
|
|
14557
14598
|
config.basePath,
|
|
14558
14599
|
_chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, config.api)
|
|
@@ -14717,22 +14758,22 @@ function toFarmNodeResponse(request, response) {
|
|
|
14717
14758
|
snapshotSSRRebundleOptions(nitroConfig)
|
|
14718
14759
|
);
|
|
14719
14760
|
const requestedBuilder = _nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER));
|
|
14720
|
-
const nitroBuildIsFarms = (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access',
|
|
14721
|
-
_optionalChain([nitroConfig, 'access',
|
|
14722
|
-
(handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess',
|
|
14761
|
+
const nitroBuildIsFarms = (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _303 => _303.rollupConfig, 'optionalAccess', _304 => _304.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _305 => _305.rollupConfig, 'optionalAccess', _306 => _306.plugins])) && customRollupKeys.length === 0 && Boolean(
|
|
14762
|
+
_optionalChain([nitroConfig, 'access', _307 => _307.handlers, 'optionalAccess', _308 => _308.some, 'call', _309 => _309(
|
|
14763
|
+
(handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _310 => _310.handler]) || "") === nitroEntryPath
|
|
14723
14764
|
)])
|
|
14724
14765
|
);
|
|
14725
|
-
const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && nitroBuildIsFarms && _path2.default.resolve(_optionalChain([nitroConfig, 'access',
|
|
14766
|
+
const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && nitroBuildIsFarms && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _311 => _311.output, 'optionalAccess', _312 => _312.serverDir]) || "") === _path2.default.resolve(expectedServerDir);
|
|
14726
14767
|
const prerenderReusesPrebuiltSSR = prerenderRoutes.length > 0 && ssrExternalsArePackaged && nitroBuildIsFarms;
|
|
14727
14768
|
const selectRolldownBuilder = canReusePrebuiltSSR && requestedBuilder === void 0 && await canUseRolldownBuilder();
|
|
14728
14769
|
if (selectRolldownBuilder) nitroConfig.builder = "rolldown";
|
|
14729
14770
|
const useRolldownBuilder = canReusePrebuiltSSR && (_nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER))) === "rolldown";
|
|
14730
14771
|
const shouldMinify = nitroConfig.minify !== false;
|
|
14731
|
-
const keepServerNames = !(_optionalChain([config, 'access',
|
|
14772
|
+
const keepServerNames = !(_optionalChain([config, 'access', _313 => _313.docs, 'optionalAccess', _314 => _314.enabled]) && _optionalChain([config, 'access', _315 => _315.docs, 'access', _316 => _316.adapter, 'optionalAccess', _317 => _317.server]));
|
|
14732
14773
|
const useFarmServerMinifier = shouldMinify && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig;
|
|
14733
14774
|
const serverChunkMinifier = useFarmServerMinifier ? createServerChunkMinifyPlugin({ keepNames: keepServerNames, target: "esnext" }) : null;
|
|
14734
14775
|
const ssrRollupPlugin = canReusePrebuiltSSR ? prebuiltSSRPlugin : createServerReadSSRAssetsPlugin(ssrBundle, ssrOutputDir);
|
|
14735
|
-
const configuredRollupPlugins = _optionalChain([nitroConfig, 'access',
|
|
14776
|
+
const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _318 => _318.rollupConfig, 'optionalAccess', _319 => _319.plugins]);
|
|
14736
14777
|
nitroConfig.rollupConfig = {
|
|
14737
14778
|
...nitroConfig.rollupConfig,
|
|
14738
14779
|
plugins: [
|
|
@@ -14771,7 +14812,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
14771
14812
|
let skippedNonHtmlPrerenderRoute = false;
|
|
14772
14813
|
nitroInstance.hooks.hook("prerender:generate", (route) => {
|
|
14773
14814
|
if (route.error || !prerenderPagePaths.has(route.route)) return;
|
|
14774
|
-
if (_optionalChain([route, 'access',
|
|
14815
|
+
if (_optionalChain([route, 'access', _320 => _320.contentType, 'optionalAccess', _321 => _321.toLowerCase, 'call', _322 => _322(), 'access', _323 => _323.includes, 'call', _324 => _324("html")])) return;
|
|
14775
14816
|
route.skip = true;
|
|
14776
14817
|
skippedNonHtmlPrerenderRoute = true;
|
|
14777
14818
|
const configuredRule = configuredNitroRouteRules[route.route];
|
|
@@ -14782,9 +14823,9 @@ function toFarmNodeResponse(request, response) {
|
|
|
14782
14823
|
nitroInstance.hooks.hook("prerender:done", () => {
|
|
14783
14824
|
if (skippedNonHtmlPrerenderRoute) nitroInstance.routing.sync();
|
|
14784
14825
|
});
|
|
14785
|
-
if (_optionalChain([config, 'access',
|
|
14826
|
+
if (_optionalChain([config, 'access', _325 => _325.md, 'optionalAccess', _326 => _326.enabled])) {
|
|
14786
14827
|
nitroInstance.hooks.hook("prerender:generate", (route) => {
|
|
14787
|
-
if (!route.contents || !_optionalChain([route, 'access',
|
|
14828
|
+
if (!route.contents || !_optionalChain([route, 'access', _327 => _327.contentType, 'optionalAccess', _328 => _328.toLowerCase, 'call', _329 => _329(), 'access', _330 => _330.includes, 'call', _331 => _331("html")])) return;
|
|
14788
14829
|
const alternatePath = _chunk2NOHVIJ3cjs.getFarmMarkdownAlternatePath.call(void 0, config.md, route.route, {
|
|
14789
14830
|
routePathname: (pathname) => routeManager.toRoutePathname(pathname)
|
|
14790
14831
|
});
|
|
@@ -14807,7 +14848,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
14807
14848
|
}
|
|
14808
14849
|
if (config.security.csp && config.security.csp.nonce) {
|
|
14809
14850
|
nitroInstance.hooks.hook("prerender:generate", async (route) => {
|
|
14810
|
-
if (!route.contents || !_optionalChain([route, 'access',
|
|
14851
|
+
if (!route.contents || !_optionalChain([route, 'access', _332 => _332.contentType, 'optionalAccess', _333 => _333.toLowerCase, 'call', _334 => _334(), 'access', _335 => _335.includes, 'call', _336 => _336("html")])) return;
|
|
14811
14852
|
const staticCsp = await _chunk6JHZPB52cjs.applyFarmCspHashesToHtml.call(void 0, route.contents, config.security);
|
|
14812
14853
|
if (!staticCsp) return;
|
|
14813
14854
|
route.contents = staticCsp.html;
|
|
@@ -14843,7 +14884,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
14843
14884
|
await nitroBuilder.copyPublicAssets(nitroInstance);
|
|
14844
14885
|
if (prerenderReusesPrebuiltSSR && !canReusePrebuiltSSR) {
|
|
14845
14886
|
nitroInstance.hooks.hook("prerender:config", (prerendererConfig) => {
|
|
14846
|
-
const configuredPlugins = _optionalChain([prerendererConfig, 'access',
|
|
14887
|
+
const configuredPlugins = _optionalChain([prerendererConfig, 'access', _337 => _337.rollupConfig, 'optionalAccess', _338 => _338.plugins]);
|
|
14847
14888
|
const plugins = Array.isArray(configuredPlugins) ? configuredPlugins : configuredPlugins ? [configuredPlugins] : [];
|
|
14848
14889
|
prerendererConfig.rollupConfig = {
|
|
14849
14890
|
...prerendererConfig.rollupConfig,
|
|
@@ -14900,13 +14941,13 @@ function toFarmNodeResponse(request, response) {
|
|
|
14900
14941
|
}
|
|
14901
14942
|
if (prerenderRoutes.length > 0) {
|
|
14902
14943
|
_chunk7U4XF76Rcjs.logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
|
|
14903
|
-
const previousPrerender = process.env[
|
|
14904
|
-
process.env[
|
|
14944
|
+
const previousPrerender = process.env[_chunkFEWCWBOFcjs.FARM_PRERENDER_ENV];
|
|
14945
|
+
process.env[_chunkFEWCWBOFcjs.FARM_PRERENDER_ENV] = "1";
|
|
14905
14946
|
try {
|
|
14906
14947
|
await nitroBuilder.prerender(nitroInstance);
|
|
14907
14948
|
} finally {
|
|
14908
|
-
if (previousPrerender === void 0) delete process.env[
|
|
14909
|
-
else process.env[
|
|
14949
|
+
if (previousPrerender === void 0) delete process.env[_chunkFEWCWBOFcjs.FARM_PRERENDER_ENV];
|
|
14950
|
+
else process.env[_chunkFEWCWBOFcjs.FARM_PRERENDER_ENV] = previousPrerender;
|
|
14910
14951
|
}
|
|
14911
14952
|
}
|
|
14912
14953
|
const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs5, preset) : Promise.resolve(null);
|
|
@@ -15083,7 +15124,7 @@ async function moveVercelOutputPath(src, dest, fs5) {
|
|
|
15083
15124
|
await fs5.rename(src, dest);
|
|
15084
15125
|
return;
|
|
15085
15126
|
} catch (error) {
|
|
15086
|
-
const code = _optionalChain([error, 'optionalAccess',
|
|
15127
|
+
const code = _optionalChain([error, 'optionalAccess', _339 => _339.code]);
|
|
15087
15128
|
if (code !== "EPERM" && code !== "EACCES" && code !== "EXDEV" && code !== "ENOTEMPTY") {
|
|
15088
15129
|
throw error;
|
|
15089
15130
|
}
|
|
@@ -15109,7 +15150,7 @@ async function postProcessVercelOutput(root, outputDir, fs5, config, farmWorkflo
|
|
|
15109
15150
|
try {
|
|
15110
15151
|
await moveVercelOutputPath(publicDir, staticDir, fs5);
|
|
15111
15152
|
} catch (error) {
|
|
15112
|
-
if (_optionalChain([error, 'optionalAccess',
|
|
15153
|
+
if (_optionalChain([error, 'optionalAccess', _340 => _340.code]) !== "ENOENT") throw error;
|
|
15113
15154
|
}
|
|
15114
15155
|
await copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs5);
|
|
15115
15156
|
await copyPrismaClientForVercel(root, nitroFuncDir, fs5);
|
|
@@ -15123,7 +15164,7 @@ async function postProcessVercelOutput(root, outputDir, fs5, config, farmWorkflo
|
|
|
15123
15164
|
config.basePath
|
|
15124
15165
|
);
|
|
15125
15166
|
const edgeMiddlewareRoutes = edgeMiddleware.middlewareRoutes.filter(
|
|
15126
|
-
(route) => edgeMiddleware.guardedPages.some((pathname) =>
|
|
15167
|
+
(route) => edgeMiddleware.guardedPages.some((pathname) => _chunk4ZVKDHS6cjs.appMiddlewareMayHandlePath.call(void 0, [route], pathname))
|
|
15127
15168
|
);
|
|
15128
15169
|
if (edgeMiddlewareRoutes.length > 0) {
|
|
15129
15170
|
await writeFarmVercelEdgeMiddlewareFunction({
|
|
@@ -15151,7 +15192,7 @@ async function postProcessVercelOutput(root, outputDir, fs5, config, farmWorkflo
|
|
|
15151
15192
|
_chunk7U4XF76Rcjs.logger.info("\u2705 Post-processed Vercel output for Build Output API v3");
|
|
15152
15193
|
}
|
|
15153
15194
|
async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs5) {
|
|
15154
|
-
if (!_optionalChain([config, 'access',
|
|
15195
|
+
if (!_optionalChain([config, 'access', _341 => _341.docs, 'optionalAccess', _342 => _342.enabled])) return;
|
|
15155
15196
|
const [mainRoot, ...extraRoots] = _chunkHR5GU4UUcjs.getFarmDocsRoots.call(void 0, config.docs);
|
|
15156
15197
|
await copyFarmDocsRootContent(
|
|
15157
15198
|
mainRoot,
|
|
@@ -15176,7 +15217,7 @@ async function copyFarmDocsRootContent(docs, root, srcDir, bundledContentDir, fs
|
|
|
15176
15217
|
const lastModifiedManifest = _chunkHR5GU4UUcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
|
|
15177
15218
|
fallback: "now"
|
|
15178
15219
|
});
|
|
15179
|
-
const undatedPages = _nullishCoalesce(_optionalChain([lastModifiedManifest, 'access',
|
|
15220
|
+
const undatedPages = _nullishCoalesce(_optionalChain([lastModifiedManifest, 'access', _343 => _343.unknown, 'optionalAccess', _344 => _344.length]), () => ( 0));
|
|
15180
15221
|
if (undatedPages > 0) {
|
|
15181
15222
|
_chunk7U4XF76Rcjs.logger.warn(
|
|
15182
15223
|
`${undatedPages} docs page(s) were last changed before this shallow clone's Git history, so they show no "Last updated" date. Build from a full clone (git fetch --unshallow) or set lastModified in the page's frontmatter.`
|
|
@@ -15261,7 +15302,7 @@ async function stageSharpRuntime(config, root, distDir, fs5, preset) {
|
|
|
15261
15302
|
try {
|
|
15262
15303
|
await copyPackage("sharp", sharpRequire);
|
|
15263
15304
|
if (!copiedPackages.has("sharp")) {
|
|
15264
|
-
throw new Error(`Farm image optimization requires sharp. ${
|
|
15305
|
+
throw new Error(`Farm image optimization requires sharp. ${_chunkPQ6DBVJ2cjs.SHARP_INSTALL_HINT}`);
|
|
15265
15306
|
}
|
|
15266
15307
|
} catch (error) {
|
|
15267
15308
|
await fs5.rm(stageDir, { recursive: true, force: true });
|
|
@@ -15494,7 +15535,7 @@ async function createFarmProjectModuleSsrEnvironment() {
|
|
|
15494
15535
|
// src/build/index.ts
|
|
15495
15536
|
async function build(config, options = {}) {
|
|
15496
15537
|
return _chunkNG2EZ6QScjs.withProductionNodeEnv.call(void 0,
|
|
15497
|
-
() =>
|
|
15538
|
+
() => _chunkPA3VZNWUcjs.withPackageClientBoundaryCache.call(void 0, () => buildWithProductionNodeEnv(config, options))
|
|
15498
15539
|
);
|
|
15499
15540
|
}
|
|
15500
15541
|
function createBuildTargetBaseline(config) {
|
|
@@ -15505,7 +15546,7 @@ function createBuildTargetBaseline(config) {
|
|
|
15505
15546
|
preset,
|
|
15506
15547
|
distDir,
|
|
15507
15548
|
outputDir,
|
|
15508
|
-
outputWasDerived: outputDir ===
|
|
15549
|
+
outputWasDerived: outputDir === _chunkIRPXOTENcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
|
|
15509
15550
|
};
|
|
15510
15551
|
}
|
|
15511
15552
|
function resolveBuildTargets(config, options, baseline) {
|
|
@@ -15514,8 +15555,8 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
15514
15555
|
const distDir = config.distDir || ".farm";
|
|
15515
15556
|
const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
|
|
15516
15557
|
const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
|
|
15517
|
-
const deployTarget = preset === config.deploy.preset ? config.deploy.target :
|
|
15518
|
-
const outputDir = shouldRefreshDerivedOutput ?
|
|
15558
|
+
const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkIRPXOTENcjs.getDeployTargetForPreset.call(void 0, preset);
|
|
15559
|
+
const outputDir = shouldRefreshDerivedOutput ? _chunkIRPXOTENcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
|
|
15519
15560
|
return {
|
|
15520
15561
|
root,
|
|
15521
15562
|
preset,
|
|
@@ -15523,7 +15564,7 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
15523
15564
|
distDir,
|
|
15524
15565
|
deployTarget,
|
|
15525
15566
|
outputDir,
|
|
15526
|
-
deployOutputDir:
|
|
15567
|
+
deployOutputDir: _chunkIRPXOTENcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
|
|
15527
15568
|
};
|
|
15528
15569
|
}
|
|
15529
15570
|
async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
@@ -15560,15 +15601,15 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
15560
15601
|
};
|
|
15561
15602
|
config = {
|
|
15562
15603
|
...config,
|
|
15563
|
-
images:
|
|
15604
|
+
images: _chunkPQ6DBVJ2cjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
|
|
15564
15605
|
root: targets.root,
|
|
15565
15606
|
preset: targets.preset
|
|
15566
15607
|
})
|
|
15567
15608
|
};
|
|
15568
|
-
if (_optionalChain([config, 'access',
|
|
15609
|
+
if (_optionalChain([config, 'access', _345 => _345.docs, 'optionalAccess', _346 => _346.enabled])) await _chunkNDOE76QCcjs.loadFarmDocsEngine.call(void 0, );
|
|
15569
15610
|
pluginManager.updateContext({ config });
|
|
15570
15611
|
const { root, preset, srcDir, distDir, deployOutputDir } = targets;
|
|
15571
|
-
|
|
15612
|
+
_chunkPA3VZNWUcjs.usePackageClientBoundaryCacheFile.call(void 0, _chunkPA3VZNWUcjs.resolvePackageClientBoundaryCacheFile.call(void 0, root, distDir));
|
|
15572
15613
|
_chunk7U4XF76Rcjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
|
|
15573
15614
|
await pluginManager.setupPlugins();
|
|
15574
15615
|
await pluginManager.runHookParallel("beforeBundle", {
|
|
@@ -15580,8 +15621,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
15580
15621
|
});
|
|
15581
15622
|
_chunk7U4XF76Rcjs.logger.info("\u{1F50D} Discovering routes and API endpoints...");
|
|
15582
15623
|
const productionViteResult = productionViteResultPromise ? (await productionViteResultPromise)[0] : void 0;
|
|
15583
|
-
if (_optionalChain([productionViteResult, 'optionalAccess',
|
|
15584
|
-
const productionVite = _optionalChain([productionViteResult, 'optionalAccess',
|
|
15624
|
+
if (_optionalChain([productionViteResult, 'optionalAccess', _347 => _347.status]) === "rejected") throw productionViteResult.reason;
|
|
15625
|
+
const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _348 => _348.value]);
|
|
15585
15626
|
const createViteServer = productionVite ? productionVite.createServer : (await import("vite")).createServer;
|
|
15586
15627
|
projectModuleServer = await createProjectModuleServer(
|
|
15587
15628
|
createViteServer,
|
|
@@ -15589,19 +15630,19 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
15589
15630
|
root,
|
|
15590
15631
|
rendererBuild.signal
|
|
15591
15632
|
);
|
|
15592
|
-
const farmApp =
|
|
15633
|
+
const farmApp = _chunkPQ6DBVJ2cjs.createFarmApp.call(void 0, config, projectModuleServer);
|
|
15593
15634
|
if (options.universal !== false) farmApp.getRouteManager().keepBuildSourceSnapshot();
|
|
15594
15635
|
await farmApp.initialize();
|
|
15595
15636
|
const routeManager = farmApp.getRouteManager();
|
|
15596
15637
|
const serverRenderer = farmApp.getServerRenderer();
|
|
15597
|
-
const typeArtifacts =
|
|
15638
|
+
const typeArtifacts = _chunkERV422FOcjs.generateFarmTypeArtifacts.call(void 0, {
|
|
15598
15639
|
root,
|
|
15599
15640
|
srcDir,
|
|
15600
15641
|
layers: config.layers,
|
|
15601
15642
|
storage: config.storage,
|
|
15602
15643
|
plugins: config.plugins,
|
|
15603
15644
|
extraRoutes: [
|
|
15604
|
-
..._optionalChain([config, 'access',
|
|
15645
|
+
..._optionalChain([config, 'access', _349 => _349.openapi, 'optionalAccess', _350 => _350.enabled]) && config.openapi.route ? [config.openapi.route] : [],
|
|
15605
15646
|
..._chunkHR5GU4UUcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
|
|
15606
15647
|
],
|
|
15607
15648
|
suppressLintOnLink: config.suppressLintOnLink,
|
|
@@ -15612,7 +15653,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
15612
15653
|
const message = error instanceof Error ? error.message : String(error);
|
|
15613
15654
|
_chunk7U4XF76Rcjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
|
|
15614
15655
|
});
|
|
15615
|
-
const apiRouteManager = new (0,
|
|
15656
|
+
const apiRouteManager = new (0, _chunk3MY6TNNEcjs.APIRouteManager)(
|
|
15616
15657
|
_chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, config),
|
|
15617
15658
|
projectModuleServer,
|
|
15618
15659
|
{
|
|
@@ -15687,7 +15728,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
15687
15728
|
throw error;
|
|
15688
15729
|
} finally {
|
|
15689
15730
|
try {
|
|
15690
|
-
await _optionalChain([projectModuleServer, 'optionalAccess',
|
|
15731
|
+
await _optionalChain([projectModuleServer, 'optionalAccess', _351 => _351.close, 'call', _352 => _352()]);
|
|
15691
15732
|
} finally {
|
|
15692
15733
|
rendererBuild.abort();
|
|
15693
15734
|
}
|
|
@@ -15699,7 +15740,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
15699
15740
|
ssr: true,
|
|
15700
15741
|
buildLifetime
|
|
15701
15742
|
});
|
|
15702
|
-
const viteConfig =
|
|
15743
|
+
const viteConfig = _chunkPQ6DBVJ2cjs.mergeFarmViteConfig.call(void 0,
|
|
15703
15744
|
{
|
|
15704
15745
|
root,
|
|
15705
15746
|
appType: "custom",
|
|
@@ -15711,12 +15752,13 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
15711
15752
|
},
|
|
15712
15753
|
plugins: [
|
|
15713
15754
|
...rendererVitePlugins,
|
|
15714
|
-
|
|
15755
|
+
_chunkPQ6DBVJ2cjs.farmFontImportsPlugin.call(void 0, {
|
|
15715
15756
|
root,
|
|
15716
15757
|
basePath: config.basePath,
|
|
15717
|
-
publicDir: config.publicDir
|
|
15758
|
+
publicDir: config.publicDir,
|
|
15759
|
+
isLayoutModule: (id) => _chunkPQ6DBVJ2cjs.isFarmLayoutModule.call(void 0, id, _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, config))
|
|
15718
15760
|
}),
|
|
15719
|
-
|
|
15761
|
+
_chunkPA3VZNWUcjs.farmEnvironmentFunctionsPlugin.call(void 0, { renderer: config.renderer }),
|
|
15720
15762
|
// Route modules load here at build time (rendering config, prerendering): `server-only`
|
|
15721
15763
|
// resolves as it does in the server build. Module-entry packages load pre-bundled, as in
|
|
15722
15764
|
// `farm dev`: unbundled, lucide-react alone is ~1,750 modules through the module runner,
|
|
@@ -15732,7 +15774,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
15732
15774
|
hmr: false
|
|
15733
15775
|
},
|
|
15734
15776
|
resolve: {
|
|
15735
|
-
alias:
|
|
15777
|
+
alias: _chunkPQ6DBVJ2cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
15736
15778
|
dedupe: [...config.renderer.dedupe || []]
|
|
15737
15779
|
},
|
|
15738
15780
|
optimizeDeps: {
|
|
@@ -15771,10 +15813,10 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
15771
15813
|
noDiscovery: true
|
|
15772
15814
|
},
|
|
15773
15815
|
// An app or plugin that brings its own SSR environment keeps it.
|
|
15774
|
-
environments: _optionalChain([viteConfig, 'access',
|
|
15816
|
+
environments: _optionalChain([viteConfig, 'access', _353 => _353.environments, 'optionalAccess', _354 => _354.ssr, 'optionalAccess', _355 => _355.dev, 'optionalAccess', _356 => _356.createEnvironment]) ? viteConfig.environments : {
|
|
15775
15817
|
...viteConfig.environments,
|
|
15776
15818
|
ssr: {
|
|
15777
|
-
..._optionalChain([viteConfig, 'access',
|
|
15819
|
+
..._optionalChain([viteConfig, 'access', _357 => _357.environments, 'optionalAccess', _358 => _358.ssr]),
|
|
15778
15820
|
...await createFarmProjectModuleSsrEnvironment()
|
|
15779
15821
|
}
|
|
15780
15822
|
}
|
|
@@ -15788,7 +15830,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
|
|
|
15788
15830
|
farmPlugin,
|
|
15789
15831
|
farmServerOnlyEntriesPlugin
|
|
15790
15832
|
} = await import("./vite.cjs");
|
|
15791
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
15833
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-MWO3G2XM.cjs");
|
|
15792
15834
|
const pluginManager = new PluginManager2({
|
|
15793
15835
|
config,
|
|
15794
15836
|
isDev: false,
|
|
@@ -15810,14 +15852,14 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
|
|
|
15810
15852
|
farmNavigationPlugin(config.renderer),
|
|
15811
15853
|
farmIslandContainersPlugin(config),
|
|
15812
15854
|
farmPlugin(config, pluginManager),
|
|
15813
|
-
|
|
15855
|
+
_chunkPA3VZNWUcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
15814
15856
|
],
|
|
15815
15857
|
mode: "production"
|
|
15816
15858
|
});
|
|
15817
15859
|
}
|
|
15818
15860
|
async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
|
|
15819
15861
|
const { farmI18nClientBridgePlugin, farmIslandContainersPlugin, farmPlugin } = await import("./vite.cjs");
|
|
15820
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
15862
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-MWO3G2XM.cjs");
|
|
15821
15863
|
const pluginManager = new PluginManager2({
|
|
15822
15864
|
config,
|
|
15823
15865
|
isDev: false,
|
|
@@ -15838,13 +15880,13 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
|
|
|
15838
15880
|
define: {
|
|
15839
15881
|
__FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
|
|
15840
15882
|
__FARM_ENV__: JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, config.env)),
|
|
15841
|
-
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access',
|
|
15883
|
+
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _359 => _359.env, 'optionalAccess', _360 => _360.public]) || {})
|
|
15842
15884
|
},
|
|
15843
15885
|
plugins: [
|
|
15844
15886
|
farmI18nClientBridgePlugin(),
|
|
15845
15887
|
farmIslandContainersPlugin(config),
|
|
15846
15888
|
farmPlugin(config, pluginManager),
|
|
15847
|
-
|
|
15889
|
+
_chunkPA3VZNWUcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
15848
15890
|
],
|
|
15849
15891
|
mode: "production"
|
|
15850
15892
|
});
|
|
@@ -15872,7 +15914,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
15872
15914
|
if (pluginManager) {
|
|
15873
15915
|
nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
|
|
15874
15916
|
}
|
|
15875
|
-
const outputDir =
|
|
15917
|
+
const outputDir = _chunkIRPXOTENcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
15876
15918
|
const serverOutputDir = _path2.default.join(outputDir, "server");
|
|
15877
15919
|
const publicOutputDir = _path2.default.join(outputDir, "public");
|
|
15878
15920
|
const { mkdir, cp } = await import("fs/promises");
|
|
@@ -15943,7 +15985,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
15943
15985
|
root,
|
|
15944
15986
|
preset,
|
|
15945
15987
|
distDir,
|
|
15946
|
-
outputDir:
|
|
15988
|
+
outputDir: _chunkIRPXOTENcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
|
|
15947
15989
|
});
|
|
15948
15990
|
}
|
|
15949
15991
|
}
|