@farm.js/core 0.1.50 → 0.1.51-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +163 -3
- package/dist/{agent-mcp-CIMH324y.d.mts → agent-mcp.d-BPzpKBHQ.d.mts} +1 -1
- package/dist/{agent-mcp-9BMbRgg_.d.ts → agent-mcp.d-ZuuNgrkQ.d.ts} +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-CN7C74WX.cjs → analyzer-AZULAOPL.cjs} +2 -2
- package/dist/{analyzer-DDW34OMC.mjs → analyzer-V74FTD2F.mjs} +1 -1
- package/dist/api/client.d.mts +4 -4
- package/dist/api/client.d.ts +4 -4
- package/dist/api/route-manager.cjs +5 -5
- package/dist/api/route-manager.d.mts +19 -19
- package/dist/api/route-manager.d.ts +19 -19
- package/dist/api/route-manager.mjs +4 -4
- 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 +7 -7
- package/dist/api.d.mts +21 -21
- package/dist/api.d.ts +21 -21
- package/dist/api.mjs +6 -6
- package/dist/{app-manifest-D0kaXdwu.d.ts → app-manifest.d-BJDcZn3W.d.mts} +1 -1
- package/dist/{app-manifest-CQDJOKL2.d.mts → app-manifest.d-HWhqbP2X.d.ts} +1 -1
- package/dist/app-markdown.d.mts +14 -14
- package/dist/app-markdown.d.ts +14 -14
- package/dist/{app-BWibTHVT.d.ts → app.d-B5EWdob-.d.ts} +12 -10
- package/dist/{app-DVJ13FPA.d.mts → app.d-DOGW1KI8.d.mts} +12 -10
- package/dist/base-path.d-BOUV5ozD.d.mts +10 -0
- package/dist/base-path.d-BOUV5ozD.d.ts +10 -0
- package/dist/{chunk-B5S2JS6M.cjs → chunk-2756SHCI.cjs} +372 -305
- package/dist/{chunk-RWT2BTJT.cjs → chunk-2IAPKPEB.cjs} +6 -6
- package/dist/{chunk-2G63BIRL.mjs → chunk-2KVDHNQS.mjs} +8 -11
- package/dist/{chunk-NJVFPJ2Y.cjs → chunk-3OWVWZ6R.cjs} +28 -2
- package/dist/{chunk-WVBUXNBX.mjs → chunk-5A5GAZ75.mjs} +296 -106
- package/dist/{chunk-GERUXONA.cjs → chunk-5A77OEIG.cjs} +4 -1
- package/dist/{chunk-4HBKBHVP.mjs → chunk-5ENW27SL.mjs} +1 -1
- package/dist/{chunk-FACTMUPI.cjs → chunk-5IONBVJY.cjs} +33 -22
- package/dist/{chunk-X2EL3BLH.cjs → chunk-5N7QAGEA.cjs} +36 -9
- package/dist/{chunk-DGOLAZLV.cjs → chunk-65Y5SIBH.cjs} +1 -1
- package/dist/{chunk-MTB57GOK.mjs → chunk-724WT3NI.mjs} +4 -2
- package/dist/{chunk-C73RIAEF.mjs → chunk-72NBDVWQ.mjs} +18 -7
- package/dist/{chunk-VCKGOXFI.cjs → chunk-76GHW3WI.cjs} +7 -1
- package/dist/{chunk-ZIBIE7AH.mjs → chunk-7UPCJDB5.mjs} +7 -1
- package/dist/{chunk-CPXDDWGL.mjs → chunk-AER5I65K.mjs} +1 -1
- package/dist/{chunk-RHOR2J6V.cjs → chunk-AGR7VJH2.cjs} +1 -1
- package/dist/{chunk-WB6XES4V.mjs → chunk-ALEUMLJN.mjs} +34 -5
- package/dist/{chunk-OD6WM3I7.mjs → chunk-AV26KHTG.mjs} +1 -1
- package/dist/{chunk-L6QDME5Z.cjs → chunk-B3GZAQSC.cjs} +3 -3
- package/dist/{chunk-ZLOQQ2UF.mjs → chunk-BSEKNTMS.mjs} +107 -40
- package/dist/{chunk-WAPQWAE6.cjs → chunk-CECUDGXQ.cjs} +9 -8
- package/dist/chunk-CKPTIEDX.cjs +12 -0
- package/dist/{chunk-IUQLRTTO.mjs → chunk-CO6UYM2D.mjs} +14 -1
- package/dist/{chunk-SHJJM6OG.mjs → chunk-CZ35L6PL.mjs} +9 -2
- package/dist/{chunk-EQMTJBB7.cjs → chunk-DZZHTMWM.cjs} +35 -6
- package/dist/{chunk-3ATXWZPH.cjs → chunk-E36C43IX.cjs} +13 -16
- package/dist/{chunk-J2ZEVDEK.cjs → chunk-EHB77D5U.cjs} +3 -3
- package/dist/{chunk-KO2NWUKN.mjs → chunk-EIMK7D2D.mjs} +33 -6
- package/dist/{chunk-CY7H5KS4.cjs → chunk-EKJYE4Y7.cjs} +2 -2
- package/dist/{chunk-2VCC3GVC.mjs → chunk-EOSFVNXZ.mjs} +1 -1
- package/dist/{chunk-IWJKJDNW.mjs → chunk-EWC76P5D.mjs} +53 -32
- package/dist/{chunk-WQGRD5BJ.cjs → chunk-EX6ZSN5P.cjs} +1 -16
- package/dist/{chunk-6QA2SXVH.cjs → chunk-FK25QSVC.cjs} +2 -1
- package/dist/{chunk-BW6SCVYX.mjs → chunk-FSQMN2MQ.mjs} +1 -0
- package/dist/{chunk-2H3FJYY6.mjs → chunk-FSXSQQTV.mjs} +3 -2
- package/dist/chunk-GNZIAJGB.mjs +358 -0
- package/dist/{chunk-TXK4D46O.mjs → chunk-H3ASZDT7.mjs} +21 -1
- package/dist/{chunk-B6PREBN6.cjs → chunk-HASX6DC7.cjs} +8 -8
- package/dist/{chunk-76R5GJER.mjs → chunk-I3EFXUAR.mjs} +60 -13
- package/dist/{chunk-HYN3LLG7.cjs → chunk-IFBINMI4.cjs} +3 -3
- package/dist/{chunk-CBJKDB6F.mjs → chunk-IRSS4HS4.mjs} +1 -1
- package/dist/{chunk-4T25YCZ5.cjs → chunk-JVBNKWLV.cjs} +81 -34
- package/dist/{chunk-VOZ5DI7D.mjs → chunk-JWI5PUO2.mjs} +6 -2
- package/dist/{chunk-YAXOEAND.cjs → chunk-KHXAJ2KA.cjs} +6 -6
- package/dist/{chunk-2DEPNLXK.mjs → chunk-KMB5BMFX.mjs} +122 -12
- package/dist/{chunk-M7LKA632.mjs → chunk-KU7MBLDZ.mjs} +1 -1
- package/dist/{chunk-WXHDVXJE.mjs → chunk-KY32FWK7.mjs} +2 -2
- package/dist/{chunk-EQWWOQTK.cjs → chunk-LEIXUFJN.cjs} +6 -2
- package/dist/{chunk-2GLQSIZD.mjs → chunk-LMFJCXDD.mjs} +1 -1
- package/dist/{chunk-IXSMFKZ2.cjs → chunk-LNM57D3H.cjs} +4 -4
- package/dist/{chunk-5V4KZOZO.mjs → chunk-LZ4SB57H.mjs} +2 -2
- package/dist/chunk-N4AQNEXR.cjs +17 -0
- package/dist/{chunk-J37KTQIA.cjs → chunk-NK2VWS7P.cjs} +52 -3
- package/dist/{chunk-X3HOVNHI.mjs → chunk-NN3MOPSI.mjs} +7 -7
- package/dist/{chunk-JZMZKABS.cjs → chunk-NWUHS6GV.cjs} +3 -2
- package/dist/{chunk-XLLVWLWO.mjs → chunk-PIHKO25G.mjs} +1 -1
- package/dist/chunk-PIUTGRDI.cjs +358 -0
- package/dist/{chunk-JJOWY3XD.mjs → chunk-QAIAFCRZ.mjs} +8 -6
- package/dist/{chunk-Q3UU2KXC.mjs → chunk-QMDU6QHN.mjs} +4 -1
- package/dist/{chunk-75WWOZ5C.mjs → chunk-QOSDWGKT.mjs} +1 -1
- package/dist/{chunk-GOOK2J2W.cjs → chunk-RMPNYUGT.cjs} +9 -7
- package/dist/{chunk-HWCHIBJZ.mjs → chunk-SCRC5AMM.mjs} +5 -5
- package/dist/{chunk-PXEXOQ5R.mjs → chunk-SHS6KXOZ.mjs} +1 -1
- package/dist/{chunk-ETF5C6HR.cjs → chunk-SJ23LJ3N.cjs} +3 -3
- package/dist/{chunk-JHXJBNLY.cjs → chunk-SUCDVKUB.cjs} +21 -1
- package/dist/{chunk-7ONZDKVY.mjs → chunk-T4EW7AAD.mjs} +2 -2
- package/dist/{chunk-F5LERVY3.cjs → chunk-TT66CP3P.cjs} +13 -13
- package/dist/{chunk-IUBDMDZZ.cjs → chunk-UQHIWZZ6.cjs} +15 -8
- package/dist/{chunk-LYWAGXXW.cjs → chunk-VITZRYW3.cjs} +131 -21
- package/dist/{chunk-XN2MB4QZ.cjs → chunk-VQJYGZNX.cjs} +4 -4
- package/dist/{chunk-KGP76FSV.mjs → chunk-VS7EHLLW.mjs} +1 -1
- package/dist/{chunk-5PKDHKQP.cjs → chunk-WFVSAT7Y.cjs} +6 -4
- package/dist/{chunk-UY6HS5PF.cjs → chunk-X2AMN2WV.cjs} +10 -10
- package/dist/{chunk-474FO3UE.cjs → chunk-X2M4XN4V.cjs} +213 -192
- package/dist/chunk-X3EFRVXY.mjs +12 -0
- package/dist/{chunk-UCQ52TJY.mjs → chunk-X3JNB2TB.mjs} +1 -1
- package/dist/{chunk-IQXGHGZF.cjs → chunk-XB24LZWI.cjs} +5 -5
- package/dist/{chunk-BNMHXVLL.mjs → chunk-XMHERKSE.mjs} +0 -15
- package/dist/{chunk-CGCJ2TJU.cjs → chunk-XPMC4E2G.cjs} +3 -3
- package/dist/{chunk-KZH6YLND.cjs → chunk-XY4DYGSU.cjs} +603 -413
- package/dist/{chunk-C7425KDG.cjs → chunk-XYL4HSVC.cjs} +2 -2
- package/dist/{chunk-HHFMECFO.mjs → chunk-Y2G5SJFB.mjs} +2 -1
- package/dist/{chunk-2SVJGOAX.mjs → chunk-Y3N5BFRJ.mjs} +3 -3
- package/dist/{chunk-Z5MZDFX4.cjs → chunk-YIHRZBD7.cjs} +14 -1
- package/dist/chunk-Z5A6CNV2.mjs +60 -0
- package/dist/chunk-Z64V4WZI.mjs +17 -0
- package/dist/{chunk-E2BMCNMJ.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-BPfltM5m.d.ts → client-plugins.d-C0n8Yhh-.d.ts} +60 -14
- package/dist/{client-plugins-D4RO59f0.d.mts → client-plugins.d-C_3CdALC.d.mts} +60 -14
- package/dist/client-plugins.d.mts +13 -13
- package/dist/client-plugins.d.ts +13 -13
- package/dist/client.cjs +5 -4
- package/dist/client.d.mts +24 -24
- package/dist/client.d.ts +24 -24
- package/dist/client.mjs +4 -3
- package/dist/config.d.mts +13 -13
- package/dist/config.d.ts +13 -13
- package/dist/cron.cjs +4 -4
- package/dist/cron.mjs +3 -3
- 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-STG7HPRV.mjs → devtools-BU5IT2PD.mjs} +8 -8
- package/dist/{devtools-N5XTOECL.cjs → devtools-KJFUE5FO.cjs} +10 -10
- package/dist/docs.cjs +14 -12
- package/dist/docs.d.mts +23 -15
- package/dist/docs.d.ts +23 -15
- package/dist/docs.mjs +13 -11
- 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 +48 -44
- package/dist/{index-C-N3Pwg-.d.ts → index.d-B6M_8kmo.d.ts} +2 -2
- 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-k8o8eUOd.d.mts → index.d-CsGxS-hZ.d.mts} +2 -2
- package/dist/index.d.mts +42 -42
- package/dist/index.d.ts +42 -42
- package/dist/index.mjs +47 -43
- 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 +36 -35
- package/dist/internal/build-runtime.d.mts +16 -16
- package/dist/internal/build-runtime.d.ts +16 -16
- package/dist/internal/build-runtime.mjs +35 -34
- package/dist/internal/cli-runtime.cjs +18 -18
- package/dist/internal/cli-runtime.mjs +17 -17
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +4 -2
- package/dist/internal/client-runtime.d.mts +21 -21
- package/dist/internal/client-runtime.d.ts +21 -21
- package/dist/internal/client-runtime.mjs +3 -1
- package/dist/internal/compression-runtime.d.mts +13 -13
- package/dist/internal/compression-runtime.d.ts +13 -13
- package/dist/internal/config-runtime.cjs +10 -10
- package/dist/internal/config-runtime.d.mts +18 -18
- package/dist/internal/config-runtime.d.ts +18 -18
- package/dist/internal/config-runtime.mjs +9 -9
- package/dist/internal/form-actions.cjs +4 -3
- package/dist/internal/form-actions.d.mts +1 -1
- package/dist/internal/form-actions.d.ts +1 -1
- package/dist/internal/form-actions.mjs +3 -2
- 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.cjs +56 -0
- package/dist/internal/islands-runtime.d.mts +1 -1
- package/dist/internal/islands-runtime.d.ts +1 -1
- package/dist/internal/islands-runtime.mjs +57 -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 +15 -8
- package/dist/internal/production-runtime.d.mts +46 -30
- package/dist/internal/production-runtime.d.ts +46 -30
- package/dist/internal/production-runtime.mjs +14 -7
- package/dist/internal/server-fn-transform.cjs +13 -0
- package/dist/internal/server-fn-transform.d.mts +24 -0
- package/dist/internal/server-fn-transform.d.ts +24 -0
- package/dist/internal/server-fn-transform.mjs +13 -0
- package/dist/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 +8 -8
- package/dist/middleware.d.mts +15 -15
- package/dist/middleware.d.ts +15 -15
- package/dist/middleware.mjs +7 -7
- package/dist/mobile.d.mts +37 -10
- package/dist/mobile.d.ts +37 -10
- package/dist/{navigation-delegate-8xg3Zvp4.d.ts → navigation-delegate.d-C0BbdUgN.d.mts} +1 -1
- package/dist/{navigation-delegate-ji6elCKy.d.mts → navigation-delegate.d-jArRF0ZP.d.ts} +1 -1
- package/dist/navigation.d.mts +17 -17
- package/dist/navigation.d.ts +17 -17
- package/dist/{nitro-YPSZBYDK.cjs → nitro-CK7M4RMY.cjs} +11 -11
- package/dist/{nitro-2Q5NVY7L.mjs → nitro-R444AF3O.mjs} +7 -7
- package/dist/observability.d.mts +1 -1
- package/dist/observability.d.ts +1 -1
- package/dist/plugin.cjs +29 -27
- package/dist/plugin.d.mts +17 -17
- package/dist/plugin.d.ts +17 -17
- package/dist/plugin.mjs +28 -26
- package/dist/{production-runtime-TdKaYRj0.d.ts → production-runtime.d-DFaQ1qaV.d.mts} +3 -3
- package/dist/{production-runtime-DXnQQkQf.d.mts → production-runtime.d-UnXmSS_S.d.ts} +3 -3
- package/dist/{programmatic-routes-client-Dh1SDLSM.d.mts → programmatic-routes-client.d-BIowUXQC.d.mts} +10 -2
- package/dist/{programmatic-routes-client-BwiTndEC.d.ts → programmatic-routes-client.d-VZ0qcbH4.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-BPbwRbuN.d.ts → render-plan.d-BB6KrYjP.d.ts} +2 -2
- package/dist/{render-plan-BvCGXF6K.d.mts → render-plan.d-BNeqyPyJ.d.mts} +2 -2
- package/dist/renderer-client.cjs +8 -6
- package/dist/renderer-client.d.mts +19 -19
- package/dist/renderer-client.d.ts +19 -19
- package/dist/renderer-client.mjs +4 -2
- package/dist/{request-C_xTkJib.d.mts → request.d-BV1munmx.d.mts} +1 -1
- package/dist/{request-B8PGTZNR.d.ts → request.d-Bxhghm76.d.ts} +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-DlddURL1.d.mts → route-rendering.d-BIf7zE9d.d.ts} +1 -1
- package/dist/{route-rendering-RNtcj607.d.ts → route-rendering.d-DShqKlgK.d.mts} +1 -1
- package/dist/{route-DFhZj6jN.d.ts → route.d-BaVH3V0w.d.mts} +1 -1
- package/dist/{route-2_yXC6gv.d.mts → route.d-DBTEqifW.d.ts} +1 -1
- package/dist/{router-B97eB0Mq.d.mts → router.d-BE7i84fb.d.mts} +1 -1
- package/dist/{router-qUVaoEN8.d.ts → router.d-Bw3K3b0a.d.ts} +1 -1
- package/dist/routes.cjs +3 -2
- package/dist/{routes-8PT9cl60.d.ts → routes.d-DVZQL0-H.d.ts} +3 -3
- package/dist/{routes-kEUsXHx3.d.mts → routes.d-_5tBQexL.d.mts} +3 -3
- package/dist/routes.d.mts +14 -14
- package/dist/routes.d.ts +14 -14
- package/dist/routes.mjs +2 -1
- package/dist/{rsc-pipeline-T3775JUA.mjs → rsc-pipeline-FBM6NFYY.mjs} +13 -13
- package/dist/{rsc-pipeline-L4XOZ2TE.cjs → rsc-pipeline-IQI5XQLS.cjs} +14 -14
- package/dist/{runtime-HRSFC4ZC.mjs → runtime-2JYIDUON.mjs} +14 -14
- package/dist/{runtime-BIBGJO7V.cjs → runtime-DXEVFYLE.cjs} +16 -16
- 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-C8GUnNeP.d.ts → runtime.d-CQgoYR0Q.d.mts} +4 -4
- package/dist/{runtime-CaDswfWi.d.mts → runtime.d-CfhaLPl-.d.ts} +4 -4
- package/dist/{schema-dev-notice-LZ5NXGLN.mjs → schema-dev-notice-F6QYSOAI.mjs} +2 -2
- package/dist/{schema-dev-notice-XV7GZ3QJ.cjs → schema-dev-notice-UU7DMZEU.cjs} +3 -3
- package/dist/{search-client-BTXL5XWD.mjs → search-client-OXH6GBNO.mjs} +5 -3
- package/dist/search-client-ZZLKVO5R.cjs +15 -0
- package/dist/server-action-security.cjs +2 -2
- package/dist/server-action-security.d.mts +1 -1
- package/dist/server-action-security.d.ts +1 -1
- package/dist/server-action-security.mjs +1 -1
- package/dist/server-fn-client.d.mts +5 -5
- package/dist/server-fn-client.d.ts +5 -5
- package/dist/server-fn.cjs +3 -3
- package/dist/server-fn.d.mts +3 -3
- package/dist/server-fn.d.ts +3 -3
- package/dist/server-fn.mjs +2 -2
- package/dist/server-plugins.d.mts +14 -14
- package/dist/server-plugins.d.ts +14 -14
- package/dist/server-query-client.cjs +4 -3
- package/dist/server-query-client.d.mts +5 -5
- package/dist/server-query-client.d.ts +5 -5
- package/dist/server-query-client.mjs +3 -2
- package/dist/server-query.cjs +4 -4
- package/dist/server-query.d.mts +2 -2
- package/dist/server-query.d.ts +2 -2
- package/dist/server-query.mjs +3 -3
- package/dist/server.cjs +64 -62
- package/dist/server.d.mts +28 -29
- package/dist/server.d.ts +28 -29
- package/dist/server.mjs +38 -36
- package/dist/{spa-router-Dlv5ofg0.d.mts → spa-router.d-C5opIgXg.d.ts} +5 -5
- package/dist/{spa-router-qapSboKz.d.ts → spa-router.d-D63jb6nX.d.mts} +5 -5
- package/dist/storage.d.mts +2 -2
- package/dist/storage.d.ts +2 -2
- package/dist/testing.cjs +12 -11
- package/dist/testing.d.mts +14 -14
- package/dist/testing.d.ts +14 -14
- package/dist/testing.mjs +9 -8
- 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-DyvlSxFk.d.mts → utils.d-CO-U4OVZ.d.mts} +1 -1
- package/dist/{utils-A-cYF81u.d.ts → utils.d-CkpTqTsC.d.ts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +29 -27
- package/dist/vite.d.mts +20 -19
- package/dist/vite.d.ts +20 -19
- package/dist/vite.mjs +28 -26
- package/dist/workflows.cjs +4 -4
- package/dist/workflows.d.mts +1 -1
- package/dist/workflows.d.ts +1 -1
- package/dist/workflows.mjs +3 -3
- package/package.json +10 -5
- package/dist/base-path-leyrqXbX.d.mts +0 -19
- package/dist/base-path-leyrqXbX.d.ts +0 -19
- package/dist/chunk-OTOOJIUB.mjs +0 -34
- package/dist/search-client-QCYAL6AY.cjs +0 -13
- /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/{config-CnhyvvmT.d.mts → config.d-CnhyvvmT.d.mts} +0 -0
- /package/dist/{config-CnhyvvmT.d.ts → config.d-CnhyvvmT.d.ts} +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
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunk65Y5SIBHcjs = require('./chunk-65Y5SIBH.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _chunkPIUTGRDIcjs = require('./chunk-PIUTGRDI.cjs');
|
|
6
11
|
|
|
7
12
|
|
|
8
13
|
var _chunkA5BJKSZEcjs = require('./chunk-A5BJKSZE.cjs');
|
|
@@ -32,20 +37,20 @@ var _chunkA5BJKSZEcjs = require('./chunk-A5BJKSZE.cjs');
|
|
|
32
37
|
|
|
33
38
|
|
|
34
39
|
|
|
35
|
-
var
|
|
40
|
+
var _chunkX2M4XN4Vcjs = require('./chunk-X2M4XN4V.cjs');
|
|
36
41
|
|
|
37
42
|
|
|
38
|
-
var
|
|
43
|
+
var _chunkLNM57D3Hcjs = require('./chunk-LNM57D3H.cjs');
|
|
39
44
|
|
|
40
45
|
|
|
41
46
|
var _chunk3EEET2Q5cjs = require('./chunk-3EEET2Q5.cjs');
|
|
42
47
|
|
|
43
48
|
|
|
49
|
+
var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
44
50
|
|
|
45
|
-
var _chunkIUBDMDZZcjs = require('./chunk-IUBDMDZZ.cjs');
|
|
46
51
|
|
|
47
52
|
|
|
48
|
-
var
|
|
53
|
+
var _chunkUQHIWZZ6cjs = require('./chunk-UQHIWZZ6.cjs');
|
|
49
54
|
|
|
50
55
|
|
|
51
56
|
|
|
@@ -56,7 +61,7 @@ var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
|
56
61
|
|
|
57
62
|
|
|
58
63
|
|
|
59
|
-
var
|
|
64
|
+
var _chunk76GHW3WIcjs = require('./chunk-76GHW3WI.cjs');
|
|
60
65
|
|
|
61
66
|
|
|
62
67
|
var _chunkSGBNF56Scjs = require('./chunk-SGBNF56S.cjs');
|
|
@@ -74,7 +79,7 @@ var _chunkSGBNF56Scjs = require('./chunk-SGBNF56S.cjs');
|
|
|
74
79
|
|
|
75
80
|
|
|
76
81
|
|
|
77
|
-
var
|
|
82
|
+
var _chunkRMPNYUGTcjs = require('./chunk-RMPNYUGT.cjs');
|
|
78
83
|
|
|
79
84
|
|
|
80
85
|
var _chunkSBABQKPTcjs = require('./chunk-SBABQKPT.cjs');
|
|
@@ -85,7 +90,10 @@ var _chunk7EPYN7GWcjs = require('./chunk-7EPYN7GW.cjs');
|
|
|
85
90
|
|
|
86
91
|
|
|
87
92
|
|
|
88
|
-
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
var _chunkNK2VWS7Pcjs = require('./chunk-NK2VWS7P.cjs');
|
|
89
97
|
|
|
90
98
|
|
|
91
99
|
|
|
@@ -156,10 +164,10 @@ var _chunkX333W5KVcjs = require('./chunk-X333W5KV.cjs');
|
|
|
156
164
|
|
|
157
165
|
|
|
158
166
|
|
|
159
|
-
var
|
|
167
|
+
var _chunkCECUDGXQcjs = require('./chunk-CECUDGXQ.cjs');
|
|
160
168
|
|
|
161
169
|
|
|
162
|
-
var
|
|
170
|
+
var _chunkX2AMN2WVcjs = require('./chunk-X2AMN2WV.cjs');
|
|
163
171
|
|
|
164
172
|
|
|
165
173
|
|
|
@@ -175,7 +183,7 @@ var _chunkKBGZ5FD6cjs = require('./chunk-KBGZ5FD6.cjs');
|
|
|
175
183
|
var _chunkP2355C6Ecjs = require('./chunk-P2355C6E.cjs');
|
|
176
184
|
|
|
177
185
|
|
|
178
|
-
var
|
|
186
|
+
var _chunkKHXAJ2KAcjs = require('./chunk-KHXAJ2KA.cjs');
|
|
179
187
|
|
|
180
188
|
|
|
181
189
|
var _chunkRVGLYMJMcjs = require('./chunk-RVGLYMJM.cjs');
|
|
@@ -210,10 +218,11 @@ var _chunkLNVGXUL3cjs = require('./chunk-LNVGXUL3.cjs');
|
|
|
210
218
|
|
|
211
219
|
|
|
212
220
|
|
|
213
|
-
var
|
|
221
|
+
var _chunkVQJYGZNXcjs = require('./chunk-VQJYGZNX.cjs');
|
|
222
|
+
|
|
214
223
|
|
|
215
224
|
|
|
216
|
-
var
|
|
225
|
+
var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
|
|
217
226
|
|
|
218
227
|
|
|
219
228
|
|
|
@@ -221,7 +230,8 @@ var _chunkEVIWKPJVcjs = require('./chunk-EVIWKPJV.cjs');
|
|
|
221
230
|
|
|
222
231
|
|
|
223
232
|
|
|
224
|
-
|
|
233
|
+
|
|
234
|
+
var _chunkYIHRZBD7cjs = require('./chunk-YIHRZBD7.cjs');
|
|
225
235
|
|
|
226
236
|
|
|
227
237
|
|
|
@@ -234,7 +244,7 @@ var _chunkLIFUPCXWcjs = require('./chunk-LIFUPCXW.cjs');
|
|
|
234
244
|
var _chunkB5BBTPJQcjs = require('./chunk-B5BBTPJQ.cjs');
|
|
235
245
|
|
|
236
246
|
|
|
237
|
-
var
|
|
247
|
+
var _chunkAGR7VJH2cjs = require('./chunk-AGR7VJH2.cjs');
|
|
238
248
|
|
|
239
249
|
|
|
240
250
|
var _chunkIWFV5ZEDcjs = require('./chunk-IWFV5ZED.cjs');
|
|
@@ -289,6 +299,7 @@ function transformFarmFormActionModule(options) {
|
|
|
289
299
|
|
|
290
300
|
// src/vite.ts
|
|
291
301
|
var _vite = require('vite');
|
|
302
|
+
var _module = require('module');
|
|
292
303
|
|
|
293
304
|
// src/dev-preview-guard.ts
|
|
294
305
|
var _fs = require('fs'); var fs2 = _interopRequireWildcard(_fs); var fs = _interopRequireWildcard(_fs);
|
|
@@ -589,7 +600,7 @@ function formatClientBoundaryWarning(id, findings) {
|
|
|
589
600
|
}
|
|
590
601
|
if (builtinImports.length > 0) {
|
|
591
602
|
lines.push(
|
|
592
|
-
`- import of ${builtinImports.join(", ")} \u2014 stubbed
|
|
603
|
+
`- import of ${builtinImports.join(", ")} \u2014 stubbed in the browser, where exports without a Web API equivalent are undefined. Move the import into server-only code.`
|
|
593
604
|
);
|
|
594
605
|
}
|
|
595
606
|
return lines.join("\n");
|
|
@@ -692,7 +703,7 @@ function resolveFarmPageDataFailure(error) {
|
|
|
692
703
|
}
|
|
693
704
|
|
|
694
705
|
// src/openapi/dev-status.ts
|
|
695
|
-
function reportOpenAPIDevGenerationResult(spec, output =
|
|
706
|
+
function reportOpenAPIDevGenerationResult(spec, output = _chunkVQJYGZNXcjs.logger) {
|
|
696
707
|
if (spec) {
|
|
697
708
|
output.success("\u2705 OpenAPI documentation enabled");
|
|
698
709
|
return;
|
|
@@ -745,7 +756,7 @@ function loadFarmDocsDevRuntime() {
|
|
|
745
756
|
return import("./docs.cjs");
|
|
746
757
|
}
|
|
747
758
|
function loadFarmDocsSearchDevRuntime() {
|
|
748
|
-
return import("./search-client-
|
|
759
|
+
return import("./search-client-ZZLKVO5R.cjs");
|
|
749
760
|
}
|
|
750
761
|
function loadFarmOpenAPIDevRuntime() {
|
|
751
762
|
return import("./manager-2LUKNX2N.cjs");
|
|
@@ -754,7 +765,7 @@ function loadFarmWorkflowsDevRuntime() {
|
|
|
754
765
|
return import("./workflows.cjs");
|
|
755
766
|
}
|
|
756
767
|
function loadFarmDevtoolsSnapshotRuntime() {
|
|
757
|
-
return import("./devtools-
|
|
768
|
+
return import("./devtools-KJFUE5FO.cjs");
|
|
758
769
|
}
|
|
759
770
|
function loadFarmDevtoolsUIRuntime() {
|
|
760
771
|
return import("./devtools-ui-SYRUXUA7.cjs");
|
|
@@ -794,14 +805,22 @@ function farmServerOnlyEntriesPlugin() {
|
|
|
794
805
|
return {
|
|
795
806
|
name: "farm:server-only-entries",
|
|
796
807
|
enforce: "pre",
|
|
808
|
+
config() {
|
|
809
|
+
return {
|
|
810
|
+
optimizeDeps: { rolldownOptions: { plugins: [_chunkNK2VWS7Pcjs.farmBrowserBuiltinsOptimizerPlugin.call(void 0, )] } }
|
|
811
|
+
};
|
|
812
|
+
},
|
|
797
813
|
configResolved(config) {
|
|
798
814
|
root = config.root;
|
|
799
815
|
},
|
|
800
816
|
resolveId(id, importer, options) {
|
|
801
817
|
if (id === FARM_PLATFORM_ENTRY) return _optionalChain([options, 'optionalAccess', _46 => _46.ssr]) ? null : FARM_PLATFORM_CLIENT_ID;
|
|
818
|
+
if (!_optionalChain([options, 'optionalAccess', _47 => _47.ssr]) && _module.isBuiltin.call(void 0, id)) {
|
|
819
|
+
return _chunkNK2VWS7Pcjs.resolveFarmBrowserBuiltin.call(void 0, this, id, importer, options);
|
|
820
|
+
}
|
|
802
821
|
if (!FARM_SERVER_ONLY_ENTRIES.has(id)) return null;
|
|
803
822
|
const importedBy = importer ? ` (imported by ${importer})` : "";
|
|
804
|
-
if (!_optionalChain([options, 'optionalAccess',
|
|
823
|
+
if (!_optionalChain([options, 'optionalAccess', _48 => _48.ssr])) {
|
|
805
824
|
this.error(
|
|
806
825
|
`${id} is server-only and cannot be imported into client code${importedBy}. Use it from an API route or another server module.`
|
|
807
826
|
);
|
|
@@ -815,7 +834,8 @@ function farmServerOnlyEntriesPlugin() {
|
|
|
815
834
|
return null;
|
|
816
835
|
},
|
|
817
836
|
load(id) {
|
|
818
|
-
|
|
837
|
+
if (id === FARM_PLATFORM_CLIENT_ID) return createFarmPlatformClientModule();
|
|
838
|
+
return _nullishCoalesce(_chunkNK2VWS7Pcjs.loadFarmBrowserBuiltin.call(void 0, id), () => ( null));
|
|
819
839
|
}
|
|
820
840
|
};
|
|
821
841
|
}
|
|
@@ -847,10 +867,10 @@ function renderFarmI18nStaticHead(requestPath, snapshot) {
|
|
|
847
867
|
if (!snapshot) return "";
|
|
848
868
|
const runtime = `<script>window.__FARM_I18N__ = ${serializeFarmInlineValue(snapshot)};</script>`;
|
|
849
869
|
if (snapshot.routing === "none") return runtime;
|
|
850
|
-
return `${
|
|
870
|
+
return `${_chunk76GHW3WIcjs.renderFarmLocaleAlternateLinks.call(void 0, requestPath, snapshot)}${runtime}`;
|
|
851
871
|
}
|
|
852
872
|
function getPublicEnvDefine(config) {
|
|
853
|
-
const publicEnv = _optionalChain([config, 'access',
|
|
873
|
+
const publicEnv = _optionalChain([config, 'access', _49 => _49.env, 'optionalAccess', _50 => _50.public]);
|
|
854
874
|
if (!isResolvedEnvScope(publicEnv)) {
|
|
855
875
|
return {};
|
|
856
876
|
}
|
|
@@ -889,7 +909,7 @@ function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request)
|
|
|
889
909
|
return;
|
|
890
910
|
}
|
|
891
911
|
if (res.headersSent) {
|
|
892
|
-
_optionalChain([res, 'access',
|
|
912
|
+
_optionalChain([res, 'access', _51 => _51.destroy, 'optionalCall', _52 => _52(error instanceof Error ? error : new Error(String(error)))]);
|
|
893
913
|
return;
|
|
894
914
|
}
|
|
895
915
|
res.statusCode = 500;
|
|
@@ -898,6 +918,17 @@ function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request)
|
|
|
898
918
|
});
|
|
899
919
|
};
|
|
900
920
|
}
|
|
921
|
+
async function proxyFarmExternalRewrite(req, res, bodySizeLimit) {
|
|
922
|
+
const destination = req.url;
|
|
923
|
+
if (!destination || !/^https?:\/\//i.test(destination)) return false;
|
|
924
|
+
let request = createRequestFromNodeRequest(req, new URL(destination));
|
|
925
|
+
if (request.method !== "GET" && request.method !== "HEAD") {
|
|
926
|
+
const body = await _chunkLIFUPCXWcjs.readNodeRequestBody.call(void 0, req, bodySizeLimit);
|
|
927
|
+
request = new Request(request, { body: toRequestBody(body) });
|
|
928
|
+
}
|
|
929
|
+
await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, await _chunkYIHRZBD7cjs.fetchFarmExternalRewrite.call(void 0, request));
|
|
930
|
+
return true;
|
|
931
|
+
}
|
|
901
932
|
function toRequestBody(body) {
|
|
902
933
|
if (!body) return void 0;
|
|
903
934
|
const copy = new Uint8Array(body.byteLength);
|
|
@@ -932,7 +963,7 @@ function applyWebResponseToNodeResponse(response, res) {
|
|
|
932
963
|
for (const name of res.getHeaderNames()) {
|
|
933
964
|
res.removeHeader(name);
|
|
934
965
|
}
|
|
935
|
-
|
|
966
|
+
_chunkYIHRZBD7cjs.applyWebResponseHeaders.call(void 0, res, response.headers);
|
|
936
967
|
}
|
|
937
968
|
function toNodeResponseBuffer(chunk, encoding) {
|
|
938
969
|
if (chunk === void 0 || chunk === null || typeof chunk === "function") return void 0;
|
|
@@ -981,7 +1012,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
981
1012
|
const originalWrite = res.write.bind(res);
|
|
982
1013
|
const originalEnd = res.end.bind(res);
|
|
983
1014
|
const originalWriteHead = res.writeHead.bind(res);
|
|
984
|
-
const originalFlushHeaders = _optionalChain([res, 'access',
|
|
1015
|
+
const originalFlushHeaders = _optionalChain([res, 'access', _53 => _53.flushHeaders, 'optionalAccess', _54 => _54.bind, 'call', _55 => _55(res)]);
|
|
985
1016
|
let afterResponseCalled = false;
|
|
986
1017
|
let interceptedEnd = false;
|
|
987
1018
|
const htmlChunks = [];
|
|
@@ -1021,7 +1052,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1021
1052
|
const shouldBufferResponse = isHtmlResponse ? bufferPluginResponse : Boolean(runtimeSession && hasRuntimeAfterHook);
|
|
1022
1053
|
if (shouldBufferResponse) {
|
|
1023
1054
|
const callback = args.find((arg) => typeof arg === "function");
|
|
1024
|
-
_optionalChain([callback, 'optionalCall',
|
|
1055
|
+
_optionalChain([callback, 'optionalCall', _56 => _56()]);
|
|
1025
1056
|
return true;
|
|
1026
1057
|
}
|
|
1027
1058
|
const writeResult = originalWrite(chunk, ...args);
|
|
@@ -1134,13 +1165,13 @@ function getEnvDefines(config, configEnv) {
|
|
|
1134
1165
|
_chunkHEPJIKKQcjs.getPublicFarmImageConfig.call(void 0, _chunkHEPJIKKQcjs.resolveFarmImageConfig.call(void 0, config.images))
|
|
1135
1166
|
)
|
|
1136
1167
|
};
|
|
1137
|
-
if (_optionalChain([configEnv, 'optionalAccess',
|
|
1168
|
+
if (_optionalChain([configEnv, 'optionalAccess', _57 => _57.isSsrBuild])) {
|
|
1138
1169
|
defines.__FARM_ENV__ = JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, getFullEnvDefine(config)));
|
|
1139
1170
|
}
|
|
1140
1171
|
return defines;
|
|
1141
1172
|
}
|
|
1142
1173
|
function getFarmAPIBaseURLDefine(config) {
|
|
1143
|
-
const baseURL = _optionalChain([config, 'access',
|
|
1174
|
+
const baseURL = _optionalChain([config, 'access', _58 => _58.api, 'optionalAccess', _59 => _59.baseURL]);
|
|
1144
1175
|
return typeof baseURL === "string" && baseURL ? baseURL : _chunkIWFV5ZEDcjs.DEFAULT_FARM_API_BASE_PATH;
|
|
1145
1176
|
}
|
|
1146
1177
|
function isResolvedEnvScope(value) {
|
|
@@ -1187,10 +1218,12 @@ function rewriteEarlySsrRelativeImports(options) {
|
|
|
1187
1218
|
const sourcePath = suffixIndex === -1 ? source.value : source.value.slice(0, suffixIndex);
|
|
1188
1219
|
const suffix = suffixIndex === -1 ? "" : source.value.slice(suffixIndex);
|
|
1189
1220
|
const resolvedPath = path5.resolve(path5.dirname(cleanId), sourcePath);
|
|
1221
|
+
const moduleId = _chunkVQJYGZNXcjs.toViteModuleId.call(void 0, resolvedPath, options.root);
|
|
1222
|
+
const specifier = moduleId.startsWith("/@fs/") ? _chunkVQJYGZNXcjs.toPosixPath.call(void 0, resolvedPath) : moduleId;
|
|
1190
1223
|
replacements.push({
|
|
1191
1224
|
start: source.start,
|
|
1192
1225
|
end: source.end,
|
|
1193
|
-
code: JSON.stringify(`${
|
|
1226
|
+
code: JSON.stringify(`${specifier}${suffix}`)
|
|
1194
1227
|
});
|
|
1195
1228
|
});
|
|
1196
1229
|
if (replacements.length === 0) return null;
|
|
@@ -1226,9 +1259,9 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
1226
1259
|
transformedExports++;
|
|
1227
1260
|
};
|
|
1228
1261
|
for (const node of body) {
|
|
1229
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
1262
|
+
if (_optionalChain([node, 'optionalAccess', _60 => _60.type]) === "ExportDefaultDeclaration" && node.declaration) {
|
|
1230
1263
|
const declaration2 = node.declaration;
|
|
1231
|
-
if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access',
|
|
1264
|
+
if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access', _61 => _61.id, 'optionalAccess', _62 => _62.name])) {
|
|
1232
1265
|
replacements.push({
|
|
1233
1266
|
start: node.start,
|
|
1234
1267
|
end: node.end,
|
|
@@ -1246,11 +1279,11 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
1246
1279
|
}
|
|
1247
1280
|
continue;
|
|
1248
1281
|
}
|
|
1249
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
1282
|
+
if (_optionalChain([node, 'optionalAccess', _63 => _63.type]) === "ExportNamedDeclaration" && !node.declaration && node.exportKind !== "type") {
|
|
1250
1283
|
const specifiers = (node.specifiers || []).filter(
|
|
1251
1284
|
(specifier) => specifier.type === "ExportSpecifier" && specifier.exportKind !== "type"
|
|
1252
1285
|
);
|
|
1253
|
-
const specifierName = (name) => _nullishCoalesce(_optionalChain([name, 'optionalAccess',
|
|
1286
|
+
const specifierName = (name) => _nullishCoalesce(_optionalChain([name, 'optionalAccess', _64 => _64.name]), () => ( String(_nullishCoalesce(_optionalChain([name, 'optionalAccess', _65 => _65.value]), () => ( "")))));
|
|
1254
1287
|
const isComponentExport = (specifier) => {
|
|
1255
1288
|
const exported = specifierName(specifier.exported);
|
|
1256
1289
|
return exported === "default" || /^[A-Z]/.test(exported);
|
|
@@ -1277,14 +1310,14 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
1277
1310
|
if (kept.length > 0) wrapperStatements.push(`export { ${kept.join(", ")} };`);
|
|
1278
1311
|
continue;
|
|
1279
1312
|
}
|
|
1280
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
1313
|
+
if (_optionalChain([node, 'optionalAccess', _66 => _66.type]) !== "ExportNamedDeclaration" || !node.declaration) continue;
|
|
1281
1314
|
const declaration = node.declaration;
|
|
1282
1315
|
const declaredNames = [];
|
|
1283
|
-
if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access',
|
|
1316
|
+
if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access', _67 => _67.id, 'optionalAccess', _68 => _68.name])) {
|
|
1284
1317
|
declaredNames.push(declaration.id.name);
|
|
1285
1318
|
} else if (declaration.type === "VariableDeclaration") {
|
|
1286
1319
|
for (const declarator of declaration.declarations || []) {
|
|
1287
|
-
if (_optionalChain([declarator, 'access',
|
|
1320
|
+
if (_optionalChain([declarator, 'access', _69 => _69.id, 'optionalAccess', _70 => _70.type]) === "Identifier") declaredNames.push(declarator.id.name);
|
|
1288
1321
|
}
|
|
1289
1322
|
}
|
|
1290
1323
|
const componentNames = declaredNames.filter((name) => /^[A-Z]/.test(name));
|
|
@@ -1348,13 +1381,13 @@ function warnClientBoundaryOnce(context, id, code, config) {
|
|
|
1348
1381
|
} catch (e11) {
|
|
1349
1382
|
return;
|
|
1350
1383
|
}
|
|
1351
|
-
const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access',
|
|
1384
|
+
const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access', _71 => _71.env, 'optionalAccess', _72 => _72.public]), () => ( {}))));
|
|
1352
1385
|
const findings = analyzeClientBoundary(program, publicKeys);
|
|
1353
1386
|
if (findings.envKeys.length === 0 && findings.publicEnvKeys.length === 0 && findings.builtinImports.length === 0) {
|
|
1354
1387
|
return;
|
|
1355
1388
|
}
|
|
1356
1389
|
warnedClientBoundaryIds.add(id);
|
|
1357
|
-
|
|
1390
|
+
_chunkVQJYGZNXcjs.logger.warn(formatClientBoundaryWarning(id, findings));
|
|
1358
1391
|
}
|
|
1359
1392
|
function shouldEmitFarmClientRootHmr(renderer) {
|
|
1360
1393
|
return _chunkRD623KW4cjs.getFarmRendererCapabilities.call(void 0, _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, renderer)).reconcilesRerenders;
|
|
@@ -1368,13 +1401,17 @@ function hasViteAlias(alias, find) {
|
|
|
1368
1401
|
}
|
|
1369
1402
|
function farmPlugin(options = {}, initialPluginManager) {
|
|
1370
1403
|
const imageImports = farmImageImportsPlugin();
|
|
1371
|
-
const fontImports =
|
|
1404
|
+
const fontImports = _chunkX2M4XN4Vcjs.farmFontImportsPlugin.call(void 0, {
|
|
1372
1405
|
root: options.root,
|
|
1373
1406
|
basePath: options.basePath,
|
|
1374
1407
|
publicDir: options.publicDir
|
|
1375
1408
|
});
|
|
1376
1409
|
let farmApp;
|
|
1377
1410
|
let serverFnTransformActive = false;
|
|
1411
|
+
const islandsServerFns = () => {
|
|
1412
|
+
const config = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _73 => _73.getConfig, 'call', _74 => _74()]), () => ( options));
|
|
1413
|
+
return _optionalChain([config, 'access', _75 => _75.experimental, 'optionalAccess', _76 => _76.serverActions]) === true && _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _77 => _77.experimental, 'optionalAccess', _78 => _78.serverComponents])) === "islands";
|
|
1414
|
+
};
|
|
1378
1415
|
let reactRefreshActive = false;
|
|
1379
1416
|
let server;
|
|
1380
1417
|
let apiRouteManager;
|
|
@@ -1398,14 +1435,14 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1398
1435
|
].join(" ");
|
|
1399
1436
|
console.log(log);
|
|
1400
1437
|
};
|
|
1401
|
-
const getProgrammaticClientRoutes = () => _nullishCoalesce(options.programmaticClientRoutes, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
1438
|
+
const getProgrammaticClientRoutes = () => _nullishCoalesce(options.programmaticClientRoutes, () => ( _optionalChain([farmApp, 'optionalAccess', _79 => _79.getRouteManager, 'call', _80 => _80(), 'access', _81 => _81.getProgrammaticClientRoutes, 'call', _82 => _82()])));
|
|
1402
1439
|
return {
|
|
1403
1440
|
name: "farm",
|
|
1404
1441
|
api: { getProgrammaticClientRoutes },
|
|
1405
1442
|
config(userConfig, configEnv) {
|
|
1406
1443
|
isBuild = configEnv.command === "build";
|
|
1407
1444
|
const layerAliases = _chunk5Y2P454Ocjs.getFarmLayerAliases.call(void 0, options.layers);
|
|
1408
|
-
const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access',
|
|
1445
|
+
const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access', _83 => _83.resolve, 'optionalAccess', _84 => _84.alias]), "@") ? {} : _chunkX2M4XN4Vcjs.createFarmSourceAlias.call(void 0, options.root || process.cwd(), options.srcDir);
|
|
1409
1446
|
const layerRoots = (_nullishCoalesce(options.layers, () => ( []))).map((layer) => layer.root);
|
|
1410
1447
|
return {
|
|
1411
1448
|
// Honor Farm's publicDir so the dev server serves the same static
|
|
@@ -1421,7 +1458,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1421
1458
|
server: {
|
|
1422
1459
|
fs: {
|
|
1423
1460
|
...layerRoots.length ? { allow: [path5.resolve(options.root || process.cwd()), ...layerRoots] } : {},
|
|
1424
|
-
deny: getFarmDevFsDeny(_optionalChain([userConfig, 'access',
|
|
1461
|
+
deny: getFarmDevFsDeny(_optionalChain([userConfig, 'access', _85 => _85.server, 'optionalAccess', _86 => _86.fs, 'optionalAccess', _87 => _87.deny]), options)
|
|
1425
1462
|
}
|
|
1426
1463
|
}
|
|
1427
1464
|
};
|
|
@@ -1433,9 +1470,9 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1433
1470
|
serverFnTransformActive = config.plugins.some(
|
|
1434
1471
|
(plugin) => plugin.name === SERVER_FN_TRANSFORM_PLUGIN
|
|
1435
1472
|
);
|
|
1436
|
-
reactRefreshActive =
|
|
1437
|
-
if (_optionalChain([options, 'access',
|
|
1438
|
-
|
|
1473
|
+
reactRefreshActive = _chunk65Y5SIBHcjs.isFarmReactRefreshActive.call(void 0, config);
|
|
1474
|
+
if (_optionalChain([options, 'access', _88 => _88.experimental, 'optionalAccess', _89 => _89.serverActions]) === true && !serverFnTransformActive && !islandsServerFns()) {
|
|
1475
|
+
_chunkVQJYGZNXcjs.logger.warn(
|
|
1439
1476
|
"experimental.serverActions has no effect without @farm.js/plugin/rsc in the Vite plugins. Server functions stay server-only, and importing one from client code is a build error."
|
|
1440
1477
|
);
|
|
1441
1478
|
}
|
|
@@ -1443,7 +1480,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1443
1480
|
async configureServer(viteServer) {
|
|
1444
1481
|
viteServer.middlewares.use(
|
|
1445
1482
|
createFarmDevPreviewGuard(viteServer, {
|
|
1446
|
-
getSourceRoots: () => _chunk5Y2P454Ocjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
1483
|
+
getSourceRoots: () => _chunk5Y2P454Ocjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _90 => _90.getConfig, 'call', _91 => _91()]), () => ( options)))
|
|
1447
1484
|
})
|
|
1448
1485
|
);
|
|
1449
1486
|
if (typeof fontImports.configureServer === "function") {
|
|
@@ -1458,7 +1495,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1458
1495
|
} catch (e12) {
|
|
1459
1496
|
}
|
|
1460
1497
|
};
|
|
1461
|
-
farmApp = new (0,
|
|
1498
|
+
farmApp = new (0, _chunkX2M4XN4Vcjs.FarmApp)(
|
|
1462
1499
|
{
|
|
1463
1500
|
...options,
|
|
1464
1501
|
root: resolveDevelopmentRoot(options.root, server.config.root)
|
|
@@ -1468,7 +1505,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1468
1505
|
await farmApp.initialize();
|
|
1469
1506
|
const farmConfig = farmApp.getConfig();
|
|
1470
1507
|
let farmAppPackages;
|
|
1471
|
-
if (_optionalChain([farmConfig, 'access',
|
|
1508
|
+
if (_optionalChain([farmConfig, 'access', _92 => _92.agent, 'optionalAccess', _93 => _93.noindexPreviews])) {
|
|
1472
1509
|
server.middlewares.use((_req, res, next) => {
|
|
1473
1510
|
if (_chunkSGBNF56Scjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
|
|
1474
1511
|
res.setHeader("X-Robots-Tag", _chunkNYQSC4DXcjs.FARM_PREVIEW_ROBOTS_TAG);
|
|
@@ -1478,7 +1515,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1478
1515
|
}
|
|
1479
1516
|
const apiServerBasePath = _chunkB5BBTPJQcjs.resolveFarmAPIServerBasePath.call(void 0, farmConfig.api);
|
|
1480
1517
|
const devBuiltInRoutePaths = new Set(
|
|
1481
|
-
|
|
1518
|
+
_chunkRMPNYUGTcjs.listFarmBuiltInRoutePaths.call(void 0, {
|
|
1482
1519
|
agent: {
|
|
1483
1520
|
apiCatalog: true,
|
|
1484
1521
|
mcp: true,
|
|
@@ -1500,9 +1537,9 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1500
1537
|
validateRemoteUrl: createNodeImageUrlValidator(farmConfig.images),
|
|
1501
1538
|
// Vite owns this address. Unlike request.url, it cannot be replaced by
|
|
1502
1539
|
// a caller-controlled Host header.
|
|
1503
|
-
trustedLocalOrigin: () => _optionalChain([server, 'access',
|
|
1540
|
+
trustedLocalOrigin: () => _optionalChain([server, 'access', _94 => _94.resolvedUrls, 'optionalAccess', _95 => _95.local, 'access', _96 => _96[0]]),
|
|
1504
1541
|
onError(error) {
|
|
1505
|
-
|
|
1542
|
+
_chunkVQJYGZNXcjs.logger.error(
|
|
1506
1543
|
`Image optimization failed: ${error instanceof Error ? error.message : String(error)}`
|
|
1507
1544
|
);
|
|
1508
1545
|
}
|
|
@@ -1520,15 +1557,15 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1520
1557
|
const workflowConfig = farmConfig.workflows;
|
|
1521
1558
|
const farmDocsDevRuntime = farmConfig.docs.enabled ? await loadFarmDocsDevRuntime() : null;
|
|
1522
1559
|
const getExtraRouteTypes = () => [
|
|
1523
|
-
..._optionalChain([options, 'access',
|
|
1524
|
-
..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
1560
|
+
..._optionalChain([options, 'access', _97 => _97.openapi, 'optionalAccess', _98 => _98.enabled]) && options.openapi.route ? [options.openapi.route] : [],
|
|
1561
|
+
..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess', _99 => _99.getFarmDocsRouteTypeEntries, 'call', _100 => _100(farmConfig.docs)]), () => ( []))
|
|
1525
1562
|
];
|
|
1526
1563
|
const appDirSlugs = sourceRoots.map(
|
|
1527
1564
|
(source) => path5.join(source.root, source.srcDir, "app").replace(/\\/g, "/")
|
|
1528
1565
|
);
|
|
1529
1566
|
const generateTypeArtifacts = async (reason, selection = ALL_TYPE_ARTIFACTS, log = false) => {
|
|
1530
1567
|
try {
|
|
1531
|
-
const result = await
|
|
1568
|
+
const result = await _chunkUQHIWZZ6cjs.generateFarmTypeArtifacts.call(void 0, {
|
|
1532
1569
|
root: farmConfig.root,
|
|
1533
1570
|
srcDir: farmConfig.srcDir,
|
|
1534
1571
|
layers: farmConfig.layers,
|
|
@@ -1557,7 +1594,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1557
1594
|
}
|
|
1558
1595
|
} catch (e) {
|
|
1559
1596
|
const message = e instanceof Error ? e.message : String(e);
|
|
1560
|
-
|
|
1597
|
+
_chunkVQJYGZNXcjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
|
|
1561
1598
|
if (pm) {
|
|
1562
1599
|
await emitPluginError("type-artifact-generation", e, { reason });
|
|
1563
1600
|
}
|
|
@@ -1568,7 +1605,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1568
1605
|
(source) => path5.join(source.root, source.srcDir).replace(/\\/g, "/")
|
|
1569
1606
|
);
|
|
1570
1607
|
const layerConfigFiles = new Set(
|
|
1571
|
-
farmConfig.layers.map((layer) => _optionalChain([layer, 'access',
|
|
1608
|
+
farmConfig.layers.map((layer) => _optionalChain([layer, 'access', _101 => _101.configFile, 'optionalAccess', _102 => _102.replace, 'call', _103 => _103(/\\/g, "/")])).filter((file) => Boolean(file))
|
|
1572
1609
|
);
|
|
1573
1610
|
const routeModuleExtensions = /* @__PURE__ */ new Set([
|
|
1574
1611
|
..._chunkRD623KW4cjs.resolveFarmComponentExtensions.call(void 0, farmConfig.renderer.componentExtensions),
|
|
@@ -1610,7 +1647,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1610
1647
|
let routeRefreshScheduled = null;
|
|
1611
1648
|
let pendingRouteRefreshIncludesMiddleware = false;
|
|
1612
1649
|
const scheduleTypeArtifactGen = (file, event, selection) => {
|
|
1613
|
-
const normalizedFile =
|
|
1650
|
+
const normalizedFile = _chunkVQJYGZNXcjs.toPosixPath.call(void 0, file);
|
|
1614
1651
|
for (const [artifact, enabled] of Object.entries(selection)) {
|
|
1615
1652
|
if (enabled) {
|
|
1616
1653
|
pendingTypeArtifacts[artifact] = true;
|
|
@@ -1647,7 +1684,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1647
1684
|
scheduleTypeArtifactGen(file, ev, typeArtifacts);
|
|
1648
1685
|
}
|
|
1649
1686
|
if (isI18nCatalogFile(file)) {
|
|
1650
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
1687
|
+
_optionalChain([farmApp, 'optionalAccess', _104 => _104.getI18nRuntime, 'call', _105 => _105(), 'access', _106 => _106.reload, 'call', _107 => _107(), 'access', _108 => _108.then, 'call', _109 => _109(() => server.ws.send({ type: "full-reload", path: "*" })), 'access', _110 => _110.catch, 'call', _111 => _111((error) => _chunkVQJYGZNXcjs.logger.warn(`i18n catalog reload failed: ${error.message}`))]);
|
|
1651
1688
|
}
|
|
1652
1689
|
const isRouteRefreshEvent = (ev !== "change" || isStaticMetadataImageFile(file)) && (isAppRuntimeFile(file) || isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file)));
|
|
1653
1690
|
if (isRouteRefreshEvent) {
|
|
@@ -1660,9 +1697,9 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1660
1697
|
const reloadsMiddleware = pendingRouteRefreshIncludesMiddleware;
|
|
1661
1698
|
pendingRouteRefreshIncludesMiddleware = false;
|
|
1662
1699
|
Promise.all([
|
|
1663
|
-
_optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
1664
|
-
reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess',
|
|
1665
|
-
]).then(() => server.ws.send({ type: "full-reload", path: "*" })).catch((error) =>
|
|
1700
|
+
_optionalChain([refreshRouteDiscovery, 'optionalCall', _112 => _112(`${ev} ${file}`)]),
|
|
1701
|
+
reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess', _113 => _113.reload, 'call', _114 => _114()]) : void 0
|
|
1702
|
+
]).then(() => server.ws.send({ type: "full-reload", path: "*" })).catch((error) => _chunkVQJYGZNXcjs.logger.warn(`Route refresh failed: ${error.message}`));
|
|
1666
1703
|
}, 50);
|
|
1667
1704
|
}
|
|
1668
1705
|
}
|
|
@@ -1696,7 +1733,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1696
1733
|
});
|
|
1697
1734
|
}
|
|
1698
1735
|
const dispatchToDevServer = _chunkBNH53KOTcjs.createFarmDevServerDispatch.call(void 0, server);
|
|
1699
|
-
apiRouteManager = new (0,
|
|
1736
|
+
apiRouteManager = new (0, _chunkKHXAJ2KAcjs.APIRouteManager)(appDirs, server, {
|
|
1700
1737
|
plugins: farmConfig.plugins,
|
|
1701
1738
|
i18n: farmApp.getI18nRuntime(),
|
|
1702
1739
|
bodySizeLimit: serverConfig.bodySizeLimit,
|
|
@@ -1730,7 +1767,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1730
1767
|
loadModule: async (workflow) => _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, workflow.filePath),
|
|
1731
1768
|
server: farmConfig.server
|
|
1732
1769
|
});
|
|
1733
|
-
|
|
1770
|
+
_chunkVQJYGZNXcjs.logger.success(`\u2705 Discovered ${discoveredWorkflows.length} Farm workflow task(s)`);
|
|
1734
1771
|
}
|
|
1735
1772
|
}
|
|
1736
1773
|
if (pm) {
|
|
@@ -1742,7 +1779,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1742
1779
|
});
|
|
1743
1780
|
}
|
|
1744
1781
|
}
|
|
1745
|
-
middlewareManager = new (0,
|
|
1782
|
+
middlewareManager = new (0, _chunkX2AMN2WVcjs.MiddlewareManager)(
|
|
1746
1783
|
appDirs,
|
|
1747
1784
|
server,
|
|
1748
1785
|
farmConfig.middleware,
|
|
@@ -1763,11 +1800,11 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1763
1800
|
});
|
|
1764
1801
|
}
|
|
1765
1802
|
}
|
|
1766
|
-
if (_optionalChain([options, 'access',
|
|
1803
|
+
if (_optionalChain([options, 'access', _115 => _115.openapi, 'optionalAccess', _116 => _116.enabled])) {
|
|
1767
1804
|
const { OpenAPIManager } = await loadFarmOpenAPIDevRuntime();
|
|
1768
1805
|
openAPIManager = new OpenAPIManager(appDirs, options.openapi, {
|
|
1769
1806
|
mode: "development",
|
|
1770
|
-
apiBaseURL: typeof _optionalChain([options, 'access',
|
|
1807
|
+
apiBaseURL: typeof _optionalChain([options, 'access', _117 => _117.api, 'optionalAccess', _118 => _118.baseURL]) === "string" ? options.api.baseURL : void 0
|
|
1771
1808
|
});
|
|
1772
1809
|
const spec = await openAPIManager.generateSpec();
|
|
1773
1810
|
reportOpenAPIDevGenerationResult(spec);
|
|
@@ -1784,7 +1821,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1784
1821
|
await openAPIManager.invalidateCache();
|
|
1785
1822
|
}
|
|
1786
1823
|
if (process.env.FARM_VERBOSE) {
|
|
1787
|
-
|
|
1824
|
+
_chunkVQJYGZNXcjs.logger.info(`Refreshed routes: ${reason}`);
|
|
1788
1825
|
}
|
|
1789
1826
|
};
|
|
1790
1827
|
const farmDocsFontAssetList = farmDocsDevRuntime ? _chunkERMUL73Lcjs.resolveFarmDocsFontAssets.call(void 0, farmConfig.root) : [];
|
|
@@ -1796,7 +1833,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1796
1833
|
return _chunk7EPYN7GWcjs.resolveFarmLayoutFonts.call(void 0, layoutModules);
|
|
1797
1834
|
};
|
|
1798
1835
|
releaseDocsMCPServers();
|
|
1799
|
-
const isFarmDocsPathGuarded = (href) =>
|
|
1836
|
+
const isFarmDocsPathGuarded = (href) => _chunk76GHW3WIcjs.farmPathGuardCoversPage.call(void 0,
|
|
1800
1837
|
{
|
|
1801
1838
|
config: farmConfig,
|
|
1802
1839
|
middlewareRoutes: middlewareManager.getMiddlewares().filter((entry) => entry.source !== "config")
|
|
@@ -1809,19 +1846,19 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1809
1846
|
clientEntry: "/@farm/client.js",
|
|
1810
1847
|
resolveLayoutFonts: resolveDocsLayoutFonts,
|
|
1811
1848
|
fontStylesheetHref: "/@farm/fonts.css",
|
|
1812
|
-
globalStylesheetHref:
|
|
1849
|
+
globalStylesheetHref: _chunkX2M4XN4Vcjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
1813
1850
|
farmConfig.root,
|
|
1814
1851
|
farmConfig.srcDir
|
|
1815
1852
|
),
|
|
1816
1853
|
loadModule: async (specifier) => {
|
|
1817
1854
|
const resolved = await server.environments.ssr.pluginContainer.resolveId(specifier);
|
|
1818
|
-
if (specifier === _optionalChain([farmConfig, 'access',
|
|
1855
|
+
if (specifier === _optionalChain([farmConfig, 'access', _119 => _119.docs, 'access', _120 => _120.adapter, 'optionalAccess', _121 => _121.server]) && _optionalChain([resolved, 'optionalAccess', _122 => _122.id])) {
|
|
1819
1856
|
return import(
|
|
1820
1857
|
/* @vite-ignore */
|
|
1821
1858
|
_url.pathToFileURL.call(void 0, resolved.id).href
|
|
1822
1859
|
);
|
|
1823
1860
|
}
|
|
1824
|
-
return _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess',
|
|
1861
|
+
return _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess', _123 => _123.id]), () => ( specifier)));
|
|
1825
1862
|
},
|
|
1826
1863
|
registerMCPServer: (mcpServer) => {
|
|
1827
1864
|
const dispose = _chunk6ONBZGVHcjs.registerFarmMCPServer.call(void 0, mcpServer);
|
|
@@ -1839,21 +1876,21 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1839
1876
|
fontAssets: _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, farmDocsFontAssetList),
|
|
1840
1877
|
resolveLayoutFonts: resolveDocsLayoutFonts,
|
|
1841
1878
|
fontStylesheetHref: "/@farm/fonts.css",
|
|
1842
|
-
globalStylesheetHref:
|
|
1879
|
+
globalStylesheetHref: _chunkX2M4XN4Vcjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
1843
1880
|
farmConfig.root,
|
|
1844
1881
|
farmConfig.srcDir
|
|
1845
1882
|
),
|
|
1846
1883
|
isPathGuarded: isFarmDocsPathGuarded
|
|
1847
1884
|
}) : null;
|
|
1848
1885
|
const wrapFarmDocsResponseWithLayouts = async (request, response) => {
|
|
1849
|
-
if (request.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access',
|
|
1886
|
+
if (request.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _124 => _124.headers, 'access', _125 => _125.get, 'call', _126 => _126("content-type"), 'optionalAccess', _127 => _127.toLowerCase, 'call', _128 => _128(), 'access', _129 => _129.includes, 'call', _130 => _130("text/html")])) {
|
|
1850
1887
|
return response;
|
|
1851
1888
|
}
|
|
1852
1889
|
const pathname = new URL(request.url).pathname;
|
|
1853
1890
|
const matchedRoute = routeManager.matchRoute(pathname);
|
|
1854
1891
|
const layoutEntries = matchedRoute.layouts.map((layout) => ({
|
|
1855
1892
|
...layout,
|
|
1856
|
-
metadata:
|
|
1893
|
+
metadata: _chunkX2M4XN4Vcjs.getClientModuleMetadata.call(void 0, layout.modulePath, farmConfig.root)
|
|
1857
1894
|
}));
|
|
1858
1895
|
if (!layoutEntries.some((layout) => layout.metadata.shouldHydrate)) {
|
|
1859
1896
|
return response;
|
|
@@ -1867,7 +1904,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1867
1904
|
headers: response.headers
|
|
1868
1905
|
});
|
|
1869
1906
|
}
|
|
1870
|
-
const docsRenderer = _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
1907
|
+
const docsRenderer = _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _131 => _131.getConfig, 'call', _132 => _132()]), () => ( options))).renderer);
|
|
1871
1908
|
const [rendererRuntime, layoutModules] = await Promise.all([
|
|
1872
1909
|
_chunkRD623KW4cjs.isReactRenderer.call(void 0, docsRenderer) ? import("./renderer/react/server.cjs") : _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, docsRenderer.server),
|
|
1873
1910
|
Promise.all(
|
|
@@ -1881,7 +1918,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1881
1918
|
(strategy) => strategy === hydrationStrategies[0]
|
|
1882
1919
|
) ? _nullishCoalesce(hydrationStrategies[0], () => ( "load")) : "load";
|
|
1883
1920
|
const params = matchedRoute.params || {};
|
|
1884
|
-
const toUrlPath = (absolutePath) =>
|
|
1921
|
+
const toUrlPath = (absolutePath) => _chunkVQJYGZNXcjs.toViteModuleId.call(void 0, absolutePath, farmConfig.root);
|
|
1885
1922
|
const clientLayouts = Object.fromEntries(
|
|
1886
1923
|
layoutEntries.map((layout) => [
|
|
1887
1924
|
layout.pattern,
|
|
@@ -1896,7 +1933,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1896
1933
|
])
|
|
1897
1934
|
);
|
|
1898
1935
|
const inlineValue = (value) => JSON.stringify(value).replace(/</g, "\\u003c").replace(/>/g, "\\u003e");
|
|
1899
|
-
const pageModulePath = _optionalChain([matchedRoute, 'access',
|
|
1936
|
+
const pageModulePath = _optionalChain([matchedRoute, 'access', _133 => _133.route, 'optionalAccess', _134 => _134.modulePath]) ? toUrlPath(matchedRoute.route.modulePath) : "";
|
|
1900
1937
|
const bootstrapScript = `<script>
|
|
1901
1938
|
window.__FARM_PROPS__ = ${inlineValue({ params })};
|
|
1902
1939
|
window.__FARM_ROUTE_SLOTS__ = [];
|
|
@@ -1992,7 +2029,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
1992
2029
|
}
|
|
1993
2030
|
},
|
|
1994
2031
|
(request) => {
|
|
1995
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
2032
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _135 => _135.getConfig, 'call', _136 => _136()]), () => ( options));
|
|
1996
2033
|
const currentServerConfig = _chunkLIFUPCXWcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
|
|
1997
2034
|
return _chunkHNAISJFDcjs.resolveFarmRequestURL.call(void 0, request, {
|
|
1998
2035
|
trustProxy: currentServerConfig.trustProxy
|
|
@@ -2003,7 +2040,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2003
2040
|
withAPIRequestTracing(async (req, res, next) => {
|
|
2004
2041
|
const requestUrl = req.url || "/";
|
|
2005
2042
|
const requestMethod = req.method || "GET";
|
|
2006
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
2043
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _137 => _137.getConfig, 'call', _138 => _138()]), () => ( options));
|
|
2007
2044
|
const currentServerConfig = _chunkLIFUPCXWcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
|
|
2008
2045
|
const parsedRequestUrl = _chunkHNAISJFDcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
2009
2046
|
trustProxy: currentServerConfig.trustProxy
|
|
@@ -2015,7 +2052,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2015
2052
|
createRequestFromNodeRequest(req, new URL(fullUrl))
|
|
2016
2053
|
);
|
|
2017
2054
|
if (imageResponse) {
|
|
2018
|
-
await
|
|
2055
|
+
await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, imageResponse);
|
|
2019
2056
|
return;
|
|
2020
2057
|
}
|
|
2021
2058
|
}
|
|
@@ -2071,7 +2108,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2071
2108
|
openapi: options.openapi
|
|
2072
2109
|
},
|
|
2073
2110
|
workflows: discoveredWorkflows,
|
|
2074
|
-
plugins: _optionalChain([pm, 'optionalAccess',
|
|
2111
|
+
plugins: _optionalChain([pm, 'optionalAccess', _139 => _139.getSortedPlugins, 'call', _140 => _140()])
|
|
2075
2112
|
});
|
|
2076
2113
|
res.statusCode = 200;
|
|
2077
2114
|
res.setHeader(
|
|
@@ -2084,7 +2121,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2084
2121
|
} else {
|
|
2085
2122
|
if (!warnedDeprecatedDevtoolsDashboard) {
|
|
2086
2123
|
warnedDeprecatedDevtoolsDashboard = true;
|
|
2087
|
-
|
|
2124
|
+
_chunkVQJYGZNXcjs.logger.warn(
|
|
2088
2125
|
"The built-in DevTools dashboard is deprecated. Install @farm.js/devtools and add devtools() to plugins in farm.config.ts."
|
|
2089
2126
|
);
|
|
2090
2127
|
}
|
|
@@ -2094,7 +2131,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2094
2131
|
return;
|
|
2095
2132
|
}
|
|
2096
2133
|
const runAppMiddlewareForContentRoute = async () => {
|
|
2097
|
-
if (!_optionalChain([middlewareManager, 'optionalAccess',
|
|
2134
|
+
if (!_optionalChain([middlewareManager, 'optionalAccess', _141 => _141.hasMiddleware, 'call', _142 => _142()])) return false;
|
|
2098
2135
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
2099
2136
|
return runFarmMiddlewareWithNavigation(
|
|
2100
2137
|
farmApp.getServerRenderer(),
|
|
@@ -2110,16 +2147,16 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2110
2147
|
label
|
|
2111
2148
|
} = {}) => {
|
|
2112
2149
|
const discard = async () => {
|
|
2113
|
-
await _optionalChain([computed, 'optionalAccess',
|
|
2150
|
+
await _optionalChain([computed, 'optionalAccess', _143 => _143.body, 'optionalAccess', _144 => _144.cancel, 'call', _145 => _145(), 'access', _146 => _146.catch, 'call', _147 => _147(() => {
|
|
2114
2151
|
})]);
|
|
2115
2152
|
};
|
|
2116
2153
|
let runtimeSession2;
|
|
2117
|
-
if (_optionalChain([pm, 'optionalAccess',
|
|
2154
|
+
if (_optionalChain([pm, 'optionalAccess', _148 => _148.hasRuntimeRequestHooks, 'call', _149 => _149()])) {
|
|
2118
2155
|
try {
|
|
2119
2156
|
const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath);
|
|
2120
|
-
const route =
|
|
2157
|
+
const route = _chunkRMPNYUGTcjs.setFarmRouteLabel.call(void 0,
|
|
2121
2158
|
{ pathname: requestPathname },
|
|
2122
|
-
label !== void 0 ? label : devBuiltInRoutePaths.has(routePathname) ? routePathname :
|
|
2159
|
+
label !== void 0 ? label : devBuiltInRoutePaths.has(routePathname) ? routePathname : _chunkRMPNYUGTcjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath)
|
|
2123
2160
|
);
|
|
2124
2161
|
runtimeSession2 = await pm.beginRuntimeRequest(
|
|
2125
2162
|
createRequestFromNodeRequest(req, new URL(fullUrl)),
|
|
@@ -2135,7 +2172,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2135
2172
|
}
|
|
2136
2173
|
if (runtimeSession2.response) {
|
|
2137
2174
|
await discard();
|
|
2138
|
-
await
|
|
2175
|
+
await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0,
|
|
2139
2176
|
res,
|
|
2140
2177
|
await pm.endRuntimeRequest(runtimeSession2, runtimeSession2.response)
|
|
2141
2178
|
);
|
|
@@ -2151,20 +2188,20 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2151
2188
|
let response;
|
|
2152
2189
|
try {
|
|
2153
2190
|
response = await respond(
|
|
2154
|
-
_nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess',
|
|
2191
|
+
_nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess', _150 => _150.request]), () => ( createRequestFromNodeRequest(req, new URL(fullUrl))))
|
|
2155
2192
|
);
|
|
2156
2193
|
} catch (error) {
|
|
2157
2194
|
if (runtimeSession2) await pm.failRuntimeRequest(runtimeSession2, error);
|
|
2158
2195
|
throw error;
|
|
2159
2196
|
}
|
|
2160
2197
|
if (!response) return;
|
|
2161
|
-
await
|
|
2198
|
+
await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0,
|
|
2162
2199
|
res,
|
|
2163
2200
|
runtimeSession2 ? await pm.endRuntimeRequest(runtimeSession2, response) : response
|
|
2164
2201
|
);
|
|
2165
2202
|
};
|
|
2166
2203
|
const openAPIRequestPathname = openAPIManager ? _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) : requestPathname;
|
|
2167
|
-
if (openAPIManager && _optionalChain([options, 'access',
|
|
2204
|
+
if (openAPIManager && _optionalChain([options, 'access', _151 => _151.openapi, 'optionalAccess', _152 => _152.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
|
|
2168
2205
|
const specManager = openAPIManager;
|
|
2169
2206
|
await serveBuiltInRoute(async () => {
|
|
2170
2207
|
if (requestMethod !== "GET" && requestMethod !== "HEAD") {
|
|
@@ -2184,7 +2221,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2184
2221
|
});
|
|
2185
2222
|
return;
|
|
2186
2223
|
}
|
|
2187
|
-
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access',
|
|
2224
|
+
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _153 => _153.openapi, 'optionalAccess', _154 => _154.route])) {
|
|
2188
2225
|
const docsManager = openAPIManager;
|
|
2189
2226
|
await serveBuiltInRoute(
|
|
2190
2227
|
async () => {
|
|
@@ -2195,24 +2232,24 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2195
2232
|
);
|
|
2196
2233
|
return;
|
|
2197
2234
|
}
|
|
2198
|
-
if (_optionalChain([options, 'access',
|
|
2235
|
+
if (_optionalChain([options, 'access', _155 => _155.agent, 'optionalAccess', _156 => _156.manifest]) !== false && _chunkRMPNYUGTcjs.isFarmAppManifestPath.call(void 0, _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath))) {
|
|
2199
2236
|
await serveBuiltInRoute(async () => {
|
|
2200
|
-
_nullishCoalesce(farmAppPackages, () => ( (farmAppPackages =
|
|
2201
|
-
const manifest = await
|
|
2237
|
+
_nullishCoalesce(farmAppPackages, () => ( (farmAppPackages = _chunkX2M4XN4Vcjs.resolveFarmAppPackages.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd()))))));
|
|
2238
|
+
const manifest = await _chunkRMPNYUGTcjs.createFarmAppManifestResponse.call(void 0,
|
|
2202
2239
|
new Request(parsedRequestUrl, {
|
|
2203
2240
|
method: requestMethod,
|
|
2204
2241
|
headers: { "if-none-match": String(_nullishCoalesce(req.headers["if-none-match"], () => ( ""))) }
|
|
2205
2242
|
}),
|
|
2206
2243
|
{
|
|
2207
|
-
...
|
|
2244
|
+
..._chunkRMPNYUGTcjs.resolveFarmAppManifestInput.call(void 0, farmConfig, {
|
|
2208
2245
|
build: "development",
|
|
2209
2246
|
packages: farmAppPackages,
|
|
2210
2247
|
// Read again on each request; unchanged files come from a cache.
|
|
2211
|
-
webmcpTools: _optionalChain([farmConfig, 'access',
|
|
2248
|
+
webmcpTools: _optionalChain([farmConfig, 'access', _157 => _157.plugins, 'optionalAccess', _158 => _158.some, 'call', _159 => _159(({ name }) => name === "farm:webmcp")]) ? _chunkX2M4XN4Vcjs.collectFarmWebMCPTools.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd())), farmConfig.srcDir) : []
|
|
2212
2249
|
}),
|
|
2213
2250
|
defaultMCP: () => farmApp.getServerRenderer().getDefaultMCPServer(),
|
|
2214
2251
|
// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
2215
|
-
guardCoversPath: (path6) =>
|
|
2252
|
+
guardCoversPath: (path6) => _chunk76GHW3WIcjs.farmPathGuardCoversEndpoint.call(void 0,
|
|
2216
2253
|
{
|
|
2217
2254
|
config: farmConfig,
|
|
2218
2255
|
middlewareRoutes: middlewareManager.getMiddlewares().filter((entry) => entry.source !== "config")
|
|
@@ -2226,11 +2263,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2226
2263
|
});
|
|
2227
2264
|
return;
|
|
2228
2265
|
}
|
|
2229
|
-
if (_optionalChain([options, 'access',
|
|
2266
|
+
if (_optionalChain([options, 'access', _160 => _160.agent, 'optionalAccess', _161 => _161.apiCatalog]) && _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunkRMPNYUGTcjs.FARM_API_CATALOG_PATH) {
|
|
2230
2267
|
await serveBuiltInRoute(
|
|
2231
|
-
() =>
|
|
2268
|
+
() => _chunkRMPNYUGTcjs.createFarmApiCatalogResponse.call(void 0,
|
|
2232
2269
|
requestMethod,
|
|
2233
|
-
|
|
2270
|
+
_chunkRMPNYUGTcjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
|
|
2234
2271
|
new Request(parsedRequestUrl, {
|
|
2235
2272
|
headers: { "user-agent": String(_nullishCoalesce(req.headers["user-agent"], () => ( ""))) }
|
|
2236
2273
|
})
|
|
@@ -2238,8 +2275,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2238
2275
|
);
|
|
2239
2276
|
return;
|
|
2240
2277
|
}
|
|
2241
|
-
if (_optionalChain([options, 'access',
|
|
2242
|
-
const aiCatalog =
|
|
2278
|
+
if (_optionalChain([options, 'access', _162 => _162.agent, 'optionalAccess', _163 => _163.aiCatalog]) !== false) {
|
|
2279
|
+
const aiCatalog = _chunkRMPNYUGTcjs.createFarmAiCatalogResponse.call(void 0,
|
|
2243
2280
|
new Request(parsedRequestUrl, {
|
|
2244
2281
|
method: requestMethod,
|
|
2245
2282
|
headers: {
|
|
@@ -2283,18 +2320,21 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2283
2320
|
{
|
|
2284
2321
|
kind: "docs",
|
|
2285
2322
|
computed: docsResponse,
|
|
2286
|
-
label:
|
|
2323
|
+
label: _chunkRMPNYUGTcjs.resolveFarmDocsEngineRouteLabel.call(void 0,
|
|
2287
2324
|
_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath),
|
|
2288
|
-
{
|
|
2325
|
+
{
|
|
2326
|
+
path: _optionalChain([farmConfig, 'access', _164 => _164.docs, 'optionalAccess', _165 => _165.entry]) || "/docs",
|
|
2327
|
+
roots: _optionalChain([farmConfig, 'access', _166 => _166.docs, 'optionalAccess', _167 => _167.roots, 'optionalAccess', _168 => _168.map, 'call', _169 => _169((root) => root.entry)])
|
|
2328
|
+
}
|
|
2289
2329
|
)
|
|
2290
2330
|
}
|
|
2291
2331
|
);
|
|
2292
2332
|
return;
|
|
2293
2333
|
}
|
|
2294
2334
|
}
|
|
2295
|
-
const markdownRouteLabel = () =>
|
|
2335
|
+
const markdownRouteLabel = () => _chunkRMPNYUGTcjs.resolveFarmMarkdownRouteLabel.call(void 0,
|
|
2296
2336
|
_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath),
|
|
2297
|
-
(page) => _optionalChain([farmApp, 'access',
|
|
2337
|
+
(page) => _optionalChain([farmApp, 'access', _170 => _170.getRouteManager, 'call', _171 => _171(), 'access', _172 => _172.matchRoute, 'call', _173 => _173(page), 'access', _174 => _174.route, 'optionalAccess', _175 => _175.pattern])
|
|
2298
2338
|
);
|
|
2299
2339
|
const markdownSourceResponse = viteModuleRequest ? null : await _chunkJATTVAHAcjs.createFarmMarkdownSourceResponse.call(void 0, {
|
|
2300
2340
|
request: new Request(fullUrl, {
|
|
@@ -2304,7 +2344,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2304
2344
|
config: farmApp.getConfig().mdx,
|
|
2305
2345
|
resolveSource: async (pathname2) => {
|
|
2306
2346
|
const match = farmApp.getRouteManager().matchRoute(pathname2);
|
|
2307
|
-
const sourcePath = _optionalChain([match, 'access',
|
|
2347
|
+
const sourcePath = _optionalChain([match, 'access', _176 => _176.route, 'optionalAccess', _177 => _177.markdownSourcePath]) || (match.route && _chunkJATTVAHAcjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
|
|
2308
2348
|
if (!sourcePath) {
|
|
2309
2349
|
return null;
|
|
2310
2350
|
}
|
|
@@ -2412,7 +2452,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2412
2452
|
} catch (error) {
|
|
2413
2453
|
const response = _chunkLIFUPCXWcjs.createFarmRequestBodyErrorResponse.call(void 0, error);
|
|
2414
2454
|
if (!response) throw error;
|
|
2415
|
-
await
|
|
2455
|
+
await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, response);
|
|
2416
2456
|
return;
|
|
2417
2457
|
}
|
|
2418
2458
|
const workflowResponse = await workflowHandler(
|
|
@@ -2424,13 +2464,13 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2424
2464
|
})
|
|
2425
2465
|
);
|
|
2426
2466
|
if (workflowResponse) {
|
|
2427
|
-
await
|
|
2467
|
+
await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, workflowResponse);
|
|
2428
2468
|
return;
|
|
2429
2469
|
}
|
|
2430
2470
|
}
|
|
2431
2471
|
const configuredIntegrations = currentConfig.integrations;
|
|
2432
2472
|
const tryConfiguredIntegrationRoute = async () => {
|
|
2433
|
-
const matchedRoute =
|
|
2473
|
+
const matchedRoute = _chunkCECUDGXQcjs.matchIntegrationRoute.call(void 0, configuredIntegrations, {
|
|
2434
2474
|
pathname: requestPathname,
|
|
2435
2475
|
method: requestMethod
|
|
2436
2476
|
});
|
|
@@ -2443,8 +2483,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2443
2483
|
await pm.runHookParallelFiltered(
|
|
2444
2484
|
"beforeRequest",
|
|
2445
2485
|
(plugin) => {
|
|
2446
|
-
const owner =
|
|
2447
|
-
return plugin.name !== _chunkUYTAP4FQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess',
|
|
2486
|
+
const owner = _chunkCECUDGXQcjs.getFarmIntegrationPluginOwner.call(void 0, plugin);
|
|
2487
|
+
return plugin.name !== _chunkUYTAP4FQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess', _178 => _178.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
|
|
2448
2488
|
},
|
|
2449
2489
|
req,
|
|
2450
2490
|
res
|
|
@@ -2472,7 +2512,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2472
2512
|
signal: _chunkLIFUPCXWcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
|
|
2473
2513
|
});
|
|
2474
2514
|
const dispatchIntegration = async (request) => {
|
|
2475
|
-
const result = await
|
|
2515
|
+
const result = await _chunkCECUDGXQcjs.dispatchIntegrationRequest.call(void 0,
|
|
2476
2516
|
{
|
|
2477
2517
|
integration: matchedRoute.integration,
|
|
2478
2518
|
config: currentConfig,
|
|
@@ -2480,7 +2520,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2480
2520
|
isProd: false
|
|
2481
2521
|
},
|
|
2482
2522
|
request,
|
|
2483
|
-
{ clientAddress: _optionalChain([req, 'access',
|
|
2523
|
+
{ clientAddress: _optionalChain([req, 'access', _179 => _179.socket, 'optionalAccess', _180 => _180.remoteAddress]) }
|
|
2484
2524
|
);
|
|
2485
2525
|
if (!result) {
|
|
2486
2526
|
throw new Error(`Matched integration route did not return a response`);
|
|
@@ -2499,12 +2539,12 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2499
2539
|
}
|
|
2500
2540
|
const duration = Date.now() - startTime2;
|
|
2501
2541
|
logResponse(requestMethod, requestUrl, response.status, duration, "API");
|
|
2502
|
-
await
|
|
2542
|
+
await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, response);
|
|
2503
2543
|
return true;
|
|
2504
2544
|
} catch (error) {
|
|
2505
2545
|
const bodyErrorResponse = _chunkLIFUPCXWcjs.createFarmRequestBodyErrorResponse.call(void 0, error);
|
|
2506
2546
|
if (bodyErrorResponse) {
|
|
2507
|
-
await
|
|
2547
|
+
await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, bodyErrorResponse);
|
|
2508
2548
|
return true;
|
|
2509
2549
|
}
|
|
2510
2550
|
const duration = Date.now() - startTime2;
|
|
@@ -2515,7 +2555,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2515
2555
|
method: requestMethod,
|
|
2516
2556
|
integration: matchedRoute.key
|
|
2517
2557
|
});
|
|
2518
|
-
|
|
2558
|
+
_chunkVQJYGZNXcjs.logger.error(`Integration route error: ${error}`);
|
|
2519
2559
|
if (!res.writableEnded) {
|
|
2520
2560
|
res.statusCode = 500;
|
|
2521
2561
|
res.setHeader("Content-Type", "application/json");
|
|
@@ -2543,9 +2583,12 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2543
2583
|
const pathname2 = _chunkHNAISJFDcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
2544
2584
|
trustProxy: currentServerConfig.trustProxy
|
|
2545
2585
|
}).pathname;
|
|
2586
|
+
const servesLocalApiRoute = hasMatchedApiRoute || Boolean(
|
|
2587
|
+
farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _181 => _181.isFarmDocsAPIRequest, 'call', _182 => _182(requestPathname)])
|
|
2588
|
+
);
|
|
2546
2589
|
try {
|
|
2547
2590
|
if (pm) {
|
|
2548
|
-
if (
|
|
2591
|
+
if (servesLocalApiRoute) {
|
|
2549
2592
|
await pm.runHookParallelFiltered(
|
|
2550
2593
|
"beforeRequest",
|
|
2551
2594
|
(plugin) => plugin.name !== _chunkUYTAP4FQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
|
|
@@ -2556,7 +2599,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2556
2599
|
await pm.runHookParallel("beforeRequest", req, res);
|
|
2557
2600
|
}
|
|
2558
2601
|
}
|
|
2559
|
-
if (res.writableEnded) {
|
|
2602
|
+
if (res.writableEnded || await proxyFarmExternalRewrite(req, res, currentServerConfig.bodySizeLimit)) {
|
|
2560
2603
|
const duration2 = Date.now() - startTime2;
|
|
2561
2604
|
logResponse(method2, urlPath2, res.statusCode || 200, duration2, "API");
|
|
2562
2605
|
return;
|
|
@@ -2566,7 +2609,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2566
2609
|
urlPath: urlPath2,
|
|
2567
2610
|
method: method2
|
|
2568
2611
|
});
|
|
2569
|
-
|
|
2612
|
+
_chunkVQJYGZNXcjs.logger.error(`Request hook error: ${error}`);
|
|
2570
2613
|
res.statusCode = 500;
|
|
2571
2614
|
res.setHeader("Content-Type", "application/json");
|
|
2572
2615
|
res.end(JSON.stringify({ error: "Internal server error" }));
|
|
@@ -2578,9 +2621,14 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2578
2621
|
return;
|
|
2579
2622
|
}
|
|
2580
2623
|
const apiHandler = apiRouteManager.getHandler({ throwOnError: true });
|
|
2581
|
-
const
|
|
2624
|
+
const routedPathname = _chunkHNAISJFDcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
2625
|
+
trustProxy: currentServerConfig.trustProxy
|
|
2626
|
+
}).pathname;
|
|
2627
|
+
const rewritten = routedPathname !== pathname2;
|
|
2628
|
+
const routedApiRoute = rewritten ? apiRouteManager.matchRoute(routedPathname) : matchedApiRoute || apiRouteManager.matchRoute(pathname2);
|
|
2629
|
+
const hasExplicitAPIRoute = Boolean(routedApiRoute);
|
|
2582
2630
|
if (apiHandler && hasExplicitAPIRoute) {
|
|
2583
|
-
const apiRoutePattern = _optionalChain([
|
|
2631
|
+
const apiRoutePattern = _optionalChain([routedApiRoute, 'optionalAccess', _183 => _183.route, 'access', _184 => _184.path]) || urlPath2;
|
|
2584
2632
|
_chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
|
|
2585
2633
|
type: "route.matched",
|
|
2586
2634
|
pathname: pathname2,
|
|
@@ -2641,7 +2689,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2641
2689
|
durationMs: duration2
|
|
2642
2690
|
});
|
|
2643
2691
|
logResponse(method2, urlPath2, handledResponse.status, duration2, "API");
|
|
2644
|
-
await
|
|
2692
|
+
await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, handledResponse);
|
|
2645
2693
|
return;
|
|
2646
2694
|
} catch (error) {
|
|
2647
2695
|
const duration2 = Date.now() - startTime2;
|
|
@@ -2656,21 +2704,21 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2656
2704
|
const bodyErrorResponse = _chunkLIFUPCXWcjs.createFarmRequestBodyErrorResponse.call(void 0, error);
|
|
2657
2705
|
if (bodyErrorResponse) {
|
|
2658
2706
|
logResponse(method2, urlPath2, bodyErrorResponse.status, duration2, "API");
|
|
2659
|
-
await
|
|
2707
|
+
await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, bodyErrorResponse);
|
|
2660
2708
|
return;
|
|
2661
2709
|
}
|
|
2662
2710
|
await emitPluginError("api-handler", error, {
|
|
2663
2711
|
urlPath: urlPath2,
|
|
2664
2712
|
method: method2
|
|
2665
2713
|
});
|
|
2666
|
-
|
|
2714
|
+
_chunkVQJYGZNXcjs.logger.error(`API route error: ${error}`);
|
|
2667
2715
|
res.statusCode = 500;
|
|
2668
2716
|
res.setHeader("Content-Type", "application/json");
|
|
2669
2717
|
res.end(JSON.stringify({ error: "Internal server error" }));
|
|
2670
2718
|
return;
|
|
2671
2719
|
}
|
|
2672
2720
|
}
|
|
2673
|
-
if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
2721
|
+
if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _185 => _185.isFarmDocsAPIRequest, 'call', _186 => _186(pathname2)])) {
|
|
2674
2722
|
try {
|
|
2675
2723
|
const url = `http://${req.headers.host || "localhost:3000"}${req.url}`;
|
|
2676
2724
|
const headers = new Headers();
|
|
@@ -2708,30 +2756,31 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2708
2756
|
};
|
|
2709
2757
|
const docsResponse = pm ? await pm.runRuntimeRequest(request, invokeDocsAPIHandler, {
|
|
2710
2758
|
kind: "docs",
|
|
2711
|
-
route:
|
|
2759
|
+
route: _chunkRMPNYUGTcjs.setFarmRouteLabel.call(void 0,
|
|
2712
2760
|
{ pathname: pathname2, pattern: apiLifecyclePayload.routePath },
|
|
2713
|
-
|
|
2714
|
-
path: _optionalChain([farmConfig, 'access',
|
|
2761
|
+
_chunkRMPNYUGTcjs.resolveFarmDocsRouteLabel.call(void 0, pathname2, {
|
|
2762
|
+
path: _optionalChain([farmConfig, 'access', _187 => _187.docs, 'optionalAccess', _188 => _188.entry]) || "/docs",
|
|
2763
|
+
roots: _optionalChain([farmConfig, 'access', _189 => _189.docs, 'optionalAccess', _190 => _190.roots, 'optionalAccess', _191 => _191.map, 'call', _192 => _192((root) => root.entry)])
|
|
2715
2764
|
})
|
|
2716
2765
|
)
|
|
2717
2766
|
}) : await invokeDocsAPIHandler(request);
|
|
2718
2767
|
if (docsResponse) {
|
|
2719
2768
|
const duration2 = Date.now() - startTime2;
|
|
2720
2769
|
logResponse(method2, urlPath2, docsResponse.status, duration2, "API");
|
|
2721
|
-
await
|
|
2770
|
+
await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, docsResponse);
|
|
2722
2771
|
return;
|
|
2723
2772
|
}
|
|
2724
2773
|
} catch (error) {
|
|
2725
2774
|
const bodyErrorResponse = _chunkLIFUPCXWcjs.createFarmRequestBodyErrorResponse.call(void 0, error);
|
|
2726
2775
|
if (bodyErrorResponse) {
|
|
2727
|
-
await
|
|
2776
|
+
await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, bodyErrorResponse);
|
|
2728
2777
|
return;
|
|
2729
2778
|
}
|
|
2730
2779
|
await emitPluginError("docs-api-handler", error, {
|
|
2731
2780
|
urlPath: urlPath2,
|
|
2732
2781
|
method: method2
|
|
2733
2782
|
});
|
|
2734
|
-
|
|
2783
|
+
_chunkVQJYGZNXcjs.logger.error(`Docs API route error: ${error}`);
|
|
2735
2784
|
res.statusCode = 500;
|
|
2736
2785
|
res.setHeader("Content-Type", "application/json");
|
|
2737
2786
|
res.end(JSON.stringify({ error: "Internal server error" }));
|
|
@@ -2745,18 +2794,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2745
2794
|
res.end(JSON.stringify({ error: "API route not found", pathname: pathname2 }));
|
|
2746
2795
|
return;
|
|
2747
2796
|
}
|
|
2748
|
-
if (_optionalChain([req, 'access',
|
|
2797
|
+
if (_optionalChain([req, 'access', _193 => _193.url, 'optionalAccess', _194 => _194.startsWith, 'call', _195 => _195("/@")]) || _optionalChain([req, 'access', _196 => _196.url, 'optionalAccess', _197 => _197.startsWith, 'call', _198 => _198("/node_modules")])) {
|
|
2749
2798
|
return next();
|
|
2750
2799
|
}
|
|
2751
2800
|
if (shouldBypassFarmRouterForDottedPath(
|
|
2752
2801
|
requestPathname,
|
|
2753
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
2802
|
+
_optionalChain([farmApp, 'optionalAccess', _199 => _199.getRouteManager, 'call', _200 => _200()]),
|
|
2754
2803
|
[server.config.publicDir, server.config.root],
|
|
2755
2804
|
farmAgentGeneratedPaths(farmConfig)
|
|
2756
2805
|
)) {
|
|
2757
2806
|
return next();
|
|
2758
2807
|
}
|
|
2759
|
-
if (_optionalChain([req, 'access',
|
|
2808
|
+
if (_optionalChain([req, 'access', _201 => _201.url, 'optionalAccess', _202 => _202.startsWith, 'call', _203 => _203("/__farm/page-data")])) {
|
|
2760
2809
|
const urlObj = parsedRequestUrl;
|
|
2761
2810
|
const targetPath = urlObj.searchParams.get("path") || "/";
|
|
2762
2811
|
try {
|
|
@@ -2770,7 +2819,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2770
2819
|
farmConfig.deploymentId
|
|
2771
2820
|
);
|
|
2772
2821
|
if (deploymentMismatch) {
|
|
2773
|
-
await
|
|
2822
|
+
await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0,
|
|
2774
2823
|
res,
|
|
2775
2824
|
_chunkE552H232cjs.createFarmDeploymentMismatchResponse.call(void 0, deploymentMismatch)
|
|
2776
2825
|
);
|
|
@@ -2784,7 +2833,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2784
2833
|
});
|
|
2785
2834
|
let middlewareMap = /* @__PURE__ */ new Map();
|
|
2786
2835
|
let middlewareContext = /* @__PURE__ */ new Map();
|
|
2787
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
2836
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _204 => _204.hasMiddleware, 'call', _205 => _205()])) {
|
|
2788
2837
|
const targetNodeRequest = createPageDataMiddlewareRequest(req, targetRequestUrl);
|
|
2789
2838
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
2790
2839
|
farmApp.getServerRenderer(),
|
|
@@ -2812,10 +2861,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2812
2861
|
if (pm) {
|
|
2813
2862
|
await pm.runHookParallel("afterRouteMatch", {
|
|
2814
2863
|
pathname: targetPath,
|
|
2815
|
-
matched: !!_optionalChain([match, 'optionalAccess',
|
|
2816
|
-
routePattern: _optionalChain([match, 'optionalAccess',
|
|
2817
|
-
params: _optionalChain([match, 'optionalAccess',
|
|
2818
|
-
layoutPatterns: (_optionalChain([match, 'optionalAccess',
|
|
2864
|
+
matched: !!_optionalChain([match, 'optionalAccess', _206 => _206.route]),
|
|
2865
|
+
routePattern: _optionalChain([match, 'optionalAccess', _207 => _207.route, 'optionalAccess', _208 => _208.pattern]) || null,
|
|
2866
|
+
params: _optionalChain([match, 'optionalAccess', _209 => _209.params]) || {},
|
|
2867
|
+
layoutPatterns: (_optionalChain([match, 'optionalAccess', _210 => _210.layouts]) || []).map((l) => l.pattern)
|
|
2819
2868
|
});
|
|
2820
2869
|
}
|
|
2821
2870
|
if (!match) {
|
|
@@ -2838,7 +2887,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2838
2887
|
);
|
|
2839
2888
|
const loadingModule = loadingBoundary ? await routeManager3.loadRouteModule(loadingBoundary.modulePath) : null;
|
|
2840
2889
|
const navigationManifest = routeManager3.generateClientManifest(server.config.root);
|
|
2841
|
-
const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => (
|
|
2890
|
+
const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => ( _chunkX2M4XN4Vcjs.getClientModuleMetadata.call(void 0, route.modulePath, server.config.root)));
|
|
2842
2891
|
const isClientComponent = moduleMetadata.isClientComponent;
|
|
2843
2892
|
const shouldHydrate = moduleMetadata.shouldHydrate;
|
|
2844
2893
|
let mergedMetadata = {};
|
|
@@ -2846,7 +2895,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2846
2895
|
layouts.map((layout) => routeManager3.loadLayoutModule(layout.modulePath))
|
|
2847
2896
|
);
|
|
2848
2897
|
const layoutHydrationMetadata = layouts.map(
|
|
2849
|
-
(layout) => _nullishCoalesce(navigationManifest.layouts.find((entry) => entry.pattern === layout.pattern), () => (
|
|
2898
|
+
(layout) => _nullishCoalesce(navigationManifest.layouts.find((entry) => entry.pattern === layout.pattern), () => ( _chunkX2M4XN4Vcjs.getClientModuleMetadata.call(void 0, layout.modulePath, server.config.root)))
|
|
2850
2899
|
);
|
|
2851
2900
|
const shouldHydrateLayout = layoutHydrationMetadata.some(
|
|
2852
2901
|
(metadata) => metadata.shouldHydrate
|
|
@@ -2861,7 +2910,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2861
2910
|
(strategy) => strategy === hydrationStrategies[0]
|
|
2862
2911
|
) ? _nullishCoalesce(hydrationStrategies[0], () => ( "load")) : "load";
|
|
2863
2912
|
const targetUrl = new URL(targetPath, "http://localhost");
|
|
2864
|
-
const searchParams =
|
|
2913
|
+
const searchParams = _chunkSUCDVKUBcjs.searchParamsToObject.call(void 0, targetUrl.searchParams);
|
|
2865
2914
|
const routeContext = await _chunkX333W5KVcjs.resolveFarmRouteContext.call(void 0, farmApp.getConfig(), {
|
|
2866
2915
|
request: targetRequest,
|
|
2867
2916
|
params,
|
|
@@ -2872,7 +2921,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2872
2921
|
props: _chunkX333W5KVcjs.withFarmRouteContext.call(void 0,
|
|
2873
2922
|
{
|
|
2874
2923
|
params,
|
|
2875
|
-
searchParams:
|
|
2924
|
+
searchParams: _chunkSUCDVKUBcjs.createFarmSearchParams.call(void 0, searchParams),
|
|
2876
2925
|
path: targetUrl.pathname,
|
|
2877
2926
|
middleware: middlewareMap.size > 0 ? { data: middlewareMap } : void 0
|
|
2878
2927
|
},
|
|
@@ -2910,7 +2959,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2910
2959
|
const slotModule = await routeManager3.loadRouteModule(slot.route.modulePath);
|
|
2911
2960
|
const slotMetadata = _nullishCoalesce(navigationManifest.slots.find(
|
|
2912
2961
|
(entry) => entry.name === slot.name && entry.ownerPattern === slot.ownerPattern && entry.pattern === slot.route.pattern
|
|
2913
|
-
), () => (
|
|
2962
|
+
), () => ( _chunkX2M4XN4Vcjs.getClientModuleMetadata.call(void 0, slot.route.modulePath, server.config.root)));
|
|
2914
2963
|
const slotContext = await _chunkX333W5KVcjs.resolveFarmRouteContext.call(void 0, farmApp.getConfig(), {
|
|
2915
2964
|
request: targetRequest,
|
|
2916
2965
|
params: slot.params,
|
|
@@ -2921,7 +2970,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2921
2970
|
props: _chunkX333W5KVcjs.withFarmRouteContext.call(void 0,
|
|
2922
2971
|
{
|
|
2923
2972
|
params: slot.params,
|
|
2924
|
-
searchParams:
|
|
2973
|
+
searchParams: _chunkSUCDVKUBcjs.createFarmSearchParams.call(void 0, searchParams),
|
|
2925
2974
|
path: targetUrl.pathname
|
|
2926
2975
|
},
|
|
2927
2976
|
slotContext
|
|
@@ -2955,16 +3004,16 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2955
3004
|
})
|
|
2956
3005
|
);
|
|
2957
3006
|
const projectRoot = server.config.root;
|
|
2958
|
-
const toUrlPath = (absolutePath) =>
|
|
2959
|
-
const renderPlan =
|
|
3007
|
+
const toUrlPath = (absolutePath) => _chunkVQJYGZNXcjs.toViteModuleId.call(void 0, absolutePath, projectRoot);
|
|
3008
|
+
const renderPlan = _chunk76GHW3WIcjs.createFarmRouteRenderPlan.call(void 0, {
|
|
2960
3009
|
pageShouldHydrate: shouldHydrate,
|
|
2961
3010
|
layoutShouldHydrate: shouldHydrateLayout,
|
|
2962
3011
|
islandStrategy: hydrationIslandStrategy,
|
|
2963
|
-
rendering:
|
|
3012
|
+
rendering: _chunkUQHIWZZ6cjs.resolveRouteRenderingConfig.call(void 0, routeModule)
|
|
2964
3013
|
});
|
|
2965
3014
|
const destinationLayoutPatterns = layouts.map((layout) => layout.pattern);
|
|
2966
|
-
const layoutStartIndex =
|
|
2967
|
-
|
|
3015
|
+
const layoutStartIndex = _chunk76GHW3WIcjs.getSharedLayoutPrefixLength.call(void 0,
|
|
3016
|
+
_chunk76GHW3WIcjs.parseFarmLayoutChainHeader.call(void 0, request.headers.get("x-farm-layout-chain")),
|
|
2968
3017
|
destinationLayoutPatterns
|
|
2969
3018
|
);
|
|
2970
3019
|
const renderer = farmApp.getServerRenderer();
|
|
@@ -2974,7 +3023,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2974
3023
|
middlewareContext,
|
|
2975
3024
|
() => renderer.renderNavigationFragment({
|
|
2976
3025
|
PageComponent: routeModule.default,
|
|
2977
|
-
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess',
|
|
3026
|
+
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _211 => _211.default]),
|
|
2978
3027
|
pageProps: routeProps,
|
|
2979
3028
|
params,
|
|
2980
3029
|
layouts: layouts.map((layout, index) => ({
|
|
@@ -3038,14 +3087,14 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3038
3087
|
} : void 0,
|
|
3039
3088
|
i18n: _chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0, )
|
|
3040
3089
|
};
|
|
3041
|
-
await
|
|
3090
|
+
await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0,
|
|
3042
3091
|
res,
|
|
3043
3092
|
_chunkXQSYOVCWcjs.createDeferredDataResponse.call(void 0,
|
|
3044
3093
|
pageData,
|
|
3045
3094
|
{
|
|
3046
3095
|
status: 200,
|
|
3047
3096
|
headers: {
|
|
3048
|
-
"Cache-Control":
|
|
3097
|
+
"Cache-Control": _chunk76GHW3WIcjs.getFarmFragmentCacheControl.call(void 0, renderPlan),
|
|
3049
3098
|
"X-Farm-Navigation": "html-fragment",
|
|
3050
3099
|
Vary: "X-Farm-Layout-Chain",
|
|
3051
3100
|
[_chunkE552H232cjs.FARM_DEPLOYMENT_ID_HEADER]: farmConfig.deploymentId
|
|
@@ -3053,7 +3102,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3053
3102
|
},
|
|
3054
3103
|
{
|
|
3055
3104
|
onError(error, id) {
|
|
3056
|
-
|
|
3105
|
+
_chunkVQJYGZNXcjs.logger.error(`Deferred route data ${id} failed: ${error}`);
|
|
3057
3106
|
}
|
|
3058
3107
|
}
|
|
3059
3108
|
)
|
|
@@ -3082,18 +3131,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3082
3131
|
trustProxy: currentServerConfig.trustProxy
|
|
3083
3132
|
}).pathname;
|
|
3084
3133
|
const routeManager2 = farmApp.getRouteManager();
|
|
3085
|
-
const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3086
|
-
const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3087
|
-
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3088
|
-
const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3089
|
-
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3090
|
-
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3091
|
-
const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3092
|
-
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3134
|
+
const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _212 => _212.hasHook, 'call', _213 => _213("beforeRouteMatch")]), () => ( false));
|
|
3135
|
+
const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _214 => _214.hasHook, 'call', _215 => _215("afterRouteMatch")]), () => ( false));
|
|
3136
|
+
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _216 => _216.hasHook, 'call', _217 => _217("beforeRequest")]), () => ( false));
|
|
3137
|
+
const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _218 => _218.hasHook, 'call', _219 => _219("beforeRender")]), () => ( false));
|
|
3138
|
+
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _220 => _220.hasHook, 'call', _221 => _221("afterResponse")]), () => ( false));
|
|
3139
|
+
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _222 => _222.hasHook, 'call', _223 => _223("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _224 => _224.hasHook, 'call', _225 => _225("afterRender")]), () => ( false)));
|
|
3140
|
+
const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _226 => _226.hasRuntimeRequestHooks, 'call', _227 => _227()]), () => ( false));
|
|
3141
|
+
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _228 => _228.hasRuntimeHook, 'call', _229 => _229("after")]), () => ( false));
|
|
3093
3142
|
const requestedMatch = routeManager2.matchRoute(requestedPathname);
|
|
3094
3143
|
const pageBuiltInRouteLabel = (pathname2) => {
|
|
3095
3144
|
const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, pathname2, farmConfig.basePath);
|
|
3096
|
-
const mcpLabel =
|
|
3145
|
+
const mcpLabel = _chunkRMPNYUGTcjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath);
|
|
3097
3146
|
if (mcpLabel) return mcpLabel;
|
|
3098
3147
|
if (farmAgentGeneratedPaths(farmConfig).includes(routePathname)) return routePathname;
|
|
3099
3148
|
return routePathname === _chunkSBABQKPTcjs.FARM_DEFAULT_MCP_PATH && farmApp.getServerRenderer().getDefaultMCPServer() ? _chunkSBABQKPTcjs.FARM_DEFAULT_MCP_PATH : null;
|
|
@@ -3105,13 +3154,13 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3105
3154
|
createRequestFromNodeRequest(req, new URL(fullUrl)),
|
|
3106
3155
|
{
|
|
3107
3156
|
kind: "page",
|
|
3108
|
-
route:
|
|
3157
|
+
route: _chunkRMPNYUGTcjs.setFarmRouteLabel.call(void 0,
|
|
3109
3158
|
{
|
|
3110
3159
|
pathname: requestedPathname,
|
|
3111
|
-
pattern: _optionalChain([requestedMatch, 'optionalAccess',
|
|
3112
|
-
params: _optionalChain([requestedMatch, 'optionalAccess',
|
|
3160
|
+
pattern: _optionalChain([requestedMatch, 'optionalAccess', _230 => _230.route, 'optionalAccess', _231 => _231.pattern]) || null,
|
|
3161
|
+
params: _optionalChain([requestedMatch, 'optionalAccess', _232 => _232.params]) || {}
|
|
3113
3162
|
},
|
|
3114
|
-
_optionalChain([requestedMatch, 'optionalAccess',
|
|
3163
|
+
_optionalChain([requestedMatch, 'optionalAccess', _233 => _233.route]) ? null : pageBuiltInRouteLabel(requestedPathname)
|
|
3115
3164
|
)
|
|
3116
3165
|
}
|
|
3117
3166
|
);
|
|
@@ -3122,7 +3171,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3122
3171
|
runtimeSession,
|
|
3123
3172
|
runtimeSession.response
|
|
3124
3173
|
);
|
|
3125
|
-
await
|
|
3174
|
+
await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, response);
|
|
3126
3175
|
return;
|
|
3127
3176
|
}
|
|
3128
3177
|
} catch (error) {
|
|
@@ -3144,17 +3193,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3144
3193
|
if (pm && hasAfterRouteMatchHook) {
|
|
3145
3194
|
await pm.runHookParallel("afterRouteMatch", {
|
|
3146
3195
|
pathname,
|
|
3147
|
-
matched: !!_optionalChain([routeMatch, 'optionalAccess',
|
|
3148
|
-
routePattern: _optionalChain([routeMatch, 'optionalAccess',
|
|
3149
|
-
params: _optionalChain([routeMatch, 'optionalAccess',
|
|
3150
|
-
layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess',
|
|
3196
|
+
matched: !!_optionalChain([routeMatch, 'optionalAccess', _234 => _234.route]),
|
|
3197
|
+
routePattern: _optionalChain([routeMatch, 'optionalAccess', _235 => _235.route, 'optionalAccess', _236 => _236.pattern]) || null,
|
|
3198
|
+
params: _optionalChain([routeMatch, 'optionalAccess', _237 => _237.params]) || {},
|
|
3199
|
+
layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess', _238 => _238.layouts]) || []).map((l) => l.pattern)
|
|
3151
3200
|
});
|
|
3152
3201
|
}
|
|
3153
3202
|
const renderPayload = {
|
|
3154
3203
|
pathname,
|
|
3155
3204
|
method,
|
|
3156
|
-
routePattern: _optionalChain([routeMatch, 'optionalAccess',
|
|
3157
|
-
params: _optionalChain([routeMatch, 'optionalAccess',
|
|
3205
|
+
routePattern: _optionalChain([routeMatch, 'optionalAccess', _239 => _239.route, 'optionalAccess', _240 => _240.pattern]) || null,
|
|
3206
|
+
params: _optionalChain([routeMatch, 'optionalAccess', _241 => _241.params]) || {}
|
|
3158
3207
|
};
|
|
3159
3208
|
const shouldInterceptResponse = Boolean(
|
|
3160
3209
|
pm && (hasAfterResponseHook || hasHTMLTransformHook || runtimeSession && hasRuntimeAfterHook)
|
|
@@ -3176,7 +3225,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3176
3225
|
emitError: (error) => emitPluginError("response-end", error, { pathname })
|
|
3177
3226
|
}) : void 0;
|
|
3178
3227
|
try {
|
|
3179
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
3228
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _242 => _242.hasMiddleware, 'call', _243 => _243()])) {
|
|
3180
3229
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
3181
3230
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
3182
3231
|
farmApp.getServerRenderer(),
|
|
@@ -3186,7 +3235,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3186
3235
|
() => middlewareManager.execute(req, res)
|
|
3187
3236
|
);
|
|
3188
3237
|
if (handled) {
|
|
3189
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
3238
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _244 => _244.isEnded, 'call', _245 => _245()])) {
|
|
3190
3239
|
const duration = Date.now() - startTime;
|
|
3191
3240
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
3192
3241
|
}
|
|
@@ -3199,14 +3248,14 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3199
3248
|
req.url || "/",
|
|
3200
3249
|
`http://${req.headers.host || "localhost:3000"}`
|
|
3201
3250
|
).pathname;
|
|
3202
|
-
const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access',
|
|
3251
|
+
const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access', _246 => _246.matchRoute, 'call', _247 => _247(currentPathname), 'optionalAccess', _248 => _248.route]));
|
|
3203
3252
|
await pm.runHookParallelFiltered(
|
|
3204
3253
|
"beforeRequest",
|
|
3205
3254
|
(plugin) => !hasLocalPageRoute || plugin.name !== _chunkUYTAP4FQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
|
|
3206
3255
|
req,
|
|
3207
3256
|
res
|
|
3208
3257
|
);
|
|
3209
|
-
if (runtimeSession && req.url !== urlBeforeRequestHooks && _optionalChain([req, 'access',
|
|
3258
|
+
if (runtimeSession && req.url !== urlBeforeRequestHooks && _optionalChain([req, 'access', _249 => _249.url, 'optionalAccess', _250 => _250.startsWith, 'call', _251 => _251("/")]) && !res.writableEnded) {
|
|
3210
3259
|
const destinationUrl = new URL(req.url, fullUrl);
|
|
3211
3260
|
const destinationMatch = routeManager2.matchRoute(destinationUrl.pathname);
|
|
3212
3261
|
const guarded = await pm.runRuntimeBeforeForRewrite(
|
|
@@ -3216,21 +3265,21 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3216
3265
|
kind: "page",
|
|
3217
3266
|
route: {
|
|
3218
3267
|
pathname: destinationUrl.pathname,
|
|
3219
|
-
pattern: _optionalChain([destinationMatch, 'optionalAccess',
|
|
3220
|
-
params: _optionalChain([destinationMatch, 'optionalAccess',
|
|
3268
|
+
pattern: _optionalChain([destinationMatch, 'optionalAccess', _252 => _252.route, 'optionalAccess', _253 => _253.pattern]) || null,
|
|
3269
|
+
params: _optionalChain([destinationMatch, 'optionalAccess', _254 => _254.params]) || {}
|
|
3221
3270
|
}
|
|
3222
3271
|
}
|
|
3223
3272
|
);
|
|
3224
3273
|
if (guarded instanceof Response) {
|
|
3225
|
-
await
|
|
3274
|
+
await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, guarded);
|
|
3226
3275
|
} else {
|
|
3227
3276
|
pm.copyRequestContext(guarded, req);
|
|
3228
3277
|
applyWebRequestToNodeRequest(guarded, req);
|
|
3229
3278
|
}
|
|
3230
3279
|
}
|
|
3231
3280
|
}
|
|
3232
|
-
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess',
|
|
3233
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
3281
|
+
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _255 => _255.isEnded, 'call', _256 => _256()]) || await proxyFarmExternalRewrite(req, res, currentServerConfig.bodySizeLimit)) {
|
|
3282
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _257 => _257.isEnded, 'call', _258 => _258()])) {
|
|
3234
3283
|
const duration = Date.now() - startTime;
|
|
3235
3284
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
3236
3285
|
}
|
|
@@ -3279,6 +3328,12 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3279
3328
|
}
|
|
3280
3329
|
},
|
|
3281
3330
|
async load(id, loadOptions) {
|
|
3331
|
+
if (_chunkPIUTGRDIcjs.isFarmServerFnBoundaryId.call(void 0, id) && islandsServerFns()) {
|
|
3332
|
+
const file = id.split("?", 1)[0];
|
|
3333
|
+
this.addWatchFile(file);
|
|
3334
|
+
const source = await fs2.promises.readFile(file, "utf8");
|
|
3335
|
+
return _nullishCoalesce(_chunkPIUTGRDIcjs.createFarmServerFnBoundaryModule.call(void 0, source, file), () => ( "export {};\n"));
|
|
3336
|
+
}
|
|
3282
3337
|
if (typeof fontImports.load === "function") {
|
|
3283
3338
|
const fontModule = await fontImports.load.call(this, id);
|
|
3284
3339
|
if (fontModule) return fontModule;
|
|
@@ -3288,8 +3343,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3288
3343
|
if (imageModule) return imageModule;
|
|
3289
3344
|
}
|
|
3290
3345
|
if (_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
|
|
3291
|
-
const renderer = _optionalChain([farmApp, 'optionalAccess',
|
|
3292
|
-
const root = _optionalChain([server, 'optionalAccess',
|
|
3346
|
+
const renderer = _optionalChain([farmApp, 'optionalAccess', _259 => _259.getConfig, 'call', _260 => _260(), 'access', _261 => _261.renderer]) || _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
3347
|
+
const root = _optionalChain([server, 'optionalAccess', _262 => _262.config, 'access', _263 => _263.root]) || options.root;
|
|
3293
3348
|
if (isClientEnvironment(this, loadOptions)) {
|
|
3294
3349
|
return generateProgrammaticClientRouteModuleForId(
|
|
3295
3350
|
id,
|
|
@@ -3302,65 +3357,65 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3302
3357
|
return generateProgrammaticRouteModule(id, root, renderer);
|
|
3303
3358
|
}
|
|
3304
3359
|
if (isFarmClientVirtualId(id)) {
|
|
3305
|
-
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
3306
|
-
const renderer = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
3307
|
-
const integrations = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
3308
|
-
const root = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
3309
|
-
const docs = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
3360
|
+
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _264 => _264.getConfig, 'call', _265 => _265()]);
|
|
3361
|
+
const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _266 => _266.renderer]) || _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
3362
|
+
const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _267 => _267.integrations]) || options.integrations;
|
|
3363
|
+
const root = _optionalChain([resolvedConfig, 'optionalAccess', _268 => _268.root]) || _optionalChain([server, 'optionalAccess', _269 => _269.config, 'access', _270 => _270.root]) || process.cwd();
|
|
3364
|
+
const docs = _optionalChain([resolvedConfig, 'optionalAccess', _271 => _271.docs]);
|
|
3310
3365
|
const adapterOwnsDocsRuntime = Boolean(
|
|
3311
|
-
_chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess',
|
|
3366
|
+
_chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _272 => _272.adapter, 'optionalAccess', _273 => _273.server]) && docs.adapter.react
|
|
3312
3367
|
);
|
|
3313
|
-
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3368
|
+
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _274 => _274.devtools]), () => ( _chunkSTF6VDYQcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
|
|
3314
3369
|
const [docsRuntime, docsSearchRuntime, devtoolsClientRuntime] = await Promise.all([
|
|
3315
|
-
_optionalChain([docs, 'optionalAccess',
|
|
3316
|
-
_optionalChain([docs, 'optionalAccess',
|
|
3370
|
+
_optionalChain([docs, 'optionalAccess', _275 => _275.enabled]) ? loadFarmDocsDevRuntime() : null,
|
|
3371
|
+
_optionalChain([docs, 'optionalAccess', _276 => _276.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
|
|
3317
3372
|
devtools.enabled ? loadFarmDevtoolsClientRuntime() : null
|
|
3318
3373
|
]);
|
|
3319
|
-
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess',
|
|
3374
|
+
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _277 => _277.isFarmDocsSearchEnabled, 'call', _278 => _278(docs)]), () => ( false));
|
|
3320
3375
|
const generatedDocsSearchRuntime = docsSearchRuntime ? docsSearchRuntime.generateFarmDocsSearchClientRuntime(
|
|
3321
3376
|
docsSearchEnabled,
|
|
3322
3377
|
docsSearchEnabled ? docsSearchRuntime.resolveFarmDocsSearchClientModule(root) : void 0
|
|
3323
3378
|
) : EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME;
|
|
3324
3379
|
const generatedDevtoolsClientRuntime = devtoolsClientRuntime ? devtoolsClientRuntime.generateFarmDevtoolsClientRuntime(devtools) : "";
|
|
3325
3380
|
const generatedDevIndicatorsClientRuntime = farmApp ? _chunkBPNOYILCcjs.generateFarmDevIndicatorsClientRuntime.call(void 0, farmApp.getConfig().devIndicators) : "";
|
|
3326
|
-
const integrationProviders = _chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) ?
|
|
3327
|
-
const isolatedHydrationMode =
|
|
3328
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3381
|
+
const integrationProviders = _chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) ? _chunkCECUDGXQcjs.getIntegrationProviders.call(void 0, integrations) : [];
|
|
3382
|
+
const isolatedHydrationMode = _chunkX2M4XN4Vcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
3383
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _279 => _279.experimental, 'optionalAccess', _280 => _280.isolatedClientHydration]),
|
|
3329
3384
|
{
|
|
3330
|
-
serverComponents: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess',
|
|
3385
|
+
serverComponents: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _281 => _281.experimental, 'optionalAccess', _282 => _282.serverComponents])) === "rsc",
|
|
3331
3386
|
hasUnsupportedIntegrationProvider: integrationProviders.filter((provider) => provider.component || provider.type === "clerk").some((provider) => provider.supportsIsolatedHydration !== true)
|
|
3332
3387
|
}
|
|
3333
3388
|
);
|
|
3334
3389
|
return generateClientCode(
|
|
3335
3390
|
integrationProviders,
|
|
3336
3391
|
[
|
|
3337
|
-
...
|
|
3338
|
-
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess',
|
|
3392
|
+
..._chunkCECUDGXQcjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
|
|
3393
|
+
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _283 => _283.getFarmDocsDocumentNavigationMatchers, 'call', _284 => _284(docs)]), () => ( []))
|
|
3339
3394
|
],
|
|
3340
3395
|
generatedDocsSearchRuntime,
|
|
3341
3396
|
`${generatedDevtoolsClientRuntime}
|
|
3342
3397
|
${generatedDevIndicatorsClientRuntime}`,
|
|
3343
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3398
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _285 => _285.plugins]) || [],
|
|
3344
3399
|
root,
|
|
3345
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3346
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3347
|
-
_chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess',
|
|
3400
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _286 => _286.srcDir]) || options.srcDir || "src",
|
|
3401
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _287 => _287.publicRuntimeConfig]) || options.publicRuntimeConfig,
|
|
3402
|
+
_chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _288 => _288.adapter, 'optionalAccess', _289 => _289.react]) : void 0,
|
|
3348
3403
|
renderer,
|
|
3349
|
-
isolatedHydrationMode === "enabled" || _chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
3350
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3351
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3352
|
-
|
|
3353
|
-
|
|
3404
|
+
isolatedHydrationMode === "enabled" || _chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _290 => _290.getRouteManager, 'call', _291 => _291(), 'access', _292 => _292.getIsolatedClientBoundaryModules, 'call', _293 => _293(root)])))), 'optionalAccess', _294 => _294.size]) > 0,
|
|
3405
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _295 => _295.trailingSlash]), () => ( false)),
|
|
3406
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _296 => _296.basePath]), () => ( "/")),
|
|
3407
|
+
_chunkX2M4XN4Vcjs.generateClientCachePersistenceCode.call(void 0,
|
|
3408
|
+
_chunkX2M4XN4Vcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, _optionalChain([resolvedConfig, 'optionalAccess', _297 => _297.cache]))
|
|
3354
3409
|
),
|
|
3355
3410
|
_chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0,
|
|
3356
|
-
_chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess',
|
|
3411
|
+
_chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _298 => _298.experimental, 'optionalAccess', _299 => _299.serverComponents])) === "islands"
|
|
3357
3412
|
);
|
|
3358
3413
|
}
|
|
3359
3414
|
if (id === "/@farm/server") {
|
|
3360
3415
|
return generateServerCode();
|
|
3361
3416
|
}
|
|
3362
3417
|
if (id === "/@farm/manifest") {
|
|
3363
|
-
const routeManager = _optionalChain([farmApp, 'optionalAccess',
|
|
3418
|
+
const routeManager = _optionalChain([farmApp, 'optionalAccess', _300 => _300.getRouteManager, 'call', _301 => _301()]);
|
|
3364
3419
|
if (!routeManager) {
|
|
3365
3420
|
return `
|
|
3366
3421
|
export const getManifest = () => ({
|
|
@@ -3373,9 +3428,9 @@ export const getManifest = () => ({
|
|
|
3373
3428
|
`;
|
|
3374
3429
|
}
|
|
3375
3430
|
const manifest = routeManager.generateClientManifest(server.config.root);
|
|
3376
|
-
const globalStylesheetHref =
|
|
3431
|
+
const globalStylesheetHref = _chunkX2M4XN4Vcjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
3377
3432
|
server.config.root,
|
|
3378
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
3433
|
+
_optionalChain([farmApp, 'optionalAccess', _302 => _302.getConfig, 'call', _303 => _303(), 'access', _304 => _304.srcDir])
|
|
3379
3434
|
);
|
|
3380
3435
|
const fullManifest = {
|
|
3381
3436
|
clientEntry: "/@farm/client.js",
|
|
@@ -3401,11 +3456,11 @@ export const getManifest = () => ({
|
|
|
3401
3456
|
};
|
|
3402
3457
|
}
|
|
3403
3458
|
for (const layout of manifest.layouts) {
|
|
3404
|
-
const groupScope =
|
|
3459
|
+
const groupScope = _chunk76GHW3WIcjs.getRouteGroupScope.call(void 0, layout.pattern);
|
|
3405
3460
|
fullManifest.layouts[layout.pattern] = {
|
|
3406
3461
|
modulePath: layout.modulePath,
|
|
3407
3462
|
pattern: layout.pattern,
|
|
3408
|
-
...groupScope ? { urlPattern:
|
|
3463
|
+
...groupScope ? { urlPattern: _chunk76GHW3WIcjs.stripRouteGroups.call(void 0, layout.pattern), groupScope } : {},
|
|
3409
3464
|
shouldHydrate: layout.shouldHydrate,
|
|
3410
3465
|
islandStrategy: layout.islandStrategy,
|
|
3411
3466
|
// Islands mode: rebuilt from its server tree, so its module is never preloaded.
|
|
@@ -3431,37 +3486,46 @@ export const manifest = getManifest();
|
|
|
3431
3486
|
}
|
|
3432
3487
|
},
|
|
3433
3488
|
async transform(code, id, transformOptions) {
|
|
3434
|
-
const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3435
|
-
if (
|
|
3489
|
+
const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _305 => _305.getConfig, 'call', _306 => _306()]), () => ( options));
|
|
3490
|
+
if (islandsServerFns() && !_chunkPIUTGRDIcjs.isFarmServerFnBoundaryId.call(void 0, id) && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
|
|
3491
|
+
const serverFns = _chunkPIUTGRDIcjs.transformFarmServerFns.call(void 0, code, id, {
|
|
3492
|
+
environment: _optionalChain([transformOptions, 'optionalAccess', _307 => _307.ssr]) === true ? "rsc" : "client"
|
|
3493
|
+
});
|
|
3494
|
+
if (serverFns) {
|
|
3495
|
+
if (!serverFns.code.includes("use server")) return { code: serverFns.code, map: null };
|
|
3496
|
+
code = serverFns.code;
|
|
3497
|
+
}
|
|
3498
|
+
}
|
|
3499
|
+
if (_chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access', _308 => _308.experimental, 'optionalAccess', _309 => _309.serverComponents])) === "islands" && code.includes("use server") && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
|
|
3436
3500
|
const file = id.split("?", 1)[0];
|
|
3437
3501
|
const actionModule = transformFarmFormActionModule({
|
|
3438
3502
|
code,
|
|
3439
3503
|
id,
|
|
3440
|
-
root: actionConfig.root || _optionalChain([server, 'optionalAccess',
|
|
3441
|
-
ssr: _optionalChain([transformOptions, 'optionalAccess',
|
|
3504
|
+
root: actionConfig.root || _optionalChain([server, 'optionalAccess', _310 => _310.config, 'access', _311 => _311.root]) || process.cwd(),
|
|
3505
|
+
ssr: _optionalChain([transformOptions, 'optionalAccess', _312 => _312.ssr]) === true,
|
|
3442
3506
|
// Parsed by file type: page components are TSX.
|
|
3443
3507
|
parse: (source) => _vite.parseSync.call(void 0, file, source).program
|
|
3444
3508
|
});
|
|
3445
3509
|
if (actionModule) return { code: actionModule, map: null };
|
|
3446
3510
|
}
|
|
3447
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
3448
|
-
const docsConfigModule = _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess',
|
|
3449
|
-
if (
|
|
3450
|
-
const redacted =
|
|
3511
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _313 => _313.ssr])) {
|
|
3512
|
+
const docsConfigModule = _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess', _314 => _314.getConfig, 'call', _315 => _315(), 'optionalAccess', _316 => _316.docs]));
|
|
3513
|
+
if (_chunkX2M4XN4Vcjs.isFarmDocsClientConfigModule.call(void 0, id, docsConfigModule)) {
|
|
3514
|
+
const redacted = _chunkX2M4XN4Vcjs.redactFarmDocsClientConfig.call(void 0, code, id.split("?")[0]);
|
|
3451
3515
|
if (redacted !== null) return { code: redacted, map: null };
|
|
3452
3516
|
}
|
|
3453
3517
|
}
|
|
3454
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
3455
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3456
|
-
if (_optionalChain([currentConfig, 'access',
|
|
3518
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _317 => _317.ssr])) {
|
|
3519
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _318 => _318.getConfig, 'call', _319 => _319()]), () => ( options));
|
|
3520
|
+
if ((_optionalChain([currentConfig, 'access', _320 => _320.experimental, 'optionalAccess', _321 => _321.serverActions]) !== true || !serverFnTransformActive) && !islandsServerFns()) {
|
|
3457
3521
|
const violation = findClientServerFnViolation(code, id);
|
|
3458
3522
|
if (violation) {
|
|
3459
3523
|
this.error(formatServerFnBoundaryError(violation, id));
|
|
3460
3524
|
}
|
|
3461
3525
|
}
|
|
3462
3526
|
}
|
|
3463
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
3464
|
-
warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3527
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _322 => _322.ssr]) && shouldInspectClientBoundary(id, code)) {
|
|
3528
|
+
warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _323 => _323.getConfig, 'call', _324 => _324()]), () => ( options)));
|
|
3465
3529
|
}
|
|
3466
3530
|
if (typeof imageImports.transform === "function") {
|
|
3467
3531
|
const imageModule = await imageImports.transform.call(this, code, id, transformOptions);
|
|
@@ -3476,13 +3540,13 @@ export const manifest = getManifest();
|
|
|
3476
3540
|
id,
|
|
3477
3541
|
transformOptions
|
|
3478
3542
|
);
|
|
3479
|
-
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess',
|
|
3543
|
+
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _325 => _325.code, 'optionalAccess', _326 => _326.toString, 'call', _327 => _327()]);
|
|
3480
3544
|
if (fontCode) {
|
|
3481
3545
|
transformedCode = fontCode;
|
|
3482
3546
|
transformed = true;
|
|
3483
3547
|
}
|
|
3484
3548
|
}
|
|
3485
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
3549
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _328 => _328.ssr]) && server) {
|
|
3486
3550
|
const rewrittenImports = rewriteEarlySsrRelativeImports({
|
|
3487
3551
|
code: transformedCode,
|
|
3488
3552
|
id,
|
|
@@ -3494,28 +3558,28 @@ export const manifest = getManifest();
|
|
|
3494
3558
|
transformed = true;
|
|
3495
3559
|
}
|
|
3496
3560
|
}
|
|
3497
|
-
if (
|
|
3561
|
+
if (_chunkX2M4XN4Vcjs.hasUseClientDirective.call(void 0, transformedCode)) {
|
|
3498
3562
|
const clientBoundarySource = transformedCode;
|
|
3499
3563
|
const moduleInfo = this.getModuleInfo(id);
|
|
3500
3564
|
if (moduleInfo) {
|
|
3501
3565
|
moduleInfo.isClientComponent = true;
|
|
3502
3566
|
}
|
|
3503
|
-
transformedCode =
|
|
3567
|
+
transformedCode = _chunkX2M4XN4Vcjs.stripUseClientDirective.call(void 0, transformedCode);
|
|
3504
3568
|
transformed = true;
|
|
3505
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3569
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _329 => _329.getConfig, 'call', _330 => _330()]), () => ( options));
|
|
3506
3570
|
let isolatedModuleReference = null;
|
|
3507
|
-
const root = currentConfig.root || _optionalChain([server, 'optionalAccess',
|
|
3571
|
+
const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _331 => _331.config, 'access', _332 => _332.root]) || process.cwd();
|
|
3508
3572
|
const cleanId = id.split("?", 1)[0];
|
|
3509
|
-
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
3510
|
-
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess',
|
|
3511
|
-
if (_chunkRD623KW4cjs.isReactRenderer.call(void 0, _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration &&
|
|
3512
|
-
isolatedModuleReference =
|
|
3573
|
+
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _333 => _333.getRouteManager, 'call', _334 => _334(), 'access', _335 => _335.getIsolatedClientBoundaryModules, 'call', _336 => _336(root)])));
|
|
3574
|
+
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _337 => _337.has, 'call', _338 => _338(path5.resolve(cleanId))]) === true;
|
|
3575
|
+
if (_chunkRD623KW4cjs.isReactRenderer.call(void 0, _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && _chunkX2M4XN4Vcjs.isIsolatableClientBoundarySource.call(void 0, clientBoundarySource)) {
|
|
3576
|
+
isolatedModuleReference = _chunkVQJYGZNXcjs.toViteModuleId.call(void 0, cleanId, root);
|
|
3513
3577
|
const transformedBoundary = transformIsolatedClientBoundaryModule({
|
|
3514
3578
|
code: transformedCode,
|
|
3515
3579
|
moduleReference: isolatedModuleReference,
|
|
3516
|
-
islandStrategy: _nullishCoalesce(
|
|
3580
|
+
islandStrategy: _nullishCoalesce(_chunkX2M4XN4Vcjs.getIslandStrategyExport.call(void 0, clientBoundarySource), () => ( "load")),
|
|
3517
3581
|
parse: (source) => this.parse(source),
|
|
3518
|
-
slots: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([currentConfig, 'access',
|
|
3582
|
+
slots: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([currentConfig, 'access', _339 => _339.experimental, 'optionalAccess', _340 => _340.serverComponents])) === "islands"
|
|
3519
3583
|
});
|
|
3520
3584
|
if (!transformedBoundary) {
|
|
3521
3585
|
this.error(
|
|
@@ -3545,7 +3609,7 @@ export const manifest = getManifest();
|
|
|
3545
3609
|
);
|
|
3546
3610
|
return;
|
|
3547
3611
|
}` : "";
|
|
3548
|
-
const hmrCode = _optionalChain([transformOptions, 'optionalAccess',
|
|
3612
|
+
const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _341 => _341.ssr]) || reactRefreshActive || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
|
|
3549
3613
|
if (import.meta.hot) {
|
|
3550
3614
|
import.meta.hot.accept((newModule) => {
|
|
3551
3615
|
${isolatedHmrUpdate}
|
|
@@ -3595,19 +3659,19 @@ if (import.meta.hot) {
|
|
|
3595
3659
|
if (!routeManager) return;
|
|
3596
3660
|
const { ssg: ssgPages, ssr: ssrRoutes } = await routeManager.collectSSGPages();
|
|
3597
3661
|
if (ssgPages.length === 0) {
|
|
3598
|
-
|
|
3662
|
+
_chunkVQJYGZNXcjs.logger.info("No SSG pages found - all pages will use SSR");
|
|
3599
3663
|
return;
|
|
3600
3664
|
}
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
const outDir = path5.join(_optionalChain([server, 'optionalAccess',
|
|
3665
|
+
_chunkVQJYGZNXcjs.logger.info(`Found ${ssgPages.length} SSG pages, ${ssrRoutes.length} SSR routes`);
|
|
3666
|
+
_chunkVQJYGZNXcjs.logger.info("Pre-rendering SSG pages...");
|
|
3667
|
+
const outDir = path5.join(_optionalChain([server, 'optionalAccess', _342 => _342.config, 'access', _343 => _343.root]) || process.cwd(), options.outDir || "dist");
|
|
3604
3668
|
const clientDir = path5.join(outDir, "client");
|
|
3605
3669
|
for (const page of ssgPages) {
|
|
3606
3670
|
try {
|
|
3607
3671
|
const staticRequest = new Request(new URL(page.urlPath, "http://farm.static"));
|
|
3608
3672
|
await farmApp.getServerRenderer().runWithRequestContext(staticRequest, async () => {
|
|
3609
3673
|
const mod = await routeManager.loadRouteModule(page.filePath);
|
|
3610
|
-
if (!_optionalChain([mod, 'optionalAccess',
|
|
3674
|
+
if (!_optionalChain([mod, 'optionalAccess', _344 => _344.default])) return;
|
|
3611
3675
|
const { layouts } = routeManager.matchRoute(page.urlPath);
|
|
3612
3676
|
const layoutModules = await Promise.all(
|
|
3613
3677
|
layouts.map((l) => routeManager.loadLayoutModule(l.modulePath))
|
|
@@ -3617,7 +3681,7 @@ if (import.meta.hot) {
|
|
|
3617
3681
|
const PageComponent = mod.default;
|
|
3618
3682
|
const pageProps = {
|
|
3619
3683
|
params: page.params,
|
|
3620
|
-
searchParams:
|
|
3684
|
+
searchParams: _chunkSUCDVKUBcjs.createFarmSearchParams.call(void 0, {}),
|
|
3621
3685
|
path: page.urlPath
|
|
3622
3686
|
};
|
|
3623
3687
|
let pageElement = React.createElement(
|
|
@@ -3639,7 +3703,7 @@ if (import.meta.hot) {
|
|
|
3639
3703
|
const i18nSnapshot = _chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
3640
3704
|
const i18nHead = renderFarmI18nStaticHead(page.urlPath, i18nSnapshot);
|
|
3641
3705
|
const fullHtml = `<!DOCTYPE html>
|
|
3642
|
-
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
3706
|
+
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _345 => _345.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
|
|
3643
3707
|
<head>
|
|
3644
3708
|
<meta charset="utf-8">
|
|
3645
3709
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
@@ -3657,10 +3721,10 @@ if (import.meta.hot) {
|
|
|
3657
3721
|
fs2.mkdirSync(path5.dirname(outputPath), { recursive: true });
|
|
3658
3722
|
fs2.writeFileSync(outputPath, fullHtml);
|
|
3659
3723
|
const revalidateInfo = page.revalidate ? ` (revalidate: ${page.revalidate}s)` : "";
|
|
3660
|
-
|
|
3724
|
+
_chunkVQJYGZNXcjs.logger.success(` \u2713 ${page.urlPath}${revalidateInfo}`);
|
|
3661
3725
|
});
|
|
3662
3726
|
} catch (error) {
|
|
3663
|
-
|
|
3727
|
+
_chunkVQJYGZNXcjs.logger.error(` \u2717 ${page.urlPath}: ${error}`);
|
|
3664
3728
|
}
|
|
3665
3729
|
}
|
|
3666
3730
|
const manifestPath = path5.join(outDir, "__ssg_manifest.json");
|
|
@@ -3676,9 +3740,9 @@ if (import.meta.hot) {
|
|
|
3676
3740
|
2
|
|
3677
3741
|
)
|
|
3678
3742
|
);
|
|
3679
|
-
|
|
3743
|
+
_chunkVQJYGZNXcjs.logger.success(`SSG complete: ${ssgPages.length} pages pre-rendered`);
|
|
3680
3744
|
} catch (error) {
|
|
3681
|
-
|
|
3745
|
+
_chunkVQJYGZNXcjs.logger.error(`SSG build failed: ${error}`);
|
|
3682
3746
|
}
|
|
3683
3747
|
},
|
|
3684
3748
|
async handleHotUpdate(ctx) {
|
|
@@ -3697,13 +3761,13 @@ if (import.meta.hot) {
|
|
|
3697
3761
|
});
|
|
3698
3762
|
}
|
|
3699
3763
|
}
|
|
3700
|
-
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
3764
|
+
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _346 => _346.getConfig, 'call', _347 => _347()]);
|
|
3701
3765
|
const normalizedFile = file.replace(/\\/g, "/");
|
|
3702
3766
|
if (currentFarmConfig && /\/route\.(?:ts|tsx|js|jsx)$/.test(normalizedFile) && _chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, currentFarmConfig).some(
|
|
3703
|
-
(appDir) => normalizedFile.startsWith(`${
|
|
3767
|
+
(appDir) => normalizedFile.startsWith(`${_chunkVQJYGZNXcjs.toPosixPath.call(void 0, appDir)}/api/`)
|
|
3704
3768
|
)) {
|
|
3705
3769
|
for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
|
|
3706
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
3770
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _348 => _348(`updated ${file}`)]);
|
|
3707
3771
|
server2.ws.send({ type: "full-reload", path: "*" });
|
|
3708
3772
|
return [];
|
|
3709
3773
|
}
|
|
@@ -3713,7 +3777,7 @@ if (import.meta.hot) {
|
|
|
3713
3777
|
for (const mod of modules) {
|
|
3714
3778
|
server2.moduleGraph.invalidateModule(mod);
|
|
3715
3779
|
}
|
|
3716
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
3780
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _349 => _349(`updated ${file}`)]);
|
|
3717
3781
|
server2.ws.send({
|
|
3718
3782
|
type: "full-reload",
|
|
3719
3783
|
path: "*"
|
|
@@ -3726,7 +3790,7 @@ if (import.meta.hot) {
|
|
|
3726
3790
|
for (const mod of modules) {
|
|
3727
3791
|
server2.moduleGraph.invalidateModule(mod);
|
|
3728
3792
|
}
|
|
3729
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
3793
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _350 => _350(`updated ${file}`)]);
|
|
3730
3794
|
server2.ws.send({
|
|
3731
3795
|
type: "full-reload",
|
|
3732
3796
|
path: "*"
|
|
@@ -3734,12 +3798,12 @@ if (import.meta.hot) {
|
|
|
3734
3798
|
return [];
|
|
3735
3799
|
}
|
|
3736
3800
|
if (apiRouteManager && _chunkJYNNIGQOcjs.invalidateFarmDevDependents.call(void 0, server2, file, apiRouteManager.getSourceFiles()).length > 0) {
|
|
3737
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
3801
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _351 => _351(`updated ${file}`)]);
|
|
3738
3802
|
}
|
|
3739
|
-
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
3740
|
-
const planRouteManager = _optionalChain([farmApp, 'optionalAccess',
|
|
3803
|
+
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _352 => _352.experimental, 'optionalAccess', _353 => _353.isolatedClientHydration]);
|
|
3804
|
+
const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _354 => _354.getRouteManager, 'call', _355 => _355()]);
|
|
3741
3805
|
const isHydrationPlanSource = currentSrcRoot !== null && normalizedFile.startsWith(`${currentSrcRoot}/`) && /\.[cm]?[jt]sx?$/.test(normalizedFile);
|
|
3742
|
-
const tracksAsyncOwnerIslands = _chunkRD623KW4cjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
3806
|
+
const tracksAsyncOwnerIslands = _chunkRD623KW4cjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _356 => _356.renderer])) && planRouteManager !== void 0;
|
|
3743
3807
|
if (isHydrationPlanSource && (isolatedHydrationMode === "enabled" || isolatedHydrationMode === "analyze" || tracksAsyncOwnerIslands)) {
|
|
3744
3808
|
const routeManager = planRouteManager;
|
|
3745
3809
|
if (routeManager) {
|
|
@@ -3763,7 +3827,7 @@ if (import.meta.hot) {
|
|
|
3763
3827
|
for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
|
|
3764
3828
|
for (const boundary of /* @__PURE__ */ new Set([...previousBoundaries, ...nextBoundaries])) {
|
|
3765
3829
|
if (previousBoundaries.has(boundary) === nextBoundaries.has(boundary)) continue;
|
|
3766
|
-
for (const mod of _nullishCoalesce(server2.moduleGraph.getModulesByFile(
|
|
3830
|
+
for (const mod of _nullishCoalesce(server2.moduleGraph.getModulesByFile(_chunkVQJYGZNXcjs.toPosixPath.call(void 0, boundary)), () => ( []))) {
|
|
3767
3831
|
server2.moduleGraph.invalidateModule(mod);
|
|
3768
3832
|
}
|
|
3769
3833
|
}
|
|
@@ -3775,7 +3839,7 @@ if (import.meta.hot) {
|
|
|
3775
3839
|
return [];
|
|
3776
3840
|
}
|
|
3777
3841
|
} catch (error) {
|
|
3778
|
-
|
|
3842
|
+
_chunkVQJYGZNXcjs.logger.warn(
|
|
3779
3843
|
`[Farm.js] Could not refresh the client hydration plan after ${file}: ${error instanceof Error ? error.message : String(error)}`
|
|
3780
3844
|
);
|
|
3781
3845
|
return modules;
|
|
@@ -3786,7 +3850,7 @@ if (import.meta.hot) {
|
|
|
3786
3850
|
if (normalizedFile.includes("middleware.")) {
|
|
3787
3851
|
if (middlewareManager) {
|
|
3788
3852
|
await middlewareManager.reload();
|
|
3789
|
-
|
|
3853
|
+
_chunkVQJYGZNXcjs.logger.success("\u2705 Middleware reloaded!");
|
|
3790
3854
|
if (initialPluginManager) {
|
|
3791
3855
|
for (const middleware of middlewareManager.getMiddlewares()) {
|
|
3792
3856
|
await initialPluginManager.runHookParallel("middlewareDiscovered", {
|
|
@@ -3799,7 +3863,7 @@ if (import.meta.hot) {
|
|
|
3799
3863
|
}
|
|
3800
3864
|
return [];
|
|
3801
3865
|
}
|
|
3802
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
3866
|
+
_optionalChain([farmApp, 'optionalAccess', _357 => _357.getRouteManager, 'call', _358 => _358(), 'access', _359 => _359.invalidateClientManifest, 'call', _360 => _360()]);
|
|
3803
3867
|
const manifestModule = server2.moduleGraph.getModuleById("/@farm/manifest");
|
|
3804
3868
|
if (manifestModule) {
|
|
3805
3869
|
server2.moduleGraph.invalidateModule(manifestModule);
|
|
@@ -3855,12 +3919,12 @@ function isFarmClientVirtualId(id) {
|
|
|
3855
3919
|
}
|
|
3856
3920
|
function isClientEnvironment(context, loadOptions) {
|
|
3857
3921
|
const environment = context.environment;
|
|
3858
|
-
if (_optionalChain([environment, 'optionalAccess',
|
|
3859
|
-
if (_optionalChain([environment, 'optionalAccess',
|
|
3860
|
-
return _optionalChain([loadOptions, 'optionalAccess',
|
|
3922
|
+
if (_optionalChain([environment, 'optionalAccess', _361 => _361.config, 'optionalAccess', _362 => _362.consumer])) return environment.config.consumer === "client";
|
|
3923
|
+
if (_optionalChain([environment, 'optionalAccess', _363 => _363.name])) return environment.name === "client";
|
|
3924
|
+
return _optionalChain([loadOptions, 'optionalAccess', _364 => _364.ssr]) !== true;
|
|
3861
3925
|
}
|
|
3862
3926
|
function invalidateProgrammaticClientRouteModules(server) {
|
|
3863
|
-
const graph = _optionalChain([server, 'access',
|
|
3927
|
+
const graph = _optionalChain([server, 'access', _365 => _365.environments, 'optionalAccess', _366 => _366.client, 'optionalAccess', _367 => _367.moduleGraph]);
|
|
3864
3928
|
if (!graph) return;
|
|
3865
3929
|
for (const [id, module] of graph.idToModuleMap) {
|
|
3866
3930
|
if (_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id)) graph.invalidateModule(module);
|
|
@@ -3870,23 +3934,23 @@ function generateProgrammaticClientRouteModuleForId(moduleId, root, renderer, cl
|
|
|
3870
3934
|
const parsed = _chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, moduleId);
|
|
3871
3935
|
const routesFile = resolveRealModuleFile(parsed.filePath, root);
|
|
3872
3936
|
watchFile(routesFile);
|
|
3873
|
-
return
|
|
3937
|
+
return _chunkNK2VWS7Pcjs.generateProgrammaticClientRouteModule.call(void 0, {
|
|
3874
3938
|
kind: parsed.kind,
|
|
3875
3939
|
routePath: parsed.routePath,
|
|
3876
3940
|
routesFile,
|
|
3877
|
-
route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess',
|
|
3878
|
-
|
|
3941
|
+
route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess', _368 => _368.routes, 'access', _369 => _369.get, 'call', _370 => _370(
|
|
3942
|
+
_chunkNK2VWS7Pcjs.programmaticClientRouteKey.call(void 0, routesFile, parsed.kind, parsed.routePath)
|
|
3879
3943
|
)]),
|
|
3880
3944
|
rendererServer: renderer.server,
|
|
3881
3945
|
toImportSpecifier: (file) => toProgrammaticRouteImportSpecifier(file, root)
|
|
3882
3946
|
});
|
|
3883
3947
|
}
|
|
3884
3948
|
function resolveRealModuleFile(filePath, root) {
|
|
3885
|
-
const resolved = _nullishCoalesce(
|
|
3949
|
+
const resolved = _nullishCoalesce(_chunkX2M4XN4Vcjs.resolveModuleSourcePath.call(void 0, filePath, root), () => ( filePath));
|
|
3886
3950
|
try {
|
|
3887
|
-
return
|
|
3951
|
+
return _chunkVQJYGZNXcjs.toPosixPath.call(void 0, fs2.realpathSync(resolved));
|
|
3888
3952
|
} catch (e15) {
|
|
3889
|
-
return
|
|
3953
|
+
return _chunkVQJYGZNXcjs.toPosixPath.call(void 0, resolved);
|
|
3890
3954
|
}
|
|
3891
3955
|
}
|
|
3892
3956
|
function generateProgrammaticRouteModule(moduleId, root, renderer = _chunkRD623KW4cjs.REACT_RENDERER) {
|
|
@@ -4182,7 +4246,7 @@ export const OPTIONS = __farmRoute.methods.OPTIONS;
|
|
|
4182
4246
|
`.trim();
|
|
4183
4247
|
}
|
|
4184
4248
|
function toProgrammaticRouteImportSpecifier(filePath, root) {
|
|
4185
|
-
return root ?
|
|
4249
|
+
return root ? _chunkVQJYGZNXcjs.toViteModuleId.call(void 0, filePath, root) : filePath;
|
|
4186
4250
|
}
|
|
4187
4251
|
async function parseRouteModuleProps(routeModule, input) {
|
|
4188
4252
|
if (typeof routeModule.__farmResolveRouteProps === "function") {
|
|
@@ -4196,17 +4260,17 @@ async function parseRouteModuleProps(routeModule, input) {
|
|
|
4196
4260
|
}
|
|
4197
4261
|
const schemas = routeModule.__farmRouteSchemas;
|
|
4198
4262
|
const params = parseRouteModuleSchema(
|
|
4199
|
-
_optionalChain([schemas, 'optionalAccess',
|
|
4263
|
+
_optionalChain([schemas, 'optionalAccess', _371 => _371.params]),
|
|
4200
4264
|
input.props.params,
|
|
4201
4265
|
"params",
|
|
4202
4266
|
input.routePath
|
|
4203
4267
|
);
|
|
4204
|
-
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess',
|
|
4268
|
+
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _372 => _372.search]), input.search, "search", input.routePath);
|
|
4205
4269
|
return {
|
|
4206
4270
|
...input.props,
|
|
4207
4271
|
params,
|
|
4208
4272
|
search,
|
|
4209
|
-
searchParams:
|
|
4273
|
+
searchParams: _chunkSUCDVKUBcjs.createFarmSearchParams.call(void 0, search)
|
|
4210
4274
|
};
|
|
4211
4275
|
}
|
|
4212
4276
|
function parseRouteModuleSchema(schema, value, label, routePath) {
|
|
@@ -4221,12 +4285,12 @@ function parseRouteModuleSchema(schema, value, label, routePath) {
|
|
|
4221
4285
|
}
|
|
4222
4286
|
}
|
|
4223
4287
|
function generateClientCode(integrationProviders = [], documentNavigationMatchers = [], docsSearchClientRuntime = EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME, devtoolsClientRuntime = "", plugins = [], root = process.cwd(), srcDir = "src", publicRuntimeConfig = void 0, docsAdapterReact, renderer = _chunkRD623KW4cjs.REACT_RENDERER, isolatedHydrationEnabled = false, trailingSlash = false, basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false) {
|
|
4224
|
-
const providerClientCode =
|
|
4288
|
+
const providerClientCode = _chunkX2M4XN4Vcjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
4225
4289
|
integrationProviders,
|
|
4226
4290
|
root,
|
|
4227
4291
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
4228
4292
|
);
|
|
4229
|
-
const clientPluginEntry =
|
|
4293
|
+
const clientPluginEntry = _chunkX2M4XN4Vcjs.generateFarmClientPluginEntryCode.call(void 0,
|
|
4230
4294
|
plugins,
|
|
4231
4295
|
root,
|
|
4232
4296
|
srcDir,
|
|
@@ -4235,7 +4299,7 @@ function generateClientCode(integrationProviders = [], documentNavigationMatcher
|
|
|
4235
4299
|
const appSetupPath = _chunkRD623KW4cjs.resolveFarmRendererAppSetup.call(void 0, root, renderer);
|
|
4236
4300
|
const rendererClientImports = _chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) ? `import React from 'react'
|
|
4237
4301
|
import { hydrateRoot, createRoot } from 'react-dom/client'` : appSetupPath ? `import React, { hydrateRoot, createRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)}
|
|
4238
|
-
import __farmAppSetup from ${JSON.stringify(
|
|
4302
|
+
import __farmAppSetup from ${JSON.stringify(_chunkVQJYGZNXcjs.toViteModuleId.call(void 0, appSetupPath, root))}
|
|
4239
4303
|
__farmConfigureApp(__farmAppSetup)` : `import React, { hydrateRoot, createRoot } from ${JSON.stringify(renderer.client)}`;
|
|
4240
4304
|
const isolatedHydrationImport = isolatedHydrationEnabled ? `${islandValues ? "import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph, createFarmServerTreeElement, createFarmServerTreeLayout } from '@farm.js/core/internal/islands-runtime'" : "import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph } from '@farm.js/core/internal/isolated-boundary'\nimport { createFarmServerTreeElement } from '@farm.js/core/internal/server-tree'"}` : "";
|
|
4241
4305
|
const docsAdapterImportBlock = _chunkSM2SYWARcjs.generateFarmDocsAdapterClientRuntime.call(void 0,
|
|
@@ -4274,7 +4338,7 @@ async function createFarmServerTreePageElement(source, pathname) {
|
|
|
4274
4338
|
return null;
|
|
4275
4339
|
}
|
|
4276
4340
|
}
|
|
4277
|
-
${islandValues ? `${
|
|
4341
|
+
${islandValues ? `${_chunkX2M4XN4Vcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
|
|
4278
4342
|
let farmLastRouteState = null;
|
|
4279
4343
|
|
|
4280
4344
|
// A hot update to a layout tree's client module renders the route again.
|
|
@@ -4294,7 +4358,7 @@ ${isolatedHydrationImport}
|
|
|
4294
4358
|
import { installChunkErrorRecovery, SPARouter } from '@farm.js/core/client'
|
|
4295
4359
|
import { createClientPluginManager } from '@farm.js/core/plugin/client'
|
|
4296
4360
|
import { isFarmRouteActive } from '@farm.js/core/router'
|
|
4297
|
-
import { isFarmBlockedNavigationURL, replayFarmQueuedInteraction, scheduleFarmIslandHydration, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from '@farm.js/core/internal/client-runtime'
|
|
4361
|
+
import { isFarmBlockedNavigationURL, replayFarmQueuedInteraction, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from '@farm.js/core/internal/client-runtime'
|
|
4298
4362
|
import { reviveDeferredData } from '@farm.js/core/deferred'
|
|
4299
4363
|
import {
|
|
4300
4364
|
createFarmDeploymentMismatchError,
|
|
@@ -5083,7 +5147,7 @@ async function loadLayoutComponents(layouts = [], params = {}, source) {
|
|
|
5083
5147
|
return loadedLayouts;
|
|
5084
5148
|
}
|
|
5085
5149
|
|
|
5086
|
-
${
|
|
5150
|
+
${_chunkX2M4XN4Vcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
5087
5151
|
function wrapWithLoadedLayouts(element, loadedLayouts, params) {
|
|
5088
5152
|
let wrapped = element;
|
|
5089
5153
|
for (let index = loadedLayouts.length - 1; index >= 0; index--) {
|
|
@@ -5119,7 +5183,7 @@ async function buildRouteComponentProps(pageModule, params, searchParams, path,
|
|
|
5119
5183
|
window.__FARM_PROPS__ = revivedProps;
|
|
5120
5184
|
return {
|
|
5121
5185
|
...revivedProps,
|
|
5122
|
-
searchParams:
|
|
5186
|
+
searchParams: createFarmSearchParams(revivedProps.search ?? revivedProps.searchParams ?? {}),
|
|
5123
5187
|
path: revivedProps.path || path,
|
|
5124
5188
|
};
|
|
5125
5189
|
}
|
|
@@ -5128,7 +5192,7 @@ async function buildRouteComponentProps(pageModule, params, searchParams, path,
|
|
|
5128
5192
|
const rawProps = {
|
|
5129
5193
|
...(existingProps || {}),
|
|
5130
5194
|
params,
|
|
5131
|
-
searchParams:
|
|
5195
|
+
searchParams: createFarmSearchParams(searchParams),
|
|
5132
5196
|
path,
|
|
5133
5197
|
};
|
|
5134
5198
|
// Keep top-level route errors inside the router's navigation transaction.
|
|
@@ -5678,7 +5742,10 @@ function farmIslandsOnlyDocument() {
|
|
|
5678
5742
|
const rootContainer = document.getElementById('root')
|
|
5679
5743
|
|
|
5680
5744
|
if (!rootContainer) {
|
|
5681
|
-
|
|
5745
|
+
// A document Farm did not render as a page (the docs renderer's) has nothing to hydrate.
|
|
5746
|
+
if (window.__FARM_PAGE_MODULE__ !== undefined) {
|
|
5747
|
+
console.error('[Farm.js] Root container not found')
|
|
5748
|
+
}
|
|
5682
5749
|
return
|
|
5683
5750
|
}
|
|
5684
5751
|
|
|
@@ -5934,9 +6001,9 @@ function generateClientManifest(bundle) {
|
|
|
5934
6001
|
return manifest;
|
|
5935
6002
|
}
|
|
5936
6003
|
async function defineConfig(config = {}) {
|
|
5937
|
-
const tailwindVitePlugin = await
|
|
6004
|
+
const tailwindVitePlugin = await _chunkLNM57D3Hcjs.loadTailwindVitePlugin.call(void 0, );
|
|
5938
6005
|
const appRoot = path5.resolve(config.root || process.cwd());
|
|
5939
|
-
if (_optionalChain([config, 'access',
|
|
6006
|
+
if (_optionalChain([config, 'access', _373 => _373.extends, 'optionalAccess', _374 => _374.length])) {
|
|
5940
6007
|
const { config: layeredConfig } = await import("./layers-DMRXRL7F.cjs").then(
|
|
5941
6008
|
({ resolveFarmLayers }) => resolveFarmLayers(config, {
|
|
5942
6009
|
root: appRoot,
|
|
@@ -5946,11 +6013,11 @@ async function defineConfig(config = {}) {
|
|
|
5946
6013
|
config = layeredConfig;
|
|
5947
6014
|
}
|
|
5948
6015
|
config.renderer = _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, config.renderer);
|
|
5949
|
-
config.images =
|
|
6016
|
+
config.images = _chunkX2M4XN4Vcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, { root: appRoot, dev: true });
|
|
5950
6017
|
const rendererVitePlugins = await _chunkRD623KW4cjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, appRoot, {
|
|
5951
6018
|
ssr: true
|
|
5952
6019
|
});
|
|
5953
|
-
const reactRefreshPlugins = _chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) ? await
|
|
6020
|
+
const reactRefreshPlugins = _chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) ? await _chunk65Y5SIBHcjs.createFarmReactRefreshPlugins.call(void 0, ) : [];
|
|
5954
6021
|
const nodeBuiltinStubs = {
|
|
5955
6022
|
"node:string_decoder": "data:text/javascript,export class StringDecoder { write(buf) { return ''; } end() { return ''; } }; export default StringDecoder;",
|
|
5956
6023
|
"node:buffer": "data:text/javascript,export const Buffer = { from: () => ({}), alloc: () => ({}), isBuffer: () => false }; export default { Buffer };",
|
|
@@ -6038,13 +6105,13 @@ async function defineConfig(config = {}) {
|
|
|
6038
6105
|
if (!serverStarted) {
|
|
6039
6106
|
serverStarted = true;
|
|
6040
6107
|
const elapsed = Date.now() - startTime;
|
|
6041
|
-
const address = _optionalChain([server, 'access',
|
|
6108
|
+
const address = _optionalChain([server, 'access', _375 => _375.httpServer, 'optionalAccess', _376 => _376.address, 'call', _377 => _377()]);
|
|
6042
6109
|
const resolvedPort = typeof address === "object" && address ? address.port : server.config.server.port || port || 3e3;
|
|
6043
6110
|
const hostConfig = server.config.server.host;
|
|
6044
6111
|
const isExposed = hostConfig === true || hostConfig === "0.0.0.0";
|
|
6045
6112
|
console.log("");
|
|
6046
6113
|
console.log(
|
|
6047
|
-
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${
|
|
6114
|
+
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkAGR7VJH2cjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
|
|
6048
6115
|
);
|
|
6049
6116
|
console.log("");
|
|
6050
6117
|
console.log(
|
|
@@ -6077,8 +6144,8 @@ async function defineConfig(config = {}) {
|
|
|
6077
6144
|
return {
|
|
6078
6145
|
plugins: [
|
|
6079
6146
|
// `farm dev --desktop`: only the desktop window gets an answer, as in the packaged app.
|
|
6080
|
-
|
|
6081
|
-
|
|
6147
|
+
_chunk65Y5SIBHcjs.farmDesktopDevGuardPlugin.call(void 0, config.basePath),
|
|
6148
|
+
_chunkX2M4XN4Vcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
6082
6149
|
tailwindVitePlugin,
|
|
6083
6150
|
...rendererVitePlugins,
|
|
6084
6151
|
...reactRefreshPlugins,
|
|
@@ -6086,14 +6153,14 @@ async function defineConfig(config = {}) {
|
|
|
6086
6153
|
farmI18nClientBridgePlugin(),
|
|
6087
6154
|
farmServerOnlyEntriesPlugin(),
|
|
6088
6155
|
farmPlugin(config),
|
|
6089
|
-
|
|
6156
|
+
_chunkNK2VWS7Pcjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
|
|
6090
6157
|
farmBrandingPlugin
|
|
6091
6158
|
],
|
|
6092
6159
|
customLogger: farmLogger,
|
|
6093
6160
|
clearScreen: false,
|
|
6094
6161
|
optimizeDeps: {
|
|
6095
|
-
...
|
|
6096
|
-
|
|
6162
|
+
..._chunkX2M4XN4Vcjs.createFarmClientOptimizeDepsConfig.call(void 0,
|
|
6163
|
+
_chunkX2M4XN4Vcjs.createFarmClientOptimizeDepsEntries.call(void 0,
|
|
6097
6164
|
appRoot,
|
|
6098
6165
|
_chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, { ...config, root: appRoot })
|
|
6099
6166
|
),
|
|
@@ -6136,7 +6203,7 @@ async function defineConfig(config = {}) {
|
|
|
6136
6203
|
// Stub out problematic server-only modules during dev mode
|
|
6137
6204
|
alias: {
|
|
6138
6205
|
..._chunk5Y2P454Ocjs.getFarmLayerAliases.call(void 0, config.layers),
|
|
6139
|
-
...
|
|
6206
|
+
..._chunkX2M4XN4Vcjs.createFarmSourceAlias.call(void 0, appRoot, config.srcDir),
|
|
6140
6207
|
// Nitro internals that should not be resolved in browser
|
|
6141
6208
|
"supports-color": "data:text/javascript,export default false; export const supportsColor = false; export const stdout = false; export const stderr = false;",
|
|
6142
6209
|
"@poppinss/dumper": "data:text/javascript,export default {};",
|