@farm.js/core 0.1.80 → 0.1.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-mcp.d-BPa5n0ld.d.ts → agent-mcp.d-C2Su3x4D.d.ts} +1 -1
- package/dist/{agent-mcp.d-DOP95Jxm.d.mts → agent-mcp.d-Yak-LqRd.d.mts} +1 -1
- package/dist/agent-runtime.cjs +4 -3
- package/dist/agent-runtime.d.mts +2 -1
- package/dist/agent-runtime.d.ts +2 -1
- package/dist/agent-runtime.mjs +3 -2
- package/dist/analyzer-LV23T6QN.cjs +17 -0
- package/dist/{analyzer-F7CWE5VA.mjs → analyzer-RPU2KG4J.mjs} +3 -2
- package/dist/api/client.cjs +1 -1
- package/dist/api/client.mjs +1 -1
- package/dist/api/client.native.cjs +1 -1
- package/dist/api/client.native.mjs +1 -1
- package/dist/api/node.cjs +6 -5
- package/dist/api/node.d.mts +4 -3
- package/dist/api/node.d.ts +4 -3
- package/dist/api/node.mjs +5 -4
- package/dist/api/route-manager.cjs +7 -6
- package/dist/api/route-manager.d.mts +4 -3
- package/dist/api/route-manager.d.ts +4 -3
- package/dist/api/route-manager.mjs +6 -5
- package/dist/api/runtime.cjs +5 -4
- package/dist/api/runtime.d.mts +3 -2
- package/dist/api/runtime.d.ts +3 -2
- package/dist/api/runtime.mjs +4 -3
- package/dist/api.cjs +9 -8
- package/dist/api.d.mts +5 -4
- package/dist/api.d.ts +5 -4
- package/dist/api.mjs +8 -7
- package/dist/{app-manifest.d-9UD6BznX.d.mts → app-manifest.d-BcyOFMrg.d.mts} +1 -1
- package/dist/{app-manifest.d-CO6Iu0Hx.d.ts → app-manifest.d-DZyXaICz.d.ts} +1 -1
- package/dist/app-markdown.cjs +3 -3
- package/dist/app-markdown.d.mts +5 -4
- package/dist/app-markdown.d.ts +5 -4
- package/dist/app-markdown.mjs +2 -2
- package/dist/{app.d-DXeRWZK7.d.mts → app.d-C0ePpuaG.d.mts} +30 -4
- package/dist/{app.d-DwX1ePhs.d.ts → app.d-CIoXsAbN.d.ts} +30 -4
- package/dist/{chunk-Q4TRGTO7.cjs → chunk-26WP75W5.cjs} +32 -16
- package/dist/{chunk-7KDCVSTR.mjs → chunk-2PFGA6PB.mjs} +2 -2
- package/dist/chunk-2UYYXSUS.mjs +401 -0
- package/dist/{chunk-PL7MCYYD.mjs → chunk-3AV4DCXY.mjs} +58 -358
- package/dist/{chunk-3GNHJ3RN.cjs → chunk-3BTN3NP7.cjs} +2 -2
- package/dist/chunk-3DE6RK7K.cjs +36 -0
- package/dist/{chunk-GBW5DU7V.mjs → chunk-47I2MYIR.mjs} +487 -304
- package/dist/{chunk-RQBGHHOQ.mjs → chunk-4X7LSGM6.mjs} +1 -1
- package/dist/{chunk-QMR2TUVZ.cjs → chunk-52Q4OB4A.cjs} +4 -4
- package/dist/{chunk-BPWTSPK6.mjs → chunk-5AL2GXAU.mjs} +1 -1
- package/dist/{chunk-GAWSWJJ2.cjs → chunk-5GFTMTX3.cjs} +2 -2
- package/dist/chunk-5MMKNW7Q.cjs +54 -0
- package/dist/{chunk-AXA2BSX3.cjs → chunk-5MUFW5UU.cjs} +22 -21
- package/dist/{chunk-MQOHYV6L.cjs → chunk-5P65LXGU.cjs} +11 -11
- package/dist/{chunk-KEU55O2D.mjs → chunk-63ZE6B6M.mjs} +7 -6
- package/dist/{chunk-TS3ZHJN5.cjs → chunk-6BPFIYGY.cjs} +3 -3
- package/dist/{chunk-NJ4OASLP.mjs → chunk-6QYPP5KC.mjs} +2 -2
- package/dist/{chunk-ATISIC6G.mjs → chunk-7VJXYB6S.mjs} +7 -1
- package/dist/{chunk-G4SZC2WH.cjs → chunk-AIPZDBP6.cjs} +557 -374
- package/dist/{chunk-X4TSMQWF.cjs → chunk-ARORZ3MH.cjs} +548 -397
- package/dist/{chunk-K3XKEZR6.mjs → chunk-AUFEM3FB.mjs} +1 -1
- package/dist/{chunk-MGKWYPE3.mjs → chunk-AYDVUCXD.mjs} +1 -0
- package/dist/{chunk-5OAN7BG5.cjs → chunk-B2PGVHBG.cjs} +4 -4
- package/dist/{chunk-WGWWRV2M.cjs → chunk-B3HQTGXS.cjs} +6 -4
- package/dist/chunk-B7L24VPX.cjs +401 -0
- package/dist/{chunk-5VDJEKGK.cjs → chunk-BBVLOEND.cjs} +1 -1
- package/dist/{chunk-XF7MJSUS.mjs → chunk-BCQIXH7L.mjs} +1 -1
- package/dist/{chunk-67MZTLTF.cjs → chunk-BCTHOQPP.cjs} +37 -9
- package/dist/{chunk-GBESKA76.cjs → chunk-BSX5OGSD.cjs} +1 -1
- package/dist/{chunk-CNDBLUKI.mjs → chunk-BVJUFVCU.mjs} +1 -1
- package/dist/{chunk-QHAISITM.mjs → chunk-C3VCYOU4.mjs} +1 -1
- package/dist/chunk-C5QHZ626.cjs +85 -0
- package/dist/{chunk-3K2E55BJ.mjs → chunk-CA2HBLXP.mjs} +13 -3
- package/dist/{chunk-ANZLZNNX.cjs → chunk-CD5Z7RR5.cjs} +155 -20
- package/dist/{chunk-4MIDUSIX.mjs → chunk-CJDBTTLB.mjs} +17 -17
- package/dist/{chunk-RLCOWWE5.cjs → chunk-CN2JOTRO.cjs} +7 -7
- package/dist/chunk-D2VAANBS.mjs +48 -0
- package/dist/{chunk-XZBBKZGW.mjs → chunk-DAXU2NBE.mjs} +128 -41
- package/dist/{chunk-4H4ZXUNB.cjs → chunk-DJ3PVHTW.cjs} +3 -3
- package/dist/{chunk-Z5BANEQD.cjs → chunk-DMSXZNQR.cjs} +2 -2
- package/dist/{chunk-ZVSQN7NC.cjs → chunk-DRO3NXA3.cjs} +40 -43
- package/dist/{chunk-4OFWG4IK.cjs → chunk-EACD6ND7.cjs} +8 -2
- package/dist/{chunk-Q4YEAWUK.mjs → chunk-ECVSRE4Y.mjs} +3 -2
- package/dist/{chunk-MDEFTF63.mjs → chunk-EL2Z6YFZ.mjs} +25 -28
- package/dist/chunk-EZYKV24V.mjs +385 -0
- package/dist/{chunk-TVCFY3KK.cjs → chunk-FB4CWSC2.cjs} +12 -12
- package/dist/{chunk-IYFBLWXU.cjs → chunk-FULX5RYX.cjs} +61 -361
- package/dist/{chunk-V73Y4UBL.mjs → chunk-GXLNARPO.mjs} +151 -16
- package/dist/{chunk-ZPEZXQTM.cjs → chunk-HHQEKLZL.cjs} +2 -2
- package/dist/{chunk-HNUBRUFQ.cjs → chunk-HQEYZSF3.cjs} +4 -3
- package/dist/{chunk-5ZHC6QGD.cjs → chunk-HQKCSJEH.cjs} +8 -2
- package/dist/{chunk-RHI67C2V.cjs → chunk-HUGPJFOC.cjs} +1 -35
- package/dist/{chunk-44G4XHEL.mjs → chunk-I4DR3HCH.mjs} +11 -11
- package/dist/chunk-I4WZRG73.mjs +54 -0
- package/dist/{chunk-MUZHULW2.mjs → chunk-ICOJ2BC6.mjs} +23 -7
- package/dist/{chunk-MNIR7I7B.mjs → chunk-INKVDO42.mjs} +1 -1
- package/dist/{chunk-C2OLXVUC.mjs → chunk-IVP5Q4BX.mjs} +10 -3
- package/dist/{chunk-HEDGTXXB.cjs → chunk-JB4BHRFK.cjs} +17 -17
- package/dist/{chunk-XKUKWMGX.cjs → chunk-JCYDWJVO.cjs} +3 -3
- package/dist/{chunk-CCMP4JD2.cjs → chunk-JK26IMT7.cjs} +1 -1
- package/dist/{chunk-WIZRYFB2.cjs → chunk-JYQ6DGPW.cjs} +8 -6
- package/dist/{chunk-SVCUSOEF.mjs → chunk-KR5DF7WK.mjs} +1 -1
- package/dist/{chunk-TYHWZOA2.mjs → chunk-KWI3SQFX.mjs} +4 -2
- package/dist/{chunk-POVHO46S.mjs → chunk-L3RDECA5.mjs} +1 -1
- package/dist/{chunk-LVGB5PYK.cjs → chunk-LM2ZDNDD.cjs} +28 -28
- package/dist/{chunk-COTFX4GT.mjs → chunk-LTOT5KVJ.mjs} +1 -1
- package/dist/{chunk-RPA45OQS.mjs → chunk-MO4UTDQ6.mjs} +1 -1
- package/dist/{chunk-DVHFIETW.cjs → chunk-N2EFMN2K.cjs} +18 -18
- package/dist/{chunk-MZ5QGWRW.mjs → chunk-N3VMHPIY.mjs} +2 -2
- package/dist/{chunk-KKVRWNDH.mjs → chunk-NAHDG6UX.mjs} +4 -4
- package/dist/{chunk-UWOCYINY.cjs → chunk-NEKO3HM2.cjs} +12 -2
- package/dist/{chunk-SLEHAGGV.mjs → chunk-NQ3Y6E2T.mjs} +7 -1
- package/dist/{chunk-ZDYYZX73.mjs → chunk-NRCKBDYP.mjs} +266 -115
- package/dist/{chunk-EG5YBYHO.mjs → chunk-OMB7UGVW.mjs} +1 -1
- package/dist/{chunk-JGEN2FIT.mjs → chunk-OP5VI4TP.mjs} +1 -1
- package/dist/{chunk-7VCLTNED.mjs → chunk-PNMAD3OS.mjs} +1 -35
- package/dist/{chunk-3XTRT3MB.mjs → chunk-PO5MZIWK.mjs} +1 -1
- package/dist/{chunk-ASYOWPSR.cjs → chunk-PWDBWXQI.cjs} +2 -1
- package/dist/{chunk-WJ2O2MPP.cjs → chunk-Q2VOT3K2.cjs} +494 -407
- package/dist/{chunk-7YLDUB4R.cjs → chunk-QCKSYYXK.cjs} +7 -7
- package/dist/{chunk-57QAQU4F.mjs → chunk-QRNYSISP.mjs} +1 -1
- package/dist/{chunk-3JQBQG7K.mjs → chunk-QSMUMK7Y.mjs} +2 -2
- package/dist/{chunk-PRL7FXG4.cjs → chunk-RDNKQ5MK.cjs} +12 -13
- package/dist/{chunk-GCRT6GJG.mjs → chunk-RMLR5RMH.mjs} +30 -2
- package/dist/{chunk-XY5OZQF6.cjs → chunk-RMPUEH5T.cjs} +2 -2
- package/dist/{chunk-7DD5TNPS.cjs → chunk-S7WZUK3B.cjs} +2 -2
- package/dist/{chunk-EGHPFXPZ.cjs → chunk-SAPG45RA.cjs} +23 -23
- package/dist/{chunk-Z4SMFUZ7.cjs → chunk-U54REWMJ.cjs} +23 -23
- package/dist/chunk-U6XYBTUT.mjs +36 -0
- package/dist/chunk-UDMBUTJD.mjs +85 -0
- package/dist/{chunk-WHEQJN4G.cjs → chunk-UGD53SNO.cjs} +2 -2
- package/dist/{chunk-TCMRLW3K.cjs → chunk-VACYUMXW.cjs} +10 -3
- package/dist/{chunk-SDICLSQU.cjs → chunk-VMBIKDKW.cjs} +10 -10
- package/dist/{chunk-WBPVLCNE.mjs → chunk-VPGEYX5Y.mjs} +4 -4
- package/dist/chunk-VS7HLH4S.cjs +385 -0
- package/dist/{chunk-UGLTOLTJ.cjs → chunk-W76C7TCW.cjs} +2 -2
- package/dist/chunk-WMRGIQTA.cjs +48 -0
- package/dist/{chunk-52LTENRE.cjs → chunk-WOAXQ5MZ.cjs} +9 -9
- package/dist/{chunk-C6HGUTXB.mjs → chunk-XBSIGZ4J.mjs} +2 -3
- package/dist/{chunk-6JWXHPVR.mjs → chunk-XRSNW4IU.mjs} +4 -2
- package/dist/{chunk-2RRTOKRZ.mjs → chunk-YHM4PXJY.mjs} +1 -1
- package/dist/{chunk-A5D3UMLJ.mjs → chunk-YSU3WCW6.mjs} +1 -1
- package/dist/{chunk-4STJ6LGR.mjs → chunk-Z3RM3VA2.mjs} +1 -1
- package/dist/{chunk-YN3YMSKD.mjs → chunk-ZIZRIZLP.mjs} +3 -3
- package/dist/{cli-runtime.d-DPNTN-JV.d.mts → cli-runtime.d-Hnvvadz7.d.mts} +5 -5
- package/dist/{cli-runtime.d-8BhZy_wr.d.ts → cli-runtime.d-I0MphTbc.d.ts} +5 -5
- package/dist/{client-component.d-CkDcob6D.d.ts → client-component.d-5QEvtJsg.d.ts} +1 -1
- package/dist/{client-component.d-CMCdyAr8.d.mts → client-component.d-DapRqtSC.d.mts} +1 -1
- package/dist/{client-plugins.d-WcMwOZGZ.d.mts → client-plugins.d-C1WM3ieD.d.mts} +7 -13
- package/dist/{client-plugins.d-BYIovYqX.d.ts → client-plugins.d-DcmDzcSC.d.ts} +7 -13
- package/dist/client-plugins.d.mts +2 -1
- package/dist/client-plugins.d.ts +2 -1
- package/dist/client.cjs +9 -8
- package/dist/client.d.mts +20 -151
- package/dist/client.d.ts +20 -151
- package/dist/client.mjs +8 -7
- package/dist/config.d.mts +2 -1
- package/dist/config.d.ts +2 -1
- package/dist/cron.cjs +2 -2
- package/dist/cron.mjs +1 -1
- package/dist/desktop.d.mts +3 -2
- package/dist/desktop.d.ts +3 -2
- package/dist/{devtools-JJOYTIMS.cjs → devtools-5B7NZE6F.cjs} +15 -14
- package/dist/{devtools-F3FDFV26.mjs → devtools-C5GXZZ7E.mjs} +12 -11
- package/dist/docs.cjs +14 -13
- package/dist/docs.d.mts +4 -3
- package/dist/docs.d.ts +4 -3
- package/dist/docs.mjs +13 -12
- package/dist/environment/vite.cjs +7 -6
- package/dist/environment/vite.mjs +6 -5
- package/dist/{handler.d-s3IM6pbJ.d.mts → handler.d-B8bPCBzl.d.mts} +1 -1
- package/dist/{handler.d-BwdOyc9x.d.ts → handler.d-Cliwo6Nu.d.ts} +1 -1
- package/dist/{headers.d-BR-OXrqQ.d.mts → headers.d-CVwSpSGX.d.mts} +1 -1
- package/dist/{headers.d-CAW4wPey.d.ts → headers.d-C_btqjV6.d.ts} +1 -1
- package/dist/index.cjs +68 -65
- package/dist/{index.d-BEVK61zS.d.mts → index.d-DFuMZk9-.d.mts} +1 -1
- package/dist/{index.d-ah2c89Wu.d.ts → index.d-hOEbMcLk.d.ts} +1 -1
- package/dist/index.d.mts +25 -23
- package/dist/index.d.ts +25 -23
- package/dist/index.mjs +72 -69
- package/dist/instrumentation.cjs +3 -3
- package/dist/instrumentation.mjs +2 -2
- package/dist/integrations/orm.d.mts +2 -1
- package/dist/integrations/orm.d.ts +2 -1
- package/dist/integrations.cjs +4 -3
- package/dist/integrations.d.mts +2 -1
- package/dist/integrations.d.ts +2 -1
- package/dist/integrations.mjs +3 -2
- package/dist/internal/app-markdown-runtime.cjs +2 -2
- package/dist/internal/app-markdown-runtime.d.mts +12 -5
- package/dist/internal/app-markdown-runtime.d.ts +12 -5
- package/dist/internal/app-markdown-runtime.mjs +1 -1
- package/dist/internal/build-runtime.cjs +49 -47
- package/dist/internal/build-runtime.d.mts +5 -4
- package/dist/internal/build-runtime.d.ts +5 -4
- package/dist/internal/build-runtime.mjs +48 -46
- package/dist/internal/cli-runtime.cjs +25 -24
- package/dist/internal/cli-runtime.d.mts +8 -7
- package/dist/internal/cli-runtime.d.ts +8 -7
- package/dist/internal/cli-runtime.mjs +26 -25
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +76 -15
- package/dist/internal/client-runtime.d.mts +18 -7
- package/dist/internal/client-runtime.d.ts +18 -7
- package/dist/internal/client-runtime.mjs +67 -6
- package/dist/internal/compression-runtime.d.mts +2 -1
- package/dist/internal/compression-runtime.d.ts +2 -1
- package/dist/internal/config-runtime.cjs +14 -13
- package/dist/internal/config-runtime.d.mts +4 -3
- package/dist/internal/config-runtime.d.ts +4 -3
- package/dist/internal/config-runtime.mjs +13 -12
- package/dist/internal/docs-precompiled-runtime.cjs +1 -1
- package/dist/internal/docs-precompiled-runtime.mjs +1 -1
- package/dist/internal/form-actions.cjs +3 -3
- package/dist/internal/form-actions.mjs +2 -2
- package/dist/internal/infra-analytics-runtime.cjs +9 -7
- package/dist/internal/infra-analytics-runtime.d.mts +8 -2
- package/dist/internal/infra-analytics-runtime.d.ts +8 -2
- package/dist/internal/infra-analytics-runtime.mjs +9 -7
- package/dist/internal/island-codec.cjs +3 -3
- package/dist/internal/island-codec.mjs +2 -2
- package/dist/internal/island-value-store.d.mts +1 -1
- package/dist/internal/island-value-store.d.ts +1 -1
- package/dist/internal/islands-boot.cjs +63 -23
- package/dist/internal/islands-boot.d.mts +5 -3
- package/dist/internal/islands-boot.d.ts +5 -3
- package/dist/internal/islands-boot.mjs +58 -18
- package/dist/internal/islands-runtime.cjs +10 -56
- package/dist/internal/islands-runtime.mjs +6 -52
- package/dist/internal/islands-server.cjs +4 -4
- package/dist/internal/islands-server.mjs +3 -3
- package/dist/internal/islx-actions-client.cjs +36 -0
- package/dist/internal/islx-actions-client.d.mts +13 -0
- package/dist/internal/islx-actions-client.d.ts +13 -0
- package/dist/internal/islx-actions-client.mjs +36 -0
- package/dist/internal/islx-actions-server.cjs +8 -0
- package/dist/internal/islx-actions-server.d.mts +6 -0
- package/dist/internal/islx-actions-server.d.ts +6 -0
- package/dist/internal/islx-actions-server.mjs +8 -0
- package/dist/internal/islx-client.d.mts +0 -4
- package/dist/internal/islx-client.d.ts +0 -4
- package/dist/internal/isolated-boundary.cjs +3 -3
- package/dist/internal/isolated-boundary.d.mts +1 -1
- package/dist/internal/isolated-boundary.d.ts +1 -1
- package/dist/internal/isolated-boundary.mjs +2 -2
- package/dist/internal/metadata-image-runtime.cjs +4 -2
- package/dist/internal/metadata-image-runtime.d.mts +18 -2
- package/dist/internal/metadata-image-runtime.d.ts +18 -2
- package/dist/internal/metadata-image-runtime.mjs +5 -3
- package/dist/internal/native-server-fns.cjs +5 -4
- package/dist/internal/native-server-fns.mjs +4 -3
- package/dist/internal/navigation-neutral.cjs +36 -0
- package/dist/internal/navigation-neutral.d.mts +14 -0
- package/dist/internal/navigation-neutral.d.ts +14 -0
- package/dist/internal/navigation-neutral.mjs +36 -0
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-runtime.cjs +30 -25
- package/dist/internal/production-runtime.d.mts +14 -11
- package/dist/internal/production-runtime.d.ts +14 -11
- package/dist/internal/production-runtime.mjs +35 -30
- package/dist/internal/server-tree.cjs +5 -4
- package/dist/internal/server-tree.d.mts +3 -4
- package/dist/internal/server-tree.d.ts +3 -4
- package/dist/internal/server-tree.mjs +4 -3
- package/dist/internal/spa-router.cjs +3 -3
- package/dist/internal/spa-router.d.mts +4 -3
- package/dist/internal/spa-router.d.ts +4 -3
- package/dist/internal/spa-router.mjs +2 -2
- package/dist/internal/start-manifest.d.mts +2 -1
- package/dist/internal/start-manifest.d.ts +2 -1
- package/dist/internal/vercel-edge-middleware.cjs +1 -1
- package/dist/internal/vercel-edge-middleware.mjs +1 -1
- package/dist/island-value-protocol.d-fEoc1m8e.d.mts +27 -0
- package/dist/island-value-protocol.d-fEoc1m8e.d.ts +27 -0
- package/dist/{layers-5ZD4764G.mjs → layers-744BBUY5.mjs} +2 -2
- package/dist/layers-XLOMMQP7.cjs +21 -0
- package/dist/markdown.d.mts +2 -1
- package/dist/markdown.d.ts +2 -1
- package/dist/middleware.cjs +5 -5
- package/dist/middleware.d.mts +2 -1
- package/dist/middleware.d.ts +2 -1
- package/dist/middleware.mjs +4 -4
- package/dist/{mount.d-DcoPFqv5.d.ts → mount.d-CAovYKfs.d.ts} +1 -1
- package/dist/{mount.d-Ylo-CmzK.d.mts → mount.d-DLeYxeRR.d.mts} +1 -1
- package/dist/{native-server-fn-handler-TNVFEQW3.cjs → native-server-fn-handler-57TCQPSM.cjs} +4 -4
- package/dist/{native-server-fn-handler-OXFTI6V5.mjs → native-server-fn-handler-PYK65A46.mjs} +3 -3
- package/dist/{navigation-delegate.d-2MK4YSlL.d.ts → navigation-delegate.d-BLM-8Q3Z.d.ts} +1 -1
- package/dist/{navigation-delegate.d-BA5h0fbE.d.mts → navigation-delegate.d-Chv93QS6.d.mts} +1 -1
- package/dist/navigation-errors.d-DwHtoMyR.d.mts +13 -0
- package/dist/navigation-errors.d-DwHtoMyR.d.ts +13 -0
- package/dist/navigation.cjs +6 -6
- package/dist/navigation.d.mts +7 -6
- package/dist/navigation.d.ts +7 -6
- package/dist/navigation.mjs +5 -5
- package/dist/{nitro-C3MYDX7V.mjs → nitro-FK3SZM4H.mjs} +2 -2
- package/dist/{nitro-6UOJXJZ6.cjs → nitro-YDFMH5PY.cjs} +6 -6
- package/dist/node-module-bundle-TNSY5PAC.cjs +15 -0
- package/dist/{node-module-bundle-XPLBMXRD.mjs → node-module-bundle-ZWCQJCKA.mjs} +3 -1
- package/dist/{plugin-LN3JBZRR.cjs → plugin-3PT7I26P.cjs} +2 -2
- package/dist/{plugin-33I3V42N.mjs → plugin-QOTAPTVV.mjs} +1 -1
- package/dist/plugin.cjs +41 -37
- package/dist/plugin.d.mts +6 -5
- package/dist/plugin.d.ts +6 -5
- package/dist/plugin.mjs +40 -36
- package/dist/query/client.cjs +10 -10
- package/dist/query/client.mjs +5 -5
- package/dist/{render-plan.d-2o-AG-ot.d.ts → render-plan.d-BSTjTH8h.d.ts} +1 -1
- package/dist/{render-plan.d-ChYBMhLu.d.mts → render-plan.d-CK5Lggyb.d.mts} +1 -1
- package/dist/renderer/none/server.cjs +5 -1
- package/dist/renderer/none/server.d.mts +3 -1
- package/dist/renderer/none/server.d.ts +3 -1
- package/dist/renderer/none/server.mjs +4 -0
- package/dist/renderer/react/server.cjs +6 -6
- package/dist/renderer/react/server.mjs +3 -3
- package/dist/renderer-client.cjs +79 -17
- package/dist/renderer-client.d.mts +13 -97
- package/dist/renderer-client.d.ts +13 -97
- package/dist/renderer-client.mjs +69 -7
- package/dist/renderer.cjs +4 -2
- package/dist/renderer.d.mts +43 -5
- package/dist/renderer.d.ts +43 -5
- package/dist/renderer.mjs +3 -1
- package/dist/{request.d-RCnCBuWq.d.mts → request.d-BhggxQf3.d.mts} +1 -1
- package/dist/{request.d-CE0FIkiM.d.ts → request.d-CyJS9bjm.d.ts} +1 -1
- package/dist/request.d.mts +3 -2
- package/dist/request.d.ts +3 -2
- package/dist/{route-rendering.d-BTPOM2nU.d.ts → route-rendering.d-BLPPmI5I.d.ts} +1 -1
- package/dist/{route-rendering.d-BZJnfKsp.d.mts → route-rendering.d-CUpG2mZJ.d.mts} +1 -1
- package/dist/{router.d-BU_WE6Ol.d.ts → router.d-0X2Ki6rf.d.ts} +1 -1
- package/dist/{router.d-D8Vvwl4i.d.mts → router.d-2NQM1Kgw.d.mts} +1 -1
- package/dist/routes.cjs +1 -1
- package/dist/routes.d.mts +2 -1
- package/dist/routes.d.ts +2 -1
- package/dist/routes.mjs +1 -1
- package/dist/{rsc-pipeline-A3R4U26C.cjs → rsc-pipeline-5AOF64FL.cjs} +19 -18
- package/dist/{rsc-pipeline-JZWVSHOR.mjs → rsc-pipeline-DNRLYOJ7.mjs} +18 -17
- package/dist/{runtime-SQFRHRGJ.mjs → runtime-EHG2FRXZ.mjs} +18 -17
- package/dist/{runtime-WZ3CHHGJ.cjs → runtime-ZVHG5SRB.cjs} +20 -19
- package/dist/{runtime.d-DJ6IIKcF.d.ts → runtime.d-CXuwkUgr.d.ts} +1 -1
- package/dist/{runtime.d-BnmuOXVD.d.mts → runtime.d-CaFXcu_Q.d.mts} +1 -1
- package/dist/server-action-security.cjs +1 -1
- package/dist/server-action-security.mjs +1 -1
- package/dist/{server-components-status.d-BeqSXcjM.d.ts → server-components-status.d-BdeFD8ZH.d.ts} +1 -1
- package/dist/{server-components-status.d-BzOg9M8g.d.mts → server-components-status.d-Cp7zvBm5.d.mts} +1 -1
- package/dist/server-fn.cjs +3 -3
- package/dist/server-fn.mjs +2 -2
- package/dist/server-plugins.cjs +1 -1
- package/dist/server-plugins.d.mts +4 -3
- package/dist/server-plugins.d.ts +4 -3
- package/dist/server-plugins.mjs +1 -1
- package/dist/server-query.cjs +4 -4
- package/dist/server-query.mjs +3 -3
- package/dist/server.cjs +82 -71
- package/dist/server.d.mts +12 -11
- package/dist/server.d.ts +12 -11
- package/dist/server.mjs +61 -50
- package/dist/{spa-router.d-BOwuVkMl.d.ts → spa-router.d-Bjgl-Osi.d.ts} +3 -3
- package/dist/{spa-router.d-CDpftSsk.d.mts → spa-router.d-l3G38xHa.d.mts} +3 -3
- package/dist/{ssg.d-BTVqyq8T.d.ts → ssg.d-DDca17Lc.d.ts} +2 -2
- package/dist/{ssg.d-Bx_WFuwg.d.mts → ssg.d-RnlHOqUL.d.mts} +2 -2
- package/dist/store-core.d-BZjuC6Zc.d.mts +309 -0
- package/dist/store-core.d-BaOUOPf7.d.ts +309 -0
- package/dist/testing.cjs +7 -6
- package/dist/testing.d.mts +2 -1
- package/dist/testing.d.ts +2 -1
- package/dist/testing.mjs +6 -5
- package/dist/{utils.d-_dvevm5s.d.ts → utils.d-D8TWmpWo.d.ts} +1 -1
- package/dist/{utils.d-JkrpS-NJ.d.mts → utils.d-tdzw0_zQ.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +43 -37
- package/dist/vite.d.mts +18 -7
- package/dist/vite.d.ts +18 -7
- package/dist/vite.mjs +42 -36
- package/dist/workflows.cjs +2 -2
- package/dist/workflows.mjs +1 -1
- package/package.json +17 -2
- package/dist/analyzer-I7RBBQ65.cjs +0 -16
- package/dist/chunk-CQL5ZGFU.cjs +0 -50
- package/dist/chunk-HONTCUK6.mjs +0 -203
- package/dist/chunk-K6PGK7DC.cjs +0 -203
- package/dist/chunk-NBIVGHAT.mjs +0 -50
- package/dist/island-value-protocol.d-BRayRghM.d.mts +0 -12
- package/dist/island-value-protocol.d-BRayRghM.d.ts +0 -12
- package/dist/layers-HMEGUEXM.cjs +0 -21
- package/dist/node-module-bundle-M6BISE2P.cjs +0 -13
- package/dist/{chunk-EY7ED5UW.mjs → chunk-3RVLJTFZ.mjs} +3 -3
- package/dist/{chunk-UJPE75GF.mjs → chunk-J2VUPCCR.mjs} +3 -3
- package/dist/{chunk-PBJ7MEOV.cjs → chunk-OZUINP2P.cjs} +2 -2
- package/dist/{chunk-7FQFK3OA.mjs → chunk-V7HNYR76.mjs} +3 -3
- package/dist/{chunk-2FK47RRZ.cjs → chunk-VGHDPEPQ.cjs} +2 -2
- package/dist/{chunk-CGIVCGH5.cjs → chunk-XOFJUSWC.cjs} +2 -2
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkXOFJUSWCcjs = require('./chunk-XOFJUSWC.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _chunkMPU5DOXXcjs = require('./chunk-MPU5DOXX.cjs');
|
|
@@ -32,7 +32,7 @@ function createServerQuery(options) {
|
|
|
32
32
|
throw new TypeError("createServerQuery requires a key function");
|
|
33
33
|
}
|
|
34
34
|
const staleTime = normalizeServerQueryStaleTime(options.staleTime);
|
|
35
|
-
const execute =
|
|
35
|
+
const execute = _chunkXOFJUSWCcjs.createServerFn.call(void 0, {
|
|
36
36
|
input: options.input,
|
|
37
37
|
middleware: options.middleware,
|
|
38
38
|
handler: async (context) => {
|
|
@@ -44,7 +44,7 @@ function createServerQuery(options) {
|
|
|
44
44
|
const producer = async () => {
|
|
45
45
|
produced = true;
|
|
46
46
|
const value = await options.handler(context);
|
|
47
|
-
return
|
|
47
|
+
return _chunkXOFJUSWCcjs._parseServerFnSchema.call(void 0, options.output, value, "output", "createServerQuery");
|
|
48
48
|
};
|
|
49
49
|
let data;
|
|
50
50
|
let updatedAt;
|
|
@@ -59,7 +59,7 @@ function createServerQuery(options) {
|
|
|
59
59
|
});
|
|
60
60
|
updatedAt = await _asyncNullishCoalesce(await _asyncOptionalChain([(await cache.getEntryAsync(cacheKey, { allowStale: true })), 'optionalAccess', async _ => _.createdAt]), async () => ( Date.now()));
|
|
61
61
|
if (!produced && options.output) {
|
|
62
|
-
data =
|
|
62
|
+
data = _chunkXOFJUSWCcjs._parseServerFnSchema.call(void 0, options.output, data, "output", "createServerQuery");
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
return _chunkMPU5DOXXcjs.createFarmServerQueryResult.call(void 0, data, {
|
|
@@ -92,10 +92,10 @@ function createServerQuery(options) {
|
|
|
92
92
|
enumerable: false
|
|
93
93
|
}
|
|
94
94
|
});
|
|
95
|
-
|
|
95
|
+
_chunkXOFJUSWCcjs._attachServerFunctionDescriptor.call(void 0,
|
|
96
96
|
query,
|
|
97
|
-
|
|
98
|
-
const result = await
|
|
97
|
+
_chunkXOFJUSWCcjs.createServerFunctionDescriptor.call(void 0, "query", options, async (value) => {
|
|
98
|
+
const result = await _chunkXOFJUSWCcjs._runServerFunctionForCaller.call(void 0,
|
|
99
99
|
execute,
|
|
100
100
|
value
|
|
101
101
|
);
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-HR4N2K4V.mjs";
|
|
5
5
|
import {
|
|
6
6
|
normalizeFarmProductionSiteOrigin
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-4X7LSGM6.mjs";
|
|
8
8
|
import {
|
|
9
9
|
resolveFarmAppManifestConfig
|
|
10
10
|
} from "./chunk-SQ5O7I3L.mjs";
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
} from "./chunk-YT2ZMLXK.mjs";
|
|
30
30
|
import {
|
|
31
31
|
FARM_VERSION
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-OP5VI4TP.mjs";
|
|
33
33
|
import {
|
|
34
34
|
applyFarmBasePath
|
|
35
35
|
} from "./chunk-SF3JB56B.mjs";
|
|
@@ -8,14 +8,14 @@ var _chunkATYTLVSIcjs = require('./chunk-ATYTLVSI.cjs');
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
var _chunkC5QHZ626cjs = require('./chunk-C5QHZ626.cjs');
|
|
12
13
|
|
|
13
14
|
// src/client/server-tree.ts
|
|
14
15
|
var MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
|
|
15
16
|
var FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
|
|
16
17
|
var SERVER_HTML_TAG = "f-html";
|
|
17
18
|
var SERVER_HTML_TEMPLATE_TAG = "template";
|
|
18
|
-
var FARM_SERVER_TREE_SCRIPT_TYPE = "f/tree";
|
|
19
19
|
var FARM_NOT_A_MARKER = /* @__PURE__ */ Symbol.for("farm.codec.not-a-marker");
|
|
20
20
|
var SERVER_TREE_CHUNK_SCRIPT_TYPE = "f/chunk";
|
|
21
21
|
var FARM_SERVER_TREE_PAYLOAD_ONLY_ATTRIBUTE = "partial";
|
|
@@ -454,7 +454,7 @@ function createTreeScript(ReactRuntime, type, name, json, values = [], attribute
|
|
|
454
454
|
...values.map(
|
|
455
455
|
([valueKey, valueJson]) => ReactRuntime.createElement("script", {
|
|
456
456
|
key: valueKey,
|
|
457
|
-
type:
|
|
457
|
+
type: _chunkC5QHZ626cjs.FARM_VALUE_SCRIPT_TYPE,
|
|
458
458
|
name: valueKey,
|
|
459
459
|
dangerouslySetInnerHTML: { __html: valueJson }
|
|
460
460
|
})
|
|
@@ -467,12 +467,12 @@ function createTreePage(ReactRuntime, tree, json, resolver, key, values = []) {
|
|
|
467
467
|
ReactRuntime.Fragment,
|
|
468
468
|
key === void 0 ? null : { key },
|
|
469
469
|
createTreeValue(ReactRuntime, tree, resolver),
|
|
470
|
-
createTreeScript(ReactRuntime, FARM_SERVER_TREE_SCRIPT_TYPE, "", json, values)
|
|
470
|
+
createTreeScript(ReactRuntime, _chunkC5QHZ626cjs.FARM_SERVER_TREE_SCRIPT_TYPE, "", json, values)
|
|
471
471
|
);
|
|
472
472
|
}
|
|
473
473
|
function readTreeValueScripts(script) {
|
|
474
474
|
const values = [];
|
|
475
|
-
for (let node = script.previousElementSibling; _optionalChain([node, 'optionalAccess', _13 => _13.tagName]) === "SCRIPT" && node.getAttribute("type") ===
|
|
475
|
+
for (let node = script.previousElementSibling; _optionalChain([node, 'optionalAccess', _13 => _13.tagName]) === "SCRIPT" && node.getAttribute("type") === _chunkC5QHZ626cjs.FARM_VALUE_SCRIPT_TYPE; node = node.previousElementSibling) {
|
|
476
476
|
values.unshift([_nullishCoalesce(node.getAttribute("name"), () => ( "")), _nullishCoalesce(node.textContent, () => ( ""))]);
|
|
477
477
|
}
|
|
478
478
|
return values;
|
|
@@ -499,7 +499,7 @@ async function createPayloadOnlyPage(state, payload, encode, resolver) {
|
|
|
499
499
|
{ key: "payload" },
|
|
500
500
|
createTreeScript(
|
|
501
501
|
ReactRuntime,
|
|
502
|
-
FARM_SERVER_TREE_SCRIPT_TYPE,
|
|
502
|
+
_chunkC5QHZ626cjs.FARM_SERVER_TREE_SCRIPT_TYPE,
|
|
503
503
|
"",
|
|
504
504
|
payload.json,
|
|
505
505
|
payload.values,
|
|
@@ -575,10 +575,10 @@ async function renderFarmServerTreePage(ReactRuntime, element, options) {
|
|
|
575
575
|
serverHtml: /* @__PURE__ */ new Map(),
|
|
576
576
|
chunks: /* @__PURE__ */ new Map(),
|
|
577
577
|
actions: /* @__PURE__ */ new Map(),
|
|
578
|
-
codec: options.values ?
|
|
578
|
+
codec: options.values ? _chunkC5QHZ626cjs.getFarmIslandValuesServer.call(void 0, ) : void 0
|
|
579
579
|
};
|
|
580
580
|
const tree = await resolveValue(state, element, { parserSensitive: false }, /* @__PURE__ */ new Set());
|
|
581
|
-
const values = options.values ?
|
|
581
|
+
const values = options.values ? _chunkC5QHZ626cjs.getFarmIslandValuesServer.call(void 0, ) : void 0;
|
|
582
582
|
const held = values ? values.held() : null;
|
|
583
583
|
const encode = (payload2) => {
|
|
584
584
|
if (!values) return { json: serializeTreePayload(payload2), values: [] };
|
|
@@ -636,7 +636,7 @@ async function renderFarmServerTreePage(ReactRuntime, element, options) {
|
|
|
636
636
|
action(id) {
|
|
637
637
|
return state.actions.get(id);
|
|
638
638
|
},
|
|
639
|
-
decode: state.codec ? (object, decodeChild) =>
|
|
639
|
+
decode: state.codec ? (object, decodeChild) => _chunkC5QHZ626cjs.getFarmIslandValuesServer.call(void 0, ).decode(object, decodeChild) : void 0
|
|
640
640
|
};
|
|
641
641
|
const payload = encode({ v: 1, t: tree });
|
|
642
642
|
const page = options.payloadOnly && await createPayloadOnlyPage(state, payload, encode, resolver) || createTreePage(ReactRuntime, tree, payload.json, resolver, void 0, payload.values);
|
|
@@ -668,14 +668,14 @@ function originalExport(module, exportName) {
|
|
|
668
668
|
async function createFarmServerTreeElement(ReactRuntime, source, options) {
|
|
669
669
|
const root = typeof source === "string" ? parseHtml(source) : source;
|
|
670
670
|
const script = root.querySelector(
|
|
671
|
-
`script[type="${FARM_SERVER_TREE_SCRIPT_TYPE}"]`
|
|
671
|
+
`script[type="${_chunkC5QHZ626cjs.FARM_SERVER_TREE_SCRIPT_TYPE}"]`
|
|
672
672
|
);
|
|
673
673
|
if (!script) return null;
|
|
674
674
|
const json = _nullishCoalesce(script.textContent, () => ( ""));
|
|
675
675
|
let ingested = false;
|
|
676
676
|
const parsePayload = (text) => {
|
|
677
677
|
const parsed = JSON.parse(text);
|
|
678
|
-
if (!text.includes(`"${
|
|
678
|
+
if (!text.includes(`"${_chunkC5QHZ626cjs.FARM_TAG}":"${_chunkC5QHZ626cjs.FARM_REFERENCE_TAG}"`)) return parsed;
|
|
679
679
|
if (!options.values) throw new Error("island values need islands mode");
|
|
680
680
|
if (!ingested) {
|
|
681
681
|
options.values.ingest(root);
|
|
@@ -803,5 +803,4 @@ async function createFarmServerTreeElement(ReactRuntime, source, options) {
|
|
|
803
803
|
|
|
804
804
|
|
|
805
805
|
|
|
806
|
-
|
|
807
|
-
exports.FARM_SERVER_TREE_SCRIPT_TYPE = FARM_SERVER_TREE_SCRIPT_TYPE; exports.FARM_SERVER_TREE_PAYLOAD_ONLY_ATTRIBUTE = FARM_SERVER_TREE_PAYLOAD_ONLY_ATTRIBUTE; exports.renderFarmServerTreePage = renderFarmServerTreePage; exports.createFarmServerTreeElement = createFarmServerTreeElement;
|
|
806
|
+
exports.FARM_SERVER_TREE_PAYLOAD_ONLY_ATTRIBUTE = FARM_SERVER_TREE_PAYLOAD_ONLY_ATTRIBUTE; exports.renderFarmServerTreePage = renderFarmServerTreePage; exports.createFarmServerTreeElement = createFarmServerTreeElement;
|
|
@@ -8,7 +8,8 @@ var DEFAULT_RENDERER_CAPABILITIES = Object.freeze({
|
|
|
8
8
|
// Conservative default: assume a re-render rebuilds until a renderer states
|
|
9
9
|
// otherwise, so callers do not silently rely on reconciliation.
|
|
10
10
|
reconcilesRerenders: false,
|
|
11
|
-
functionComponents: false
|
|
11
|
+
functionComponents: false,
|
|
12
|
+
hydrationFallback: false
|
|
12
13
|
});
|
|
13
14
|
function getFarmRendererCapabilities(renderer) {
|
|
14
15
|
const defaultStreaming = {
|
|
@@ -36,7 +37,8 @@ function getFarmRendererCapabilities(renderer) {
|
|
|
36
37
|
...Object.keys(runtimes).length > 0 ? { runtimes } : {}
|
|
37
38
|
},
|
|
38
39
|
reconcilesRerenders: renderer?.capabilities?.reconcilesRerenders ?? DEFAULT_RENDERER_CAPABILITIES.reconcilesRerenders,
|
|
39
|
-
functionComponents: renderer?.capabilities?.functionComponents ?? DEFAULT_RENDERER_CAPABILITIES.functionComponents
|
|
40
|
+
functionComponents: renderer?.capabilities?.functionComponents ?? DEFAULT_RENDERER_CAPABILITIES.functionComponents,
|
|
41
|
+
hydrationFallback: renderer?.capabilities?.hydrationFallback ?? DEFAULT_RENDERER_CAPABILITIES.hydrationFallback
|
|
40
42
|
};
|
|
41
43
|
}
|
|
42
44
|
function getFarmRendererStreamingCapabilitiesForRuntime(renderer, runtime) {
|
|
@@ -44,6 +46,31 @@ function getFarmRendererStreamingCapabilitiesForRuntime(renderer, runtime) {
|
|
|
44
46
|
if (runtime === "unknown") return { node: streaming.node, web: streaming.web };
|
|
45
47
|
return streaming.runtimes?.[runtime] ?? { node: streaming.node, web: streaming.web };
|
|
46
48
|
}
|
|
49
|
+
var FARM_RENDERER_SERVER_EXPORTS = [
|
|
50
|
+
"name",
|
|
51
|
+
"createElement",
|
|
52
|
+
"isValidElement",
|
|
53
|
+
"Fragment",
|
|
54
|
+
"Suspense",
|
|
55
|
+
"renderToString"
|
|
56
|
+
];
|
|
57
|
+
function isMissingServerExport(key, value) {
|
|
58
|
+
if (key === "name") return typeof value !== "string" || value === "";
|
|
59
|
+
if (key === "Fragment" || key === "Suspense") return value === void 0 || value === null;
|
|
60
|
+
return typeof value !== "function";
|
|
61
|
+
}
|
|
62
|
+
function assertFarmRendererServerModule(runtime, renderer) {
|
|
63
|
+
const exports = runtime ?? {};
|
|
64
|
+
const missing = FARM_RENDERER_SERVER_EXPORTS.filter(
|
|
65
|
+
(key) => isMissingServerExport(key, exports[key])
|
|
66
|
+
);
|
|
67
|
+
if (missing.length === 0) return;
|
|
68
|
+
const names = missing.map((key) => `\`${key}\``);
|
|
69
|
+
const list = names.length === 1 ? names[0] : `${names.slice(0, -1).join(", ")}${names.length > 2 ? "," : ""} and ${names[names.length - 1]}`;
|
|
70
|
+
throw new Error(
|
|
71
|
+
`Renderer \`${renderer.name}\` server module \`${renderer.server}\` does not export ${list}. Export ${missing.length === 1 ? "it" : "them"} by name from that module: https://farmjs.dev/docs/renderers#renderer-modules`
|
|
72
|
+
);
|
|
73
|
+
}
|
|
47
74
|
function assertFarmRendererStreamingRuntime(name, renderer, runtimeModule, runtime) {
|
|
48
75
|
const declared = getFarmRendererStreamingCapabilitiesForRuntime(renderer, runtime);
|
|
49
76
|
const runtimeDeclaration = runtimeModule.capabilities?.streaming;
|
|
@@ -204,6 +231,7 @@ async function loadFarmRendererVitePlugins(renderer, root, options = {}) {
|
|
|
204
231
|
export {
|
|
205
232
|
getFarmRendererCapabilities,
|
|
206
233
|
getFarmRendererStreamingCapabilitiesForRuntime,
|
|
234
|
+
assertFarmRendererServerModule,
|
|
207
235
|
assertFarmRendererStreamingRuntime,
|
|
208
236
|
FARM_COMPONENT_EXTENSIONS,
|
|
209
237
|
resolveFarmComponentExtensions,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkJK26IMT7cjs = require('./chunk-JK26IMT7.cjs');
|
|
4
4
|
|
|
5
5
|
// src/deployment-environment.ts
|
|
6
6
|
function isFarmProductionDeploymentEnvironment(env = process.env) {
|
|
@@ -90,7 +90,7 @@ function createFarmProductionSiteReporter(options) {
|
|
|
90
90
|
schemaVersion: FARM_PRODUCTION_SITE_TELEMETRY_SCHEMA_VERSION,
|
|
91
91
|
eventType: FARM_PRODUCTION_SITE_ATTESTATION_EVENT_TYPE,
|
|
92
92
|
packageName: FARM_PRODUCTION_SITE_TELEMETRY_PACKAGE_NAME,
|
|
93
|
-
packageVersion: sanitizeDetail(
|
|
93
|
+
packageVersion: sanitizeDetail(_chunkJK26IMT7cjs.FARM_VERSION, "unknown"),
|
|
94
94
|
renderer: sanitizeDetail(options.renderer, "custom"),
|
|
95
95
|
deployTarget: sanitizeDetail(options.deployTarget, "custom")
|
|
96
96
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunkAQIRXBBYcjs = require('./chunk-AQIRXBBY.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkBCTHOQPPcjs = require('./chunk-BCTHOQPP.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunk2BEGVSDFcjs = require('./chunk-2BEGVSDF.cjs');
|
|
@@ -136,7 +136,7 @@ var PLATFORM_FILE = /^(?:(page|layout)\.(native|ios|android)\.(?:tsx|ts|jsx|js)|
|
|
|
136
136
|
async function scanRoutePatterns(options) {
|
|
137
137
|
const { root, srcDir = "src" } = options;
|
|
138
138
|
const sourceRoots = _nullishCoalesce(options.sourceRoots, () => ( [{ name: "project", root, srcDir, layer: false }]));
|
|
139
|
-
const componentExtensions =
|
|
139
|
+
const componentExtensions = _chunkBCTHOQPPcjs.resolveFarmComponentExtensions.call(void 0, options.componentExtensions).map(
|
|
140
140
|
(extension) => extension.slice(1)
|
|
141
141
|
);
|
|
142
142
|
const pages = /* @__PURE__ */ new Set();
|
|
@@ -16,10 +16,10 @@ var _chunkATYTLVSIcjs = require('./chunk-ATYTLVSI.cjs');
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunkC5QHZ626cjs = require('./chunk-C5QHZ626.cjs');
|
|
20
20
|
|
|
21
21
|
// src/client/isolated-boundary.ts
|
|
22
|
-
var ISLAND_SELECTOR = `${
|
|
22
|
+
var ISLAND_SELECTOR = `${_chunkC5QHZ626cjs.FARM_ISLAND_ELEMENT}[src]`;
|
|
23
23
|
var runtimeTagged = /* @__PURE__ */ new WeakSet();
|
|
24
24
|
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element");
|
|
25
25
|
var LEGACY_REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.element");
|
|
@@ -36,7 +36,7 @@ function getBoundaryGraphContext(ReactRuntime) {
|
|
|
36
36
|
return context;
|
|
37
37
|
}
|
|
38
38
|
function serializeBoundaryProps(value, seen = /* @__PURE__ */ new Set()) {
|
|
39
|
-
const codec =
|
|
39
|
+
const codec = _chunkC5QHZ626cjs.getFarmIslandValuesServer.call(void 0, );
|
|
40
40
|
const leaf = _optionalChain([codec, 'optionalAccess', _ => _.encodeLeaf, 'call', _2 => _2(value)]);
|
|
41
41
|
if (leaf) return leaf;
|
|
42
42
|
if (value === null || typeof value === "string" || typeof value === "boolean") return value;
|
|
@@ -49,7 +49,7 @@ function serializeBoundaryProps(value, seen = /* @__PURE__ */ new Set()) {
|
|
|
49
49
|
}
|
|
50
50
|
if (typeof value === "function") {
|
|
51
51
|
const actionId = _chunkATYTLVSIcjs.getFarmActionId.call(void 0, value);
|
|
52
|
-
if (actionId) return { [
|
|
52
|
+
if (actionId) return { [_chunkC5QHZ626cjs.FARM_TAG]: _chunkC5QHZ626cjs.FARM_ACTION_TAG, [_chunkC5QHZ626cjs.FARM_TAG_VALUE]: actionId };
|
|
53
53
|
}
|
|
54
54
|
if (typeof value !== "object") {
|
|
55
55
|
throw new TypeError(`${typeof value} values are not serializable`);
|
|
@@ -63,8 +63,8 @@ function serializeBoundaryProps(value, seen = /* @__PURE__ */ new Set()) {
|
|
|
63
63
|
if (Array.isArray(value)) return value.map((entry) => serializeBoundaryProps(entry, seen));
|
|
64
64
|
if (codec && value instanceof Map) {
|
|
65
65
|
return {
|
|
66
|
-
[
|
|
67
|
-
[
|
|
66
|
+
[_chunkC5QHZ626cjs.FARM_TAG]: "M",
|
|
67
|
+
[_chunkC5QHZ626cjs.FARM_TAG_VALUE]: Array.from(value, ([key, entry]) => [
|
|
68
68
|
serializeBoundaryProps(key, seen),
|
|
69
69
|
serializeBoundaryProps(entry, seen)
|
|
70
70
|
])
|
|
@@ -72,8 +72,8 @@ function serializeBoundaryProps(value, seen = /* @__PURE__ */ new Set()) {
|
|
|
72
72
|
}
|
|
73
73
|
if (codec && value instanceof Set) {
|
|
74
74
|
return {
|
|
75
|
-
[
|
|
76
|
-
[
|
|
75
|
+
[_chunkC5QHZ626cjs.FARM_TAG]: "S",
|
|
76
|
+
[_chunkC5QHZ626cjs.FARM_TAG_VALUE]: Array.from(value, (entry) => serializeBoundaryProps(entry, seen))
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
79
|
const prototype = Object.getPrototypeOf(value);
|
|
@@ -83,7 +83,7 @@ function serializeBoundaryProps(value, seen = /* @__PURE__ */ new Set()) {
|
|
|
83
83
|
const serialized = Object.fromEntries(
|
|
84
84
|
Object.entries(value).map(([key, entry]) => [key, serializeBoundaryProps(entry, seen)])
|
|
85
85
|
);
|
|
86
|
-
return codec && !runtimeTagged.has(value) && Object.prototype.hasOwnProperty.call(value,
|
|
86
|
+
return codec && !runtimeTagged.has(value) && Object.prototype.hasOwnProperty.call(value, _chunkC5QHZ626cjs.FARM_TAG) ? { [_chunkC5QHZ626cjs.FARM_TAG]: _chunkC5QHZ626cjs.FARM_OBJECT_TAG, [_chunkC5QHZ626cjs.FARM_TAG_VALUE]: serialized } : serialized;
|
|
87
87
|
} finally {
|
|
88
88
|
seen.delete(value);
|
|
89
89
|
}
|
|
@@ -94,13 +94,13 @@ function serializeBoundaryPayload(value) {
|
|
|
94
94
|
function escapeScriptJson(json) {
|
|
95
95
|
return json.replace(/&/g, "\\u0026").replace(/</g, "\\u003c").replace(/>/g, "\\u003e").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
96
96
|
}
|
|
97
|
-
var SLOT_ELEMENT =
|
|
97
|
+
var SLOT_ELEMENT = _chunkC5QHZ626cjs.FARM_SLOT_ELEMENT;
|
|
98
98
|
function isReactElementValue(value) {
|
|
99
99
|
const type = _optionalChain([value, 'optionalAccess', _3 => _3.$$typeof]);
|
|
100
100
|
return type === REACT_ELEMENT_TYPE || type === LEGACY_REACT_ELEMENT_TYPE;
|
|
101
101
|
}
|
|
102
102
|
function slotReference(id) {
|
|
103
|
-
const reference = { [
|
|
103
|
+
const reference = { [_chunkC5QHZ626cjs.FARM_TAG]: _chunkC5QHZ626cjs.FARM_SLOT_TAG, [_chunkC5QHZ626cjs.FARM_TAG_VALUE]: id };
|
|
104
104
|
runtimeTagged.add(reference);
|
|
105
105
|
return reference;
|
|
106
106
|
}
|
|
@@ -146,13 +146,13 @@ function reviveSlotProps(ReactRuntime, value, container, actions, decode) {
|
|
|
146
146
|
return changed2 ? revived2 : value;
|
|
147
147
|
}
|
|
148
148
|
if (!value || typeof value !== "object") return value;
|
|
149
|
-
const tag = decode || actions ?
|
|
150
|
-
const data = tag === void 0 ? void 0 : value[
|
|
151
|
-
if (tag ===
|
|
149
|
+
const tag = decode || actions ? _chunkC5QHZ626cjs.getFarmTag.call(void 0, value) : void 0;
|
|
150
|
+
const data = tag === void 0 ? void 0 : value[_chunkC5QHZ626cjs.FARM_TAG_VALUE];
|
|
151
|
+
if (tag === _chunkC5QHZ626cjs.FARM_ACTION_TAG && typeof data === "string") {
|
|
152
152
|
if (!actions) throw new Error("server action props need islands mode");
|
|
153
153
|
return actions(data);
|
|
154
154
|
}
|
|
155
|
-
if (tag ===
|
|
155
|
+
if (tag === _chunkC5QHZ626cjs.FARM_SLOT_TAG && typeof data === "string") {
|
|
156
156
|
let html = "";
|
|
157
157
|
for (const slot of container.querySelectorAll(SLOT_ELEMENT)) {
|
|
158
158
|
if (slot.getAttribute("name") === data) {
|
|
@@ -168,7 +168,7 @@ function reviveSlotProps(ReactRuntime, value, container, actions, decode) {
|
|
|
168
168
|
dangerouslySetInnerHTML: { __html: html }
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
|
-
if (tag ===
|
|
171
|
+
if (tag === _chunkC5QHZ626cjs.FARM_REFERENCE_TAG) throw new Error(`island value ${String(data)} was not resolved`);
|
|
172
172
|
if (tag !== void 0) {
|
|
173
173
|
if (!decode) throw new Error("typed props need islands mode");
|
|
174
174
|
const decoded = decode(
|
|
@@ -215,14 +215,14 @@ function createFarmIsolatedClientBoundary(ReactRuntime, Component, moduleReferen
|
|
|
215
215
|
if (boundaryOptions.slots) {
|
|
216
216
|
const { render, wire } = splitSlotProps(ReactRuntime, props, `${boundaryId}s`, { next: 0 });
|
|
217
217
|
renderProps = render;
|
|
218
|
-
const values = boundaryOptions.values ?
|
|
218
|
+
const values = boundaryOptions.values ? _chunkC5QHZ626cjs.getFarmIslandValuesServer.call(void 0, ) : void 0;
|
|
219
219
|
if (values) {
|
|
220
220
|
const addressed = values.address(serializeBoundaryProps(wire));
|
|
221
221
|
serializedProps = escapeScriptJson(addressed.json);
|
|
222
222
|
valueScripts = values.select(addressed, values.held()).map(
|
|
223
223
|
(value) => ReactRuntime.createElement("script", {
|
|
224
224
|
key: value.key,
|
|
225
|
-
type:
|
|
225
|
+
type: _chunkC5QHZ626cjs.FARM_VALUE_SCRIPT_TYPE,
|
|
226
226
|
name: value.key,
|
|
227
227
|
dangerouslySetInnerHTML: { __html: escapeScriptJson(value.json) }
|
|
228
228
|
})
|
|
@@ -249,7 +249,7 @@ function createFarmIsolatedClientBoundary(ReactRuntime, Component, moduleReferen
|
|
|
249
249
|
null,
|
|
250
250
|
...valueScripts,
|
|
251
251
|
ReactRuntime.createElement(
|
|
252
|
-
|
|
252
|
+
_chunkC5QHZ626cjs.FARM_ISLAND_ELEMENT,
|
|
253
253
|
{
|
|
254
254
|
src: moduleReference,
|
|
255
255
|
export: exportName,
|
|
@@ -264,7 +264,7 @@ function createFarmIsolatedClientBoundary(ReactRuntime, Component, moduleReferen
|
|
|
264
264
|
)
|
|
265
265
|
),
|
|
266
266
|
ReactRuntime.createElement("script", {
|
|
267
|
-
type:
|
|
267
|
+
type: _chunkC5QHZ626cjs.FARM_PROPS_SCRIPT_TYPE,
|
|
268
268
|
htmlFor: boundaryId,
|
|
269
269
|
dangerouslySetInnerHTML: { __html: serializedProps }
|
|
270
270
|
})
|
|
@@ -283,11 +283,11 @@ function isEarlyHydrationUpdate(error) {
|
|
|
283
283
|
}
|
|
284
284
|
function findBoundaryPayload(container, boundaryId) {
|
|
285
285
|
const sibling = container.nextElementSibling;
|
|
286
|
-
if (sibling instanceof HTMLScriptElement && sibling.type ===
|
|
286
|
+
if (sibling instanceof HTMLScriptElement && sibling.type === _chunkC5QHZ626cjs.FARM_PROPS_SCRIPT_TYPE && sibling.getAttribute("for") === boundaryId) {
|
|
287
287
|
return sibling;
|
|
288
288
|
}
|
|
289
289
|
for (const candidate of container.ownerDocument.querySelectorAll(
|
|
290
|
-
`script[type="${
|
|
290
|
+
`script[type="${_chunkC5QHZ626cjs.FARM_PROPS_SCRIPT_TYPE}"]`
|
|
291
291
|
)) {
|
|
292
292
|
if (candidate.getAttribute("for") === boundaryId) return candidate;
|
|
293
293
|
}
|
|
@@ -348,7 +348,7 @@ function createFarmIsolatedHydrationRuntime(options) {
|
|
|
348
348
|
throw new Error("serialized props must be an object");
|
|
349
349
|
}
|
|
350
350
|
let resolvedProps = parsedProps;
|
|
351
|
-
if (_optionalChain([payload, 'access', _9 => _9.textContent, 'optionalAccess', _10 => _10.includes, 'call', _11 => _11(`"${
|
|
351
|
+
if (_optionalChain([payload, 'access', _9 => _9.textContent, 'optionalAccess', _10 => _10.includes, 'call', _11 => _11(`"${_chunkC5QHZ626cjs.FARM_TAG}":"${_chunkC5QHZ626cjs.FARM_REFERENCE_TAG}"`)])) {
|
|
352
352
|
if (!options.values) throw new Error("island values need islands mode");
|
|
353
353
|
options.values.ingest(container.ownerDocument);
|
|
354
354
|
resolvedProps = options.values.resolve(parsedProps);
|
|
@@ -9,7 +9,7 @@ var _chunkKBGZ5FD6cjs = require('./chunk-KBGZ5FD6.cjs');
|
|
|
9
9
|
var _chunkP2355C6Ecjs = require('./chunk-P2355C6E.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunk5P65LXGUcjs = require('./chunk-5P65LXGU.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
var _chunkHS4JPIGRcjs = require('./chunk-HS4JPIGR.cjs');
|
|
@@ -26,7 +26,7 @@ var _chunkSBDWCDS6cjs = require('./chunk-SBDWCDS6.cjs');
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
var
|
|
29
|
+
var _chunkJYQ6DGPWcjs = require('./chunk-JYQ6DGPW.cjs');
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
var _chunkYUCU6XB4cjs = require('./chunk-YUCU6XB4.cjs');
|
|
@@ -148,7 +148,7 @@ function farmApiPlugin(options = {}) {
|
|
|
148
148
|
const existing = apiRoutesCache.get(routePath);
|
|
149
149
|
const existingFile = _optionalChain([endpointSources, 'access', _4 => _4.get, 'call', _5 => _5(routePath), 'optionalAccess', _6 => _6.get, 'call', _7 => _7(normalizedMethod)]);
|
|
150
150
|
if (existingFile) {
|
|
151
|
-
throw new (0,
|
|
151
|
+
throw new (0, _chunk5P65LXGUcjs.APIRouteConflictError)(routePath, normalizedMethod, existingFile, filePath);
|
|
152
152
|
}
|
|
153
153
|
if (existing) {
|
|
154
154
|
if (!existing.methods.includes(normalizedMethod)) {
|
|
@@ -224,7 +224,7 @@ function farmApiPlugin(options = {}) {
|
|
|
224
224
|
const createRouter = async () => {
|
|
225
225
|
const plugins = options.plugins ? await (_nullishCoalesce(routePlugins, () => ( (routePlugins = Promise.resolve(options.plugins({ root: projectRoot })))))) : [];
|
|
226
226
|
pluginMergedRoutes = plugins.length ? new Map(
|
|
227
|
-
|
|
227
|
+
_chunkJYQ6DGPWcjs.mergePluginAPIRoutes.call(void 0, [...apiRoutesCache.values()], plugins, void 0, {
|
|
228
228
|
bodySizeLimit,
|
|
229
229
|
// A plugin calling an app endpoint (an MCP tool, say) goes back through this server,
|
|
230
230
|
// so the middleware that guards the endpoint's path runs for it.
|
|
@@ -244,7 +244,7 @@ function farmApiPlugin(options = {}) {
|
|
|
244
244
|
const url = new URL(request.url);
|
|
245
245
|
const method = request.method.toUpperCase();
|
|
246
246
|
const pathname = url.pathname;
|
|
247
|
-
const match =
|
|
247
|
+
const match = _chunkJYQ6DGPWcjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), pathname, basePath);
|
|
248
248
|
if (!match) {
|
|
249
249
|
return new Response(JSON.stringify({ error: "Not Found" }), {
|
|
250
250
|
status: 404,
|
|
@@ -252,21 +252,21 @@ function farmApiPlugin(options = {}) {
|
|
|
252
252
|
});
|
|
253
253
|
}
|
|
254
254
|
const { route, params } = match;
|
|
255
|
-
const endpoint =
|
|
255
|
+
const endpoint = _chunkJYQ6DGPWcjs.resolveAPIRouteEndpoint.call(void 0, route, method);
|
|
256
256
|
if (!endpoint) {
|
|
257
257
|
return new Response(JSON.stringify({ error: "Method Not Allowed" }), {
|
|
258
258
|
status: 405,
|
|
259
259
|
headers: {
|
|
260
|
-
Allow:
|
|
260
|
+
Allow: _chunkJYQ6DGPWcjs.getAllowedAPIRouteMethods.call(void 0, route).join(", "),
|
|
261
261
|
"Content-Type": "application/json"
|
|
262
262
|
}
|
|
263
263
|
});
|
|
264
264
|
}
|
|
265
265
|
try {
|
|
266
|
-
return await
|
|
266
|
+
return await _chunkJYQ6DGPWcjs.invokeAPIRouteEndpoint.call(void 0, endpoint, request, params, bodySizeLimit);
|
|
267
267
|
} catch (error) {
|
|
268
268
|
console.error(`[API Error] ${pathname}:`, error);
|
|
269
|
-
return
|
|
269
|
+
return _chunkJYQ6DGPWcjs.createFarmInternalServerErrorResponse.call(void 0, );
|
|
270
270
|
}
|
|
271
271
|
};
|
|
272
272
|
log(`API router created with ${totalEndpoints} endpoints`);
|
|
@@ -310,7 +310,7 @@ function farmApiPlugin(options = {}) {
|
|
|
310
310
|
const routeModule = await _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, server, filePath);
|
|
311
311
|
const endpoints = {};
|
|
312
312
|
const availableMethods = [];
|
|
313
|
-
for (const method of
|
|
313
|
+
for (const method of _chunkJYQ6DGPWcjs.API_ROUTE_METHODS) {
|
|
314
314
|
if (routeModule[method]) {
|
|
315
315
|
availableMethods.push(method);
|
|
316
316
|
endpoints[method] = routeModule[method];
|
|
@@ -323,7 +323,7 @@ function farmApiPlugin(options = {}) {
|
|
|
323
323
|
log(`API route discovered: ${availableMethods.join(", ")} ${routePath}`);
|
|
324
324
|
}
|
|
325
325
|
} catch (e) {
|
|
326
|
-
if (e instanceof
|
|
326
|
+
if (e instanceof _chunk5P65LXGUcjs.APIRouteConflictError || e instanceof _chunkML4TOUZPcjs.AmbiguousRouteError) throw e;
|
|
327
327
|
log(`API route load failed at ${filePath}: ${e.message}`);
|
|
328
328
|
}
|
|
329
329
|
}
|
|
@@ -350,7 +350,7 @@ function farmApiPlugin(options = {}) {
|
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
352
|
} catch (e) {
|
|
353
|
-
if (e instanceof
|
|
353
|
+
if (e instanceof _chunk5P65LXGUcjs.APIRouteConflictError || e instanceof _chunkML4TOUZPcjs.AmbiguousRouteError) throw e;
|
|
354
354
|
log(`Root routes.ts load failed: ${e.message}`);
|
|
355
355
|
}
|
|
356
356
|
break;
|
|
@@ -381,7 +381,7 @@ function farmApiPlugin(options = {}) {
|
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
383
|
} catch (e) {
|
|
384
|
-
if (e instanceof
|
|
384
|
+
if (e instanceof _chunk5P65LXGUcjs.APIRouteConflictError || e instanceof _chunkML4TOUZPcjs.AmbiguousRouteError) throw e;
|
|
385
385
|
log(`Programmatic routes file load failed at ${routeFile}: ${e.message}`);
|
|
386
386
|
}
|
|
387
387
|
}
|
|
@@ -433,7 +433,7 @@ function farmApiPlugin(options = {}) {
|
|
|
433
433
|
const runWithDevI18n = async (req, res, handle) => {
|
|
434
434
|
const i18n = await devI18n;
|
|
435
435
|
const pathname = (req.url || "/").split("?")[0];
|
|
436
|
-
if (!
|
|
436
|
+
if (!_chunkJYQ6DGPWcjs.isFarmAPIPathname.call(void 0, pathname, basePath) && !_chunkJYQ6DGPWcjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), pathname, basePath)) {
|
|
437
437
|
return handle();
|
|
438
438
|
}
|
|
439
439
|
const headers = new Headers();
|
|
@@ -472,15 +472,15 @@ function farmApiPlugin(options = {}) {
|
|
|
472
472
|
if (discoveryPromise) await waitForDiscovery();
|
|
473
473
|
const farmMiddleware = server.__farmMiddleware__;
|
|
474
474
|
let middlewareRan = false;
|
|
475
|
-
if (!
|
|
476
|
-
if (!farmMiddleware || !apiRouterHandler || !
|
|
475
|
+
if (!_chunkJYQ6DGPWcjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), pathname, basePath)) {
|
|
476
|
+
if (!farmMiddleware || !apiRouterHandler || !_chunkJYQ6DGPWcjs.isFarmAPIPathname.call(void 0, pathname, basePath)) {
|
|
477
477
|
return next();
|
|
478
478
|
}
|
|
479
479
|
await _optionalChain([farmMiddleware, 'access', _10 => _10.waitForDiscovery, 'optionalCall', _11 => _11()]);
|
|
480
480
|
if (await farmMiddleware.execute(req, res, pathname, /* @__PURE__ */ new Map())) return;
|
|
481
481
|
middlewareRan = true;
|
|
482
482
|
const rewrittenPathname = (req.url || url).split("?")[0];
|
|
483
|
-
if (rewrittenPathname === pathname || !
|
|
483
|
+
if (rewrittenPathname === pathname || !_chunkJYQ6DGPWcjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), rewrittenPathname, basePath)) {
|
|
484
484
|
return next();
|
|
485
485
|
}
|
|
486
486
|
}
|
|
@@ -501,7 +501,7 @@ function farmApiPlugin(options = {}) {
|
|
|
501
501
|
}
|
|
502
502
|
const currentUrl = req.url || url;
|
|
503
503
|
const currentPathname = currentUrl.split("?")[0];
|
|
504
|
-
if (currentPathname !== pathname && !
|
|
504
|
+
if (currentPathname !== pathname && !_chunkJYQ6DGPWcjs.matchAPIRouteAtBasePath.call(void 0, servedRoutes(), currentPathname, basePath)) {
|
|
505
505
|
return next();
|
|
506
506
|
}
|
|
507
507
|
const fullUrl = _chunk2RSVYJT6cjs.resolveFarmRequestURL.call(void 0, req);
|
|
@@ -538,7 +538,7 @@ function farmApiPlugin(options = {}) {
|
|
|
538
538
|
console.error("[FARM] API error:", error);
|
|
539
539
|
res.statusCode = 500;
|
|
540
540
|
res.setHeader("Content-Type", "application/json");
|
|
541
|
-
res.end(
|
|
541
|
+
res.end(_chunkJYQ6DGPWcjs.FARM_INTERNAL_SERVER_ERROR_BODY);
|
|
542
542
|
}
|
|
543
543
|
});
|
|
544
544
|
server.middlewares.use((req, res, next) => {
|
|
@@ -562,7 +562,7 @@ function farmApiPlugin(options = {}) {
|
|
|
562
562
|
}
|
|
563
563
|
res.statusCode = 500;
|
|
564
564
|
res.setHeader("Content-Type", "application/json");
|
|
565
|
-
res.end(
|
|
565
|
+
res.end(_chunkJYQ6DGPWcjs.FARM_INTERNAL_SERVER_ERROR_BODY);
|
|
566
566
|
});
|
|
567
567
|
});
|
|
568
568
|
};
|
|
@@ -606,7 +606,7 @@ function farmApiPlugin(options = {}) {
|
|
|
606
606
|
log(`API router recreated`);
|
|
607
607
|
} catch (e) {
|
|
608
608
|
restoreRouteState(previousState);
|
|
609
|
-
if (e instanceof
|
|
609
|
+
if (e instanceof _chunk5P65LXGUcjs.APIRouteConflictError || e instanceof _chunkML4TOUZPcjs.AmbiguousRouteError) throw e;
|
|
610
610
|
log(`Root routes.ts HMR failed: ${e.message}`);
|
|
611
611
|
}
|
|
612
612
|
return [];
|
|
@@ -634,7 +634,7 @@ function farmApiPlugin(options = {}) {
|
|
|
634
634
|
const routeModule = await _chunk25JGHAGHcjs.loadFarmDevModule.call(void 0, server, file);
|
|
635
635
|
removeEndpointsFromFile(file);
|
|
636
636
|
const availableMethods = [];
|
|
637
|
-
for (const method of
|
|
637
|
+
for (const method of _chunkJYQ6DGPWcjs.API_ROUTE_METHODS) {
|
|
638
638
|
if (!routeModule[method]) continue;
|
|
639
639
|
availableMethods.push(method);
|
|
640
640
|
addEndpoint(routePath, file, method, routeModule[method]);
|
|
@@ -644,7 +644,7 @@ function farmApiPlugin(options = {}) {
|
|
|
644
644
|
log(`API router recreated`);
|
|
645
645
|
} catch (e) {
|
|
646
646
|
restoreRouteState(previousState);
|
|
647
|
-
if (e instanceof
|
|
647
|
+
if (e instanceof _chunk5P65LXGUcjs.APIRouteConflictError || e instanceof _chunkML4TOUZPcjs.AmbiguousRouteError) throw e;
|
|
648
648
|
log(`API route HMR failed: ${e.message}`);
|
|
649
649
|
}
|
|
650
650
|
return [];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// src/api/route-schema.ts
|
|
2
|
+
async function parseRouteSchema(schema, value) {
|
|
3
|
+
if (schema.parseAsync) return schema.parseAsync(value);
|
|
4
|
+
if (schema["~standard"]) {
|
|
5
|
+
const result = await schema["~standard"].validate(value);
|
|
6
|
+
if (result.issues)
|
|
7
|
+
throw Object.assign(new Error("Validation failed"), { issues: result.issues });
|
|
8
|
+
return result.value;
|
|
9
|
+
}
|
|
10
|
+
if (schema.parse) return schema.parse(value);
|
|
11
|
+
throw new TypeError("Route validators must implement Standard Schema or parse().");
|
|
12
|
+
}
|
|
13
|
+
var PUBLIC_MESSAGE_CODES = /* @__PURE__ */ new Set(["custom", "invalid_type"]);
|
|
14
|
+
function toPublicValidationIssues(error) {
|
|
15
|
+
const issues = error?.issues;
|
|
16
|
+
const list = Array.isArray(issues) ? issues : Array.isArray(error?.errors) ? error.errors : [];
|
|
17
|
+
return list.map((issue) => {
|
|
18
|
+
const { path, code, message } = issue ?? {};
|
|
19
|
+
return {
|
|
20
|
+
path: Array.isArray(path) ? path.map(toPublicPathSegment) : [],
|
|
21
|
+
...typeof code === "string" ? { code } : {},
|
|
22
|
+
message: PUBLIC_MESSAGE_CODES.has(code) && typeof message === "string" && message ? message : "Invalid value"
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function toPublicPathSegment(segment) {
|
|
27
|
+
const key = segment && typeof segment === "object" && "key" in segment ? segment.key : segment;
|
|
28
|
+
if (typeof key === "number") return key;
|
|
29
|
+
if (typeof key === "symbol") return key.description || key.toString();
|
|
30
|
+
return String(key);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
parseRouteSchema,
|
|
35
|
+
toPublicValidationIssues
|
|
36
|
+
};
|