@farm.js/core 0.1.51-beta.0 → 0.1.51-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-mcp-BBMfNpsC.d.ts → agent-mcp.d-CR5Ov83o.d.ts} +1 -1
- package/dist/{agent-mcp-D44ip11f.d.mts → agent-mcp.d-Z5DuwrqW.d.mts} +1 -1
- package/dist/agent-runtime.cjs +3 -3
- package/dist/agent-runtime.d.mts +13 -13
- package/dist/agent-runtime.d.ts +13 -13
- package/dist/agent-runtime.mjs +2 -2
- package/dist/{analyzer-VKUDHNDF.cjs → analyzer-T76CN3S7.cjs} +70 -21
- package/dist/{analyzer-HOUCQR3K.mjs → analyzer-Z6TNEAET.mjs} +70 -21
- package/dist/api/client.d.mts +4 -4
- package/dist/api/client.d.ts +4 -4
- package/dist/api/route-manager.d.mts +19 -19
- package/dist/api/route-manager.d.ts +19 -19
- package/dist/api/runtime.d.mts +15 -15
- package/dist/api/runtime.d.ts +15 -15
- package/dist/{api-client-CvI5oOBE.d.ts → api-client.d-BWcqZciH.d.ts} +3 -3
- package/dist/{api-client-CFdv-Xgh.d.mts → api-client.d-CeA6tNA6.d.mts} +3 -3
- package/dist/api.cjs +3 -3
- package/dist/api.d.mts +21 -21
- package/dist/api.d.ts +21 -21
- package/dist/api.mjs +2 -2
- package/dist/{app-manifest-LzjoNPeq.d.ts → app-manifest.d-CAHkOBFa.d.mts} +1 -1
- package/dist/{app-manifest-BC6mFn5A.d.mts → app-manifest.d-DiWr_Jfx.d.ts} +1 -1
- package/dist/app-markdown.d.mts +14 -14
- package/dist/app-markdown.d.ts +14 -14
- package/dist/{app-aeD4s_mg.d.mts → app.d-BfgJCsTQ.d.mts} +12 -10
- package/dist/{app-CourU3rQ.d.ts → app.d-DmapqkbV.d.ts} +12 -10
- package/dist/{chunk-AMRK3P6W.mjs → chunk-4SSRBCBR.mjs} +233 -84
- package/dist/{chunk-PDJSL7PL.cjs → chunk-5IONBVJY.cjs} +3 -3
- package/dist/{chunk-IOUOGRDX.cjs → chunk-5N7QAGEA.cjs} +25 -6
- package/dist/{chunk-DGOLAZLV.cjs → chunk-65Y5SIBH.cjs} +1 -1
- package/dist/{chunk-ZF3GX4O7.mjs → chunk-6CYQQQGR.mjs} +1 -1
- package/dist/{chunk-QI5AQMEE.mjs → chunk-72NBDVWQ.mjs} +1 -1
- package/dist/{chunk-I2ZA5SXS.mjs → chunk-74Z5KX4A.mjs} +53 -19
- package/dist/chunk-7FVVQEVL.cjs +541 -0
- package/dist/{chunk-OD6WM3I7.mjs → chunk-AV26KHTG.mjs} +1 -1
- package/dist/chunk-C3BOESDW.mjs +541 -0
- package/dist/{chunk-WAPQWAE6.cjs → chunk-CECUDGXQ.cjs} +9 -8
- package/dist/{chunk-IUQLRTTO.mjs → chunk-CO6UYM2D.mjs} +14 -1
- package/dist/{chunk-JF5CNHHF.mjs → chunk-CTM4SPB3.mjs} +123 -8
- package/dist/{chunk-WVX3BUNJ.mjs → chunk-CZ35L6PL.mjs} +8 -1
- package/dist/{chunk-SO3T6T4I.cjs → chunk-DTU4PX7V.cjs} +408 -259
- package/dist/{chunk-YLNBWUVS.mjs → chunk-E6LTONL4.mjs} +1 -1
- package/dist/{chunk-R5P4KFPM.mjs → chunk-E73PGHSR.mjs} +8 -6
- package/dist/{chunk-4GJJ65RB.mjs → chunk-EIMK7D2D.mjs} +24 -5
- package/dist/{chunk-CY7H5KS4.cjs → chunk-EKJYE4Y7.cjs} +2 -2
- package/dist/{chunk-3HA7PP72.mjs → chunk-FM2UEKS2.mjs} +60 -13
- package/dist/{chunk-VIFPE5RG.cjs → chunk-GNJIYJMS.cjs} +81 -34
- package/dist/{chunk-X5BCMLGP.cjs → chunk-GUJTVM36.cjs} +1 -1
- package/dist/{chunk-XWC5NAHV.mjs → chunk-IBSAYAWB.mjs} +2 -2
- package/dist/{chunk-J22JD5YJ.cjs → chunk-J3LBO2O4.cjs} +9 -7
- package/dist/{chunk-J37KTQIA.cjs → chunk-NK2VWS7P.cjs} +52 -3
- package/dist/{chunk-WSY2JD7O.mjs → chunk-NN3MOPSI.mjs} +1 -1
- package/dist/{chunk-O3MMJPC2.cjs → chunk-NPQLMP7M.cjs} +124 -9
- package/dist/{chunk-QK3HBOTG.cjs → chunk-NXBHYO7S.cjs} +5 -5
- package/dist/{chunk-S5ZA2T2W.mjs → chunk-PMKUU273.mjs} +21 -7
- package/dist/{chunk-75WWOZ5C.mjs → chunk-QOSDWGKT.mjs} +1 -1
- package/dist/{chunk-VO6NLTV4.cjs → chunk-QXPSWMUD.cjs} +3 -3
- package/dist/{chunk-Y7TLL65B.cjs → chunk-UQHIWZZ6.cjs} +11 -4
- package/dist/{chunk-PPDHCRTC.mjs → chunk-VS7EHLLW.mjs} +1 -1
- package/dist/{chunk-F42U3R4F.cjs → chunk-WZW6LEHM.cjs} +55 -41
- package/dist/{chunk-USL2ANCB.cjs → chunk-X2AMN2WV.cjs} +2 -2
- package/dist/{chunk-HHFMECFO.mjs → chunk-Y2G5SJFB.mjs} +2 -1
- package/dist/{chunk-Z5MZDFX4.cjs → chunk-YIHRZBD7.cjs} +14 -1
- package/dist/{chunk-DWW3AMJX.cjs → chunk-YU42A5MA.cjs} +282 -248
- package/dist/{chunk-MMEEXMUQ.cjs → chunk-ZOWNWHK6.cjs} +2 -2
- package/dist/{chunk-C5JXCUKR.mjs → chunk-ZQ5BDNKW.mjs} +51 -2
- package/dist/client/lifecycle.d.mts +1 -1
- package/dist/client/lifecycle.d.ts +1 -1
- package/dist/{client-plugins-cqy_dQd0.d.mts → client-plugins.d-Bx3FXpqm.d.mts} +57 -15
- package/dist/{client-plugins-CFBEfVPO.d.ts → client-plugins.d-TiLbS5j4.d.ts} +57 -15
- package/dist/client-plugins.d.mts +13 -13
- package/dist/client-plugins.d.ts +13 -13
- package/dist/client.d.mts +24 -24
- package/dist/client.d.ts +24 -24
- package/dist/{config-CnhyvvmT.d.mts → config.d-iRPI16ku.d.mts} +6 -2
- package/dist/{config-CnhyvvmT.d.ts → config.d-iRPI16ku.d.ts} +6 -2
- package/dist/config.d.mts +13 -13
- package/dist/config.d.ts +13 -13
- package/dist/desktop.d.mts +14 -14
- package/dist/desktop.d.ts +14 -14
- package/dist/{dev-guard-YLO5DE3H.cjs → dev-guard-2UW2KERP.cjs} +2 -2
- package/dist/{dev-guard-4PFQNXQX.mjs → dev-guard-ONNMVQUN.mjs} +1 -1
- package/dist/{devtools-4ZLMD454.cjs → devtools-6XWCZIGO.cjs} +4 -4
- package/dist/{devtools-4MLL3RAL.mjs → devtools-UQLDAOEI.mjs} +3 -3
- package/dist/docs.cjs +8 -6
- package/dist/docs.d.mts +23 -15
- package/dist/docs.d.ts +23 -15
- package/dist/docs.mjs +7 -5
- package/dist/environment/vite.cjs +2 -2
- package/dist/environment/vite.d.mts +1 -1
- package/dist/environment/vite.d.ts +1 -1
- package/dist/environment/vite.mjs +1 -1
- package/dist/{generate-route-types-TF5Wwtvz.d.mts → generate-route-types.d-BL2pq6xC.d.ts} +1 -1
- package/dist/{generate-route-types-DQP0cUzk.d.ts → generate-route-types.d-BoVDU8qX.d.mts} +1 -1
- 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.d.mts +1 -1
- package/dist/image/server.d.ts +1 -1
- package/dist/image/sharp.d.mts +1 -1
- package/dist/image/sharp.d.ts +1 -1
- package/dist/image.d.mts +1 -1
- package/dist/image.d.ts +1 -1
- package/dist/index.cjs +20 -17
- package/dist/{index-D3l4tREW.d.ts → index.d-BNNDpql4.d.ts} +2 -2
- package/dist/{index-DPUAPho_.d.mts → index.d-BqcfqJvt.d.mts} +2 -2
- package/dist/{index-BxjN_UDZ.d.ts → index.d-YxJ2AiDF.d.mts} +2 -2
- package/dist/{index-BYkNbeQV.d.mts → index.d-yueUNipJ.d.ts} +2 -2
- package/dist/index.d.mts +42 -42
- package/dist/index.d.ts +42 -42
- package/dist/index.mjs +19 -16
- package/dist/instrumentation.d.mts +2 -2
- package/dist/instrumentation.d.ts +2 -2
- package/dist/integrations.cjs +3 -3
- package/dist/integrations.d.mts +13 -13
- package/dist/integrations.d.ts +13 -13
- package/dist/integrations.mjs +2 -2
- package/dist/internal/app-markdown-runtime.d.mts +14 -14
- package/dist/internal/app-markdown-runtime.d.ts +14 -14
- package/dist/internal/build-runtime.cjs +16 -15
- package/dist/internal/build-runtime.d.mts +16 -16
- package/dist/internal/build-runtime.d.ts +16 -16
- package/dist/internal/build-runtime.mjs +15 -14
- package/dist/internal/cli-runtime.cjs +7 -7
- package/dist/internal/cli-runtime.mjs +6 -6
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.d.mts +21 -21
- package/dist/internal/client-runtime.d.ts +21 -21
- package/dist/internal/compression-runtime.d.mts +13 -13
- package/dist/internal/compression-runtime.d.ts +13 -13
- package/dist/internal/config-runtime.cjs +5 -5
- package/dist/internal/config-runtime.d.mts +29 -92
- package/dist/internal/config-runtime.d.ts +29 -92
- package/dist/internal/config-runtime.mjs +4 -4
- package/dist/internal/form-actions.d.mts +1 -1
- package/dist/internal/form-actions.d.ts +1 -1
- package/dist/internal/infra-analytics-runtime.cjs +5 -5
- package/dist/internal/infra-analytics-runtime.mjs +3 -3
- package/dist/internal/island-value-store.d.mts +1 -1
- package/dist/internal/island-value-store.d.ts +1 -1
- package/dist/internal/islands-runtime.d.mts +1 -1
- package/dist/internal/islands-runtime.d.ts +1 -1
- package/dist/internal/isolated-boundary.d.mts +2 -2
- package/dist/internal/isolated-boundary.d.ts +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 +11 -3
- package/dist/internal/production-runtime.d.mts +57 -31
- package/dist/internal/production-runtime.d.ts +57 -31
- package/dist/internal/production-runtime.mjs +10 -2
- package/dist/internal/server-tree.d.mts +1 -1
- package/dist/internal/server-tree.d.ts +1 -1
- package/dist/markdown.d.mts +13 -13
- package/dist/markdown.d.ts +13 -13
- package/dist/middleware.cjs +4 -4
- package/dist/middleware.d.mts +15 -15
- package/dist/middleware.d.ts +15 -15
- package/dist/middleware.mjs +3 -3
- package/dist/mobile.d.mts +7 -7
- package/dist/mobile.d.ts +7 -7
- package/dist/{navigation-delegate-BU4xqdnw.d.ts → navigation-delegate.d-BY1e_Xrh.d.ts} +1 -1
- package/dist/{navigation-delegate-DLhbfEN4.d.mts → navigation-delegate.d-HnDXhlyP.d.mts} +1 -1
- package/dist/navigation.d.mts +17 -17
- package/dist/navigation.d.ts +17 -17
- package/dist/observability.d.mts +1 -1
- package/dist/observability.d.ts +1 -1
- package/dist/plugin.cjs +11 -11
- package/dist/plugin.d.mts +17 -17
- package/dist/plugin.d.ts +17 -17
- package/dist/plugin.mjs +10 -10
- package/dist/{production-runtime-DLA4J5WG.d.mts → production-runtime.d-BpJUDzP8.d.mts} +3 -3
- package/dist/{production-runtime-C78A8YgK.d.ts → production-runtime.d-lMjvE9cf.d.ts} +3 -3
- package/dist/{programmatic-routes-client-NpqGBn-i.d.mts → programmatic-routes-client.d-6CGQ3TCk.d.mts} +10 -2
- package/dist/{programmatic-routes-client-CBqkNhBy.d.ts → programmatic-routes-client.d-BlFp5hv4.d.ts} +10 -2
- package/dist/query/client.d.mts +1 -1
- package/dist/query/client.d.ts +1 -1
- package/dist/query/index.d.mts +1 -1
- package/dist/query/index.d.ts +1 -1
- package/dist/query/server.d.mts +1 -1
- package/dist/query/server.d.ts +1 -1
- package/dist/{render-plan-CrqcBbnV.d.ts → render-plan.d-BH9edqKs.d.mts} +2 -2
- package/dist/{render-plan-C9sWvDTv.d.mts → render-plan.d-DhP0mTHF.d.ts} +2 -2
- package/dist/renderer-client.d.mts +19 -19
- package/dist/renderer-client.d.ts +19 -19
- package/dist/{request-BizeuqD7.d.ts → request.d-BVZrsR1v.d.ts} +1 -1
- package/dist/{request-WwB1-Uim.d.mts → request.d-DJFRdKi8.d.mts} +1 -1
- package/dist/request.d.mts +14 -14
- package/dist/request.d.ts +14 -14
- package/dist/{resolver-CJ-D9nP-.d.ts → resolver.d-BHyZgpa7.d.ts} +1 -1
- package/dist/{resolver-TDyZKgKI.d.mts → resolver.d-JnZKKsc5.d.mts} +1 -1
- package/dist/response.d-BolW0Vx_.d.mts +10 -0
- package/dist/response.d-BolW0Vx_.d.ts +10 -0
- package/dist/{route-rendering-BGhJN64l.d.ts → route-rendering.d-B00JtK_-.d.ts} +1 -1
- package/dist/{route-rendering-S6NFjnx4.d.mts → route-rendering.d-Bpmw7PED.d.mts} +1 -1
- package/dist/{route-2_yXC6gv.d.mts → route.d-BaVH3V0w.d.mts} +1 -1
- package/dist/{route-DFhZj6jN.d.ts → route.d-DBTEqifW.d.ts} +1 -1
- package/dist/{router-BUD_j2EL.d.ts → router.d-Bd1x9XxQ.d.ts} +1 -1
- package/dist/{router-BIheIy9G.d.mts → router.d-e0jQ3jQ-.d.mts} +1 -1
- package/dist/{routes-kEUsXHx3.d.mts → routes.d-Cmv8TgVq.d.mts} +91 -4
- package/dist/{routes-8PT9cl60.d.ts → routes.d-D96Dq9lz.d.ts} +91 -4
- package/dist/routes.d.mts +13 -13
- package/dist/routes.d.ts +13 -13
- package/dist/{rsc-pipeline-JRGUZBYM.cjs → rsc-pipeline-DX4OC5FN.cjs} +6 -6
- package/dist/{rsc-pipeline-OLAVIKI3.mjs → rsc-pipeline-ZQ4CTVEG.mjs} +5 -5
- package/dist/{runtime-OGCHDACZ.mjs → runtime-NPDRDV6R.mjs} +66 -17
- package/dist/{runtime-G23RSLEK.cjs → runtime-NQ3EDSA7.cjs} +75 -26
- package/dist/{runtime-CihDZ2Rn.d.mts → runtime.d-3iJAKptR.d.mts} +2 -2
- package/dist/{runtime-C4CmlOOh.d.ts → runtime.d-BtL3PCL3.d.ts} +2 -2
- package/dist/{runtime-CWP-21hP.d.ts → runtime.d-CgB3IJDq.d.mts} +4 -4
- package/dist/{runtime-CgJwe6H_.d.mts → runtime.d-D-td-RR3.d.ts} +4 -4
- package/dist/server-action-security.d.mts +1 -1
- package/dist/server-action-security.d.ts +1 -1
- package/dist/server-fn-client.d.mts +5 -5
- package/dist/server-fn-client.d.ts +5 -5
- package/dist/server-fn.d.mts +3 -3
- package/dist/server-fn.d.ts +3 -3
- package/dist/server-plugins.d.mts +14 -14
- package/dist/server-plugins.d.ts +14 -14
- package/dist/server-query-client.d.mts +5 -5
- package/dist/server-query-client.d.ts +5 -5
- package/dist/server-query.d.mts +2 -2
- package/dist/server-query.d.ts +2 -2
- package/dist/server.cjs +31 -31
- package/dist/server.d.mts +28 -29
- package/dist/server.d.ts +28 -29
- package/dist/server.mjs +13 -13
- package/dist/session-AAU7RNRO.cjs +23 -0
- package/dist/session-IGEDQ5PY.mjs +23 -0
- package/dist/{spa-router-Kytv4jSB.d.ts → spa-router.d-BWDhS0FK.d.mts} +5 -5
- package/dist/{spa-router-CVOL0Vrq.d.mts → spa-router.d-CO01mVOM.d.ts} +5 -5
- package/dist/storage.d.mts +2 -2
- package/dist/storage.d.ts +2 -2
- package/dist/testing.d.mts +14 -14
- package/dist/testing.d.ts +14 -14
- package/dist/theme/client.d.mts +1 -1
- package/dist/theme/client.d.ts +1 -1
- package/dist/theme/index.d.mts +2 -2
- package/dist/theme/index.d.ts +2 -2
- package/dist/theme/runtime.d.mts +1 -1
- package/dist/theme/runtime.d.ts +1 -1
- package/dist/theme/server.d.mts +1 -1
- package/dist/theme/server.d.ts +1 -1
- package/dist/{utils-DbyXlzaj.d.ts → utils.d-B77__yh8.d.ts} +1 -1
- package/dist/{utils-Dsa1HZ7X.d.mts → utils.d-DRDazhCA.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +11 -11
- package/dist/vite.d.mts +20 -19
- package/dist/vite.d.ts +20 -19
- package/dist/vite.mjs +10 -10
- package/dist/workflows.d.mts +1 -1
- package/dist/workflows.d.ts +1 -1
- package/package.json +5 -5
- /package/dist/{base-path-BOUV5ozD.d.mts → base-path.d-BOUV5ozD.d.mts} +0 -0
- /package/dist/{base-path-BOUV5ozD.d.ts → base-path.d-BOUV5ozD.d.ts} +0 -0
- /package/dist/{chunk-recovery-lnQFzcQP.d.mts → chunk-recovery.d-lnQFzcQP.d.mts} +0 -0
- /package/dist/{chunk-recovery-lnQFzcQP.d.ts → chunk-recovery.d-lnQFzcQP.d.ts} +0 -0
- /package/dist/{client-cache-Deoqq-nM.d.ts → client-cache.d-Deoqq-nM.d.ts} +0 -0
- /package/dist/{client-cache-di_Nasxa.d.mts → client-cache.d-di_Nasxa.d.mts} +0 -0
- /package/dist/{endpoint-BgHn0lhl.d.ts → endpoint.d-BgHn0lhl.d.ts} +0 -0
- /package/dist/{endpoint-BkMSCRf6.d.mts → endpoint.d-BkMSCRf6.d.mts} +0 -0
- /package/dist/{image-config-CeDgNyX4.d.mts → image-config.d-CeDgNyX4.d.mts} +0 -0
- /package/dist/{image-config-CeDgNyX4.d.ts → image-config.d-CeDgNyX4.d.ts} +0 -0
- /package/dist/{instrumentation-runtime-CX9Zh-16.d.mts → instrumentation-runtime.d-CX9Zh-16.d.mts} +0 -0
- /package/dist/{instrumentation-runtime-CX9Zh-16.d.ts → instrumentation-runtime.d-CX9Zh-16.d.ts} +0 -0
- /package/dist/{island-value-protocol-BRayRghM.d.mts → island-value-protocol.d-BRayRghM.d.mts} +0 -0
- /package/dist/{island-value-protocol-BRayRghM.d.ts → island-value-protocol.d-BRayRghM.d.ts} +0 -0
- /package/dist/{island-CfGru1MO.d.mts → island.d-CfGru1MO.d.mts} +0 -0
- /package/dist/{island-CfGru1MO.d.ts → island.d-CfGru1MO.d.ts} +0 -0
- /package/dist/{layers-CcS42OGR.d.mts → layers.d-CcS42OGR.d.mts} +0 -0
- /package/dist/{layers-CcS42OGR.d.ts → layers.d-CcS42OGR.d.ts} +0 -0
- /package/dist/{lifecycle-C2aLBOwu.d.mts → lifecycle.d-C2aLBOwu.d.mts} +0 -0
- /package/dist/{lifecycle-C2aLBOwu.d.ts → lifecycle.d-C2aLBOwu.d.ts} +0 -0
- /package/dist/{observability-B2363jB6.d.mts → observability.d-B2363jB6.d.mts} +0 -0
- /package/dist/{observability-B2363jB6.d.ts → observability.d-B2363jB6.d.ts} +0 -0
- /package/dist/{params-BALtrRim.d.ts → params.d-BALtrRim.d.ts} +0 -0
- /package/dist/{params-ry-lxqmy.d.mts → params.d-ry-lxqmy.d.mts} +0 -0
- /package/dist/{production-vite-BQFAlG7n.d.mts → production-vite.d-BQFAlG7n.d.mts} +0 -0
- /package/dist/{production-vite-BQFAlG7n.d.ts → production-vite.d-BQFAlG7n.d.ts} +0 -0
- /package/dist/{route-pattern-CVsVbq5n.d.mts → route-pattern.d-CVsVbq5n.d.mts} +0 -0
- /package/dist/{route-pattern-CVsVbq5n.d.ts → route-pattern.d-CVsVbq5n.d.ts} +0 -0
- /package/dist/{server-client-bridge-DKWDl5NB.d.mts → server-client-bridge.d-DKWDl5NB.d.mts} +0 -0
- /package/dist/{server-client-bridge-DKWDl5NB.d.ts → server-client-bridge.d-DKWDl5NB.d.ts} +0 -0
- /package/dist/{server-fn-error-DrcH9cc1.d.mts → server-fn-error.d-DrcH9cc1.d.mts} +0 -0
- /package/dist/{server-fn-error-DrcH9cc1.d.ts → server-fn-error.d-DrcH9cc1.d.ts} +0 -0
- /package/dist/{server-query-runtime-DXRNhX_3.d.ts → server-query-runtime.d-DXRNhX_3.d.ts} +0 -0
- /package/dist/{server-query-runtime-aP52iuL5.d.mts → server-query-runtime.d-aP52iuL5.d.mts} +0 -0
- /package/dist/{types-BnIqOn9w.d.mts → types.d-BnIqOn9w.d.mts} +0 -0
- /package/dist/{types-BnIqOn9w.d.ts → types.d-BnIqOn9w.d.ts} +0 -0
- /package/dist/{types-C41ePjvP.d.mts → types.d-C41ePjvP.d.mts} +0 -0
- /package/dist/{types-C41ePjvP.d.ts → types.d-C41ePjvP.d.ts} +0 -0
- /package/dist/{types-DQnyD3VD.d.mts → types.d-DQnyD3VD.d.mts} +0 -0
- /package/dist/{types-DQnyD3VD.d.ts → types.d-DQnyD3VD.d.ts} +0 -0
- /package/dist/{workflows-CRMzQZ3k.d.mts → workflows.d-CRMzQZ3k.d.mts} +0 -0
- /package/dist/{workflows-CRMzQZ3k.d.ts → workflows.d-CRMzQZ3k.d.ts} +0 -0
|
@@ -15,13 +15,14 @@ var _chunkVZY7MAVScjs = require('./chunk-VZY7MAVS.cjs');
|
|
|
15
15
|
var _chunkVM57CK74cjs = require('./chunk-VM57CK74.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
|
+
var _chunk7FVVQEVLcjs = require('./chunk-7FVVQEVL.cjs');
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
|
|
21
|
-
var _chunkVIFPE5RGcjs = require('./chunk-VIFPE5RG.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
+
var _chunkGNJIYJMScjs = require('./chunk-GNJIYJMS.cjs');
|
|
25
26
|
|
|
26
27
|
|
|
27
28
|
|
|
@@ -29,7 +30,11 @@ var _chunkVIFPE5RGcjs = require('./chunk-VIFPE5RG.cjs');
|
|
|
29
30
|
|
|
30
31
|
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
var _chunk5N7QAGEAcjs = require('./chunk-5N7QAGEA.cjs');
|
|
33
38
|
|
|
34
39
|
|
|
35
40
|
|
|
@@ -37,7 +42,7 @@ var _chunkIOUOGRDXcjs = require('./chunk-IOUOGRDX.cjs');
|
|
|
37
42
|
var _chunkDZZHTMWMcjs = require('./chunk-DZZHTMWM.cjs');
|
|
38
43
|
|
|
39
44
|
|
|
40
|
-
var
|
|
45
|
+
var _chunkQXPSWMUDcjs = require('./chunk-QXPSWMUD.cjs');
|
|
41
46
|
|
|
42
47
|
|
|
43
48
|
var _chunkBRWIVOV4cjs = require('./chunk-BRWIVOV4.cjs');
|
|
@@ -52,7 +57,7 @@ var _chunkV3UOEWCBcjs = require('./chunk-V3UOEWCB.cjs');
|
|
|
52
57
|
|
|
53
58
|
|
|
54
59
|
|
|
55
|
-
var
|
|
60
|
+
var _chunkNPQLMP7Mcjs = require('./chunk-NPQLMP7M.cjs');
|
|
56
61
|
|
|
57
62
|
|
|
58
63
|
|
|
@@ -84,7 +89,7 @@ var _chunkO3MMJPC2cjs = require('./chunk-O3MMJPC2.cjs');
|
|
|
84
89
|
|
|
85
90
|
|
|
86
91
|
|
|
87
|
-
var
|
|
92
|
+
var _chunkWZW6LEHMcjs = require('./chunk-WZW6LEHM.cjs');
|
|
88
93
|
|
|
89
94
|
|
|
90
95
|
var _chunkLNM57D3Hcjs = require('./chunk-LNM57D3H.cjs');
|
|
@@ -95,7 +100,7 @@ var _chunk3EEET2Q5cjs = require('./chunk-3EEET2Q5.cjs');
|
|
|
95
100
|
|
|
96
101
|
|
|
97
102
|
|
|
98
|
-
var
|
|
103
|
+
var _chunkUQHIWZZ6cjs = require('./chunk-UQHIWZZ6.cjs');
|
|
99
104
|
|
|
100
105
|
|
|
101
106
|
|
|
@@ -122,7 +127,7 @@ var _chunkSGBNF56Scjs = require('./chunk-SGBNF56S.cjs');
|
|
|
122
127
|
|
|
123
128
|
|
|
124
129
|
|
|
125
|
-
var
|
|
130
|
+
var _chunkJ3LBO2O4cjs = require('./chunk-J3LBO2O4.cjs');
|
|
126
131
|
|
|
127
132
|
|
|
128
133
|
|
|
@@ -130,7 +135,7 @@ var _chunkJ22JD5YJcjs = require('./chunk-J22JD5YJ.cjs');
|
|
|
130
135
|
var _chunkSBABQKPTcjs = require('./chunk-SBABQKPT.cjs');
|
|
131
136
|
|
|
132
137
|
|
|
133
|
-
var
|
|
138
|
+
var _chunkNK2VWS7Pcjs = require('./chunk-NK2VWS7P.cjs');
|
|
134
139
|
|
|
135
140
|
|
|
136
141
|
var _chunkJATTVAHAcjs = require('./chunk-JATTVAHA.cjs');
|
|
@@ -193,7 +198,7 @@ var _chunkJMYXO572cjs = require('./chunk-JMYXO572.cjs');
|
|
|
193
198
|
|
|
194
199
|
|
|
195
200
|
|
|
196
|
-
var
|
|
201
|
+
var _chunkCECUDGXQcjs = require('./chunk-CECUDGXQ.cjs');
|
|
197
202
|
|
|
198
203
|
|
|
199
204
|
var _chunkPFV2KPDZcjs = require('./chunk-PFV2KPDZ.cjs');
|
|
@@ -231,7 +236,7 @@ var _chunkVQJYGZNXcjs = require('./chunk-VQJYGZNX.cjs');
|
|
|
231
236
|
var _chunkB5BBTPJQcjs = require('./chunk-B5BBTPJQ.cjs');
|
|
232
237
|
|
|
233
238
|
|
|
234
|
-
var
|
|
239
|
+
var _chunkGUJTVM36cjs = require('./chunk-GUJTVM36.cjs');
|
|
235
240
|
|
|
236
241
|
|
|
237
242
|
var _chunkE552H232cjs = require('./chunk-E552H232.cjs');
|
|
@@ -338,7 +343,7 @@ function getDocsTitle(docs) {
|
|
|
338
343
|
return typeof docs.config.nav === "object" && docs.config.nav && "title" in docs.config.nav ? String(docs.config.nav.title || "Documentation") : "Documentation";
|
|
339
344
|
}
|
|
340
345
|
function loadPages(contentDir, docs) {
|
|
341
|
-
return
|
|
346
|
+
return _chunk5N7QAGEAcjs.discoverFarmDocsPages.call(void 0, contentDir, docs).map((page) => _chunk5N7QAGEAcjs.loadFarmDocsPage.call(void 0, contentDir, docs, page.slug)).filter((page) => Boolean(page)).sort((a, b) => a.href.localeCompare(b.href));
|
|
342
347
|
}
|
|
343
348
|
function findSocialImagePath(html) {
|
|
344
349
|
const match = /<meta\s+property=["']og:image["']\s+content=["']([^"']+)["']/i.exec(html) || /<meta\s+content=["']([^"']+)["']\s+property=["']og:image["']/i.exec(html);
|
|
@@ -356,14 +361,14 @@ async function addHandlerRoute(routes, pathname, handler, absolutePaths) {
|
|
|
356
361
|
return response;
|
|
357
362
|
}
|
|
358
363
|
async function compileFarmDocsManifest(docs, options) {
|
|
359
|
-
const contentDir =
|
|
364
|
+
const contentDir = _chunk5N7QAGEAcjs.resolveFarmDocsContentDir.call(void 0, docs, options);
|
|
360
365
|
const pages = loadPages(contentDir, docs);
|
|
361
366
|
const absolutePaths = [
|
|
362
367
|
_path2.default.resolve(options.root),
|
|
363
368
|
_path2.default.resolve(contentDir),
|
|
364
369
|
docs.configPath || ""
|
|
365
370
|
];
|
|
366
|
-
const handler =
|
|
371
|
+
const handler = _chunk5N7QAGEAcjs.createFarmDocsHandler.call(void 0, docs, {
|
|
367
372
|
root: options.root,
|
|
368
373
|
srcDir: options.srcDir,
|
|
369
374
|
clientEntry: options.clientEntry,
|
|
@@ -372,7 +377,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
372
377
|
globalStylesheetHref: options.globalStylesheetHref,
|
|
373
378
|
isPathGuarded: options.isPathGuarded
|
|
374
379
|
});
|
|
375
|
-
const apiHandler =
|
|
380
|
+
const apiHandler = _chunkGNJIYJMScjs.createFarmDocsAPIHandler.call(void 0, {
|
|
376
381
|
rootDir: options.root,
|
|
377
382
|
srcDir: options.srcDir,
|
|
378
383
|
docs,
|
|
@@ -383,7 +388,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
383
388
|
const apiMarkdown = {};
|
|
384
389
|
for (const page of pages) {
|
|
385
390
|
const htmlResponse = await addHandlerRoute(routes, page.href, handler, absolutePaths);
|
|
386
|
-
const markdownPath =
|
|
391
|
+
const markdownPath = _chunk5N7QAGEAcjs.getFarmDocsMarkdownPath.call(void 0, page.href);
|
|
387
392
|
await addHandlerRoute(routes, markdownPath, handler, absolutePaths);
|
|
388
393
|
if (htmlResponse) {
|
|
389
394
|
const socialImagePath = findSocialImagePath(await htmlResponse.text());
|
|
@@ -467,7 +472,7 @@ async function compileFarmDocsManifest(docs, options) {
|
|
|
467
472
|
post: await compileResponse(postResponse, absolutePaths),
|
|
468
473
|
search: {
|
|
469
474
|
pages: publicPages.map((page) => ({
|
|
470
|
-
...
|
|
475
|
+
..._chunk5N7QAGEAcjs.toFarmDocsMarkdownPage.call(void 0, page),
|
|
471
476
|
sourcePath: `farm-docs:${page.slug || "index"}`
|
|
472
477
|
})),
|
|
473
478
|
search: _nullishCoalesce(searchConfig, () => ( true)),
|
|
@@ -645,7 +650,7 @@ async function createFarmRouteRuntimeManifest(options) {
|
|
|
645
650
|
const routes = [];
|
|
646
651
|
for (const [pattern, entry] of options.routeManager.getRoutes()) {
|
|
647
652
|
const routeModule = await options.routeManager.loadRouteModule(entry.modulePath);
|
|
648
|
-
const rendering = await
|
|
653
|
+
const rendering = await _chunkUQHIWZZ6cjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
|
|
649
654
|
const runtimeConfig = await options.routeManager.resolveRouteRuntimeConfig(pattern);
|
|
650
655
|
routes.push({
|
|
651
656
|
kind: "page",
|
|
@@ -1685,15 +1690,14 @@ function createServerChunkMinifyPlugin(options) {
|
|
|
1685
1690
|
function trimSlashes(value) {
|
|
1686
1691
|
return value.replace(/^\/+|\/+$/g, "");
|
|
1687
1692
|
}
|
|
1688
|
-
function resolveBuildDocsContentDir(
|
|
1689
|
-
|
|
1690
|
-
const configuredContentDir = config.docs.contentDir || config.docs.config.contentDir;
|
|
1693
|
+
function resolveBuildDocsContentDir(docs, root, srcDir) {
|
|
1694
|
+
const configuredContentDir = docs.contentDir || docs.config.contentDir;
|
|
1691
1695
|
if (typeof configuredContentDir === "string" && configuredContentDir.trim()) {
|
|
1692
1696
|
const contentDir = _path2.default.isAbsolute(configuredContentDir) ? configuredContentDir : _path2.default.join(root, configuredContentDir);
|
|
1693
1697
|
return _fs.existsSync.call(void 0, contentDir) ? contentDir : null;
|
|
1694
1698
|
}
|
|
1695
|
-
const entryDir =
|
|
1696
|
-
const appDocsDir = _path2.default.join(root,
|
|
1699
|
+
const entryDir = docs.config.entry || trimSlashes(docs.entry) || "docs";
|
|
1700
|
+
const appDocsDir = _path2.default.join(root, srcDir || "src", "app", entryDir);
|
|
1697
1701
|
if (_fs.existsSync.call(void 0, appDocsDir)) return appDocsDir;
|
|
1698
1702
|
const rootDocsDir = _path2.default.join(root, entryDir);
|
|
1699
1703
|
return _fs.existsSync.call(void 0, rootDocsDir) ? rootDocsDir : null;
|
|
@@ -1746,7 +1750,7 @@ async function findFarmConfigPath(root) {
|
|
|
1746
1750
|
}
|
|
1747
1751
|
function hasFarmServerRuntimePlugins(config) {
|
|
1748
1752
|
return (config.plugins || []).some((plugin) => {
|
|
1749
|
-
if (
|
|
1753
|
+
if (_chunkCECUDGXQcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) === false) return false;
|
|
1750
1754
|
return Boolean(
|
|
1751
1755
|
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
|
|
1752
1756
|
);
|
|
@@ -1757,7 +1761,9 @@ function hasFarmPluginRoutes(config) {
|
|
|
1757
1761
|
}
|
|
1758
1762
|
function farmServerRuntimePluginsMayHandlePath(config, pathname) {
|
|
1759
1763
|
return (config.plugins || []).some(
|
|
1760
|
-
(plugin) =>
|
|
1764
|
+
(plugin) => _chunkCECUDGXQcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && // Mobile session tokens change only bearer requests and cookie-clearing responses, which a
|
|
1765
|
+
// prerendered file never answers or sends; its endpoints live under /__farm/.
|
|
1766
|
+
plugin.name !== _chunk7FVVQEVLcjs.FARM_MOBILE_SESSION_PLUGIN && _chunk47JV57DAcjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
|
|
1761
1767
|
);
|
|
1762
1768
|
}
|
|
1763
1769
|
async function discoverMiddlewareRoutes(appDir) {
|
|
@@ -1803,7 +1809,7 @@ async function discoverMiddlewareRoutes(appDir) {
|
|
|
1803
1809
|
return Array.from(routes.values()).sort(_chunkB3GZAQSCcjs.compareMiddlewareRouteLocations).map(({ path: routePath, filePath }) => ({ path: routePath, filePath }));
|
|
1804
1810
|
}
|
|
1805
1811
|
function assertFarmDocsRuntimeSupported(config, preset) {
|
|
1806
|
-
if (!_optionalChain([config, 'access',
|
|
1812
|
+
if (!_optionalChain([config, 'access', _48 => _48.docs, 'optionalAccess', _49 => _49.enabled]) || !_optionalChain([config, 'access', _50 => _50.docs, 'access', _51 => _51.adapter, 'optionalAccess', _52 => _52.server]) || _chunkE552H232cjs.getFarmPresetRuntime.call(void 0, preset) !== "edge" || Boolean(config.docs.adapter.edgeCompiler)) {
|
|
1807
1813
|
return;
|
|
1808
1814
|
}
|
|
1809
1815
|
throw new Error(
|
|
@@ -1816,7 +1822,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
|
|
|
1816
1822
|
assertFarmDocsRuntimeSupported(config, preset);
|
|
1817
1823
|
const srcDir = config.srcDir || "src";
|
|
1818
1824
|
const distDir = config.distDir || ".farm";
|
|
1819
|
-
const deployOutputDir =
|
|
1825
|
+
const deployOutputDir = _chunkNPQLMP7Mcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
1820
1826
|
const lifecyclePluginManager = options.pluginManager;
|
|
1821
1827
|
const productionViteResultPromise = Promise.allSettled([
|
|
1822
1828
|
Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkMF3IA2AWcjs.loadFarmProductionVite.call(void 0, ))))
|
|
@@ -2027,7 +2033,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
|
|
|
2027
2033
|
_chunkVQJYGZNXcjs.logger.error(`\u274C Build failed: ${error}`);
|
|
2028
2034
|
throw error;
|
|
2029
2035
|
} finally {
|
|
2030
|
-
_optionalChain([rendererBuild, 'optionalAccess',
|
|
2036
|
+
_optionalChain([rendererBuild, 'optionalAccess', _53 => _53.abort, 'call', _54 => _54()]);
|
|
2031
2037
|
}
|
|
2032
2038
|
}
|
|
2033
2039
|
async function writeSSRAssetsToClient(bundle, outputDir) {
|
|
@@ -2072,7 +2078,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
|
|
|
2072
2078
|
}
|
|
2073
2079
|
const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
|
|
2074
2080
|
await fs4.writeFile(fontCssPath, normalizedFontCss);
|
|
2075
|
-
await fs4.writeFile(clientCssPath,
|
|
2081
|
+
await fs4.writeFile(clientCssPath, _chunkWZW6LEHMcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
|
|
2076
2082
|
}
|
|
2077
2083
|
var IncompleteClientBuildOutputError = class extends Error {
|
|
2078
2084
|
constructor(detail) {
|
|
@@ -2118,7 +2124,7 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
|
|
|
2118
2124
|
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)}`;
|
|
2119
2125
|
let plan = cache.get(key);
|
|
2120
2126
|
if (!plan) {
|
|
2121
|
-
plan =
|
|
2127
|
+
plan = _chunkWZW6LEHMcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
|
|
2122
2128
|
cache.set(key, plan);
|
|
2123
2129
|
}
|
|
2124
2130
|
return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
|
|
@@ -2135,31 +2141,31 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2135
2141
|
});
|
|
2136
2142
|
pluginManager.addPlugins(config.plugins || []);
|
|
2137
2143
|
const clientPages = [];
|
|
2138
|
-
const integrationProviders =
|
|
2144
|
+
const integrationProviders = _chunkCECUDGXQcjs.getIntegrationProviders.call(void 0, config.integrations).filter(
|
|
2139
2145
|
(provider) => provider.component || provider.type === "clerk"
|
|
2140
2146
|
);
|
|
2141
2147
|
const unsupportedIntegrationProvider = integrationProviders.find(
|
|
2142
2148
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
2143
2149
|
);
|
|
2144
|
-
if (_optionalChain([config, 'access',
|
|
2150
|
+
if (_optionalChain([config, 'access', _55 => _55.experimental, 'optionalAccess', _56 => _56.isolatedClientHydration]) === "enabled" && _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _57 => _57.experimental, 'optionalAccess', _58 => _58.serverComponents])) !== "rsc" && unsupportedIntegrationProvider) {
|
|
2145
2151
|
_chunkVQJYGZNXcjs.logger.warn(
|
|
2146
2152
|
`[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
|
|
2147
2153
|
);
|
|
2148
2154
|
}
|
|
2149
|
-
const isolatedMode =
|
|
2150
|
-
_optionalChain([config, 'access',
|
|
2155
|
+
const isolatedMode = _chunkWZW6LEHMcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
2156
|
+
_optionalChain([config, 'access', _59 => _59.experimental, 'optionalAccess', _60 => _60.isolatedClientHydration]),
|
|
2151
2157
|
{
|
|
2152
|
-
serverComponents: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
2158
|
+
serverComponents: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _61 => _61.experimental, 'optionalAccess', _62 => _62.serverComponents])) === "rsc",
|
|
2153
2159
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
2154
2160
|
}
|
|
2155
2161
|
);
|
|
2156
|
-
const planOptions =
|
|
2162
|
+
const planOptions = _chunkWZW6LEHMcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
2157
2163
|
config.renderer,
|
|
2158
2164
|
Boolean(unsupportedIntegrationProvider)
|
|
2159
2165
|
);
|
|
2160
2166
|
const pagePlanOptions = {
|
|
2161
2167
|
...planOptions,
|
|
2162
|
-
serverOwners: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
2168
|
+
serverOwners: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _63 => _63.experimental, 'optionalAccess', _64 => _64.serverComponents])) === "islands"
|
|
2163
2169
|
};
|
|
2164
2170
|
const layoutPlanOptions = {
|
|
2165
2171
|
...planOptions,
|
|
@@ -2213,15 +2219,18 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2213
2219
|
const layoutAppliesToRoute = _chunk76GHW3WIcjs.routeBoundaryCoversDirectory;
|
|
2214
2220
|
const routeDirectory = (route) => _nullishCoalesce(route.directory, () => ( route.pattern));
|
|
2215
2221
|
const adapterOwnsDocsRuntime = Boolean(
|
|
2216
|
-
_chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access',
|
|
2222
|
+
_chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _65 => _65.docs, 'optionalAccess', _66 => _66.enabled]) && _optionalChain([config, 'access', _67 => _67.docs, 'access', _68 => _68.adapter, 'optionalAccess', _69 => _69.server]) && config.docs.adapter.react
|
|
2217
2223
|
);
|
|
2218
|
-
const
|
|
2219
|
-
|
|
2220
|
-
|
|
2224
|
+
const docsEntries = _optionalChain([config, 'access', _70 => _70.docs, 'optionalAccess', _71 => _71.enabled]) ? _chunk5N7QAGEAcjs.getFarmDocsRoots.call(void 0, config.docs).map(
|
|
2225
|
+
(docsRoot) => `/${docsRoot.entry || "docs"}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/"
|
|
2226
|
+
) : [];
|
|
2227
|
+
const adapterDocsEntry = _nullishCoalesce(docsEntries[0], () => ( null));
|
|
2228
|
+
const isAdapterDocsRoute = (routePattern) => adapterOwnsDocsRuntime && docsEntries.some(
|
|
2229
|
+
(docsEntry) => docsEntry === "/" || routePattern === docsEntry || routePattern.startsWith(`${docsEntry}/`)
|
|
2221
2230
|
);
|
|
2222
|
-
const syntheticDocsEntry = _optionalChain([config, 'access',
|
|
2231
|
+
const syntheticDocsEntry = _optionalChain([config, 'access', _72 => _72.docs, 'optionalAccess', _73 => _73.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
|
|
2223
2232
|
const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
|
|
2224
|
-
const markdownPagePlan =
|
|
2233
|
+
const markdownPagePlan = _chunkWZW6LEHMcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
2225
2234
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), root),
|
|
2226
2235
|
root,
|
|
2227
2236
|
isolatedMode,
|
|
@@ -2237,7 +2246,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2237
2246
|
pagePlanOptions
|
|
2238
2247
|
)
|
|
2239
2248
|
}));
|
|
2240
|
-
|
|
2249
|
+
_chunkWZW6LEHMcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
2241
2250
|
clientLayouts.map((layout) => ({
|
|
2242
2251
|
pattern: layout.pattern,
|
|
2243
2252
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -2267,9 +2276,9 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2267
2276
|
layoutAppliesToRoute
|
|
2268
2277
|
);
|
|
2269
2278
|
for (const layout of clientLayouts) {
|
|
2270
|
-
const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) ||
|
|
2279
|
+
const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || docsEntries.some((docsEntry) => layoutAppliesToRoute(layout.pattern, docsEntry));
|
|
2271
2280
|
if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
|
|
2272
|
-
_chunkVQJYGZNXcjs.logger.warn(`\u26A0\uFE0F ${
|
|
2281
|
+
_chunkVQJYGZNXcjs.logger.warn(`\u26A0\uFE0F ${_chunkWZW6LEHMcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
|
|
2273
2282
|
}
|
|
2274
2283
|
}
|
|
2275
2284
|
if (isolatedMode === "analyze") {
|
|
@@ -2293,7 +2302,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2293
2302
|
);
|
|
2294
2303
|
if (metadata.suppressedAsyncHydration) {
|
|
2295
2304
|
_chunkVQJYGZNXcjs.logger.warn(
|
|
2296
|
-
`\u26A0\uFE0F ${
|
|
2305
|
+
`\u26A0\uFE0F ${_chunkWZW6LEHMcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
|
|
2297
2306
|
);
|
|
2298
2307
|
}
|
|
2299
2308
|
if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0) {
|
|
@@ -2318,7 +2327,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2318
2327
|
...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries || layout.serverTreeLayout).flatMap((layout) => layout.isolatedBoundaries)
|
|
2319
2328
|
],
|
|
2320
2329
|
// The server renders a server tree only below a hydrating layout.
|
|
2321
|
-
...
|
|
2330
|
+
..._chunkWZW6LEHMcjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
|
|
2322
2331
|
});
|
|
2323
2332
|
_chunkVQJYGZNXcjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
|
|
2324
2333
|
}
|
|
@@ -2354,7 +2363,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2354
2363
|
}
|
|
2355
2364
|
const clientRouteSlots = routeSlots.filter((slot) => {
|
|
2356
2365
|
try {
|
|
2357
|
-
return
|
|
2366
|
+
return _chunkWZW6LEHMcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root).shouldHydrate;
|
|
2358
2367
|
} catch (error) {
|
|
2359
2368
|
_chunkVQJYGZNXcjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
|
|
2360
2369
|
return false;
|
|
@@ -2375,18 +2384,18 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2375
2384
|
srcDir,
|
|
2376
2385
|
adapterOwnsDocsRuntime ? false : _chunkDZZHTMWMcjs.isFarmDocsSearchEnabled.call(void 0, config.docs),
|
|
2377
2386
|
adapterOwnsDocsRuntime ? void 0 : _chunkDZZHTMWMcjs.resolveFarmDocsSearchClientModule.call(void 0, root),
|
|
2378
|
-
_optionalChain([config, 'access',
|
|
2379
|
-
adapterOwnsDocsRuntime ? _optionalChain([config, 'access',
|
|
2387
|
+
_optionalChain([config, 'access', _74 => _74.docs, 'optionalAccess', _75 => _75.enabled]) ? _chunk5N7QAGEAcjs.getFarmDocsRoots.call(void 0, config.docs).map((docsRoot) => docsRoot.entry) : void 0,
|
|
2388
|
+
adapterOwnsDocsRuntime ? _optionalChain([config, 'access', _76 => _76.docs, 'access', _77 => _77.adapter, 'optionalAccess', _78 => _78.react]) : void 0,
|
|
2380
2389
|
config.i18n,
|
|
2381
2390
|
config.plugins,
|
|
2382
2391
|
config.renderer,
|
|
2383
2392
|
config.publicRuntimeConfig,
|
|
2384
2393
|
config.trailingSlash,
|
|
2385
|
-
|
|
2394
|
+
_chunkCECUDGXQcjs.getIntegrationProviders.call(void 0, config.integrations),
|
|
2386
2395
|
config.basePath,
|
|
2387
|
-
|
|
2396
|
+
_chunkWZW6LEHMcjs.generateClientCachePersistenceCode.call(void 0, _chunkWZW6LEHMcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
|
|
2388
2397
|
adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0,
|
|
2389
|
-
_chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
2398
|
+
_chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _79 => _79.experimental, 'optionalAccess', _80 => _80.serverComponents])) === "islands"
|
|
2390
2399
|
);
|
|
2391
2400
|
await fs4.writeFile(clientEntryPath, clientHydrationCode);
|
|
2392
2401
|
const hasScopedPostcssConfig = hasProjectPostcssConfig(root);
|
|
@@ -2423,7 +2432,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2423
2432
|
outDir: outputDir,
|
|
2424
2433
|
emptyOutDir: true,
|
|
2425
2434
|
// Never public: see resolveFarmClientSourcemap.
|
|
2426
|
-
sourcemap: resolveFarmClientSourcemap(_optionalChain([config, 'access',
|
|
2435
|
+
sourcemap: resolveFarmClientSourcemap(_optionalChain([config, 'access', _81 => _81.vite, 'optionalAccess', _82 => _82.build, 'optionalAccess', _83 => _83.sourcemap])),
|
|
2427
2436
|
assetsInlineLimit: 0,
|
|
2428
2437
|
cssCodeSplit: false,
|
|
2429
2438
|
// Bundle all CSS into one file
|
|
@@ -2437,34 +2446,15 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2437
2446
|
hashCharacters: "hex",
|
|
2438
2447
|
// Use predictable name for CSS so we can reference it in SSR HTML
|
|
2439
2448
|
assetFileNames: (assetInfo) => {
|
|
2440
|
-
if (_optionalChain([assetInfo, 'access',
|
|
2449
|
+
if (_optionalChain([assetInfo, 'access', _84 => _84.name, 'optionalAccess', _85 => _85.endsWith, 'call', _86 => _86(".css")])) {
|
|
2441
2450
|
return "farm-client.css";
|
|
2442
2451
|
}
|
|
2443
2452
|
return "assets/[name]-h[hash][extname]";
|
|
2444
2453
|
}
|
|
2445
2454
|
},
|
|
2446
|
-
//
|
|
2455
|
+
// A browser cannot load a Node builtin: farmServerOnlyEntriesPlugin
|
|
2456
|
+
// resolves one to Farm's browser module for it instead.
|
|
2447
2457
|
external: (id) => {
|
|
2448
|
-
if (id.startsWith("node:") || [
|
|
2449
|
-
"path",
|
|
2450
|
-
"url",
|
|
2451
|
-
"fs",
|
|
2452
|
-
"fs/promises",
|
|
2453
|
-
"os",
|
|
2454
|
-
"crypto",
|
|
2455
|
-
"http",
|
|
2456
|
-
"https",
|
|
2457
|
-
"net",
|
|
2458
|
-
"stream",
|
|
2459
|
-
"util",
|
|
2460
|
-
"events",
|
|
2461
|
-
"child_process",
|
|
2462
|
-
"module",
|
|
2463
|
-
"tty",
|
|
2464
|
-
"dns"
|
|
2465
|
-
].includes(id)) {
|
|
2466
|
-
return true;
|
|
2467
|
-
}
|
|
2468
2458
|
if (id === "fsevents" || id.includes("fsevents") || id.endsWith(".node")) {
|
|
2469
2459
|
return true;
|
|
2470
2460
|
}
|
|
@@ -2473,7 +2463,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2473
2463
|
}
|
|
2474
2464
|
},
|
|
2475
2465
|
plugins: [
|
|
2476
|
-
|
|
2466
|
+
_chunkWZW6LEHMcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
2477
2467
|
createFarmPrivateClientSourcemapsPlugin({
|
|
2478
2468
|
outDir: _path2.default.join(_path2.default.dirname(outputDir), FARM_CLIENT_SOURCEMAPS_DIR)
|
|
2479
2469
|
}),
|
|
@@ -2498,7 +2488,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2498
2488
|
...rendererVitePlugins,
|
|
2499
2489
|
...config.vite.plugins || [],
|
|
2500
2490
|
farmServerOnlyEntriesPlugin(),
|
|
2501
|
-
|
|
2491
|
+
_chunkWZW6LEHMcjs.farmDocsClientConfigPlugin.call(void 0,
|
|
2502
2492
|
adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
|
|
2503
2493
|
),
|
|
2504
2494
|
// Plugin to redirect @farm.js/core imports to client-only exports
|
|
@@ -2552,7 +2542,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2552
2542
|
{ ...config, isolatedClientBoundaryModules, programmaticClientRoutes },
|
|
2553
2543
|
pluginManager
|
|
2554
2544
|
),
|
|
2555
|
-
|
|
2545
|
+
_chunkNK2VWS7Pcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
2556
2546
|
],
|
|
2557
2547
|
mode: "production",
|
|
2558
2548
|
css: postcssSearchPath ? {
|
|
@@ -2560,7 +2550,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2560
2550
|
} : void 0,
|
|
2561
2551
|
// Ensure React is bundled for client
|
|
2562
2552
|
resolve: {
|
|
2563
|
-
alias:
|
|
2553
|
+
alias: _chunkWZW6LEHMcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
2564
2554
|
dedupe: [...config.renderer.dedupe || []]
|
|
2565
2555
|
},
|
|
2566
2556
|
// Optimize dependencies - exclude server-side code from client bundle
|
|
@@ -2573,7 +2563,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
|
|
|
2573
2563
|
]
|
|
2574
2564
|
}
|
|
2575
2565
|
};
|
|
2576
|
-
await viteBuild(
|
|
2566
|
+
await viteBuild(_chunkWZW6LEHMcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
|
|
2577
2567
|
await mergeBuiltFontCss(outputDir);
|
|
2578
2568
|
await validateClientBuildOutput(root, srcDir, outputDir);
|
|
2579
2569
|
} finally {
|
|
@@ -2660,21 +2650,24 @@ async function fetchFarmNavigationDocument(url, headers, recover = true, signal)
|
|
|
2660
2650
|
return response;
|
|
2661
2651
|
}
|
|
2662
2652
|
|
|
2663
|
-
${streamNavigations ?
|
|
2664
|
-
|
|
2665
|
-
// Reads a streamed navigation (F-Stream) up to the end of React's shell. \`next\` then resolves
|
|
2653
|
+
${streamNavigations ? `// Reads a streamed navigation (F-Stream) up to the end of React's shell. \`next\` then resolves
|
|
2666
2654
|
// with each later flush as it ends, and null at the end; a document without a marker is all shell.
|
|
2667
|
-
|
|
2655
|
+
// The marker carries the random token the server sent in the F-Flush header, so page content
|
|
2656
|
+
// cannot forge a boundary; a response without a valid token is all shell.
|
|
2657
|
+
async function readFarmNavigationStream(body, flushToken) {
|
|
2668
2658
|
const reader = body.getReader();
|
|
2669
2659
|
const decoder = new TextDecoder();
|
|
2660
|
+
const marker = typeof flushToken === "string" && /^[0-9a-f]{32}$/.test(flushToken)
|
|
2661
|
+
? "<!--farm-flush:" + flushToken + "-->"
|
|
2662
|
+
: "";
|
|
2670
2663
|
let text = "";
|
|
2671
2664
|
let done = false;
|
|
2672
2665
|
const next = async function() {
|
|
2673
2666
|
for (;;) {
|
|
2674
|
-
const at = text.indexOf(
|
|
2667
|
+
const at = marker ? text.indexOf(marker) : -1;
|
|
2675
2668
|
if (at !== -1) {
|
|
2676
2669
|
const flush = text.slice(0, at);
|
|
2677
|
-
text = text.slice(at +
|
|
2670
|
+
text = text.slice(at + marker.length);
|
|
2678
2671
|
return flush;
|
|
2679
2672
|
}
|
|
2680
2673
|
if (done) {
|
|
@@ -3248,7 +3241,7 @@ ${streamNavigations ? ` // A streamed navigation swaps in the page's shell; its
|
|
|
3248
3241
|
}
|
|
3249
3242
|
};
|
|
3250
3243
|
${streamNavigations ? ` if (streamShell && response.body) {
|
|
3251
|
-
const streamed = await readFarmNavigationStream(response.body);
|
|
3244
|
+
const streamed = await readFarmNavigationStream(response.body, response.headers.get("F-Flush"));
|
|
3252
3245
|
if (!streamed.next) {
|
|
3253
3246
|
store(streamed.shell);
|
|
3254
3247
|
return streamed.shell;
|
|
@@ -3456,7 +3449,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
3456
3449
|
direction: {}
|
|
3457
3450
|
}, plugins = [], renderer = _chunkRD623KW4cjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false) {
|
|
3458
3451
|
const toImportPath = (targetPath) => targetPath.replace(/\\/g, "/");
|
|
3459
|
-
const clientPluginEntry =
|
|
3452
|
+
const clientPluginEntry = _chunkWZW6LEHMcjs.generateFarmClientPluginEntryCode.call(void 0,
|
|
3460
3453
|
plugins,
|
|
3461
3454
|
root,
|
|
3462
3455
|
srcDir,
|
|
@@ -3467,7 +3460,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
|
|
|
3467
3460
|
import { createRoot, hydrateRoot } from "react-dom/client";` : appSetupPath ? `import React, { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
|
|
3468
3461
|
import __farmAppSetup from ${JSON.stringify(_chunkVQJYGZNXcjs.toPosixPath.call(void 0, appSetupPath))};
|
|
3469
3462
|
__farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};`;
|
|
3470
|
-
const providerClientCode =
|
|
3463
|
+
const providerClientCode = _chunkWZW6LEHMcjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
3471
3464
|
integrationProviders,
|
|
3472
3465
|
root,
|
|
3473
3466
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
@@ -3527,8 +3520,18 @@ function isFarmLocaleDocumentChange() {
|
|
|
3527
3520
|
return false;
|
|
3528
3521
|
}
|
|
3529
3522
|
`;
|
|
3530
|
-
const
|
|
3531
|
-
const
|
|
3523
|
+
const docsEntryPaths = typeof docsEntryPath === "string" ? [docsEntryPath] : _nullishCoalesce(docsEntryPath, () => ( []));
|
|
3524
|
+
const docsNavigationRuntime = docsEntryPaths.length > 1 ? `
|
|
3525
|
+
const farmDocsEntryPaths = ${JSON.stringify(docsEntryPaths)};
|
|
3526
|
+
function isFarmDocsPath(pathname) {
|
|
3527
|
+
const routePathname = getFarmRoutePathname(pathname);
|
|
3528
|
+
const normalizedPath = routePathname.length > 1 ? routePathname.replace(/\\/+$/, "") : routePathname;
|
|
3529
|
+
return farmDocsEntryPaths.some(
|
|
3530
|
+
(entryPath) => normalizedPath === entryPath || normalizedPath.startsWith(entryPath + "/"),
|
|
3531
|
+
);
|
|
3532
|
+
}
|
|
3533
|
+
` : docsEntryPaths[0] ? `
|
|
3534
|
+
const farmDocsEntryPath = ${JSON.stringify(docsEntryPaths[0])};
|
|
3532
3535
|
function isFarmDocsPath(pathname) {
|
|
3533
3536
|
const routePathname = getFarmRoutePathname(pathname);
|
|
3534
3537
|
const normalizedPath = routePathname.length > 1 ? routePathname.replace(/\\/+$/, "") : routePathname;
|
|
@@ -4001,7 +4004,7 @@ function hasHydratableLayout(pathname) {
|
|
|
4001
4004
|
});
|
|
4002
4005
|
}
|
|
4003
4006
|
|
|
4004
|
-
${
|
|
4007
|
+
${_chunkWZW6LEHMcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
4005
4008
|
// Wrap a page element with applicable layouts
|
|
4006
4009
|
function wrapWithLayouts(pageElement, pathname, params) {
|
|
4007
4010
|
const layouts = getApplicableLayouts(pathname);
|
|
@@ -4036,7 +4039,7 @@ function createLayoutPageBoundary(route, pageElement, serverHtml) {
|
|
|
4036
4039
|
return React.createElement("div", props, pageElement);
|
|
4037
4040
|
}
|
|
4038
4041
|
let farmLastRouteState = null;
|
|
4039
|
-
${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${
|
|
4042
|
+
${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunkWZW6LEHMcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
|
|
4040
4043
|
function farmTreeLayoutsOf(pathname) {
|
|
4041
4044
|
return getApplicableLayouts(pathname).filter(function(layout) {
|
|
4042
4045
|
return layout.serverTree === true;
|
|
@@ -5262,7 +5265,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5262
5265
|
}
|
|
5263
5266
|
const middlewareRoutes = await discoverMiddlewareRoutes(appDirs);
|
|
5264
5267
|
const instrumentationPath = _chunkBRWIVOV4cjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
|
|
5265
|
-
const notFoundPath =
|
|
5268
|
+
const notFoundPath = _chunkWZW6LEHMcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
|
|
5266
5269
|
if (notFoundPath) _chunkVQJYGZNXcjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
|
|
5267
5270
|
layoutRoutes.sort((a, b) => {
|
|
5268
5271
|
const depthA = a.pattern.split("/").filter(Boolean).length;
|
|
@@ -5279,13 +5282,13 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5279
5282
|
const hasServerRuntimeIntegrations = configuredIntegrationValues.some(
|
|
5280
5283
|
(integration) => typeof integration === "object" && integration !== null && (!("serverRuntime" in integration) || integration.serverRuntime !== false)
|
|
5281
5284
|
);
|
|
5282
|
-
const hasIntegrationProviders =
|
|
5285
|
+
const hasIntegrationProviders = _chunkCECUDGXQcjs.getIntegrationProviders.call(void 0, config.integrations).some(
|
|
5283
5286
|
(provider) => provider.component || provider.type === "clerk"
|
|
5284
5287
|
);
|
|
5285
5288
|
const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
|
|
5286
|
-
const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access',
|
|
5289
|
+
const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _87 => _87.mdx, 'optionalAccess', _88 => _88.components]));
|
|
5287
5290
|
const hasMiddlewareConfig = _chunk76GHW3WIcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
5288
|
-
const hasRouteContextConfig =
|
|
5291
|
+
const hasRouteContextConfig = _chunkNPQLMP7Mcjs.hasCustomFarmRouteContext.call(void 0, config);
|
|
5289
5292
|
const hasServerRuntimePlugins = hasFarmServerRuntimePlugins(config);
|
|
5290
5293
|
const hasPluginRoutes = hasFarmPluginRoutes(config);
|
|
5291
5294
|
const hasServerCacheConfig = hasFarmServerCacheConfig(config.cache);
|
|
@@ -5295,18 +5298,18 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5295
5298
|
const hasConfiguredRuntimePlugins = Boolean(
|
|
5296
5299
|
hasRuntimeConfigModule && (config.plugins || []).length > 0
|
|
5297
5300
|
);
|
|
5298
|
-
if (
|
|
5301
|
+
if (_chunkGNJIYJMScjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
|
|
5299
5302
|
const adapterGuardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
|
|
5300
|
-
|
|
5303
|
+
_chunkGNJIYJMScjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
|
|
5301
5304
|
config.docs,
|
|
5302
5305
|
{ root, srcDir: config.srcDir },
|
|
5303
5306
|
(pathname) => adapterGuardedPaths.has(pathname)
|
|
5304
5307
|
);
|
|
5305
5308
|
}
|
|
5306
5309
|
const farmDocsCspNonceMarker = _chunk6JHZPB52cjs.createFarmCspNonce.call(void 0, config.security);
|
|
5307
|
-
const farmDocsPrecompiledManifest = _optionalChain([config, 'access',
|
|
5310
|
+
const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _89 => _89.docs, 'optionalAccess', _90 => _90.enabled]) && _chunkE552H232cjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunkHNAISJFDcjs._runWithFarmCspNonce.call(void 0,
|
|
5308
5311
|
farmDocsCspNonceMarker,
|
|
5309
|
-
async () => _optionalChain([config, 'access',
|
|
5312
|
+
async () => _optionalChain([config, 'access', _91 => _91.docs, 'access', _92 => _92.adapter, 'optionalAccess', _93 => _93.server]) ? await _chunkGNJIYJMScjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
|
|
5310
5313
|
root,
|
|
5311
5314
|
srcDir: config.srcDir,
|
|
5312
5315
|
clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
|
|
@@ -5415,7 +5418,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5415
5418
|
// Adapters can render provider scripts by serializing function source.
|
|
5416
5419
|
// keepNames injects helper calls into those functions; after Nitro
|
|
5417
5420
|
// minifies the server chunk the helper is no longer in script scope.
|
|
5418
|
-
keepNames: !(_optionalChain([config, 'access',
|
|
5421
|
+
keepNames: !(_optionalChain([config, 'access', _94 => _94.docs, 'optionalAccess', _95 => _95.enabled]) && _optionalChain([config, 'access', _96 => _96.docs, 'access', _97 => _97.adapter, 'optionalAccess', _98 => _98.server])),
|
|
5419
5422
|
jsxDev: false
|
|
5420
5423
|
},
|
|
5421
5424
|
// SSR configuration to externalize problematic modules
|
|
@@ -5465,10 +5468,10 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5465
5468
|
define: {
|
|
5466
5469
|
__FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
|
|
5467
5470
|
__FARM_ENV__: JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, config.env)),
|
|
5468
|
-
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access',
|
|
5471
|
+
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _99 => _99.env, 'optionalAccess', _100 => _100.public]) || {})
|
|
5469
5472
|
},
|
|
5470
5473
|
plugins: [
|
|
5471
|
-
|
|
5474
|
+
_chunkWZW6LEHMcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
5472
5475
|
...tailwindVitePlugin ? [tailwindVitePlugin] : [],
|
|
5473
5476
|
...rendererVitePlugins,
|
|
5474
5477
|
...config.vite.plugins || [],
|
|
@@ -5482,7 +5485,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5482
5485
|
{ ...createReactProductionModePlugin(), enforce: "pre" },
|
|
5483
5486
|
farmServerOnlyEntriesPlugin(),
|
|
5484
5487
|
farmPlugin({ ...config, isolatedClientBoundaryModules }, pluginManager),
|
|
5485
|
-
|
|
5488
|
+
_chunkNK2VWS7Pcjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
|
|
5486
5489
|
...hasRuntimeConfigModule ? [
|
|
5487
5490
|
farmStripPlatformConfigPlugin(
|
|
5488
5491
|
[
|
|
@@ -5529,7 +5532,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5529
5532
|
resolve: {
|
|
5530
5533
|
alias: [
|
|
5531
5534
|
...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
|
|
5532
|
-
...Object.entries(
|
|
5535
|
+
...Object.entries(_chunkWZW6LEHMcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
|
|
5533
5536
|
([find, replacement]) => ({ find, replacement })
|
|
5534
5537
|
)
|
|
5535
5538
|
],
|
|
@@ -5537,7 +5540,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
|
|
|
5537
5540
|
dedupe: [...config.renderer.dedupe || []]
|
|
5538
5541
|
}
|
|
5539
5542
|
};
|
|
5540
|
-
await viteBuild(
|
|
5543
|
+
await viteBuild(_chunkWZW6LEHMcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
|
|
5541
5544
|
} finally {
|
|
5542
5545
|
if (postcssConfigDir) {
|
|
5543
5546
|
try {
|
|
@@ -5573,33 +5576,56 @@ function readFarmPageLastModified(pageRoutes) {
|
|
|
5573
5576
|
return lastModified;
|
|
5574
5577
|
}
|
|
5575
5578
|
function getFarmDocsGuardedPaths(config, middlewareRoutes) {
|
|
5576
|
-
if (!_optionalChain([config, 'access',
|
|
5577
|
-
const
|
|
5578
|
-
root: config.root,
|
|
5579
|
-
srcDir: config.srcDir
|
|
5580
|
-
});
|
|
5579
|
+
if (!_optionalChain([config, 'access', _101 => _101.docs, 'optionalAccess', _102 => _102.enabled])) return [];
|
|
5580
|
+
const options = { root: config.root, srcDir: config.srcDir };
|
|
5581
5581
|
const guards = {
|
|
5582
5582
|
config: { middleware: config.middleware, integrations: config.integrations },
|
|
5583
5583
|
middlewareRoutes
|
|
5584
5584
|
};
|
|
5585
|
-
return
|
|
5585
|
+
return _chunk5N7QAGEAcjs.getFarmDocsRoots.call(void 0, config.docs).flatMap(
|
|
5586
|
+
(docsRoot) => _chunk5N7QAGEAcjs.discoverFarmDocsPages.call(void 0, _chunk5N7QAGEAcjs.resolveFarmDocsContentDir.call(void 0, docsRoot, options), docsRoot)
|
|
5587
|
+
).flatMap((page) => [page.href, _chunk5N7QAGEAcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunk76GHW3WIcjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
|
|
5586
5588
|
}
|
|
5587
5589
|
function getFarmAppOwnedDocsEnginePaths(agent, applicationMetadataRoutes) {
|
|
5588
|
-
const llmsTxt = _optionalChain([agent, 'optionalAccess',
|
|
5590
|
+
const llmsTxt = _optionalChain([agent, 'optionalAccess', _103 => _103.llmsTxt]);
|
|
5589
5591
|
const ownedByFile = (kind) => applicationMetadataRoutes.some(
|
|
5590
5592
|
(metadata) => metadata.kind === kind && metadata.pattern === "/"
|
|
5591
5593
|
);
|
|
5592
5594
|
return [
|
|
5593
|
-
..._optionalChain([llmsTxt, 'optionalAccess',
|
|
5594
|
-
..._optionalChain([llmsTxt, 'optionalAccess',
|
|
5595
|
-
..._optionalChain([agent, 'optionalAccess',
|
|
5596
|
-
..._optionalChain([agent, 'optionalAccess',
|
|
5595
|
+
..._optionalChain([llmsTxt, 'optionalAccess', _104 => _104.enabled]) || ownedByFile("llms") ? ["/llms.txt"] : [],
|
|
5596
|
+
..._optionalChain([llmsTxt, 'optionalAccess', _105 => _105.enabled]) && llmsTxt.full || ownedByFile("llms-full") ? ["/llms-full.txt"] : [],
|
|
5597
|
+
..._optionalChain([agent, 'optionalAccess', _106 => _106.sitemap, 'optionalAccess', _107 => _107.enabled]) || ownedByFile("sitemap") ? ["/sitemap.xml"] : [],
|
|
5598
|
+
..._optionalChain([agent, 'optionalAccess', _108 => _108.crawlers, 'optionalAccess', _109 => _109.enabled]) || ownedByFile("robots") ? ["/robots.txt"] : []
|
|
5597
5599
|
];
|
|
5598
5600
|
}
|
|
5601
|
+
function generateFarmDocsAdapterHandlerArguments(docs, docsConfigModulePath) {
|
|
5602
|
+
const runtimeConfig = (root) => `{
|
|
5603
|
+
${docsConfigModulePath ? `...getFarmDocsConfigModuleRoot(farmDocsConfigModule.default || farmDocsConfigModule, ${root}.entry),
|
|
5604
|
+
...${root}.configOverrides,` : `...${root}.config,`}
|
|
5605
|
+
entry: ${root}.config?.entry || String(${root}.entry || "/docs").replace(/^\\/+|\\/+$/g, "") || "docs",
|
|
5606
|
+
docsPath: ${root}.entry,
|
|
5607
|
+
contentDir: ${root}.contentDir || ${root}.config?.contentDir,
|
|
5608
|
+
}`;
|
|
5609
|
+
if (_optionalChain([docs, 'optionalAccess', _110 => _110.roots, 'optionalAccess', _111 => _111.length])) {
|
|
5610
|
+
return {
|
|
5611
|
+
factory: "createFarmDocsAdapterMultiRuntimeHandler",
|
|
5612
|
+
config: `[farmDocsResolvedConfig, ...farmDocsResolvedConfig.roots].map((farmDocsRoot) => (${runtimeConfig("farmDocsRoot")}))`
|
|
5613
|
+
};
|
|
5614
|
+
}
|
|
5615
|
+
return {
|
|
5616
|
+
factory: "createFarmDocsAdapterRuntimeHandler",
|
|
5617
|
+
config: runtimeConfig("farmDocsResolvedConfig")
|
|
5618
|
+
};
|
|
5619
|
+
}
|
|
5599
5620
|
function generateFarmDocsRuntimeConfigExpression(docs, precompiled = false) {
|
|
5600
5621
|
if (!docs.enabled) return "null";
|
|
5601
|
-
const
|
|
5622
|
+
const serializableDocs = _optionalChain([docs, 'access', _112 => _112.roots, 'optionalAccess', _113 => _113.length]) ? {
|
|
5602
5623
|
...docs,
|
|
5624
|
+
// React elements and functions do not survive JSON; see runtimeConfig below.
|
|
5625
|
+
roots: docs.roots.map((docsRoot) => ({ ...docsRoot, runtimeConfig: void 0 }))
|
|
5626
|
+
} : docs;
|
|
5627
|
+
const baseConfig = {
|
|
5628
|
+
...serializableDocs,
|
|
5603
5629
|
contentDir: void 0,
|
|
5604
5630
|
...precompiled ? { configPath: void 0 } : {},
|
|
5605
5631
|
config: void 0,
|
|
@@ -5617,7 +5643,7 @@ function generateFarmDocsRuntimeConfigExpression(docs, precompiled = false) {
|
|
|
5617
5643
|
config: nestedConfig
|
|
5618
5644
|
});
|
|
5619
5645
|
}
|
|
5620
|
-
|
|
5646
|
+
const expression = `farmDocsBundledContentDir
|
|
5621
5647
|
? {
|
|
5622
5648
|
...${JSON.stringify(baseConfig)},
|
|
5623
5649
|
contentDir: farmDocsBundledContentDir,
|
|
@@ -5626,13 +5652,25 @@ function generateFarmDocsRuntimeConfigExpression(docs, precompiled = false) {
|
|
|
5626
5652
|
contentDir: farmDocsBundledContentDir,
|
|
5627
5653
|
},
|
|
5628
5654
|
}
|
|
5629
|
-
: ${JSON.stringify({ ...
|
|
5655
|
+
: ${JSON.stringify({ ...serializableDocs, runtimeConfig: void 0 })}`;
|
|
5656
|
+
if (!_optionalChain([docs, 'access', _114 => _114.roots, 'optionalAccess', _115 => _115.length])) return expression;
|
|
5657
|
+
return `((farmDocs) => ({
|
|
5658
|
+
...farmDocs,
|
|
5659
|
+
roots: farmDocs.roots.map((farmDocsRoot, index) => {
|
|
5660
|
+
const contentDir = farmDocsBundledRootsDir
|
|
5661
|
+
? farmDocsJoin(farmDocsBundledRootsDir, String(index))
|
|
5662
|
+
: null;
|
|
5663
|
+
return contentDir && farmDocsExistsSync(contentDir)
|
|
5664
|
+
? { ...farmDocsRoot, contentDir, config: { ...farmDocsRoot.config, contentDir } }
|
|
5665
|
+
: farmDocsRoot;
|
|
5666
|
+
}),
|
|
5667
|
+
}))(${expression})`;
|
|
5630
5668
|
}
|
|
5631
5669
|
function toVirtualEntryImportSpecifier(modulePath) {
|
|
5632
5670
|
return JSON.stringify(modulePath.replace(/\\/g, "/"));
|
|
5633
5671
|
}
|
|
5634
5672
|
function generateNativeAuthIntegrationSource(auth) {
|
|
5635
|
-
if (_optionalChain([auth, 'optionalAccess',
|
|
5673
|
+
if (_optionalChain([auth, 'optionalAccess', _116 => _116.enabled]) !== true) {
|
|
5636
5674
|
return { importSource: "", registerSource: "" };
|
|
5637
5675
|
}
|
|
5638
5676
|
return {
|
|
@@ -5925,23 +5963,29 @@ if (typeof ReactDOMServer.configureApp !== "function") {
|
|
|
5925
5963
|
ReactDOMServer.configureApp(__farmAppSetup);`;
|
|
5926
5964
|
}
|
|
5927
5965
|
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) {
|
|
5928
|
-
const farmIslandsMode = _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
5966
|
+
const farmIslandsMode = _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _117 => _117.experimental, 'optionalAccess', _118 => _118.serverComponents])) === "islands";
|
|
5929
5967
|
const hasCompressionRuntime = config.compress && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
|
|
5930
|
-
const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access',
|
|
5968
|
+
const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access', _119 => _119.agent, 'optionalAccess', _120 => _120.crawlers, 'optionalAccess', _121 => _121.enabled])) && !applicationMetadataRoutes.some(
|
|
5931
5969
|
(metadata) => metadata.kind === "robots" && metadata.pattern === "/"
|
|
5932
5970
|
);
|
|
5933
|
-
const servesAgentSitemap = Boolean(_optionalChain([config, 'access',
|
|
5971
|
+
const servesAgentSitemap = Boolean(_optionalChain([config, 'access', _122 => _122.agent, 'optionalAccess', _123 => _123.sitemap, 'optionalAccess', _124 => _124.enabled])) && !applicationMetadataRoutes.some(
|
|
5934
5972
|
(metadata) => metadata.kind === "sitemap" && metadata.pattern === "/"
|
|
5935
5973
|
);
|
|
5936
|
-
const servesDefaultMCP = _optionalChain([config, 'access',
|
|
5937
|
-
const servesAiCatalog = _optionalChain([config, 'access',
|
|
5974
|
+
const servesDefaultMCP = _optionalChain([config, 'access', _125 => _125.agent, 'optionalAccess', _126 => _126.mcp]) === true && !_chunkSBABQKPTcjs.farmConfigMountsMCP.call(void 0, config) && !apiRoutes.some((route) => route.path === "/api/mcp");
|
|
5975
|
+
const servesAiCatalog = _optionalChain([config, 'access', _127 => _127.agent, 'optionalAccess', _128 => _128.aiCatalog]) !== false;
|
|
5938
5976
|
const hasPluginRuntime = hasRuntimeIntegrationConfig || hasServerRuntimePlugins;
|
|
5939
5977
|
const hasInfraAnalyticsRuntime = config.analytics !== false && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
|
|
5940
5978
|
const hasPrecompiledDocs = Boolean(farmDocsPrecompiledManifest);
|
|
5941
5979
|
const adapterOwnsDocsRuntime = Boolean(
|
|
5942
|
-
_chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access',
|
|
5980
|
+
_chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _129 => _129.docs, 'optionalAccess', _130 => _130.enabled]) && _optionalChain([config, 'access', _131 => _131.docs, 'access', _132 => _132.adapter, 'optionalAccess', _133 => _133.server]) && config.docs.adapter.react
|
|
5943
5981
|
);
|
|
5982
|
+
if (_optionalChain([config, 'access', _134 => _134.docs, 'optionalAccess', _135 => _135.enabled]) && _optionalChain([config, 'access', _136 => _136.docs, 'access', _137 => _137.roots, 'optionalAccess', _138 => _138.length]) && !adapterOwnsDocsRuntime) {
|
|
5983
|
+
throw new Error(
|
|
5984
|
+
"Several docs roots need the docs adapter, which serves the React renderer only; Farm's built-in docs renderer serves a single docs root."
|
|
5985
|
+
);
|
|
5986
|
+
}
|
|
5944
5987
|
const docsConfigModulePath = adapterOwnsDocsRuntime && !hasPrecompiledDocs && config.docs.configPath && !config.docs.configPath.endsWith(".json") ? config.docs.configPath : void 0;
|
|
5988
|
+
const adapterHandler = generateFarmDocsAdapterHandlerArguments(config.docs, docsConfigModulePath);
|
|
5945
5989
|
const hasIsolatedClientGraphRuntime = _chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) && isolatedClientBoundaryModules.size > 0;
|
|
5946
5990
|
const rendererStreamingCapabilities = _chunkRD623KW4cjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0,
|
|
5947
5991
|
config.renderer,
|
|
@@ -5985,8 +6029,8 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
5985
6029
|
(image) => image.sourceType === "module"
|
|
5986
6030
|
);
|
|
5987
6031
|
const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunk76GHW3WIcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
|
|
5988
|
-
const farmDocsFontAssets = _optionalChain([config, 'access',
|
|
5989
|
-
const integrationProviders =
|
|
6032
|
+
const farmDocsFontAssets = _optionalChain([config, 'access', _139 => _139.docs, 'optionalAccess', _140 => _140.enabled]) ? _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkERMUL73Lcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
|
|
6033
|
+
const integrationProviders = _chunkCECUDGXQcjs.getIntegrationProviders.call(void 0, config.integrations);
|
|
5990
6034
|
const renderedIntegrationProviders = integrationProviders.filter(
|
|
5991
6035
|
(provider) => provider.component || provider.type === "clerk"
|
|
5992
6036
|
);
|
|
@@ -5995,16 +6039,16 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
5995
6039
|
`Integration provider components are not supported by the "${config.renderer.name}" renderer.`
|
|
5996
6040
|
);
|
|
5997
6041
|
}
|
|
5998
|
-
const providerServerModules =
|
|
6042
|
+
const providerServerModules = _chunkWZW6LEHMcjs.generateFarmIntegrationProviderServerModules.call(void 0,
|
|
5999
6043
|
renderedIntegrationProviders,
|
|
6000
6044
|
config.root,
|
|
6001
6045
|
_nullishCoalesce(config.renderer.componentExtensions, () => ( []))
|
|
6002
6046
|
);
|
|
6003
6047
|
const resolvedIntegrationProviderFallback = Object.fromEntries(
|
|
6004
6048
|
Object.entries(config.integrations).flatMap(([name, integration]) => {
|
|
6005
|
-
const configuredProviders = _optionalChain([integration, 'optionalAccess',
|
|
6049
|
+
const configuredProviders = _optionalChain([integration, 'optionalAccess', _141 => _141.providers]);
|
|
6006
6050
|
const providers = Array.isArray(configuredProviders) ? configuredProviders : [];
|
|
6007
|
-
if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess',
|
|
6051
|
+
if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess', _142 => _142.component]) === "function")) {
|
|
6008
6052
|
throw new Error(
|
|
6009
6053
|
`Integration provider components in production must use an importable component reference, for example component: { module: "@/components/provider" }.`
|
|
6010
6054
|
);
|
|
@@ -6015,20 +6059,20 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6015
6059
|
const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
|
|
6016
6060
|
(provider) => provider.supportsIsolatedHydration !== true
|
|
6017
6061
|
);
|
|
6018
|
-
const isolatedHydrationMode =
|
|
6019
|
-
_optionalChain([config, 'access',
|
|
6062
|
+
const isolatedHydrationMode = _chunkWZW6LEHMcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
6063
|
+
_optionalChain([config, 'access', _143 => _143.experimental, 'optionalAccess', _144 => _144.isolatedClientHydration]),
|
|
6020
6064
|
{
|
|
6021
|
-
serverComponents: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
6065
|
+
serverComponents: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _145 => _145.experimental, 'optionalAccess', _146 => _146.serverComponents])) === "rsc",
|
|
6022
6066
|
hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
|
|
6023
6067
|
}
|
|
6024
6068
|
);
|
|
6025
|
-
const hydrationPlanOptions =
|
|
6069
|
+
const hydrationPlanOptions = _chunkWZW6LEHMcjs.getFarmClientHydrationPlanOptions.call(void 0,
|
|
6026
6070
|
config.renderer,
|
|
6027
6071
|
Boolean(unsupportedIntegrationProvider)
|
|
6028
6072
|
);
|
|
6029
6073
|
const pageHydrationPlanOptions = {
|
|
6030
6074
|
...hydrationPlanOptions,
|
|
6031
|
-
serverOwners: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access',
|
|
6075
|
+
serverOwners: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _147 => _147.experimental, 'optionalAccess', _148 => _148.serverComponents])) === "islands"
|
|
6032
6076
|
};
|
|
6033
6077
|
const layoutHydrationPlans = layoutRoutes.map((layout) => ({
|
|
6034
6078
|
...layout,
|
|
@@ -6040,7 +6084,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6040
6084
|
{ ...hydrationPlanOptions, serverTreeLayouts: pageHydrationPlanOptions.serverOwners }
|
|
6041
6085
|
)
|
|
6042
6086
|
}));
|
|
6043
|
-
const markdownPagePlan =
|
|
6087
|
+
const markdownPagePlan = _chunkWZW6LEHMcjs.createMarkdownPageHydrationPlanner.call(void 0,
|
|
6044
6088
|
_chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
|
|
6045
6089
|
config.root,
|
|
6046
6090
|
isolatedHydrationMode,
|
|
@@ -6058,7 +6102,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6058
6102
|
)
|
|
6059
6103
|
])
|
|
6060
6104
|
);
|
|
6061
|
-
|
|
6105
|
+
_chunkWZW6LEHMcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
|
|
6062
6106
|
layoutHydrationPlans.map((layout) => ({
|
|
6063
6107
|
pattern: layout.pattern,
|
|
6064
6108
|
depth: layout.pattern.split("/").filter(Boolean).length,
|
|
@@ -6087,7 +6131,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6087
6131
|
apiRegistrations.push(`
|
|
6088
6132
|
{
|
|
6089
6133
|
path: ${JSON.stringify(route.path)},
|
|
6090
|
-
methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access',
|
|
6134
|
+
methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access', _149 => _149.pluginMethods, 'optionalAccess', _150 => _150.includes, 'call', _151 => _151(method)])))},
|
|
6091
6135
|
endpoints: ${varName},
|
|
6092
6136
|
}`);
|
|
6093
6137
|
});
|
|
@@ -6124,7 +6168,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6124
6168
|
`import * as ${varName} from ${toVirtualEntryImportSpecifier(route.modulePath)};`
|
|
6125
6169
|
);
|
|
6126
6170
|
const clientMetadata = pageHydrationPlans.get(route.modulePath);
|
|
6127
|
-
const renderingDirective =
|
|
6171
|
+
const renderingDirective = _chunkUQHIWZZ6cjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
|
|
6128
6172
|
pageRegistrations.push(`
|
|
6129
6173
|
{
|
|
6130
6174
|
pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
|
|
@@ -6132,7 +6176,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6132
6176
|
module: ${varName},
|
|
6133
6177
|
shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},${clientMetadata.shouldHydrate ? `
|
|
6134
6178
|
clientModule: ${JSON.stringify(_chunkVQJYGZNXcjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
|
|
6135
|
-
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${
|
|
6179
|
+
islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkWZW6LEHMcjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${renderingDirective ? `
|
|
6136
6180
|
rendering: ${JSON.stringify(renderingDirective)},` : ""}
|
|
6137
6181
|
${route.source !== void 0 ? `markdownSource: {
|
|
6138
6182
|
source: ${JSON.stringify(route.source)},
|
|
@@ -6338,6 +6382,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
|
|
|
6338
6382
|
resolveFarmInstrumentationRuntime,
|
|
6339
6383
|
resolveFarmPreviewDeployment,
|
|
6340
6384
|
resolveFarmWebRequestOrigin,
|
|
6385
|
+
fetchFarmExternalRewrite,
|
|
6341
6386
|
runWithFarmRequestSpan,
|
|
6342
6387
|
createFarmSearchParams,
|
|
6343
6388
|
searchParamsToObject,
|
|
@@ -6362,25 +6407,25 @@ ${FARM_SEGMENT_NAVIGATION_SERVER_RUNTIME}` : ""}`;
|
|
|
6362
6407
|
const infraAnalyticsImport = hasInfraAnalyticsRuntime ? `import { ${hasPluginRuntime ? "createFarmInfraAnalyticsPlugin" : "createFarmInfraAnalyticsRecorder"} } from "@farm.js/core/internal/infra-analytics-runtime";` : "";
|
|
6363
6408
|
const compressionRuntimeImport = hasCompressionRuntime ? `import { compressFarmResponse${hasPluginRuntime ? ", createCompressionPlugin" : ""} } from "@farm.js/core/internal/compression-runtime";` : "";
|
|
6364
6409
|
const i18nServerImport = config.i18n.enabled ? `import { _runWithFarmI18nRequest, _setDefaultFarmI18nRuntime, createFarmI18nRuntime, getFarmI18nClientSnapshot } from "@farm.js/core/i18n/server";` : "";
|
|
6365
|
-
const docsHandlerImport = _optionalChain([config, 'access',
|
|
6410
|
+
const docsHandlerImport = _optionalChain([config, 'access', _152 => _152.docs, 'optionalAccess', _153 => _153.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
|
|
6366
6411
|
const isFarmDocsAPIRequest = (requestOrPathname) => {
|
|
6367
6412
|
const pathname = typeof requestOrPathname === "string"
|
|
6368
6413
|
? requestOrPathname
|
|
6369
6414
|
: new URL(requestOrPathname.url).pathname;
|
|
6370
|
-
const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess',
|
|
6415
|
+
const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _154 => _154.apiPath]) || "/api/docs")};
|
|
6371
6416
|
return pathname === apiPath || pathname.startsWith(apiPath + "/");
|
|
6372
|
-
};` : adapterOwnsDocsRuntime ? `import { isFarmDocsAPIRequest } from "@farm.js/core/docs";
|
|
6373
|
-
import { createFarmDocsRuntimeHandler as createFarmDocsAdapterRuntimeHandler } from ${JSON.stringify(config.docs.adapter.server)};
|
|
6417
|
+
};` : adapterOwnsDocsRuntime ? `import { ${docsConfigModulePath ? "getFarmDocsConfigModuleRoot, " : ""}isFarmDocsAPIRequest } from "@farm.js/core/docs";
|
|
6418
|
+
import { ${_optionalChain([config, 'access', _155 => _155.docs, 'access', _156 => _156.roots, 'optionalAccess', _157 => _157.length]) ? "createFarmDocsMultiRuntimeHandler as createFarmDocsAdapterMultiRuntimeHandler" : "createFarmDocsRuntimeHandler as createFarmDocsAdapterRuntimeHandler"} } from ${JSON.stringify(config.docs.adapter.server)};
|
|
6374
6419
|
import * as FarmDocsAdapterReact from ${JSON.stringify(config.docs.adapter.react)};${docsConfigModulePath ? `
|
|
6375
6420
|
import * as farmDocsConfigModule from ${toVirtualEntryImportSpecifier(docsConfigModulePath)};` : ""}` : `import { createFarmDocsAPIHandler, createFarmDocsHandler, isFarmDocsAPIRequest } from "@farm.js/core/docs";` : "";
|
|
6376
|
-
const docsFontImport = _optionalChain([config, 'access',
|
|
6377
|
-
const docsRuntimeImport = _optionalChain([config, 'access',
|
|
6421
|
+
const docsFontImport = _optionalChain([config, 'access', _158 => _158.docs, 'optionalAccess', _159 => _159.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
|
|
6422
|
+
const docsRuntimeImport = _optionalChain([config, 'access', _160 => _160.docs, 'optionalAccess', _161 => _161.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
|
|
6378
6423
|
import { dirname as farmDocsDirname, join as farmDocsJoin } from "node:path";
|
|
6379
6424
|
import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
|
|
6380
|
-
const markdownHandlerImport = _optionalChain([config, 'access',
|
|
6425
|
+
const markdownHandlerImport = _optionalChain([config, 'access', _162 => _162.md, 'optionalAccess', _163 => _163.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
|
|
6381
6426
|
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;";
|
|
6382
6427
|
const markdownErrorImport = `import { FARM_MARKDOWN_CONTENT_TYPE, FARM_MARKDOWN_PAGE_CHECK_HEADER, _isFarmMarkdownPageCheck, createFarmMarkdownErrorBody, farmRequestWantsMarkdown } from "@farm.js/core/markdown";`;
|
|
6383
|
-
const mdxComponentsPath = typeof _optionalChain([config, 'access',
|
|
6428
|
+
const mdxComponentsPath = typeof _optionalChain([config, 'access', _164 => _164.mdx, 'optionalAccess', _165 => _165.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
|
|
6384
6429
|
const mdxComponentsImport = mdxComponentsPath ? `import * as FarmMdxComponentsModule from ${toVirtualEntryImportSpecifier(mdxComponentsPath)};` : "";
|
|
6385
6430
|
const layerConfigPaths = (config.layers || []).map((layer) => layer.configFile).filter((configFile) => Boolean(configFile)).filter((configFile) => configFile !== configModulePath);
|
|
6386
6431
|
const layerConfigImports = layerConfigPaths.map(
|
|
@@ -6399,14 +6444,18 @@ import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
|
|
|
6399
6444
|
const instrumentationImport = instrumentationPath ? `import * as FarmInstrumentationModule from ${toVirtualEntryImportSpecifier(instrumentationPath)};` : "";
|
|
6400
6445
|
const nativeAuth = generateNativeAuthIntegrationSource(config.auth);
|
|
6401
6446
|
const nativeMCP = _chunkVM57CK74cjs.generateNativeMCPPluginSource.call(void 0, config.mcp);
|
|
6447
|
+
const mobileSession = (config.plugins || []).some(
|
|
6448
|
+
(plugin) => _optionalChain([plugin, 'optionalAccess', _166 => _166.name]) === _chunk7FVVQEVLcjs.FARM_MOBILE_SESSION_PLUGIN
|
|
6449
|
+
);
|
|
6402
6450
|
const integrationImports = `
|
|
6403
6451
|
${configModulePath ? `import * as FarmUserConfigModule from ${toVirtualEntryImportSpecifier(configModulePath)};` : ""}
|
|
6404
6452
|
${layerConfigImports}
|
|
6405
6453
|
${integrationRuntimeImport}
|
|
6406
6454
|
${nativeAuth.importSource}
|
|
6407
6455
|
${nativeMCP.importSource}
|
|
6456
|
+
${mobileSession ? `import { createFarmMobileSessionPlugin as __farmCreateMobileSessionPlugin } from "@farm.js/core/internal/production-runtime";` : ""}
|
|
6408
6457
|
`;
|
|
6409
|
-
const imageRuntime =
|
|
6458
|
+
const imageRuntime = _chunkWZW6LEHMcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
6410
6459
|
const imageRuntimeImport = imageRuntime === "none" ? "" : `import { _withFarmImageSourceClientAddress, createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
|
|
6411
6460
|
const imageNodeRuntimeImport = imageRuntime === "node" ? `import { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } from "@farm.js/core/image/sharp";` : "";
|
|
6412
6461
|
const apiHandlerCode = apiRoutes.length > 0 ? `
|
|
@@ -6585,7 +6634,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
|
|
|
6585
6634
|
|
|
6586
6635
|
function FarmDefault404Page() {
|
|
6587
6636
|
return React.createElement(React.Fragment, null,
|
|
6588
|
-
React.createElement("style", null, ${JSON.stringify(
|
|
6637
|
+
React.createElement("style", null, ${JSON.stringify(_chunkWZW6LEHMcjs.DEFAULT_NOT_FOUND_STYLES)}),
|
|
6589
6638
|
React.createElement("main", {
|
|
6590
6639
|
className: "farm-default-not-found",
|
|
6591
6640
|
"aria-labelledby": "farm-default-not-found-title",
|
|
@@ -6685,6 +6734,10 @@ const configuredPlugins = [
|
|
|
6685
6734
|
${hasCompressionRuntime && hasPluginRuntime ? "createCompressionPlugin()," : ""}
|
|
6686
6735
|
${hasRuntimeIntegrationConfig ? "...resolveIntegrationPlugins(serverRuntimeIntegrations)," : ""}
|
|
6687
6736
|
${nativeMCP.pluginSource}
|
|
6737
|
+
${mobileSession ? `__farmCreateMobileSessionPlugin({
|
|
6738
|
+
basePath: ${JSON.stringify(config.basePath)},
|
|
6739
|
+
integrations: () => serverRuntimeIntegrations,
|
|
6740
|
+
}),` : ""}
|
|
6688
6741
|
${hasConfiguredRuntimePlugins ? `...farmRuntimeConfigs.flatMap((runtimeConfig) =>
|
|
6689
6742
|
Array.isArray(runtimeConfig.plugins) ? runtimeConfig.plugins : [],
|
|
6690
6743
|
),` : ""}
|
|
@@ -6718,14 +6771,14 @@ const farmImageHandler = ${imageRuntime === "none" ? "null" : imageRuntime === "
|
|
|
6718
6771
|
onError(error) { console.error("[Farm Image]", error); },
|
|
6719
6772
|
})`};
|
|
6720
6773
|
const farmMarkdownConfig = ${JSON.stringify(config.md)};
|
|
6721
|
-
const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access',
|
|
6722
|
-
${_optionalChain([config, 'access',
|
|
6774
|
+
const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _167 => _167.agent, 'optionalAccess', _168 => _168.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
|
|
6775
|
+
${_optionalChain([config, 'access', _169 => _169.agent, 'optionalAccess', _170 => _170.llmsTxt, 'optionalAccess', _171 => _171.enabled]) ? "const farmLlmsFullRenderer = createFarmLlmsFullRenderer({ revalidate: farmLlmsTxtConfig.revalidate });\n" : ""}${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
|
|
6723
6776
|
const farmMdxConfig = ${JSON.stringify({
|
|
6724
6777
|
...config.mdx,
|
|
6725
|
-
components: typeof _optionalChain([config, 'access',
|
|
6778
|
+
components: typeof _optionalChain([config, 'access', _172 => _172.mdx, 'optionalAccess', _173 => _173.components]) === "string" ? config.mdx.components : void 0
|
|
6726
6779
|
})};
|
|
6727
6780
|
const configuredFarmMdxComponents = farmUserConfig?.mdx?.components;
|
|
6728
|
-
${_optionalChain([config, 'access',
|
|
6781
|
+
${_optionalChain([config, 'access', _174 => _174.agent, 'optionalAccess', _175 => _175.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
|
|
6729
6782
|
// environment this was built in, since Netlify exposes its deploy context only
|
|
6730
6783
|
// to the build.
|
|
6731
6784
|
const farmNoindexPreview = resolveFarmPreviewDeployment(
|
|
@@ -6776,7 +6829,7 @@ export const farmProductionLifecycle = createFarmProductionLifecycle({
|
|
|
6776
6829
|
});
|
|
6777
6830
|
const farmI18nRuntime = ${config.i18n.enabled ? `createFarmI18nRuntime(farmI18nConfig, ${JSON.stringify(i18nCatalogs)})` : "null"};
|
|
6778
6831
|
${config.i18n.enabled ? "_setDefaultFarmI18nRuntime(farmI18nRuntime);" : ""}
|
|
6779
|
-
const farmDocsBundledContentDir = ${_optionalChain([config, 'access',
|
|
6832
|
+
const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _176 => _176.docs, 'optionalAccess', _177 => _177.enabled]) && !hasPrecompiledDocs ? `(() => {
|
|
6780
6833
|
try {
|
|
6781
6834
|
const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
|
|
6782
6835
|
const candidates = [
|
|
@@ -6788,7 +6841,20 @@ const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _163 => _1
|
|
|
6788
6841
|
} catch {
|
|
6789
6842
|
return null;
|
|
6790
6843
|
}
|
|
6791
|
-
})()` : "null"}
|
|
6844
|
+
})()` : "null"};${_optionalChain([config, 'access', _178 => _178.docs, 'optionalAccess', _179 => _179.enabled]) && !hasPrecompiledDocs && _optionalChain([config, 'access', _180 => _180.docs, 'access', _181 => _181.roots, 'optionalAccess', _182 => _182.length]) ? `
|
|
6845
|
+
const farmDocsBundledRootsDir = (() => {
|
|
6846
|
+
try {
|
|
6847
|
+
const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
|
|
6848
|
+
const candidates = [
|
|
6849
|
+
farmDocsJoin(currentDir, "farm-docs-roots"),
|
|
6850
|
+
farmDocsJoin(currentDir, "..", "farm-docs-roots"),
|
|
6851
|
+
farmDocsJoin(currentDir, "..", "..", "farm-docs-roots"),
|
|
6852
|
+
];
|
|
6853
|
+
return candidates.find((candidate) => farmDocsExistsSync(candidate)) || null;
|
|
6854
|
+
} catch {
|
|
6855
|
+
return null;
|
|
6856
|
+
}
|
|
6857
|
+
})();` : ""}
|
|
6792
6858
|
const farmDocsResolvedConfig = ${generateFarmDocsRuntimeConfigExpression(config.docs, hasPrecompiledDocs)};
|
|
6793
6859
|
const farmDocsRuntimeRoot = ${hasPrecompiledDocs ? '"."' : `farmDocsBundledContentDir || ${JSON.stringify(config.root)}`};
|
|
6794
6860
|
// Docs pages a path-specific guard covers, decided at build time. The docs API and the
|
|
@@ -6826,12 +6892,7 @@ const farmDocsModulePreloadPaths = farmDocsModulePreloads
|
|
|
6826
6892
|
),
|
|
6827
6893
|
}
|
|
6828
6894
|
: undefined;
|
|
6829
|
-
const farmDocsHandler = ${_optionalChain([config, 'access',
|
|
6830
|
-
${docsConfigModulePath ? "...(farmDocsConfigModule.default || farmDocsConfigModule),\n ...farmDocsResolvedConfig.configOverrides," : "...farmDocsResolvedConfig.config,"}
|
|
6831
|
-
entry: farmDocsResolvedConfig.config?.entry || String(farmDocsResolvedConfig.entry || "/docs").replace(/^\\/+|\\/+$/g, "") || "docs",
|
|
6832
|
-
docsPath: farmDocsResolvedConfig.entry,
|
|
6833
|
-
contentDir: farmDocsResolvedConfig.contentDir || farmDocsResolvedConfig.config?.contentDir,
|
|
6834
|
-
}, {
|
|
6895
|
+
const farmDocsHandler = ${_optionalChain([config, 'access', _183 => _183.docs, 'optionalAccess', _184 => _184.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `${adapterHandler.factory}(${adapterHandler.config}, {
|
|
6835
6896
|
rootDir: farmDocsRuntimeRoot,
|
|
6836
6897
|
// A production build's content cannot change, so the adapter reads its
|
|
6837
6898
|
// navigation once instead of scanning the content directory per request.
|
|
@@ -6864,7 +6925,7 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _165 => _165.docs, '
|
|
|
6864
6925
|
globalStylesheetHref: ${JSON.stringify(FARM_CLIENT_CSS_HREF_PLACEHOLDER)},
|
|
6865
6926
|
isPathGuarded: isFarmDocsPathGuarded,
|
|
6866
6927
|
})` : "null"};
|
|
6867
|
-
const farmDocsAPIHandler = ${_optionalChain([config, 'access',
|
|
6928
|
+
const farmDocsAPIHandler = ${_optionalChain([config, 'access', _185 => _185.docs, 'optionalAccess', _186 => _186.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig, isPathGuarded: isFarmDocsPathGuarded })` : "null"};
|
|
6868
6929
|
|
|
6869
6930
|
// API routes bundled at build time
|
|
6870
6931
|
const apiRoutes = ${apiRoutes.length > 0 ? "mergePluginAPIRoutes(" : ""}[${apiRegistrations.join(",")}
|
|
@@ -6889,12 +6950,12 @@ function fetchFarmInnerRequest(request, context) {
|
|
|
6889
6950
|
}
|
|
6890
6951
|
const farmLocalAPIBasePath = ${JSON.stringify(_chunkB5BBTPJQcjs.resolveFarmAPIServerBasePath.call(void 0, config.api))};
|
|
6891
6952
|
const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
|
|
6892
|
-
${_optionalChain([config, 'access',
|
|
6893
|
-
` : ""}${_optionalChain([config, 'access',
|
|
6894
|
-
|
|
6953
|
+
${_optionalChain([config, 'access', _187 => _187.agent, 'optionalAccess', _188 => _188.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkJ3LBO2O4cjs.resolveFarmApiCatalogInput.call(void 0, config))};
|
|
6954
|
+
` : ""}${_optionalChain([config, 'access', _189 => _189.agent, 'optionalAccess', _190 => _190.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
|
|
6955
|
+
_chunkJ3LBO2O4cjs.resolveFarmAppManifestInput.call(void 0, config, {
|
|
6895
6956
|
build: config.deploymentId,
|
|
6896
|
-
packages:
|
|
6897
|
-
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ?
|
|
6957
|
+
packages: _chunkWZW6LEHMcjs.resolveFarmAppPackages.call(void 0, config.root),
|
|
6958
|
+
webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkWZW6LEHMcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
|
|
6898
6959
|
})
|
|
6899
6960
|
)};
|
|
6900
6961
|
${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
@@ -7036,10 +7097,22 @@ function escapeFarmHtmlAttribute(value) {
|
|
|
7036
7097
|
.replace(/>/g, ">");
|
|
7037
7098
|
}
|
|
7038
7099
|
|
|
7039
|
-
|
|
7040
|
-
|
|
7100
|
+
// A streamed navigation's flush marker token: 128 random bits, hex.
|
|
7101
|
+
function createFarmFlushToken() {
|
|
7102
|
+
const bytes = new Uint8Array(16);
|
|
7103
|
+
globalThis.crypto.getRandomValues(bytes);
|
|
7104
|
+
let token = "";
|
|
7105
|
+
for (const byte of bytes) token += byte.toString(16).padStart(2, "0");
|
|
7106
|
+
return token;
|
|
7107
|
+
}
|
|
7108
|
+
|
|
7109
|
+
async function renderFarmElement(ReactDOMServer, element, routeKey, flushToken = "") {
|
|
7110
|
+
// Written after each React flush in a streamed navigation (flushToken): the browser swaps in
|
|
7041
7111
|
// the shell, then adds each Suspense boundary as soon as the flush that completed it ends.
|
|
7042
|
-
|
|
7112
|
+
// The token is random per response and reaches the browser in the F-Flush header, so page
|
|
7113
|
+
// content cannot forge a boundary.
|
|
7114
|
+
const flushMarkers = Boolean(flushToken);
|
|
7115
|
+
const FARM_FLUSH_MARKER = flushMarkers ? "<!--farm-flush:" + flushToken + "-->" : "";
|
|
7043
7116
|
// Islands mode: each render writes its islands' values itself, so a request that renders twice
|
|
7044
7117
|
// (notFound(), or a synchronous attempt that suspends and streams) still sends them.
|
|
7045
7118
|
if (typeof farmIslandsRender === "function") element = farmIslandsRender(element);
|
|
@@ -8060,7 +8133,7 @@ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as
|
|
|
8060
8133
|
// aside for a page route that answers /mcp and for any MCP server published or
|
|
8061
8134
|
// registered at runtime, such as the docs engine's.
|
|
8062
8135
|
const farmDefaultMCPServer = ${JSON.stringify(
|
|
8063
|
-
_chunkSBABQKPTcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root),
|
|
8136
|
+
_chunkSBABQKPTcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkGUJTVM36cjs.FARM_VERSION)
|
|
8064
8137
|
)};
|
|
8065
8138
|
let farmDefaultMCPRouteFree;
|
|
8066
8139
|
function getFarmDefaultMCPServer() {
|
|
@@ -8360,7 +8433,7 @@ function hasLocalRequestRoute(request, routePathname) {
|
|
|
8360
8433
|
if (${imageRuntime === "none" ? "false" : `pathname === ${JSON.stringify(config.images.path)}`}) {
|
|
8361
8434
|
return true;
|
|
8362
8435
|
}
|
|
8363
|
-
${_optionalChain([config, 'access',
|
|
8436
|
+
${_optionalChain([config, 'access', _191 => _191.docs, 'optionalAccess', _192 => _192.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
|
|
8364
8437
|
if (
|
|
8365
8438
|
isFarmDocsAPIRequest(pathname) ||
|
|
8366
8439
|
docsPath === "/" ||
|
|
@@ -8386,7 +8459,7 @@ function getFarmPluginRequestOptions(request) {
|
|
|
8386
8459
|
route: { ...route, pattern: normalizeRuntimePath(farmOpenAPIReference.route) },
|
|
8387
8460
|
};
|
|
8388
8461
|
}
|
|
8389
|
-
const isDocsAPIRequest = ${_optionalChain([config, 'access',
|
|
8462
|
+
const isDocsAPIRequest = ${_optionalChain([config, 'access', _193 => _193.docs, 'optionalAccess', _194 => _194.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
|
|
8390
8463
|
const integrationMatch = ${hasServerRuntimeIntegrations ? `matchIntegrationRoute(serverRuntimeIntegrations, {
|
|
8391
8464
|
pathname,
|
|
8392
8465
|
method: request.method,
|
|
@@ -8470,7 +8543,7 @@ ${hasInfraAnalyticsRuntime ? `
|
|
|
8470
8543
|
// endpoints, Markdown mirrors, and docs pages have no app route pattern, so they are
|
|
8471
8544
|
// labeled here; route.pattern keeps meaning the matched app route for plugins.
|
|
8472
8545
|
const farmBuiltInRoutePaths = new Set(${JSON.stringify(
|
|
8473
|
-
|
|
8546
|
+
_chunkJ3LBO2O4cjs.listFarmBuiltInRoutePaths.call(void 0, {
|
|
8474
8547
|
agent: {
|
|
8475
8548
|
...config.agent,
|
|
8476
8549
|
aiCatalog: servesAiCatalog,
|
|
@@ -8481,9 +8554,9 @@ const farmBuiltInRoutePaths = new Set(${JSON.stringify(
|
|
|
8481
8554
|
openapi: openAPIReference
|
|
8482
8555
|
})
|
|
8483
8556
|
)});
|
|
8484
|
-
${_optionalChain([config, 'access',
|
|
8557
|
+
${_optionalChain([config, 'access', _195 => _195.docs, 'optionalAccess', _196 => _196.enabled]) ? `const farmDocsRouteLabelInput = {
|
|
8485
8558
|
path: normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs"),
|
|
8486
|
-
apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess',
|
|
8559
|
+
apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _197 => _197.apiPath]) || "/api/docs")},${_optionalChain([config, 'access', _198 => _198.docs, 'access', _199 => _199.roots, 'optionalAccess', _200 => _200.length]) ? "\n roots: farmDocsResolvedConfig.roots.map((farmDocsRoot) => farmDocsRoot.entry)," : ""}
|
|
8487
8560
|
};
|
|
8488
8561
|
` : ""}// The request's route payload, for a handler that learns what answered while it handles.
|
|
8489
8562
|
const farmRouteLabelSlot = Symbol("farm.route.label.slot");
|
|
@@ -8498,11 +8571,11 @@ function labelFarmRequestOptions(options) {
|
|
|
8498
8571
|
setFarmRouteLabel(options.route, mcpLabel);
|
|
8499
8572
|
return options;
|
|
8500
8573
|
}
|
|
8501
|
-
${_optionalChain([config, 'access',
|
|
8574
|
+
${_optionalChain([config, 'access', _201 => _201.docs, 'optionalAccess', _202 => _202.enabled]) ? `if (options.kind === "docs") {
|
|
8502
8575
|
setFarmRouteLabel(options.route, resolveFarmDocsRouteLabel(routePathname, farmDocsRouteLabelInput));
|
|
8503
8576
|
return options;
|
|
8504
8577
|
}` : ""}
|
|
8505
|
-
${_optionalChain([config, 'access',
|
|
8578
|
+
${_optionalChain([config, 'access', _203 => _203.md, 'optionalAccess', _204 => _204.enabled]) || hasMarkdownPages ? `const markdownLabel = resolveFarmMarkdownRouteLabel(
|
|
8506
8579
|
routePathname,
|
|
8507
8580
|
(page) => matchPageRoute(page)?.route.pattern,
|
|
8508
8581
|
);
|
|
@@ -8537,7 +8610,7 @@ function getApplicableLayouts(pathname, directory) {
|
|
|
8537
8610
|
return applicable;
|
|
8538
8611
|
}
|
|
8539
8612
|
|
|
8540
|
-
${_optionalChain([config, 'access',
|
|
8613
|
+
${_optionalChain([config, 'access', _205 => _205.docs, 'optionalAccess', _206 => _206.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
|
|
8541
8614
|
if (request.method === "HEAD") return response;
|
|
8542
8615
|
if (response.headers.get("x-farm-docs-adapter")) return response;
|
|
8543
8616
|
|
|
@@ -8645,7 +8718,7 @@ ${_optionalChain([config, 'access', _184 => _184.docs, 'optionalAccess', _185 =>
|
|
|
8645
8718
|
|
|
8646
8719
|
// Shells keep their own LRU so query-string variants never evict app cache entries.
|
|
8647
8720
|
const pprShellCache = getFarmDataCache().pprShellCache;
|
|
8648
|
-
const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access',
|
|
8721
|
+
const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _207 => _207.experimental, 'optionalAccess', _208 => _208.ppr]) === true)};
|
|
8649
8722
|
|
|
8650
8723
|
function resolveRouteRenderingView(route) {
|
|
8651
8724
|
// The same merge development uses: baked directive config under the
|
|
@@ -8777,7 +8850,7 @@ async function handleFarmRequest(request, adapterContext) {
|
|
|
8777
8850
|
},
|
|
8778
8851
|
{ redirect: !isFarmLocalAPIPathname(requestUrl.pathname) }
|
|
8779
8852
|
)` : "handleFarmRequestInContext(request, null, false, Date.now(), adapterContext, requestUrl)"};
|
|
8780
|
-
${_optionalChain([config, 'access',
|
|
8853
|
+
${_optionalChain([config, 'access', _209 => _209.md, 'optionalAccess', _210 => _210.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
|
|
8781
8854
|
if (matchPageRoute(pathname)) {
|
|
8782
8855
|
// The Link header advertises the public .md URL, like the head alternate.
|
|
8783
8856
|
return applyMarkdownNegotiationHeaders(response, {
|
|
@@ -8858,7 +8931,7 @@ async function resolveFarmRequestInContext(
|
|
|
8858
8931
|
if (rewriteDestination) {
|
|
8859
8932
|
let rewrittenRequest = createRewrittenRequest(request, rewriteDestination);
|
|
8860
8933
|
if (new URL(rewrittenRequest.url).origin !== url.origin) {
|
|
8861
|
-
return
|
|
8934
|
+
return fetchFarmExternalRewrite(rewrittenRequest);
|
|
8862
8935
|
}
|
|
8863
8936
|
if (farmPluginRuntime) {
|
|
8864
8937
|
// Plugin guards ran on the requested URL. Re-run only runtime.before
|
|
@@ -8987,7 +9060,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
8987
9060
|
}
|
|
8988
9061
|
` : ""}
|
|
8989
9062
|
|
|
8990
|
-
${_optionalChain([config, 'access',
|
|
9063
|
+
${_optionalChain([config, 'access', _211 => _211.docs, 'optionalAccess', _212 => _212.enabled]) ? `
|
|
8991
9064
|
// Docs responses are served after app middleware so route guards and
|
|
8992
9065
|
// middleware headers apply to the docs engine like any other page content.
|
|
8993
9066
|
// An app's own llms.txt, llms-full.txt, sitemap.xml, and robots.txt take
|
|
@@ -9055,7 +9128,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9055
9128
|
}
|
|
9056
9129
|
` : ""}
|
|
9057
9130
|
|
|
9058
|
-
${_optionalChain([config, 'access',
|
|
9131
|
+
${_optionalChain([config, 'access', _213 => _213.md, 'optionalAccess', _214 => _214.enabled]) ? `
|
|
9059
9132
|
if (farmMarkdownConfig?.enabled) {
|
|
9060
9133
|
const markdownResponse = await createMarkdownMirrorResponse({
|
|
9061
9134
|
// The mirror helper only reads metadata and creates its own GET request.
|
|
@@ -9154,11 +9227,11 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9154
9227
|
return applyProductionMiddlewareHeaders(applicationMetadataResponse, middlewareHeaders);
|
|
9155
9228
|
}
|
|
9156
9229
|
` : ""}
|
|
9157
|
-
${_optionalChain([config, 'access',
|
|
9230
|
+
${_optionalChain([config, 'access', _215 => _215.agent, 'optionalAccess', _216 => _216.manifest]) !== false ? `
|
|
9158
9231
|
// agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
|
|
9159
9232
|
// public manifest, the same document for every request.
|
|
9160
9233
|
if (
|
|
9161
|
-
[${JSON.stringify(
|
|
9234
|
+
[${JSON.stringify(_chunkJ3LBO2O4cjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkJ3LBO2O4cjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
|
|
9162
9235
|
normalizeRuntimePath(routePathname),
|
|
9163
9236
|
)
|
|
9164
9237
|
) {
|
|
@@ -9168,9 +9241,9 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9168
9241
|
);
|
|
9169
9242
|
}
|
|
9170
9243
|
` : ""}
|
|
9171
|
-
${_optionalChain([config, 'access',
|
|
9244
|
+
${_optionalChain([config, 'access', _217 => _217.agent, 'optionalAccess', _218 => _218.apiCatalog]) ? `
|
|
9172
9245
|
// agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
|
|
9173
|
-
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(
|
|
9246
|
+
if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkJ3LBO2O4cjs.FARM_API_CATALOG_PATH)}) {
|
|
9174
9247
|
return applyProductionMiddlewareHeaders(
|
|
9175
9248
|
createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
|
|
9176
9249
|
middlewareHeaders,
|
|
@@ -9195,11 +9268,11 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9195
9268
|
);
|
|
9196
9269
|
}
|
|
9197
9270
|
` : ""}
|
|
9198
|
-
${_optionalChain([config, 'access',
|
|
9271
|
+
${_optionalChain([config, 'access', _219 => _219.agent, 'optionalAccess', _220 => _220.llmsTxt, 'optionalAccess', _221 => _221.enabled]) ? `
|
|
9199
9272
|
// agent.llmsTxt with no llms.ts or llms-full.ts: serve the generated files.
|
|
9200
9273
|
const farmGeneratedLlmsKind = normalizeRuntimePath(routePathname) === "/llms.txt"
|
|
9201
9274
|
? "llms"
|
|
9202
|
-
: ${_optionalChain([config, 'access',
|
|
9275
|
+
: ${_optionalChain([config, 'access', _222 => _222.agent, 'optionalAccess', _223 => _223.llmsTxt, 'optionalAccess', _224 => _224.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
|
|
9203
9276
|
if (farmGeneratedLlmsKind) {
|
|
9204
9277
|
const llmsContext = createFarmLlmsTxtContext(request, farmGeneratedLlmsKind === "llms-full");
|
|
9205
9278
|
const llmsOrigin = new URL(request.url).origin;
|
|
@@ -9234,7 +9307,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9234
9307
|
}
|
|
9235
9308
|
` : ""}
|
|
9236
9309
|
|
|
9237
|
-
${_optionalChain([config, 'access',
|
|
9310
|
+
${_optionalChain([config, 'access', _225 => _225.docs, 'optionalAccess', _226 => _226.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
|
|
9238
9311
|
const docsAPIResponse = await farmDocsAPIHandler(cloneFarmRequestWithContext(request));
|
|
9239
9312
|
if (docsAPIResponse) {
|
|
9240
9313
|
return applyProductionMiddlewareHeaders(
|
|
@@ -9577,10 +9650,13 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9577
9650
|
!route.shouldHydrate &&
|
|
9578
9651
|
request.headers.get("f-render") === "tree";
|
|
9579
9652
|
// A navigation the browser streams marks where each React flush ends, so the browser
|
|
9580
|
-
// shows the page before its Suspense content arrives (FARM_FLUSH_MARKER).
|
|
9581
|
-
|
|
9653
|
+
// shows the page before its Suspense content arrives (FARM_FLUSH_MARKER). The marker
|
|
9654
|
+
// carries a random token sent in the F-Flush header: page content cannot forge one.
|
|
9655
|
+
const farmFlushToken = request.headers.get("f-stream") === "flush"
|
|
9656
|
+
? createFarmFlushToken()
|
|
9657
|
+
: "";` : `const farmLayoutKeyOf = null;
|
|
9582
9658
|
const farmPayloadOnlyNavigation = false;
|
|
9583
|
-
const
|
|
9659
|
+
const farmFlushToken = "";`}
|
|
9584
9660
|
const renderPageElement = async () => {
|
|
9585
9661
|
// First, render the page content
|
|
9586
9662
|
let pageElement;
|
|
@@ -9702,7 +9778,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9702
9778
|
}
|
|
9703
9779
|
|
|
9704
9780
|
wrappedElement = wrapWithFarmIntegrationProviders(wrappedElement);
|
|
9705
|
-
return renderFarmElement(ReactDOMServer, wrappedElement, route.pattern,
|
|
9781
|
+
return renderFarmElement(ReactDOMServer, wrappedElement, route.pattern, farmFlushToken);
|
|
9706
9782
|
};
|
|
9707
9783
|
const renderedPage = ${hasMiddlewareRuntime ? `await _runWithMiddlewareData(middlewareData, () =>
|
|
9708
9784
|
_runWithMiddlewareContext(middlewareContext, renderPageElement)
|
|
@@ -9770,7 +9846,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9770
9846
|
);
|
|
9771
9847
|
}
|
|
9772
9848
|
}
|
|
9773
|
-
${_optionalChain([config, 'access',
|
|
9849
|
+
${_optionalChain([config, 'access', _227 => _227.md, 'optionalAccess', _228 => _228.enabled]) ? `
|
|
9774
9850
|
// Advertise the Markdown mirror in the head as well as the Link header,
|
|
9775
9851
|
// using the public path the .md request will be resolved against.
|
|
9776
9852
|
mergedMetadata = addMetadataMarkdownAlternate(
|
|
@@ -9789,7 +9865,7 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
9789
9865
|
emitFarmEvent({ type: "cache.bypass", route: pathname, reason: "request-read" });
|
|
9790
9866
|
}
|
|
9791
9867
|
|
|
9792
|
-
const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access',
|
|
9868
|
+
const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _229 => _229.agent, 'optionalAccess', _230 => _230.jsonLd]), () => ( false)))} });
|
|
9793
9869
|
const title = renderedMetadata.title;
|
|
9794
9870
|
const metaTags = renderedMetadata.tags;
|
|
9795
9871
|
const hasFavicon = renderedMetadata.hasFavicon;
|
|
@@ -10009,7 +10085,11 @@ ${hasServerRuntimeIntegrations ? `
|
|
|
10009
10085
|
);
|
|
10010
10086
|
return applyProductionMiddlewareHeaders(farmOwnedResponse(streamedDocument, {
|
|
10011
10087
|
status: pageStatus,
|
|
10012
|
-
headers: {
|
|
10088
|
+
headers: {
|
|
10089
|
+
...responseHeaders,
|
|
10090
|
+
"x-farm-preload-streaming": "1",
|
|
10091
|
+
...(farmFlushToken ? { "F-Flush": farmFlushToken } : {}),
|
|
10092
|
+
},
|
|
10013
10093
|
}), middlewareHeaders);
|
|
10014
10094
|
}
|
|
10015
10095
|
|
|
@@ -10479,11 +10559,11 @@ ${generatePreloadResponseRuntimeSource()}
|
|
|
10479
10559
|
export async function fetch(request, context) {${imageRuntime === "none" ? "" : `
|
|
10480
10560
|
// The image optimizer's fetch of a local source is not a loopback visitor.
|
|
10481
10561
|
context = _withFarmImageSourceClientAddress(request, context);`}
|
|
10482
|
-
${_optionalChain([config, 'access',
|
|
10562
|
+
${_optionalChain([config, 'access', _231 => _231.agent, 'optionalAccess', _232 => _232.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
|
|
10483
10563
|
basePath: farmLocalAPIBasePath,
|
|
10484
10564
|
dispatch: async (localRequest) =>
|
|
10485
10565
|
(await handleAPIRequest(localRequest)) ?? Response.json({ error: "Not Found" }, { status: 404 }),
|
|
10486
|
-
}, () => handleFarmFetch(request, context));${_optionalChain([config, 'access',
|
|
10566
|
+
}, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _233 => _233.agent, 'optionalAccess', _234 => _234.noindexPreviews]) ? `
|
|
10487
10567
|
// Keep every response of a preview deployment out of search indexes.
|
|
10488
10568
|
return farmNoindexPreview ? applyFarmPreviewRobotsTag(response) : response;` : ""}
|
|
10489
10569
|
}
|
|
@@ -10676,11 +10756,11 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
10676
10756
|
}
|
|
10677
10757
|
if (_chunk76GHW3WIcjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
|
|
10678
10758
|
if (_chunk76GHW3WIcjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
|
|
10679
|
-
if (
|
|
10759
|
+
if (_chunkNPQLMP7Mcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
|
|
10680
10760
|
if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
|
|
10681
10761
|
const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
|
|
10682
|
-
if (_optionalChain([manifestEntry, 'optionalAccess',
|
|
10683
|
-
if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access',
|
|
10762
|
+
if (_optionalChain([manifestEntry, 'optionalAccess', _235 => _235.rendering]) === "dynamic") return "dynamic runtime manifest";
|
|
10763
|
+
if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _236 => _236.regions, 'optionalAccess', _237 => _237.length])) || manifestEntry.maxDuration !== void 0)) {
|
|
10684
10764
|
return "route runtime controls";
|
|
10685
10765
|
}
|
|
10686
10766
|
const routeRule = getEffectiveRouteRule(config, pathname);
|
|
@@ -10692,11 +10772,34 @@ function getPhysicalPrerenderBypassReason(options) {
|
|
|
10692
10772
|
}
|
|
10693
10773
|
return void 0;
|
|
10694
10774
|
}
|
|
10775
|
+
async function getFarmDocsPrerenderPages(config, root, preset) {
|
|
10776
|
+
if (!_optionalChain([config, 'access', _238 => _238.docs, 'optionalAccess', _239 => _239.enabled]) || !config.docs.prerender) return [];
|
|
10777
|
+
if (!_chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) || !_chunkGNJIYJMScjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
|
|
10778
|
+
_chunkVQJYGZNXcjs.logger.warn(
|
|
10779
|
+
"docs.prerender needs a docs adapter such as @farming-labs/farmjs; Farm's built-in docs renderer keeps rendering docs pages on request."
|
|
10780
|
+
);
|
|
10781
|
+
return [];
|
|
10782
|
+
}
|
|
10783
|
+
if (_chunkE552H232cjs.getFarmPresetRuntime.call(void 0, preset) === "edge") {
|
|
10784
|
+
_chunkVQJYGZNXcjs.logger.info(
|
|
10785
|
+
`\u21AA Keeping docs pages in the edge docs snapshot: docs.prerender writes static files on Node and serverless targets, not "${preset}".`
|
|
10786
|
+
);
|
|
10787
|
+
return [];
|
|
10788
|
+
}
|
|
10789
|
+
const pages = await _chunkGNJIYJMScjs.listFarmDocsAdapterPages.call(void 0, config.docs, { root, srcDir: config.srcDir });
|
|
10790
|
+
if (!pages) {
|
|
10791
|
+
_chunkVQJYGZNXcjs.logger.warn(
|
|
10792
|
+
`The docs adapter ${JSON.stringify(config.docs.adapter.id)} does not list its pages for prerendering; upgrade it to prerender docs pages. They render on request until then.`
|
|
10793
|
+
);
|
|
10794
|
+
return [];
|
|
10795
|
+
}
|
|
10796
|
+
return pages;
|
|
10797
|
+
}
|
|
10695
10798
|
function hasFarmNitroCacheRouteRule(routeRules) {
|
|
10696
10799
|
return Object.values(routeRules || {}).some((rule) => {
|
|
10697
|
-
const swr = _optionalChain([rule, 'optionalAccess',
|
|
10698
|
-
const cache = _optionalChain([rule, 'optionalAccess',
|
|
10699
|
-
const headers = _optionalChain([rule, 'optionalAccess',
|
|
10800
|
+
const swr = _optionalChain([rule, 'optionalAccess', _240 => _240.swr]);
|
|
10801
|
+
const cache = _optionalChain([rule, 'optionalAccess', _241 => _241.cache]);
|
|
10802
|
+
const headers = _optionalChain([rule, 'optionalAccess', _242 => _242.headers]);
|
|
10700
10803
|
return swr !== void 0 && swr !== false || cache !== void 0 && cache !== false || !!headers && typeof headers === "object" && Object.keys(headers).length > 0;
|
|
10701
10804
|
});
|
|
10702
10805
|
}
|
|
@@ -10709,10 +10812,10 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
10709
10812
|
const nitroBuilder = nitroBuilderResult.value;
|
|
10710
10813
|
const isVercel = preset === "vercel" || preset === "vercel-edge";
|
|
10711
10814
|
const isCloudflareWorker = preset === "cloudflare-module";
|
|
10712
|
-
const outputDir =
|
|
10815
|
+
const outputDir = _chunkNPQLMP7Mcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
10713
10816
|
const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
|
|
10714
10817
|
const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
|
|
10715
|
-
const imageRuntime =
|
|
10818
|
+
const imageRuntime = _chunkWZW6LEHMcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
|
|
10716
10819
|
const hasGeneratedMetadataImages = Array.from(routeManager.getMetadataImages().values()).some(
|
|
10717
10820
|
(image) => image.sourceType === "module"
|
|
10718
10821
|
);
|
|
@@ -10733,12 +10836,19 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
10733
10836
|
const ssgCollectionPromise = routeManager.collectSSGPages();
|
|
10734
10837
|
const middlewareRoutesPromise = discoverMiddlewareRoutes(_chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, config));
|
|
10735
10838
|
const configuredResponseRoutesPromise = Promise.all([config.redirects(), config.rewrites()]);
|
|
10839
|
+
const docsPrerenderPagesPromise = getFarmDocsPrerenderPages(config, root, preset);
|
|
10736
10840
|
const farmWorkflows = await _chunkXB24LZWIcjs.prepareFarmWorkflowsForNitro.call(void 0, config);
|
|
10737
10841
|
const farmCron = await _chunkXYL4HSVCcjs.prepareFarmCronForNitro.call(void 0, config);
|
|
10738
|
-
const [
|
|
10842
|
+
const [
|
|
10843
|
+
{ ssg: ssgPages },
|
|
10844
|
+
middlewareRoutes,
|
|
10845
|
+
[configuredRedirects, configuredRewrites],
|
|
10846
|
+
docsPrerenderPages
|
|
10847
|
+
] = await Promise.all([
|
|
10739
10848
|
ssgCollectionPromise,
|
|
10740
10849
|
middlewareRoutesPromise,
|
|
10741
|
-
configuredResponseRoutesPromise
|
|
10850
|
+
configuredResponseRoutesPromise,
|
|
10851
|
+
docsPrerenderPagesPromise
|
|
10742
10852
|
]);
|
|
10743
10853
|
const redirectSources = [
|
|
10744
10854
|
...routeManager.getRedirects().map((route) => route.source),
|
|
@@ -10747,7 +10857,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
10747
10857
|
const rewriteSources = configuredRewrites.map((route) => route.source);
|
|
10748
10858
|
const prerenderRoutes = [];
|
|
10749
10859
|
const skippedPrerenderRoutes = [];
|
|
10750
|
-
const middlewareRoutesWithConfig = ssgPages.length > 0 ? await Promise.all(
|
|
10860
|
+
const middlewareRoutesWithConfig = ssgPages.length > 0 || docsPrerenderPages.length > 0 ? await Promise.all(
|
|
10751
10861
|
middlewareRoutes.map(async (route) => ({
|
|
10752
10862
|
...route,
|
|
10753
10863
|
config: await readMiddlewareFileConfig(route.filePath)
|
|
@@ -10770,6 +10880,26 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
|
|
|
10770
10880
|
}
|
|
10771
10881
|
prerenderRoutes.push(page.urlPath);
|
|
10772
10882
|
}
|
|
10883
|
+
const docsRouteRuntimeManifest = {
|
|
10884
|
+
...routeRuntimeManifest,
|
|
10885
|
+
routes: routeRuntimeManifest.routes.filter((entry) => entry.kind !== "page")
|
|
10886
|
+
};
|
|
10887
|
+
for (const pathname of docsPrerenderPages) {
|
|
10888
|
+
if (prerenderRoutes.includes(pathname)) continue;
|
|
10889
|
+
const reason = getPhysicalPrerenderBypassReason({
|
|
10890
|
+
config,
|
|
10891
|
+
middlewareRoutes: middlewareRoutesWithConfig,
|
|
10892
|
+
routeRuntimeManifest: docsRouteRuntimeManifest,
|
|
10893
|
+
redirectSources,
|
|
10894
|
+
rewriteSources,
|
|
10895
|
+
pathname
|
|
10896
|
+
});
|
|
10897
|
+
if (reason) {
|
|
10898
|
+
skippedPrerenderRoutes.push({ pathname, reason });
|
|
10899
|
+
continue;
|
|
10900
|
+
}
|
|
10901
|
+
prerenderRoutes.push(pathname);
|
|
10902
|
+
}
|
|
10773
10903
|
for (const skipped of skippedPrerenderRoutes) {
|
|
10774
10904
|
_chunkVQJYGZNXcjs.logger.info(`\u21AA Keeping SSG route ${skipped.pathname} server-handled (${skipped.reason})`);
|
|
10775
10905
|
}
|
|
@@ -11195,20 +11325,20 @@ function toFarmNodeResponse(request, response) {
|
|
|
11195
11325
|
snapshotSSRRebundleOptions(nitroConfig)
|
|
11196
11326
|
);
|
|
11197
11327
|
const requestedBuilder = _nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER));
|
|
11198
|
-
const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access',
|
|
11199
|
-
_optionalChain([nitroConfig, 'access',
|
|
11200
|
-
(handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess',
|
|
11328
|
+
const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _243 => _243.rollupConfig, 'optionalAccess', _244 => _244.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _245 => _245.rollupConfig, 'optionalAccess', _246 => _246.plugins])) && customRollupKeys.length === 0 && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _247 => _247.output, 'optionalAccess', _248 => _248.serverDir]) || "") === _path2.default.resolve(expectedServerDir) && Boolean(
|
|
11329
|
+
_optionalChain([nitroConfig, 'access', _249 => _249.handlers, 'optionalAccess', _250 => _250.some, 'call', _251 => _251(
|
|
11330
|
+
(handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _252 => _252.handler]) || "") === nitroEntryPath
|
|
11201
11331
|
)])
|
|
11202
11332
|
);
|
|
11203
11333
|
const selectRolldownBuilder = canReusePrebuiltSSR && requestedBuilder === void 0 && await canUseRolldownBuilder();
|
|
11204
11334
|
if (selectRolldownBuilder) nitroConfig.builder = "rolldown";
|
|
11205
11335
|
const useRolldownBuilder = canReusePrebuiltSSR && (_nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER))) === "rolldown";
|
|
11206
11336
|
const shouldMinify = nitroConfig.minify !== false;
|
|
11207
|
-
const keepServerNames = !(_optionalChain([config, 'access',
|
|
11337
|
+
const keepServerNames = !(_optionalChain([config, 'access', _253 => _253.docs, 'optionalAccess', _254 => _254.enabled]) && _optionalChain([config, 'access', _255 => _255.docs, 'access', _256 => _256.adapter, 'optionalAccess', _257 => _257.server]));
|
|
11208
11338
|
const useFarmServerMinifier = shouldMinify && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig;
|
|
11209
11339
|
const serverChunkMinifier = useFarmServerMinifier ? createServerChunkMinifyPlugin({ keepNames: keepServerNames, target: "esnext" }) : null;
|
|
11210
11340
|
if (canReusePrebuiltSSR) {
|
|
11211
|
-
const configuredRollupPlugins = _optionalChain([nitroConfig, 'access',
|
|
11341
|
+
const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _258 => _258.rollupConfig, 'optionalAccess', _259 => _259.plugins]);
|
|
11212
11342
|
nitroConfig.rollupConfig = {
|
|
11213
11343
|
...nitroConfig.rollupConfig,
|
|
11214
11344
|
plugins: [
|
|
@@ -11219,9 +11349,9 @@ function toFarmNodeResponse(request, response) {
|
|
|
11219
11349
|
}
|
|
11220
11350
|
nitroConfig.minify = useFarmServerMinifier ? false : shouldMinify;
|
|
11221
11351
|
const nitroInstance = await nitroBuilder.createNitro(nitroConfig);
|
|
11222
|
-
if (_optionalChain([config, 'access',
|
|
11352
|
+
if (_optionalChain([config, 'access', _260 => _260.md, 'optionalAccess', _261 => _261.enabled])) {
|
|
11223
11353
|
nitroInstance.hooks.hook("prerender:generate", (route) => {
|
|
11224
|
-
if (!route.contents || !_optionalChain([route, 'access',
|
|
11354
|
+
if (!route.contents || !_optionalChain([route, 'access', _262 => _262.contentType, 'optionalAccess', _263 => _263.toLowerCase, 'call', _264 => _264(), 'access', _265 => _265.includes, 'call', _266 => _266("html")])) return;
|
|
11225
11355
|
const alternatePath = _chunkWJFFPXCVcjs.getFarmMarkdownAlternatePath.call(void 0, config.md, route.route);
|
|
11226
11356
|
if (!alternatePath) return;
|
|
11227
11357
|
const routeRule = nitroInstance.options.routeRules[route.route] || {};
|
|
@@ -11242,7 +11372,7 @@ function toFarmNodeResponse(request, response) {
|
|
|
11242
11372
|
}
|
|
11243
11373
|
if (config.security.csp && config.security.csp.nonce) {
|
|
11244
11374
|
nitroInstance.hooks.hook("prerender:generate", async (route) => {
|
|
11245
|
-
if (!route.contents || !_optionalChain([route, 'access',
|
|
11375
|
+
if (!route.contents || !_optionalChain([route, 'access', _267 => _267.contentType, 'optionalAccess', _268 => _268.toLowerCase, 'call', _269 => _269(), 'access', _270 => _270.includes, 'call', _271 => _271("html")])) return;
|
|
11246
11376
|
const staticCsp = await _chunk6JHZPB52cjs.applyFarmCspHashesToHtml.call(void 0, route.contents, config.security);
|
|
11247
11377
|
if (!staticCsp) return;
|
|
11248
11378
|
route.contents = staticCsp.html;
|
|
@@ -11317,13 +11447,13 @@ function toFarmNodeResponse(request, response) {
|
|
|
11317
11447
|
}
|
|
11318
11448
|
if (prerenderRoutes.length > 0) {
|
|
11319
11449
|
_chunkVQJYGZNXcjs.logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
|
|
11320
|
-
const previousPrerender = process.env[
|
|
11321
|
-
process.env[
|
|
11450
|
+
const previousPrerender = process.env[_chunkQXPSWMUDcjs.FARM_PRERENDER_ENV];
|
|
11451
|
+
process.env[_chunkQXPSWMUDcjs.FARM_PRERENDER_ENV] = "1";
|
|
11322
11452
|
try {
|
|
11323
11453
|
await nitroBuilder.prerender(nitroInstance);
|
|
11324
11454
|
} finally {
|
|
11325
|
-
if (previousPrerender === void 0) delete process.env[
|
|
11326
|
-
else process.env[
|
|
11455
|
+
if (previousPrerender === void 0) delete process.env[_chunkQXPSWMUDcjs.FARM_PRERENDER_ENV];
|
|
11456
|
+
else process.env[_chunkQXPSWMUDcjs.FARM_PRERENDER_ENV] = previousPrerender;
|
|
11327
11457
|
}
|
|
11328
11458
|
}
|
|
11329
11459
|
const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs4, preset) : Promise.resolve(null);
|
|
@@ -11448,7 +11578,7 @@ async function moveVercelOutputPath(src, dest, fs4) {
|
|
|
11448
11578
|
await fs4.rename(src, dest);
|
|
11449
11579
|
return;
|
|
11450
11580
|
} catch (error) {
|
|
11451
|
-
const code = _optionalChain([error, 'optionalAccess',
|
|
11581
|
+
const code = _optionalChain([error, 'optionalAccess', _272 => _272.code]);
|
|
11452
11582
|
if (code !== "EPERM" && code !== "EACCES" && code !== "EXDEV" && code !== "ENOTEMPTY") {
|
|
11453
11583
|
throw error;
|
|
11454
11584
|
}
|
|
@@ -11474,7 +11604,7 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
|
|
|
11474
11604
|
try {
|
|
11475
11605
|
await moveVercelOutputPath(publicDir, staticDir, fs4);
|
|
11476
11606
|
} catch (error) {
|
|
11477
|
-
if (_optionalChain([error, 'optionalAccess',
|
|
11607
|
+
if (_optionalChain([error, 'optionalAccess', _273 => _273.code]) !== "ENOENT") throw error;
|
|
11478
11608
|
}
|
|
11479
11609
|
await copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4);
|
|
11480
11610
|
await copyPrismaClientForVercel(root, nitroFuncDir, fs4);
|
|
@@ -11503,10 +11633,29 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
|
|
|
11503
11633
|
_chunkVQJYGZNXcjs.logger.info("\u2705 Post-processed Vercel output for Build Output API v3");
|
|
11504
11634
|
}
|
|
11505
11635
|
async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4) {
|
|
11506
|
-
|
|
11636
|
+
if (!_optionalChain([config, 'access', _274 => _274.docs, 'optionalAccess', _275 => _275.enabled])) return;
|
|
11637
|
+
const [mainRoot, ...extraRoots] = _chunk5N7QAGEAcjs.getFarmDocsRoots.call(void 0, config.docs);
|
|
11638
|
+
await copyFarmDocsRootContent(
|
|
11639
|
+
mainRoot,
|
|
11640
|
+
root,
|
|
11641
|
+
config.srcDir,
|
|
11642
|
+
_path2.default.join(nitroFuncDir, "farm-docs-content"),
|
|
11643
|
+
fs4
|
|
11644
|
+
);
|
|
11645
|
+
for (const [index, docsRoot] of extraRoots.entries()) {
|
|
11646
|
+
await copyFarmDocsRootContent(
|
|
11647
|
+
docsRoot,
|
|
11648
|
+
root,
|
|
11649
|
+
config.srcDir,
|
|
11650
|
+
_path2.default.join(nitroFuncDir, "farm-docs-roots", String(index)),
|
|
11651
|
+
fs4
|
|
11652
|
+
);
|
|
11653
|
+
}
|
|
11654
|
+
}
|
|
11655
|
+
async function copyFarmDocsRootContent(docs, root, srcDir, bundledContentDir, fs4) {
|
|
11656
|
+
const docsContentDir = resolveBuildDocsContentDir(docs, root, srcDir);
|
|
11507
11657
|
if (!docsContentDir) return;
|
|
11508
|
-
const
|
|
11509
|
-
const lastModifiedManifest = _chunkIOUOGRDXcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
|
|
11658
|
+
const lastModifiedManifest = _chunk5N7QAGEAcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
|
|
11510
11659
|
fallback: "now"
|
|
11511
11660
|
});
|
|
11512
11661
|
await fs4.rm(bundledContentDir, { recursive: true, force: true });
|
|
@@ -11516,7 +11665,7 @@ async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4) {
|
|
|
11516
11665
|
force: true
|
|
11517
11666
|
});
|
|
11518
11667
|
await fs4.writeFile(
|
|
11519
|
-
_path2.default.join(bundledContentDir,
|
|
11668
|
+
_path2.default.join(bundledContentDir, _chunk5N7QAGEAcjs.FARM_DOCS_LAST_MODIFIED_MANIFEST),
|
|
11520
11669
|
`${JSON.stringify(lastModifiedManifest, null, 2)}
|
|
11521
11670
|
`
|
|
11522
11671
|
);
|
|
@@ -11587,7 +11736,7 @@ async function stageSharpRuntime(config, root, distDir, fs4, preset) {
|
|
|
11587
11736
|
try {
|
|
11588
11737
|
await copyPackage("sharp", sharpRequire);
|
|
11589
11738
|
if (!copiedPackages.has("sharp")) {
|
|
11590
|
-
throw new Error(`Farm image optimization requires sharp. ${
|
|
11739
|
+
throw new Error(`Farm image optimization requires sharp. ${_chunkWZW6LEHMcjs.SHARP_INSTALL_HINT}`);
|
|
11591
11740
|
}
|
|
11592
11741
|
} catch (error) {
|
|
11593
11742
|
await fs4.rm(stageDir, { recursive: true, force: true });
|
|
@@ -11817,7 +11966,7 @@ function createBuildTargetBaseline(config) {
|
|
|
11817
11966
|
preset,
|
|
11818
11967
|
distDir,
|
|
11819
11968
|
outputDir,
|
|
11820
|
-
outputWasDerived: outputDir ===
|
|
11969
|
+
outputWasDerived: outputDir === _chunkNPQLMP7Mcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
|
|
11821
11970
|
};
|
|
11822
11971
|
}
|
|
11823
11972
|
function resolveBuildTargets(config, options, baseline) {
|
|
@@ -11826,8 +11975,8 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
11826
11975
|
const distDir = config.distDir || ".farm";
|
|
11827
11976
|
const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
|
|
11828
11977
|
const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
|
|
11829
|
-
const deployTarget = preset === config.deploy.preset ? config.deploy.target :
|
|
11830
|
-
const outputDir = shouldRefreshDerivedOutput ?
|
|
11978
|
+
const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkNPQLMP7Mcjs.getDeployTargetForPreset.call(void 0, preset);
|
|
11979
|
+
const outputDir = shouldRefreshDerivedOutput ? _chunkNPQLMP7Mcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
|
|
11831
11980
|
return {
|
|
11832
11981
|
root,
|
|
11833
11982
|
preset,
|
|
@@ -11835,7 +11984,7 @@ function resolveBuildTargets(config, options, baseline) {
|
|
|
11835
11984
|
distDir,
|
|
11836
11985
|
deployTarget,
|
|
11837
11986
|
outputDir,
|
|
11838
|
-
deployOutputDir:
|
|
11987
|
+
deployOutputDir: _chunkNPQLMP7Mcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
|
|
11839
11988
|
};
|
|
11840
11989
|
}
|
|
11841
11990
|
async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
@@ -11872,12 +12021,12 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
11872
12021
|
};
|
|
11873
12022
|
config = {
|
|
11874
12023
|
...config,
|
|
11875
|
-
images:
|
|
12024
|
+
images: _chunkWZW6LEHMcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
|
|
11876
12025
|
root: targets.root,
|
|
11877
12026
|
preset: targets.preset
|
|
11878
12027
|
})
|
|
11879
12028
|
};
|
|
11880
|
-
if (_optionalChain([config, 'access',
|
|
12029
|
+
if (_optionalChain([config, 'access', _276 => _276.docs, 'optionalAccess', _277 => _277.enabled])) await _chunkV3UOEWCBcjs.loadFarmDocsEngine.call(void 0, );
|
|
11881
12030
|
pluginManager.updateContext({ config });
|
|
11882
12031
|
const { root, preset, srcDir, distDir, deployOutputDir } = targets;
|
|
11883
12032
|
_chunkVQJYGZNXcjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
|
|
@@ -11891,8 +12040,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
11891
12040
|
});
|
|
11892
12041
|
_chunkVQJYGZNXcjs.logger.info("\u{1F50D} Discovering routes and API endpoints...");
|
|
11893
12042
|
const productionViteResult = productionViteResultPromise ? (await productionViteResultPromise)[0] : void 0;
|
|
11894
|
-
if (_optionalChain([productionViteResult, 'optionalAccess',
|
|
11895
|
-
const productionVite = _optionalChain([productionViteResult, 'optionalAccess',
|
|
12043
|
+
if (_optionalChain([productionViteResult, 'optionalAccess', _278 => _278.status]) === "rejected") throw productionViteResult.reason;
|
|
12044
|
+
const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _279 => _279.value]);
|
|
11896
12045
|
const createViteServer = productionVite ? productionVite.createServer : (await import("vite")).createServer;
|
|
11897
12046
|
projectModuleServer = await createProjectModuleServer(
|
|
11898
12047
|
createViteServer,
|
|
@@ -11900,18 +12049,18 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
11900
12049
|
root,
|
|
11901
12050
|
rendererBuild.signal
|
|
11902
12051
|
);
|
|
11903
|
-
const farmApp =
|
|
12052
|
+
const farmApp = _chunkWZW6LEHMcjs.createFarmApp.call(void 0, config, projectModuleServer);
|
|
11904
12053
|
await farmApp.initialize();
|
|
11905
12054
|
const routeManager = farmApp.getRouteManager();
|
|
11906
12055
|
const serverRenderer = farmApp.getServerRenderer();
|
|
11907
|
-
const typeArtifacts =
|
|
12056
|
+
const typeArtifacts = _chunkUQHIWZZ6cjs.generateFarmTypeArtifacts.call(void 0, {
|
|
11908
12057
|
root,
|
|
11909
12058
|
srcDir,
|
|
11910
12059
|
layers: config.layers,
|
|
11911
12060
|
plugins: config.plugins,
|
|
11912
12061
|
extraRoutes: [
|
|
11913
|
-
..._optionalChain([config, 'access',
|
|
11914
|
-
...
|
|
12062
|
+
..._optionalChain([config, 'access', _280 => _280.openapi, 'optionalAccess', _281 => _281.enabled]) && config.openapi.route ? [config.openapi.route] : [],
|
|
12063
|
+
..._chunk5N7QAGEAcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
|
|
11915
12064
|
],
|
|
11916
12065
|
suppressLintOnLink: config.suppressLintOnLink,
|
|
11917
12066
|
componentExtensions: config.renderer.componentExtensions,
|
|
@@ -11995,7 +12144,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
|
|
|
11995
12144
|
throw error;
|
|
11996
12145
|
} finally {
|
|
11997
12146
|
try {
|
|
11998
|
-
await _optionalChain([projectModuleServer, 'optionalAccess',
|
|
12147
|
+
await _optionalChain([projectModuleServer, 'optionalAccess', _282 => _282.close, 'call', _283 => _283()]);
|
|
11999
12148
|
} finally {
|
|
12000
12149
|
rendererBuild.abort();
|
|
12001
12150
|
}
|
|
@@ -12006,7 +12155,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
12006
12155
|
ssr: true,
|
|
12007
12156
|
buildLifetime
|
|
12008
12157
|
});
|
|
12009
|
-
const viteConfig =
|
|
12158
|
+
const viteConfig = _chunkWZW6LEHMcjs.mergeFarmViteConfig.call(void 0,
|
|
12010
12159
|
{
|
|
12011
12160
|
root,
|
|
12012
12161
|
appType: "custom",
|
|
@@ -12018,19 +12167,19 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
12018
12167
|
},
|
|
12019
12168
|
plugins: [
|
|
12020
12169
|
...rendererVitePlugins,
|
|
12021
|
-
|
|
12170
|
+
_chunkWZW6LEHMcjs.farmFontImportsPlugin.call(void 0, {
|
|
12022
12171
|
root,
|
|
12023
12172
|
basePath: config.basePath,
|
|
12024
12173
|
publicDir: config.publicDir
|
|
12025
12174
|
}),
|
|
12026
|
-
|
|
12175
|
+
_chunkNK2VWS7Pcjs.farmEnvironmentFunctionsPlugin.call(void 0, )
|
|
12027
12176
|
],
|
|
12028
12177
|
server: {
|
|
12029
12178
|
middlewareMode: true,
|
|
12030
12179
|
hmr: false
|
|
12031
12180
|
},
|
|
12032
12181
|
resolve: {
|
|
12033
|
-
alias:
|
|
12182
|
+
alias: _chunkWZW6LEHMcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
|
|
12034
12183
|
dedupe: [...config.renderer.dedupe || []]
|
|
12035
12184
|
},
|
|
12036
12185
|
optimizeDeps: {
|
|
@@ -12063,10 +12212,10 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
|
|
|
12063
12212
|
noDiscovery: true
|
|
12064
12213
|
},
|
|
12065
12214
|
// An app or plugin that brings its own SSR environment keeps it.
|
|
12066
|
-
environments: _optionalChain([viteConfig, 'access',
|
|
12215
|
+
environments: _optionalChain([viteConfig, 'access', _284 => _284.environments, 'optionalAccess', _285 => _285.ssr, 'optionalAccess', _286 => _286.dev, 'optionalAccess', _287 => _287.createEnvironment]) ? viteConfig.environments : {
|
|
12067
12216
|
...viteConfig.environments,
|
|
12068
12217
|
ssr: {
|
|
12069
|
-
..._optionalChain([viteConfig, 'access',
|
|
12218
|
+
..._optionalChain([viteConfig, 'access', _288 => _288.environments, 'optionalAccess', _289 => _289.ssr]),
|
|
12070
12219
|
...await createFarmProjectModuleSsrEnvironment()
|
|
12071
12220
|
}
|
|
12072
12221
|
}
|
|
@@ -12094,7 +12243,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
|
|
|
12094
12243
|
farmI18nClientBridgePlugin(),
|
|
12095
12244
|
farmServerOnlyEntriesPlugin(),
|
|
12096
12245
|
farmPlugin(config, pluginManager),
|
|
12097
|
-
|
|
12246
|
+
_chunkNK2VWS7Pcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
12098
12247
|
],
|
|
12099
12248
|
mode: "production"
|
|
12100
12249
|
});
|
|
@@ -12122,12 +12271,12 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
|
|
|
12122
12271
|
define: {
|
|
12123
12272
|
__FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
|
|
12124
12273
|
__FARM_ENV__: JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, config.env)),
|
|
12125
|
-
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access',
|
|
12274
|
+
__FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _290 => _290.env, 'optionalAccess', _291 => _291.public]) || {})
|
|
12126
12275
|
},
|
|
12127
12276
|
plugins: [
|
|
12128
12277
|
farmI18nClientBridgePlugin(),
|
|
12129
12278
|
farmPlugin(config, pluginManager),
|
|
12130
|
-
|
|
12279
|
+
_chunkNK2VWS7Pcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
|
|
12131
12280
|
],
|
|
12132
12281
|
mode: "production"
|
|
12133
12282
|
});
|
|
@@ -12155,7 +12304,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
12155
12304
|
if (pluginManager) {
|
|
12156
12305
|
nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
|
|
12157
12306
|
}
|
|
12158
|
-
const outputDir =
|
|
12307
|
+
const outputDir = _chunkNPQLMP7Mcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
|
|
12159
12308
|
const serverOutputDir = _path2.default.join(outputDir, "server");
|
|
12160
12309
|
const publicOutputDir = _path2.default.join(outputDir, "public");
|
|
12161
12310
|
const { mkdir, cp } = await import("fs/promises");
|
|
@@ -12226,7 +12375,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
|
|
|
12226
12375
|
root,
|
|
12227
12376
|
preset,
|
|
12228
12377
|
distDir,
|
|
12229
|
-
outputDir:
|
|
12378
|
+
outputDir: _chunkNPQLMP7Mcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
|
|
12230
12379
|
});
|
|
12231
12380
|
}
|
|
12232
12381
|
}
|