@farm.js/core 0.1.67 → 0.1.69
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-DWyWkTSy.d.mts → agent-mcp.d-DOfBMEzP.d.mts} +1 -1
- package/dist/{agent-mcp.d-BFu9xHAi.d.ts → agent-mcp.d-DnIgriX1.d.ts} +1 -1
- package/dist/agent-runtime.d.mts +5 -3
- package/dist/agent-runtime.d.ts +5 -3
- package/dist/{analyzer-TTIIXXMQ.mjs → analyzer-NAL5TJUP.mjs} +2 -2
- package/dist/analyzer-SAJSV6SP.cjs +16 -0
- package/dist/api/node.d.mts +7 -5
- package/dist/api/node.d.ts +7 -5
- package/dist/api/route-manager.d.mts +7 -5
- package/dist/api/route-manager.d.ts +7 -5
- package/dist/api/runtime.d.mts +6 -4
- package/dist/api/runtime.d.ts +6 -4
- package/dist/api.cjs +2 -2
- package/dist/api.d.mts +8 -23
- package/dist/api.d.ts +8 -23
- package/dist/api.mjs +1 -1
- package/dist/{app-manifest.d-CwfhGrVR.d.ts → app-manifest.d-CaAcaukR.d.ts} +1 -1
- package/dist/{app-manifest.d-CRmjN5j9.d.mts → app-manifest.d-_BVbI0xp.d.mts} +1 -1
- package/dist/app-markdown.cjs +3 -3
- package/dist/app-markdown.d.mts +10 -10
- package/dist/app-markdown.d.ts +10 -10
- package/dist/app-markdown.mjs +2 -2
- package/dist/{app.d-BX9LVTiP.d.ts → app.d-BWeDqOaF.d.ts} +6 -6
- package/dist/{app.d-uBBUxwyV.d.mts → app.d-CaPwtytN.d.mts} +6 -6
- package/dist/{base-path.d-BOUV5ozD.d.mts → base-path.d-CTDVF0Fc.d.mts} +2 -1
- package/dist/{base-path.d-BOUV5ozD.d.ts → base-path.d-CTDVF0Fc.d.ts} +2 -1
- package/dist/{chunk-HM7AGSKU.cjs → chunk-22LGTSBA.cjs} +1 -1
- package/dist/{chunk-4JX3M4C6.cjs → chunk-23VJEGKC.cjs} +2 -1
- package/dist/{chunk-V5MQMQ2P.mjs → chunk-2P7UYHZP.mjs} +1 -1
- package/dist/{chunk-Q37INCXG.cjs → chunk-3EEINK7G.cjs} +11 -2
- package/dist/{chunk-BRWIVOV4.cjs → chunk-3GNHJ3RN.cjs} +10 -8
- package/dist/{chunk-QJVW76JG.mjs → chunk-3Y52TWYU.mjs} +2 -2
- package/dist/{chunk-OB3IFUK6.cjs → chunk-437QZIC2.cjs} +4 -4
- package/dist/{chunk-DCXSIEFE.cjs → chunk-4JRAMCUP.cjs} +59 -38
- package/dist/{chunk-Q5UX55YA.cjs → chunk-4W4ZWSV2.cjs} +887 -485
- package/dist/{chunk-JWSI5WO4.mjs → chunk-4ZXKYCYK.mjs} +1 -1
- package/dist/{chunk-N35YPV4N.mjs → chunk-57QAQU4F.mjs} +9 -7
- package/dist/{chunk-AQDLVHNF.mjs → chunk-5FBZJJGA.mjs} +17 -0
- package/dist/{chunk-HP2DQGQH.mjs → chunk-5TOWKGV3.mjs} +1 -1
- package/dist/{chunk-556H7JCE.cjs → chunk-6GQJVY4E.cjs} +32 -27
- package/dist/{chunk-PL6RTBDE.cjs → chunk-ABIBASLJ.cjs} +2 -2
- package/dist/{chunk-H37MDCPR.mjs → chunk-ANMIR6US.mjs} +1 -1
- package/dist/{chunk-DQJ2CIH7.cjs → chunk-ASYOWPSR.cjs} +2 -1
- package/dist/{chunk-QGJ4FI2G.mjs → chunk-C6HGUTXB.mjs} +113 -29
- package/dist/{chunk-UHNSY2PQ.mjs → chunk-CKCKCUYO.mjs} +826 -424
- package/dist/{chunk-IRA2CZAY.mjs → chunk-CRVSYDHV.mjs} +2 -2
- package/dist/{chunk-2ZOYOYEE.mjs → chunk-D5F7RPZP.mjs} +71 -1
- package/dist/{chunk-N5DQMOAG.cjs → chunk-DHR2WDSL.cjs} +275 -92
- package/dist/{chunk-QGQP6QKO.cjs → chunk-DWLNLU55.cjs} +2 -2
- package/dist/{chunk-52Y3C3HG.mjs → chunk-E7VF3LQ5.mjs} +3 -2
- package/dist/{chunk-V5RTHYJB.cjs → chunk-F6YLXK5L.cjs} +93 -25
- package/dist/{chunk-HNVAZGQD.cjs → chunk-FJMC24KG.cjs} +2 -2
- package/dist/{chunk-KCY52OUQ.cjs → chunk-FSODPZRT.cjs} +1 -1
- package/dist/{chunk-PPX7UOFY.cjs → chunk-FVYBEMOD.cjs} +55 -38
- package/dist/{chunk-6YBYX4K4.mjs → chunk-G7NBPP7H.mjs} +1 -1
- package/dist/{chunk-HFHJJXSV.mjs → chunk-GFPS7MNE.mjs} +1 -1
- package/dist/{chunk-LPIZMU7D.cjs → chunk-GQ6QOH7T.cjs} +9 -5
- package/dist/{chunk-BZWTBELF.cjs → chunk-GTQOEEE7.cjs} +77 -7
- package/dist/{chunk-6V5YWI4W.cjs → chunk-GUMKIQJL.cjs} +2 -2
- package/dist/{chunk-3T5TLFCQ.mjs → chunk-HEJM46HQ.mjs} +11 -2
- package/dist/{chunk-F43OG25P.cjs → chunk-I7J5RLGO.cjs} +15 -1
- package/dist/chunk-ICFPTHXM.mjs +97 -0
- package/dist/{chunk-WGHY3OL5.mjs → chunk-IYLZZTP6.mjs} +233 -50
- package/dist/{chunk-WUTFJOV7.cjs → chunk-JFPKARWM.cjs} +16 -8
- package/dist/{chunk-TEG6HJVF.mjs → chunk-JL2YW5KX.mjs} +1 -0
- package/dist/{chunk-23PVOIPT.cjs → chunk-L5OZN6YW.cjs} +3 -3
- package/dist/{chunk-QITSS4TD.cjs → chunk-L6NWQ3DR.cjs} +537 -356
- package/dist/{chunk-3T7ALZJF.cjs → chunk-LR4KP3I7.cjs} +2 -2
- package/dist/{chunk-CO3YMZFD.mjs → chunk-MAGFDK4Q.mjs} +1 -1
- package/dist/{chunk-VFXE6NWR.mjs → chunk-MGKWYPE3.mjs} +2 -1
- package/dist/{chunk-5TA63JD3.mjs → chunk-MGZVDX4R.mjs} +1 -1
- package/dist/{chunk-6SQZXRJ2.cjs → chunk-MMDKYJ5V.cjs} +7 -7
- package/dist/{chunk-5Y2P454O.cjs → chunk-MTBDJ326.cjs} +6 -5
- package/dist/{chunk-XUES6OET.mjs → chunk-MV7NWU23.mjs} +1 -1
- package/dist/{chunk-4IHMHFQB.cjs → chunk-NG2EZ6QS.cjs} +28 -1
- package/dist/{chunk-F7JKVHU2.mjs → chunk-NVOMQLI2.mjs} +15 -1
- package/dist/{chunk-5IQ2ERQA.cjs → chunk-O47W53D3.cjs} +1 -1
- package/dist/{chunk-22IWL4YD.cjs → chunk-OCNV4CI2.cjs} +21 -2
- package/dist/{chunk-3TXKFRSO.mjs → chunk-OEL5EPOJ.mjs} +1 -1
- package/dist/{chunk-E6CD45JK.mjs → chunk-PDQ6EGPK.mjs} +26 -5
- package/dist/{chunk-VK54PDQ6.mjs → chunk-PEYDQMSA.mjs} +86 -18
- package/dist/{chunk-KSZK34HU.mjs → chunk-PJQ5W356.mjs} +16 -8
- package/dist/{chunk-72KCTHLV.cjs → chunk-PRL7FXG4.cjs} +113 -29
- package/dist/{chunk-JSOCDYER.cjs → chunk-Q4HH5Q6A.cjs} +15 -1
- package/dist/{chunk-YVTS3S3F.cjs → chunk-QOGIZKSO.cjs} +3 -3
- package/dist/{chunk-DB2HSHQA.cjs → chunk-QSUYB3RH.cjs} +14 -14
- package/dist/{chunk-724MGMIL.mjs → chunk-R2ZHU37O.mjs} +19 -0
- package/dist/{chunk-YQYTQJZN.mjs → chunk-RLH5AH2M.mjs} +1 -1
- package/dist/{chunk-WDD5CTZW.mjs → chunk-SZORL7EW.mjs} +24 -19
- package/dist/{chunk-6R53ZWX2.cjs → chunk-TKYOJ5G2.cjs} +3 -3
- package/dist/{chunk-XNZWMXCF.mjs → chunk-UHU4QALN.mjs} +330 -149
- package/dist/{chunk-J7JHVCWA.cjs → chunk-UKZ6AWKZ.cjs} +2 -1
- package/dist/{chunk-GTV2ABO7.mjs → chunk-ULMXZYOA.mjs} +162 -33
- package/dist/{chunk-4DRINDGN.cjs → chunk-VO65MYJD.cjs} +254 -125
- package/dist/chunk-W44X6IC2.cjs +97 -0
- package/dist/{chunk-UHE5JUKB.mjs → chunk-XCAQTCGK.mjs} +1 -1
- package/dist/{chunk-DGOFR7D5.cjs → chunk-Y6KHPJDB.cjs} +2 -2
- package/dist/{chunk-DXZ57EPE.mjs → chunk-YOHHL2UE.mjs} +14 -0
- package/dist/{chunk-KWFNUODD.mjs → chunk-YVPX5PI5.mjs} +1 -0
- package/dist/{chunk-HRPTMX5C.mjs → chunk-ZR2QB45W.mjs} +7 -3
- package/dist/{chunk-JVM3DKZE.mjs → chunk-ZYCEEE3V.mjs} +1 -1
- package/dist/{chunk-5FE5YT2N.mjs → chunk-ZZGQD3LL.mjs} +28 -1
- package/dist/{client-component.d-DWRKyAp5.d.ts → client-component.d-CfJxuXZl.d.ts} +2 -2
- package/dist/{client-component.d-CDRvRmbU.d.mts → client-component.d-CnEeVvGG.d.mts} +2 -2
- package/dist/{client-plugins.d-CrKZiNSN.d.ts → client-plugins.d-D7dHV1Nf.d.ts} +37 -236
- package/dist/{client-plugins.d-BNILjfX3.d.mts → client-plugins.d-Do5ULA0x.d.mts} +37 -236
- package/dist/client-plugins.d.mts +5 -3
- package/dist/client-plugins.d.ts +5 -3
- package/dist/client.cjs +6 -6
- package/dist/client.d.mts +10 -8
- package/dist/client.d.ts +10 -8
- package/dist/client.mjs +5 -5
- package/dist/config.d.mts +5 -3
- package/dist/config.d.ts +5 -3
- package/dist/deployment.cjs +4 -2
- package/dist/deployment.d.mts +15 -1
- package/dist/deployment.d.ts +15 -1
- package/dist/deployment.mjs +3 -1
- package/dist/desktop.d.mts +6 -4
- package/dist/desktop.d.ts +6 -4
- package/dist/{devtools-RZVT4JVN.cjs → devtools-7HNDS4SY.cjs} +7 -7
- package/dist/{devtools-UFQYT3VA.mjs → devtools-BP4EBTKQ.mjs} +6 -6
- package/dist/docs.cjs +11 -9
- package/dist/docs.d.mts +19 -5
- package/dist/docs.d.ts +19 -5
- package/dist/docs.mjs +11 -9
- package/dist/environment/vite.cjs +5 -5
- package/dist/environment/vite.d.mts +1 -1
- package/dist/environment/vite.d.ts +1 -1
- package/dist/environment/vite.mjs +4 -4
- package/dist/{generate-route-types.d-BL2pq6xC.d.ts → generate-route-types.d-B76M5R11.d.ts} +1 -1
- package/dist/{generate-route-types.d-BoVDU8qX.d.mts → generate-route-types.d-CaGMIaNI.d.mts} +1 -1
- package/dist/image/server.cjs +2 -2
- package/dist/image/server.mjs +1 -1
- package/dist/image/sharp.cjs +9 -9
- package/dist/image/sharp.mjs +1 -1
- package/dist/index.cjs +45 -39
- package/dist/{index.d-Bdm6866n.d.mts → index.d-B1MpEJAo.d.mts} +1 -1
- package/dist/{index.d-Dey5T14f.d.ts → index.d-CVFk37uX.d.ts} +1 -1
- package/dist/index.d.mts +26 -23
- package/dist/index.d.ts +26 -23
- package/dist/index.mjs +48 -42
- package/dist/instrumentation.cjs +3 -3
- package/dist/instrumentation.mjs +2 -2
- package/dist/integrations/orm.d.mts +5 -3
- package/dist/integrations/orm.d.ts +5 -3
- package/dist/integrations.d.mts +5 -3
- package/dist/integrations.d.ts +5 -3
- 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 +34 -32
- package/dist/internal/build-runtime.d.mts +7 -5
- package/dist/internal/build-runtime.d.ts +7 -5
- package/dist/internal/build-runtime.mjs +33 -31
- package/dist/internal/cli-runtime.cjs +10 -10
- package/dist/internal/cli-runtime.mjs +9 -9
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +31 -36
- package/dist/internal/client-runtime.d.mts +9 -7
- package/dist/internal/client-runtime.d.ts +9 -7
- package/dist/internal/client-runtime.mjs +22 -27
- package/dist/internal/compression-runtime.d.mts +5 -3
- package/dist/internal/compression-runtime.d.ts +5 -3
- package/dist/internal/config-runtime.cjs +8 -8
- package/dist/internal/config-runtime.d.mts +9 -7
- package/dist/internal/config-runtime.d.ts +9 -7
- package/dist/internal/config-runtime.mjs +7 -7
- package/dist/internal/form-actions.cjs +7 -2
- package/dist/internal/form-actions.d.mts +10 -3
- package/dist/internal/form-actions.d.ts +10 -3
- package/dist/internal/form-actions.mjs +8 -3
- package/dist/internal/infra-analytics-runtime.cjs +6 -6
- package/dist/internal/infra-analytics-runtime.mjs +4 -4
- package/dist/internal/islands-boot.cjs +6 -1
- package/dist/internal/islands-boot.mjs +6 -1
- package/dist/internal/native-server-fns.cjs +4 -4
- package/dist/internal/native-server-fns.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-node-env.cjs +4 -2
- package/dist/internal/production-node-env.d.mts +22 -1
- package/dist/internal/production-node-env.d.ts +22 -1
- package/dist/internal/production-node-env.mjs +3 -1
- package/dist/internal/production-runtime.cjs +17 -9
- package/dist/internal/production-runtime.d.mts +31 -19
- package/dist/internal/production-runtime.d.ts +31 -19
- package/dist/internal/production-runtime.mjs +18 -10
- package/dist/internal/server-tree.cjs +2 -2
- package/dist/internal/server-tree.d.mts +0 -5
- package/dist/internal/server-tree.d.ts +0 -5
- package/dist/internal/server-tree.mjs +1 -1
- package/dist/internal/vercel-edge-middleware.cjs +87 -0
- package/dist/internal/vercel-edge-middleware.d.mts +39 -0
- package/dist/internal/vercel-edge-middleware.d.ts +39 -0
- package/dist/internal/vercel-edge-middleware.mjs +87 -0
- package/dist/layers-7P4RLKVX.cjs +20 -0
- package/dist/{layers-T55SA47E.mjs → layers-XQ7VFMWO.mjs} +4 -2
- package/dist/{layers.d-CcS42OGR.d.mts → layers.d-CH0bC4QL.d.mts} +2 -1
- package/dist/{layers.d-CcS42OGR.d.ts → layers.d-CH0bC4QL.d.ts} +2 -1
- package/dist/markdown.d.mts +5 -3
- package/dist/markdown.d.ts +5 -3
- package/dist/middleware.cjs +4 -4
- package/dist/middleware.d.mts +8 -5
- package/dist/middleware.d.ts +8 -5
- package/dist/middleware.mjs +6 -6
- package/dist/mobile.d.mts +4 -4
- package/dist/mobile.d.ts +4 -4
- package/dist/{mount.d-BP0nLYQO.d.mts → mount.d-CBqr-LfI.d.mts} +1 -1
- package/dist/{mount.d-CkiPky_F.d.ts → mount.d-CGzN61Kq.d.ts} +1 -1
- package/dist/{navigation-delegate.d-CdBP-hkZ.d.mts → navigation-delegate.d-BwCOhpj7.d.mts} +1 -1
- package/dist/{navigation-delegate.d-DchcGzAQ.d.ts → navigation-delegate.d-CLH2dXjy.d.ts} +1 -1
- package/dist/navigation.cjs +5 -5
- package/dist/navigation.d.mts +8 -6
- package/dist/navigation.d.ts +8 -6
- package/dist/navigation.mjs +4 -4
- package/dist/{nitro-55YOZWRA.mjs → nitro-NSTXT7LB.mjs} +2 -2
- package/dist/{nitro-EEX2J3KB.cjs → nitro-Y3LGITW3.cjs} +4 -4
- package/dist/node-module-bundle-LIZ2KMVW.cjs +13 -0
- package/dist/node-module-bundle-VR6NV6AI.mjs +13 -0
- package/dist/{plugin-WIU4GDD4.cjs → plugin-F2O4BFTK.cjs} +2 -2
- package/dist/{plugin-SAS22JL7.mjs → plugin-VEBRN7A3.mjs} +1 -1
- package/dist/plugin.cjs +23 -23
- package/dist/plugin.d.mts +7 -5
- package/dist/plugin.d.ts +7 -5
- package/dist/plugin.mjs +22 -22
- package/dist/{production-runtime.d-Dou_Htas.d.ts → production-runtime.d-BMyyLGBB.d.ts} +3 -57
- package/dist/{production-runtime.d-VwsBzIee.d.mts → production-runtime.d-DMZY3OgV.d.mts} +3 -57
- package/dist/query/client.cjs +6 -6
- package/dist/query/client.mjs +2 -2
- package/dist/{render-plan.d-LKymStDJ.d.mts → render-plan.d-CzGDjcT0.d.mts} +1 -1
- package/dist/{render-plan.d-D8UakAIk.d.ts → render-plan.d-W6LmjD6y.d.ts} +1 -1
- package/dist/renderer/react/server.cjs +2 -2
- package/dist/renderer/react/server.mjs +1 -1
- package/dist/renderer-client.cjs +5 -5
- package/dist/renderer-client.d.mts +8 -6
- package/dist/renderer-client.d.ts +8 -6
- package/dist/renderer-client.mjs +2 -2
- package/dist/renderer.d.mts +5 -0
- package/dist/renderer.d.ts +5 -0
- package/dist/{request.d-B928QjWy.d.ts → request.d-CTVRZiQv.d.ts} +1 -1
- package/dist/{request.d-KG-4d2eG.d.mts → request.d-CgNVderU.d.mts} +1 -1
- package/dist/request.d.mts +6 -4
- package/dist/request.d.ts +6 -4
- package/dist/{route-rendering.d-NIHQeb4m.d.mts → route-rendering.d-D0bmZVJA.d.mts} +1 -1
- package/dist/{route-rendering.d-DoEe_w9t.d.ts → route-rendering.d-FDSNtCMg.d.ts} +1 -1
- package/dist/{router.d-DYnRHQwz.d.ts → router.d-DZ3ldniI.d.ts} +1 -1
- package/dist/{router.d-B8PkJSGp.d.mts → router.d-GRKm_uAV.d.mts} +1 -1
- package/dist/{routes.d-uUBZyWoK.d.ts → routes.d-9GFFNioh.d.ts} +1 -1
- package/dist/{routes.d-DgZ_jgGG.d.mts → routes.d-CrEy0lJS.d.mts} +1 -1
- package/dist/routes.d.mts +5 -3
- package/dist/routes.d.ts +5 -3
- package/dist/{rsc-pipeline-7K5H2RPH.cjs → rsc-pipeline-J4KKBSCH.cjs} +10 -10
- package/dist/{rsc-pipeline-4OJ5ZQNZ.mjs → rsc-pipeline-PJZOVYSY.mjs} +9 -9
- package/dist/{runtime-X52Q7JFR.cjs → runtime-OLEO5NXF.cjs} +20 -20
- package/dist/{runtime-U7O3HZOZ.mjs → runtime-QDBSE4H6.mjs} +12 -12
- package/dist/{runtime.d-BxQIzwfy.d.mts → runtime.d-DqXihlxm.d.mts} +1 -1
- package/dist/{runtime.d-DP7mEkEF.d.ts → runtime.d-pqFQBU2N.d.ts} +1 -1
- package/dist/server-http.d-rAe7lAQc.d.mts +70 -0
- package/dist/server-http.d-rAe7lAQc.d.ts +70 -0
- package/dist/server-plugins.d.mts +6 -4
- package/dist/server-plugins.d.ts +6 -4
- package/dist/server.cjs +52 -50
- package/dist/server.d-C5FFrZAo.d.ts +57 -0
- package/dist/server.d-DgC8xew5.d.mts +57 -0
- package/dist/server.d.mts +13 -11
- package/dist/server.d.ts +13 -11
- package/dist/server.mjs +31 -29
- package/dist/{spa-router.d-DsFDHTsv.d.ts → spa-router.d-DhOhaQ-7.d.ts} +2 -2
- package/dist/{spa-router.d-BgHPVMhz.d.mts → spa-router.d-Dhvy60p4.d.mts} +2 -2
- package/dist/testing.d.mts +5 -3
- package/dist/testing.d.ts +5 -3
- package/dist/types.d-xCIhyjOq.d.mts +233 -0
- package/dist/types.d-xCIhyjOq.d.ts +233 -0
- package/dist/{utils.d-zxAVcf_V.d.ts → utils.d-BVCMRRau.d.ts} +1 -1
- package/dist/{utils.d-BKyKDBR1.d.mts → utils.d-Q8EHCpkF.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +23 -23
- package/dist/vite.d.mts +10 -8
- package/dist/vite.d.ts +10 -8
- package/dist/vite.mjs +22 -22
- package/dist/workflows.cjs +2 -2
- package/dist/workflows.d.mts +121 -1
- package/dist/workflows.d.ts +121 -1
- package/dist/workflows.mjs +1 -1
- package/package.json +7 -2
- package/dist/analyzer-KVZGVY5Q.cjs +0 -16
- package/dist/chunk-CLFEQGET.cjs +0 -60
- package/dist/chunk-MK5E44WP.mjs +0 -60
- package/dist/layers-DMRXRL7F.cjs +0 -18
- package/dist/node-module-bundle-7JHPPF6B.mjs +0 -11
- package/dist/node-module-bundle-YJGYBOGK.cjs +0 -11
- package/dist/workflows.d-CRMzQZ3k.d.mts +0 -188
- package/dist/workflows.d-CRMzQZ3k.d.ts +0 -188
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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 _chunk3EEINK7Gcjs = require('./chunk-3EEINK7G.cjs');
|
|
4
4
|
|
|
5
5
|
// src/app-markdown.ts
|
|
6
6
|
var _promises = require('fs/promises');
|
|
@@ -8,7 +8,7 @@ var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
|
8
8
|
var _url = require('url');
|
|
9
9
|
async function createFarmMarkdownRouteModuleFromFile(filePath, options = {}) {
|
|
10
10
|
const source = await _promises.readFile.call(void 0, filePath, "utf8");
|
|
11
|
-
return
|
|
11
|
+
return _chunk3EEINK7Gcjs.createFarmMarkdownRouteModule.call(void 0, {
|
|
12
12
|
source,
|
|
13
13
|
filePath,
|
|
14
14
|
components: options.components,
|
|
@@ -345,7 +345,7 @@ async function loadWorkflowModule(filePath, root) {
|
|
|
345
345
|
outDir,
|
|
346
346
|
`workflow-${Date.now()}-${Math.random().toString(36).slice(2)}.mjs`
|
|
347
347
|
);
|
|
348
|
-
const { bundleNodeModule } = await import("./node-module-bundle-
|
|
348
|
+
const { bundleNodeModule } = await import("./node-module-bundle-VR6NV6AI.mjs");
|
|
349
349
|
await bundleNodeModule({
|
|
350
350
|
root,
|
|
351
351
|
entry: filePath,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkQSUYB3RHcjs = require('./chunk-QSUYB3RH.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk437QZIC2cjs = require('./chunk-437QZIC2.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkD22BUQKWcjs = require('./chunk-D22BUQKW.cjs');
|
|
10
10
|
|
|
11
11
|
// src/navigation.ts
|
|
12
12
|
function useRouter2() {
|
|
13
|
-
const router =
|
|
13
|
+
const router = _chunkQSUYB3RHcjs.useRouter.call(void 0, );
|
|
14
14
|
return {
|
|
15
15
|
push: router.push,
|
|
16
16
|
replace: router.replace,
|
|
@@ -18,19 +18,19 @@ function useRouter2() {
|
|
|
18
18
|
forward: router.forward,
|
|
19
19
|
refresh() {
|
|
20
20
|
if (typeof window === "undefined") return Promise.resolve();
|
|
21
|
-
return
|
|
21
|
+
return _chunk437QZIC2cjs.getRouter.call(void 0, ).refresh();
|
|
22
22
|
},
|
|
23
23
|
prefetch(href) {
|
|
24
24
|
if (typeof window === "undefined") return Promise.resolve();
|
|
25
|
-
return
|
|
25
|
+
return _chunk437QZIC2cjs.getRouter.call(void 0, ).prefetch(_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, href));
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
function usePathname() {
|
|
30
|
-
return
|
|
30
|
+
return _chunkQSUYB3RHcjs.useRouter.call(void 0, ).pathname;
|
|
31
31
|
}
|
|
32
32
|
function useSearchParams() {
|
|
33
|
-
return
|
|
33
|
+
return _chunkQSUYB3RHcjs.useRouter.call(void 0, ).searchParams;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkASYOWPSRcjs = require('./chunk-ASYOWPSR.cjs');
|
|
6
6
|
|
|
7
7
|
// src/layers.ts
|
|
8
8
|
var _fs = require('fs');
|
|
@@ -157,8 +157,8 @@ function createFarmConfigResolutionPlugin(options) {
|
|
|
157
157
|
kind: extraOptions.kind,
|
|
158
158
|
skipSelf: true
|
|
159
159
|
});
|
|
160
|
-
if (!_optionalChain([resolved, 'optionalAccess', _ => _.id]) || !
|
|
161
|
-
return await _asyncNullishCoalesce(await
|
|
160
|
+
if (!_optionalChain([resolved, 'optionalAccess', _ => _.id]) || !_chunkASYOWPSRcjs.isDeclarationFile.call(void 0, resolved.id)) return _optionalChain([resolved, 'optionalAccess', _2 => _2.id]);
|
|
161
|
+
return await _asyncNullishCoalesce(await _chunkASYOWPSRcjs.resolvePackageWithoutTsconfig.call(void 0, specifier, importer, extraOptions.kind), async () => ( void 0));
|
|
162
162
|
};
|
|
163
163
|
if (source === FARM_CORE_PACKAGE && extraOptions.kind === "import-statement") {
|
|
164
164
|
let configEntryCheck = configEntryChecks.get(importer);
|
|
@@ -191,7 +191,7 @@ async function loadFarmConfigFile(configPath, options) {
|
|
|
191
191
|
configCacheDir,
|
|
192
192
|
`farm-config-${Date.now()}-${Math.random().toString(36).slice(2)}.mjs`
|
|
193
193
|
);
|
|
194
|
-
await
|
|
194
|
+
await _chunkASYOWPSRcjs.bundleNodeModule.call(void 0, {
|
|
195
195
|
root: _path2.default.resolve(options.root),
|
|
196
196
|
entry: _path2.default.resolve(configPath),
|
|
197
197
|
outfile: modulePath,
|
|
@@ -418,4 +418,5 @@ function normalizeRealPath(value) {
|
|
|
418
418
|
|
|
419
419
|
|
|
420
420
|
|
|
421
|
-
|
|
421
|
+
|
|
422
|
+
exports.resolveFarmLayers = resolveFarmLayers; exports.getFarmSourceRoots = getFarmSourceRoots; exports.getFarmAppDirectories = getFarmAppDirectories; exports.getFarmLayerAliases = getFarmLayerAliases; exports.createFarmConfigResolutionPlugin = createFarmConfigResolutionPlugin; exports.loadFarmConfigFile = loadFarmConfigFile; exports.findFarmConfigFile = findFarmConfigFile;
|
|
@@ -443,6 +443,33 @@ async function withProductionNodeEnv(operation) {
|
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
|
+
var REACT_RUNTIME_DIRECTORIES = [
|
|
447
|
+
"/node_modules/react/",
|
|
448
|
+
"/node_modules/react-dom/",
|
|
449
|
+
"/node_modules/react-server-dom-webpack/",
|
|
450
|
+
"/node_modules/@vitejs/plugin-rsc/dist/vendor/react-server-dom/"
|
|
451
|
+
];
|
|
452
|
+
function createReactProductionModePlugin() {
|
|
453
|
+
const nodeEnvExpression = ["process", "env", "NODE_ENV"].join(".");
|
|
454
|
+
return {
|
|
455
|
+
name: "farm-react-production-mode",
|
|
456
|
+
transform: {
|
|
457
|
+
filter: {
|
|
458
|
+
id: /\/node_modules\/(?:react(?:-dom|-server-dom-webpack)?|@vitejs\/plugin-rsc\/dist\/vendor\/react-server-dom)\//,
|
|
459
|
+
code: new RegExp(nodeEnvExpression.replace(/\./g, "\\."))
|
|
460
|
+
},
|
|
461
|
+
handler(code, id) {
|
|
462
|
+
const normalizedId = id.replace(/\\/g, "/");
|
|
463
|
+
const isReactRuntime = REACT_RUNTIME_DIRECTORIES.some(
|
|
464
|
+
(directory) => normalizedId.includes(directory)
|
|
465
|
+
);
|
|
466
|
+
if (!isReactRuntime || !code.includes(nodeEnvExpression)) return null;
|
|
467
|
+
return { code: code.split(nodeEnvExpression).join('"production"'), map: null };
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
|
|
446
473
|
|
|
447
474
|
|
|
448
475
|
|
|
@@ -455,4 +482,4 @@ async function withProductionNodeEnv(operation) {
|
|
|
455
482
|
|
|
456
483
|
|
|
457
484
|
|
|
458
|
-
exports.FARM_NODE_ENV_MODULE_FILE = FARM_NODE_ENV_MODULE_FILE; exports.FARM_NODE_ENV_MODULE_SOURCE = FARM_NODE_ENV_MODULE_SOURCE; exports.FARM_DESKTOP_ENV_MODULE_FILE = FARM_DESKTOP_ENV_MODULE_FILE; exports.FARM_DESKTOP_ENV_MODULE_SOURCE = FARM_DESKTOP_ENV_MODULE_SOURCE; exports.FARM_SERVER_MODULE_FILE = FARM_SERVER_MODULE_FILE; exports.FARM_COMPILE_CACHE_DIR = FARM_COMPILE_CACHE_DIR; exports.createFarmCompileCacheLauncher = createFarmCompileCacheLauncher; exports.createFarmNodeServerEntry = createFarmNodeServerEntry; exports.createFarmBunServerEntry = createFarmBunServerEntry; exports.withProductionNodeEnv = withProductionNodeEnv;
|
|
485
|
+
exports.FARM_NODE_ENV_MODULE_FILE = FARM_NODE_ENV_MODULE_FILE; exports.FARM_NODE_ENV_MODULE_SOURCE = FARM_NODE_ENV_MODULE_SOURCE; exports.FARM_DESKTOP_ENV_MODULE_FILE = FARM_DESKTOP_ENV_MODULE_FILE; exports.FARM_DESKTOP_ENV_MODULE_SOURCE = FARM_DESKTOP_ENV_MODULE_SOURCE; exports.FARM_SERVER_MODULE_FILE = FARM_SERVER_MODULE_FILE; exports.FARM_COMPILE_CACHE_DIR = FARM_COMPILE_CACHE_DIR; exports.createFarmCompileCacheLauncher = createFarmCompileCacheLauncher; exports.createFarmNodeServerEntry = createFarmNodeServerEntry; exports.createFarmBunServerEntry = createFarmBunServerEntry; exports.withProductionNodeEnv = withProductionNodeEnv; exports.createReactProductionModePlugin = createReactProductionModePlugin;
|
|
@@ -132,6 +132,19 @@ function readCookie(cookieHeader, name) {
|
|
|
132
132
|
function isSafeRequestMethod(method) {
|
|
133
133
|
return ["GET", "HEAD", "OPTIONS", "QUERY"].includes(method.toUpperCase());
|
|
134
134
|
}
|
|
135
|
+
var CLOUDFLARE_POPULATE_PROCESS_ENV_FLAG = "nodejs_compat_populate_process_env";
|
|
136
|
+
var CLOUDFLARE_DO_NOT_POPULATE_PROCESS_ENV_FLAG = "nodejs_compat_do_not_populate_process_env";
|
|
137
|
+
var CLOUDFLARE_POPULATE_PROCESS_ENV_DATE = "2025-04-01";
|
|
138
|
+
function resolveCloudflareProcessEnvFlags(wrangler) {
|
|
139
|
+
const date = wrangler.compatibility_date;
|
|
140
|
+
const flags = wrangler.compatibility_flags;
|
|
141
|
+
if (typeof date !== "string" || date >= CLOUDFLARE_POPULATE_PROCESS_ENV_DATE) return void 0;
|
|
142
|
+
if (!Array.isArray(flags) || !flags.includes("nodejs_compat")) return void 0;
|
|
143
|
+
if (flags.includes(CLOUDFLARE_POPULATE_PROCESS_ENV_FLAG) || flags.includes(CLOUDFLARE_DO_NOT_POPULATE_PROCESS_ENV_FLAG)) {
|
|
144
|
+
return void 0;
|
|
145
|
+
}
|
|
146
|
+
return [...flags, CLOUDFLARE_POPULATE_PROCESS_ENV_FLAG];
|
|
147
|
+
}
|
|
135
148
|
|
|
136
149
|
export {
|
|
137
150
|
FARM_DEPLOYMENT_ID_HEADER,
|
|
@@ -150,5 +163,6 @@ export {
|
|
|
150
163
|
getFarmResponseDeploymentId,
|
|
151
164
|
isFarmDeploymentMismatchResponse,
|
|
152
165
|
createFarmDeploymentMismatchError,
|
|
153
|
-
createFarmDeploymentCookie
|
|
166
|
+
createFarmDeploymentCookie,
|
|
167
|
+
resolveCloudflareProcessEnvFlags
|
|
154
168
|
};
|
|
@@ -315,7 +315,7 @@ async function validateImageSourceUrl(sourceUrl, requestOrigin, trustedLocalOrig
|
|
|
315
315
|
if (sourceUrl.username || sourceUrl.password || sourceUrl.hash) {
|
|
316
316
|
throw new FarmImageRequestError("DISALLOWED_SOURCE", 400, "Unsafe image source URL");
|
|
317
317
|
}
|
|
318
|
-
const isLocalSource = sourceUrl.origin ===
|
|
318
|
+
const isLocalSource = sourceUrl.origin === (_nullishCoalesce(trustedLocalOrigin, () => ( requestOrigin)));
|
|
319
319
|
if (isLocalSource) {
|
|
320
320
|
if (sourceUrl.pathname === config.path || !matchesLocalPatterns(sourceUrl, config.localPatterns)) {
|
|
321
321
|
throw new FarmImageRequestError(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
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
3
|
|
|
4
4
|
var _chunkIUKBPBM7cjs = require('./chunk-IUKBPBM7.cjs');
|
|
@@ -10,6 +10,10 @@ var _chunkPWKAX5MScjs = require('./chunk-PWKAX5MS.cjs');
|
|
|
10
10
|
|
|
11
11
|
var _chunk7JUIK547cjs = require('./chunk-7JUIK547.cjs');
|
|
12
12
|
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
var _chunkD22BUQKWcjs = require('./chunk-D22BUQKW.cjs');
|
|
16
|
+
|
|
13
17
|
// src/route-rules.ts
|
|
14
18
|
function normalizeRouteRules(routeRules) {
|
|
15
19
|
if (!routeRules) return {};
|
|
@@ -102,6 +106,20 @@ function routeRulesToNitroRouteRules(routeRules) {
|
|
|
102
106
|
}
|
|
103
107
|
return nitroRules;
|
|
104
108
|
}
|
|
109
|
+
function nitroRouteRulesBelowBasePath(nitroRules, basePath, apiServerBasePath) {
|
|
110
|
+
const prefix = _chunkD22BUQKWcjs.normalizeFarmBasePath.call(void 0, basePath);
|
|
111
|
+
if (!prefix) return nitroRules;
|
|
112
|
+
const isAPISource = (source) => source === apiServerBasePath || source.startsWith(`${apiServerBasePath}/`);
|
|
113
|
+
const rules = { ...nitroRules };
|
|
114
|
+
for (const [source, rule] of Object.entries(nitroRules)) {
|
|
115
|
+
if (isAPISource(source)) continue;
|
|
116
|
+
const publicSource = _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, source, prefix);
|
|
117
|
+
if (publicSource in nitroRules) continue;
|
|
118
|
+
const to = _optionalChain([rule, 'access', _ => _.redirect, 'optionalAccess', _2 => _2.to]);
|
|
119
|
+
rules[publicSource] = typeof to === "string" && to.startsWith("/") && !to.startsWith("//") ? { ...rule, redirect: { ...rule.redirect, to: _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, to, prefix) } } : rule;
|
|
120
|
+
}
|
|
121
|
+
return rules;
|
|
122
|
+
}
|
|
105
123
|
function resolveRouteRuleCorsPreflightHeaders(routeRules, pathname) {
|
|
106
124
|
if (!routeRules) return void 0;
|
|
107
125
|
let cors;
|
|
@@ -152,4 +170,5 @@ function hasExplicitQuery(destination) {
|
|
|
152
170
|
|
|
153
171
|
|
|
154
172
|
|
|
155
|
-
|
|
173
|
+
|
|
174
|
+
exports.normalizeRouteRules = normalizeRouteRules; exports.routeRulesToRedirects = routeRulesToRedirects; exports.routeRulesToHeaders = routeRulesToHeaders; exports.routeRulesToNitroRouteRules = routeRulesToNitroRouteRules; exports.nitroRouteRulesBelowBasePath = nitroRouteRulesBelowBasePath; exports.resolveRouteRuleCorsPreflightHeaders = resolveRouteRuleCorsPreflightHeaders;
|
|
@@ -315,7 +315,7 @@ async function validateImageSourceUrl(sourceUrl, requestOrigin, trustedLocalOrig
|
|
|
315
315
|
if (sourceUrl.username || sourceUrl.password || sourceUrl.hash) {
|
|
316
316
|
throw new FarmImageRequestError("DISALLOWED_SOURCE", 400, "Unsafe image source URL");
|
|
317
317
|
}
|
|
318
|
-
const isLocalSource = sourceUrl.origin ===
|
|
318
|
+
const isLocalSource = sourceUrl.origin === (trustedLocalOrigin ?? requestOrigin);
|
|
319
319
|
if (isLocalSource) {
|
|
320
320
|
if (sourceUrl.pathname === config.path || !matchesLocalPatterns(sourceUrl, config.localPatterns)) {
|
|
321
321
|
throw new FarmImageRequestError(
|
|
@@ -10,14 +10,14 @@ import {
|
|
|
10
10
|
resolveFarmDocsContentDir,
|
|
11
11
|
toFarmDocsMarkdownPage,
|
|
12
12
|
toFarmDocsPublicSitemapConfig
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-5FBZJJGA.mjs";
|
|
14
14
|
import {
|
|
15
15
|
docsEngine,
|
|
16
16
|
loadFarmDocsEngine
|
|
17
17
|
} from "./chunk-VE3FWJBO.mjs";
|
|
18
18
|
import {
|
|
19
19
|
resolveDocsConfig
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-SZORL7EW.mjs";
|
|
21
21
|
import {
|
|
22
22
|
getFarmDocsAdapterConfigModule,
|
|
23
23
|
isSecretDocsConfigKey
|
|
@@ -37,12 +37,24 @@ import { pathToFileURL } from "url";
|
|
|
37
37
|
function hasFarmDocsRuntimeAdapter(docs) {
|
|
38
38
|
return Boolean(docs?.enabled && docs.adapter?.server && docs.adapter.react);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function farmDocsAdapterServesGuardedPages(docs) {
|
|
41
|
+
return Boolean(
|
|
42
|
+
hasFarmDocsRuntimeAdapter(docs) && docs.adapter.capabilities?.includes("guarded-pages")
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
function assertFarmDocsAdapterServesNoGuardedPages(docs, options, isPathGuarded, runtime = "node") {
|
|
41
46
|
if (!isPathGuarded || !hasFarmDocsRuntimeAdapter(docs)) return;
|
|
47
|
+
const servesGuardedPages = farmDocsAdapterServesGuardedPages(docs);
|
|
48
|
+
if (servesGuardedPages && runtime !== "edge") return;
|
|
42
49
|
const guarded = getFarmDocsRoots(docs).flatMap((root) => discoverFarmDocsPages(resolveFarmDocsContentDir(root, options), root)).filter((page) => isPathGuarded(page.href) || isPathGuarded(getFarmDocsMarkdownPath(page.href))).map((page) => page.href);
|
|
43
50
|
if (guarded.length === 0) return;
|
|
51
|
+
if (servesGuardedPages) {
|
|
52
|
+
throw new Error(
|
|
53
|
+
`Docs pages behind a path guard (${guarded.join(", ")}) would be public on an edge target: the docs adapter ${JSON.stringify(docs.adapter.id)} serves a build-time snapshot of their content in llms-full.txt, search, Markdown, and MCP, where no guard runs. Deploy to a Node or serverless target, or move those pages out of the docs content directory.`
|
|
54
|
+
);
|
|
55
|
+
}
|
|
44
56
|
throw new Error(
|
|
45
|
-
`Docs pages behind a path guard (${guarded.join(", ")}) would be public: the docs adapter ${JSON.stringify(docs.adapter.id)} serves their content in llms-full.txt, search, Markdown, and MCP without running the app's guards.
|
|
57
|
+
`Docs pages behind a path guard (${guarded.join(", ")}) would be public: the docs adapter ${JSON.stringify(docs.adapter.id)} serves their content in llms-full.txt, search, Markdown, and MCP without running the app's guards. Upgrade the adapter to a release that keeps guarded pages off those surfaces (@farming-labs/farmjs declares it as the \`guarded-pages\` capability), move those pages out of the docs content directory, or set docs.adapter = false to use Farm's built-in docs runtime, which keeps guarded pages off anonymous surfaces.`
|
|
46
58
|
);
|
|
47
59
|
}
|
|
48
60
|
async function loadFarmDocsConfigModule(docs, loadModule) {
|
|
@@ -143,6 +155,12 @@ async function listFarmDocsAdapterPages(docs, options) {
|
|
|
143
155
|
}
|
|
144
156
|
return [...new Set(pages)];
|
|
145
157
|
}
|
|
158
|
+
async function listFarmDocsPagePaths(docs, options) {
|
|
159
|
+
if (options.adapter) return await listFarmDocsAdapterPages(docs, options) ?? [];
|
|
160
|
+
return getFarmDocsRoots(docs).flatMap(
|
|
161
|
+
(root) => discoverFarmDocsPages(resolveFarmDocsContentDir(root, options), root).map(({ href }) => href)
|
|
162
|
+
);
|
|
163
|
+
}
|
|
146
164
|
async function createFarmDocsAdapterHandler(docs, options) {
|
|
147
165
|
if (!hasFarmDocsRuntimeAdapter(docs)) {
|
|
148
166
|
throw new Error("Farm docs adapter requires server and react runtime entrypoints.");
|
|
@@ -167,7 +185,8 @@ async function createFarmDocsAdapterHandler(docs, options) {
|
|
|
167
185
|
stylesheets: getFarmDocsAdapterStylesheets(options),
|
|
168
186
|
resolveLayoutFonts: options.resolveLayoutFonts,
|
|
169
187
|
loadReactModule: () => options.loadModule(docs.adapter.react),
|
|
170
|
-
...options.registerMCPServer ? { registerMCPServer: options.registerMCPServer } : {}
|
|
188
|
+
...options.registerMCPServer ? { registerMCPServer: options.registerMCPServer } : {},
|
|
189
|
+
...options.isPathGuarded && farmDocsAdapterServesGuardedPages(docs) ? { isPathGuarded: options.isPathGuarded } : {}
|
|
171
190
|
};
|
|
172
191
|
if (multiRoot) {
|
|
173
192
|
return serverModule.createFarmDocsMultiRuntimeHandler(
|
|
@@ -704,10 +723,12 @@ function createFarmDocsAPIHandler(options = {}, cloudIntegration) {
|
|
|
704
723
|
|
|
705
724
|
export {
|
|
706
725
|
hasFarmDocsRuntimeAdapter,
|
|
726
|
+
farmDocsAdapterServesGuardedPages,
|
|
707
727
|
assertFarmDocsAdapterServesNoGuardedPages,
|
|
708
728
|
getFarmDocsConfigModuleRoot,
|
|
709
729
|
compileFarmDocsAdapterEdgeManifest,
|
|
710
730
|
listFarmDocsAdapterPages,
|
|
731
|
+
listFarmDocsPagePaths,
|
|
711
732
|
createFarmDocsAdapterHandler,
|
|
712
733
|
isFarmDocsAPIRequest,
|
|
713
734
|
createDocsAPI,
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FARM_RSC_INSTALL_HINT,
|
|
3
3
|
findFarmAppPackageDir,
|
|
4
|
+
formatFarmRscBlockingMessage,
|
|
5
|
+
inspectFarmServerComponents,
|
|
4
6
|
resolveFarmRscCheckConfig
|
|
5
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3Y52TWYU.mjs";
|
|
6
8
|
import {
|
|
7
9
|
createFarmDevLoopbackPlugin
|
|
8
10
|
} from "./chunk-FN5UEC7I.mjs";
|
|
9
11
|
import {
|
|
10
12
|
resolveDeployOutputPath
|
|
11
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-SZORL7EW.mjs";
|
|
12
14
|
import {
|
|
13
15
|
farmDesktopDevGuardPlugin,
|
|
14
16
|
loadFarmReactPlugin
|
|
15
17
|
} from "./chunk-QOSDWGKT.mjs";
|
|
16
18
|
import {
|
|
17
19
|
generateFarmClientPluginEntryCode,
|
|
20
|
+
hasFarmServerRuntimePlugins,
|
|
18
21
|
loadTailwindVitePlugin
|
|
19
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-YOHHL2UE.mjs";
|
|
20
23
|
import {
|
|
21
24
|
resolveFarmPlatform
|
|
22
25
|
} from "./chunk-SMUW7UST.mjs";
|
|
@@ -34,6 +37,7 @@ var FARM_RSC_CONFIG_KEYS = [
|
|
|
34
37
|
"srcDir",
|
|
35
38
|
"extends",
|
|
36
39
|
"basePath",
|
|
40
|
+
"trailingSlash",
|
|
37
41
|
"api",
|
|
38
42
|
"server",
|
|
39
43
|
"middleware",
|
|
@@ -88,28 +92,42 @@ async function createFarmRscViteConfig(userConfig, options) {
|
|
|
88
92
|
`[Farm.js] experimental.serverComponents runs on @farm.js/plugin and the official @vitejs/plugin-rsc. Install them: ${FARM_RSC_INSTALL_HINT}`
|
|
89
93
|
);
|
|
90
94
|
}
|
|
91
|
-
const
|
|
95
|
+
const layered = await resolveFarmRscCheckConfig(
|
|
96
|
+
userConfig,
|
|
97
|
+
root,
|
|
98
|
+
options.command === "build" ? "production" : "development"
|
|
99
|
+
);
|
|
100
|
+
const config = await configureFarmRscPlugins(
|
|
101
|
+
{
|
|
102
|
+
...userConfig,
|
|
103
|
+
vite: typeof userConfig.vite === "function" ? userConfig.vite({}) : userConfig.vite,
|
|
104
|
+
plugins: layered?.plugins ?? [],
|
|
105
|
+
publicRuntimeConfig: layered?.publicRuntimeConfig ?? {}
|
|
106
|
+
},
|
|
107
|
+
options.command
|
|
108
|
+
);
|
|
109
|
+
const blockingKeys = inspectFarmServerComponents(config, root).blockingKeys;
|
|
110
|
+
if (blockingKeys.length > 0) {
|
|
111
|
+
throw new Error(`[Farm.js] ${formatFarmRscBlockingMessage(blockingKeys)}`);
|
|
112
|
+
}
|
|
113
|
+
const { plugins: vitePlugins = [], ...viteOptions } = config.vite ?? {};
|
|
92
114
|
const rscConfig = {};
|
|
93
115
|
for (const key of FARM_RSC_CONFIG_KEYS) {
|
|
94
|
-
if (
|
|
116
|
+
if (config[key] !== void 0) rscConfig[key] = config[key];
|
|
95
117
|
}
|
|
96
118
|
const createReactPlugin = hasPluginNamed(vitePlugins, "vite:react") ? void 0 : viteReact?.default ?? (options.command === "serve" ? (await loadFarmReactPlugin()).default : void 0);
|
|
97
119
|
const tailwind = hasPluginNamed(vitePlugins, "@tailwindcss/vite") ? void 0 : await loadTailwindVitePlugin();
|
|
98
120
|
const platform = resolveFarmPlatform();
|
|
99
|
-
const mobileClient =
|
|
100
|
-
const layered = await resolveFarmRscCheckConfig(
|
|
101
|
-
userConfig,
|
|
102
|
-
root,
|
|
103
|
-
options.command === "build" ? "production" : "development"
|
|
104
|
-
);
|
|
121
|
+
const mobileClient = config.mobile === void 0 || platform === "desktop" ? void 0 : options.command === "build" ? "entry" : platform === "mobile" ? "inline" : void 0;
|
|
105
122
|
const clientPluginEntry = generateFarmClientPluginEntryCode(
|
|
106
|
-
|
|
123
|
+
config.plugins,
|
|
107
124
|
root,
|
|
108
|
-
typeof
|
|
109
|
-
|
|
125
|
+
typeof config.srcDir === "string" ? config.srcDir : "src",
|
|
126
|
+
config.publicRuntimeConfig ?? {},
|
|
110
127
|
// The RSC entry hands navigations to a mobile shell itself.
|
|
111
128
|
"web"
|
|
112
129
|
);
|
|
130
|
+
const serverPlugins = options.command === "build" ? await resolveFarmRscServerPlugins(userConfig, config, root) : void 0;
|
|
113
131
|
const farmConfig = pluginRsc.defineConfig({
|
|
114
132
|
...rscConfig,
|
|
115
133
|
...mobileClient ? { mobileClient } : {},
|
|
@@ -118,12 +136,16 @@ async function createFarmRscViteConfig(userConfig, options) {
|
|
|
118
136
|
imports: clientPluginEntry.imports,
|
|
119
137
|
registrations: clientPluginEntry.registrations
|
|
120
138
|
},
|
|
121
|
-
|
|
122
|
-
|
|
139
|
+
// Plugins with server hooks load in the production server, as in Farm's other servers, so
|
|
140
|
+
// factories such as `bot()` run there. Dev loaded them with the config already.
|
|
141
|
+
...serverPlugins ? { serverPlugins } : {},
|
|
142
|
+
...options.preset ? { preset: options.preset } : {},
|
|
143
|
+
experimental: { ...config.experimental, serverComponents: { mode: "rsc" } },
|
|
144
|
+
port: options.port ?? config.server?.port,
|
|
123
145
|
plugins: [
|
|
124
146
|
...options.command === "serve" && platform === "desktop" ? [
|
|
125
147
|
farmDesktopDevGuardPlugin(
|
|
126
|
-
typeof
|
|
148
|
+
typeof config.basePath === "string" ? config.basePath : void 0
|
|
127
149
|
)
|
|
128
150
|
] : [],
|
|
129
151
|
...tailwind ? [tailwind] : [],
|
|
@@ -140,7 +162,7 @@ async function createFarmRscViteConfig(userConfig, options) {
|
|
|
140
162
|
]
|
|
141
163
|
});
|
|
142
164
|
for (const key of FARM_RSC_PASSTHROUGH_KEYS) {
|
|
143
|
-
if (
|
|
165
|
+
if (config[key] !== void 0) farmConfig[key] = config[key];
|
|
144
166
|
}
|
|
145
167
|
const { mergeConfig } = await import("vite");
|
|
146
168
|
return {
|
|
@@ -151,6 +173,52 @@ async function createFarmRscViteConfig(userConfig, options) {
|
|
|
151
173
|
mode: options.command === "build" ? "production" : "development"
|
|
152
174
|
};
|
|
153
175
|
}
|
|
176
|
+
async function resolveFarmRscServerPlugins(userConfig, config, root) {
|
|
177
|
+
const kept = config.plugins ?? [];
|
|
178
|
+
const names = new Set(
|
|
179
|
+
kept.filter((plugin) => hasFarmServerRuntimePlugins([plugin])).map((plugin) => plugin.name)
|
|
180
|
+
);
|
|
181
|
+
if (names.size === 0) return void 0;
|
|
182
|
+
const loads = (plugin) => {
|
|
183
|
+
const candidate = plugin;
|
|
184
|
+
return !!candidate && names.has(candidate.name) && hasFarmServerRuntimePlugins([candidate]);
|
|
185
|
+
};
|
|
186
|
+
const { findFarmConfigFile, loadFarmConfigFile, resolveFarmLayers } = await import("./layers-XQ7VFMWO.mjs");
|
|
187
|
+
const files = [];
|
|
188
|
+
if (userConfig.extends) {
|
|
189
|
+
const { layers } = await resolveFarmLayers(userConfig, { root, mode: "production" });
|
|
190
|
+
for (const layer of layers) {
|
|
191
|
+
if (!layer.configFile) continue;
|
|
192
|
+
const layerConfig = await loadFarmConfigFile(layer.configFile, {
|
|
193
|
+
root: layer.root,
|
|
194
|
+
cacheRoot: root
|
|
195
|
+
});
|
|
196
|
+
files.push([layer.configFile, layerConfig.plugins]);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
const configFile = findFarmConfigFile(root);
|
|
200
|
+
if (configFile) files.push([configFile, userConfig.plugins]);
|
|
201
|
+
const selections = {};
|
|
202
|
+
for (const [file, plugins] of files) {
|
|
203
|
+
const entries = Array.isArray(plugins) ? plugins : [plugins];
|
|
204
|
+
const indexes = entries.flatMap(
|
|
205
|
+
(entry, index) => [entry].flat(Infinity).some(loads) ? [index] : []
|
|
206
|
+
);
|
|
207
|
+
if (indexes.length > 0) selections[path.resolve(file)] = { indexes, count: entries.length };
|
|
208
|
+
}
|
|
209
|
+
return Object.keys(selections).length > 0 ? selections : void 0;
|
|
210
|
+
}
|
|
211
|
+
async function configureFarmRscPlugins(config, command) {
|
|
212
|
+
if (config.plugins.length === 0) return config;
|
|
213
|
+
const { PluginManager } = await import("./plugin-VEBRN7A3.mjs");
|
|
214
|
+
const manager = new PluginManager({
|
|
215
|
+
config,
|
|
216
|
+
isDev: command === "serve",
|
|
217
|
+
isProd: command === "build"
|
|
218
|
+
});
|
|
219
|
+
manager.addPlugins(config.plugins);
|
|
220
|
+
return await manager.runHookSerial("config", config);
|
|
221
|
+
}
|
|
154
222
|
async function createFarmRscDevServer(userConfig, options) {
|
|
155
223
|
const { createServer } = await import("vite");
|
|
156
224
|
const { host, ...configOptions } = options;
|
|
@@ -809,6 +809,21 @@ var PluginManager = class {
|
|
|
809
809
|
session.waitUntil
|
|
810
810
|
);
|
|
811
811
|
}
|
|
812
|
+
/**
|
|
813
|
+
* @internal Reports an error the handler answered to `runtime.error` and `onError`, as the
|
|
814
|
+
* runtime scope's `reportError` does, without failing the session: `after` still runs, and a
|
|
815
|
+
* later throw in it is reported too.
|
|
816
|
+
*/
|
|
817
|
+
async reportRuntimeRequestError(session, error) {
|
|
818
|
+
await this.runRuntimeErrorHooks(
|
|
819
|
+
session.request,
|
|
820
|
+
error,
|
|
821
|
+
session.ctx,
|
|
822
|
+
Date.now() - session.startedAt,
|
|
823
|
+
session.options,
|
|
824
|
+
session.waitUntil
|
|
825
|
+
);
|
|
826
|
+
}
|
|
812
827
|
async runRuntimeRequest(request, handler, options = {}) {
|
|
813
828
|
return this.completeRuntimeRequest(await this.beginRuntimeRequest(request, options), handler);
|
|
814
829
|
}
|
|
@@ -822,14 +837,7 @@ var PluginManager = class {
|
|
|
822
837
|
const response = session.response ?? await handler(session.request, {
|
|
823
838
|
// Not a failed session: the handler answers, so `after` runs and a later throw in it
|
|
824
839
|
// is still reported.
|
|
825
|
-
reportError: (error) => this.
|
|
826
|
-
session.request,
|
|
827
|
-
error,
|
|
828
|
-
session.ctx,
|
|
829
|
-
Date.now() - session.startedAt,
|
|
830
|
-
session.options,
|
|
831
|
-
session.waitUntil
|
|
832
|
-
)
|
|
840
|
+
reportError: (error) => this.reportRuntimeRequestError(session, error)
|
|
833
841
|
});
|
|
834
842
|
if (!(response instanceof Response)) {
|
|
835
843
|
throw new TypeError("Farm plugin runtime handlers must return a Response");
|