@farm.js/core 0.1.65 → 0.1.67
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-handler-QLFDDTYN.mjs → agent-mcp-handler-AZ7QW4UP.mjs} +5 -5
- package/dist/{agent-mcp-handler-OXT73ZBY.cjs → agent-mcp-handler-FER4MQDF.cjs} +6 -6
- package/dist/{agent-mcp.d-QD2WZ9BS.d.ts → agent-mcp.d-BFu9xHAi.d.ts} +1 -1
- package/dist/{agent-mcp.d-CO_ABmNK.d.mts → agent-mcp.d-DWyWkTSy.d.mts} +1 -1
- package/dist/agent-runtime.cjs +6 -5
- package/dist/agent-runtime.d.mts +6 -6
- package/dist/agent-runtime.d.ts +6 -6
- package/dist/agent-runtime.mjs +5 -4
- package/dist/analyzer-KVZGVY5Q.cjs +16 -0
- package/dist/{analyzer-PE33SK5W.mjs → analyzer-TTIIXXMQ.mjs} +3 -3
- package/dist/api/client.cjs +12 -2
- package/dist/api/client.d.mts +4 -4
- package/dist/api/client.d.ts +4 -4
- package/dist/api/client.mjs +12 -2
- package/dist/api/client.native.cjs +12 -2
- package/dist/api/client.native.d.mts +5 -5
- package/dist/api/client.native.d.ts +5 -5
- package/dist/api/client.native.mjs +12 -2
- package/dist/api/node.cjs +223 -0
- package/dist/api/node.d.mts +59 -0
- package/dist/api/node.d.ts +59 -0
- package/dist/api/node.mjs +223 -0
- package/dist/api/route-manager.cjs +11 -11
- package/dist/api/route-manager.d.mts +10 -9
- package/dist/api/route-manager.d.ts +10 -9
- package/dist/api/route-manager.mjs +10 -10
- package/dist/api/runtime.cjs +11 -7
- package/dist/api/runtime.d.mts +7 -7
- package/dist/api/runtime.d.ts +7 -7
- package/dist/api/runtime.mjs +10 -6
- package/dist/{api-client.d-BNLXNCXJ.d.mts → api-client.d-Bp35zMqR.d.mts} +1 -1
- package/dist/{api-client.d-ddQBNGtu.d.ts → api-client.d-CFI_xL0V.d.ts} +1 -1
- package/dist/api.cjs +17 -13
- package/dist/api.d.mts +11 -10
- package/dist/api.d.ts +11 -10
- package/dist/api.mjs +16 -12
- package/dist/{app-manifest.d-BpKxiU_E.d.mts → app-manifest.d-CRmjN5j9.d.mts} +1 -1
- package/dist/{app-manifest.d-DDmNkYQQ.d.ts → app-manifest.d-CwfhGrVR.d.ts} +1 -1
- package/dist/app-markdown.cjs +5 -5
- package/dist/app-markdown.d.mts +7 -7
- package/dist/app-markdown.d.ts +7 -7
- package/dist/app-markdown.mjs +4 -4
- package/dist/{app.d-x68Cwr0_.d.ts → app.d-BX9LVTiP.d.ts} +50 -9
- package/dist/{app.d-kuoVWhWM.d.mts → app.d-uBBUxwyV.d.mts} +50 -9
- package/dist/{chunk-V56632LA.cjs → chunk-22IWL4YD.cjs} +19 -5
- package/dist/{chunk-CZF4XIRZ.cjs → chunk-23PVOIPT.cjs} +3 -3
- package/dist/{chunk-5C7XMKQ4.cjs → chunk-2AFW7673.cjs} +6 -1
- package/dist/{chunk-SYW346ZN.cjs → chunk-2LHZD3OP.cjs} +1 -21
- package/dist/{chunk-ZZI56IUY.mjs → chunk-2ZOYOYEE.mjs} +13 -13
- package/dist/{chunk-RVGSVQWT.mjs → chunk-3T5TLFCQ.mjs} +10 -5
- package/dist/{chunk-XBSKPLHF.cjs → chunk-3T7ALZJF.cjs} +2 -2
- package/dist/{chunk-JCEFKP5M.mjs → chunk-423SSBYQ.mjs} +6 -0
- package/dist/{chunk-7QVRWGBL.cjs → chunk-4DRINDGN.cjs} +319 -138
- package/dist/{chunk-O6L3YYPM.cjs → chunk-4E57QHPW.cjs} +8 -16
- package/dist/{chunk-WKPBIT5Q.cjs → chunk-4HGLJOXZ.cjs} +6 -6
- package/dist/{chunk-JGAE5XPL.cjs → chunk-4JX3M4C6.cjs} +2 -1
- package/dist/{chunk-CJNAUEVC.mjs → chunk-4QENVMG7.mjs} +1 -1
- package/dist/{chunk-IMK32ERL.cjs → chunk-556H7JCE.cjs} +65 -48
- package/dist/{chunk-OLIGNTWU.cjs → chunk-5NFQ6AZI.cjs} +7 -7
- package/dist/{chunk-6HRAK7I5.mjs → chunk-5OFNUETM.mjs} +8 -2
- package/dist/{chunk-TZVUF5JJ.mjs → chunk-5TA63JD3.mjs} +4 -4
- package/dist/{chunk-RD623KW4.cjs → chunk-67MZTLTF.cjs} +21 -3
- package/dist/chunk-6I4BFRE7.cjs +51 -0
- package/dist/{chunk-OSFIUSYK.cjs → chunk-6R53ZWX2.cjs} +7 -7
- package/dist/{chunk-MGKW5XZE.cjs → chunk-6SQZXRJ2.cjs} +7 -7
- package/dist/{chunk-WNXVWXG3.cjs → chunk-6V5YWI4W.cjs} +2 -2
- package/dist/{chunk-BM2LH2JM.mjs → chunk-6YBYX4K4.mjs} +13 -12
- package/dist/{chunk-X3XUZWRB.mjs → chunk-724MGMIL.mjs} +17 -3
- package/dist/{chunk-K5EW7GUU.mjs → chunk-7BIW7VCW.mjs} +13 -5
- package/dist/{chunk-HPP2II4Z.mjs → chunk-7PJARAQQ.mjs} +1 -1
- package/dist/{chunk-LEJDW34D.cjs → chunk-7PPLTD3P.cjs} +3 -3
- package/dist/{chunk-TGULJSHD.mjs → chunk-AJNBTOVQ.mjs} +20 -9
- package/dist/{chunk-FBEBSAVI.cjs → chunk-AKIQ54FK.cjs} +82 -63
- package/dist/{chunk-2NGZFOKG.mjs → chunk-AOIUYHPH.mjs} +2 -2
- package/dist/{chunk-ZEXE4TGY.mjs → chunk-AQDLVHNF.mjs} +230 -110
- package/dist/{chunk-NKRZLQUK.mjs → chunk-AQIO3RNL.mjs} +1 -1
- package/dist/chunk-AQIRXBBY.cjs +26 -0
- package/dist/chunk-AZ6IW6SF.mjs +28 -0
- package/dist/{chunk-QMDU6QHN.mjs → chunk-B6RBJJ5G.mjs} +1 -1
- package/dist/{chunk-I32V5CZL.cjs → chunk-BDYM2TN3.cjs} +28 -17
- package/dist/{chunk-JLDNXURZ.cjs → chunk-BZWTBELF.cjs} +32 -32
- package/dist/{chunk-ITV4QQL2.cjs → chunk-C6CUUBY5.cjs} +14 -3
- package/dist/{chunk-V727H3RI.cjs → chunk-CCAUIBIS.cjs} +6 -0
- package/dist/{chunk-YN6BHOYY.cjs → chunk-CL52PD6D.cjs} +10 -3
- package/dist/{chunk-ZX2JHEWW.mjs → chunk-CO3YMZFD.mjs} +20 -9
- package/dist/{chunk-XURDCXNH.cjs → chunk-CSLHNBPS.cjs} +6 -6
- package/dist/{chunk-CNNBFGL5.cjs → chunk-DB2HSHQA.cjs} +14 -14
- package/dist/{chunk-XQSYOVCW.cjs → chunk-DBYNZIIQ.cjs} +13 -5
- package/dist/{chunk-32RPJAAS.cjs → chunk-DCXSIEFE.cjs} +40 -41
- package/dist/{chunk-D4MRNBVF.cjs → chunk-DGOFR7D5.cjs} +2 -2
- package/dist/{chunk-QTD6EMN2.mjs → chunk-DQ2DI3Y7.mjs} +11 -4
- package/dist/chunk-DXZ57EPE.mjs +375 -0
- package/dist/{chunk-SA7MLSP4.mjs → chunk-E3HDJCWF.mjs} +3 -3
- package/dist/{chunk-EFZGB7JC.cjs → chunk-E5UN4OWX.cjs} +1 -0
- package/dist/{chunk-HKNYNSOK.mjs → chunk-E6CD45JK.mjs} +30 -31
- package/dist/{chunk-752XUZIM.cjs → chunk-EGIY4A7V.cjs} +6 -6
- package/dist/chunk-EIVGPQN5.mjs +51 -0
- package/dist/{chunk-KPAJWD3N.mjs → chunk-EYPSKXO4.mjs} +1 -1
- package/dist/{chunk-E552H232.cjs → chunk-F43OG25P.cjs} +1 -1
- package/dist/{chunk-UAQD67HM.mjs → chunk-F7JKVHU2.mjs} +1 -1
- package/dist/{chunk-QISW423S.cjs → chunk-FPBOAG6N.cjs} +2 -2
- package/dist/{chunk-2C5L5RPM.cjs → chunk-FT6KJHS3.cjs} +71 -38
- package/dist/{chunk-ES2LD2YD.mjs → chunk-GCRT6GJG.mjs} +18 -0
- package/dist/{chunk-5OJVKXFV.cjs → chunk-GDM3ZD2O.cjs} +10 -8
- package/dist/{chunk-EMDGXYUD.mjs → chunk-GJ7QVFAG.mjs} +16 -7
- package/dist/{chunk-TGSEVBPO.mjs → chunk-GJEC5S4V.mjs} +11 -0
- package/dist/{chunk-ZAUOOGER.mjs → chunk-GTV2ABO7.mjs} +218 -37
- package/dist/{chunk-72JSHQQQ.mjs → chunk-H37MDCPR.mjs} +1 -1
- package/dist/{chunk-HNAISJFD.cjs → chunk-HDPT6OYE.cjs} +9 -3
- package/dist/{chunk-25T5VXOE.mjs → chunk-HFHJJXSV.mjs} +106 -19
- package/dist/{chunk-ZNH6NR3H.cjs → chunk-HJZZSBVK.cjs} +2 -2
- package/dist/{chunk-A3G5IY2W.cjs → chunk-HM7AGSKU.cjs} +1 -1
- package/dist/{chunk-GL7N5UHF.cjs → chunk-HNVAZGQD.cjs} +20 -9
- package/dist/{chunk-GRBJ7VKH.mjs → chunk-HP2DQGQH.mjs} +1 -1
- package/dist/{chunk-E2TSYUHV.mjs → chunk-HRPTMX5C.mjs} +4 -4
- package/dist/{chunk-K7OZAVOI.mjs → chunk-IFR74W6S.mjs} +46 -13
- package/dist/{chunk-5A77OEIG.cjs → chunk-IHTDLCDJ.cjs} +5 -5
- package/dist/{chunk-VQJHT2ND.mjs → chunk-IRA2CZAY.mjs} +2 -2
- package/dist/{chunk-OYZXVBZP.cjs → chunk-IUKBPBM7.cjs} +2 -1
- package/dist/chunk-J6TZRYCO.cjs +22 -0
- package/dist/{chunk-WYAXRIYP.cjs → chunk-J7JHVCWA.cjs} +8 -8
- package/dist/chunk-JSOCDYER.cjs +375 -0
- package/dist/{chunk-YUW7F6SK.mjs → chunk-JVM3DKZE.mjs} +3 -3
- package/dist/{chunk-UPYIFH2H.cjs → chunk-JWLRBDDC.cjs} +2 -2
- package/dist/{chunk-BQWBHWEW.mjs → chunk-JWSI5WO4.mjs} +1 -1
- package/dist/{chunk-OLGQZRW6.mjs → chunk-JZBU7V4D.mjs} +37 -17
- package/dist/{chunk-ONG4RDW3.mjs → chunk-JZGL2PIH.mjs} +13 -3
- package/dist/chunk-K63OWRY2.mjs +22 -0
- package/dist/{chunk-TUPKMMXT.mjs → chunk-K6HIIWUB.mjs} +1 -1
- package/dist/{chunk-MESQF2JC.mjs → chunk-K6SXMVXO.mjs} +2 -2
- package/dist/{chunk-L2JG337G.cjs → chunk-K6VFYFOY.cjs} +33 -31
- package/dist/{chunk-3CCAICF7.cjs → chunk-KCY52OUQ.cjs} +4 -4
- package/dist/{chunk-EZ34EHQP.mjs → chunk-KI3MU7B5.mjs} +1 -1
- package/dist/{chunk-GHNW564E.mjs → chunk-KSZK34HU.mjs} +30 -10
- package/dist/{chunk-RFKTJTWZ.mjs → chunk-KWFNUODD.mjs} +2 -1
- package/dist/{chunk-ECKQFEX2.mjs → chunk-LENKRGBV.mjs} +8 -6
- package/dist/{chunk-C7DCMGC4.cjs → chunk-LPIZMU7D.cjs} +12 -12
- package/dist/{chunk-HEPJIKKQ.cjs → chunk-MCSRMEQV.cjs} +2 -2
- package/dist/{chunk-DQF3QLOH.mjs → chunk-ME7RVELR.mjs} +3 -2
- package/dist/{chunk-3KJPIO5D.cjs → chunk-N5DQMOAG.cjs} +589 -678
- package/dist/{chunk-O4F3JUST.mjs → chunk-NDDRTFN4.mjs} +4 -0
- package/dist/{chunk-CBOEJ5Z4.cjs → chunk-OB3IFUK6.cjs} +133 -46
- package/dist/{chunk-R62SF5R4.mjs → chunk-OB45EAQL.mjs} +6 -1
- package/dist/{chunk-SYXPWJ7N.cjs → chunk-OFBLGH6V.cjs} +17 -18
- package/dist/{chunk-VQ4NWOWO.mjs → chunk-OGVTUGMU.mjs} +5 -13
- package/dist/{chunk-3UZVPO72.mjs → chunk-OIOPQ25L.mjs} +6 -7
- package/dist/{chunk-2XGBJSDV.cjs → chunk-OO7DYIJD.cjs} +73 -24
- package/dist/{chunk-IP2KHSGF.mjs → chunk-P2NBQ5JI.mjs} +57 -4
- package/dist/{chunk-ZQQK4U66.cjs → chunk-PDFFYZAT.cjs} +72 -19
- package/dist/{chunk-GSVJ3IIF.cjs → chunk-PHCJJJZV.cjs} +2 -2
- package/dist/{chunk-EVMXPJCB.mjs → chunk-PKMUQ7LM.mjs} +2 -1
- package/dist/{chunk-YD4J37RN.cjs → chunk-PL6RTBDE.cjs} +30 -19
- package/dist/{chunk-OAJOQU5J.mjs → chunk-PLJKJJ2H.mjs} +82 -63
- package/dist/{chunk-WMTBBQHY.cjs → chunk-PPX7UOFY.cjs} +271 -151
- package/dist/{chunk-6XQSPIN6.cjs → chunk-PWKAX5MS.cjs} +13 -3
- package/dist/{chunk-7XGWBPQQ.cjs → chunk-Q37INCXG.cjs} +13 -8
- package/dist/{chunk-T4M52BA5.cjs → chunk-Q5UX55YA.cjs} +1457 -612
- package/dist/{chunk-53ZCZ46B.cjs → chunk-QGQP6QKO.cjs} +4 -3
- package/dist/{chunk-TZOGZKI7.cjs → chunk-QITSS4TD.cjs} +1381 -626
- package/dist/{chunk-4ZJ5C7UJ.cjs → chunk-QIXEU2WV.cjs} +19 -10
- package/dist/{chunk-HCGWDRZO.mjs → chunk-QJVW76JG.mjs} +17 -6
- package/dist/{chunk-FJWN7RV4.cjs → chunk-QO43L7Z4.cjs} +38 -8
- package/dist/{chunk-ZIHWAN55.cjs → chunk-RE5E2G5S.cjs} +1 -1
- package/dist/chunk-RWR7SMD7.cjs +50 -0
- package/dist/{chunk-7PTISZSQ.cjs → chunk-S7MWSFFP.cjs} +4 -0
- package/dist/chunk-SD6JGJOM.mjs +50 -0
- package/dist/{chunk-7H4SVNC4.cjs → chunk-SPP3EZTJ.cjs} +46 -26
- package/dist/{chunk-E4RDMG3K.mjs → chunk-TEG6HJVF.mjs} +4 -4
- package/dist/{chunk-WAY6LOQH.mjs → chunk-TEJ67GD2.mjs} +1 -1
- package/dist/{chunk-ZNXTU4YH.mjs → chunk-TM2E623I.mjs} +1 -0
- package/dist/{chunk-IFTGERT3.mjs → chunk-TTXIITYA.mjs} +49 -0
- package/dist/{chunk-ZFWYCVKS.mjs → chunk-TY5KCYDE.mjs} +22 -4
- package/dist/{chunk-W2ZXMMHA.mjs → chunk-UHE5JUKB.mjs} +1 -1
- package/dist/{chunk-6X5NKNBE.mjs → chunk-UHNSY2PQ.mjs} +1304 -459
- package/dist/{chunk-UJ3R2AH2.cjs → chunk-UPOYKX4S.cjs} +5 -5
- package/dist/{chunk-2DLGV2ZG.mjs → chunk-UTUS6JUH.mjs} +1 -21
- package/dist/{chunk-Q75QPLBA.mjs → chunk-V5MQMQ2P.mjs} +1 -1
- package/dist/{chunk-TRIDJQ6A.cjs → chunk-V5RTHYJB.cjs} +30 -10
- package/dist/{chunk-QHRCR44V.mjs → chunk-VK54PDQ6.mjs} +25 -5
- package/dist/{chunk-LQNW3ABP.cjs → chunk-VX2HZGC7.cjs} +14 -14
- package/dist/{chunk-2L54YV25.mjs → chunk-WDD5CTZW.mjs} +49 -32
- package/dist/{chunk-7GYCZRTH.mjs → chunk-WGHY3OL5.mjs} +355 -444
- package/dist/{chunk-A2MN5PQJ.mjs → chunk-WMLSZAKN.mjs} +9 -9
- package/dist/{chunk-3EEET2Q5.cjs → chunk-WUTFJOV7.cjs} +32 -12
- package/dist/chunk-WVQNXXNE.cjs +28 -0
- package/dist/{chunk-Y5TOT5F6.cjs → chunk-X3MHKLCO.cjs} +5 -5
- package/dist/{chunk-Z7P2BTZ3.cjs → chunk-XGTFLG73.cjs} +30 -12
- package/dist/{chunk-VHHLKIDZ.mjs → chunk-XNZWMXCF.mjs} +1090 -335
- package/dist/{chunk-FIR62CR3.mjs → chunk-XUES6OET.mjs} +1 -1
- package/dist/{chunk-XCXHQBMM.mjs → chunk-Y2LU4LE5.mjs} +1 -1
- package/dist/{chunk-5J45H65F.mjs → chunk-Y5LEPEVH.mjs} +1 -1
- package/dist/{chunk-BT4SEFLC.cjs → chunk-YAEN3L2F.cjs} +3 -2
- package/dist/chunk-YFTGIHNC.mjs +26 -0
- package/dist/{chunk-KL7SHLQB.mjs → chunk-YGJ5P3TJ.mjs} +31 -1
- package/dist/{chunk-UYRI6U3P.mjs → chunk-YQYTQJZN.mjs} +3 -2
- package/dist/{chunk-X4K7TYN6.cjs → chunk-YVTS3S3F.cjs} +24 -23
- package/dist/{chunk-72KABRWN.mjs → chunk-ZJGFAW5U.mjs} +5 -3
- package/dist/{chunk-TNBJ4LZG.mjs → chunk-ZPKJPM7K.mjs} +4 -4
- package/dist/client/lifecycle.cjs +2 -2
- package/dist/client/lifecycle.d.mts +1 -1
- package/dist/client/lifecycle.d.ts +1 -1
- package/dist/client/lifecycle.mjs +1 -1
- package/dist/{client-component.d-D74pqdea.d.mts → client-component.d-CDRvRmbU.d.mts} +2 -2
- package/dist/{client-component.d-D8VcypQA.d.ts → client-component.d-DWRKyAp5.d.ts} +2 -2
- package/dist/client-plugins.cjs +2 -2
- package/dist/{client-plugins.d-D4-6hNx7.d.mts → client-plugins.d-BNILjfX3.d.mts} +94 -140
- package/dist/{client-plugins.d-CXElzotB.d.ts → client-plugins.d-CrKZiNSN.d.ts} +94 -140
- package/dist/client-plugins.d.mts +6 -6
- package/dist/client-plugins.d.ts +6 -6
- package/dist/client-plugins.mjs +1 -1
- package/dist/client.cjs +11 -9
- package/dist/client.d.mts +13 -13
- package/dist/client.d.ts +13 -13
- package/dist/client.mjs +10 -8
- package/dist/{config.d-qt-mE8O5.d.mts → config.d-BKIhJtmr.d.mts} +7 -2
- package/dist/{config.d-qt-mE8O5.d.ts → config.d-BKIhJtmr.d.ts} +7 -2
- package/dist/config.d.mts +6 -6
- package/dist/config.d.ts +6 -6
- package/dist/cron.cjs +2 -2
- package/dist/cron.mjs +1 -1
- package/dist/deferred.cjs +2 -2
- package/dist/deferred.mjs +1 -1
- package/dist/deployment.cjs +2 -2
- package/dist/deployment.mjs +1 -1
- package/dist/desktop.d.mts +7 -7
- package/dist/desktop.d.ts +7 -7
- package/dist/{devtools-SGYOG36E.cjs → devtools-RZVT4JVN.cjs} +36 -32
- package/dist/{devtools-PUVZB3F2.mjs → devtools-UFQYT3VA.mjs} +31 -27
- package/dist/docs.cjs +26 -25
- package/dist/docs.d.mts +20 -8
- package/dist/docs.d.ts +20 -8
- package/dist/docs.mjs +25 -24
- package/dist/env-types.cjs +3 -3
- package/dist/env-types.mjs +2 -2
- package/dist/environment/vite.cjs +5 -5
- package/dist/environment/vite.mjs +4 -4
- package/dist/headers.cjs +3 -3
- package/dist/headers.mjs +2 -2
- package/dist/image/server.d.mts +1 -1
- package/dist/image/server.d.ts +1 -1
- package/dist/image/sharp.d.mts +1 -1
- package/dist/image/sharp.d.ts +1 -1
- package/dist/{image-config.d-CeDgNyX4.d.mts → image-config.d-ByhQ0TT7.d.mts} +3 -1
- package/dist/{image-config.d-CeDgNyX4.d.ts → image-config.d-ByhQ0TT7.d.ts} +3 -1
- package/dist/image.cjs +6 -6
- package/dist/image.d.mts +1 -1
- package/dist/image.d.ts +1 -1
- package/dist/image.mjs +1 -1
- package/dist/index.cjs +143 -128
- package/dist/{index.d-SSgYDv4D.d.mts → index.d-Bdm6866n.d.mts} +1 -1
- package/dist/{index.d-A_x10zGS.d.ts → index.d-Dey5T14f.d.ts} +1 -1
- package/dist/index.d.mts +31 -82
- package/dist/index.d.ts +31 -82
- package/dist/index.mjs +214 -199
- package/dist/{integration-orm-52GPGTHO.cjs → integrations/orm.cjs} +5 -5
- package/dist/integrations/orm.d.mts +33 -0
- package/dist/integrations/orm.d.ts +33 -0
- package/dist/{integration-orm-CO23MSFE.mjs → integrations/orm.mjs} +5 -5
- package/dist/integrations.cjs +6 -5
- package/dist/integrations.d.mts +6 -6
- package/dist/integrations.d.ts +6 -6
- package/dist/integrations.mjs +5 -4
- package/dist/internal/app-markdown-runtime.cjs +4 -4
- package/dist/internal/app-markdown-runtime.d.mts +17 -8
- package/dist/internal/app-markdown-runtime.d.ts +17 -8
- package/dist/internal/app-markdown-runtime.mjs +3 -3
- package/dist/internal/build-runtime.cjs +70 -68
- package/dist/internal/build-runtime.d.mts +8 -8
- package/dist/internal/build-runtime.d.ts +8 -8
- package/dist/internal/build-runtime.mjs +69 -67
- package/dist/internal/cli-runtime.cjs +45 -44
- package/dist/internal/cli-runtime.mjs +44 -43
- package/dist/internal/client-error-overlay.cjs +6 -6
- package/dist/internal/client-error-overlay.mjs +2 -2
- package/dist/internal/client-runtime.cjs +60 -6
- package/dist/internal/client-runtime.d.mts +40 -11
- package/dist/internal/client-runtime.d.ts +40 -11
- package/dist/internal/client-runtime.mjs +58 -4
- package/dist/internal/compression-runtime.d.mts +6 -6
- package/dist/internal/compression-runtime.d.ts +6 -6
- package/dist/internal/config-runtime.cjs +25 -24
- package/dist/internal/config-runtime.d.mts +9 -9
- package/dist/internal/config-runtime.d.ts +9 -9
- package/dist/internal/config-runtime.mjs +24 -23
- package/dist/internal/docs-precompiled-runtime.cjs +16 -5
- package/dist/internal/docs-precompiled-runtime.d.mts +7 -0
- package/dist/internal/docs-precompiled-runtime.d.ts +7 -0
- package/dist/internal/docs-precompiled-runtime.mjs +15 -4
- package/dist/internal/infra-analytics-runtime.cjs +11 -11
- package/dist/internal/infra-analytics-runtime.mjs +9 -9
- package/dist/internal/islands-runtime.cjs +33 -4
- package/dist/internal/islands-runtime.d.mts +1 -1
- package/dist/internal/islands-runtime.d.ts +1 -1
- package/dist/internal/islands-runtime.mjs +31 -2
- package/dist/internal/native-server-fns.cjs +6 -6
- package/dist/internal/native-server-fns.mjs +5 -5
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-runtime.cjs +54 -40
- package/dist/internal/production-runtime.d.mts +23 -15
- package/dist/internal/production-runtime.d.ts +23 -15
- package/dist/internal/production-runtime.mjs +69 -55
- package/dist/internal/react-cache.cjs +3 -3
- package/dist/internal/react-cache.mjs +1 -1
- package/dist/{lifecycle.d-C2aLBOwu.d.ts → lifecycle.d-keQs5Swc.d.mts} +7 -1
- package/dist/{lifecycle.d-C2aLBOwu.d.mts → lifecycle.d-keQs5Swc.d.ts} +7 -1
- package/dist/{manager-H5ZM3HAM.mjs → manager-JIA66YJ2.mjs} +4 -3
- package/dist/manager-JOHU6BQI.cjs +15 -0
- package/dist/markdown.cjs +7 -3
- package/dist/markdown.d.mts +6 -6
- package/dist/markdown.d.ts +6 -6
- package/dist/markdown.mjs +6 -2
- package/dist/middleware.cjs +10 -10
- package/dist/middleware.d.mts +8 -8
- package/dist/middleware.d.ts +8 -8
- package/dist/middleware.mjs +9 -9
- package/dist/mobile.d.mts +4 -4
- package/dist/mobile.d.ts +4 -4
- package/dist/mount.d-BP0nLYQO.d.mts +38 -0
- package/dist/mount.d-CkiPky_F.d.ts +38 -0
- package/dist/{native-server-fn-handler-GLRHAYWV.mjs → native-server-fn-handler-EP5AFJYE.mjs} +5 -5
- package/dist/{native-server-fn-handler-J5MYRXN6.cjs → native-server-fn-handler-QRTXGZA4.cjs} +6 -6
- package/dist/{native-tree-HE2FLS72.cjs → native-tree-W2SSJB3Y.cjs} +5 -5
- package/dist/{native-tree-YF2DSPKM.mjs → native-tree-Y5YQANW7.mjs} +4 -4
- package/dist/{navigation-delegate.d-DQVYKoaZ.d.mts → navigation-delegate.d-CdBP-hkZ.d.mts} +1 -1
- package/dist/{navigation-delegate.d-GghbHJuK.d.ts → navigation-delegate.d-DchcGzAQ.d.ts} +1 -1
- package/dist/navigation.cjs +8 -7
- package/dist/navigation.d.mts +9 -9
- package/dist/navigation.d.ts +9 -9
- package/dist/navigation.mjs +7 -6
- package/dist/{nitro-DD4QCA66.mjs → nitro-55YOZWRA.mjs} +11 -11
- package/dist/{nitro-VRDX2H4M.cjs → nitro-EEX2J3KB.cjs} +13 -13
- package/dist/{plugin-53SY5YBS.mjs → plugin-SAS22JL7.mjs} +4 -3
- package/dist/{plugin-HZIBL3DW.cjs → plugin-WIU4GDD4.cjs} +5 -4
- package/dist/plugin.cjs +61 -59
- package/dist/plugin.d.mts +8 -8
- package/dist/plugin.d.ts +8 -8
- package/dist/plugin.mjs +60 -58
- package/dist/{port-UFUZL6RI.mjs → port-CLL4BC4O.mjs} +1 -1
- package/dist/{port-VTLHPZOI.cjs → port-HASZTQGY.cjs} +9 -9
- package/dist/{production-runtime.d-Bzns3NW9.d.ts → production-runtime.d-Dou_Htas.d.ts} +1 -1
- package/dist/{production-runtime.d-DiFa5vHW.d.mts → production-runtime.d-VwsBzIee.d.mts} +1 -1
- package/dist/query/client.cjs +9 -7
- package/dist/query/client.mjs +5 -3
- package/dist/{render-plan.d-CL_Ikfg_.d.ts → render-plan.d-D8UakAIk.d.ts} +1 -1
- package/dist/{render-plan.d-CcF0MeCf.d.mts → render-plan.d-LKymStDJ.d.mts} +1 -1
- package/dist/renderer/none/server.cjs +35 -0
- package/dist/renderer/none/server.d.mts +21 -0
- package/dist/renderer/none/server.d.ts +21 -0
- package/dist/renderer/none/server.mjs +35 -0
- package/dist/renderer/react/server.cjs +2 -2
- package/dist/renderer/react/server.mjs +3 -3
- package/dist/renderer-client.cjs +8 -6
- package/dist/renderer-client.d.mts +9 -9
- package/dist/renderer-client.d.ts +9 -9
- package/dist/renderer-client.mjs +5 -3
- package/dist/renderer.cjs +6 -2
- package/dist/renderer.d.mts +20 -2
- package/dist/renderer.d.ts +20 -2
- package/dist/renderer.mjs +5 -1
- package/dist/request.cjs +2 -2
- package/dist/{request.d-B1RnTLri.d.ts → request.d-B928QjWy.d.ts} +1 -1
- package/dist/{request.d-DarDOCk9.d.mts → request.d-KG-4d2eG.d.mts} +1 -1
- package/dist/request.d.mts +7 -7
- package/dist/request.d.ts +7 -7
- package/dist/request.mjs +1 -1
- package/dist/{route-rendering.d-BTUYCIj4.d.ts → route-rendering.d-DoEe_w9t.d.ts} +1 -1
- package/dist/{route-rendering.d-D_2Ual0-.d.mts → route-rendering.d-NIHQeb4m.d.mts} +1 -1
- package/dist/{route.d-BaVH3V0w.d.mts → route.d-DrXkpvcg.d.mts} +1 -1
- package/dist/{route.d-DBTEqifW.d.ts → route.d-hs-_cyHn.d.ts} +1 -1
- package/dist/{router.d-Cuv1jntg.d.mts → router.d-B8PkJSGp.d.mts} +1 -1
- package/dist/{router.d-CMANF6da.d.ts → router.d-DYnRHQwz.d.ts} +1 -1
- package/dist/routes.cjs +3 -3
- package/dist/{routes.d-c2HKfrfL.d.mts → routes.d-DgZ_jgGG.d.mts} +1 -1
- package/dist/{routes.d-B6yFe6jm.d.ts → routes.d-uUBZyWoK.d.ts} +1 -1
- package/dist/routes.d.mts +6 -6
- package/dist/routes.d.ts +6 -6
- package/dist/routes.mjs +2 -2
- package/dist/{rsc-pipeline-T3PWURLJ.mjs → rsc-pipeline-4OJ5ZQNZ.mjs} +26 -25
- package/dist/{rsc-pipeline-V4ANLRAA.cjs → rsc-pipeline-7K5H2RPH.cjs} +27 -26
- package/dist/{runtime-LRIQ3XH7.mjs → runtime-U7O3HZOZ.mjs} +62 -36
- package/dist/{runtime-5AROV2C3.cjs → runtime-X52Q7JFR.cjs} +72 -46
- package/dist/{runtime.d-wvh4ngU0.d.mts → runtime.d-BxQIzwfy.d.mts} +11 -3
- package/dist/{runtime.d-C3RQUj6_.d.ts → runtime.d-DP7mEkEF.d.ts} +11 -3
- package/dist/{schema-dev-notice-JMXEQWIQ.mjs → schema-dev-notice-C2JINRZI.mjs} +3 -2
- package/dist/{schema-dev-notice-PLBFDTOF.cjs → schema-dev-notice-X7GG7QVB.cjs} +5 -4
- package/dist/schema.cjs +6 -2
- package/dist/schema.d-Dny9pnrm.d.mts +298 -0
- package/dist/schema.d-Dny9pnrm.d.ts +298 -0
- package/dist/schema.d.mts +1 -115
- package/dist/schema.d.ts +1 -115
- package/dist/schema.mjs +5 -1
- package/dist/server-fn-client.d.mts +2 -2
- package/dist/server-fn-client.d.ts +2 -2
- package/dist/server-fn.cjs +5 -5
- package/dist/server-fn.mjs +4 -4
- package/dist/server-plugins.cjs +7 -7
- package/dist/server-plugins.d.mts +16 -10
- package/dist/server-plugins.d.ts +16 -10
- package/dist/server-plugins.mjs +8 -8
- package/dist/server-query.cjs +6 -6
- package/dist/server-query.mjs +5 -5
- package/dist/server.cjs +160 -120
- package/dist/server.d.mts +20 -14
- package/dist/server.d.ts +20 -14
- package/dist/server.mjs +138 -98
- package/dist/{spa-router.d-WU_qS5gJ.d.mts → spa-router.d-BgHPVMhz.d.mts} +15 -5
- package/dist/{spa-router.d-m8H_Kl_B.d.ts → spa-router.d-DsFDHTsv.d.ts} +15 -5
- package/dist/testing.cjs +17 -17
- package/dist/testing.d.mts +6 -6
- package/dist/testing.d.ts +6 -6
- package/dist/testing.mjs +13 -13
- package/dist/theme/server.cjs +3 -3
- package/dist/theme/server.mjs +2 -2
- package/dist/{utils.d-W9IiEqmW.d.mts → utils.d-BKyKDBR1.d.mts} +1 -1
- package/dist/{utils.d-C9dQD5Zg.d.ts → utils.d-zxAVcf_V.d.ts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +63 -61
- package/dist/vite.d.mts +32 -12
- package/dist/vite.d.ts +32 -12
- package/dist/vite.mjs +62 -60
- package/dist/workflows.cjs +4 -4
- package/dist/workflows.mjs +3 -3
- package/package.json +31 -1
- package/dist/analyzer-GHWK46LX.cjs +0 -16
- package/dist/chunk-5YPBFMBN.cjs +0 -19
- package/dist/chunk-OM7WILES.mjs +0 -100
- package/dist/chunk-Q5B4LNON.mjs +0 -19
- package/dist/chunk-QPJ4MZTO.mjs +0 -60
- package/dist/chunk-R53QDV6T.cjs +0 -100
- package/dist/chunk-UYTAP4FQ.cjs +0 -60
- package/dist/manager-2LUKNX2N.cjs +0 -14
- /package/dist/{chunk-QGOZLGVP.mjs → chunk-I6FIAWNT.mjs} +0 -0
- /package/dist/{chunk-XPIPMWY3.cjs → chunk-K5NI5YQR.cjs} +0 -0
- /package/dist/{chunk-NWUHS6GV.cjs → chunk-QEJWNXRI.cjs} +0 -0
- /package/dist/{chunk-FSXSQQTV.mjs → chunk-TXE4SAMV.mjs} +0 -0
- /package/dist/{chunk-ZXK2EYQW.cjs → chunk-UUQNJDGH.cjs} +0 -0
- /package/dist/{chunk-46P5KNTE.mjs → chunk-VZBAW44S.mjs} +0 -0
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
import {
|
|
2
|
+
resolveFarmPlatform
|
|
3
|
+
} from "./chunk-SMUW7UST.mjs";
|
|
4
|
+
import {
|
|
5
|
+
formatOptionalPeerInstallHint,
|
|
6
|
+
isMissingPackageError
|
|
7
|
+
} from "./chunk-NR63PD3P.mjs";
|
|
8
|
+
import {
|
|
9
|
+
logger
|
|
10
|
+
} from "./chunk-JSDV2NUN.mjs";
|
|
11
|
+
|
|
12
|
+
// src/client-plugin-build.ts
|
|
13
|
+
import fs from "fs";
|
|
14
|
+
import path from "path";
|
|
15
|
+
var CLIENT_KEYS = [
|
|
16
|
+
"public",
|
|
17
|
+
"setup",
|
|
18
|
+
"hydration",
|
|
19
|
+
"navigation",
|
|
20
|
+
"error",
|
|
21
|
+
"performance",
|
|
22
|
+
"close"
|
|
23
|
+
];
|
|
24
|
+
var HYDRATION_KEYS = ["before", "after"];
|
|
25
|
+
var NAVIGATION_KEYS = ["before", "loaded", "resolved", "rendered", "error"];
|
|
26
|
+
var MOBILE_SHELL_CLIENT_IMPORT = 'import { farmMobileShellClient as __farmMobileShellClient } from "@farm.js/core/internal/client-runtime";';
|
|
27
|
+
var MOBILE_SHELL_CLIENT_REGISTRATION = ` {
|
|
28
|
+
name: "farm:mobile-shell",
|
|
29
|
+
enforce: "pre",
|
|
30
|
+
definition: __farmMobileShellClient,
|
|
31
|
+
}`;
|
|
32
|
+
var APP_CLIENT_EXTENSIONS = ["ts", "tsx", "js", "jsx", "mts", "mjs"];
|
|
33
|
+
function resolveFarmAppClientEntry(root = process.cwd(), srcDir = "src") {
|
|
34
|
+
const sourceRoot = path.resolve(root, srcDir);
|
|
35
|
+
for (const extension of APP_CLIENT_EXTENSIONS) {
|
|
36
|
+
const candidate = path.join(sourceRoot, `client.${extension}`);
|
|
37
|
+
if (fs.existsSync(candidate) && fs.statSync(candidate).isFile()) return candidate;
|
|
38
|
+
}
|
|
39
|
+
return void 0;
|
|
40
|
+
}
|
|
41
|
+
function resolveFarmClientPlugins(plugins, _root) {
|
|
42
|
+
if (!plugins?.length) return [];
|
|
43
|
+
return plugins.flatMap((plugin) => {
|
|
44
|
+
if (!plugin.client) return [];
|
|
45
|
+
assertClientLifecycle(plugin.client, plugin.name);
|
|
46
|
+
assertPublicData(plugin.client.public, plugin.name);
|
|
47
|
+
return [
|
|
48
|
+
{
|
|
49
|
+
name: plugin.name,
|
|
50
|
+
version: plugin.version,
|
|
51
|
+
enforce: plugin.enforce,
|
|
52
|
+
definition: plugin.client,
|
|
53
|
+
publicData: plugin.client.public
|
|
54
|
+
}
|
|
55
|
+
];
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function generateFarmClientPluginEntryCode(plugins, root, srcDir = "src", appPublicData, platform = resolveFarmPlatform()) {
|
|
59
|
+
const resolved = resolveFarmClientPlugins(plugins, root);
|
|
60
|
+
const appClientEntry = root ? resolveFarmAppClientEntry(root, srcDir) : void 0;
|
|
61
|
+
const appImport = appClientEntry ? `import farmAppClientDefinition from ${JSON.stringify(appClientEntry.replace(/\\/g, "/"))};` : "";
|
|
62
|
+
const mobileShell = platform === "mobile";
|
|
63
|
+
const imports = mobileShell ? [MOBILE_SHELL_CLIENT_IMPORT, appImport].filter(Boolean).join("\n") : appImport;
|
|
64
|
+
const serializedPlugins = mobileShell ? [MOBILE_SHELL_CLIENT_REGISTRATION] : [];
|
|
65
|
+
serializedPlugins.push(
|
|
66
|
+
...resolved.map(
|
|
67
|
+
(plugin) => ` {
|
|
68
|
+
name: ${JSON.stringify(plugin.name)},
|
|
69
|
+
version: ${serializeOptionalString(plugin.version)},
|
|
70
|
+
enforce: ${serializeOptionalString(plugin.enforce)},
|
|
71
|
+
definition: ${serializeClientLifecycle(plugin.definition, plugin.name)},
|
|
72
|
+
public: ${serializePublicData(plugin.publicData)},
|
|
73
|
+
}`
|
|
74
|
+
)
|
|
75
|
+
);
|
|
76
|
+
if (appClientEntry) {
|
|
77
|
+
assertPublicData(appPublicData, "farm:app-client");
|
|
78
|
+
serializedPlugins.push(` {
|
|
79
|
+
name: "farm:app-client",
|
|
80
|
+
enforce: "post",
|
|
81
|
+
definition: farmAppClientDefinition,
|
|
82
|
+
public: ${serializePublicData(appPublicData)},
|
|
83
|
+
}`);
|
|
84
|
+
}
|
|
85
|
+
const registrations = `[
|
|
86
|
+
${serializedPlugins.join(",\n")}
|
|
87
|
+
]`;
|
|
88
|
+
return { imports, registrations, plugins: resolved, empty: serializedPlugins.length === 0 };
|
|
89
|
+
}
|
|
90
|
+
function assertClientLifecycle(client, pluginName) {
|
|
91
|
+
assertLifecycleObject(client, pluginName, "client", CLIENT_KEYS);
|
|
92
|
+
assertHook(client.setup, pluginName, "client.setup");
|
|
93
|
+
assertHook(client.error, pluginName, "client.error");
|
|
94
|
+
assertHook(client.performance, pluginName, "client.performance");
|
|
95
|
+
assertHook(client.close, pluginName, "client.close");
|
|
96
|
+
if (client.hydration !== void 0) {
|
|
97
|
+
assertLifecycleObject(client.hydration, pluginName, "client.hydration", HYDRATION_KEYS);
|
|
98
|
+
assertHook(client.hydration.before, pluginName, "client.hydration.before");
|
|
99
|
+
assertHook(client.hydration.after, pluginName, "client.hydration.after");
|
|
100
|
+
}
|
|
101
|
+
if (client.navigation !== void 0) {
|
|
102
|
+
assertLifecycleObject(client.navigation, pluginName, "client.navigation", NAVIGATION_KEYS);
|
|
103
|
+
for (const key of NAVIGATION_KEYS) {
|
|
104
|
+
assertHook(client.navigation[key], pluginName, `client.navigation.${key}`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function assertLifecycleObject(value, pluginName, location, allowedKeys) {
|
|
109
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
110
|
+
throw new TypeError(`Client plugin "${pluginName}" ${location} must be an object`);
|
|
111
|
+
}
|
|
112
|
+
const prototype = Object.getPrototypeOf(value);
|
|
113
|
+
if (prototype !== Object.prototype && prototype !== null) {
|
|
114
|
+
throw new TypeError(`Client plugin "${pluginName}" ${location} must be a plain object`);
|
|
115
|
+
}
|
|
116
|
+
for (const key of Reflect.ownKeys(value)) {
|
|
117
|
+
if (typeof key === "symbol") {
|
|
118
|
+
throw new TypeError(`Client plugin "${pluginName}" ${location} cannot contain symbol keys`);
|
|
119
|
+
}
|
|
120
|
+
if (!allowedKeys.includes(key)) {
|
|
121
|
+
throw new TypeError(`Client plugin "${pluginName}" has an unknown ${location}.${key} option`);
|
|
122
|
+
}
|
|
123
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
124
|
+
if (!descriptor?.enumerable) {
|
|
125
|
+
throw new TypeError(`Client plugin "${pluginName}" ${location}.${key} must be enumerable`);
|
|
126
|
+
}
|
|
127
|
+
if (!("value" in descriptor)) {
|
|
128
|
+
throw new TypeError(`Client plugin "${pluginName}" ${location}.${key} cannot be an accessor`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
function assertHook(value, pluginName, location) {
|
|
133
|
+
if (value === void 0) return;
|
|
134
|
+
if (typeof value !== "function") {
|
|
135
|
+
throw new TypeError(`Client plugin "${pluginName}" ${location} must be a function`);
|
|
136
|
+
}
|
|
137
|
+
functionSource(value, pluginName, location);
|
|
138
|
+
}
|
|
139
|
+
function serializeClientLifecycle(definition, pluginName) {
|
|
140
|
+
const fields = [];
|
|
141
|
+
pushHook(fields, "setup", definition.setup, pluginName, "client.setup", 2);
|
|
142
|
+
pushHookGroup(fields, "hydration", definition.hydration, HYDRATION_KEYS, pluginName, 2);
|
|
143
|
+
pushHookGroup(fields, "navigation", definition.navigation, NAVIGATION_KEYS, pluginName, 2);
|
|
144
|
+
pushHook(fields, "error", definition.error, pluginName, "client.error", 2);
|
|
145
|
+
pushHook(fields, "performance", definition.performance, pluginName, "client.performance", 2);
|
|
146
|
+
pushHook(fields, "close", definition.close, pluginName, "client.close", 2);
|
|
147
|
+
return fields.length ? `{
|
|
148
|
+
${fields.join(",\n")}
|
|
149
|
+
}` : "{}";
|
|
150
|
+
}
|
|
151
|
+
function pushHookGroup(fields, groupName, group, keys, pluginName, indent) {
|
|
152
|
+
if (!group) return;
|
|
153
|
+
const hooks = [];
|
|
154
|
+
for (const key of keys) {
|
|
155
|
+
pushHook(hooks, key, group[key], pluginName, `client.${groupName}.${key}`, indent + 2);
|
|
156
|
+
}
|
|
157
|
+
fields.push(
|
|
158
|
+
`${" ".repeat(indent)}${JSON.stringify(groupName)}: {
|
|
159
|
+
${hooks.join(",\n")}
|
|
160
|
+
${" ".repeat(indent)}}`
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
function pushHook(fields, key, hook, pluginName, location, indent) {
|
|
164
|
+
if (hook === void 0) return;
|
|
165
|
+
fields.push(
|
|
166
|
+
`${" ".repeat(indent)}${JSON.stringify(key)}: ${functionSource(hook, pluginName, location)}`
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
function functionSource(value, pluginName, location) {
|
|
170
|
+
if (typeof value !== "function") {
|
|
171
|
+
throw new TypeError(`Client plugin "${pluginName}" ${location} must be a function`);
|
|
172
|
+
}
|
|
173
|
+
const source = Function.prototype.toString.call(value).trim();
|
|
174
|
+
if (!source || source.includes("[native code]")) {
|
|
175
|
+
throw new TypeError(
|
|
176
|
+
`Client plugin "${pluginName}" ${location} must be authored inline and cannot be native or bound`
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
if (/^(?:async\s+)?function(?:\s*\*)?(?:\s+|\()/.test(source)) {
|
|
180
|
+
return `(${source})`;
|
|
181
|
+
}
|
|
182
|
+
if (!/^class\b/.test(source)) {
|
|
183
|
+
if (/^async\s*\(/.test(source) && value.name !== "async") return `(${source})`;
|
|
184
|
+
const method = source.match(/^(async\s+)?(\*\s*)?[$A-Z_a-z][$\w]*\s*(\([\s\S]*)$/);
|
|
185
|
+
if (method) {
|
|
186
|
+
const asyncPrefix = method[1] ?? "";
|
|
187
|
+
const generator = method[2] ? "*" : "";
|
|
188
|
+
return `(${asyncPrefix}function${generator}${method[3]})`;
|
|
189
|
+
}
|
|
190
|
+
if (source.includes("=>")) return `(${source})`;
|
|
191
|
+
}
|
|
192
|
+
throw new TypeError(
|
|
193
|
+
`Client plugin "${pluginName}" ${location} must use a function, method, or arrow function`
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
function assertPublicData(value, pluginName) {
|
|
197
|
+
if (value === void 0) return;
|
|
198
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
199
|
+
const visit = (current, pathSegments) => {
|
|
200
|
+
if (current === null || typeof current === "string" || typeof current === "boolean") {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
if (typeof current === "number") {
|
|
204
|
+
if (Number.isFinite(current)) return;
|
|
205
|
+
throwPublicDataError(pluginName, pathSegments, "must be a finite number");
|
|
206
|
+
}
|
|
207
|
+
if (typeof current !== "object") {
|
|
208
|
+
throwPublicDataError(pluginName, pathSegments, `cannot contain ${typeof current} values`);
|
|
209
|
+
}
|
|
210
|
+
if (seen.has(current)) {
|
|
211
|
+
throwPublicDataError(pluginName, pathSegments, "cannot contain circular references");
|
|
212
|
+
}
|
|
213
|
+
seen.add(current);
|
|
214
|
+
if (Array.isArray(current)) {
|
|
215
|
+
for (let index = 0; index < current.length; index += 1) {
|
|
216
|
+
if (!Object.prototype.hasOwnProperty.call(current, index)) {
|
|
217
|
+
throwPublicDataError(
|
|
218
|
+
pluginName,
|
|
219
|
+
[...pathSegments, String(index)],
|
|
220
|
+
"cannot contain sparse array slots"
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
visit(current[index], [...pathSegments, String(index)]);
|
|
224
|
+
}
|
|
225
|
+
for (const key of Reflect.ownKeys(current)) {
|
|
226
|
+
if (key === "length" || typeof key === "string" && isArrayIndex(key)) continue;
|
|
227
|
+
throwPublicDataError(
|
|
228
|
+
pluginName,
|
|
229
|
+
pathSegments,
|
|
230
|
+
typeof key === "symbol" ? "cannot contain symbol keys" : `cannot contain non-index array property ${key}`
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
seen.delete(current);
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
const prototype = Object.getPrototypeOf(current);
|
|
237
|
+
if (prototype !== Object.prototype && prototype !== null) {
|
|
238
|
+
throwPublicDataError(pluginName, pathSegments, "must contain only plain objects and arrays");
|
|
239
|
+
}
|
|
240
|
+
for (const key of Reflect.ownKeys(current)) {
|
|
241
|
+
if (typeof key === "symbol") {
|
|
242
|
+
throwPublicDataError(pluginName, pathSegments, "cannot contain symbol keys");
|
|
243
|
+
}
|
|
244
|
+
const descriptor = Object.getOwnPropertyDescriptor(current, key);
|
|
245
|
+
if (!descriptor?.enumerable) {
|
|
246
|
+
throwPublicDataError(
|
|
247
|
+
pluginName,
|
|
248
|
+
[...pathSegments, key],
|
|
249
|
+
"cannot contain non-enumerable properties"
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
if (!("value" in descriptor)) {
|
|
253
|
+
throwPublicDataError(
|
|
254
|
+
pluginName,
|
|
255
|
+
[...pathSegments, key],
|
|
256
|
+
"cannot contain accessor properties"
|
|
257
|
+
);
|
|
258
|
+
}
|
|
259
|
+
visit(descriptor.value, [...pathSegments, key]);
|
|
260
|
+
}
|
|
261
|
+
seen.delete(current);
|
|
262
|
+
};
|
|
263
|
+
visit(value, []);
|
|
264
|
+
}
|
|
265
|
+
function throwPublicDataError(pluginName, pathSegments, message) {
|
|
266
|
+
const location = pathSegments.length ? ` at client.public.${pathSegments.join(".")}` : "";
|
|
267
|
+
throw new TypeError(`Client plugin "${pluginName}"${location} ${message}`);
|
|
268
|
+
}
|
|
269
|
+
function serializePublicData(value) {
|
|
270
|
+
if (value === void 0) return "undefined";
|
|
271
|
+
return `JSON.parse(${JSON.stringify(JSON.stringify(value))})`;
|
|
272
|
+
}
|
|
273
|
+
function serializeOptionalString(value) {
|
|
274
|
+
return value === void 0 ? "undefined" : JSON.stringify(value);
|
|
275
|
+
}
|
|
276
|
+
function isArrayIndex(key) {
|
|
277
|
+
const value = Number(key);
|
|
278
|
+
return Number.isInteger(value) && value >= 0 && value < 4294967295 && String(value) === key;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// src/build/tailwind.ts
|
|
282
|
+
import path2 from "path";
|
|
283
|
+
|
|
284
|
+
// src/build/vite-plugin-compat.ts
|
|
285
|
+
function adaptTailwindVitePlugin(pluginOption, builder) {
|
|
286
|
+
if (builder !== "rolldown") return pluginOption;
|
|
287
|
+
return adaptPluginOption(pluginOption);
|
|
288
|
+
}
|
|
289
|
+
function adaptPluginOption(pluginOption) {
|
|
290
|
+
if (Array.isArray(pluginOption)) return pluginOption.map(adaptPluginOption);
|
|
291
|
+
if (!pluginOption || typeof pluginOption !== "object") return pluginOption;
|
|
292
|
+
const plugin = pluginOption;
|
|
293
|
+
if (!plugin.name?.startsWith("@tailwindcss/vite:generate:")) return pluginOption;
|
|
294
|
+
if (isVitePluginHook(plugin.transform)) {
|
|
295
|
+
return {
|
|
296
|
+
...plugin,
|
|
297
|
+
transform: withVite5TransformContext(plugin.transform)
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
if (plugin.transform && typeof plugin.transform === "object" && "handler" in plugin.transform && isVitePluginHook(plugin.transform.handler)) {
|
|
301
|
+
return {
|
|
302
|
+
...plugin,
|
|
303
|
+
transform: {
|
|
304
|
+
...plugin.transform,
|
|
305
|
+
handler: withVite5TransformContext(plugin.transform.handler)
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
return pluginOption;
|
|
310
|
+
}
|
|
311
|
+
function isVitePluginHook(value) {
|
|
312
|
+
return typeof value === "function";
|
|
313
|
+
}
|
|
314
|
+
function withVite5TransformContext(handler) {
|
|
315
|
+
return function(...args) {
|
|
316
|
+
const context = new Proxy(this, {
|
|
317
|
+
get(target, property, receiver) {
|
|
318
|
+
if (property === "environment") return void 0;
|
|
319
|
+
return Reflect.get(target, property, receiver);
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
return handler.apply(context, args);
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
// src/build/tailwind.ts
|
|
327
|
+
var TAILWIND_CSS_IMPORT = /@import\s+["']tailwindcss["']/;
|
|
328
|
+
var TAILWIND_VITE_INSTALL_HINT = formatOptionalPeerInstallHint(
|
|
329
|
+
"@tailwindcss/vite",
|
|
330
|
+
"enable built-in Tailwind CSS support",
|
|
331
|
+
{ dev: true }
|
|
332
|
+
);
|
|
333
|
+
var warnedMissingTailwind = false;
|
|
334
|
+
async function loadTailwindVitePlugin(options = {}, importTailwind = () => import("@tailwindcss/vite")) {
|
|
335
|
+
try {
|
|
336
|
+
const tailwindVite = (await importTailwind()).default;
|
|
337
|
+
const plugin = options.builder ? adaptTailwindVitePlugin(tailwindVite(), options.builder) : tailwindVite();
|
|
338
|
+
if (options.announce) logger.info("\u{1F4E6} Enabled built-in Tailwind support (@tailwindcss/vite)");
|
|
339
|
+
return plugin;
|
|
340
|
+
} catch (error) {
|
|
341
|
+
if (isMissingPackageError(error, "@tailwindcss/vite")) return createMissingTailwindPlugin();
|
|
342
|
+
logger.warn(
|
|
343
|
+
`Tailwind plugin auto-enable failed${options.label ? ` ${options.label}` : ""}; continuing without it: ${error.message}`
|
|
344
|
+
);
|
|
345
|
+
return void 0;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
function createMissingTailwindPlugin() {
|
|
349
|
+
let root = process.cwd();
|
|
350
|
+
return {
|
|
351
|
+
name: "farm:tailwind-missing",
|
|
352
|
+
enforce: "pre",
|
|
353
|
+
configResolved(config) {
|
|
354
|
+
root = config.root;
|
|
355
|
+
},
|
|
356
|
+
transform(code, id) {
|
|
357
|
+
if (warnedMissingTailwind || !/\.css(?:\?.*)?$/.test(id) || !TAILWIND_CSS_IMPORT.test(code)) {
|
|
358
|
+
return null;
|
|
359
|
+
}
|
|
360
|
+
warnedMissingTailwind = true;
|
|
361
|
+
const file = path2.relative(root, id.split("?", 1)[0]).replace(/\\/g, "/");
|
|
362
|
+
logger.warn(
|
|
363
|
+
`${file} imports Tailwind CSS, but @tailwindcss/vite is not installed; continuing without Tailwind. ${TAILWIND_VITE_INSTALL_HINT}`
|
|
364
|
+
);
|
|
365
|
+
return null;
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
export {
|
|
371
|
+
resolveFarmAppClientEntry,
|
|
372
|
+
resolveFarmClientPlugins,
|
|
373
|
+
generateFarmClientPluginEntryCode,
|
|
374
|
+
loadTailwindVitePlugin
|
|
375
|
+
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
writeFileIfChanged
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YFTGIHNC.mjs";
|
|
4
4
|
import {
|
|
5
5
|
resolveFarmComponentExtensions
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GCRT6GJG.mjs";
|
|
7
7
|
import {
|
|
8
8
|
parseRouteSlotFile
|
|
9
9
|
} from "./chunk-K3RU5MOR.mjs";
|
|
10
10
|
import {
|
|
11
11
|
discoverProgrammaticRoutePaths
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-TXE4SAMV.mjs";
|
|
13
13
|
import {
|
|
14
14
|
parseRoutePath
|
|
15
15
|
} from "./chunk-JSDV2NUN.mjs";
|
|
@@ -86,6 +86,7 @@ async function finalizeFarmMobileClient(options) {
|
|
|
86
86
|
return {
|
|
87
87
|
webEntry: options.webEntry,
|
|
88
88
|
entry: manifest.entry,
|
|
89
|
+
...options.webBoot ? { webBoot: options.webBoot } : {},
|
|
89
90
|
webOnly: options.webFiles.filter((file) => !mobileFiles.has(file)).sort()
|
|
90
91
|
};
|
|
91
92
|
}
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
|
+
buildFarmDocsSitemapManifest,
|
|
2
3
|
discoverFarmDocsPages,
|
|
3
4
|
getFarmDocsMarkdownPath,
|
|
5
|
+
getFarmDocsPublicEntry,
|
|
4
6
|
getFarmDocsRoots,
|
|
7
|
+
getFarmDocsSiteUrl,
|
|
5
8
|
loadFarmDocsPage,
|
|
9
|
+
renderFarmDocsRobotsTxt,
|
|
6
10
|
resolveFarmDocsContentDir,
|
|
7
|
-
toFarmDocsMarkdownPage
|
|
8
|
-
|
|
11
|
+
toFarmDocsMarkdownPage,
|
|
12
|
+
toFarmDocsPublicSitemapConfig
|
|
13
|
+
} from "./chunk-AQDLVHNF.mjs";
|
|
9
14
|
import {
|
|
10
15
|
docsEngine,
|
|
11
16
|
loadFarmDocsEngine
|
|
12
17
|
} from "./chunk-VE3FWJBO.mjs";
|
|
13
18
|
import {
|
|
14
19
|
resolveDocsConfig
|
|
15
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-WDD5CTZW.mjs";
|
|
16
21
|
import {
|
|
17
22
|
getFarmDocsAdapterConfigModule,
|
|
18
23
|
isSecretDocsConfigKey
|
|
@@ -20,6 +25,10 @@ import {
|
|
|
20
25
|
import {
|
|
21
26
|
cloneFarmRequest
|
|
22
27
|
} from "./chunk-QDWMCFTH.mjs";
|
|
28
|
+
import {
|
|
29
|
+
applyFarmBasePath,
|
|
30
|
+
normalizeFarmBasePath
|
|
31
|
+
} from "./chunk-SF3JB56B.mjs";
|
|
23
32
|
|
|
24
33
|
// src/docs/adapter.ts
|
|
25
34
|
import { createRequire } from "module";
|
|
@@ -310,15 +319,9 @@ function getDocsDescription(docs) {
|
|
|
310
319
|
function getLoadedDocsPages(context) {
|
|
311
320
|
return discoverFarmDocsPages(context.contentDir, context.docs).filter((page) => !context.isPathGuarded(page.href)).map((page) => loadFarmDocsPage(context.contentDir, context.docs, page.slug)).filter((page) => Boolean(page));
|
|
312
321
|
}
|
|
313
|
-
function toDocsSourcePage(page) {
|
|
314
|
-
return {
|
|
315
|
-
...toFarmDocsMarkdownPage(page),
|
|
316
|
-
sourcePath: page.sourcePath
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
function toDocsSitemapPage(page) {
|
|
322
|
+
function toDocsSourcePage(page, basePath) {
|
|
320
323
|
return {
|
|
321
|
-
...toFarmDocsMarkdownPage(page),
|
|
324
|
+
...toFarmDocsMarkdownPage(page, basePath),
|
|
322
325
|
sourcePath: page.sourcePath
|
|
323
326
|
};
|
|
324
327
|
}
|
|
@@ -329,7 +332,7 @@ function getDocsLlmsOptions(context, request) {
|
|
|
329
332
|
const configured = isRecord(context.docs.config.llmsTxt) ? context.docs.config.llmsTxt : {};
|
|
330
333
|
return {
|
|
331
334
|
enabled: true,
|
|
332
|
-
baseUrl:
|
|
335
|
+
baseUrl: getFarmDocsSiteUrl(request, context.basePath),
|
|
333
336
|
siteTitle: getDocsTitle(context.docs),
|
|
334
337
|
siteDescription: getDocsDescription(context.docs),
|
|
335
338
|
...configured
|
|
@@ -370,13 +373,12 @@ function getDocsDiscoveryOptions(context, request) {
|
|
|
370
373
|
};
|
|
371
374
|
}
|
|
372
375
|
function buildSitemapManifest(context, request) {
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
});
|
|
376
|
+
return buildFarmDocsSitemapManifest(
|
|
377
|
+
getLoadedDocsPages(context),
|
|
378
|
+
context.docs,
|
|
379
|
+
new URL(request.url).origin,
|
|
380
|
+
context.basePath
|
|
381
|
+
);
|
|
380
382
|
}
|
|
381
383
|
function renderLlmsTxt(context, request, full) {
|
|
382
384
|
const generated = docsEngine().renderDocsLlmsTxt(
|
|
@@ -426,7 +428,7 @@ function buildAgentSpec(context, request) {
|
|
|
426
428
|
},
|
|
427
429
|
entry: context.docs.entry,
|
|
428
430
|
routes: {
|
|
429
|
-
docs: `${origin}${context.docs.
|
|
431
|
+
docs: `${origin}${getFarmDocsPublicEntry(context.docs, context.basePath)}`,
|
|
430
432
|
config: `${origin}/api/docs?format=config`,
|
|
431
433
|
search: `${origin}/api/docs?query=<term>`,
|
|
432
434
|
markdown: `${origin}/api/docs/<slug>.md`,
|
|
@@ -450,7 +452,8 @@ function buildAgentSpec(context, request) {
|
|
|
450
452
|
post: false
|
|
451
453
|
},
|
|
452
454
|
// Same root-relative source paths the precompiled runtime serves.
|
|
453
|
-
pages: pages.map(({ sourcePath, ...
|
|
455
|
+
pages: pages.map(({ sourcePath, ...route }) => {
|
|
456
|
+
const page = { ...route, href: applyFarmBasePath(route.href, context.basePath) };
|
|
454
457
|
const publicSourcePath = toPublicDocsPath(sourcePath, context.root);
|
|
455
458
|
return publicSourcePath ? { ...page, sourcePath: `./${publicSourcePath}` } : page;
|
|
456
459
|
})
|
|
@@ -532,7 +535,7 @@ function buildDiagnostics(context) {
|
|
|
532
535
|
}
|
|
533
536
|
async function searchDocs(context, request, query) {
|
|
534
537
|
const loadedPages = getLoadedDocsPages(context);
|
|
535
|
-
const sourcePages = loadedPages.map(toDocsSourcePage);
|
|
538
|
+
const sourcePages = loadedPages.map((page) => toDocsSourcePage(page, context.basePath));
|
|
536
539
|
const sourcePageByUrl = new Map(sourcePages.map((page) => [page.url, page]));
|
|
537
540
|
const resultLimit = isRecord(context.docs.config.search) && typeof context.docs.config.search.maxResults === "number" ? context.docs.config.search.maxResults : void 0;
|
|
538
541
|
const results = await docsEngine().performDocsSearch({
|
|
@@ -576,7 +579,8 @@ async function resolveAPIContext(options) {
|
|
|
576
579
|
docs,
|
|
577
580
|
contentDir: resolveFarmDocsContentDir(docs, { root, srcDir }),
|
|
578
581
|
diagnostics: options.diagnostics === true,
|
|
579
|
-
isPathGuarded: options.isPathGuarded ?? ((pathname) => guardedPaths.has(pathname))
|
|
582
|
+
isPathGuarded: options.isPathGuarded ?? ((pathname) => guardedPaths.has(pathname)),
|
|
583
|
+
basePath: normalizeFarmBasePath(options.basePath ?? runtimeConfig?.basePath)
|
|
580
584
|
};
|
|
581
585
|
}
|
|
582
586
|
async function handleDocsAPIGet(request, context) {
|
|
@@ -621,12 +625,7 @@ async function handleDocsAPIGet(request, context) {
|
|
|
621
625
|
}
|
|
622
626
|
if (format === "robots") {
|
|
623
627
|
return text(
|
|
624
|
-
|
|
625
|
-
entry: context.docs.entry,
|
|
626
|
-
sitemap: context.docs.config.sitemap ?? true,
|
|
627
|
-
robots: context.docs.config.robots ?? true,
|
|
628
|
-
baseUrl: new URL(request.url).origin
|
|
629
|
-
}),
|
|
628
|
+
renderFarmDocsRobotsTxt(context.docs, new URL(request.url).origin, context.basePath),
|
|
630
629
|
"text/plain; charset=utf-8"
|
|
631
630
|
);
|
|
632
631
|
}
|
|
@@ -638,10 +637,10 @@ async function handleDocsAPIGet(request, context) {
|
|
|
638
637
|
return text("Docs page not found\n", "text/plain; charset=utf-8", { status: 404 });
|
|
639
638
|
}
|
|
640
639
|
return text(
|
|
641
|
-
docsEngine().renderDocsMarkdownDocument(toFarmDocsMarkdownPage(page), {
|
|
640
|
+
docsEngine().renderDocsMarkdownDocument(toFarmDocsMarkdownPage(page, context.basePath), {
|
|
642
641
|
origin: new URL(request.url).origin,
|
|
643
642
|
llms: getDocsLlmsOptions(context, request),
|
|
644
|
-
sitemap: context.docs.config.sitemap
|
|
643
|
+
sitemap: toFarmDocsPublicSitemapConfig(context.docs.config.sitemap, context.basePath)
|
|
645
644
|
}),
|
|
646
645
|
"text/markdown; charset=utf-8"
|
|
647
646
|
);
|
|
@@ -1,15 +1,15 @@
|
|
|
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 _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkAQIRXBBYcjs = require('./chunk-AQIRXBBY.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk67MZTLTFcjs = require('./chunk-67MZTLTF.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkZDAEHG2Ocjs = require('./chunk-ZDAEHG2O.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkQEJWNXRIcjs = require('./chunk-QEJWNXRI.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
var _chunkQMNWKQL4cjs = require('./chunk-QMNWKQL4.cjs');
|
|
@@ -66,7 +66,7 @@ async function generateRouteTypes(options) {
|
|
|
66
66
|
const outPath = path.isAbsolute(outFile) ? outFile : path.join(root, srcDir, outFile);
|
|
67
67
|
const content = await createRouteTypeDeclarations(options, outPath);
|
|
68
68
|
fs.mkdirSync(path.dirname(outPath), { recursive: true });
|
|
69
|
-
|
|
69
|
+
_chunkAQIRXBBYcjs.writeFileIfChanged.call(void 0, outPath, content);
|
|
70
70
|
return outPath;
|
|
71
71
|
}
|
|
72
72
|
async function createRouteTypeDeclarations(options, outPath) {
|
|
@@ -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 = _chunk67MZTLTFcjs.resolveFarmComponentExtensions.call(void 0, options.componentExtensions).map(
|
|
140
140
|
(extension) => extension.slice(1)
|
|
141
141
|
);
|
|
142
142
|
const pages = /* @__PURE__ */ new Set();
|
|
@@ -174,7 +174,7 @@ async function scanRoutePatterns(options) {
|
|
|
174
174
|
);
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
-
for (const route of await
|
|
177
|
+
for (const route of await _chunkQEJWNXRIcjs.discoverProgrammaticRoutePaths.call(void 0, source.root, source.srcDir)) {
|
|
178
178
|
pages.add(route);
|
|
179
179
|
modules.add(route);
|
|
180
180
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// src/plugins/env.ts
|
|
2
|
+
function createEnvPlugin(env, {
|
|
3
|
+
beforeRequest: overrideBeforeRequest,
|
|
4
|
+
afterResponse: overrideAfterResponse
|
|
5
|
+
} = {}) {
|
|
6
|
+
return {
|
|
7
|
+
name: "farm:env",
|
|
8
|
+
configResolved(config, context) {
|
|
9
|
+
for (const [key, value] of Object.entries(env)) {
|
|
10
|
+
process.env[key] = value;
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
async beforeRequest(req, res, context) {
|
|
14
|
+
if (overrideBeforeRequest) {
|
|
15
|
+
await overrideBeforeRequest(req, res, context);
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
async afterResponse(req, res, context) {
|
|
19
|
+
if (overrideAfterResponse) {
|
|
20
|
+
await overrideAfterResponse(req, res, context);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// src/plugins/logger.ts
|
|
27
|
+
function createLoggerPlugin({
|
|
28
|
+
beforeRequest,
|
|
29
|
+
afterResponse
|
|
30
|
+
} = {}) {
|
|
31
|
+
const plugin = {
|
|
32
|
+
name: "farm:logger",
|
|
33
|
+
enforce: "post"
|
|
34
|
+
};
|
|
35
|
+
if (beforeRequest) {
|
|
36
|
+
plugin.beforeRequest = async (req, res, context) => {
|
|
37
|
+
await beforeRequest(req, res, context);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
if (afterResponse) {
|
|
41
|
+
plugin.afterResponse = async (req, res, context) => {
|
|
42
|
+
await afterResponse(req, res, context);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return plugin;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
createEnvPlugin,
|
|
50
|
+
createLoggerPlugin
|
|
51
|
+
};
|
|
@@ -5,7 +5,7 @@ var FARM_DEPLOYMENT_COOKIE = "__farm_deployment";
|
|
|
5
5
|
var FARM_DEPLOYMENT_MISMATCH_CODE = "FARM_DEPLOYMENT_MISMATCH";
|
|
6
6
|
var FARM_DEPLOYMENT_MISMATCH_STATUS = 409;
|
|
7
7
|
function getFarmPresetRuntime(preset) {
|
|
8
|
-
if (preset === "cloudflare" || preset === "cloudflare-pages" || preset === "cloudflare-module" || preset === "netlify-edge" || preset === "
|
|
8
|
+
if (preset === "cloudflare" || preset === "cloudflare-pages" || preset === "cloudflare-module" || preset === "netlify-edge" || preset === "deno") {
|
|
9
9
|
return "edge";
|
|
10
10
|
}
|
|
11
11
|
if (preset === "node-server" || preset === "vercel" || preset === "netlify" || preset === "aws-lambda" || preset === "azure" || preset === "firebase" || preset === "bun" || preset === "self-host" || preset === "farm") {
|
|
@@ -5,7 +5,7 @@ var FARM_DEPLOYMENT_COOKIE = "__farm_deployment";
|
|
|
5
5
|
var FARM_DEPLOYMENT_MISMATCH_CODE = "FARM_DEPLOYMENT_MISMATCH";
|
|
6
6
|
var FARM_DEPLOYMENT_MISMATCH_STATUS = 409;
|
|
7
7
|
function getFarmPresetRuntime(preset) {
|
|
8
|
-
if (preset === "cloudflare" || preset === "cloudflare-pages" || preset === "cloudflare-module" || preset === "netlify-edge" || preset === "
|
|
8
|
+
if (preset === "cloudflare" || preset === "cloudflare-pages" || preset === "cloudflare-module" || preset === "netlify-edge" || preset === "deno") {
|
|
9
9
|
return "edge";
|
|
10
10
|
}
|
|
11
11
|
if (preset === "node-server" || preset === "vercel" || preset === "netlify" || preset === "aws-lambda" || preset === "azure" || preset === "firebase" || preset === "bun" || preset === "self-host" || preset === "farm") {
|