@farm.js/core 0.1.49 → 0.1.51-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/README.md +163 -3
- package/dist/{agent-mcp-Bb8hnnqd.d.ts → agent-mcp-BBMfNpsC.d.ts} +1 -1
- package/dist/{agent-mcp-ir3v4fHf.d.mts → agent-mcp-D44ip11f.d.mts} +1 -1
- package/dist/agent-runtime.cjs +3 -3
- package/dist/agent-runtime.d.mts +6 -6
- package/dist/agent-runtime.d.ts +6 -6
- package/dist/agent-runtime.mjs +2 -2
- package/dist/analyzer-HOUCQR3K.mjs +1066 -0
- package/dist/analyzer-VKUDHNDF.cjs +1066 -0
- package/dist/api/client.d.mts +0 -1
- package/dist/api/client.d.ts +0 -1
- package/dist/api/route-manager.cjs +8 -8
- package/dist/api/route-manager.d.mts +10 -10
- package/dist/api/route-manager.d.ts +10 -10
- package/dist/api/route-manager.mjs +7 -7
- package/dist/api/runtime.cjs +3 -3
- package/dist/api/runtime.d.mts +7 -7
- package/dist/api/runtime.d.ts +7 -7
- package/dist/api/runtime.mjs +2 -2
- package/dist/api.cjs +9 -9
- package/dist/api.d.mts +10 -10
- package/dist/api.d.ts +10 -10
- package/dist/api.mjs +8 -8
- package/dist/{app-y649szYm.d.ts → app-CourU3rQ.d.ts} +7 -7
- package/dist/{app-DLzz02du.d.mts → app-aeD4s_mg.d.mts} +7 -7
- package/dist/{app-manifest-Crn8Qd3U.d.mts → app-manifest-BC6mFn5A.d.mts} +1 -1
- package/dist/{app-manifest-DNeTKMRL.d.ts → app-manifest-LzjoNPeq.d.ts} +1 -1
- package/dist/app-markdown.d.mts +7 -7
- package/dist/app-markdown.d.ts +7 -7
- package/dist/base-path-BOUV5ozD.d.mts +10 -0
- package/dist/base-path-BOUV5ozD.d.ts +10 -0
- package/dist/cache.d.mts +4 -3
- package/dist/cache.d.ts +4 -3
- package/dist/{chunk-YQGZLCT4.cjs → chunk-2IAPKPEB.cjs} +6 -6
- package/dist/chunk-2KVDHNQS.mjs +224 -0
- package/dist/{chunk-QFQDRJKJ.mjs → chunk-3HA7PP72.mjs} +2 -2
- package/dist/{chunk-6LH33DLL.cjs → chunk-3OWVWZ6R.cjs} +28 -2
- package/dist/{chunk-GXSMF7UR.mjs → chunk-4GJJ65RB.mjs} +10 -2
- package/dist/{chunk-GERUXONA.cjs → chunk-5A77OEIG.cjs} +4 -1
- package/dist/{chunk-4HBKBHVP.mjs → chunk-5ENW27SL.mjs} +1 -1
- package/dist/{chunk-MTB57GOK.mjs → chunk-724WT3NI.mjs} +4 -2
- package/dist/{chunk-XLYXG73A.mjs → chunk-75WWOZ5C.mjs} +22 -0
- package/dist/{chunk-VCKGOXFI.cjs → chunk-76GHW3WI.cjs} +7 -1
- package/dist/{chunk-ZIBIE7AH.mjs → chunk-7UPCJDB5.mjs} +7 -1
- package/dist/{chunk-4IICUBQX.cjs → chunk-A5BJKSZE.cjs} +2 -2
- package/dist/{chunk-UYQOIPXE.mjs → chunk-AER5I65K.mjs} +1 -1
- package/dist/{chunk-WB6XES4V.mjs → chunk-ALEUMLJN.mjs} +34 -5
- package/dist/{chunk-Z4LTSH7D.mjs → chunk-AMRK3P6W.mjs} +175 -71
- package/dist/{chunk-TTYXOAB7.mjs → chunk-ANHZ6SUL.mjs} +1 -1
- package/dist/{chunk-ZBS3GOQZ.cjs → chunk-AQLHD6HZ.cjs} +35 -61
- package/dist/{chunk-L6QDME5Z.cjs → chunk-B3GZAQSC.cjs} +3 -3
- package/dist/chunk-CKPTIEDX.cjs +12 -0
- package/dist/{chunk-JPAVNDZH.cjs → chunk-CY7H5KS4.cjs} +25 -25
- package/dist/{chunk-4S7M63WX.cjs → chunk-DGOLAZLV.cjs} +22 -1
- package/dist/{chunk-4HM5B5RR.cjs → chunk-DWW3AMJX.cjs} +343 -308
- package/dist/{chunk-EQMTJBB7.cjs → chunk-DZZHTMWM.cjs} +35 -6
- package/dist/chunk-E36C43IX.cjs +224 -0
- package/dist/{chunk-J2ZEVDEK.cjs → chunk-EHB77D5U.cjs} +3 -3
- package/dist/{chunk-WQGRD5BJ.cjs → chunk-EX6ZSN5P.cjs} +1 -16
- package/dist/{chunk-C5S457CK.cjs → chunk-F42U3R4F.cjs} +214 -193
- package/dist/{chunk-FGJQS4EC.cjs → chunk-FK25QSVC.cjs} +4 -3
- package/dist/{chunk-JOHXK4BB.mjs → chunk-FSQMN2MQ.mjs} +2 -1
- package/dist/{chunk-2H3FJYY6.mjs → chunk-FSXSQQTV.mjs} +3 -2
- package/dist/chunk-G2KTRMWA.mjs +40 -0
- package/dist/{chunk-C6U66WWF.mjs → chunk-GFT5AHAT.mjs} +13 -0
- package/dist/chunk-GNZIAJGB.mjs +358 -0
- package/dist/{chunk-TXK4D46O.mjs → chunk-H3ASZDT7.mjs} +21 -1
- package/dist/{chunk-AXRNEVCS.cjs → chunk-HASX6DC7.cjs} +8 -8
- package/dist/{chunk-NW2BKDVT.mjs → chunk-HHFMECFO.mjs} +1 -1
- package/dist/{chunk-HELQXYVI.cjs → chunk-I2DQGS56.cjs} +11 -9
- package/dist/{chunk-IVHPRF4W.mjs → chunk-I2ZA5SXS.mjs} +81 -46
- package/dist/{chunk-EVCQX243.cjs → chunk-IOUOGRDX.cjs} +13 -5
- package/dist/{chunk-CBJKDB6F.mjs → chunk-IRSS4HS4.mjs} +1 -1
- package/dist/{chunk-NPPT4RWF.cjs → chunk-J22JD5YJ.cjs} +7 -7
- package/dist/{chunk-VJXLUTBM.mjs → chunk-JF5CNHHF.mjs} +9 -9
- package/dist/{chunk-VR4SEDEM.mjs → chunk-JWI5PUO2.mjs} +6 -2
- package/dist/{chunk-6XFGJBYX.cjs → chunk-JYNNIGQO.cjs} +16 -7
- package/dist/{chunk-EXHEPWFJ.cjs → chunk-KHXAJ2KA.cjs} +16 -16
- package/dist/{chunk-ALD2WMLA.mjs → chunk-KY32FWK7.mjs} +4 -4
- package/dist/{chunk-BR5FSKZ5.cjs → chunk-LEIXUFJN.cjs} +6 -2
- package/dist/{chunk-5566GNEG.cjs → chunk-LIFUPCXW.cjs} +13 -0
- package/dist/{chunk-I2SWKWO7.mjs → chunk-LJDIFIJ2.mjs} +1 -1
- package/dist/chunk-LMFJCXDD.mjs +55 -0
- package/dist/{chunk-IXSMFKZ2.cjs → chunk-LNM57D3H.cjs} +4 -4
- package/dist/{chunk-ATHPRVP2.mjs → chunk-LZ4SB57H.mjs} +3 -3
- package/dist/{chunk-73XBJRZW.cjs → chunk-MMEEXMUQ.cjs} +2 -2
- package/dist/chunk-N4AQNEXR.cjs +17 -0
- package/dist/{chunk-JZMZKABS.cjs → chunk-NWUHS6GV.cjs} +3 -2
- package/dist/{chunk-KZT2VHRQ.cjs → chunk-O3MMJPC2.cjs} +19 -19
- package/dist/{chunk-JWP56HCP.mjs → chunk-OD6WM3I7.mjs} +2 -2
- package/dist/{chunk-R2SEZEBC.cjs → chunk-OYNNA4DD.cjs} +4 -4
- package/dist/{chunk-GBPDSUFE.mjs → chunk-OZK2DS44.mjs} +1 -1
- package/dist/{chunk-A7DK663W.cjs → chunk-PDJSL7PL.cjs} +50 -39
- package/dist/{chunk-XLLVWLWO.mjs → chunk-PIHKO25G.mjs} +1 -1
- package/dist/chunk-PIUTGRDI.cjs +358 -0
- package/dist/{chunk-XO6WL6NL.mjs → chunk-PPDHCRTC.mjs} +1 -1
- package/dist/{chunk-LZBM35DH.mjs → chunk-QI5AQMEE.mjs} +20 -9
- package/dist/{chunk-FR4HJDI6.cjs → chunk-QK3HBOTG.cjs} +27 -30
- package/dist/{chunk-Q3UU2KXC.mjs → chunk-QMDU6QHN.mjs} +4 -1
- package/dist/chunk-QXJADAQB.cjs +40 -0
- package/dist/{chunk-DGVVVYKD.mjs → chunk-R5P4KFPM.mjs} +2 -2
- package/dist/{chunk-3HBFI373.cjs → chunk-S5AQ7CAC.cjs} +14 -14
- package/dist/{chunk-Z3BXMMFF.mjs → chunk-S5ZA2T2W.mjs} +63 -42
- package/dist/{chunk-PXEXOQ5R.mjs → chunk-SHS6KXOZ.mjs} +1 -1
- package/dist/{chunk-ETF5C6HR.cjs → chunk-SJ23LJ3N.cjs} +3 -3
- package/dist/{chunk-LL7TDMOM.mjs → chunk-SMUW7UST.mjs} +33 -59
- package/dist/{chunk-VCFBQFOV.mjs → chunk-SN5VSO3Q.mjs} +9 -7
- package/dist/{chunk-AIHD6VME.cjs → chunk-SO3T6T4I.cjs} +482 -378
- package/dist/{chunk-JHXJBNLY.cjs → chunk-SUCDVKUB.cjs} +21 -1
- package/dist/{chunk-DM3TFCC2.cjs → chunk-SUV6YO4Q.cjs} +5 -5
- package/dist/{chunk-NG44F7AH.mjs → chunk-T4EW7AAD.mjs} +2 -2
- package/dist/{chunk-JUMPFVMK.mjs → chunk-TUOO6IK3.mjs} +9 -0
- package/dist/chunk-UB7RVEMX.mjs +73 -0
- package/dist/{chunk-CDTIXBKN.mjs → chunk-UN6N623E.mjs} +2 -2
- package/dist/{chunk-BEXYFR2R.cjs → chunk-USL2ANCB.cjs} +10 -10
- package/dist/{chunk-HAH4FBTA.mjs → chunk-VAHBCI6X.mjs} +1 -1
- package/dist/{chunk-QNQEK3OF.cjs → chunk-VIFPE5RG.cjs} +14 -14
- package/dist/{chunk-HTLCLOXQ.cjs → chunk-VO6NLTV4.cjs} +3 -3
- package/dist/{chunk-XN2MB4QZ.cjs → chunk-VQJYGZNX.cjs} +4 -4
- package/dist/{chunk-N25RPPO5.cjs → chunk-WAPQWAE6.cjs} +10 -10
- package/dist/{chunk-5PKDHKQP.cjs → chunk-WFVSAT7Y.cjs} +6 -4
- package/dist/{chunk-EA5PMJDU.mjs → chunk-WSY2JD7O.mjs} +7 -7
- package/dist/{chunk-HNAUK3SC.mjs → chunk-WVX3BUNJ.mjs} +40 -199
- package/dist/chunk-X3EFRVXY.mjs +12 -0
- package/dist/{chunk-UCQ52TJY.mjs → chunk-X3JNB2TB.mjs} +1 -1
- package/dist/{chunk-J5VCA45K.cjs → chunk-X5BCMLGP.cjs} +1 -1
- package/dist/{chunk-SSNN55Q6.cjs → chunk-XB24LZWI.cjs} +10 -10
- package/dist/{chunk-XXB37YET.cjs → chunk-XLRLSTJ6.cjs} +7 -7
- package/dist/{chunk-BNMHXVLL.mjs → chunk-XMHERKSE.mjs} +0 -15
- package/dist/chunk-XPMC4E2G.cjs +55 -0
- package/dist/{chunk-J27BZO67.mjs → chunk-XWC5NAHV.mjs} +23 -26
- package/dist/{chunk-DRFADSKY.mjs → chunk-XXXRRVY6.mjs} +4 -4
- package/dist/{chunk-C7425KDG.cjs → chunk-XYL4HSVC.cjs} +2 -2
- package/dist/{chunk-2SVJGOAX.mjs → chunk-Y3N5BFRJ.mjs} +3 -3
- package/dist/{chunk-ZSIGEHSE.cjs → chunk-Y7TLL65B.cjs} +21 -180
- package/dist/{chunk-PEHL3IZL.cjs → chunk-YB44NKC2.cjs} +2 -2
- package/dist/chunk-YKHRCY4T.cjs +73 -0
- package/dist/{chunk-RYDDUCNJ.mjs → chunk-YLNBWUVS.mjs} +1 -1
- package/dist/chunk-Z5A6CNV2.mjs +60 -0
- package/dist/chunk-Z64V4WZI.mjs +17 -0
- package/dist/{chunk-ACI52TCN.mjs → chunk-ZF3GX4O7.mjs} +1 -1
- package/dist/client/lifecycle.d.mts +1 -1
- package/dist/client/lifecycle.d.ts +1 -1
- package/dist/{client-plugins-DFDQUI9Q.d.ts → client-plugins-CFBEfVPO.d.ts} +34 -10
- package/dist/{client-plugins-BNBeyLMi.d.mts → client-plugins-cqy_dQd0.d.mts} +34 -10
- package/dist/client-plugins.d.mts +6 -6
- package/dist/client-plugins.d.ts +6 -6
- package/dist/client.cjs +13 -9
- package/dist/client.d.mts +11 -10
- package/dist/client.d.ts +11 -10
- package/dist/client.mjs +15 -11
- package/dist/client.react-server.mjs +1 -1
- package/dist/config-CnhyvvmT.d.mts +188 -0
- package/dist/config-CnhyvvmT.d.ts +188 -0
- package/dist/config.d.mts +6 -6
- package/dist/config.d.ts +6 -6
- package/dist/cron.cjs +4 -4
- package/dist/cron.mjs +3 -3
- package/dist/desktop.d.mts +7 -7
- package/dist/desktop.d.ts +7 -7
- package/dist/{dev-guard-YO6KPIOQ.mjs → dev-guard-4PFQNXQX.mjs} +2 -1
- package/dist/{dev-guard-PLHL6OTJ.cjs → dev-guard-YLO5DE3H.cjs} +4 -3
- package/dist/{devtools-BLKHPY3C.mjs → devtools-4MLL3RAL.mjs} +10 -10
- package/dist/{devtools-A37WWJZL.cjs → devtools-4ZLMD454.cjs} +12 -12
- package/dist/docs.cjs +14 -14
- package/dist/docs.d.mts +7 -7
- package/dist/docs.d.ts +7 -7
- package/dist/docs.mjs +13 -13
- package/dist/environment/vite.d.mts +1 -1
- package/dist/environment/vite.d.ts +1 -1
- package/dist/generate-route-types-DQP0cUzk.d.ts +33 -0
- package/dist/generate-route-types-TF5Wwtvz.d.mts +33 -0
- package/dist/i18n/client.d.mts +2 -2
- package/dist/i18n/client.d.ts +2 -2
- package/dist/i18n/index.d.mts +3 -3
- package/dist/i18n/index.d.ts +3 -3
- package/dist/i18n/server.d.mts +5 -5
- package/dist/i18n/server.d.ts +5 -5
- package/dist/image/server.cjs +3 -3
- package/dist/image/server.mjs +2 -2
- package/dist/image/sharp.cjs +10 -10
- package/dist/image/sharp.mjs +2 -2
- package/dist/{index-DBdiTkNc.d.ts → index-BYkNbeQV.d.mts} +2 -2
- package/dist/{index-CeJ9_s9p.d.mts → index-BxjN_UDZ.d.ts} +2 -2
- package/dist/{index-MocnSP3a.d.ts → index-D3l4tREW.d.ts} +2 -2
- package/dist/{index-Cl3akY5U.d.mts → index-DPUAPho_.d.mts} +2 -2
- package/dist/index.cjs +88 -79
- package/dist/index.d.mts +29 -45
- package/dist/index.d.ts +29 -45
- package/dist/index.mjs +92 -83
- package/dist/integrations.cjs +3 -3
- package/dist/integrations.d.mts +6 -6
- package/dist/integrations.d.ts +6 -6
- package/dist/integrations.mjs +2 -2
- package/dist/internal/app-markdown-runtime.d.mts +7 -7
- package/dist/internal/app-markdown-runtime.d.ts +7 -7
- package/dist/internal/build-runtime.cjs +47 -43
- package/dist/internal/build-runtime.d.mts +9 -9
- package/dist/internal/build-runtime.d.ts +9 -9
- package/dist/internal/build-runtime.mjs +46 -42
- package/dist/internal/cli-runtime.cjs +24 -23
- package/dist/internal/cli-runtime.mjs +24 -23
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +22 -3
- package/dist/internal/client-runtime.d.mts +46 -4
- package/dist/internal/client-runtime.d.ts +46 -4
- package/dist/internal/client-runtime.mjs +22 -3
- package/dist/internal/compression-runtime.d.mts +6 -6
- package/dist/internal/compression-runtime.d.ts +6 -6
- package/dist/internal/config-runtime.cjs +20 -13
- package/dist/internal/config-runtime.d.mts +259 -18
- package/dist/internal/config-runtime.d.ts +259 -18
- package/dist/internal/config-runtime.mjs +18 -11
- package/dist/internal/form-actions.cjs +5 -4
- package/dist/internal/form-actions.mjs +4 -3
- package/dist/internal/infra-analytics-runtime.cjs +6 -6
- package/dist/internal/infra-analytics-runtime.mjs +4 -4
- package/dist/internal/islands-runtime.cjs +56 -0
- package/dist/internal/islands-runtime.mjs +57 -1
- package/dist/internal/metadata-image-runtime.cjs +3 -3
- package/dist/internal/metadata-image-runtime.mjs +2 -2
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +18 -15
- package/dist/internal/production-runtime.d.mts +33 -20
- package/dist/internal/production-runtime.d.ts +33 -20
- package/dist/internal/production-runtime.mjs +20 -17
- package/dist/internal/server-fn-transform.cjs +13 -0
- package/dist/internal/server-fn-transform.d.mts +24 -0
- package/dist/internal/server-fn-transform.d.ts +24 -0
- package/dist/internal/server-fn-transform.mjs +13 -0
- package/dist/{layers-D9fbe-rz.d.ts → layers-CcS42OGR.d.mts} +1 -1
- package/dist/{layers-D9fbe-rz.d.mts → layers-CcS42OGR.d.ts} +1 -1
- package/dist/{lifecycle-DK06VuKP.d.ts → lifecycle-C2aLBOwu.d.mts} +1 -1
- package/dist/{lifecycle-DK06VuKP.d.mts → lifecycle-C2aLBOwu.d.ts} +1 -1
- package/dist/markdown.d.mts +6 -6
- package/dist/markdown.d.ts +6 -6
- package/dist/middleware.cjs +11 -11
- package/dist/middleware.d.mts +8 -8
- package/dist/middleware.d.ts +8 -8
- package/dist/middleware.mjs +10 -10
- package/dist/mobile.cjs +9 -0
- package/dist/mobile.d.mts +94 -0
- package/dist/mobile.d.ts +94 -0
- package/dist/mobile.mjs +9 -0
- package/dist/navigation-delegate-BU4xqdnw.d.ts +29 -0
- package/dist/navigation-delegate-DLhbfEN4.d.mts +29 -0
- package/dist/navigation.cjs +5 -5
- package/dist/navigation.d.mts +9 -9
- package/dist/navigation.d.ts +9 -9
- package/dist/navigation.mjs +4 -4
- package/dist/{nitro-BIXIKJZS.cjs → nitro-CK7M4RMY.cjs} +12 -12
- package/dist/{nitro-UT2J5A5D.mjs → nitro-R444AF3O.mjs} +8 -8
- package/dist/platform.cjs +2 -1
- package/dist/platform.d.mts +4 -3
- package/dist/platform.d.ts +4 -3
- package/dist/platform.mjs +2 -1
- package/dist/{plugin-4KYXV7BB.mjs → plugin-53SY5YBS.mjs} +1 -1
- package/dist/{plugin-WBANOZQM.cjs → plugin-HZIBL3DW.cjs} +2 -2
- package/dist/plugin.cjs +40 -36
- package/dist/plugin.d.mts +13 -8
- package/dist/plugin.d.ts +13 -8
- package/dist/plugin.mjs +39 -35
- package/dist/{production-runtime-B3qFFtKF.d.ts → production-runtime-C78A8YgK.d.ts} +3 -3
- package/dist/{production-runtime-DcD-GRAv.d.mts → production-runtime-DLA4J5WG.d.mts} +3 -3
- package/dist/production-vite-BQFAlG7n.d.mts +13 -0
- package/dist/production-vite-BQFAlG7n.d.ts +13 -0
- package/dist/{programmatic-routes-client-fD9f4XqU.d.ts → programmatic-routes-client-CBqkNhBy.d.ts} +2 -2
- package/dist/{programmatic-routes-client-DzbYGiZQ.d.mts → programmatic-routes-client-NpqGBn-i.d.mts} +2 -2
- package/dist/query/client.cjs +6 -6
- package/dist/query/client.mjs +2 -2
- package/dist/{render-plan-DqJ51ufr.d.mts → render-plan-C9sWvDTv.d.mts} +1 -1
- package/dist/{render-plan-B6cfssrr.d.ts → render-plan-CrqcBbnV.d.ts} +1 -1
- package/dist/renderer-client.cjs +17 -12
- package/dist/renderer-client.d.mts +9 -8
- package/dist/renderer-client.d.ts +9 -8
- package/dist/renderer-client.mjs +10 -5
- package/dist/{request-jhvUMXRx.d.ts → request-BizeuqD7.d.ts} +1 -1
- package/dist/{request-UuAxHn8h.d.mts → request-WwB1-Uim.d.mts} +1 -1
- package/dist/request.d.mts +7 -7
- package/dist/request.d.ts +7 -7
- package/dist/{resolver-DC57A4vz.d.ts → resolver-CJ-D9nP-.d.ts} +1 -1
- package/dist/{resolver-C2G-3Tm6.d.mts → resolver-TDyZKgKI.d.mts} +1 -1
- package/dist/{route-rendering-Sn50cYZf.d.ts → route-rendering-BGhJN64l.d.ts} +1 -1
- package/dist/{route-rendering-Cou00t1X.d.mts → route-rendering-S6NFjnx4.d.mts} +1 -1
- package/dist/{router-0X9DCTcm.d.mts → router-BIheIy9G.d.mts} +1 -1
- package/dist/{router-xwLvi48p.d.ts → router-BUD_j2EL.d.ts} +1 -1
- package/dist/routes-8PT9cl60.d.ts +121 -0
- package/dist/routes-kEUsXHx3.d.mts +121 -0
- package/dist/routes.cjs +3 -2
- package/dist/routes.d.mts +7 -7
- package/dist/routes.d.ts +7 -7
- package/dist/routes.mjs +2 -1
- package/dist/{rsc-pipeline-VKHMABDJ.cjs → rsc-pipeline-JRGUZBYM.cjs} +18 -16
- package/dist/{rsc-pipeline-F6ZPH5MU.mjs → rsc-pipeline-OLAVIKI3.mjs} +17 -15
- package/dist/{runtime-B9HmxiZc.d.ts → runtime-C4CmlOOh.d.ts} +2 -2
- package/dist/{runtime-tkSXZiqO.d.ts → runtime-CWP-21hP.d.ts} +1 -1
- package/dist/{runtime-CMrsyChI.d.mts → runtime-CgJwe6H_.d.mts} +1 -1
- package/dist/{runtime-CCxTmGuf.d.mts → runtime-CihDZ2Rn.d.mts} +2 -2
- package/dist/runtime-G23RSLEK.cjs +1005 -0
- package/dist/runtime-OGCHDACZ.mjs +1005 -0
- package/dist/{schema-dev-notice-O3I5HLXK.mjs → schema-dev-notice-F6QYSOAI.mjs} +4 -4
- package/dist/{schema-dev-notice-Z73J3NJ6.cjs → schema-dev-notice-UU7DMZEU.cjs} +7 -7
- package/dist/{search-client-BTXL5XWD.mjs → search-client-OXH6GBNO.mjs} +5 -3
- package/dist/search-client-ZZLKVO5R.cjs +15 -0
- package/dist/server-action-security.cjs +3 -3
- package/dist/server-action-security.mjs +2 -2
- package/dist/server-fn-client.d.mts +0 -1
- package/dist/server-fn-client.d.ts +0 -1
- package/dist/server-fn.cjs +4 -4
- package/dist/server-fn.d.mts +0 -1
- package/dist/server-fn.d.ts +0 -1
- package/dist/server-fn.mjs +3 -3
- package/dist/server-plugins.cjs +1 -1
- package/dist/server-plugins.d.mts +7 -7
- package/dist/server-plugins.d.ts +7 -7
- package/dist/server-plugins.mjs +1 -1
- package/dist/server-query-client.cjs +4 -3
- package/dist/server-query-client.d.mts +0 -1
- package/dist/server-query-client.d.ts +0 -1
- package/dist/server-query-client.mjs +3 -2
- package/dist/server-query.cjs +5 -5
- package/dist/server-query.d.mts +0 -1
- package/dist/server-query.d.ts +0 -1
- package/dist/server-query.mjs +4 -4
- package/dist/server.cjs +104 -79
- package/dist/server.d.mts +22 -17
- package/dist/server.d.ts +22 -17
- package/dist/server.mjs +73 -48
- package/dist/{spa-router-B48EjsS1.d.mts → spa-router-CVOL0Vrq.d.mts} +4 -4
- package/dist/{spa-router-B06APnGK.d.ts → spa-router-Kytv4jSB.d.ts} +4 -4
- package/dist/testing.cjs +16 -15
- package/dist/testing.d.mts +6 -6
- package/dist/testing.d.ts +6 -6
- package/dist/testing.mjs +12 -11
- package/dist/{types--Wh02r5_.d.mts → types-C41ePjvP.d.mts} +1 -1
- package/dist/{types--Wh02r5_.d.ts → types-C41ePjvP.d.ts} +1 -1
- package/dist/{utils-C5fyK2tE.d.ts → utils-DbyXlzaj.d.ts} +1 -1
- package/dist/{utils-hyAwmcN6.d.mts → utils-Dsa1HZ7X.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +40 -36
- package/dist/vite.d.mts +9 -9
- package/dist/vite.d.ts +9 -9
- package/dist/vite.mjs +39 -35
- package/dist/{workflows-Df1C_7OG.d.mts → workflows-CRMzQZ3k.d.mts} +2 -1
- package/dist/{workflows-Df1C_7OG.d.ts → workflows-CRMzQZ3k.d.ts} +2 -1
- package/dist/workflows.cjs +5 -5
- package/dist/workflows.d.mts +1 -1
- package/dist/workflows.d.ts +1 -1
- package/dist/workflows.mjs +4 -4
- package/package.json +16 -3
- package/dist/base-path-leyrqXbX.d.mts +0 -19
- package/dist/base-path-leyrqXbX.d.ts +0 -19
- package/dist/cache-invalidation-BD0z_lfu.d.mts +0 -4
- package/dist/cache-invalidation-BD0z_lfu.d.ts +0 -4
- package/dist/chunk-45EUIICW.mjs +0 -15
- package/dist/chunk-MJ6IC4K2.mjs +0 -34
- package/dist/chunk-V7KTQR4C.cjs +0 -15
- package/dist/search-client-QCYAL6AY.cjs +0 -13
- package/dist/{chunk-5OJVKXFV.cjs → chunk-N7JQXQAV.cjs} +2 -2
- package/dist/{chunk-72KABRWN.mjs → chunk-WSDKXV4E.mjs} +4 -4
|
@@ -18,7 +18,7 @@ var _chunkVM57CK74cjs = require('./chunk-VM57CK74.cjs');
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunkVIFPE5RGcjs = require('./chunk-VIFPE5RG.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -29,15 +29,15 @@ var _chunkQNQEK3OFcjs = require('./chunk-QNQEK3OF.cjs');
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunkIOUOGRDXcjs = require('./chunk-IOUOGRDX.cjs');
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunkDZZHTMWMcjs = require('./chunk-DZZHTMWM.cjs');
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
var
|
|
40
|
+
var _chunkVO6NLTV4cjs = require('./chunk-VO6NLTV4.cjs');
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
var _chunkBRWIVOV4cjs = require('./chunk-BRWIVOV4.cjs');
|
|
@@ -52,7 +52,7 @@ var _chunkV3UOEWCBcjs = require('./chunk-V3UOEWCB.cjs');
|
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
|
|
55
|
-
var
|
|
55
|
+
var _chunkO3MMJPC2cjs = require('./chunk-O3MMJPC2.cjs');
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
|
|
@@ -84,10 +84,10 @@ var _chunkKZT2VHRQcjs = require('./chunk-KZT2VHRQ.cjs');
|
|
|
84
84
|
|
|
85
85
|
|
|
86
86
|
|
|
87
|
-
var
|
|
87
|
+
var _chunkF42U3R4Fcjs = require('./chunk-F42U3R4F.cjs');
|
|
88
88
|
|
|
89
89
|
|
|
90
|
-
var
|
|
90
|
+
var _chunkLNM57D3Hcjs = require('./chunk-LNM57D3H.cjs');
|
|
91
91
|
|
|
92
92
|
|
|
93
93
|
var _chunk3EEET2Q5cjs = require('./chunk-3EEET2Q5.cjs');
|
|
@@ -95,7 +95,7 @@ var _chunk3EEET2Q5cjs = require('./chunk-3EEET2Q5.cjs');
|
|
|
95
95
|
|
|
96
96
|
|
|
97
97
|
|
|
98
|
-
var
|
|
98
|
+
var _chunkY7TLL65Bcjs = require('./chunk-Y7TLL65B.cjs');
|
|
99
99
|
|
|
100
100
|
|
|
101
101
|
|
|
@@ -108,31 +108,34 @@ var _chunkZSIGEHSEcjs = require('./chunk-ZSIGEHSE.cjs');
|
|
|
108
108
|
|
|
109
109
|
|
|
110
110
|
|
|
111
|
-
var
|
|
111
|
+
var _chunk76GHW3WIcjs = require('./chunk-76GHW3WI.cjs');
|
|
112
112
|
|
|
113
113
|
|
|
114
114
|
var _chunk47JV57DAcjs = require('./chunk-47JV57DA.cjs');
|
|
115
115
|
|
|
116
116
|
|
|
117
|
+
var _chunkSGBNF56Scjs = require('./chunk-SGBNF56S.cjs');
|
|
117
118
|
|
|
118
119
|
|
|
119
120
|
|
|
120
121
|
|
|
121
122
|
|
|
122
|
-
var _chunkNPPT4RWFcjs = require('./chunk-NPPT4RWF.cjs');
|
|
123
123
|
|
|
124
124
|
|
|
125
|
+
var _chunkJ22JD5YJcjs = require('./chunk-J22JD5YJ.cjs');
|
|
125
126
|
|
|
126
127
|
|
|
127
|
-
var _chunkSBABQKPTcjs = require('./chunk-SBABQKPT.cjs');
|
|
128
128
|
|
|
129
129
|
|
|
130
|
-
var
|
|
130
|
+
var _chunkSBABQKPTcjs = require('./chunk-SBABQKPT.cjs');
|
|
131
131
|
|
|
132
132
|
|
|
133
133
|
var _chunkJ37KTQIAcjs = require('./chunk-J37KTQIA.cjs');
|
|
134
134
|
|
|
135
135
|
|
|
136
|
+
var _chunkJATTVAHAcjs = require('./chunk-JATTVAHA.cjs');
|
|
137
|
+
|
|
138
|
+
|
|
136
139
|
|
|
137
140
|
var _chunkSM2SYWARcjs = require('./chunk-SM2SYWAR.cjs');
|
|
138
141
|
|
|
@@ -167,23 +170,20 @@ var _chunk5Y2P454Ocjs = require('./chunk-5Y2P454O.cjs');
|
|
|
167
170
|
|
|
168
171
|
|
|
169
172
|
|
|
170
|
-
var
|
|
171
|
-
|
|
172
|
-
|
|
173
|
+
var _chunk2HW5LWAHcjs = require('./chunk-2HW5LWAH.cjs');
|
|
173
174
|
|
|
174
175
|
|
|
175
176
|
|
|
176
|
-
var
|
|
177
|
+
var _chunkXB24LZWIcjs = require('./chunk-XB24LZWI.cjs');
|
|
177
178
|
|
|
178
179
|
|
|
179
|
-
var _chunkFGJQS4ECcjs = require('./chunk-FGJQS4EC.cjs');
|
|
180
180
|
|
|
181
181
|
|
|
182
|
-
var _chunkJATTVAHAcjs = require('./chunk-JATTVAHA.cjs');
|
|
183
182
|
|
|
183
|
+
var _chunkXYL4HSVCcjs = require('./chunk-XYL4HSVC.cjs');
|
|
184
184
|
|
|
185
185
|
|
|
186
|
-
var
|
|
186
|
+
var _chunkFK25QSVCcjs = require('./chunk-FK25QSVC.cjs');
|
|
187
187
|
|
|
188
188
|
|
|
189
189
|
var _chunkWJFFPXCVcjs = require('./chunk-WJFFPXCV.cjs');
|
|
@@ -193,7 +193,7 @@ var _chunkJMYXO572cjs = require('./chunk-JMYXO572.cjs');
|
|
|
193
193
|
|
|
194
194
|
|
|
195
195
|
|
|
196
|
-
var
|
|
196
|
+
var _chunkWAPQWAE6cjs = require('./chunk-WAPQWAE6.cjs');
|
|
197
197
|
|
|
198
198
|
|
|
199
199
|
var _chunkPFV2KPDZcjs = require('./chunk-PFV2KPDZ.cjs');
|
|
@@ -201,10 +201,10 @@ var _chunkPFV2KPDZcjs = require('./chunk-PFV2KPDZ.cjs');
|
|
|
201
201
|
|
|
202
202
|
|
|
203
203
|
|
|
204
|
-
var
|
|
204
|
+
var _chunkB3GZAQSCcjs = require('./chunk-B3GZAQSC.cjs');
|
|
205
205
|
|
|
206
206
|
|
|
207
|
-
var
|
|
207
|
+
var _chunkKHXAJ2KAcjs = require('./chunk-KHXAJ2KA.cjs');
|
|
208
208
|
|
|
209
209
|
|
|
210
210
|
var _chunkBBPDJGCUcjs = require('./chunk-BBPDJGCU.cjs');
|
|
@@ -224,14 +224,14 @@ var _chunkOYZXVBZPcjs = require('./chunk-OYZXVBZP.cjs');
|
|
|
224
224
|
|
|
225
225
|
|
|
226
226
|
|
|
227
|
-
var
|
|
227
|
+
var _chunkVQJYGZNXcjs = require('./chunk-VQJYGZNX.cjs');
|
|
228
228
|
|
|
229
229
|
|
|
230
230
|
|
|
231
231
|
var _chunkB5BBTPJQcjs = require('./chunk-B5BBTPJQ.cjs');
|
|
232
232
|
|
|
233
233
|
|
|
234
|
-
var
|
|
234
|
+
var _chunkX5BCMLGPcjs = require('./chunk-X5BCMLGP.cjs');
|
|
235
235
|
|
|
236
236
|
|
|
237
237
|
var _chunkE552H232cjs = require('./chunk-E552H232.cjs');
|
|
@@ -338,7 +338,7 @@ function getDocsTitle(docs) {
|
|
|
338
338
|
return typeof docs.config.nav === "object" && docs.config.nav && "title" in docs.config.nav ? String(docs.config.nav.title || "Documentation") : "Documentation";
|
|
339
339
|
}
|
|
340
340
|
function loadPages(contentDir, docs) {
|
|
341
|
-
return
|
|
341
|
+
return _chunkIOUOGRDXcjs.discoverFarmDocsPages.call(void 0, contentDir, docs).map((page) => _chunkIOUOGRDXcjs.loadFarmDocsPage.call(void 0, contentDir, docs, page.slug)).filter((page) => Boolean(page)).sort((a, b) => a.href.localeCompare(b.href));
|
|
342
342
|
}
|
|
343
343
|
function findSocialImagePath(html) {
|
|
344
344
|
const match = /<meta\s+property=["']og:image["']\s+content=["']([^"']+)["']/i.exec(html) || /<meta\s+content=["']([^"']+)["']\s+property=["']og:image["']/i.exec(html);
|
|
@@ -356,14 +356,14 @@ async function addHandlerRoute(routes, pathname, handler, absolutePaths) {
|
|
|
356
356
|
return response;
|
|
357
357
|
}
|
|
358
358
|
async function compileFarmDocsManifest(docs, options) {
|
|
359
|
-
const contentDir =
|
|
359
|
+
const contentDir = _chunkIOUOGRDXcjs.resolveFarmDocsContentDir.call(void 0, docs, options);
|
|
360
360
|
const pages = loadPages(contentDir, docs);
|
|
361
361
|
const absolutePaths = [
|
|
362
362
|
_path2.default.resolve(options.root),
|
|
363
363
|
_path2.default.resolve(contentDir),
|
|
364
364
|
docs.configPath || ""
|
|
365
365
|
];
|
|
366
|
-
const handler =
|
|
366
|
+
const handler = _chunkIOUOGRDXcjs.createFarmDocsHandler.call(void 0, docs, {
|
|
367
367
|
root: options.root,
|
|
368
368
|
srcDir: options.srcDir,
|
|
369
369
|
clientEntry: options.clientEntry,
|
|
@@ -372,7 +372,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
372
372
|
globalStylesheetHref: options.globalStylesheetHref,
|
|
373
373
|
isPathGuarded: options.isPathGuarded
|
|
374
374
|
});
|
|
375
|
-
const apiHandler =
|
|
375
|
+
const apiHandler = _chunkVIFPE5RGcjs.createFarmDocsAPIHandler.call(void 0, {
|
|
376
376
|
rootDir: options.root,
|
|
377
377
|
srcDir: options.srcDir,
|
|
378
378
|
docs,
|
|
@@ -383,7 +383,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
383
383
|
const apiMarkdown = {};
|
|
384
384
|
for (const page of pages) {
|
|
385
385
|
const htmlResponse = await addHandlerRoute(routes, page.href, handler, absolutePaths);
|
|
386
|
-
const markdownPath =
|
|
386
|
+
const markdownPath = _chunkIOUOGRDXcjs.getFarmDocsMarkdownPath.call(void 0, page.href);
|
|
387
387
|
await addHandlerRoute(routes, markdownPath, handler, absolutePaths);
|
|
388
388
|
if (htmlResponse) {
|
|
389
389
|
const socialImagePath = findSocialImagePath(await htmlResponse.text());
|
|
@@ -467,7 +467,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
467
467
|
post: await compileResponse(postResponse, absolutePaths),
|
|
468
468
|
search: {
|
|
469
469
|
pages: publicPages.map((page) => ({
|
|
470
|
-
...
|
|
470
|
+
..._chunkIOUOGRDXcjs.toFarmDocsMarkdownPage.call(void 0, page),
|
|
471
471
|
sourcePath: `farm-docs:${page.slug || "index"}`
|
|
472
472
|
})),
|
|
473
473
|
search: _nullishCoalesce(searchConfig, () => ( true)),
|
|
@@ -520,7 +520,7 @@ function collectFarmClientModulePreloads(bundle, options) {
|
|
|
520
520
|
const moduleId = chunk.facadeModuleId.split("?")[0];
|
|
521
521
|
if (!_path2.default.isAbsolute(moduleId)) continue;
|
|
522
522
|
const loaded = /* @__PURE__ */ new Set([...entryLoaded, chunk.fileName]);
|
|
523
|
-
modules[
|
|
523
|
+
modules[_chunkVQJYGZNXcjs.toViteModuleId.call(void 0, moduleId, options.root)] = [
|
|
524
524
|
chunk.fileName,
|
|
525
525
|
...staticImports(chunk, loaded, [])
|
|
526
526
|
].map(index);
|
|
@@ -645,7 +645,7 @@ async function createFarmRouteRuntimeManifest(options) {
|
|
|
645
645
|
const routes = [];
|
|
646
646
|
for (const [pattern, entry] of options.routeManager.getRoutes()) {
|
|
647
647
|
const routeModule = await options.routeManager.loadRouteModule(entry.modulePath);
|
|
648
|
-
const rendering = await
|
|
648
|
+
const rendering = await _chunkY7TLL65Bcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
|
|
649
649
|
const runtimeConfig = await options.routeManager.resolveRouteRuntimeConfig(pattern);
|
|
650
650
|
routes.push({
|
|
651
651
|
kind: "page",
|
|
@@ -957,7 +957,7 @@ export default async function farmNetlifyHandler(request, context) {
|
|
|
957
957
|
// src/build/strip-platform-config.ts
|
|
958
958
|
|
|
959
959
|
|
|
960
|
-
var PLATFORM_CONFIG_KEYS = /* @__PURE__ */ new Set(["desktop"]);
|
|
960
|
+
var PLATFORM_CONFIG_KEYS = /* @__PURE__ */ new Set(["desktop", "mobile"]);
|
|
961
961
|
var CONFIG_FACTORIES = /* @__PURE__ */ new Set(["defineConfig", "defineFarmConfig"]);
|
|
962
962
|
function isConfigObject(node) {
|
|
963
963
|
return _optionalChain([node, 'optionalAccess', _15 => _15.type]) === "ObjectExpression";
|
|
@@ -992,23 +992,33 @@ function collectConfigObjects(node, found) {
|
|
|
992
992
|
}
|
|
993
993
|
}
|
|
994
994
|
function stripPlatformConfigSource(code, parse) {
|
|
995
|
-
if (!code.includes("desktop")) return null;
|
|
995
|
+
if (!code.includes("desktop") && !code.includes("mobile")) return null;
|
|
996
996
|
const objects = [];
|
|
997
997
|
collectConfigObjects(parse(code), objects);
|
|
998
998
|
const removals = [];
|
|
999
999
|
for (const object of objects) {
|
|
1000
1000
|
const properties = object.properties;
|
|
1001
|
-
properties.
|
|
1001
|
+
const removed = properties.map((property) => {
|
|
1002
1002
|
const name = propertyName(property);
|
|
1003
|
-
|
|
1004
|
-
if (index < properties.length - 1)
|
|
1005
|
-
removals.push([property.start, properties[index + 1].start]);
|
|
1006
|
-
else if (index > 0) removals.push([properties[index - 1].end, property.end]);
|
|
1007
|
-
else {
|
|
1008
|
-
const trailingComma = /^\s*,/.exec(code.slice(property.end));
|
|
1009
|
-
removals.push([property.start, property.end + (_nullishCoalesce(_optionalChain([trailingComma, 'optionalAccess', _18 => _18[0], 'access', _19 => _19.length]), () => ( 0)))]);
|
|
1010
|
-
}
|
|
1003
|
+
return !!name && PLATFORM_CONFIG_KEYS.has(name);
|
|
1011
1004
|
});
|
|
1005
|
+
for (let first = 0; first < properties.length; first++) {
|
|
1006
|
+
if (!removed[first]) continue;
|
|
1007
|
+
let last = first;
|
|
1008
|
+
while (last + 1 < properties.length && removed[last + 1]) last++;
|
|
1009
|
+
if (last < properties.length - 1) {
|
|
1010
|
+
removals.push([properties[first].start, properties[last + 1].start]);
|
|
1011
|
+
} else if (first > 0) {
|
|
1012
|
+
removals.push([properties[first - 1].end, properties[last].end]);
|
|
1013
|
+
} else {
|
|
1014
|
+
const trailingComma = /^\s*,/.exec(code.slice(properties[last].end));
|
|
1015
|
+
removals.push([
|
|
1016
|
+
properties[first].start,
|
|
1017
|
+
properties[last].end + (_nullishCoalesce(_optionalChain([trailingComma, 'optionalAccess', _18 => _18[0], 'access', _19 => _19.length]), () => ( 0)))
|
|
1018
|
+
]);
|
|
1019
|
+
}
|
|
1020
|
+
first = last;
|
|
1021
|
+
}
|
|
1012
1022
|
}
|
|
1013
1023
|
if (removals.length === 0) return null;
|
|
1014
1024
|
removals.sort((left, right) => right[0] - left[0]);
|
|
@@ -1073,6 +1083,75 @@ function createFarmPrivateClientSourcemapsPlugin(options) {
|
|
|
1073
1083
|
};
|
|
1074
1084
|
}
|
|
1075
1085
|
|
|
1086
|
+
// src/middleware/static-config.ts
|
|
1087
|
+
function literalMatcher(node) {
|
|
1088
|
+
if (!node) return void 0;
|
|
1089
|
+
if (node.type === "Literal" && typeof node.value === "string") return node.value;
|
|
1090
|
+
if (node.type === "Literal" && node.regex)
|
|
1091
|
+
return new RegExp(node.regex.pattern, node.regex.flags);
|
|
1092
|
+
if (node.type === "TemplateLiteral" && node.expressions.length === 0) {
|
|
1093
|
+
return _nullishCoalesce(_optionalChain([node, 'access', _20 => _20.quasis, 'access', _21 => _21[0], 'optionalAccess', _22 => _22.value, 'optionalAccess', _23 => _23.cooked]), () => ( void 0));
|
|
1094
|
+
}
|
|
1095
|
+
return void 0;
|
|
1096
|
+
}
|
|
1097
|
+
function literalMatchers(node) {
|
|
1098
|
+
const values = node.type === "ArrayExpression" ? node.elements : [node];
|
|
1099
|
+
const matchers = [];
|
|
1100
|
+
for (const value of values) {
|
|
1101
|
+
const matcher = literalMatcher(value);
|
|
1102
|
+
if (matcher === void 0) return void 0;
|
|
1103
|
+
matchers.push(matcher);
|
|
1104
|
+
}
|
|
1105
|
+
return matchers;
|
|
1106
|
+
}
|
|
1107
|
+
function unwrap(node) {
|
|
1108
|
+
while (node.type === "TSAsExpression" || node.type === "TSSatisfiesExpression" || node.type === "ParenthesizedExpression") {
|
|
1109
|
+
node = node.expression;
|
|
1110
|
+
}
|
|
1111
|
+
return node;
|
|
1112
|
+
}
|
|
1113
|
+
function readStaticMiddlewareConfig(program) {
|
|
1114
|
+
let found = null;
|
|
1115
|
+
for (const statement of program.body) {
|
|
1116
|
+
if (statement.type === "ExportNamedDeclaration" && !statement.declaration) {
|
|
1117
|
+
if (statement.specifiers.some((specifier) => _optionalChain([specifier, 'access', _24 => _24.exported, 'optionalAccess', _25 => _25.name]) === "config")) {
|
|
1118
|
+
return "unknown";
|
|
1119
|
+
}
|
|
1120
|
+
continue;
|
|
1121
|
+
}
|
|
1122
|
+
const declaration = statement.type === "ExportNamedDeclaration" ? statement.declaration : null;
|
|
1123
|
+
if (!declaration || declaration.type !== "VariableDeclaration") continue;
|
|
1124
|
+
for (const declarator of declaration.declarations) {
|
|
1125
|
+
if (_optionalChain([declarator, 'access', _26 => _26.id, 'optionalAccess', _27 => _27.type]) !== "Identifier" || declarator.id.name !== "config") continue;
|
|
1126
|
+
if (declaration.kind !== "const" || !declarator.init) return "unknown";
|
|
1127
|
+
const init = unwrap(declarator.init);
|
|
1128
|
+
if (init.type !== "ObjectExpression") return "unknown";
|
|
1129
|
+
const config = {};
|
|
1130
|
+
for (const property of init.properties) {
|
|
1131
|
+
if (property.type !== "Property" || property.computed) return "unknown";
|
|
1132
|
+
const key = _nullishCoalesce(_optionalChain([property, 'access', _28 => _28.key, 'optionalAccess', _29 => _29.name]), () => ( _optionalChain([property, 'access', _30 => _30.key, 'optionalAccess', _31 => _31.value])));
|
|
1133
|
+
if (key !== "matcher" && key !== "exclude") continue;
|
|
1134
|
+
const matchers = literalMatchers(unwrap(property.value));
|
|
1135
|
+
if (!matchers) return "unknown";
|
|
1136
|
+
if (key === "matcher") config.matcher = matchers;
|
|
1137
|
+
else config.exclude = matchers;
|
|
1138
|
+
}
|
|
1139
|
+
found = config;
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
return found;
|
|
1143
|
+
}
|
|
1144
|
+
async function readMiddlewareFileConfig(filePath) {
|
|
1145
|
+
try {
|
|
1146
|
+
const [{ readFile }, vite] = await Promise.all([import("fs/promises"), import("vite")]);
|
|
1147
|
+
const parsed = vite.parseSync(filePath, await readFile(filePath, "utf8"));
|
|
1148
|
+
if (_optionalChain([parsed, 'access', _32 => _32.errors, 'optionalAccess', _33 => _33.length])) return "unknown";
|
|
1149
|
+
return readStaticMiddlewareConfig(parsed.program);
|
|
1150
|
+
} catch (e7) {
|
|
1151
|
+
return "unknown";
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1076
1155
|
// src/nitro/universal-build.ts
|
|
1077
1156
|
function preloadFarmNitroBuilder() {
|
|
1078
1157
|
return import("nitro/builder").then(
|
|
@@ -1089,7 +1168,7 @@ function findFarmCoreRoot(from) {
|
|
|
1089
1168
|
if (_fs.existsSync.call(void 0, manifest)) {
|
|
1090
1169
|
try {
|
|
1091
1170
|
if (JSON.parse(_fs.readFileSync.call(void 0, manifest, "utf8")).name === "@farm.js/core") return dir;
|
|
1092
|
-
} catch (
|
|
1171
|
+
} catch (e8) {
|
|
1093
1172
|
}
|
|
1094
1173
|
}
|
|
1095
1174
|
dir = _path2.default.dirname(dir);
|
|
@@ -1107,7 +1186,7 @@ function findInstalledPackageDir(name, from) {
|
|
|
1107
1186
|
if (_fs.existsSync.call(void 0, _path2.default.join(candidate, "package.json"))) {
|
|
1108
1187
|
try {
|
|
1109
1188
|
return _fs.realpathSync.call(void 0, candidate);
|
|
1110
|
-
} catch (
|
|
1189
|
+
} catch (e9) {
|
|
1111
1190
|
return null;
|
|
1112
1191
|
}
|
|
1113
1192
|
}
|
|
@@ -1123,7 +1202,7 @@ function collectFarmDependencyDirs(root) {
|
|
|
1123
1202
|
let manifest;
|
|
1124
1203
|
try {
|
|
1125
1204
|
manifest = JSON.parse(_fs.readFileSync.call(void 0, _path2.default.join(dir, "package.json"), "utf8"));
|
|
1126
|
-
} catch (
|
|
1205
|
+
} catch (e10) {
|
|
1127
1206
|
return;
|
|
1128
1207
|
}
|
|
1129
1208
|
for (const field of ["dependencies", "optionalDependencies", "peerDependencies"]) {
|
|
@@ -1139,7 +1218,7 @@ function collectFarmDependencyDirs(root) {
|
|
|
1139
1218
|
if (name.startsWith("@farm.js/")) queue.push({ name, from: root });
|
|
1140
1219
|
}
|
|
1141
1220
|
}
|
|
1142
|
-
} catch (
|
|
1221
|
+
} catch (e11) {
|
|
1143
1222
|
}
|
|
1144
1223
|
for (let next = queue.pop(); next; next = queue.pop()) {
|
|
1145
1224
|
const dir = findInstalledPackageDir(next.name, next.from);
|
|
@@ -1229,14 +1308,14 @@ function createPrerenderRuntimeResolverPlugin(root, resolveNitroEntry = resolveN
|
|
|
1229
1308
|
return {
|
|
1230
1309
|
name: "farm-prerender-runtime-resolver",
|
|
1231
1310
|
async resolveId(id, _importer, options) {
|
|
1232
|
-
if (_optionalChain([options, 'access',
|
|
1311
|
+
if (_optionalChain([options, 'access', _34 => _34.custom, 'optionalAccess', _35 => _35.farmPrerenderRuntimeResolve])) return null;
|
|
1233
1312
|
if (id.startsWith("\0") || id.startsWith(".") || id.startsWith("#") || id.startsWith("virtual:") || _path2.default.isAbsolute(id) || NODE_BUILTIN_MODULES.has(id)) {
|
|
1234
1313
|
return null;
|
|
1235
1314
|
}
|
|
1236
1315
|
if (nitroEntry === void 0) {
|
|
1237
1316
|
try {
|
|
1238
1317
|
nitroEntry = resolveNitroEntry(root);
|
|
1239
|
-
} catch (
|
|
1318
|
+
} catch (e12) {
|
|
1240
1319
|
nitroEntry = null;
|
|
1241
1320
|
}
|
|
1242
1321
|
}
|
|
@@ -1257,7 +1336,7 @@ function createFarmStorageModuleRegistration(config) {
|
|
|
1257
1336
|
let runtimeRequire = projectRequire;
|
|
1258
1337
|
try {
|
|
1259
1338
|
runtimeRequire = _module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core"));
|
|
1260
|
-
} catch (
|
|
1339
|
+
} catch (e13) {
|
|
1261
1340
|
}
|
|
1262
1341
|
const loaders = [];
|
|
1263
1342
|
for (const specifier of modules) {
|
|
@@ -1266,7 +1345,7 @@ function createFarmStorageModuleRegistration(config) {
|
|
|
1266
1345
|
try {
|
|
1267
1346
|
resolved = require2.resolve(specifier);
|
|
1268
1347
|
break;
|
|
1269
|
-
} catch (
|
|
1348
|
+
} catch (e14) {
|
|
1270
1349
|
}
|
|
1271
1350
|
}
|
|
1272
1351
|
if (resolved) {
|
|
@@ -1284,7 +1363,7 @@ function resolveNitroPackageEntry(root) {
|
|
|
1284
1363
|
let runtimeRequire = projectRequire;
|
|
1285
1364
|
try {
|
|
1286
1365
|
runtimeRequire = _module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core"));
|
|
1287
|
-
} catch (
|
|
1366
|
+
} catch (e15) {
|
|
1288
1367
|
}
|
|
1289
1368
|
return runtimeRequire.resolve("nitro");
|
|
1290
1369
|
}
|
|
@@ -1338,7 +1417,7 @@ async function canUseRolldownBuilder() {
|
|
|
1338
1417
|
try {
|
|
1339
1418
|
await import("rolldown");
|
|
1340
1419
|
return true;
|
|
1341
|
-
} catch (
|
|
1420
|
+
} catch (e16) {
|
|
1342
1421
|
return false;
|
|
1343
1422
|
}
|
|
1344
1423
|
}
|
|
@@ -1352,7 +1431,7 @@ function hasReactDomEdgeServerBuild(root) {
|
|
|
1352
1431
|
try {
|
|
1353
1432
|
_module.createRequire.call(void 0, _path2.default.join(root, "package.json")).resolve("react-dom/server.edge");
|
|
1354
1433
|
return true;
|
|
1355
|
-
} catch (
|
|
1434
|
+
} catch (e17) {
|
|
1356
1435
|
return false;
|
|
1357
1436
|
}
|
|
1358
1437
|
}
|
|
@@ -1390,7 +1469,7 @@ function isFarmCoreModule(file) {
|
|
|
1390
1469
|
if (_fs.existsSync.call(void 0, manifest)) {
|
|
1391
1470
|
try {
|
|
1392
1471
|
return JSON.parse(_fs.readFileSync.call(void 0, manifest, "utf8")).name === "@farm.js/core";
|
|
1393
|
-
} catch (
|
|
1472
|
+
} catch (e18) {
|
|
1394
1473
|
return false;
|
|
1395
1474
|
}
|
|
1396
1475
|
}
|
|
@@ -1423,7 +1502,7 @@ function createMetadataImageWasmPlugin() {
|
|
|
1423
1502
|
return {
|
|
1424
1503
|
name: "farm-metadata-image-wasm",
|
|
1425
1504
|
resolveId(source, importer) {
|
|
1426
|
-
if (!source.endsWith(".wasm?module") || !_optionalChain([importer, 'optionalAccess',
|
|
1505
|
+
if (!source.endsWith(".wasm?module") || !_optionalChain([importer, 'optionalAccess', _36 => _36.replace, 'call', _37 => _37(/\\/g, "/"), 'access', _38 => _38.includes, 'call', _39 => _39("/@vercel/og/")])) {
|
|
1427
1506
|
return null;
|
|
1428
1507
|
}
|
|
1429
1508
|
const requestPath = source.slice(0, -"?module".length);
|
|
@@ -1499,9 +1578,9 @@ function hasFarmRuntimeConfigModule(config, configModulePath) {
|
|
|
1499
1578
|
return Boolean(configModulePath || (config.layers || []).some((layer) => layer.configFile));
|
|
1500
1579
|
}
|
|
1501
1580
|
function nameCodeSplittingGroups(bundlerConfig) {
|
|
1502
|
-
const outputs = _optionalChain([bundlerConfig, 'optionalAccess',
|
|
1581
|
+
const outputs = _optionalChain([bundlerConfig, 'optionalAccess', _40 => _40.output]);
|
|
1503
1582
|
for (const output of Array.isArray(outputs) ? outputs : [outputs]) {
|
|
1504
|
-
const groups = _optionalChain([output, 'optionalAccess',
|
|
1583
|
+
const groups = _optionalChain([output, 'optionalAccess', _41 => _41.codeSplitting, 'optionalAccess', _42 => _42.groups]);
|
|
1505
1584
|
if (!Array.isArray(groups)) continue;
|
|
1506
1585
|
groups.forEach((group, index) => {
|
|
1507
1586
|
if (group && typeof group.name === "function" && !group.debugName) {
|
|
@@ -1557,9 +1636,9 @@ function restoreLiteralModuleSpecifiers(code, fileName, { parseSync, Visitor })
|
|
|
1557
1636
|
if (needsAst) {
|
|
1558
1637
|
replacements.length = 0;
|
|
1559
1638
|
const restore = (node) => {
|
|
1560
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
1639
|
+
if (_optionalChain([node, 'optionalAccess', _43 => _43.type]) !== "TemplateLiteral") return;
|
|
1561
1640
|
const template = node;
|
|
1562
|
-
const value = _optionalChain([template, 'access',
|
|
1641
|
+
const value = _optionalChain([template, 'access', _44 => _44.quasis, 'access', _45 => _45[0], 'optionalAccess', _46 => _46.value, 'access', _47 => _47.cooked]);
|
|
1563
1642
|
if (template.expressions.length > 0 || typeof value !== "string") return;
|
|
1564
1643
|
replacements.push({
|
|
1565
1644
|
start: template.start,
|
|
@@ -1607,7 +1686,7 @@ function trimSlashes(value) {
|
|
|
1607
1686
|
return value.replace(/^\/+|\/+$/g, "");
|
|
1608
1687
|
}
|
|
1609
1688
|
function resolveBuildDocsContentDir(config, root) {
|
|
1610
|
-
if (!_optionalChain([config, 'access',
|
|
1689
|
+
if (!_optionalChain([config, 'access', _48 => _48.docs, 'optionalAccess', _49 => _49.enabled])) return null;
|
|
1611
1690
|
const configuredContentDir = config.docs.contentDir || config.docs.config.contentDir;
|
|
1612
1691
|
if (typeof configuredContentDir === "string" && configuredContentDir.trim()) {
|
|
1613
1692
|
const contentDir = _path2.default.isAbsolute(configuredContentDir) ? configuredContentDir : _path2.default.join(root, configuredContentDir);
|
|
@@ -1638,7 +1717,7 @@ function hasProjectPostcssConfig(root) {
|
|
|
1638
1717
|
try {
|
|
1639
1718
|
projectRequire.resolve(`./${file}`);
|
|
1640
1719
|
return true;
|
|
1641
|
-
} catch (
|
|
1720
|
+
} catch (e19) {
|
|
1642
1721
|
return false;
|
|
1643
1722
|
}
|
|
1644
1723
|
});
|
|
@@ -1660,14 +1739,14 @@ async function findFarmConfigPath(root) {
|
|
|
1660
1739
|
try {
|
|
1661
1740
|
await fs4.access(resolvedPath);
|
|
1662
1741
|
return resolvedPath;
|
|
1663
|
-
} catch (
|
|
1742
|
+
} catch (e20) {
|
|
1664
1743
|
}
|
|
1665
1744
|
}
|
|
1666
1745
|
return null;
|
|
1667
1746
|
}
|
|
1668
1747
|
function hasFarmServerRuntimePlugins(config) {
|
|
1669
1748
|
return (config.plugins || []).some((plugin) => {
|
|
1670
|
-
if (
|
|
1749
|
+
if (_chunkWAPQWAE6cjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) === false) return false;
|
|
1671
1750
|
return Boolean(
|
|
1672
1751
|
plugin.setup || plugin.init || plugin.ready || plugin.shutdown || plugin.runtime || plugin.router || plugin.render || plugin.beforeRouteMatch || plugin.afterRouteMatch || plugin.beforeRender || plugin.afterRender || plugin.onError || plugin.transformHTML
|
|
1673
1752
|
);
|
|
@@ -1678,7 +1757,7 @@ function hasFarmPluginRoutes(config) {
|
|
|
1678
1757
|
}
|
|
1679
1758
|
function farmServerRuntimePluginsMayHandlePath(config, pathname) {
|
|
1680
1759
|
return (config.plugins || []).some(
|
|
1681
|
-
(plugin) =>
|
|
1760
|
+
(plugin) => _chunkWAPQWAE6cjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && _chunk47JV57DAcjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
|
|
1682
1761
|
);
|
|
1683
1762
|
}
|
|
1684
1763
|
async function discoverMiddlewareRoutes(appDir) {
|
|
@@ -1689,7 +1768,7 @@ async function discoverMiddlewareRoutes(appDir) {
|
|
|
1689
1768
|
let entries;
|
|
1690
1769
|
try {
|
|
1691
1770
|
entries = await fs4.readdir(dir, { withFileTypes: true });
|
|
1692
|
-
} catch (
|
|
1771
|
+
} catch (e21) {
|
|
1693
1772
|
return;
|
|
1694
1773
|
}
|
|
1695
1774
|
const middlewareFile = entries.find(
|
|
@@ -1708,8 +1787,8 @@ async function discoverMiddlewareRoutes(appDir) {
|
|
|
1708
1787
|
}
|
|
1709
1788
|
await walk(
|
|
1710
1789
|
_path2.default.join(dir, entry.name),
|
|
1711
|
-
|
|
1712
|
-
|
|
1790
|
+
_chunkB3GZAQSCcjs.appendMiddlewareRoutePath.call(void 0, routePath, entry.name),
|
|
1791
|
+
_chunkB3GZAQSCcjs.appendMiddlewareDirectory.call(void 0, directory, entry.name),
|
|
1713
1792
|
discovered
|
|
1714
1793
|
);
|
|
1715
1794
|
}
|
|
@@ -1721,10 +1800,10 @@ async function discoverMiddlewareRoutes(appDir) {
|
|
|
1721
1800
|
routes.set(route.directory, route);
|
|
1722
1801
|
}
|
|
1723
1802
|
}
|
|
1724
|
-
return Array.from(routes.values()).sort(
|
|
1803
|
+
return Array.from(routes.values()).sort(_chunkB3GZAQSCcjs.compareMiddlewareRouteLocations).map(({ path: routePath, filePath }) => ({ path: routePath, filePath }));
|
|
1725
1804
|
}
|
|
1726
1805
|
function assertFarmDocsRuntimeSupported(config, preset) {
|
|
1727
|
-
if (!_optionalChain([config, 'access',
|
|
1806
|
+
if (!_optionalChain([config, 'access', _50 => _50.docs, 'optionalAccess', _51 => _51.enabled]) || !_optionalChain([config, 'access', _52 => _52.docs, 'access', _53 => _53.adapter, 'optionalAccess', _54 => _54.server]) || _chunkE552H232cjs.getFarmPresetRuntime.call(void 0, preset) !== "edge" || Boolean(config.docs.adapter.edgeCompiler)) {
|
|
1728
1807
|
return;
|
|
1729
1808
|
}
|
|
1730
1809
|
throw new Error(
|
|
@@ -1737,13 +1816,13 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
|
|
|
1737
1816
|
assertFarmDocsRuntimeSupported(config, preset);
|
|
1738
1817
|
const srcDir = config.srcDir || "src";
|
|
1739
1818
|
const distDir = config.distDir || ".farm";
|
|
1740
|
-
const deployOutputDir =
|
|
1819
|
+
const deployOutputDir = _chunkO3MMJPC2cjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
1741
1820
|
const lifecyclePluginManager = options.pluginManager;
|
|
1742
1821
|
const productionViteResultPromise = Promise.allSettled([
|
|
1743
1822
|
Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkMF3IA2AWcjs.loadFarmProductionVite.call(void 0, ))))
|
|
1744
1823
|
]);
|
|
1745
1824
|
const nitroBuilderResultPromise = preloadFarmNitroBuilder();
|
|
1746
|
-
|
|
1825
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F69C} Building Farm.js application (universal) with preset: ${preset}...`);
|
|
1747
1826
|
const rendererBuild = options.rendererBuildLifetime ? void 0 : new AbortController();
|
|
1748
1827
|
const rendererBuildLifetime = _nullishCoalesce(options.rendererBuildLifetime, () => ( rendererBuild.signal));
|
|
1749
1828
|
try {
|
|
@@ -1780,7 +1859,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
|
|
|
1780
1859
|
fallback: entry.fallback
|
|
1781
1860
|
})
|
|
1782
1861
|
);
|
|
1783
|
-
|
|
1862
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F4CB} Found ${pageRoutes.length} page routes`);
|
|
1784
1863
|
const fs4 = await import("fs/promises");
|
|
1785
1864
|
const layoutRoutes = [];
|
|
1786
1865
|
const appDir = _path2.default.join(root, srcDir, "app");
|
|
@@ -1798,7 +1877,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
|
|
|
1798
1877
|
await findLayoutsForClient(_path2.default.join(dir, entry.name), childPrefix);
|
|
1799
1878
|
}
|
|
1800
1879
|
}
|
|
1801
|
-
} catch (
|
|
1880
|
+
} catch (e22) {
|
|
1802
1881
|
}
|
|
1803
1882
|
}
|
|
1804
1883
|
await findLayoutsForClient(appDir);
|
|
@@ -1808,7 +1887,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
|
|
|
1808
1887
|
seenLayoutPatterns.add(pattern);
|
|
1809
1888
|
layoutRoutes.push({ pattern, modulePath: entry.modulePath });
|
|
1810
1889
|
}
|
|
1811
|
-
|
|
1890
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F4CB} Found ${pageRoutes.length} page routes and ${layoutRoutes.length} layouts`);
|
|
1812
1891
|
const isolatedClientBoundaryModules = routeManager.getIsolatedClientBoundaryModules(root);
|
|
1813
1892
|
const islandsErrors = routeManager.getIslandsErrors(root);
|
|
1814
1893
|
if (islandsErrors.length > 0) {
|
|
@@ -1826,7 +1905,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
1826
1905
|
throw productionViteResult.reason;
|
|
1827
1906
|
}
|
|
1828
1907
|
const productionVite = productionViteResult.value;
|
|
1829
|
-
|
|
1908
|
+
_chunkVQJYGZNXcjs.logger.info("\u26A1 Building application bundles with Vite Rolldown");
|
|
1830
1909
|
const buildClientBundle = () => buildClient(
|
|
1831
1910
|
productionVite,
|
|
1832
1911
|
config,
|
|
@@ -1859,11 +1938,11 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
1859
1938
|
let clientBuildResult;
|
|
1860
1939
|
let ssrBuildResult;
|
|
1861
1940
|
if (config.renderer.buildConcurrency === "serial") {
|
|
1862
|
-
|
|
1941
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F4E6} Building client and SSR bundles serially for ${config.renderer.name}...`);
|
|
1863
1942
|
[clientBuildResult] = await Promise.allSettled([buildClientBundle()]);
|
|
1864
1943
|
[ssrBuildResult] = await Promise.allSettled([buildSSRBundle()]);
|
|
1865
1944
|
} else {
|
|
1866
|
-
|
|
1945
|
+
_chunkVQJYGZNXcjs.logger.info("\u{1F4E6} Building client and SSR bundles in parallel...");
|
|
1867
1946
|
[clientBuildResult, ssrBuildResult] = await Promise.allSettled([
|
|
1868
1947
|
buildClientBundle(),
|
|
1869
1948
|
buildSSRBundle()
|
|
@@ -1878,7 +1957,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
1878
1957
|
if (productionVite.builder !== "rolldown" || !(clientBuildResult.reason instanceof IncompleteClientBuildOutputError)) {
|
|
1879
1958
|
throw clientBuildResult.reason;
|
|
1880
1959
|
}
|
|
1881
|
-
|
|
1960
|
+
_chunkVQJYGZNXcjs.logger.warn("Client bundle was incomplete; retrying after the SSR build...");
|
|
1882
1961
|
try {
|
|
1883
1962
|
await buildClient(
|
|
1884
1963
|
productionVite,
|
|
@@ -1905,14 +1984,14 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
1905
1984
|
const routeRuntimeManifest = routeRuntimeManifestResult.value;
|
|
1906
1985
|
const runtimeValidation = validateFarmRouteRuntimeDeployment(routeRuntimeManifest, preset);
|
|
1907
1986
|
for (const warning of runtimeValidation.warnings) {
|
|
1908
|
-
|
|
1987
|
+
_chunkVQJYGZNXcjs.logger.warn(warning);
|
|
1909
1988
|
}
|
|
1910
1989
|
const { bundle: ssrBundle, entryFile: ssrEntryFile, configuredHeaderRoutes } = ssrResult;
|
|
1911
1990
|
await writeSSRAssetsToClient(ssrBundle, clientOutputDir);
|
|
1912
1991
|
if (config.docs.enabled) {
|
|
1913
1992
|
await copyFarmDocsFontAssetsToClient(root, clientOutputDir);
|
|
1914
1993
|
}
|
|
1915
|
-
|
|
1994
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F680} Building server with Nitro (preset: ${preset})...`);
|
|
1916
1995
|
await buildNitroUniversal(
|
|
1917
1996
|
config,
|
|
1918
1997
|
routeManager,
|
|
@@ -1933,7 +2012,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
1933
2012
|
_path2.default.join(root, distDir),
|
|
1934
2013
|
routeRuntimeManifest
|
|
1935
2014
|
);
|
|
1936
|
-
|
|
2015
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F4CB} Route runtime manifest: ${_path2.default.relative(root, runtimeManifestPath)}`);
|
|
1937
2016
|
} catch (error) {
|
|
1938
2017
|
if (lifecyclePluginManager) {
|
|
1939
2018
|
await lifecyclePluginManager.runHookParallel("onError", {
|
|
@@ -1945,10 +2024,10 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
1945
2024
|
}
|
|
1946
2025
|
});
|
|
1947
2026
|
}
|
|
1948
|
-
|
|
2027
|
+
_chunkVQJYGZNXcjs.logger.error(`\u274C Build failed: ${error}`);
|
|
1949
2028
|
throw error;
|
|
1950
2029
|
} finally {
|
|
1951
|
-
_optionalChain([rendererBuild, 'optionalAccess',
|
|
2030
|
+
_optionalChain([rendererBuild, 'optionalAccess', _55 => _55.abort, 'call', _56 => _56()]);
|
|
1952
2031
|
}
|
|
1953
2032
|
}
|
|
1954
2033
|
async function writeSSRAssetsToClient(bundle, outputDir) {
|
|
@@ -1981,7 +2060,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
|
|
|
1981
2060
|
if (fontCss === void 0) {
|
|
1982
2061
|
try {
|
|
1983
2062
|
fontCss = await fs4.readFile(fontCssPath);
|
|
1984
|
-
} catch (
|
|
2063
|
+
} catch (e23) {
|
|
1985
2064
|
return;
|
|
1986
2065
|
}
|
|
1987
2066
|
}
|
|
@@ -1989,11 +2068,11 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
|
|
|
1989
2068
|
let clientCss = "";
|
|
1990
2069
|
try {
|
|
1991
2070
|
clientCss = await fs4.readFile(clientCssPath, "utf8");
|
|
1992
|
-
} catch (
|
|
2071
|
+
} catch (e24) {
|
|
1993
2072
|
}
|
|
1994
2073
|
const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
|
|
1995
2074
|
await fs4.writeFile(fontCssPath, normalizedFontCss);
|
|
1996
|
-
await fs4.writeFile(clientCssPath,
|
|
2075
|
+
await fs4.writeFile(clientCssPath, _chunkF42U3R4Fcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
|
|
1997
2076
|
}
|
|
1998
2077
|
var IncompleteClientBuildOutputError = class extends Error {
|
|
1999
2078
|
constructor(detail) {
|
|
@@ -2009,7 +2088,7 @@ async function validateClientBuildOutput(root, srcDir, outputDir) {
|
|
|
2009
2088
|
try {
|
|
2010
2089
|
const clientEntry = await fs4.stat(clientEntryPath);
|
|
2011
2090
|
if (clientEntry.isFile()) clientEntrySize = clientEntry.size;
|
|
2012
|
-
} catch (
|
|
2091
|
+
} catch (e25) {
|
|
2013
2092
|
}
|
|
2014
2093
|
if (clientEntrySize === 0) {
|
|
2015
2094
|
throw new IncompleteClientBuildOutputError("farm-client.js is missing or empty");
|
|
@@ -2020,7 +2099,7 @@ async function validateClientBuildOutput(root, srcDir, outputDir) {
|
|
|
2020
2099
|
try {
|
|
2021
2100
|
const globalsCss = await fs4.readFile(globalsCssPath, "utf8");
|
|
2022
2101
|
expectsCss = globalsCss.replace(/\/\*[\s\S]*?\*\//g, "").trim().length > 0;
|
|
2023
|
-
} catch (
|
|
2102
|
+
} catch (e26) {
|
|
2024
2103
|
}
|
|
2025
2104
|
try {
|
|
2026
2105
|
const clientCss = await fs4.stat(clientCssPath);
|
|
@@ -2039,7 +2118,7 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
|
|
|
2039
2118
|
const key = `${_path2.default.resolve(root)}\0${mode}\0${options.asyncOwnerIslands === true}\0${options.serverOwners === true}\0${options.serverTreeLayouts === true}\0${_path2.default.resolve(modulePath)}`;
|
|
2040
2119
|
let plan = cache.get(key);
|
|
2041
2120
|
if (!plan) {
|
|
2042
|
-
plan =
|
|
2121
|
+
plan = _chunkF42U3R4Fcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
|
|
2043
2122
|
cache.set(key, plan);
|
|
2044
2123
|
}
|
|
2045
2124
|
return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
|
|
@@ -2047,7 +2126,7 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
|
|
|
2047
2126
|
async function buildClient(productionVite, config, root, srcDir, outputDir, pageRoutes, layoutRoutes = [], routeSlots = [], isolatedClientBoundaryModules = /* @__PURE__ */ new Set(), hydrationPlanCache = /* @__PURE__ */ new Map(), rendererBuildLifetime, programmaticClientRoutes) {
|
|
2048
2127
|
const viteBuild = productionVite.build;
|
|
2049
2128
|
const { farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
|
|
2050
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
2129
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-HZIBL3DW.cjs");
|
|
2051
2130
|
const fs4 = await import("fs/promises");
|
|
2052
2131
|
const pluginManager = new PluginManager2({
|
|
2053
2132
|
config,
|
|
@@ -2056,31 +2135,31 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2056
2135
|
});
|
|
2057
2136
|
pluginManager.addPlugins(config.plugins || []);
|
|
2058
2137
|
const clientPages = [];
|
|
2059
|
-
const integrationProviders =
|
|
2138
|
+
const integrationProviders = _chunkWAPQWAE6cjs.getIntegrationProviders.call(void 0, config.integrations).filter(
|
|
2060
2139
|
(provider) => provider.component || provider.type === "clerk"
|
|
2061
2140
|
);
|
|
2062
2141
|
const unsupportedIntegrationProvider = integrationProviders.find(
|
|
2063
2142
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
2064
2143
|
);
|
|
2065
|
-
if (_optionalChain([config, 'access',
|
|
2066
|
-
|
|
2144
|
+
if (_optionalChain([config, 'access', _57 => _57.experimental, 'optionalAccess', _58 => _58.isolatedClientHydration]) === "enabled" && _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _59 => _59.experimental, 'optionalAccess', _60 => _60.serverComponents])) !== "rsc" && unsupportedIntegrationProvider) {
|
|
2145
|
+
_chunkVQJYGZNXcjs.logger.warn(
|
|
2067
2146
|
`[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
|
|
2068
2147
|
);
|
|
2069
2148
|
}
|
|
2070
|
-
const isolatedMode =
|
|
2071
|
-
_optionalChain([config, 'access',
|
|
2149
|
+
const isolatedMode = _chunkF42U3R4Fcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
2150
|
+
_optionalChain([config, 'access', _61 => _61.experimental, 'optionalAccess', _62 => _62.isolatedClientHydration]),
|
|
2072
2151
|
{
|
|
2073
|
-
serverComponents: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
2152
|
+
serverComponents: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _63 => _63.experimental, 'optionalAccess', _64 => _64.serverComponents])) === "rsc",
|
|
2074
2153
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
2075
2154
|
}
|
|
2076
2155
|
);
|
|
2077
|
-
const planOptions =
|
|
2156
|
+
const planOptions = _chunkF42U3R4Fcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
2078
2157
|
config.renderer,
|
|
2079
2158
|
Boolean(unsupportedIntegrationProvider)
|
|
2080
2159
|
);
|
|
2081
2160
|
const pagePlanOptions = {
|
|
2082
2161
|
...planOptions,
|
|
2083
|
-
serverOwners: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
2162
|
+
serverOwners: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _65 => _65.experimental, 'optionalAccess', _66 => _66.serverComponents])) === "islands"
|
|
2084
2163
|
};
|
|
2085
2164
|
const layoutPlanOptions = {
|
|
2086
2165
|
...planOptions,
|
|
@@ -2112,7 +2191,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2112
2191
|
serverTreeLayout: metadata.serverTreeLayout
|
|
2113
2192
|
};
|
|
2114
2193
|
} catch (error) {
|
|
2115
|
-
|
|
2194
|
+
_chunkVQJYGZNXcjs.logger.warn(`\u26A0\uFE0F Could not inspect layout file ${layout.modulePath}: ${error}`);
|
|
2116
2195
|
return {
|
|
2117
2196
|
...layout,
|
|
2118
2197
|
shouldHydrate: false,
|
|
@@ -2131,18 +2210,18 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2131
2210
|
};
|
|
2132
2211
|
}
|
|
2133
2212
|
});
|
|
2134
|
-
const layoutAppliesToRoute =
|
|
2213
|
+
const layoutAppliesToRoute = _chunk76GHW3WIcjs.routeBoundaryCoversDirectory;
|
|
2135
2214
|
const routeDirectory = (route) => _nullishCoalesce(route.directory, () => ( route.pattern));
|
|
2136
2215
|
const adapterOwnsDocsRuntime = Boolean(
|
|
2137
|
-
_chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access',
|
|
2216
|
+
_chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _67 => _67.docs, 'optionalAccess', _68 => _68.enabled]) && _optionalChain([config, 'access', _69 => _69.docs, 'access', _70 => _70.adapter, 'optionalAccess', _71 => _71.server]) && config.docs.adapter.react
|
|
2138
2217
|
);
|
|
2139
|
-
const adapterDocsEntry = _optionalChain([config, 'access',
|
|
2218
|
+
const adapterDocsEntry = _optionalChain([config, 'access', _72 => _72.docs, 'optionalAccess', _73 => _73.enabled]) ? `/${config.docs.entry || "docs"}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/" : null;
|
|
2140
2219
|
const isAdapterDocsRoute = (routePattern) => Boolean(
|
|
2141
2220
|
adapterOwnsDocsRuntime && adapterDocsEntry && (adapterDocsEntry === "/" || routePattern === adapterDocsEntry || routePattern.startsWith(`${adapterDocsEntry}/`))
|
|
2142
2221
|
);
|
|
2143
|
-
const syntheticDocsEntry = _optionalChain([config, 'access',
|
|
2222
|
+
const syntheticDocsEntry = _optionalChain([config, 'access', _74 => _74.docs, 'optionalAccess', _75 => _75.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
|
|
2144
2223
|
const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
|
|
2145
|
-
const markdownPagePlan =
|
|
2224
|
+
const markdownPagePlan = _chunkF42U3R4Fcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
2146
2225
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), root),
|
|
2147
2226
|
root,
|
|
2148
2227
|
isolatedMode,
|
|
@@ -2158,7 +2237,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2158
2237
|
pagePlanOptions
|
|
2159
2238
|
)
|
|
2160
2239
|
}));
|
|
2161
|
-
|
|
2240
|
+
_chunkF42U3R4Fcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
2162
2241
|
clientLayouts.map((layout) => ({
|
|
2163
2242
|
pattern: layout.pattern,
|
|
2164
2243
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -2167,7 +2246,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2167
2246
|
[
|
|
2168
2247
|
...routePlans.map(({ route, metadata }) => ({
|
|
2169
2248
|
pattern: routeDirectory(route),
|
|
2170
|
-
depth:
|
|
2249
|
+
depth: _chunk76GHW3WIcjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
|
|
2171
2250
|
metadata
|
|
2172
2251
|
})),
|
|
2173
2252
|
...syntheticDocsPatterns.map((pattern) => ({
|
|
@@ -2190,7 +2269,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2190
2269
|
for (const layout of clientLayouts) {
|
|
2191
2270
|
const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || Boolean(adapterDocsEntry && layoutAppliesToRoute(layout.pattern, adapterDocsEntry));
|
|
2192
2271
|
if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
|
|
2193
|
-
|
|
2272
|
+
_chunkVQJYGZNXcjs.logger.warn(`\u26A0\uFE0F ${_chunkF42U3R4Fcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
|
|
2194
2273
|
}
|
|
2195
2274
|
}
|
|
2196
2275
|
if (isolatedMode === "analyze") {
|
|
@@ -2201,7 +2280,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2201
2280
|
if (!("isolatedHydrationEligible" in metadata) || !metadata.isolatedHydrationEligible) {
|
|
2202
2281
|
continue;
|
|
2203
2282
|
}
|
|
2204
|
-
|
|
2283
|
+
_chunkVQJYGZNXcjs.logger.info(
|
|
2205
2284
|
`\u{1F4CA} Isolated hydration analysis: ${entry.modulePath} can exclude its server owner and hydrate ${metadata.isolatedBoundaries.length} client ${metadata.isolatedBoundaries.length === 1 ? "boundary" : "boundaries"}.`
|
|
2206
2285
|
);
|
|
2207
2286
|
}
|
|
@@ -2213,8 +2292,8 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2213
2292
|
(layout) => (layout.shouldHydrate || layout.hasIsolatedClientBoundaries) && layoutAppliesToRoute(layout.pattern, routeDirectory(route))
|
|
2214
2293
|
);
|
|
2215
2294
|
if (metadata.suppressedAsyncHydration) {
|
|
2216
|
-
|
|
2217
|
-
`\u26A0\uFE0F ${
|
|
2295
|
+
_chunkVQJYGZNXcjs.logger.warn(
|
|
2296
|
+
`\u26A0\uFE0F ${_chunkF42U3R4Fcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
|
|
2218
2297
|
);
|
|
2219
2298
|
}
|
|
2220
2299
|
if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0) {
|
|
@@ -2239,12 +2318,12 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2239
2318
|
...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries || layout.serverTreeLayout).flatMap((layout) => layout.isolatedBoundaries)
|
|
2240
2319
|
],
|
|
2241
2320
|
// The server renders a server tree only below a hydrating layout.
|
|
2242
|
-
...
|
|
2321
|
+
..._chunkF42U3R4Fcjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
|
|
2243
2322
|
});
|
|
2244
|
-
|
|
2323
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
|
|
2245
2324
|
}
|
|
2246
2325
|
} catch (error) {
|
|
2247
|
-
|
|
2326
|
+
_chunkVQJYGZNXcjs.logger.warn(`\u26A0\uFE0F Could not inspect route file ${route.modulePath}: ${error}`);
|
|
2248
2327
|
}
|
|
2249
2328
|
}
|
|
2250
2329
|
if (syntheticDocsEntry) {
|
|
@@ -2275,13 +2354,13 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2275
2354
|
}
|
|
2276
2355
|
const clientRouteSlots = routeSlots.filter((slot) => {
|
|
2277
2356
|
try {
|
|
2278
|
-
return
|
|
2357
|
+
return _chunkF42U3R4Fcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root).shouldHydrate;
|
|
2279
2358
|
} catch (error) {
|
|
2280
|
-
|
|
2359
|
+
_chunkVQJYGZNXcjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
|
|
2281
2360
|
return false;
|
|
2282
2361
|
}
|
|
2283
2362
|
});
|
|
2284
|
-
|
|
2363
|
+
_chunkVQJYGZNXcjs.logger.info(
|
|
2285
2364
|
`\u{1F4F1} Total hydratable routes detected: ${clientPages.length} pages, ${clientLayouts.filter((layout) => layout.shouldHydrate || layout.hasIsolatedClientBoundaries).length} layouts, and ${clientRouteSlots.length} slots`
|
|
2286
2365
|
);
|
|
2287
2366
|
const clientEntryRoot = _path2.default.join(root, ".farm", "tmp");
|
|
@@ -2294,20 +2373,20 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2294
2373
|
clientRouteSlots,
|
|
2295
2374
|
root,
|
|
2296
2375
|
srcDir,
|
|
2297
|
-
adapterOwnsDocsRuntime ? false :
|
|
2298
|
-
adapterOwnsDocsRuntime ? void 0 :
|
|
2299
|
-
_optionalChain([config, 'access',
|
|
2300
|
-
adapterOwnsDocsRuntime ? _optionalChain([config, 'access',
|
|
2376
|
+
adapterOwnsDocsRuntime ? false : _chunkDZZHTMWMcjs.isFarmDocsSearchEnabled.call(void 0, config.docs),
|
|
2377
|
+
adapterOwnsDocsRuntime ? void 0 : _chunkDZZHTMWMcjs.resolveFarmDocsSearchClientModule.call(void 0, root),
|
|
2378
|
+
_optionalChain([config, 'access', _76 => _76.docs, 'optionalAccess', _77 => _77.enabled]) ? config.docs.entry : void 0,
|
|
2379
|
+
adapterOwnsDocsRuntime ? _optionalChain([config, 'access', _78 => _78.docs, 'access', _79 => _79.adapter, 'optionalAccess', _80 => _80.react]) : void 0,
|
|
2301
2380
|
config.i18n,
|
|
2302
2381
|
config.plugins,
|
|
2303
2382
|
config.renderer,
|
|
2304
2383
|
config.publicRuntimeConfig,
|
|
2305
2384
|
config.trailingSlash,
|
|
2306
|
-
|
|
2385
|
+
_chunkWAPQWAE6cjs.getIntegrationProviders.call(void 0, config.integrations),
|
|
2307
2386
|
config.basePath,
|
|
2308
|
-
|
|
2387
|
+
_chunkF42U3R4Fcjs.generateClientCachePersistenceCode.call(void 0, _chunkF42U3R4Fcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
|
|
2309
2388
|
adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0,
|
|
2310
|
-
_chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
2389
|
+
_chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _81 => _81.experimental, 'optionalAccess', _82 => _82.serverComponents])) === "islands"
|
|
2311
2390
|
);
|
|
2312
2391
|
await fs4.writeFile(clientEntryPath, clientHydrationCode);
|
|
2313
2392
|
const hasScopedPostcssConfig = hasProjectPostcssConfig(root);
|
|
@@ -2318,12 +2397,12 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2318
2397
|
buildLifetime: rendererBuildLifetime
|
|
2319
2398
|
});
|
|
2320
2399
|
if (hasScopedPostcssConfig) {
|
|
2321
|
-
|
|
2400
|
+
_chunkVQJYGZNXcjs.logger.info("\u{1F4E6} Using project PostCSS/Tailwind configuration");
|
|
2322
2401
|
} else {
|
|
2323
2402
|
const postcssConfigPath = _path2.default.join(clientEntryDir, "postcss.config.cjs");
|
|
2324
2403
|
await fs4.writeFile(postcssConfigPath, "module.exports = { plugins: [] };\n");
|
|
2325
2404
|
postcssSearchPath = clientEntryDir;
|
|
2326
|
-
tailwindVitePlugin = await
|
|
2405
|
+
tailwindVitePlugin = await _chunkLNM57D3Hcjs.loadTailwindVitePlugin.call(void 0, {
|
|
2327
2406
|
builder: productionVite.builder,
|
|
2328
2407
|
announce: true
|
|
2329
2408
|
});
|
|
@@ -2344,7 +2423,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2344
2423
|
outDir: outputDir,
|
|
2345
2424
|
emptyOutDir: true,
|
|
2346
2425
|
// Never public: see resolveFarmClientSourcemap.
|
|
2347
|
-
sourcemap: resolveFarmClientSourcemap(_optionalChain([config, 'access',
|
|
2426
|
+
sourcemap: resolveFarmClientSourcemap(_optionalChain([config, 'access', _83 => _83.vite, 'optionalAccess', _84 => _84.build, 'optionalAccess', _85 => _85.sourcemap])),
|
|
2348
2427
|
assetsInlineLimit: 0,
|
|
2349
2428
|
cssCodeSplit: false,
|
|
2350
2429
|
// Bundle all CSS into one file
|
|
@@ -2358,7 +2437,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2358
2437
|
hashCharacters: "hex",
|
|
2359
2438
|
// Use predictable name for CSS so we can reference it in SSR HTML
|
|
2360
2439
|
assetFileNames: (assetInfo) => {
|
|
2361
|
-
if (_optionalChain([assetInfo, 'access',
|
|
2440
|
+
if (_optionalChain([assetInfo, 'access', _86 => _86.name, 'optionalAccess', _87 => _87.endsWith, 'call', _88 => _88(".css")])) {
|
|
2362
2441
|
return "farm-client.css";
|
|
2363
2442
|
}
|
|
2364
2443
|
return "assets/[name]-h[hash][extname]";
|
|
@@ -2394,7 +2473,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2394
2473
|
}
|
|
2395
2474
|
},
|
|
2396
2475
|
plugins: [
|
|
2397
|
-
|
|
2476
|
+
_chunkF42U3R4Fcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
2398
2477
|
createFarmPrivateClientSourcemapsPlugin({
|
|
2399
2478
|
outDir: _path2.default.join(_path2.default.dirname(outputDir), FARM_CLIENT_SOURCEMAPS_DIR)
|
|
2400
2479
|
}),
|
|
@@ -2419,7 +2498,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2419
2498
|
...rendererVitePlugins,
|
|
2420
2499
|
...config.vite.plugins || [],
|
|
2421
2500
|
farmServerOnlyEntriesPlugin(),
|
|
2422
|
-
|
|
2501
|
+
_chunkF42U3R4Fcjs.farmDocsClientConfigPlugin.call(void 0,
|
|
2423
2502
|
adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
|
|
2424
2503
|
),
|
|
2425
2504
|
// Plugin to redirect @farm.js/core imports to client-only exports
|
|
@@ -2481,7 +2560,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2481
2560
|
} : void 0,
|
|
2482
2561
|
// Ensure React is bundled for client
|
|
2483
2562
|
resolve: {
|
|
2484
|
-
alias:
|
|
2563
|
+
alias: _chunkF42U3R4Fcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
2485
2564
|
dedupe: [...config.renderer.dedupe || []]
|
|
2486
2565
|
},
|
|
2487
2566
|
// Optimize dependencies - exclude server-side code from client bundle
|
|
@@ -2494,13 +2573,13 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2494
2573
|
]
|
|
2495
2574
|
}
|
|
2496
2575
|
};
|
|
2497
|
-
await viteBuild(
|
|
2576
|
+
await viteBuild(_chunkF42U3R4Fcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
|
|
2498
2577
|
await mergeBuiltFontCss(outputDir);
|
|
2499
2578
|
await validateClientBuildOutput(root, srcDir, outputDir);
|
|
2500
2579
|
} finally {
|
|
2501
2580
|
try {
|
|
2502
2581
|
await fs4.rm(clientEntryDir, { recursive: true, force: true });
|
|
2503
|
-
} catch (
|
|
2582
|
+
} catch (e27) {
|
|
2504
2583
|
}
|
|
2505
2584
|
}
|
|
2506
2585
|
}
|
|
@@ -3348,6 +3427,14 @@ function countFarmKeptLayouts(request, layouts, params) {
|
|
|
3348
3427
|
// browser's chain starts at the next layout.
|
|
3349
3428
|
return keys.length > 1 ? 1 + getSharedLayoutPrefixLength(chain, keys.slice(1)) : 0;
|
|
3350
3429
|
}
|
|
3430
|
+
`;
|
|
3431
|
+
var FARM_DOCUMENT_PARSED_RUNTIME = `function farmDocumentParsed() {
|
|
3432
|
+
if (document.readyState !== "loading") return Promise.resolve();
|
|
3433
|
+
return new Promise(function(resolve) {
|
|
3434
|
+
document.addEventListener("DOMContentLoaded", function() { resolve(); }, { once: true });
|
|
3435
|
+
});
|
|
3436
|
+
}
|
|
3437
|
+
|
|
3351
3438
|
`;
|
|
3352
3439
|
function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlots, root, srcDir, docsSearchEnabled, docsSearchModuleId, docsEntryPath, docsAdapterReact, i18nConfig = {
|
|
3353
3440
|
enabled: false,
|
|
@@ -3369,7 +3456,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
3369
3456
|
direction: {}
|
|
3370
3457
|
}, plugins = [], renderer = _chunkRD623KW4cjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false) {
|
|
3371
3458
|
const toImportPath = (targetPath) => targetPath.replace(/\\/g, "/");
|
|
3372
|
-
const clientPluginEntry =
|
|
3459
|
+
const clientPluginEntry = _chunkF42U3R4Fcjs.generateFarmClientPluginEntryCode.call(void 0,
|
|
3373
3460
|
plugins,
|
|
3374
3461
|
root,
|
|
3375
3462
|
srcDir,
|
|
@@ -3378,9 +3465,9 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
3378
3465
|
const appSetupPath = _chunkRD623KW4cjs.resolveFarmRendererAppSetup.call(void 0, root, renderer);
|
|
3379
3466
|
const rendererClientImports = _chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) ? `import React from "react";
|
|
3380
3467
|
import { createRoot, hydrateRoot } from "react-dom/client";` : appSetupPath ? `import React, { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
|
|
3381
|
-
import __farmAppSetup from ${JSON.stringify(
|
|
3468
|
+
import __farmAppSetup from ${JSON.stringify(_chunkVQJYGZNXcjs.toPosixPath.call(void 0, appSetupPath))};
|
|
3382
3469
|
__farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};`;
|
|
3383
|
-
const providerClientCode =
|
|
3470
|
+
const providerClientCode = _chunkF42U3R4Fcjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
3384
3471
|
integrationProviders,
|
|
3385
3472
|
root,
|
|
3386
3473
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
@@ -3390,18 +3477,18 @@ __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot
|
|
|
3390
3477
|
const layoutImportStatements = [];
|
|
3391
3478
|
const layoutRegistrations = [];
|
|
3392
3479
|
const hydratingLayoutPatterns = layoutRoutes.filter((layout) => layout.shouldHydrate).map((layout) => layout.pattern);
|
|
3393
|
-
const treeLayoutPatterns = islandValues ?
|
|
3480
|
+
const treeLayoutPatterns = islandValues ? _chunk76GHW3WIcjs.getFarmServerTreeLayoutPatterns.call(void 0, layoutRoutes) : /* @__PURE__ */ new Set();
|
|
3394
3481
|
layoutRoutes.forEach((layout, index) => {
|
|
3395
3482
|
const relativePath = toImportPath(layout.modulePath);
|
|
3396
3483
|
const treeLayout = treeLayoutPatterns.has(layout.pattern);
|
|
3397
3484
|
const rendersOnClient = treeLayout || !layout.hasIsolatedClientBoundaries && hydratingLayoutPatterns.some(
|
|
3398
|
-
(pattern) =>
|
|
3485
|
+
(pattern) => _chunk76GHW3WIcjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern)
|
|
3399
3486
|
);
|
|
3400
3487
|
if (rendersOnClient && !treeLayout) {
|
|
3401
3488
|
layoutImportStatements.push(`import Layout${index} from "${relativePath}";`);
|
|
3402
3489
|
}
|
|
3403
|
-
const groupScope =
|
|
3404
|
-
const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(
|
|
3490
|
+
const groupScope = _chunk76GHW3WIcjs.getRouteGroupScope.call(void 0, layout.pattern);
|
|
3491
|
+
const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunk76GHW3WIcjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
|
|
3405
3492
|
layoutRegistrations.push(
|
|
3406
3493
|
` { pattern: ${JSON.stringify(layout.pattern)}${groupFields}, Component: ${rendersOnClient ? treeLayout ? `getFarmTreeLayoutComponent(${JSON.stringify(layout.pattern)})` : `Layout${index}` : "null"}, shouldHydrate: ${JSON.stringify(layout.shouldHydrate)}, islandStrategy: ${JSON.stringify(layout.islandStrategy)}${treeLayout ? ", serverTree: true" : ""} }`
|
|
3407
3494
|
);
|
|
@@ -3461,14 +3548,14 @@ function isFarmDocsPath() {
|
|
|
3461
3548
|
// Farm.js Client Runtime (no client components)
|
|
3462
3549
|
${cssImport}
|
|
3463
3550
|
${layoutImports}
|
|
3464
|
-
import { createClientCancellation, createClientPluginManager, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, reconcileFarmDocumentHead, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
3551
|
+
import { createClientCancellation, createClientPluginManager, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, reconcileFarmDocumentHead, runFarmNavigationDelegates, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
3465
3552
|
import { createFarmDeploymentMismatchError, createFarmDeploymentRequestHeaders, isFarmDeploymentMismatchResponse } from "@farm.js/core/deployment";
|
|
3466
3553
|
${clientPluginEntry.imports}
|
|
3467
3554
|
${clientCachePersistence.imports}
|
|
3468
3555
|
${i18nClientRuntime}
|
|
3469
3556
|
${docsNavigationRuntime}
|
|
3470
3557
|
${docsAdapterRuntime}
|
|
3471
|
-
${
|
|
3558
|
+
${_chunkDZZHTMWMcjs.generateFarmDocsSearchClientRuntime.call(void 0, docsSearchEnabled, docsSearchModuleId)}
|
|
3472
3559
|
|
|
3473
3560
|
setFarmBasePath(${JSON.stringify(basePath)});
|
|
3474
3561
|
setFarmTrailingSlashPreference(${JSON.stringify(trailingSlash)});
|
|
@@ -3526,6 +3613,15 @@ ${generateUniversalRouterStateProperties()}
|
|
|
3526
3613
|
if (action === "pop") this.revertBlockedPopState(from);
|
|
3527
3614
|
return;
|
|
3528
3615
|
}
|
|
3616
|
+
// A refresh re-renders the page on screen; only a move to another page is offered.
|
|
3617
|
+
if (
|
|
3618
|
+
action !== "pop" &&
|
|
3619
|
+
!(options.refresh && to === from) &&
|
|
3620
|
+
(await runFarmNavigationDelegates({ url: url.href, from, to, action }))
|
|
3621
|
+
) {
|
|
3622
|
+
this.cancelActiveNavigation();
|
|
3623
|
+
return;
|
|
3624
|
+
}
|
|
3529
3625
|
if (action === "pop") {
|
|
3530
3626
|
this.currentHistoryIndex = readHistoryIndex(options.popState);
|
|
3531
3627
|
this.currentHistoryState = options.popState;
|
|
@@ -3699,7 +3795,7 @@ void farmClientRuntime.start();
|
|
|
3699
3795
|
spaRouter.initializeHistory();
|
|
3700
3796
|
window.__FARM_SPA_ROUTER__ = spaRouter;
|
|
3701
3797
|
|
|
3702
|
-
${islandValues ?
|
|
3798
|
+
${islandValues ? `${FARM_DOCUMENT_PARSED_RUNTIME}void farmDocumentParsed().then(hydrateFarmDocsAdapterRuntime);` : "void hydrateFarmDocsAdapterRuntime();"}
|
|
3703
3799
|
|
|
3704
3800
|
window.addEventListener("beforeunload", function(event) {
|
|
3705
3801
|
if (spaRouter.shouldBlockUnload()) {
|
|
@@ -3743,7 +3839,7 @@ document.addEventListener("click", function(e) {
|
|
|
3743
3839
|
clientPages.forEach((page) => {
|
|
3744
3840
|
for (const boundary of page.isolatedBoundaries) {
|
|
3745
3841
|
isolatedBoundaryModules.set(
|
|
3746
|
-
|
|
3842
|
+
_chunkVQJYGZNXcjs.toViteModuleId.call(void 0, boundary.modulePath, root),
|
|
3747
3843
|
toImportPath(boundary.modulePath)
|
|
3748
3844
|
);
|
|
3749
3845
|
}
|
|
@@ -3826,7 +3922,7 @@ ${layoutImports}
|
|
|
3826
3922
|
${rendererClientImports}
|
|
3827
3923
|
${isolatedHydrationImport}
|
|
3828
3924
|
${providerClientCode.imports}
|
|
3829
|
-
import { createClientCancellation, createClientPluginManager, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, reconcileFarmDocumentHead, scheduleFarmIslandHydration, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
3925
|
+
import { createClientCancellation, createClientPluginManager, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, reconcileFarmDocumentHead, runFarmNavigationDelegates, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
|
|
3830
3926
|
import { createFarmDeploymentMismatchError, createFarmDeploymentRequestHeaders, isFarmDeploymentMismatchResponse } from "@farm.js/core/deployment";
|
|
3831
3927
|
import { createFarmRouter, isFarmRouteActive, matchFarmRoute } from "@farm.js/core/router";
|
|
3832
3928
|
${clientPluginEntry.imports}
|
|
@@ -3836,7 +3932,7 @@ ${docsNavigationRuntime}
|
|
|
3836
3932
|
${docsAdapterRuntime}
|
|
3837
3933
|
|
|
3838
3934
|
${imports.join("\n")}
|
|
3839
|
-
${
|
|
3935
|
+
${_chunkDZZHTMWMcjs.generateFarmDocsSearchClientRuntime.call(void 0, docsSearchEnabled, docsSearchModuleId)}
|
|
3840
3936
|
|
|
3841
3937
|
${providerClientCode.runtime}
|
|
3842
3938
|
|
|
@@ -3905,7 +4001,7 @@ function hasHydratableLayout(pathname) {
|
|
|
3905
4001
|
});
|
|
3906
4002
|
}
|
|
3907
4003
|
|
|
3908
|
-
${
|
|
4004
|
+
${_chunkF42U3R4Fcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
3909
4005
|
// Wrap a page element with applicable layouts
|
|
3910
4006
|
function wrapWithLayouts(pageElement, pathname, params) {
|
|
3911
4007
|
const layouts = getApplicableLayouts(pathname);
|
|
@@ -3940,7 +4036,7 @@ function createLayoutPageBoundary(route, pageElement, serverHtml) {
|
|
|
3940
4036
|
return React.createElement("div", props, pageElement);
|
|
3941
4037
|
}
|
|
3942
4038
|
let farmLastRouteState = null;
|
|
3943
|
-
${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${
|
|
4039
|
+
${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunkF42U3R4Fcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
|
|
3944
4040
|
function farmTreeLayoutsOf(pathname) {
|
|
3945
4041
|
return getApplicableLayouts(pathname).filter(function(layout) {
|
|
3946
4042
|
return layout.serverTree === true;
|
|
@@ -4013,7 +4109,7 @@ async function createMatchedHydrationRoute(matched, pathname, searchParams, serv
|
|
|
4013
4109
|
if (!serverProps || serverProps.__farmRoutePropsResolved !== true) return null;
|
|
4014
4110
|
const props = {
|
|
4015
4111
|
...reviveServerPageProps(serverProps),
|
|
4016
|
-
searchParams:
|
|
4112
|
+
searchParams: createFarmSearchParams(serverProps.search ?? searchParams),
|
|
4017
4113
|
};
|
|
4018
4114
|
pageElement = React.createElement(Component, props);
|
|
4019
4115
|
} else if (typeof Component === "function" && Component.constructor && Component.constructor.name === "AsyncFunction") {
|
|
@@ -4028,7 +4124,7 @@ async function createMatchedHydrationRoute(matched, pathname, searchParams, serv
|
|
|
4028
4124
|
const props = {
|
|
4029
4125
|
...reviveServerPageProps(serverProps),
|
|
4030
4126
|
params: params,
|
|
4031
|
-
searchParams:
|
|
4127
|
+
searchParams: createFarmSearchParams(searchParams),
|
|
4032
4128
|
};
|
|
4033
4129
|
pageElement = React.createElement(Component, props);
|
|
4034
4130
|
}
|
|
@@ -4274,16 +4370,7 @@ function resetReactRoot() {
|
|
|
4274
4370
|
isHydrated = false;
|
|
4275
4371
|
}
|
|
4276
4372
|
|
|
4277
|
-
${islandValues ?
|
|
4278
|
-
// hydrates them as they arrive; anything else waits for the whole document.
|
|
4279
|
-
function farmDocumentParsed() {
|
|
4280
|
-
if (document.readyState !== "loading") return Promise.resolve();
|
|
4281
|
-
return new Promise(function(resolve) {
|
|
4282
|
-
document.addEventListener("DOMContentLoaded", function() { resolve(); }, { once: true });
|
|
4283
|
-
});
|
|
4284
|
-
}
|
|
4285
|
-
|
|
4286
|
-
` : ""}// Hydrate client components
|
|
4373
|
+
${islandValues ? FARM_DOCUMENT_PARSED_RUNTIME : ""}// Hydrate client components
|
|
4287
4374
|
async function hydrate() {
|
|
4288
4375
|
await window.__FARM_PPR_REFRESH_PROMISE__;
|
|
4289
4376
|
// A PPR refresh that is still retrying must not replace DOM once hydration starts.
|
|
@@ -4595,6 +4682,15 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
|
|
|
4595
4682
|
if (action === "pop") this.revertBlockedPopState(from);
|
|
4596
4683
|
return;
|
|
4597
4684
|
}
|
|
4685
|
+
// A refresh re-renders the page on screen; only a move to another page is offered.
|
|
4686
|
+
if (
|
|
4687
|
+
action !== "pop" &&
|
|
4688
|
+
!(options.refresh && to === from) &&
|
|
4689
|
+
(await runFarmNavigationDelegates({ url: url.href, from, to, action }))
|
|
4690
|
+
) {
|
|
4691
|
+
this.cancelActiveNavigation();
|
|
4692
|
+
return;
|
|
4693
|
+
}
|
|
4598
4694
|
if (action === "pop") {
|
|
4599
4695
|
this.currentHistoryIndex = readHistoryIndex(options.popState);
|
|
4600
4696
|
this.currentHistoryState = options.popState;
|
|
@@ -4678,7 +4774,7 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
|
|
|
4678
4774
|
if (!this.isCurrentNavigation(navigation, clientNavigation)) return;
|
|
4679
4775
|
const params = matched.params;
|
|
4680
4776
|
const searchParams = searchParamsToObject(url.searchParams);
|
|
4681
|
-
const props = { params: params, searchParams:
|
|
4777
|
+
const props = { params: params, searchParams: createFarmSearchParams(searchParams) };
|
|
4682
4778
|
let pageElement = React.createElement(Component, props);
|
|
4683
4779
|
if (hasHydratableLayout(pathname)) {
|
|
4684
4780
|
pageElement = createLayoutPageBoundary(matched.route, pageElement);
|
|
@@ -5049,7 +5145,7 @@ void hydrate();
|
|
|
5049
5145
|
async function buildSSRInMemory(productionVite, config, root, routeManager, apiRouteManager, serverRenderer, preset, collectedPageRoutes, collectedLayoutRoutes, collectedRouteSlots, isolatedClientBoundaryModules, hydrationPlanCache, rendererBuildLifetime) {
|
|
5050
5146
|
const viteBuild = productionVite.build;
|
|
5051
5147
|
const { farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
|
|
5052
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
5148
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-HZIBL3DW.cjs");
|
|
5053
5149
|
const fs4 = await import("fs/promises");
|
|
5054
5150
|
const pluginManager = new PluginManager2({
|
|
5055
5151
|
config,
|
|
@@ -5070,7 +5166,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5070
5166
|
_path2.default.join(postcssConfigDir, "postcss.config.cjs"),
|
|
5071
5167
|
"module.exports = { plugins: [] };\n"
|
|
5072
5168
|
);
|
|
5073
|
-
tailwindVitePlugin = await
|
|
5169
|
+
tailwindVitePlugin = await _chunkLNM57D3Hcjs.loadTailwindVitePlugin.call(void 0, {
|
|
5074
5170
|
builder: productionVite.builder,
|
|
5075
5171
|
label: "for SSR"
|
|
5076
5172
|
});
|
|
@@ -5166,14 +5262,14 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5166
5262
|
}
|
|
5167
5263
|
const middlewareRoutes = await discoverMiddlewareRoutes(appDirs);
|
|
5168
5264
|
const instrumentationPath = _chunkBRWIVOV4cjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
|
|
5169
|
-
const notFoundPath =
|
|
5170
|
-
if (notFoundPath)
|
|
5265
|
+
const notFoundPath = _chunkF42U3R4Fcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
|
|
5266
|
+
if (notFoundPath) _chunkVQJYGZNXcjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
|
|
5171
5267
|
layoutRoutes.sort((a, b) => {
|
|
5172
5268
|
const depthA = a.pattern.split("/").filter(Boolean).length;
|
|
5173
5269
|
const depthB = b.pattern.split("/").filter(Boolean).length;
|
|
5174
5270
|
return depthA - depthB;
|
|
5175
5271
|
});
|
|
5176
|
-
|
|
5272
|
+
_chunkVQJYGZNXcjs.logger.info(
|
|
5177
5273
|
`\u{1F4CB} Found ${pageRoutes.length} page routes, ${layoutRoutes.length} layouts, ${apiRoutes.length} API routes, ${applicationMetadataRoutes.length} metadata routes, and ${middlewareRoutes.length} middleware files`
|
|
5178
5274
|
);
|
|
5179
5275
|
const configuredIntegrationValues = Object.values(config.integrations || {});
|
|
@@ -5183,13 +5279,13 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5183
5279
|
const hasServerRuntimeIntegrations = configuredIntegrationValues.some(
|
|
5184
5280
|
(integration) => typeof integration === "object" && integration !== null && (!("serverRuntime" in integration) || integration.serverRuntime !== false)
|
|
5185
5281
|
);
|
|
5186
|
-
const hasIntegrationProviders =
|
|
5282
|
+
const hasIntegrationProviders = _chunkWAPQWAE6cjs.getIntegrationProviders.call(void 0, config.integrations).some(
|
|
5187
5283
|
(provider) => provider.component || provider.type === "clerk"
|
|
5188
5284
|
);
|
|
5189
5285
|
const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
|
|
5190
|
-
const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access',
|
|
5191
|
-
const hasMiddlewareConfig =
|
|
5192
|
-
const hasRouteContextConfig =
|
|
5286
|
+
const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _89 => _89.mdx, 'optionalAccess', _90 => _90.components]));
|
|
5287
|
+
const hasMiddlewareConfig = _chunk76GHW3WIcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
5288
|
+
const hasRouteContextConfig = _chunkO3MMJPC2cjs.hasCustomFarmRouteContext.call(void 0, config);
|
|
5193
5289
|
const hasServerRuntimePlugins = hasFarmServerRuntimePlugins(config);
|
|
5194
5290
|
const hasPluginRoutes = hasFarmPluginRoutes(config);
|
|
5195
5291
|
const hasServerCacheConfig = hasFarmServerCacheConfig(config.cache);
|
|
@@ -5199,23 +5295,23 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5199
5295
|
const hasConfiguredRuntimePlugins = Boolean(
|
|
5200
5296
|
hasRuntimeConfigModule && (config.plugins || []).length > 0
|
|
5201
5297
|
);
|
|
5202
|
-
if (
|
|
5298
|
+
if (_chunkVIFPE5RGcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
|
|
5203
5299
|
const adapterGuardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
|
|
5204
|
-
|
|
5300
|
+
_chunkVIFPE5RGcjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
|
|
5205
5301
|
config.docs,
|
|
5206
5302
|
{ root, srcDir: config.srcDir },
|
|
5207
5303
|
(pathname) => adapterGuardedPaths.has(pathname)
|
|
5208
5304
|
);
|
|
5209
5305
|
}
|
|
5210
5306
|
const farmDocsCspNonceMarker = _chunk6JHZPB52cjs.createFarmCspNonce.call(void 0, config.security);
|
|
5211
|
-
const farmDocsPrecompiledManifest = _optionalChain([config, 'access',
|
|
5307
|
+
const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _91 => _91.docs, 'optionalAccess', _92 => _92.enabled]) && _chunkE552H232cjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunkHNAISJFDcjs._runWithFarmCspNonce.call(void 0,
|
|
5212
5308
|
farmDocsCspNonceMarker,
|
|
5213
|
-
async () => _optionalChain([config, 'access',
|
|
5309
|
+
async () => _optionalChain([config, 'access', _93 => _93.docs, 'access', _94 => _94.adapter, 'optionalAccess', _95 => _95.server]) ? await _chunkVIFPE5RGcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
|
|
5214
5310
|
root,
|
|
5215
5311
|
srcDir: config.srcDir,
|
|
5216
5312
|
clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
|
|
5217
5313
|
fontStylesheetHref: "/farm-fonts.css",
|
|
5218
|
-
globalStylesheetHref:
|
|
5314
|
+
globalStylesheetHref: FARM_CLIENT_CSS_HREF_PLACEHOLDER
|
|
5219
5315
|
}) : await (async () => {
|
|
5220
5316
|
const guardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
|
|
5221
5317
|
return compileFarmDocsManifest(config.docs, {
|
|
@@ -5224,7 +5320,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5224
5320
|
clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
|
|
5225
5321
|
fontAssets: _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkERMUL73Lcjs.resolveFarmDocsFontAssets.call(void 0, root)),
|
|
5226
5322
|
fontStylesheetHref: "/farm-fonts.css",
|
|
5227
|
-
globalStylesheetHref:
|
|
5323
|
+
globalStylesheetHref: FARM_CLIENT_CSS_HREF_PLACEHOLDER,
|
|
5228
5324
|
isPathGuarded: (pathname) => guardedPaths.has(pathname)
|
|
5229
5325
|
});
|
|
5230
5326
|
})()
|
|
@@ -5319,7 +5415,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5319
5415
|
// Adapters can render provider scripts by serializing function source.
|
|
5320
5416
|
// keepNames injects helper calls into those functions; after Nitro
|
|
5321
5417
|
// minifies the server chunk the helper is no longer in script scope.
|
|
5322
|
-
keepNames: !(_optionalChain([config, 'access',
|
|
5418
|
+
keepNames: !(_optionalChain([config, 'access', _96 => _96.docs, 'optionalAccess', _97 => _97.enabled]) && _optionalChain([config, 'access', _98 => _98.docs, 'access', _99 => _99.adapter, 'optionalAccess', _100 => _100.server])),
|
|
5323
5419
|
jsxDev: false
|
|
5324
5420
|
},
|
|
5325
5421
|
// SSR configuration to externalize problematic modules
|
|
@@ -5369,10 +5465,10 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5369
5465
|
define: {
|
|
5370
5466
|
__FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
|
|
5371
5467
|
__FARM_ENV__: JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, config.env)),
|
|
5372
|
-
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access',
|
|
5468
|
+
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _101 => _101.env, 'optionalAccess', _102 => _102.public]) || {})
|
|
5373
5469
|
},
|
|
5374
5470
|
plugins: [
|
|
5375
|
-
|
|
5471
|
+
_chunkF42U3R4Fcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
5376
5472
|
...tailwindVitePlugin ? [tailwindVitePlugin] : [],
|
|
5377
5473
|
...rendererVitePlugins,
|
|
5378
5474
|
...config.vite.plugins || [],
|
|
@@ -5433,7 +5529,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5433
5529
|
resolve: {
|
|
5434
5530
|
alias: [
|
|
5435
5531
|
...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
|
|
5436
|
-
...Object.entries(
|
|
5532
|
+
...Object.entries(_chunkF42U3R4Fcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
|
|
5437
5533
|
([find, replacement]) => ({ find, replacement })
|
|
5438
5534
|
)
|
|
5439
5535
|
],
|
|
@@ -5441,12 +5537,12 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5441
5537
|
dedupe: [...config.renderer.dedupe || []]
|
|
5442
5538
|
}
|
|
5443
5539
|
};
|
|
5444
|
-
await viteBuild(
|
|
5540
|
+
await viteBuild(_chunkF42U3R4Fcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
|
|
5445
5541
|
} finally {
|
|
5446
5542
|
if (postcssConfigDir) {
|
|
5447
5543
|
try {
|
|
5448
5544
|
await fs4.rm(postcssConfigDir, { recursive: true, force: true });
|
|
5449
|
-
} catch (
|
|
5545
|
+
} catch (e28) {
|
|
5450
5546
|
}
|
|
5451
5547
|
}
|
|
5452
5548
|
}
|
|
@@ -5459,7 +5555,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5459
5555
|
function readFarmAppPackageIdentity(root) {
|
|
5460
5556
|
try {
|
|
5461
5557
|
return JSON.parse(_fs.readFileSync.call(void 0, _path2.default.join(root, "package.json"), "utf8"));
|
|
5462
|
-
} catch (
|
|
5558
|
+
} catch (e29) {
|
|
5463
5559
|
return {};
|
|
5464
5560
|
}
|
|
5465
5561
|
}
|
|
@@ -5471,14 +5567,14 @@ function readFarmPageLastModified(pageRoutes) {
|
|
|
5471
5567
|
lastModified[route.pattern] = _fs.statSync.call(void 0,
|
|
5472
5568
|
_nullishCoalesce(route.markdownSourcePath, () => ( route.modulePath))
|
|
5473
5569
|
).mtime.toISOString();
|
|
5474
|
-
} catch (
|
|
5570
|
+
} catch (e30) {
|
|
5475
5571
|
}
|
|
5476
5572
|
}
|
|
5477
5573
|
return lastModified;
|
|
5478
5574
|
}
|
|
5479
5575
|
function getFarmDocsGuardedPaths(config, middlewareRoutes) {
|
|
5480
|
-
if (!_optionalChain([config, 'access',
|
|
5481
|
-
const contentDir =
|
|
5576
|
+
if (!_optionalChain([config, 'access', _103 => _103.docs, 'optionalAccess', _104 => _104.enabled])) return [];
|
|
5577
|
+
const contentDir = _chunkIOUOGRDXcjs.resolveFarmDocsContentDir.call(void 0, config.docs, {
|
|
5482
5578
|
root: config.root,
|
|
5483
5579
|
srcDir: config.srcDir
|
|
5484
5580
|
});
|
|
@@ -5486,18 +5582,18 @@ function getFarmDocsGuardedPaths(config, middlewareRoutes) {
|
|
|
5486
5582
|
config: { middleware: config.middleware, integrations: config.integrations },
|
|
5487
5583
|
middlewareRoutes
|
|
5488
5584
|
};
|
|
5489
|
-
return
|
|
5585
|
+
return _chunkIOUOGRDXcjs.discoverFarmDocsPages.call(void 0, contentDir, config.docs).flatMap((page) => [page.href, _chunkIOUOGRDXcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunk76GHW3WIcjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
|
|
5490
5586
|
}
|
|
5491
5587
|
function getFarmAppOwnedDocsEnginePaths(agent, applicationMetadataRoutes) {
|
|
5492
|
-
const llmsTxt = _optionalChain([agent, 'optionalAccess',
|
|
5588
|
+
const llmsTxt = _optionalChain([agent, 'optionalAccess', _105 => _105.llmsTxt]);
|
|
5493
5589
|
const ownedByFile = (kind) => applicationMetadataRoutes.some(
|
|
5494
5590
|
(metadata) => metadata.kind === kind && metadata.pattern === "/"
|
|
5495
5591
|
);
|
|
5496
5592
|
return [
|
|
5497
|
-
..._optionalChain([llmsTxt, 'optionalAccess',
|
|
5498
|
-
..._optionalChain([llmsTxt, 'optionalAccess',
|
|
5499
|
-
..._optionalChain([agent, 'optionalAccess',
|
|
5500
|
-
..._optionalChain([agent, 'optionalAccess',
|
|
5593
|
+
..._optionalChain([llmsTxt, 'optionalAccess', _106 => _106.enabled]) || ownedByFile("llms") ? ["/llms.txt"] : [],
|
|
5594
|
+
..._optionalChain([llmsTxt, 'optionalAccess', _107 => _107.enabled]) && llmsTxt.full || ownedByFile("llms-full") ? ["/llms-full.txt"] : [],
|
|
5595
|
+
..._optionalChain([agent, 'optionalAccess', _108 => _108.sitemap, 'optionalAccess', _109 => _109.enabled]) || ownedByFile("sitemap") ? ["/sitemap.xml"] : [],
|
|
5596
|
+
..._optionalChain([agent, 'optionalAccess', _110 => _110.crawlers, 'optionalAccess', _111 => _111.enabled]) || ownedByFile("robots") ? ["/robots.txt"] : []
|
|
5501
5597
|
];
|
|
5502
5598
|
}
|
|
5503
5599
|
function generateFarmDocsRuntimeConfigExpression(docs, precompiled = false) {
|
|
@@ -5536,7 +5632,7 @@ function toVirtualEntryImportSpecifier(modulePath) {
|
|
|
5536
5632
|
return JSON.stringify(modulePath.replace(/\\/g, "/"));
|
|
5537
5633
|
}
|
|
5538
5634
|
function generateNativeAuthIntegrationSource(auth) {
|
|
5539
|
-
if (_optionalChain([auth, 'optionalAccess',
|
|
5635
|
+
if (_optionalChain([auth, 'optionalAccess', _112 => _112.enabled]) !== true) {
|
|
5540
5636
|
return { importSource: "", registerSource: "" };
|
|
5541
5637
|
}
|
|
5542
5638
|
return {
|
|
@@ -5822,28 +5918,28 @@ function generateFarmRendererAppSetupServerCode(config) {
|
|
|
5822
5918
|
const appSetupPath = _chunkRD623KW4cjs.resolveFarmRendererAppSetup.call(void 0, config.root || process.cwd(), config.renderer);
|
|
5823
5919
|
if (!appSetupPath) return "";
|
|
5824
5920
|
return `
|
|
5825
|
-
import __farmAppSetup from ${JSON.stringify(
|
|
5921
|
+
import __farmAppSetup from ${JSON.stringify(_chunkVQJYGZNXcjs.toPosixPath.call(void 0, appSetupPath))};
|
|
5826
5922
|
if (typeof ReactDOMServer.configureApp !== "function") {
|
|
5827
5923
|
throw new Error(${JSON.stringify(`Renderer \`${config.renderer.name}\` does not support \`appSetup\`: its server module must export configureApp().`)});
|
|
5828
5924
|
}
|
|
5829
5925
|
ReactDOMServer.configureApp(__farmAppSetup);`;
|
|
5830
5926
|
}
|
|
5831
5927
|
function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlots, errorRoutes, metadataImageRoutes, applicationMetadataRoutes, middlewareRoutes, redirectRoutes, configuredRewriteRoutes, configuredHeaderRoutes, openAPIReference, notFoundPath, instrumentationPath, config, farmDocsPrecompiledManifest, configModulePath, hasServerRuntimeIntegrations, hasRuntimeIntegrationConfig, hasConfiguredRuntimePlugins, hasServerRuntimePlugins, preset, i18nCatalogs, isolatedClientBoundaryModules, hydrationPlanCache) {
|
|
5832
|
-
const farmIslandsMode = _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
5928
|
+
const farmIslandsMode = _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _113 => _113.experimental, 'optionalAccess', _114 => _114.serverComponents])) === "islands";
|
|
5833
5929
|
const hasCompressionRuntime = config.compress && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
|
|
5834
|
-
const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access',
|
|
5930
|
+
const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access', _115 => _115.agent, 'optionalAccess', _116 => _116.crawlers, 'optionalAccess', _117 => _117.enabled])) && !applicationMetadataRoutes.some(
|
|
5835
5931
|
(metadata) => metadata.kind === "robots" && metadata.pattern === "/"
|
|
5836
5932
|
);
|
|
5837
|
-
const servesAgentSitemap = Boolean(_optionalChain([config, 'access',
|
|
5933
|
+
const servesAgentSitemap = Boolean(_optionalChain([config, 'access', _118 => _118.agent, 'optionalAccess', _119 => _119.sitemap, 'optionalAccess', _120 => _120.enabled])) && !applicationMetadataRoutes.some(
|
|
5838
5934
|
(metadata) => metadata.kind === "sitemap" && metadata.pattern === "/"
|
|
5839
5935
|
);
|
|
5840
|
-
const servesDefaultMCP = _optionalChain([config, 'access',
|
|
5841
|
-
const servesAiCatalog = _optionalChain([config, 'access',
|
|
5936
|
+
const servesDefaultMCP = _optionalChain([config, 'access', _121 => _121.agent, 'optionalAccess', _122 => _122.mcp]) === true && !_chunkSBABQKPTcjs.farmConfigMountsMCP.call(void 0, config) && !apiRoutes.some((route) => route.path === "/api/mcp");
|
|
5937
|
+
const servesAiCatalog = _optionalChain([config, 'access', _123 => _123.agent, 'optionalAccess', _124 => _124.aiCatalog]) !== false;
|
|
5842
5938
|
const hasPluginRuntime = hasRuntimeIntegrationConfig || hasServerRuntimePlugins;
|
|
5843
5939
|
const hasInfraAnalyticsRuntime = config.analytics !== false && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
|
|
5844
5940
|
const hasPrecompiledDocs = Boolean(farmDocsPrecompiledManifest);
|
|
5845
5941
|
const adapterOwnsDocsRuntime = Boolean(
|
|
5846
|
-
_chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access',
|
|
5942
|
+
_chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _125 => _125.docs, 'optionalAccess', _126 => _126.enabled]) && _optionalChain([config, 'access', _127 => _127.docs, 'access', _128 => _128.adapter, 'optionalAccess', _129 => _129.server]) && config.docs.adapter.react
|
|
5847
5943
|
);
|
|
5848
5944
|
const docsConfigModulePath = adapterOwnsDocsRuntime && !hasPrecompiledDocs && config.docs.configPath && !config.docs.configPath.endsWith(".json") ? config.docs.configPath : void 0;
|
|
5849
5945
|
const hasIsolatedClientGraphRuntime = _chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) && isolatedClientBoundaryModules.size > 0;
|
|
@@ -5888,9 +5984,9 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
5888
5984
|
const hasGeneratedMetadataImages = metadataImageRoutes.some(
|
|
5889
5985
|
(image) => image.sourceType === "module"
|
|
5890
5986
|
);
|
|
5891
|
-
const hasMiddlewareRuntime = middlewareRoutes.length > 0 ||
|
|
5892
|
-
const farmDocsFontAssets = _optionalChain([config, 'access',
|
|
5893
|
-
const integrationProviders =
|
|
5987
|
+
const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunk76GHW3WIcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
5988
|
+
const farmDocsFontAssets = _optionalChain([config, 'access', _130 => _130.docs, 'optionalAccess', _131 => _131.enabled]) ? _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkERMUL73Lcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
|
|
5989
|
+
const integrationProviders = _chunkWAPQWAE6cjs.getIntegrationProviders.call(void 0, config.integrations);
|
|
5894
5990
|
const renderedIntegrationProviders = integrationProviders.filter(
|
|
5895
5991
|
(provider) => provider.component || provider.type === "clerk"
|
|
5896
5992
|
);
|
|
@@ -5899,16 +5995,16 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
5899
5995
|
`Integration provider components are not supported by the "${config.renderer.name}" renderer.`
|
|
5900
5996
|
);
|
|
5901
5997
|
}
|
|
5902
|
-
const providerServerModules =
|
|
5998
|
+
const providerServerModules = _chunkF42U3R4Fcjs.generateFarmIntegrationProviderServerModules.call(void 0,
|
|
5903
5999
|
renderedIntegrationProviders,
|
|
5904
6000
|
config.root,
|
|
5905
6001
|
_nullishCoalesce(config.renderer.componentExtensions, () => ( []))
|
|
5906
6002
|
);
|
|
5907
6003
|
const resolvedIntegrationProviderFallback = Object.fromEntries(
|
|
5908
6004
|
Object.entries(config.integrations).flatMap(([name, integration]) => {
|
|
5909
|
-
const configuredProviders = _optionalChain([integration, 'optionalAccess',
|
|
6005
|
+
const configuredProviders = _optionalChain([integration, 'optionalAccess', _132 => _132.providers]);
|
|
5910
6006
|
const providers = Array.isArray(configuredProviders) ? configuredProviders : [];
|
|
5911
|
-
if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess',
|
|
6007
|
+
if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess', _133 => _133.component]) === "function")) {
|
|
5912
6008
|
throw new Error(
|
|
5913
6009
|
`Integration provider components in production must use an importable component reference, for example component: { module: "@/components/provider" }.`
|
|
5914
6010
|
);
|
|
@@ -5919,20 +6015,20 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
5919
6015
|
const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
|
|
5920
6016
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
5921
6017
|
);
|
|
5922
|
-
const isolatedHydrationMode =
|
|
5923
|
-
_optionalChain([config, 'access',
|
|
6018
|
+
const isolatedHydrationMode = _chunkF42U3R4Fcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
6019
|
+
_optionalChain([config, 'access', _134 => _134.experimental, 'optionalAccess', _135 => _135.isolatedClientHydration]),
|
|
5924
6020
|
{
|
|
5925
|
-
serverComponents: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
6021
|
+
serverComponents: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _136 => _136.experimental, 'optionalAccess', _137 => _137.serverComponents])) === "rsc",
|
|
5926
6022
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
5927
6023
|
}
|
|
5928
6024
|
);
|
|
5929
|
-
const hydrationPlanOptions =
|
|
6025
|
+
const hydrationPlanOptions = _chunkF42U3R4Fcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
5930
6026
|
config.renderer,
|
|
5931
6027
|
Boolean(unsupportedIntegrationProvider)
|
|
5932
6028
|
);
|
|
5933
6029
|
const pageHydrationPlanOptions = {
|
|
5934
6030
|
...hydrationPlanOptions,
|
|
5935
|
-
serverOwners: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
6031
|
+
serverOwners: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _138 => _138.experimental, 'optionalAccess', _139 => _139.serverComponents])) === "islands"
|
|
5936
6032
|
};
|
|
5937
6033
|
const layoutHydrationPlans = layoutRoutes.map((layout) => ({
|
|
5938
6034
|
...layout,
|
|
@@ -5944,7 +6040,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
5944
6040
|
{ ...hydrationPlanOptions, serverTreeLayouts: pageHydrationPlanOptions.serverOwners }
|
|
5945
6041
|
)
|
|
5946
6042
|
}));
|
|
5947
|
-
const markdownPagePlan =
|
|
6043
|
+
const markdownPagePlan = _chunkF42U3R4Fcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
5948
6044
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
|
|
5949
6045
|
config.root,
|
|
5950
6046
|
isolatedHydrationMode,
|
|
@@ -5962,7 +6058,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
5962
6058
|
)
|
|
5963
6059
|
])
|
|
5964
6060
|
);
|
|
5965
|
-
|
|
6061
|
+
_chunkF42U3R4Fcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
5966
6062
|
layoutHydrationPlans.map((layout) => ({
|
|
5967
6063
|
pattern: layout.pattern,
|
|
5968
6064
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -5971,10 +6067,10 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
5971
6067
|
pageRoutes.map((route) => ({
|
|
5972
6068
|
// Compared by directory so a grouped layout applies only inside its group.
|
|
5973
6069
|
pattern: _nullishCoalesce(route.directory, () => ( route.pattern)),
|
|
5974
|
-
depth:
|
|
6070
|
+
depth: _chunk76GHW3WIcjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
|
|
5975
6071
|
metadata: pageHydrationPlans.get(route.modulePath)
|
|
5976
6072
|
})),
|
|
5977
|
-
|
|
6073
|
+
_chunk76GHW3WIcjs.routeBoundaryCoversDirectory
|
|
5978
6074
|
);
|
|
5979
6075
|
const providerServerImports = [
|
|
5980
6076
|
providerServerModules.hasClerkProvider ? `import { ClerkProvider as FarmClerkProvider } from "@clerk/react";` : "",
|
|
@@ -5991,7 +6087,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
5991
6087
|
apiRegistrations.push(`
|
|
5992
6088
|
{
|
|
5993
6089
|
path: ${JSON.stringify(route.path)},
|
|
5994
|
-
methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access',
|
|
6090
|
+
methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access', _140 => _140.pluginMethods, 'optionalAccess', _141 => _141.includes, 'call', _142 => _142(method)])))},
|
|
5995
6091
|
endpoints: ${varName},
|
|
5996
6092
|
}`);
|
|
5997
6093
|
});
|
|
@@ -6028,15 +6124,15 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6028
6124
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(route.modulePath)};`
|
|
6029
6125
|
);
|
|
6030
6126
|
const clientMetadata = pageHydrationPlans.get(route.modulePath);
|
|
6031
|
-
const renderingDirective =
|
|
6127
|
+
const renderingDirective = _chunkY7TLL65Bcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
|
|
6032
6128
|
pageRegistrations.push(`
|
|
6033
6129
|
{
|
|
6034
6130
|
pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
|
|
6035
6131
|
directory: ${JSON.stringify(route.directory)},` : ""}
|
|
6036
6132
|
module: ${varName},
|
|
6037
6133
|
shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},${clientMetadata.shouldHydrate ? `
|
|
6038
|
-
clientModule: ${JSON.stringify(
|
|
6039
|
-
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${
|
|
6134
|
+
clientModule: ${JSON.stringify(_chunkVQJYGZNXcjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
|
|
6135
|
+
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkF42U3R4Fcjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${renderingDirective ? `
|
|
6040
6136
|
rendering: ${JSON.stringify(renderingDirective)},` : ""}
|
|
6041
6137
|
${route.source !== void 0 ? `markdownSource: {
|
|
6042
6138
|
source: ${JSON.stringify(route.source)},
|
|
@@ -6046,7 +6142,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6046
6142
|
});
|
|
6047
6143
|
const layoutImports = [];
|
|
6048
6144
|
const layoutRegistrations = [];
|
|
6049
|
-
const treeLayoutPatterns = farmIslandsMode ?
|
|
6145
|
+
const treeLayoutPatterns = farmIslandsMode ? _chunk76GHW3WIcjs.getFarmServerTreeLayoutPatterns.call(void 0,
|
|
6050
6146
|
layoutHydrationPlans.map((layout) => ({
|
|
6051
6147
|
pattern: layout.pattern,
|
|
6052
6148
|
shouldHydrate: layout.hydration.shouldHydrate,
|
|
@@ -6100,12 +6196,12 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6100
6196
|
errorImports.push(
|
|
6101
6197
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(errorRoute.modulePath)};`
|
|
6102
6198
|
);
|
|
6103
|
-
const groupScope =
|
|
6199
|
+
const groupScope = _chunk76GHW3WIcjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
|
|
6104
6200
|
errorRegistrations.push(`
|
|
6105
6201
|
{
|
|
6106
|
-
pattern: ${JSON.stringify(
|
|
6202
|
+
pattern: ${JSON.stringify(_chunk76GHW3WIcjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
|
|
6107
6203
|
groupScope: ${JSON.stringify(groupScope)},
|
|
6108
|
-
directoryDepth: ${
|
|
6204
|
+
directoryDepth: ${_chunk76GHW3WIcjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
|
|
6109
6205
|
module: ${varName},
|
|
6110
6206
|
}`);
|
|
6111
6207
|
});
|
|
@@ -6243,6 +6339,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6243
6339
|
resolveFarmPreviewDeployment,
|
|
6244
6340
|
resolveFarmWebRequestOrigin,
|
|
6245
6341
|
runWithFarmRequestSpan,
|
|
6342
|
+
createFarmSearchParams,
|
|
6246
6343
|
searchParamsToObject,
|
|
6247
6344
|
setFarmBasePath,
|
|
6248
6345
|
setFarmTrailingSlashPreference,
|
|
@@ -6255,7 +6352,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6255
6352
|
import { getSharedLayoutPrefixLength, handleFarmFormActionRequest, ignoreFarmHeldValues, installFarmIslandValues, parseFarmLayoutChainHeader } from "@farm.js/core/internal/production-runtime";
|
|
6256
6353
|
import { installFarmIslandsServer } from "@farm.js/core/internal/islands-server";
|
|
6257
6354
|
installFarmIslandsServer();
|
|
6258
|
-
const farmFormActionsConfig = ${JSON.stringify(
|
|
6355
|
+
const farmFormActionsConfig = ${JSON.stringify(_chunkFK25QSVCcjs.resolveServerActionsConfig.call(void 0, config.serverActions))};
|
|
6259
6356
|
installFarmIslandValues();
|
|
6260
6357
|
${islandsActionKeyCode()}
|
|
6261
6358
|
${FARM_SEGMENT_NAVIGATION_SERVER_RUNTIME}` : ""}`;
|
|
@@ -6265,25 +6362,25 @@ ${FARM_SEGMENT_NAVIGATION_SERVER_RUNTIME}` : ""}`;
|
|
|
6265
6362
|
const infraAnalyticsImport = hasInfraAnalyticsRuntime ? `import { ${hasPluginRuntime ? "createFarmInfraAnalyticsPlugin" : "createFarmInfraAnalyticsRecorder"} } from "@farm.js/core/internal/infra-analytics-runtime";` : "";
|
|
6266
6363
|
const compressionRuntimeImport = hasCompressionRuntime ? `import { compressFarmResponse${hasPluginRuntime ? ", createCompressionPlugin" : ""} } from "@farm.js/core/internal/compression-runtime";` : "";
|
|
6267
6364
|
const i18nServerImport = config.i18n.enabled ? `import { _runWithFarmI18nRequest, _setDefaultFarmI18nRuntime, createFarmI18nRuntime, getFarmI18nClientSnapshot } from "@farm.js/core/i18n/server";` : "";
|
|
6268
|
-
const docsHandlerImport = _optionalChain([config, 'access',
|
|
6365
|
+
const docsHandlerImport = _optionalChain([config, 'access', _143 => _143.docs, 'optionalAccess', _144 => _144.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
|
|
6269
6366
|
const isFarmDocsAPIRequest = (requestOrPathname) => {
|
|
6270
6367
|
const pathname = typeof requestOrPathname === "string"
|
|
6271
6368
|
? requestOrPathname
|
|
6272
6369
|
: new URL(requestOrPathname.url).pathname;
|
|
6273
|
-
const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess',
|
|
6370
|
+
const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _145 => _145.apiPath]) || "/api/docs")};
|
|
6274
6371
|
return pathname === apiPath || pathname.startsWith(apiPath + "/");
|
|
6275
6372
|
};` : adapterOwnsDocsRuntime ? `import { isFarmDocsAPIRequest } from "@farm.js/core/docs";
|
|
6276
6373
|
import { createFarmDocsRuntimeHandler as createFarmDocsAdapterRuntimeHandler } from ${JSON.stringify(config.docs.adapter.server)};
|
|
6277
6374
|
import * as FarmDocsAdapterReact from ${JSON.stringify(config.docs.adapter.react)};${docsConfigModulePath ? `
|
|
6278
6375
|
import * as farmDocsConfigModule from ${toVirtualEntryImportSpecifier(docsConfigModulePath)};` : ""}` : `import { createFarmDocsAPIHandler, createFarmDocsHandler, isFarmDocsAPIRequest } from "@farm.js/core/docs";` : "";
|
|
6279
|
-
const docsFontImport = _optionalChain([config, 'access',
|
|
6280
|
-
const docsRuntimeImport = _optionalChain([config, 'access',
|
|
6376
|
+
const docsFontImport = _optionalChain([config, 'access', _146 => _146.docs, 'optionalAccess', _147 => _147.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
|
|
6377
|
+
const docsRuntimeImport = _optionalChain([config, 'access', _148 => _148.docs, 'optionalAccess', _149 => _149.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
|
|
6281
6378
|
import { dirname as farmDocsDirname, join as farmDocsJoin } from "node:path";
|
|
6282
6379
|
import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
|
|
6283
|
-
const markdownHandlerImport = _optionalChain([config, 'access',
|
|
6380
|
+
const markdownHandlerImport = _optionalChain([config, 'access', _150 => _150.md, 'optionalAccess', _151 => _151.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
|
|
6284
6381
|
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;";
|
|
6285
6382
|
const markdownErrorImport = `import { FARM_MARKDOWN_CONTENT_TYPE, FARM_MARKDOWN_PAGE_CHECK_HEADER, _isFarmMarkdownPageCheck, createFarmMarkdownErrorBody, farmRequestWantsMarkdown } from "@farm.js/core/markdown";`;
|
|
6286
|
-
const mdxComponentsPath = typeof _optionalChain([config, 'access',
|
|
6383
|
+
const mdxComponentsPath = typeof _optionalChain([config, 'access', _152 => _152.mdx, 'optionalAccess', _153 => _153.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
|
|
6287
6384
|
const mdxComponentsImport = mdxComponentsPath ? `import * as FarmMdxComponentsModule from ${toVirtualEntryImportSpecifier(mdxComponentsPath)};` : "";
|
|
6288
6385
|
const layerConfigPaths = (config.layers || []).map((layer) => layer.configFile).filter((configFile) => Boolean(configFile)).filter((configFile) => configFile !== configModulePath);
|
|
6289
6386
|
const layerConfigImports = layerConfigPaths.map(
|
|
@@ -6309,7 +6406,7 @@ ${integrationRuntimeImport}
|
|
|
6309
6406
|
${nativeAuth.importSource}
|
|
6310
6407
|
${nativeMCP.importSource}
|
|
6311
6408
|
`;
|
|
6312
|
-
const imageRuntime =
|
|
6409
|
+
const imageRuntime = _chunkF42U3R4Fcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
6313
6410
|
const imageRuntimeImport = imageRuntime === "none" ? "" : `import { _withFarmImageSourceClientAddress, createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
|
|
6314
6411
|
const imageNodeRuntimeImport = imageRuntime === "node" ? `import { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } from "@farm.js/core/image/sharp";` : "";
|
|
6315
6412
|
const apiHandlerCode = apiRoutes.length > 0 ? `
|
|
@@ -6488,7 +6585,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
|
|
|
6488
6585
|
|
|
6489
6586
|
function FarmDefault404Page() {
|
|
6490
6587
|
return React.createElement(React.Fragment, null,
|
|
6491
|
-
React.createElement("style", null, ${JSON.stringify(
|
|
6588
|
+
React.createElement("style", null, ${JSON.stringify(_chunkF42U3R4Fcjs.DEFAULT_NOT_FOUND_STYLES)}),
|
|
6492
6589
|
React.createElement("main", {
|
|
6493
6590
|
className: "farm-default-not-found",
|
|
6494
6591
|
"aria-labelledby": "farm-default-not-found-title",
|
|
@@ -6621,14 +6718,14 @@ const farmImageHandler = ${imageRuntime === "none" ? "null" : imageRuntime === "
|
|
|
6621
6718
|
onError(error) { console.error("[Farm Image]", error); },
|
|
6622
6719
|
})`};
|
|
6623
6720
|
const farmMarkdownConfig = ${JSON.stringify(config.md)};
|
|
6624
|
-
const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access',
|
|
6625
|
-
${_optionalChain([config, 'access',
|
|
6721
|
+
const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _154 => _154.agent, 'optionalAccess', _155 => _155.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
|
|
6722
|
+
${_optionalChain([config, 'access', _156 => _156.agent, 'optionalAccess', _157 => _157.llmsTxt, 'optionalAccess', _158 => _158.enabled]) ? "const farmLlmsFullRenderer = createFarmLlmsFullRenderer({ revalidate: farmLlmsTxtConfig.revalidate });\n" : ""}${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
|
|
6626
6723
|
const farmMdxConfig = ${JSON.stringify({
|
|
6627
6724
|
...config.mdx,
|
|
6628
|
-
components: typeof _optionalChain([config, 'access',
|
|
6725
|
+
components: typeof _optionalChain([config, 'access', _159 => _159.mdx, 'optionalAccess', _160 => _160.components]) === "string" ? config.mdx.components : void 0
|
|
6629
6726
|
})};
|
|
6630
6727
|
const configuredFarmMdxComponents = farmUserConfig?.mdx?.components;
|
|
6631
|
-
${_optionalChain([config, 'access',
|
|
6728
|
+
${_optionalChain([config, 'access', _161 => _161.agent, 'optionalAccess', _162 => _162.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
|
|
6632
6729
|
// environment this was built in, since Netlify exposes its deploy context only
|
|
6633
6730
|
// to the build.
|
|
6634
6731
|
const farmNoindexPreview = resolveFarmPreviewDeployment(
|
|
@@ -6679,7 +6776,7 @@ export const farmProductionLifecycle = createFarmProductionLifecycle({
|
|
|
6679
6776
|
});
|
|
6680
6777
|
const farmI18nRuntime = ${config.i18n.enabled ? `createFarmI18nRuntime(farmI18nConfig, ${JSON.stringify(i18nCatalogs)})` : "null"};
|
|
6681
6778
|
${config.i18n.enabled ? "_setDefaultFarmI18nRuntime(farmI18nRuntime);" : ""}
|
|
6682
|
-
const farmDocsBundledContentDir = ${_optionalChain([config, 'access',
|
|
6779
|
+
const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _163 => _163.docs, 'optionalAccess', _164 => _164.enabled]) && !hasPrecompiledDocs ? `(() => {
|
|
6683
6780
|
try {
|
|
6684
6781
|
const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
|
|
6685
6782
|
const candidates = [
|
|
@@ -6729,7 +6826,7 @@ const farmDocsModulePreloadPaths = farmDocsModulePreloads
|
|
|
6729
6826
|
),
|
|
6730
6827
|
}
|
|
6731
6828
|
: undefined;
|
|
6732
|
-
const farmDocsHandler = ${_optionalChain([config, 'access',
|
|
6829
|
+
const farmDocsHandler = ${_optionalChain([config, 'access', _165 => _165.docs, 'optionalAccess', _166 => _166.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `createFarmDocsAdapterRuntimeHandler({
|
|
6733
6830
|
${docsConfigModulePath ? "...(farmDocsConfigModule.default || farmDocsConfigModule),\n ...farmDocsResolvedConfig.configOverrides," : "...farmDocsResolvedConfig.config,"}
|
|
6734
6831
|
entry: farmDocsResolvedConfig.config?.entry || String(farmDocsResolvedConfig.entry || "/docs").replace(/^\\/+|\\/+$/g, "") || "docs",
|
|
6735
6832
|
docsPath: farmDocsResolvedConfig.entry,
|
|
@@ -6763,10 +6860,11 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _151 => _151.docs, '
|
|
|
6763
6860
|
getApplicableLayouts(getFarmRoutePathname(pathname)).map((layout) => layout.module),
|
|
6764
6861
|
),
|
|
6765
6862
|
fontStylesheetHref: "/farm-fonts.css",
|
|
6766
|
-
|
|
6863
|
+
// The client stylesheet carries globals.css under a content-hashed name.
|
|
6864
|
+
globalStylesheetHref: ${JSON.stringify(FARM_CLIENT_CSS_HREF_PLACEHOLDER)},
|
|
6767
6865
|
isPathGuarded: isFarmDocsPathGuarded,
|
|
6768
6866
|
})` : "null"};
|
|
6769
|
-
const farmDocsAPIHandler = ${_optionalChain([config, 'access',
|
|
6867
|
+
const farmDocsAPIHandler = ${_optionalChain([config, 'access', _167 => _167.docs, 'optionalAccess', _168 => _168.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig, isPathGuarded: isFarmDocsPathGuarded })` : "null"};
|
|
6770
6868
|
|
|
6771
6869
|
// API routes bundled at build time
|
|
6772
6870
|
const apiRoutes = ${apiRoutes.length > 0 ? "mergePluginAPIRoutes(" : ""}[${apiRegistrations.join(",")}
|
|
@@ -6791,12 +6889,12 @@ function fetchFarmInnerRequest(request, context) {
|
|
|
6791
6889
|
}
|
|
6792
6890
|
const farmLocalAPIBasePath = ${JSON.stringify(_chunkB5BBTPJQcjs.resolveFarmAPIServerBasePath.call(void 0, config.api))};
|
|
6793
6891
|
const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
|
|
6794
|
-
${_optionalChain([config, 'access',
|
|
6795
|
-
` : ""}${_optionalChain([config, 'access',
|
|
6796
|
-
|
|
6892
|
+
${_optionalChain([config, 'access', _169 => _169.agent, 'optionalAccess', _170 => _170.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkJ22JD5YJcjs.resolveFarmApiCatalogInput.call(void 0, config))};
|
|
6893
|
+
` : ""}${_optionalChain([config, 'access', _171 => _171.agent, 'optionalAccess', _172 => _172.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
|
|
6894
|
+
_chunkJ22JD5YJcjs.resolveFarmAppManifestInput.call(void 0, config, {
|
|
6797
6895
|
build: config.deploymentId,
|
|
6798
|
-
packages:
|
|
6799
|
-
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ?
|
|
6896
|
+
packages: _chunkF42U3R4Fcjs.resolveFarmAppPackages.call(void 0, config.root),
|
|
6897
|
+
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkF42U3R4Fcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
|
|
6800
6898
|
})
|
|
6801
6899
|
)};
|
|
6802
6900
|
${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
@@ -7384,7 +7482,7 @@ function peelFarmDocumentPrefix(markup) {
|
|
|
7384
7482
|
let inner = markup.replace(/^\\s+/, "");
|
|
7385
7483
|
let hoisted = "";
|
|
7386
7484
|
const wrapper = /^<div\\b[^>]*style=["']display\\s*:\\s*contents;?\\s*["'][^>]*>/i;
|
|
7387
|
-
const hoistable = /${
|
|
7485
|
+
const hoistable = /${_chunk76GHW3WIcjs.HOISTED_HEAD_ELEMENT.source}/i;
|
|
7388
7486
|
let match;
|
|
7389
7487
|
while ((match = wrapper.exec(inner) || hoistable.exec(inner))) {
|
|
7390
7488
|
if (!/^<div/i.test(match[0])) hoisted += match[0];
|
|
@@ -7828,7 +7926,7 @@ async function handleMetadataImageRequest(request, routePathname) {
|
|
|
7828
7926
|
const searchParams = searchParamsToObject(url.searchParams);
|
|
7829
7927
|
const props = {
|
|
7830
7928
|
params: match.params,
|
|
7831
|
-
searchParams:
|
|
7929
|
+
searchParams: createFarmSearchParams(searchParams),
|
|
7832
7930
|
path: match.pagePath,
|
|
7833
7931
|
};
|
|
7834
7932
|
const value = typeof imageModule.default === "function"
|
|
@@ -7915,7 +8013,7 @@ function createFarmAgentRobotsResponse(request) {
|
|
|
7915
8013
|
// a route guard.
|
|
7916
8014
|
const farmAgentGuardedPages = new Set(${JSON.stringify(
|
|
7917
8015
|
pageRoutes.map((route) => route.pattern).filter(
|
|
7918
|
-
(pattern) => !pattern.includes("[") &&
|
|
8016
|
+
(pattern) => !pattern.includes("[") && _chunk76GHW3WIcjs.farmPathGuardCoversPage.call(void 0,
|
|
7919
8017
|
{
|
|
7920
8018
|
config: { middleware: config.middleware, integrations: config.integrations },
|
|
7921
8019
|
middlewareRoutes
|
|
@@ -7962,7 +8060,7 @@ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as
|
|
|
7962
8060
|
// aside for a page route that answers /mcp and for any MCP server published or
|
|
7963
8061
|
// registered at runtime, such as the docs engine's.
|
|
7964
8062
|
const farmDefaultMCPServer = ${JSON.stringify(
|
|
7965
|
-
_chunkSBABQKPTcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root),
|
|
8063
|
+
_chunkSBABQKPTcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkX5BCMLGPcjs.FARM_VERSION)
|
|
7966
8064
|
)};
|
|
7967
8065
|
let farmDefaultMCPRouteFree;
|
|
7968
8066
|
function getFarmDefaultMCPServer() {
|
|
@@ -8262,7 +8360,7 @@ function hasLocalRequestRoute(request, routePathname) {
|
|
|
8262
8360
|
if (${imageRuntime === "none" ? "false" : `pathname === ${JSON.stringify(config.images.path)}`}) {
|
|
8263
8361
|
return true;
|
|
8264
8362
|
}
|
|
8265
|
-
${_optionalChain([config, 'access',
|
|
8363
|
+
${_optionalChain([config, 'access', _173 => _173.docs, 'optionalAccess', _174 => _174.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
|
|
8266
8364
|
if (
|
|
8267
8365
|
isFarmDocsAPIRequest(pathname) ||
|
|
8268
8366
|
docsPath === "/" ||
|
|
@@ -8288,7 +8386,7 @@ function getFarmPluginRequestOptions(request) {
|
|
|
8288
8386
|
route: { ...route, pattern: normalizeRuntimePath(farmOpenAPIReference.route) },
|
|
8289
8387
|
};
|
|
8290
8388
|
}
|
|
8291
|
-
const isDocsAPIRequest = ${_optionalChain([config, 'access',
|
|
8389
|
+
const isDocsAPIRequest = ${_optionalChain([config, 'access', _175 => _175.docs, 'optionalAccess', _176 => _176.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
|
|
8292
8390
|
const integrationMatch = ${hasServerRuntimeIntegrations ? `matchIntegrationRoute(serverRuntimeIntegrations, {
|
|
8293
8391
|
pathname,
|
|
8294
8392
|
method: request.method,
|
|
@@ -8372,7 +8470,7 @@ ${hasInfraAnalyticsRuntime ? `
|
|
|
8372
8470
|
// endpoints, Markdown mirrors, and docs pages have no app route pattern, so they are
|
|
8373
8471
|
// labeled here; route.pattern keeps meaning the matched app route for plugins.
|
|
8374
8472
|
const farmBuiltInRoutePaths = new Set(${JSON.stringify(
|
|
8375
|
-
|
|
8473
|
+
_chunkJ22JD5YJcjs.listFarmBuiltInRoutePaths.call(void 0, {
|
|
8376
8474
|
agent: {
|
|
8377
8475
|
...config.agent,
|
|
8378
8476
|
aiCatalog: servesAiCatalog,
|
|
@@ -8383,9 +8481,9 @@ const farmBuiltInRoutePaths = new Set(${JSON.stringify(
|
|
|
8383
8481
|
openapi: openAPIReference
|
|
8384
8482
|
})
|
|
8385
8483
|
)});
|
|
8386
|
-
${_optionalChain([config, 'access',
|
|
8484
|
+
${_optionalChain([config, 'access', _177 => _177.docs, 'optionalAccess', _178 => _178.enabled]) ? `const farmDocsRouteLabelInput = {
|
|
8387
8485
|
path: normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs"),
|
|
8388
|
-
apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess',
|
|
8486
|
+
apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _179 => _179.apiPath]) || "/api/docs")},
|
|
8389
8487
|
};
|
|
8390
8488
|
` : ""}// The request's route payload, for a handler that learns what answered while it handles.
|
|
8391
8489
|
const farmRouteLabelSlot = Symbol("farm.route.label.slot");
|
|
@@ -8400,11 +8498,11 @@ function labelFarmRequestOptions(options) {
|
|
|
8400
8498
|
setFarmRouteLabel(options.route, mcpLabel);
|
|
8401
8499
|
return options;
|
|
8402
8500
|
}
|
|
8403
|
-
${_optionalChain([config, 'access',
|
|
8501
|
+
${_optionalChain([config, 'access', _180 => _180.docs, 'optionalAccess', _181 => _181.enabled]) ? `if (options.kind === "docs") {
|
|
8404
8502
|
setFarmRouteLabel(options.route, resolveFarmDocsRouteLabel(routePathname, farmDocsRouteLabelInput));
|
|
8405
8503
|
return options;
|
|
8406
8504
|
}` : ""}
|
|
8407
|
-
${_optionalChain([config, 'access',
|
|
8505
|
+
${_optionalChain([config, 'access', _182 => _182.md, 'optionalAccess', _183 => _183.enabled]) || hasMarkdownPages ? `const markdownLabel = resolveFarmMarkdownRouteLabel(
|
|
8408
8506
|
routePathname,
|
|
8409
8507
|
(page) => matchPageRoute(page)?.route.pattern,
|
|
8410
8508
|
);
|
|
@@ -8439,7 +8537,7 @@ function getApplicableLayouts(pathname, directory) {
|
|
|
8439
8537
|
return applicable;
|
|
8440
8538
|
}
|
|
8441
8539
|
|
|
8442
|
-
${_optionalChain([config, 'access',
|
|
8540
|
+
${_optionalChain([config, 'access', _184 => _184.docs, 'optionalAccess', _185 => _185.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
|
|
8443
8541
|
if (request.method === "HEAD") return response;
|
|
8444
8542
|
if (response.headers.get("x-farm-docs-adapter")) return response;
|
|
8445
8543
|
|
|
@@ -8547,7 +8645,7 @@ ${_optionalChain([config, 'access', _170 => _170.docs, 'optionalAccess', _171 =>
|
|
|
8547
8645
|
|
|
8548
8646
|
// Shells keep their own LRU so query-string variants never evict app cache entries.
|
|
8549
8647
|
const pprShellCache = getFarmDataCache().pprShellCache;
|
|
8550
|
-
const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access',
|
|
8648
|
+
const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _186 => _186.experimental, 'optionalAccess', _187 => _187.ppr]) === true)};
|
|
8551
8649
|
|
|
8552
8650
|
function resolveRouteRenderingView(route) {
|
|
8553
8651
|
// The same merge development uses: baked directive config under the
|
|
@@ -8679,7 +8777,7 @@ async function handleFarmRequest(request, adapterContext) {
|
|
|
8679
8777
|
},
|
|
8680
8778
|
{ redirect: !isFarmLocalAPIPathname(requestUrl.pathname) }
|
|
8681
8779
|
)` : "handleFarmRequestInContext(request, null, false, Date.now(), adapterContext, requestUrl)"};
|
|
8682
|
-
${_optionalChain([config, 'access',
|
|
8780
|
+
${_optionalChain([config, 'access', _188 => _188.md, 'optionalAccess', _189 => _189.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
|
|
8683
8781
|
if (matchPageRoute(pathname)) {
|
|
8684
8782
|
// The Link header advertises the public .md URL, like the head alternate.
|
|
8685
8783
|
return applyMarkdownNegotiationHeaders(response, {
|
|
@@ -8889,7 +8987,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
8889
8987
|
}
|
|
8890
8988
|
` : ""}
|
|
8891
8989
|
|
|
8892
|
-
${_optionalChain([config, 'access',
|
|
8990
|
+
${_optionalChain([config, 'access', _190 => _190.docs, 'optionalAccess', _191 => _191.enabled]) ? `
|
|
8893
8991
|
// Docs responses are served after app middleware so route guards and
|
|
8894
8992
|
// middleware headers apply to the docs engine like any other page content.
|
|
8895
8993
|
// An app's own llms.txt, llms-full.txt, sitemap.xml, and robots.txt take
|
|
@@ -8957,7 +9055,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
8957
9055
|
}
|
|
8958
9056
|
` : ""}
|
|
8959
9057
|
|
|
8960
|
-
${_optionalChain([config, 'access',
|
|
9058
|
+
${_optionalChain([config, 'access', _192 => _192.md, 'optionalAccess', _193 => _193.enabled]) ? `
|
|
8961
9059
|
if (farmMarkdownConfig?.enabled) {
|
|
8962
9060
|
const markdownResponse = await createMarkdownMirrorResponse({
|
|
8963
9061
|
// The mirror helper only reads metadata and creates its own GET request.
|
|
@@ -9056,11 +9154,11 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9056
9154
|
return applyProductionMiddlewareHeaders(applicationMetadataResponse, middlewareHeaders);
|
|
9057
9155
|
}
|
|
9058
9156
|
` : ""}
|
|
9059
|
-
${_optionalChain([config, 'access',
|
|
9157
|
+
${_optionalChain([config, 'access', _194 => _194.agent, 'optionalAccess', _195 => _195.manifest]) !== false ? `
|
|
9060
9158
|
// agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
|
|
9061
9159
|
// public manifest, the same document for every request.
|
|
9062
9160
|
if (
|
|
9063
|
-
[${JSON.stringify(
|
|
9161
|
+
[${JSON.stringify(_chunkJ22JD5YJcjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkJ22JD5YJcjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
|
|
9064
9162
|
normalizeRuntimePath(routePathname),
|
|
9065
9163
|
)
|
|
9066
9164
|
) {
|
|
@@ -9070,9 +9168,9 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9070
9168
|
);
|
|
9071
9169
|
}
|
|
9072
9170
|
` : ""}
|
|
9073
|
-
${_optionalChain([config, 'access',
|
|
9171
|
+
${_optionalChain([config, 'access', _196 => _196.agent, 'optionalAccess', _197 => _197.apiCatalog]) ? `
|
|
9074
9172
|
// agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
|
|
9075
|
-
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(
|
|
9173
|
+
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkJ22JD5YJcjs.FARM_API_CATALOG_PATH)}) {
|
|
9076
9174
|
return applyProductionMiddlewareHeaders(
|
|
9077
9175
|
createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
|
|
9078
9176
|
middlewareHeaders,
|
|
@@ -9097,11 +9195,11 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9097
9195
|
);
|
|
9098
9196
|
}
|
|
9099
9197
|
` : ""}
|
|
9100
|
-
${_optionalChain([config, 'access',
|
|
9198
|
+
${_optionalChain([config, 'access', _198 => _198.agent, 'optionalAccess', _199 => _199.llmsTxt, 'optionalAccess', _200 => _200.enabled]) ? `
|
|
9101
9199
|
// agent.llmsTxt with no llms.ts or llms-full.ts: serve the generated files.
|
|
9102
9200
|
const farmGeneratedLlmsKind = normalizeRuntimePath(routePathname) === "/llms.txt"
|
|
9103
9201
|
? "llms"
|
|
9104
|
-
: ${_optionalChain([config, 'access',
|
|
9202
|
+
: ${_optionalChain([config, 'access', _201 => _201.agent, 'optionalAccess', _202 => _202.llmsTxt, 'optionalAccess', _203 => _203.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
|
|
9105
9203
|
if (farmGeneratedLlmsKind) {
|
|
9106
9204
|
const llmsContext = createFarmLlmsTxtContext(request, farmGeneratedLlmsKind === "llms-full");
|
|
9107
9205
|
const llmsOrigin = new URL(request.url).origin;
|
|
@@ -9136,7 +9234,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9136
9234
|
}
|
|
9137
9235
|
` : ""}
|
|
9138
9236
|
|
|
9139
|
-
${_optionalChain([config, 'access',
|
|
9237
|
+
${_optionalChain([config, 'access', _204 => _204.docs, 'optionalAccess', _205 => _205.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
|
|
9140
9238
|
const docsAPIResponse = await farmDocsAPIHandler(cloneFarmRequestWithContext(request));
|
|
9141
9239
|
if (docsAPIResponse) {
|
|
9142
9240
|
return applyProductionMiddlewareHeaders(
|
|
@@ -9292,7 +9390,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9292
9390
|
const rawPageProps = withFarmRouteContext(
|
|
9293
9391
|
{
|
|
9294
9392
|
params,
|
|
9295
|
-
searchParams:
|
|
9393
|
+
searchParams: createFarmSearchParams(searchParamsObj),
|
|
9296
9394
|
path: pathname,
|
|
9297
9395
|
...(middlewareData?.size ? { middleware: { data: middlewareData } } : {}),
|
|
9298
9396
|
},
|
|
@@ -9333,7 +9431,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9333
9431
|
...rawPageProps,
|
|
9334
9432
|
params: parsedParams,
|
|
9335
9433
|
search: parsedSearch,
|
|
9336
|
-
searchParams:
|
|
9434
|
+
searchParams: createFarmSearchParams(parsedSearch),
|
|
9337
9435
|
};
|
|
9338
9436
|
})();
|
|
9339
9437
|
if (
|
|
@@ -9352,7 +9450,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9352
9450
|
const routeStateProps = {
|
|
9353
9451
|
...rawPageProps,
|
|
9354
9452
|
search: searchParamsObj,
|
|
9355
|
-
searchParams:
|
|
9453
|
+
searchParams: createFarmSearchParams(searchParamsObj),
|
|
9356
9454
|
error: routeStateError,
|
|
9357
9455
|
};
|
|
9358
9456
|
if (isFarmNotFoundError(routeStateError) && routeComponents?.notFound) {
|
|
@@ -9381,7 +9479,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9381
9479
|
const rawSlotProps = withFarmRouteContext(
|
|
9382
9480
|
{
|
|
9383
9481
|
params: slot.params,
|
|
9384
|
-
searchParams:
|
|
9482
|
+
searchParams: createFarmSearchParams(searchParamsObj),
|
|
9385
9483
|
path: pathname,
|
|
9386
9484
|
...(middlewareData?.size ? { middleware: { data: middlewareData } } : {}),
|
|
9387
9485
|
},
|
|
@@ -9408,7 +9506,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9408
9506
|
search: slotSchemas.search?.parse
|
|
9409
9507
|
? slotSchemas.search.parse(searchParamsObj)
|
|
9410
9508
|
: searchParamsObj,
|
|
9411
|
-
searchParams:
|
|
9509
|
+
searchParams: createFarmSearchParams(
|
|
9412
9510
|
slotSchemas.search?.parse
|
|
9413
9511
|
? slotSchemas.search.parse(searchParamsObj)
|
|
9414
9512
|
: searchParamsObj,
|
|
@@ -9672,7 +9770,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9672
9770
|
);
|
|
9673
9771
|
}
|
|
9674
9772
|
}
|
|
9675
|
-
${_optionalChain([config, 'access',
|
|
9773
|
+
${_optionalChain([config, 'access', _206 => _206.md, 'optionalAccess', _207 => _207.enabled]) ? `
|
|
9676
9774
|
// Advertise the Markdown mirror in the head as well as the Link header,
|
|
9677
9775
|
// using the public path the .md request will be resolved against.
|
|
9678
9776
|
mergedMetadata = addMetadataMarkdownAlternate(
|
|
@@ -9691,7 +9789,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9691
9789
|
emitFarmEvent({ type: "cache.bypass", route: pathname, reason: "request-read" });
|
|
9692
9790
|
}
|
|
9693
9791
|
|
|
9694
|
-
const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access',
|
|
9792
|
+
const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _208 => _208.agent, 'optionalAccess', _209 => _209.jsonLd]), () => ( false)))} });
|
|
9695
9793
|
const title = renderedMetadata.title;
|
|
9696
9794
|
const metaTags = renderedMetadata.tags;
|
|
9697
9795
|
const hasFavicon = renderedMetadata.hasFavicon;
|
|
@@ -10072,7 +10170,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10072
10170
|
reset: function() {},
|
|
10073
10171
|
params,
|
|
10074
10172
|
search: searchParamsObj,
|
|
10075
|
-
searchParams:
|
|
10173
|
+
searchParams: createFarmSearchParams(searchParamsObj),
|
|
10076
10174
|
path: pathname,
|
|
10077
10175
|
...(middlewareData?.size ? { middleware: { data: middlewareData } } : {}),
|
|
10078
10176
|
});
|
|
@@ -10381,11 +10479,11 @@ ${generatePreloadResponseRuntimeSource()}
|
|
|
10381
10479
|
export async function fetch(request, context) {${imageRuntime === "none" ? "" : `
|
|
10382
10480
|
// The image optimizer's fetch of a local source is not a loopback visitor.
|
|
10383
10481
|
context = _withFarmImageSourceClientAddress(request, context);`}
|
|
10384
|
-
${_optionalChain([config, 'access',
|
|
10482
|
+
${_optionalChain([config, 'access', _210 => _210.agent, 'optionalAccess', _211 => _211.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
|
|
10385
10483
|
basePath: farmLocalAPIBasePath,
|
|
10386
10484
|
dispatch: async (localRequest) =>
|
|
10387
10485
|
(await handleAPIRequest(localRequest)) ?? Response.json({ error: "Not Found" }, { status: 404 }),
|
|
10388
|
-
}, () => handleFarmFetch(request, context));${_optionalChain([config, 'access',
|
|
10486
|
+
}, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _212 => _212.agent, 'optionalAccess', _213 => _213.noindexPreviews]) ? `
|
|
10389
10487
|
// Keep every response of a preview deployment out of search indexes.
|
|
10390
10488
|
return farmNoindexPreview ? applyFarmPreviewRobotsTag(response) : response;` : ""}
|
|
10391
10489
|
}
|
|
@@ -10576,13 +10674,13 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
10576
10674
|
if (rewriteSources.some((source) => middlewarePatternMatches(source, pathname))) {
|
|
10577
10675
|
return "rewrite";
|
|
10578
10676
|
}
|
|
10579
|
-
if (
|
|
10580
|
-
if (
|
|
10581
|
-
if (
|
|
10677
|
+
if (_chunk76GHW3WIcjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
|
|
10678
|
+
if (_chunk76GHW3WIcjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
|
|
10679
|
+
if (_chunkO3MMJPC2cjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
|
|
10582
10680
|
if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
|
|
10583
10681
|
const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
|
|
10584
|
-
if (_optionalChain([manifestEntry, 'optionalAccess',
|
|
10585
|
-
if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access',
|
|
10682
|
+
if (_optionalChain([manifestEntry, 'optionalAccess', _214 => _214.rendering]) === "dynamic") return "dynamic runtime manifest";
|
|
10683
|
+
if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _215 => _215.regions, 'optionalAccess', _216 => _216.length])) || manifestEntry.maxDuration !== void 0)) {
|
|
10586
10684
|
return "route runtime controls";
|
|
10587
10685
|
}
|
|
10588
10686
|
const routeRule = getEffectiveRouteRule(config, pathname);
|
|
@@ -10596,9 +10694,9 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
10596
10694
|
}
|
|
10597
10695
|
function hasFarmNitroCacheRouteRule(routeRules) {
|
|
10598
10696
|
return Object.values(routeRules || {}).some((rule) => {
|
|
10599
|
-
const swr = _optionalChain([rule, 'optionalAccess',
|
|
10600
|
-
const cache = _optionalChain([rule, 'optionalAccess',
|
|
10601
|
-
const headers = _optionalChain([rule, 'optionalAccess',
|
|
10697
|
+
const swr = _optionalChain([rule, 'optionalAccess', _217 => _217.swr]);
|
|
10698
|
+
const cache = _optionalChain([rule, 'optionalAccess', _218 => _218.cache]);
|
|
10699
|
+
const headers = _optionalChain([rule, 'optionalAccess', _219 => _219.headers]);
|
|
10602
10700
|
return swr !== void 0 && swr !== false || cache !== void 0 && cache !== false || !!headers && typeof headers === "object" && Object.keys(headers).length > 0;
|
|
10603
10701
|
});
|
|
10604
10702
|
}
|
|
@@ -10611,10 +10709,10 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
10611
10709
|
const nitroBuilder = nitroBuilderResult.value;
|
|
10612
10710
|
const isVercel = preset === "vercel" || preset === "vercel-edge";
|
|
10613
10711
|
const isCloudflareWorker = preset === "cloudflare-module";
|
|
10614
|
-
const outputDir =
|
|
10712
|
+
const outputDir = _chunkO3MMJPC2cjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
10615
10713
|
const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
|
|
10616
10714
|
const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
|
|
10617
|
-
const imageRuntime =
|
|
10715
|
+
const imageRuntime = _chunkF42U3R4Fcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
10618
10716
|
const hasGeneratedMetadataImages = Array.from(routeManager.getMetadataImages().values()).some(
|
|
10619
10717
|
(image) => image.sourceType === "module"
|
|
10620
10718
|
);
|
|
@@ -10629,14 +10727,14 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
10629
10727
|
...useExternalMetadataImageRuntime ? ["@vercel/og"] : []
|
|
10630
10728
|
]);
|
|
10631
10729
|
const isPrebuiltSSRCandidate = preset === "node-server" && [...ssrExternalPackages].every((packageName) => copiedRuntimePackages.has(packageName));
|
|
10632
|
-
|
|
10633
|
-
|
|
10634
|
-
|
|
10730
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F4E6} Nitro output directory: ${outputDir}`);
|
|
10731
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F4E6} SSR entry file: ${ssrEntryFile}`);
|
|
10732
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F4E6} Preset: ${preset}`);
|
|
10635
10733
|
const ssgCollectionPromise = routeManager.collectSSGPages();
|
|
10636
10734
|
const middlewareRoutesPromise = discoverMiddlewareRoutes(_chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, config));
|
|
10637
10735
|
const configuredResponseRoutesPromise = Promise.all([config.redirects(), config.rewrites()]);
|
|
10638
|
-
const farmWorkflows = await
|
|
10639
|
-
const farmCron = await
|
|
10736
|
+
const farmWorkflows = await _chunkXB24LZWIcjs.prepareFarmWorkflowsForNitro.call(void 0, config);
|
|
10737
|
+
const farmCron = await _chunkXYL4HSVCcjs.prepareFarmCronForNitro.call(void 0, config);
|
|
10640
10738
|
const [{ ssg: ssgPages }, middlewareRoutes, [configuredRedirects, configuredRewrites]] = await Promise.all([
|
|
10641
10739
|
ssgCollectionPromise,
|
|
10642
10740
|
middlewareRoutesPromise,
|
|
@@ -10649,12 +10747,18 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
10649
10747
|
const rewriteSources = configuredRewrites.map((route) => route.source);
|
|
10650
10748
|
const prerenderRoutes = [];
|
|
10651
10749
|
const skippedPrerenderRoutes = [];
|
|
10750
|
+
const middlewareRoutesWithConfig = ssgPages.length > 0 ? await Promise.all(
|
|
10751
|
+
middlewareRoutes.map(async (route) => ({
|
|
10752
|
+
...route,
|
|
10753
|
+
config: await readMiddlewareFileConfig(route.filePath)
|
|
10754
|
+
}))
|
|
10755
|
+
) : middlewareRoutes;
|
|
10652
10756
|
for (const page of ssgPages) {
|
|
10653
10757
|
if (page.revalidate !== void 0) continue;
|
|
10654
10758
|
if (prerenderRoutes.includes(page.urlPath)) continue;
|
|
10655
10759
|
const reason = getPhysicalPrerenderBypassReason({
|
|
10656
10760
|
config,
|
|
10657
|
-
middlewareRoutes,
|
|
10761
|
+
middlewareRoutes: middlewareRoutesWithConfig,
|
|
10658
10762
|
routeRuntimeManifest,
|
|
10659
10763
|
redirectSources,
|
|
10660
10764
|
rewriteSources,
|
|
@@ -10667,21 +10771,21 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
10667
10771
|
prerenderRoutes.push(page.urlPath);
|
|
10668
10772
|
}
|
|
10669
10773
|
for (const skipped of skippedPrerenderRoutes) {
|
|
10670
|
-
|
|
10774
|
+
_chunkVQJYGZNXcjs.logger.info(`\u21AA Keeping SSG route ${skipped.pathname} server-handled (${skipped.reason})`);
|
|
10671
10775
|
}
|
|
10672
10776
|
if (farmWorkflows.workflows.length > 0) {
|
|
10673
|
-
|
|
10777
|
+
_chunkVQJYGZNXcjs.logger.info(`\u23F1\uFE0F Found ${farmWorkflows.workflows.length} Farm workflow task(s)`);
|
|
10674
10778
|
}
|
|
10675
10779
|
if (farmCron.jobs.length > 0) {
|
|
10676
|
-
|
|
10780
|
+
_chunkVQJYGZNXcjs.logger.info(`\u23F1\uFE0F Configured ${farmCron.jobs.length} Farm cron route(s)`);
|
|
10677
10781
|
}
|
|
10678
10782
|
if (preset === "cloudflare-pages" && farmCron.jobs.length > 0) {
|
|
10679
|
-
|
|
10783
|
+
_chunkVQJYGZNXcjs.logger.warn(
|
|
10680
10784
|
"Cloudflare Pages does not install Cron Triggers. Use the cloudflare-module preset or an external scheduler with .farm/cron-manifest.json."
|
|
10681
10785
|
);
|
|
10682
10786
|
}
|
|
10683
|
-
const scheduledTasks =
|
|
10684
|
-
const cloudflareCronConfig =
|
|
10787
|
+
const scheduledTasks = _chunkXYL4HSVCcjs.mergeScheduledTasks.call(void 0, farmWorkflows.scheduledTasks, farmCron.scheduledTasks);
|
|
10788
|
+
const cloudflareCronConfig = _chunkXYL4HSVCcjs.createFarmCronCloudflareConfig.call(void 0, farmCron.jobs);
|
|
10685
10789
|
const [clientCssHref, clientJsSrc, docsModulePreloads, clientModulePreloads] = await Promise.all([
|
|
10686
10790
|
resolveHashedClientCssHref(clientOutputDir),
|
|
10687
10791
|
resolveHashedClientJsSrc(clientOutputDir),
|
|
@@ -11046,7 +11150,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
11046
11150
|
] : [],
|
|
11047
11151
|
{
|
|
11048
11152
|
route: "/**",
|
|
11049
|
-
handler:
|
|
11153
|
+
handler: _chunkVQJYGZNXcjs.toPosixPath.call(void 0, nitroEntryPath)
|
|
11050
11154
|
}
|
|
11051
11155
|
],
|
|
11052
11156
|
routeRules: {
|
|
@@ -11091,20 +11195,20 @@ function toFarmNodeResponse(request, response) {
|
|
|
11091
11195
|
snapshotSSRRebundleOptions(nitroConfig)
|
|
11092
11196
|
);
|
|
11093
11197
|
const requestedBuilder = _nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER));
|
|
11094
|
-
const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access',
|
|
11095
|
-
_optionalChain([nitroConfig, 'access',
|
|
11096
|
-
(handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess',
|
|
11198
|
+
const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _220 => _220.rollupConfig, 'optionalAccess', _221 => _221.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _222 => _222.rollupConfig, 'optionalAccess', _223 => _223.plugins])) && customRollupKeys.length === 0 && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _224 => _224.output, 'optionalAccess', _225 => _225.serverDir]) || "") === _path2.default.resolve(expectedServerDir) && Boolean(
|
|
11199
|
+
_optionalChain([nitroConfig, 'access', _226 => _226.handlers, 'optionalAccess', _227 => _227.some, 'call', _228 => _228(
|
|
11200
|
+
(handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _229 => _229.handler]) || "") === nitroEntryPath
|
|
11097
11201
|
)])
|
|
11098
11202
|
);
|
|
11099
11203
|
const selectRolldownBuilder = canReusePrebuiltSSR && requestedBuilder === void 0 && await canUseRolldownBuilder();
|
|
11100
11204
|
if (selectRolldownBuilder) nitroConfig.builder = "rolldown";
|
|
11101
11205
|
const useRolldownBuilder = canReusePrebuiltSSR && (_nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER))) === "rolldown";
|
|
11102
11206
|
const shouldMinify = nitroConfig.minify !== false;
|
|
11103
|
-
const keepServerNames = !(_optionalChain([config, 'access',
|
|
11207
|
+
const keepServerNames = !(_optionalChain([config, 'access', _230 => _230.docs, 'optionalAccess', _231 => _231.enabled]) && _optionalChain([config, 'access', _232 => _232.docs, 'access', _233 => _233.adapter, 'optionalAccess', _234 => _234.server]));
|
|
11104
11208
|
const useFarmServerMinifier = shouldMinify && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig;
|
|
11105
11209
|
const serverChunkMinifier = useFarmServerMinifier ? createServerChunkMinifyPlugin({ keepNames: keepServerNames, target: "esnext" }) : null;
|
|
11106
11210
|
if (canReusePrebuiltSSR) {
|
|
11107
|
-
const configuredRollupPlugins = _optionalChain([nitroConfig, 'access',
|
|
11211
|
+
const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _235 => _235.rollupConfig, 'optionalAccess', _236 => _236.plugins]);
|
|
11108
11212
|
nitroConfig.rollupConfig = {
|
|
11109
11213
|
...nitroConfig.rollupConfig,
|
|
11110
11214
|
plugins: [
|
|
@@ -11115,9 +11219,9 @@ function toFarmNodeResponse(request, response) {
|
|
|
11115
11219
|
}
|
|
11116
11220
|
nitroConfig.minify = useFarmServerMinifier ? false : shouldMinify;
|
|
11117
11221
|
const nitroInstance = await nitroBuilder.createNitro(nitroConfig);
|
|
11118
|
-
if (_optionalChain([config, 'access',
|
|
11222
|
+
if (_optionalChain([config, 'access', _237 => _237.md, 'optionalAccess', _238 => _238.enabled])) {
|
|
11119
11223
|
nitroInstance.hooks.hook("prerender:generate", (route) => {
|
|
11120
|
-
if (!route.contents || !_optionalChain([route, 'access',
|
|
11224
|
+
if (!route.contents || !_optionalChain([route, 'access', _239 => _239.contentType, 'optionalAccess', _240 => _240.toLowerCase, 'call', _241 => _241(), 'access', _242 => _242.includes, 'call', _243 => _243("html")])) return;
|
|
11121
11225
|
const alternatePath = _chunkWJFFPXCVcjs.getFarmMarkdownAlternatePath.call(void 0, config.md, route.route);
|
|
11122
11226
|
if (!alternatePath) return;
|
|
11123
11227
|
const routeRule = nitroInstance.options.routeRules[route.route] || {};
|
|
@@ -11138,7 +11242,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
11138
11242
|
}
|
|
11139
11243
|
if (config.security.csp && config.security.csp.nonce) {
|
|
11140
11244
|
nitroInstance.hooks.hook("prerender:generate", async (route) => {
|
|
11141
|
-
if (!route.contents || !_optionalChain([route, 'access',
|
|
11245
|
+
if (!route.contents || !_optionalChain([route, 'access', _244 => _244.contentType, 'optionalAccess', _245 => _245.toLowerCase, 'call', _246 => _246(), 'access', _247 => _247.includes, 'call', _248 => _248("html")])) return;
|
|
11142
11246
|
const staticCsp = await _chunk6JHZPB52cjs.applyFarmCspHashesToHtml.call(void 0, route.contents, config.security);
|
|
11143
11247
|
if (!staticCsp) return;
|
|
11144
11248
|
route.contents = staticCsp.html;
|
|
@@ -11212,14 +11316,14 @@ function toFarmNodeResponse(request, response) {
|
|
|
11212
11316
|
});
|
|
11213
11317
|
}
|
|
11214
11318
|
if (prerenderRoutes.length > 0) {
|
|
11215
|
-
|
|
11216
|
-
const previousPrerender = process.env[
|
|
11217
|
-
process.env[
|
|
11319
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
|
|
11320
|
+
const previousPrerender = process.env[_chunkVO6NLTV4cjs.FARM_PRERENDER_ENV];
|
|
11321
|
+
process.env[_chunkVO6NLTV4cjs.FARM_PRERENDER_ENV] = "1";
|
|
11218
11322
|
try {
|
|
11219
11323
|
await nitroBuilder.prerender(nitroInstance);
|
|
11220
11324
|
} finally {
|
|
11221
|
-
if (previousPrerender === void 0) delete process.env[
|
|
11222
|
-
else process.env[
|
|
11325
|
+
if (previousPrerender === void 0) delete process.env[_chunkVO6NLTV4cjs.FARM_PRERENDER_ENV];
|
|
11326
|
+
else process.env[_chunkVO6NLTV4cjs.FARM_PRERENDER_ENV] = previousPrerender;
|
|
11223
11327
|
}
|
|
11224
11328
|
}
|
|
11225
11329
|
const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs4, preset) : Promise.resolve(null);
|
|
@@ -11271,10 +11375,10 @@ function toFarmNodeResponse(request, response) {
|
|
|
11271
11375
|
if (failedCopy) throw failedCopy.reason;
|
|
11272
11376
|
if (canReusePrebuiltSSR) {
|
|
11273
11377
|
await registerPrebuiltSSRPackageImport(_path2.default.join(outputDir, "server"), ssrEntryFile, fs4);
|
|
11274
|
-
|
|
11378
|
+
_chunkVQJYGZNXcjs.logger.info("\u26A1 Reused Farm's prebuilt SSR bundle for the Node output");
|
|
11275
11379
|
}
|
|
11276
11380
|
if (useRolldownBuilder) {
|
|
11277
|
-
|
|
11381
|
+
_chunkVQJYGZNXcjs.logger.info("\u26A1 Built the Node adapter with Rolldown");
|
|
11278
11382
|
}
|
|
11279
11383
|
if (pluginManager) {
|
|
11280
11384
|
await pluginManager.runHookParallel("afterNitroBuild", {
|
|
@@ -11287,7 +11391,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
11287
11391
|
if (isVercel) {
|
|
11288
11392
|
await postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflows, routeRuntimeManifest);
|
|
11289
11393
|
}
|
|
11290
|
-
|
|
11394
|
+
_chunkVQJYGZNXcjs.logger.success(`\u2705 Nitro build completed with preset: ${preset}`);
|
|
11291
11395
|
}
|
|
11292
11396
|
function resolveFarmNitroOutputConfig(preset, outputDir) {
|
|
11293
11397
|
const isVercel = preset === "vercel" || preset === "vercel-edge";
|
|
@@ -11344,7 +11448,7 @@ async function moveVercelOutputPath(src, dest, fs4) {
|
|
|
11344
11448
|
await fs4.rename(src, dest);
|
|
11345
11449
|
return;
|
|
11346
11450
|
} catch (error) {
|
|
11347
|
-
const code = _optionalChain([error, 'optionalAccess',
|
|
11451
|
+
const code = _optionalChain([error, 'optionalAccess', _249 => _249.code]);
|
|
11348
11452
|
if (code !== "EPERM" && code !== "EACCES" && code !== "EXDEV" && code !== "ENOTEMPTY") {
|
|
11349
11453
|
throw error;
|
|
11350
11454
|
}
|
|
@@ -11370,7 +11474,7 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
|
|
|
11370
11474
|
try {
|
|
11371
11475
|
await moveVercelOutputPath(publicDir, staticDir, fs4);
|
|
11372
11476
|
} catch (error) {
|
|
11373
|
-
if (_optionalChain([error, 'optionalAccess',
|
|
11477
|
+
if (_optionalChain([error, 'optionalAccess', _250 => _250.code]) !== "ENOENT") throw error;
|
|
11374
11478
|
}
|
|
11375
11479
|
await copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4);
|
|
11376
11480
|
await copyPrismaClientForVercel(root, nitroFuncDir, fs4);
|
|
@@ -11387,22 +11491,22 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
|
|
|
11387
11491
|
presetRoutes: Array.isArray(vercelConfig.routes) ? vercelConfig.routes : [],
|
|
11388
11492
|
runtimeRoutes
|
|
11389
11493
|
});
|
|
11390
|
-
const vercelConfigWithWorkflowCrons =
|
|
11494
|
+
const vercelConfigWithWorkflowCrons = _chunkXB24LZWIcjs.applyFarmWorkflowVercelCrons.call(void 0,
|
|
11391
11495
|
vercelConfig,
|
|
11392
11496
|
farmWorkflows.workflows
|
|
11393
11497
|
);
|
|
11394
|
-
const vercelConfigWithCrons =
|
|
11498
|
+
const vercelConfigWithCrons = _chunkXYL4HSVCcjs.applyFarmCronVercelCrons.call(void 0,
|
|
11395
11499
|
vercelConfigWithWorkflowCrons,
|
|
11396
11500
|
config.cron.jobs
|
|
11397
11501
|
);
|
|
11398
11502
|
await fs4.writeFile(configPath, JSON.stringify(vercelConfigWithCrons, null, 2));
|
|
11399
|
-
|
|
11503
|
+
_chunkVQJYGZNXcjs.logger.info("\u2705 Post-processed Vercel output for Build Output API v3");
|
|
11400
11504
|
}
|
|
11401
11505
|
async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4) {
|
|
11402
11506
|
const docsContentDir = resolveBuildDocsContentDir(config, root);
|
|
11403
11507
|
if (!docsContentDir) return;
|
|
11404
11508
|
const bundledContentDir = _path2.default.join(nitroFuncDir, "farm-docs-content");
|
|
11405
|
-
const lastModifiedManifest =
|
|
11509
|
+
const lastModifiedManifest = _chunkIOUOGRDXcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
|
|
11406
11510
|
fallback: "now"
|
|
11407
11511
|
});
|
|
11408
11512
|
await fs4.rm(bundledContentDir, { recursive: true, force: true });
|
|
@@ -11412,11 +11516,11 @@ async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4) {
|
|
|
11412
11516
|
force: true
|
|
11413
11517
|
});
|
|
11414
11518
|
await fs4.writeFile(
|
|
11415
|
-
_path2.default.join(bundledContentDir,
|
|
11519
|
+
_path2.default.join(bundledContentDir, _chunkIOUOGRDXcjs.FARM_DOCS_LAST_MODIFIED_MANIFEST),
|
|
11416
11520
|
`${JSON.stringify(lastModifiedManifest, null, 2)}
|
|
11417
11521
|
`
|
|
11418
11522
|
);
|
|
11419
|
-
|
|
11523
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F4DA} Bundled docs content for Vercel: ${_path2.default.relative(root, docsContentDir)}`);
|
|
11420
11524
|
}
|
|
11421
11525
|
function resolveServerFunctionPlatform(preset) {
|
|
11422
11526
|
return preset === "vercel" || preset === "netlify" ? { os: "linux", cpu: "x64", libc: "glibc" } : null;
|
|
@@ -11438,7 +11542,7 @@ async function stageSharpRuntime(config, root, distDir, fs4, preset) {
|
|
|
11438
11542
|
if (!resolvePackageJson(projectRequire, "sharp")) {
|
|
11439
11543
|
try {
|
|
11440
11544
|
sharpRequire = _module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core"));
|
|
11441
|
-
} catch (
|
|
11545
|
+
} catch (e31) {
|
|
11442
11546
|
}
|
|
11443
11547
|
}
|
|
11444
11548
|
const copiedPackages = /* @__PURE__ */ new Map();
|
|
@@ -11483,7 +11587,7 @@ async function stageSharpRuntime(config, root, distDir, fs4, preset) {
|
|
|
11483
11587
|
try {
|
|
11484
11588
|
await copyPackage("sharp", sharpRequire);
|
|
11485
11589
|
if (!copiedPackages.has("sharp")) {
|
|
11486
|
-
throw new Error(`Farm image optimization requires sharp. ${
|
|
11590
|
+
throw new Error(`Farm image optimization requires sharp. ${_chunkF42U3R4Fcjs.SHARP_INSTALL_HINT}`);
|
|
11487
11591
|
}
|
|
11488
11592
|
} catch (error) {
|
|
11489
11593
|
await fs4.rm(stageDir, { recursive: true, force: true });
|
|
@@ -11510,7 +11614,7 @@ async function installStagedSharpRuntime(staged, nitroFuncDir, fs4) {
|
|
|
11510
11614
|
} finally {
|
|
11511
11615
|
await fs4.rm(staged.stageDir, { recursive: true, force: true });
|
|
11512
11616
|
}
|
|
11513
|
-
|
|
11617
|
+
_chunkVQJYGZNXcjs.logger.info(
|
|
11514
11618
|
`\u{1F5BC}\uFE0F Bundled Sharp image runtime (${Object.keys(staged.dependencies).length} packages)`
|
|
11515
11619
|
);
|
|
11516
11620
|
}
|
|
@@ -11554,7 +11658,7 @@ async function mergeStagedDirectory(sourceDir, targetDir, fs4) {
|
|
|
11554
11658
|
function assertMetadataImageRuntimeInstalled(root, metadataImageRoutes) {
|
|
11555
11659
|
const generated = metadataImageRoutes.find((image) => image.sourceType === "module");
|
|
11556
11660
|
if (!generated || resolveMetadataImageRuntimePackageJson(root)) return;
|
|
11557
|
-
const file = generated.modulePath ?
|
|
11661
|
+
const file = generated.modulePath ? _chunkVQJYGZNXcjs.toPosixPath.call(void 0, _path2.default.relative(root, generated.modulePath)) : "";
|
|
11558
11662
|
throw new Error(
|
|
11559
11663
|
`${file || "A generated metadata image"} renders with @vercel/og, which is not installed. ${_chunkKORZ6PREcjs.VERCEL_OG_INSTALL_HINT}`
|
|
11560
11664
|
);
|
|
@@ -11565,7 +11669,7 @@ function resolveMetadataImageRuntimePackageJson(root) {
|
|
|
11565
11669
|
if (packageJsonPath) return packageJsonPath;
|
|
11566
11670
|
try {
|
|
11567
11671
|
return resolvePackageJson(_module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core")), "@vercel/og");
|
|
11568
|
-
} catch (
|
|
11672
|
+
} catch (e32) {
|
|
11569
11673
|
return null;
|
|
11570
11674
|
}
|
|
11571
11675
|
}
|
|
@@ -11588,7 +11692,7 @@ async function copyMetadataImageRuntime(root, nitroFuncDir, fs4) {
|
|
|
11588
11692
|
"@vercel/og": String(packageJson.version || "0.11.1")
|
|
11589
11693
|
};
|
|
11590
11694
|
await writeNitroOutputPackage(nitroFuncDir, functionPackage, fs4);
|
|
11591
|
-
|
|
11695
|
+
_chunkVQJYGZNXcjs.logger.info("\u{1F5BC}\uFE0F Bundled generated metadata image runtime");
|
|
11592
11696
|
}
|
|
11593
11697
|
async function readNitroOutputPackage(outputDir, fs4) {
|
|
11594
11698
|
const packagePath = _path2.default.join(outputDir, "package.json");
|
|
@@ -11612,7 +11716,7 @@ function resolvePackageJson(parentRequire, packageName) {
|
|
|
11612
11716
|
const resolved = parentRequire.resolve(request);
|
|
11613
11717
|
if (resolved.endsWith(".json")) return resolved;
|
|
11614
11718
|
_nullishCoalesce(metadataModule, () => ( (metadataModule = resolved)));
|
|
11615
|
-
} catch (
|
|
11719
|
+
} catch (e33) {
|
|
11616
11720
|
}
|
|
11617
11721
|
}
|
|
11618
11722
|
try {
|
|
@@ -11623,13 +11727,13 @@ function resolvePackageJson(parentRequire, packageName) {
|
|
|
11623
11727
|
try {
|
|
11624
11728
|
const manifest = JSON.parse(_fs.readFileSync.call(void 0, candidate, "utf8"));
|
|
11625
11729
|
if (manifest.name === packageName) return candidate;
|
|
11626
|
-
} catch (
|
|
11730
|
+
} catch (e34) {
|
|
11627
11731
|
}
|
|
11628
11732
|
}
|
|
11629
11733
|
if (_path2.default.basename(directory) === "node_modules") break;
|
|
11630
11734
|
directory = _path2.default.dirname(directory);
|
|
11631
11735
|
}
|
|
11632
|
-
} catch (
|
|
11736
|
+
} catch (e35) {
|
|
11633
11737
|
}
|
|
11634
11738
|
return null;
|
|
11635
11739
|
}
|
|
@@ -11638,13 +11742,13 @@ async function copyPrismaClientForVercel(root, nitroFuncDir, fs4) {
|
|
|
11638
11742
|
let prismaClientDir;
|
|
11639
11743
|
try {
|
|
11640
11744
|
prismaClientDir = _path2.default.dirname(projectRequire.resolve("@prisma/client/default.js"));
|
|
11641
|
-
} catch (
|
|
11745
|
+
} catch (e36) {
|
|
11642
11746
|
return;
|
|
11643
11747
|
}
|
|
11644
11748
|
const generatedClientDir = _path2.default.join(prismaClientDir, "..", "..", ".prisma", "client");
|
|
11645
11749
|
try {
|
|
11646
11750
|
await fs4.access(generatedClientDir);
|
|
11647
|
-
} catch (
|
|
11751
|
+
} catch (e37) {
|
|
11648
11752
|
return;
|
|
11649
11753
|
}
|
|
11650
11754
|
const targetNodeModules = _path2.default.join(nitroFuncDir, "node_modules");
|
|
@@ -11713,7 +11817,7 @@ function createBuildTargetBaseline(config) {
|
|
|
11713
11817
|
preset,
|
|
11714
11818
|
distDir,
|
|
11715
11819
|
outputDir,
|
|
11716
|
-
outputWasDerived: outputDir ===
|
|
11820
|
+
outputWasDerived: outputDir === _chunkO3MMJPC2cjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
|
|
11717
11821
|
};
|
|
11718
11822
|
}
|
|
11719
11823
|
function resolveBuildTargets(config, options, baseline) {
|
|
@@ -11722,8 +11826,8 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
11722
11826
|
const distDir = config.distDir || ".farm";
|
|
11723
11827
|
const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
|
|
11724
11828
|
const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
|
|
11725
|
-
const deployTarget = preset === config.deploy.preset ? config.deploy.target :
|
|
11726
|
-
const outputDir = shouldRefreshDerivedOutput ?
|
|
11829
|
+
const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkO3MMJPC2cjs.getDeployTargetForPreset.call(void 0, preset);
|
|
11830
|
+
const outputDir = shouldRefreshDerivedOutput ? _chunkO3MMJPC2cjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
|
|
11727
11831
|
return {
|
|
11728
11832
|
root,
|
|
11729
11833
|
preset,
|
|
@@ -11731,7 +11835,7 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
11731
11835
|
distDir,
|
|
11732
11836
|
deployTarget,
|
|
11733
11837
|
outputDir,
|
|
11734
|
-
deployOutputDir:
|
|
11838
|
+
deployOutputDir: _chunkO3MMJPC2cjs.resolveDeployOutputPath.call(void 0, root, outputDir)
|
|
11735
11839
|
};
|
|
11736
11840
|
}
|
|
11737
11841
|
async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
@@ -11768,15 +11872,15 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
11768
11872
|
};
|
|
11769
11873
|
config = {
|
|
11770
11874
|
...config,
|
|
11771
|
-
images:
|
|
11875
|
+
images: _chunkF42U3R4Fcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
|
|
11772
11876
|
root: targets.root,
|
|
11773
11877
|
preset: targets.preset
|
|
11774
11878
|
})
|
|
11775
11879
|
};
|
|
11776
|
-
if (_optionalChain([config, 'access',
|
|
11880
|
+
if (_optionalChain([config, 'access', _251 => _251.docs, 'optionalAccess', _252 => _252.enabled])) await _chunkV3UOEWCBcjs.loadFarmDocsEngine.call(void 0, );
|
|
11777
11881
|
pluginManager.updateContext({ config });
|
|
11778
11882
|
const { root, preset, srcDir, distDir, deployOutputDir } = targets;
|
|
11779
|
-
|
|
11883
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
|
|
11780
11884
|
await pluginManager.setupPlugins();
|
|
11781
11885
|
await pluginManager.runHookParallel("beforeBundle", {
|
|
11782
11886
|
root,
|
|
@@ -11785,10 +11889,10 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
11785
11889
|
distDir,
|
|
11786
11890
|
outputDir: deployOutputDir
|
|
11787
11891
|
});
|
|
11788
|
-
|
|
11892
|
+
_chunkVQJYGZNXcjs.logger.info("\u{1F50D} Discovering routes and API endpoints...");
|
|
11789
11893
|
const productionViteResult = productionViteResultPromise ? (await productionViteResultPromise)[0] : void 0;
|
|
11790
|
-
if (_optionalChain([productionViteResult, 'optionalAccess',
|
|
11791
|
-
const productionVite = _optionalChain([productionViteResult, 'optionalAccess',
|
|
11894
|
+
if (_optionalChain([productionViteResult, 'optionalAccess', _253 => _253.status]) === "rejected") throw productionViteResult.reason;
|
|
11895
|
+
const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _254 => _254.value]);
|
|
11792
11896
|
const createViteServer = productionVite ? productionVite.createServer : (await import("vite")).createServer;
|
|
11793
11897
|
projectModuleServer = await createProjectModuleServer(
|
|
11794
11898
|
createViteServer,
|
|
@@ -11796,27 +11900,27 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
11796
11900
|
root,
|
|
11797
11901
|
rendererBuild.signal
|
|
11798
11902
|
);
|
|
11799
|
-
const farmApp =
|
|
11903
|
+
const farmApp = _chunkF42U3R4Fcjs.createFarmApp.call(void 0, config, projectModuleServer);
|
|
11800
11904
|
await farmApp.initialize();
|
|
11801
11905
|
const routeManager = farmApp.getRouteManager();
|
|
11802
11906
|
const serverRenderer = farmApp.getServerRenderer();
|
|
11803
|
-
const typeArtifacts =
|
|
11907
|
+
const typeArtifacts = _chunkY7TLL65Bcjs.generateFarmTypeArtifacts.call(void 0, {
|
|
11804
11908
|
root,
|
|
11805
11909
|
srcDir,
|
|
11806
11910
|
layers: config.layers,
|
|
11807
11911
|
plugins: config.plugins,
|
|
11808
11912
|
extraRoutes: [
|
|
11809
|
-
..._optionalChain([config, 'access',
|
|
11810
|
-
...
|
|
11913
|
+
..._optionalChain([config, 'access', _255 => _255.openapi, 'optionalAccess', _256 => _256.enabled]) && config.openapi.route ? [config.openapi.route] : [],
|
|
11914
|
+
..._chunkIOUOGRDXcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
|
|
11811
11915
|
],
|
|
11812
11916
|
suppressLintOnLink: config.suppressLintOnLink,
|
|
11813
11917
|
componentExtensions: config.renderer.componentExtensions,
|
|
11814
11918
|
i18nConfig: config.i18n
|
|
11815
11919
|
}).catch((error) => {
|
|
11816
11920
|
const message = error instanceof Error ? error.message : String(error);
|
|
11817
|
-
|
|
11921
|
+
_chunkVQJYGZNXcjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
|
|
11818
11922
|
});
|
|
11819
|
-
const apiRouteManager = new (0,
|
|
11923
|
+
const apiRouteManager = new (0, _chunkKHXAJ2KAcjs.APIRouteManager)(
|
|
11820
11924
|
_chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, config),
|
|
11821
11925
|
projectModuleServer,
|
|
11822
11926
|
{
|
|
@@ -11842,11 +11946,11 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
11842
11946
|
});
|
|
11843
11947
|
} else {
|
|
11844
11948
|
const { build: legacyViteBuild } = await import("vite");
|
|
11845
|
-
|
|
11949
|
+
_chunkVQJYGZNXcjs.logger.info("\u{1F4E6} Building client bundle...");
|
|
11846
11950
|
await buildClient2(legacyViteBuild, config, root, srcDir, _path2.default.join(root, distDir, "client"));
|
|
11847
|
-
|
|
11951
|
+
_chunkVQJYGZNXcjs.logger.info("\u{1F4E6} Building SSR bundle...");
|
|
11848
11952
|
await buildSSR(legacyViteBuild, config, root, srcDir, _path2.default.join(root, distDir, "server"));
|
|
11849
|
-
|
|
11953
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F680} Building server with Nitro (preset: ${preset})...`);
|
|
11850
11954
|
await buildNitro(
|
|
11851
11955
|
config,
|
|
11852
11956
|
routeManager,
|
|
@@ -11867,8 +11971,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
11867
11971
|
outputDir: deployOutputDir,
|
|
11868
11972
|
success: true
|
|
11869
11973
|
});
|
|
11870
|
-
|
|
11871
|
-
|
|
11974
|
+
_chunkVQJYGZNXcjs.logger.success(`\u2705 Build completed successfully! (preset: ${preset})`);
|
|
11975
|
+
_chunkVQJYGZNXcjs.logger.info(`\u{1F4C1} Output directory: ${deployOutputDir}`);
|
|
11872
11976
|
} catch (error) {
|
|
11873
11977
|
const { root, preset, distDir, deployOutputDir } = _nullishCoalesce(targets, () => ( resolveBuildTargets(config, options, targetBaseline)));
|
|
11874
11978
|
await pluginManager.runHookParallel("onError", {
|
|
@@ -11887,11 +11991,11 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
11887
11991
|
outputDir: deployOutputDir,
|
|
11888
11992
|
success: false
|
|
11889
11993
|
});
|
|
11890
|
-
|
|
11994
|
+
_chunkVQJYGZNXcjs.logger.error(`\u274C Build failed: ${error}`);
|
|
11891
11995
|
throw error;
|
|
11892
11996
|
} finally {
|
|
11893
11997
|
try {
|
|
11894
|
-
await _optionalChain([projectModuleServer, 'optionalAccess',
|
|
11998
|
+
await _optionalChain([projectModuleServer, 'optionalAccess', _257 => _257.close, 'call', _258 => _258()]);
|
|
11895
11999
|
} finally {
|
|
11896
12000
|
rendererBuild.abort();
|
|
11897
12001
|
}
|
|
@@ -11902,7 +12006,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
11902
12006
|
ssr: true,
|
|
11903
12007
|
buildLifetime
|
|
11904
12008
|
});
|
|
11905
|
-
const viteConfig =
|
|
12009
|
+
const viteConfig = _chunkF42U3R4Fcjs.mergeFarmViteConfig.call(void 0,
|
|
11906
12010
|
{
|
|
11907
12011
|
root,
|
|
11908
12012
|
appType: "custom",
|
|
@@ -11914,7 +12018,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
11914
12018
|
},
|
|
11915
12019
|
plugins: [
|
|
11916
12020
|
...rendererVitePlugins,
|
|
11917
|
-
|
|
12021
|
+
_chunkF42U3R4Fcjs.farmFontImportsPlugin.call(void 0, {
|
|
11918
12022
|
root,
|
|
11919
12023
|
basePath: config.basePath,
|
|
11920
12024
|
publicDir: config.publicDir
|
|
@@ -11926,7 +12030,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
11926
12030
|
hmr: false
|
|
11927
12031
|
},
|
|
11928
12032
|
resolve: {
|
|
11929
|
-
alias:
|
|
12033
|
+
alias: _chunkF42U3R4Fcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
11930
12034
|
dedupe: [...config.renderer.dedupe || []]
|
|
11931
12035
|
},
|
|
11932
12036
|
optimizeDeps: {
|
|
@@ -11959,10 +12063,10 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
11959
12063
|
noDiscovery: true
|
|
11960
12064
|
},
|
|
11961
12065
|
// An app or plugin that brings its own SSR environment keeps it.
|
|
11962
|
-
environments: _optionalChain([viteConfig, 'access',
|
|
12066
|
+
environments: _optionalChain([viteConfig, 'access', _259 => _259.environments, 'optionalAccess', _260 => _260.ssr, 'optionalAccess', _261 => _261.dev, 'optionalAccess', _262 => _262.createEnvironment]) ? viteConfig.environments : {
|
|
11963
12067
|
...viteConfig.environments,
|
|
11964
12068
|
ssr: {
|
|
11965
|
-
..._optionalChain([viteConfig, 'access',
|
|
12069
|
+
..._optionalChain([viteConfig, 'access', _263 => _263.environments, 'optionalAccess', _264 => _264.ssr]),
|
|
11966
12070
|
...await createFarmProjectModuleSsrEnvironment()
|
|
11967
12071
|
}
|
|
11968
12072
|
}
|
|
@@ -11970,7 +12074,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
11970
12074
|
}
|
|
11971
12075
|
async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
|
|
11972
12076
|
const { farmI18nClientBridgePlugin, farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
|
|
11973
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
12077
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-HZIBL3DW.cjs");
|
|
11974
12078
|
const pluginManager = new PluginManager2({
|
|
11975
12079
|
config,
|
|
11976
12080
|
isDev: false,
|
|
@@ -11997,7 +12101,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
|
|
|
11997
12101
|
}
|
|
11998
12102
|
async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
|
|
11999
12103
|
const { farmI18nClientBridgePlugin, farmPlugin } = await import("./vite.cjs");
|
|
12000
|
-
const { PluginManager: PluginManager2 } = await import("./plugin-
|
|
12104
|
+
const { PluginManager: PluginManager2 } = await import("./plugin-HZIBL3DW.cjs");
|
|
12001
12105
|
const pluginManager = new PluginManager2({
|
|
12002
12106
|
config,
|
|
12003
12107
|
isDev: false,
|
|
@@ -12018,7 +12122,7 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
|
|
|
12018
12122
|
define: {
|
|
12019
12123
|
__FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
|
|
12020
12124
|
__FARM_ENV__: JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, config.env)),
|
|
12021
|
-
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access',
|
|
12125
|
+
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _265 => _265.env, 'optionalAccess', _266 => _266.public]) || {})
|
|
12022
12126
|
},
|
|
12023
12127
|
plugins: [
|
|
12024
12128
|
farmI18nClientBridgePlugin(),
|
|
@@ -12038,7 +12142,7 @@ function resolveLegacyPageEntry(config, root, srcDir) {
|
|
|
12038
12142
|
}
|
|
12039
12143
|
async function buildNitro(config, routeManager, apiRouteManager, serverRenderer, preset, root, distDir, pluginManager) {
|
|
12040
12144
|
const [{ createNitroConfig }, { createNitro, build: nitroBuild }] = await Promise.all([
|
|
12041
|
-
import("./nitro-
|
|
12145
|
+
import("./nitro-CK7M4RMY.cjs"),
|
|
12042
12146
|
import("nitro/builder")
|
|
12043
12147
|
]);
|
|
12044
12148
|
let nitroConfig = await createNitroConfig(
|
|
@@ -12051,7 +12155,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
12051
12155
|
if (pluginManager) {
|
|
12052
12156
|
nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
|
|
12053
12157
|
}
|
|
12054
|
-
const outputDir =
|
|
12158
|
+
const outputDir = _chunkO3MMJPC2cjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
12055
12159
|
const serverOutputDir = _path2.default.join(outputDir, "server");
|
|
12056
12160
|
const publicOutputDir = _path2.default.join(outputDir, "public");
|
|
12057
12161
|
const { mkdir, cp } = await import("fs/promises");
|
|
@@ -12061,7 +12165,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
12061
12165
|
try {
|
|
12062
12166
|
await mkdir(publicOutputDir, { recursive: true });
|
|
12063
12167
|
await cp(clientDir, publicOutputDir, { recursive: true });
|
|
12064
|
-
|
|
12168
|
+
_chunkVQJYGZNXcjs.logger.info("\u{1F4E6} Copied client assets to public directory");
|
|
12065
12169
|
const manifestPath = _path2.default.join(publicOutputDir, "farm-client-manifest.json");
|
|
12066
12170
|
const assetsDir = _path2.default.join(publicOutputDir, "assets");
|
|
12067
12171
|
const manifestExists = await import("fs/promises").then(
|
|
@@ -12071,12 +12175,12 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
12071
12175
|
(fs4) => fs4.access(assetsDir).then(() => true).catch(() => false)
|
|
12072
12176
|
);
|
|
12073
12177
|
if (manifestExists && assetsExist) {
|
|
12074
|
-
|
|
12178
|
+
_chunkVQJYGZNXcjs.logger.info("\u2705 Verified client assets are present");
|
|
12075
12179
|
} else {
|
|
12076
|
-
|
|
12180
|
+
_chunkVQJYGZNXcjs.logger.warn("\u26A0\uFE0F Some client assets may be missing");
|
|
12077
12181
|
}
|
|
12078
12182
|
} catch (error) {
|
|
12079
|
-
|
|
12183
|
+
_chunkVQJYGZNXcjs.logger.error(`\u274C Failed to copy client assets: ${error}`);
|
|
12080
12184
|
throw error;
|
|
12081
12185
|
}
|
|
12082
12186
|
const serverDir = _path2.default.join(root, distDir, "server");
|
|
@@ -12084,9 +12188,9 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
12084
12188
|
try {
|
|
12085
12189
|
await mkdir(nitroServerDir, { recursive: true });
|
|
12086
12190
|
await cp(serverDir, nitroServerDir, { recursive: true });
|
|
12087
|
-
|
|
12191
|
+
_chunkVQJYGZNXcjs.logger.info("\u{1F4E6} Copied SSR bundles to Nitro server directory");
|
|
12088
12192
|
} catch (error) {
|
|
12089
|
-
|
|
12193
|
+
_chunkVQJYGZNXcjs.logger.warn(`Could not copy SSR bundles: ${error}`);
|
|
12090
12194
|
}
|
|
12091
12195
|
const nitro = await createNitro(nitroConfig);
|
|
12092
12196
|
const registryPath = _path2.default.join(root, distDir, ".nitro", "server", "farm-registry.ts");
|
|
@@ -12110,11 +12214,11 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
12110
12214
|
const { readFile } = await import("fs/promises");
|
|
12111
12215
|
const manifestContent = await readFile(clientManifestPath, "utf-8");
|
|
12112
12216
|
farmRegistry.clientManifest = JSON.parse(manifestContent);
|
|
12113
|
-
} catch (
|
|
12217
|
+
} catch (e38) {
|
|
12114
12218
|
farmRegistry.clientManifest = {};
|
|
12115
12219
|
}
|
|
12116
12220
|
} catch (error) {
|
|
12117
|
-
|
|
12221
|
+
_chunkVQJYGZNXcjs.logger.warn(`Could not populate registry: ${error}`);
|
|
12118
12222
|
}
|
|
12119
12223
|
await nitroBuild(nitro);
|
|
12120
12224
|
if (pluginManager) {
|
|
@@ -12122,7 +12226,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
12122
12226
|
root,
|
|
12123
12227
|
preset,
|
|
12124
12228
|
distDir,
|
|
12125
|
-
outputDir:
|
|
12229
|
+
outputDir: _chunkO3MMJPC2cjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
|
|
12126
12230
|
});
|
|
12127
12231
|
}
|
|
12128
12232
|
}
|