@farm.js/core 0.1.47 → 0.1.48
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/after.cjs +3 -3
- package/dist/after.mjs +2 -2
- package/dist/agent-mcp-CXN3g0eX.d.mts +115 -0
- package/dist/agent-mcp-DAjB8Eyu.d.ts +115 -0
- package/dist/agent-mcp-handler-RT3COCEL.cjs +18 -0
- package/dist/agent-mcp-handler-WWCC4GLG.mjs +18 -0
- package/dist/agent-runtime.cjs +33 -61
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/agent-runtime.mjs +32 -60
- package/dist/api/client.cjs +14 -14
- package/dist/api/client.mjs +13 -13
- package/dist/api/route-manager.cjs +41 -41
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/route-manager.mjs +40 -40
- package/dist/api/runtime.cjs +23 -23
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api/runtime.mjs +22 -22
- package/dist/api.cjs +52 -52
- package/dist/api.d.mts +3 -3
- package/dist/api.d.ts +3 -3
- package/dist/api.mjs +51 -51
- package/dist/app-DytgRPjJ.d.mts +562 -0
- package/dist/app-VK9sHDn5.d.ts +562 -0
- package/dist/app-manifest-BUu7YGAx.d.ts +120 -0
- package/dist/app-manifest-DPgW5ke5.d.mts +120 -0
- package/dist/app-markdown.cjs +14 -15
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/app-markdown.mjs +13 -14
- package/dist/cache.cjs +8 -8
- package/dist/cache.mjs +7 -7
- package/dist/chunk-22W4FNTG.mjs +538 -0
- package/dist/chunk-23LVFSID.mjs +182 -0
- package/dist/chunk-2DA7CLY7.mjs +560 -0
- package/dist/chunk-2DLGV2ZG.mjs +71 -0
- package/dist/chunk-2H3FJYY6.mjs +78 -0
- package/dist/chunk-2HW5LWAH.cjs +19 -0
- package/dist/chunk-2KMIJDY6.cjs +20 -0
- package/dist/chunk-2NGZFOKG.mjs +190 -0
- package/dist/chunk-2NHOYYUT.mjs +2250 -0
- package/dist/chunk-2SVJGOAX.mjs +206 -0
- package/dist/chunk-2WZTGPK6.mjs +65 -0
- package/dist/chunk-2XGBJSDV.cjs +408 -0
- package/dist/chunk-3BIASUGR.cjs +59 -0
- package/dist/chunk-3EEET2Q5.cjs +1044 -0
- package/dist/chunk-3EIPOTZV.cjs +272 -0
- package/dist/chunk-3HBFI373.cjs +227 -0
- package/dist/chunk-45EUIICW.mjs +15 -0
- package/dist/chunk-46P5KNTE.mjs +8 -0
- package/dist/chunk-47JV57DA.cjs +69 -0
- package/dist/chunk-4DCWVSL2.cjs +15 -0
- package/dist/chunk-4HBKBHVP.mjs +36 -0
- package/dist/chunk-4IICUBQX.cjs +657 -0
- package/dist/chunk-4MU4QCX4.mjs +158 -0
- package/dist/chunk-4S7M63WX.cjs +91 -0
- package/dist/chunk-4ZJ5C7UJ.cjs +75 -0
- package/dist/chunk-52Y3C3HG.mjs +421 -0
- package/dist/chunk-53EHWHT2.cjs +166 -0
- package/dist/chunk-5566GNEG.cjs +410 -0
- package/dist/chunk-5C7XMKQ4.cjs +410 -0
- package/dist/chunk-5DX3O6TT.cjs +266 -0
- package/dist/chunk-5J45H65F.mjs +48 -0
- package/dist/chunk-5OJVKXFV.cjs +2072 -0
- package/dist/chunk-5PKDHKQP.cjs +81 -0
- package/dist/chunk-5PZJ63PK.mjs +17 -0
- package/dist/chunk-5Y2P454O.cjs +421 -0
- package/dist/chunk-5Y4GYKKH.mjs +13 -0
- package/dist/chunk-5YPBFMBN.cjs +19 -0
- package/dist/chunk-6BLAY2VQ.mjs +45 -0
- package/dist/chunk-6CTFVBAT.cjs +29 -0
- package/dist/chunk-6FXBJPF5.cjs +35 -0
- package/dist/chunk-6HRAK7I5.mjs +215 -0
- package/dist/chunk-6IOZPJ3I.cjs +549 -0
- package/dist/chunk-6JHZPB52.cjs +538 -0
- package/dist/chunk-6LH33DLL.cjs +34 -0
- package/dist/chunk-6M3HXUBQ.mjs +135 -0
- package/dist/chunk-6ONBZGVH.cjs +124 -0
- package/dist/chunk-6XFGJBYX.cjs +78 -0
- package/dist/chunk-6XQSPIN6.cjs +155 -0
- package/dist/chunk-6YFC3ZFX.mjs +449 -0
- package/dist/chunk-6ZFRWRHO.mjs +54 -0
- package/dist/chunk-72D2NX77.mjs +293 -0
- package/dist/chunk-72KABRWN.mjs +2072 -0
- package/dist/chunk-72KCTHLV.cjs +723 -0
- package/dist/chunk-73XBJRZW.cjs +462 -0
- package/dist/chunk-75XSZIRE.mjs +180 -0
- package/dist/chunk-7EPYN7GW.cjs +30 -0
- package/dist/chunk-7H4SVNC4.cjs +700 -0
- package/dist/chunk-7JUIK547.cjs +62 -0
- package/dist/chunk-7KJJ4SBS.cjs +13 -0
- package/dist/chunk-7PTISZSQ.cjs +176 -0
- package/dist/chunk-7S7AAK2D.mjs +82 -0
- package/dist/chunk-A25FXJ7D.cjs +38 -0
- package/dist/chunk-A4PWGL46.mjs +141 -0
- package/dist/chunk-A7DK663W.cjs +577 -0
- package/dist/chunk-ALD2WMLA.mjs +387 -0
- package/dist/chunk-AOKXITZ6.cjs +16 -0
- package/dist/chunk-ATHPRVP2.mjs +651 -0
- package/dist/chunk-ATYTLVSI.cjs +45 -0
- package/dist/chunk-AXRNEVCS.cjs +150 -0
- package/dist/chunk-AY2YD5ZX.mjs +34 -0
- package/dist/chunk-AYP2YFVN.mjs +168 -0
- package/dist/chunk-AZQXXXDX.mjs +80 -0
- package/dist/chunk-B5BBTPJQ.cjs +44 -0
- package/dist/chunk-BBPDJGCU.cjs +157 -0
- package/dist/chunk-BEXYFR2R.cjs +527 -0
- package/dist/chunk-BLD5GVCG.mjs +152 -0
- package/dist/chunk-BMQAPZXD.mjs +31 -0
- package/dist/chunk-BNH53KOT.cjs +69 -0
- package/dist/chunk-BNMHXVLL.mjs +239 -0
- package/dist/chunk-BOVGCUDZ.cjs +35 -0
- package/dist/chunk-BPAXGCKX.mjs +166 -0
- package/dist/chunk-BPNOYILC.cjs +450 -0
- package/dist/chunk-BR5FSKZ5.cjs +1457 -0
- package/dist/chunk-BRWIVOV4.cjs +48 -0
- package/dist/chunk-BTZ5O6VM.cjs +14 -0
- package/dist/chunk-BUC3FDYC.cjs +158 -0
- package/dist/chunk-C2R5RVLA.cjs +800 -0
- package/dist/chunk-C5JXCUKR.mjs +905 -0
- package/dist/chunk-C64XOPBZ.mjs +380 -0
- package/dist/chunk-C6U66WWF.mjs +410 -0
- package/dist/chunk-C7425KDG.cjs +406 -0
- package/dist/chunk-C7LCTVJ2.cjs +30 -0
- package/dist/chunk-CA7DNRHO.cjs +164 -0
- package/dist/chunk-CBJKDB6F.mjs +80 -0
- package/dist/chunk-CDTIXBKN.mjs +40 -0
- package/dist/chunk-CL2ONP73.cjs +180 -0
- package/dist/chunk-CQL5ZGFU.cjs +50 -0
- package/dist/chunk-CSLUBKGG.mjs +44 -0
- package/dist/chunk-CU5SYTJG.mjs +23 -0
- package/dist/chunk-CV6MFQ4Y.mjs +259 -0
- package/dist/chunk-D22BUQKW.cjs +82 -0
- package/dist/chunk-D2LCAV6L.mjs +79 -0
- package/dist/chunk-D4XGKF67.cjs +127 -0
- package/dist/chunk-D7Y63SOY.mjs +15 -0
- package/dist/chunk-DM3TFCC2.cjs +697 -0
- package/dist/chunk-DMAP4RND.cjs +998 -0
- package/dist/chunk-DQJ2CIH7.cjs +87 -0
- package/dist/chunk-DRFADSKY.mjs +697 -0
- package/dist/chunk-DU4VHHPJ.mjs +157 -0
- package/dist/chunk-DUIP64BF.cjs +16 -0
- package/dist/chunk-DV52ZS53.cjs +40 -0
- package/dist/chunk-DXUXQP2T.cjs +142 -0
- package/dist/chunk-E552H232.cjs +154 -0
- package/dist/chunk-E7QOEV5Z.cjs +449 -0
- package/dist/chunk-EA5PMJDU.mjs +527 -0
- package/dist/chunk-EDPENAVO.mjs +266 -0
- package/dist/chunk-EFLNOZGH.mjs +30 -0
- package/dist/chunk-EGHPFXPZ.cjs +590 -0
- package/dist/chunk-EJCVG25Z.mjs +49 -0
- package/dist/chunk-EMDGXYUD.mjs +75 -0
- package/dist/chunk-EOXPRC2C.cjs +48 -0
- package/dist/chunk-EQMTJBB7.cjs +161 -0
- package/dist/chunk-ERMUL73L.cjs +39 -0
- package/dist/chunk-ES2LD2YD.mjs +203 -0
- package/dist/chunk-ETF5C6HR.cjs +135 -0
- package/dist/chunk-EV4SBMPX.mjs +208 -0
- package/dist/chunk-EVCQX243.cjs +1923 -0
- package/dist/chunk-EVIWKPJV.cjs +560 -0
- package/dist/chunk-EVMXPJCB.mjs +133 -0
- package/dist/chunk-EXHEPWFJ.cjs +387 -0
- package/dist/chunk-EZTKXD6P.cjs +182 -0
- package/dist/chunk-F3N52U7S.mjs +138 -0
- package/dist/chunk-F6TLUMH7.mjs +172 -0
- package/dist/chunk-FBEBSAVI.cjs +225 -0
- package/dist/chunk-FEFCISOX.cjs +102 -0
- package/dist/chunk-FGJQS4EC.cjs +385 -0
- package/dist/chunk-FHURJABM.mjs +45 -0
- package/dist/chunk-GBMWLDCC.cjs +138 -0
- package/dist/chunk-GBPDSUFE.mjs +203 -0
- package/dist/chunk-GERUXONA.cjs +775 -0
- package/dist/chunk-GHNW564E.mjs +1044 -0
- package/dist/chunk-GL3ZDHKI.mjs +274 -0
- package/dist/chunk-GLOICKDO.mjs +142 -0
- package/dist/chunk-GSVJ3IIF.cjs +173 -0
- package/dist/chunk-GUZC226X.mjs +164 -0
- package/dist/chunk-GW4YUIHW.mjs +277 -0
- package/dist/chunk-GWXZS7K5.mjs +24 -0
- package/dist/chunk-GXSMF7UR.mjs +1923 -0
- package/dist/chunk-GYMGK467.mjs +214 -0
- package/dist/chunk-H227LYHT.mjs +88 -0
- package/dist/chunk-H4WUWLQR.mjs +16 -0
- package/dist/chunk-HA7YRO53.cjs +214 -0
- package/dist/chunk-HAH4FBTA.mjs +227 -0
- package/dist/chunk-HELQXYVI.cjs +1093 -0
- package/dist/chunk-HEPJIKKQ.cjs +190 -0
- package/dist/chunk-HIFIG6HL.cjs +341 -0
- package/dist/chunk-HLYRXN2I.cjs +242 -0
- package/dist/chunk-HNAISJFD.cjs +215 -0
- package/dist/chunk-HNAUK3SC.mjs +1181 -0
- package/dist/chunk-HPP2II4Z.mjs +332 -0
- package/dist/chunk-HRLYO2XJ.mjs +9 -0
- package/dist/chunk-HUL4LTC6.cjs +390 -0
- package/dist/chunk-HXNLKCWH.cjs +13 -0
- package/dist/chunk-HZOMT5DY.mjs +30 -0
- package/dist/chunk-I2BYNELA.cjs +380 -0
- package/dist/chunk-I2SWKWO7.mjs +453 -0
- package/dist/chunk-IAPTECEB.mjs +48 -0
- package/dist/chunk-IFTGERT3.mjs +408 -0
- package/dist/chunk-IGL6CO6M.mjs +9 -0
- package/dist/chunk-ITV4QQL2.cjs +93 -0
- package/dist/chunk-IUQLRTTO.mjs +159 -0
- package/dist/chunk-IWFV5ZED.cjs +152 -0
- package/dist/chunk-IXSMFKZ2.cjs +100 -0
- package/dist/chunk-IYEY3JWJ.mjs +186 -0
- package/dist/chunk-J2ZEVDEK.cjs +80 -0
- package/dist/chunk-J37KTQIA.cjs +905 -0
- package/dist/chunk-JATTVAHA.cjs +277 -0
- package/dist/chunk-JGAE5XPL.cjs +26 -0
- package/dist/chunk-JHXJBNLY.cjs +22 -0
- package/dist/chunk-JLS6ZLFM.cjs +9 -0
- package/dist/chunk-JMYXO572.cjs +531 -0
- package/dist/chunk-JNYFXL7X.mjs +62 -0
- package/dist/chunk-JOHXK4BB.mjs +385 -0
- package/dist/chunk-JPAVNDZH.cjs +712 -0
- package/dist/chunk-JRHGJVJH.mjs +44 -0
- package/dist/chunk-JUMPFVMK.mjs +78 -0
- package/dist/chunk-JWP56HCP.mjs +712 -0
- package/dist/chunk-JXIYH2NO.cjs +24 -0
- package/dist/chunk-JYT7AN37.cjs +79 -0
- package/dist/chunk-JZMZKABS.cjs +78 -0
- package/dist/chunk-K5EW7GUU.mjs +417 -0
- package/dist/chunk-K76CBYQM.mjs +157 -0
- package/dist/chunk-KBGZ5FD6.cjs +17 -0
- package/dist/chunk-KBRZAYI7.mjs +593 -0
- package/dist/chunk-KJMWAUKE.mjs +124 -0
- package/dist/chunk-KORZ6PRE.cjs +64 -0
- package/dist/chunk-KPAJWD3N.mjs +168 -0
- package/dist/chunk-KQH2COEJ.mjs +42 -0
- package/dist/chunk-KRRZJ77U.mjs +169 -0
- package/dist/chunk-KZT2VHRQ.cjs +894 -0
- package/dist/chunk-L5JDKFMQ.cjs +44 -0
- package/dist/chunk-L6QDME5Z.cjs +36 -0
- package/dist/chunk-LAZK6UV7.mjs +341 -0
- package/dist/chunk-LL7TDMOM.mjs +222 -0
- package/dist/chunk-LM2YOGDK.mjs +44 -0
- package/dist/chunk-LM55GS4R.mjs +38 -0
- package/dist/chunk-LNVGXUL3.cjs +172 -0
- package/dist/chunk-LSHX2H5G.cjs +57 -0
- package/dist/chunk-LZBM35DH.mjs +577 -0
- package/dist/chunk-M25IONJP.mjs +16 -0
- package/dist/chunk-MF3IA2AW.cjs +25 -0
- package/dist/chunk-MFQGU5CC.mjs +127 -0
- package/dist/chunk-MJ6IC4K2.mjs +34 -0
- package/dist/chunk-MNIR7I7B.mjs +217 -0
- package/dist/chunk-MPU5DOXX.cjs +21 -0
- package/dist/chunk-MTB57GOK.mjs +81 -0
- package/dist/chunk-MU5V7XHL.mjs +172 -0
- package/dist/chunk-MZZA6ZQV.mjs +113 -0
- package/dist/chunk-N25RPPO5.cjs +1963 -0
- package/dist/chunk-N33DLJBC.mjs +272 -0
- package/dist/chunk-N35YPV4N.mjs +48 -0
- package/dist/chunk-N6SIQJEJ.mjs +390 -0
- package/dist/chunk-N77JBPLC.mjs +1357 -0
- package/dist/chunk-N7SPZJLY.mjs +6166 -0
- package/dist/chunk-N7XWC6BN.mjs +21 -0
- package/dist/chunk-NBIVGHAT.mjs +50 -0
- package/dist/chunk-NCIAP562.mjs +27 -0
- package/dist/chunk-NE33FRQ5.mjs +11944 -0
- package/dist/chunk-NG44F7AH.mjs +150 -0
- package/dist/chunk-NIPKC4DA.mjs +800 -0
- package/dist/chunk-NJLTQR5P.cjs +293 -0
- package/dist/chunk-NR63PD3P.mjs +64 -0
- package/dist/chunk-NRFUVDTH.mjs +489 -0
- package/dist/chunk-NRNAHZ57.mjs +39 -0
- package/dist/chunk-NW2BKDVT.mjs +1963 -0
- package/dist/chunk-NYQSC4DX.cjs +593 -0
- package/dist/chunk-O4F3JUST.mjs +176 -0
- package/dist/chunk-OAJOQU5J.mjs +225 -0
- package/dist/chunk-OCS3PSYR.cjs +51 -0
- package/dist/chunk-OHWM2VI4.mjs +29 -0
- package/dist/chunk-OJO2GOM3.mjs +69 -0
- package/dist/chunk-OLGQZRW6.mjs +700 -0
- package/dist/chunk-ONG4RDW3.mjs +155 -0
- package/dist/chunk-OOJBBHYW.cjs +38 -0
- package/dist/chunk-OOZEU5KK.cjs +18 -0
- package/dist/chunk-OWQV6MLM.cjs +82 -0
- package/dist/chunk-OYZXVBZP.cjs +133 -0
- package/dist/chunk-OZC2JPW6.cjs +10 -0
- package/dist/chunk-P2355C6E.cjs +186 -0
- package/dist/chunk-PAKCHVUS.mjs +450 -0
- package/dist/chunk-PEHL3IZL.cjs +203 -0
- package/dist/chunk-PENBZAHJ.cjs +88 -0
- package/dist/chunk-PFV2KPDZ.cjs +172 -0
- package/dist/chunk-PO5MXV5X.cjs +13 -0
- package/dist/chunk-PSUYE5HR.mjs +25 -0
- package/dist/chunk-PTLXHRJZ.mjs +57 -0
- package/dist/chunk-PXEXOQ5R.mjs +135 -0
- package/dist/chunk-PZXYAWYG.cjs +274 -0
- package/dist/chunk-Q2ZKQ6GD.cjs +6166 -0
- package/dist/chunk-Q3UU2KXC.mjs +775 -0
- package/dist/chunk-Q5B4LNON.mjs +19 -0
- package/dist/chunk-QFQDRJKJ.mjs +666 -0
- package/dist/chunk-QGJ4FI2G.mjs +723 -0
- package/dist/chunk-QISW423S.cjs +335 -0
- package/dist/chunk-QNQEK3OF.cjs +666 -0
- package/dist/chunk-QPJ4MZTO.mjs +60 -0
- package/dist/chunk-QPNVDSFZ.mjs +18 -0
- package/dist/chunk-QQ44FYRO.cjs +27 -0
- package/dist/chunk-QSTRBKHZ.mjs +102 -0
- package/dist/chunk-R2SEZEBC.cjs +453 -0
- package/dist/chunk-R5U7OIPI.cjs +34 -0
- package/dist/chunk-R62SF5R4.mjs +410 -0
- package/dist/chunk-RD623KW4.cjs +203 -0
- package/dist/chunk-RFKTJTWZ.mjs +26 -0
- package/dist/chunk-RI3EVPKD.cjs +57 -0
- package/dist/chunk-RLEALQEN.mjs +998 -0
- package/dist/chunk-RVGLYMJM.cjs +259 -0
- package/dist/chunk-S32PDOLO.mjs +13 -0
- package/dist/chunk-S6O2L47H.mjs +549 -0
- package/dist/chunk-SBABQKPT.cjs +169 -0
- package/dist/chunk-SBDWCDS6.cjs +8 -0
- package/dist/chunk-SF3JB56B.mjs +82 -0
- package/dist/chunk-SG57PX7K.cjs +65 -0
- package/dist/chunk-SGBNF56S.cjs +44 -0
- package/dist/chunk-SHD265HW.cjs +19 -0
- package/dist/chunk-SHIWRBFI.cjs +17 -0
- package/dist/chunk-SM2SYWAR.cjs +49 -0
- package/dist/chunk-SNP33A33.cjs +9 -0
- package/dist/chunk-SSNN55Q6.cjs +651 -0
- package/dist/chunk-STF6VDYQ.cjs +23 -0
- package/dist/chunk-SVCUSOEF.mjs +590 -0
- package/dist/chunk-SXCL2MIN.cjs +208 -0
- package/dist/chunk-SYW346ZN.cjs +71 -0
- package/dist/chunk-TFA6BUAE.cjs +113 -0
- package/dist/chunk-TGSEVBPO.mjs +93 -0
- package/dist/chunk-TJVUTGED.mjs +531 -0
- package/dist/chunk-TQWGOQ7O.mjs +8606 -0
- package/dist/chunk-TTYXOAB7.mjs +657 -0
- package/dist/chunk-TUPKMMXT.mjs +173 -0
- package/dist/chunk-TVCFY3KK.cjs +217 -0
- package/dist/chunk-TXK4D46O.mjs +22 -0
- package/dist/chunk-UAQD67HM.mjs +154 -0
- package/dist/chunk-UCQ52TJY.mjs +406 -0
- package/dist/chunk-UIJOLBUL.mjs +19 -0
- package/dist/chunk-UPYIFH2H.cjs +168 -0
- package/dist/chunk-UUMKLGUU.mjs +69 -0
- package/dist/chunk-UYQOIPXE.mjs +368 -0
- package/dist/chunk-UYTAP4FQ.cjs +60 -0
- package/dist/chunk-UZCMMJJT.cjs +80 -0
- package/dist/chunk-V3UOEWCB.cjs +46 -0
- package/dist/chunk-V56632LA.cjs +141 -0
- package/dist/chunk-V7KTQR4C.cjs +15 -0
- package/dist/chunk-VCFBQFOV.mjs +1093 -0
- package/dist/chunk-VDLF2DJA.cjs +11947 -0
- package/dist/chunk-VE3FWJBO.mjs +46 -0
- package/dist/chunk-VFXE6NWR.mjs +87 -0
- package/dist/chunk-VHIXGZYH.mjs +9 -0
- package/dist/chunk-VISQDC6W.mjs +10 -0
- package/dist/chunk-VIXTAVEA.mjs +59 -0
- package/dist/chunk-VJXLUTBM.mjs +894 -0
- package/dist/chunk-VM57CK74.cjs +42 -0
- package/dist/chunk-VOQ7XZZT.cjs +157 -0
- package/dist/chunk-VR4SEDEM.mjs +1457 -0
- package/dist/chunk-VR6QLTTX.mjs +59 -0
- package/dist/chunk-VSLM6BHX.cjs +2250 -0
- package/dist/chunk-VU3MYZPO.mjs +432 -0
- package/dist/chunk-VXCFJWK5.cjs +59 -0
- package/dist/chunk-VZY7MAVS.cjs +432 -0
- package/dist/chunk-WB6XES4V.mjs +161 -0
- package/dist/chunk-WCLLPR6H.mjs +35 -0
- package/dist/chunk-WEGAVN37.cjs +45 -0
- package/dist/chunk-WJFFPXCV.cjs +1357 -0
- package/dist/chunk-WNDAISB7.mjs +51 -0
- package/dist/chunk-WNLPQW7W.mjs +19 -0
- package/dist/chunk-WQGRD5BJ.cjs +239 -0
- package/dist/chunk-WT6RAN2I.cjs +41 -0
- package/dist/chunk-WUEDTW6E.cjs +135 -0
- package/dist/chunk-WXFY5JIY.mjs +20 -0
- package/dist/chunk-WYL4ODZ4.mjs +38 -0
- package/dist/chunk-X333W5KV.cjs +31 -0
- package/dist/chunk-X3XUZWRB.mjs +141 -0
- package/dist/chunk-XGJVRPYL.cjs +141 -0
- package/dist/chunk-XLLVWLWO.mjs +100 -0
- package/dist/chunk-XLYXG73A.mjs +87 -0
- package/dist/chunk-XN2MB4QZ.cjs +206 -0
- package/dist/chunk-XO6WL6NL.mjs +462 -0
- package/dist/chunk-XQ4DPO4G.mjs +13 -0
- package/dist/chunk-XQSYOVCW.cjs +417 -0
- package/dist/chunk-XR2ZIBQK.mjs +57 -0
- package/dist/chunk-XURDCXNH.cjs +48 -0
- package/dist/chunk-XXB37YET.cjs +40 -0
- package/dist/chunk-Y3WG64CP.cjs +9 -0
- package/dist/chunk-Y6FXYEAI.mjs +10 -0
- package/dist/chunk-Y7NN63LS.mjs +40 -0
- package/dist/chunk-YDXLC4DW.cjs +54 -0
- package/dist/chunk-YP7YO3S3.mjs +17 -0
- package/dist/chunk-YQGZLCT4.cjs +368 -0
- package/dist/chunk-YSPMY4B7.cjs +8609 -0
- package/dist/chunk-YT3SLLZK.mjs +242 -0
- package/dist/chunk-YTVSWXEZ.cjs +168 -0
- package/dist/chunk-YVJV7Q2X.mjs +35 -0
- package/dist/chunk-YWPNIYUP.mjs +41 -0
- package/dist/chunk-YX6AFPXC.mjs +8 -0
- package/dist/chunk-Z5MZDFX4.cjs +159 -0
- package/dist/chunk-ZBS3GOQZ.cjs +222 -0
- package/dist/chunk-ZGS3ZDF7.cjs +489 -0
- package/dist/chunk-ZSIGEHSE.cjs +1181 -0
- package/dist/chunk-ZXK2EYQW.cjs +8 -0
- package/dist/client/lifecycle.cjs +3 -3
- package/dist/client/lifecycle.mjs +2 -2
- package/dist/client-plugins-BlEzV5FO.d.mts +3920 -0
- package/dist/client-plugins-DqjCsKMN.d.ts +3920 -0
- package/dist/client-plugins.cjs +3 -3
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client-plugins.mjs +2 -2
- package/dist/client.cjs +41 -41
- package/dist/client.d.mts +5 -5
- package/dist/client.d.ts +5 -5
- package/dist/client.mjs +42 -42
- package/dist/config.cjs +3 -3
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.mjs +2 -2
- package/dist/cron.cjs +9 -9
- package/dist/cron.mjs +8 -8
- package/dist/deferred.cjs +3 -3
- package/dist/deferred.mjs +2 -2
- package/dist/deployment.cjs +3 -3
- package/dist/deployment.mjs +2 -2
- package/dist/desktop.cjs +13 -0
- package/dist/desktop.d.mts +120 -0
- package/dist/desktop.d.ts +120 -0
- package/dist/desktop.mjs +13 -0
- package/dist/dev-guard-4NQ3LFO5.cjs +57 -0
- package/dist/dev-guard-MPZUJFIV.mjs +57 -0
- package/dist/devtools-A37WWJZL.cjs +463 -0
- package/dist/devtools-BLKHPY3C.mjs +463 -0
- package/dist/devtools-client-SU4XH46J.mjs +250 -0
- package/dist/devtools-client-X5OQCXDF.cjs +250 -0
- package/dist/devtools-ui-CYBVFLPH.mjs +1265 -0
- package/dist/devtools-ui-SYRUXUA7.cjs +1265 -0
- package/dist/docs.cjs +64 -64
- package/dist/docs.d.mts +2 -2
- package/dist/docs.d.ts +2 -2
- package/dist/docs.mjs +63 -63
- package/dist/env-types.cjs +4 -4
- package/dist/env-types.mjs +3 -3
- package/dist/env.cjs +4 -4
- package/dist/env.mjs +3 -3
- package/dist/environment/vite.cjs +7 -7
- package/dist/environment/vite.mjs +6 -6
- package/dist/environment.cjs +3 -3
- package/dist/environment.mjs +2 -2
- package/dist/font.cjs +3 -3
- package/dist/font.mjs +2 -2
- package/dist/headers.cjs +6 -6
- package/dist/headers.mjs +5 -5
- package/dist/i18n/client.cjs +19 -30
- package/dist/i18n/client.mjs +9 -20
- package/dist/i18n/index.cjs +6 -6
- package/dist/i18n/index.mjs +5 -5
- package/dist/i18n/server.cjs +10 -10
- package/dist/i18n/server.mjs +9 -9
- package/dist/image/server.cjs +6 -6
- package/dist/image/server.mjs +5 -5
- package/dist/image/sharp.cjs +15 -21
- package/dist/image/sharp.mjs +7 -13
- package/dist/image.cjs +9 -18
- package/dist/image.mjs +4 -13
- package/dist/index-CMigAr9f.d.mts +54 -0
- package/dist/index-n3hjOvVC.d.ts +54 -0
- package/dist/index.cjs +187 -196
- package/dist/index.d.mts +15 -15
- package/dist/index.d.ts +15 -15
- package/dist/index.mjs +217 -226
- package/dist/instrumentation.cjs +5 -5
- package/dist/instrumentation.mjs +4 -4
- package/dist/integration-orm-52GPGTHO.cjs +14 -0
- package/dist/integration-orm-CO23MSFE.mjs +14 -0
- package/dist/integrations.cjs +20 -20
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/integrations.mjs +19 -19
- package/dist/internal/app-markdown-runtime.cjs +12 -13
- package/dist/internal/app-markdown-runtime.d.mts +2 -2
- package/dist/internal/app-markdown-runtime.d.ts +2 -2
- package/dist/internal/app-markdown-runtime.mjs +11 -12
- package/dist/internal/build-runtime.cjs +152 -149
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +135 -132
- package/dist/internal/cli-runtime.cjs +88 -88
- package/dist/internal/cli-runtime.mjs +87 -87
- package/dist/internal/client-error-overlay.cjs +18 -49
- package/dist/internal/client-error-overlay.mjs +14 -45
- package/dist/internal/client-runtime.cjs +39 -53
- package/dist/internal/client-runtime.mjs +36 -50
- package/dist/internal/compression-runtime.cjs +4 -4
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/compression-runtime.mjs +3 -3
- package/dist/internal/config-runtime.cjs +85 -69
- package/dist/internal/config-runtime.d.mts +2 -2
- package/dist/internal/config-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.mjs +73 -57
- package/dist/internal/desktop-guard.cjs +17 -0
- package/dist/internal/desktop-guard.d.mts +45 -0
- package/dist/internal/desktop-guard.d.ts +45 -0
- package/dist/internal/desktop-guard.mjs +17 -0
- package/dist/internal/docs-precompiled-runtime.cjs +5 -17
- package/dist/internal/docs-precompiled-runtime.mjs +4 -16
- package/dist/internal/form-actions-client.cjs +1 -5
- package/dist/internal/form-actions-client.mjs +1 -5
- package/dist/internal/form-actions.cjs +10 -10
- package/dist/internal/form-actions.mjs +9 -9
- package/dist/internal/infra-analytics-runtime.cjs +22 -8
- package/dist/internal/infra-analytics-runtime.mjs +20 -6
- package/dist/internal/island-codec.cjs +4 -4
- package/dist/internal/island-codec.mjs +3 -3
- package/dist/internal/island-value-store.cjs +1 -4
- package/dist/internal/island-value-store.mjs +1 -4
- package/dist/internal/islands-runtime.cjs +46 -21
- package/dist/internal/islands-runtime.d.mts +31 -19
- package/dist/internal/islands-runtime.d.ts +31 -19
- package/dist/internal/islands-runtime.mjs +41 -16
- package/dist/internal/islands-server.cjs +6 -9
- package/dist/internal/islands-server.mjs +5 -8
- package/dist/internal/islx-client.cjs +1 -1
- package/dist/internal/islx-react.cjs +1 -1
- package/dist/internal/islx-server.cjs +1 -1
- package/dist/internal/isolated-boundary.cjs +5 -5
- package/dist/internal/isolated-boundary.mjs +4 -4
- package/dist/internal/metadata-image-runtime.cjs +8 -8
- package/dist/internal/metadata-image-runtime.d.mts +6 -1
- package/dist/internal/metadata-image-runtime.d.ts +6 -1
- package/dist/internal/metadata-image-runtime.mjs +7 -7
- package/dist/internal/product-telemetry-runtime.cjs +5 -17
- package/dist/internal/product-telemetry-runtime.mjs +3 -15
- package/dist/internal/production-node-env.cjs +3 -3
- package/dist/internal/production-node-env.mjs +2 -2
- package/dist/internal/production-runtime.cjs +102 -103
- package/dist/internal/production-runtime.d.mts +42 -11
- package/dist/internal/production-runtime.d.ts +42 -11
- package/dist/internal/production-runtime.mjs +114 -115
- package/dist/internal/request-cookies.cjs +3 -3
- package/dist/internal/request-cookies.mjs +2 -2
- package/dist/internal/server-tree.cjs +5 -5
- package/dist/internal/server-tree.mjs +4 -4
- package/dist/json-ld.cjs +3 -16
- package/dist/json-ld.mjs +3 -16
- package/dist/layers-DMRXRL7F.cjs +18 -0
- package/dist/layers-T55SA47E.mjs +18 -0
- package/dist/manager-2LUKNX2N.cjs +14 -0
- package/dist/manager-H5ZM3HAM.mjs +14 -0
- package/dist/markdown.cjs +11 -12
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/markdown.mjs +10 -11
- package/dist/middleware.cjs +31 -31
- package/dist/middleware.d.mts +3 -3
- package/dist/middleware.d.ts +3 -3
- package/dist/middleware.mjs +30 -30
- package/dist/navigation.cjs +22 -22
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/navigation.mjs +21 -21
- package/dist/nitro-BIXIKJZS.cjs +650 -0
- package/dist/nitro-UT2J5A5D.mjs +650 -0
- package/dist/node-module-bundle-7JHPPF6B.mjs +11 -0
- package/dist/node-module-bundle-YJGYBOGK.cjs +11 -0
- package/dist/observability.cjs +3 -3
- package/dist/observability.mjs +2 -2
- package/dist/og.cjs +1 -1
- package/dist/og.mjs +1 -1
- package/dist/platform.cjs +28 -0
- package/dist/platform.d.mts +23 -0
- package/dist/platform.d.ts +23 -0
- package/dist/platform.mjs +28 -0
- package/dist/plugin-4KYXV7BB.mjs +32 -0
- package/dist/plugin-WBANOZQM.cjs +32 -0
- package/dist/plugin.cjs +147 -144
- package/dist/plugin.d.mts +3 -3
- package/dist/plugin.d.ts +3 -3
- package/dist/plugin.mjs +127 -124
- package/dist/production-runtime-YVDGYWBG.d.ts +123 -0
- package/dist/production-runtime-bWZJMcQb.d.mts +123 -0
- package/dist/programmatic-routes-client-BFKOTEXN.d.mts +184 -0
- package/dist/programmatic-routes-client-DviwGeAv.d.ts +184 -0
- package/dist/query/client.cjs +59 -70
- package/dist/query/client.mjs +49 -60
- package/dist/query/index.cjs +4 -4
- package/dist/query/index.mjs +3 -3
- package/dist/query/parsers.cjs +3 -3
- package/dist/query/parsers.mjs +2 -2
- package/dist/query/server.cjs +5 -11
- package/dist/query/server.mjs +3 -9
- package/dist/render-plan-CS8l0zaK.d.mts +25 -0
- package/dist/render-plan-DqWXo3-B.d.ts +25 -0
- package/dist/renderer/react/client.cjs +1 -1
- package/dist/renderer/react/client.mjs +1 -1
- package/dist/renderer/react/server.cjs +10 -15
- package/dist/renderer/react/server.mjs +10 -15
- package/dist/renderer/react/vite.cjs +1 -4
- package/dist/renderer/react/vite.mjs +1 -4
- package/dist/renderer-client.cjs +67 -79
- package/dist/renderer-client.d.mts +3 -3
- package/dist/renderer-client.d.ts +3 -3
- package/dist/renderer-client.mjs +44 -56
- package/dist/renderer.cjs +3 -3
- package/dist/renderer.mjs +2 -2
- package/dist/request-CBrHpaCC.d.ts +24 -0
- package/dist/request-D4XqmnJF.d.mts +24 -0
- package/dist/request.cjs +4 -4
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/request.mjs +3 -3
- package/dist/route-rendering-3pRPtyO2.d.mts +44 -0
- package/dist/route-rendering-Bltnu8a3.d.ts +44 -0
- package/dist/router-BFSmKGtI.d.mts +50 -0
- package/dist/router-DDT7bkg7.d.ts +50 -0
- package/dist/router.cjs +5 -5
- package/dist/router.mjs +4 -4
- package/dist/routes.cjs +13 -13
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/routes.mjs +12 -12
- package/dist/rsc-pipeline-4KOITP64.cjs +80 -0
- package/dist/rsc-pipeline-ULFIB3UT.mjs +80 -0
- package/dist/runtime-C6yG64je.d.ts +69 -0
- package/dist/runtime-Cpylaypt.d.mts +69 -0
- package/dist/schema-dev-notice-O3I5HLXK.mjs +54 -0
- package/dist/schema-dev-notice-Z73J3NJ6.cjs +54 -0
- package/dist/schema.cjs +3 -3
- package/dist/schema.mjs +2 -2
- package/dist/search-client-BTXL5XWD.mjs +13 -0
- package/dist/search-client-QCYAL6AY.cjs +13 -0
- package/dist/server-action-security.cjs +8 -8
- package/dist/server-action-security.mjs +7 -7
- package/dist/server-fn-client.cjs +4 -4
- package/dist/server-fn-client.mjs +3 -3
- package/dist/server-fn.cjs +15 -15
- package/dist/server-fn.mjs +14 -14
- package/dist/server-plugins.cjs +15 -15
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server-plugins.mjs +14 -14
- package/dist/server-query-client.cjs +8 -8
- package/dist/server-query-client.mjs +7 -7
- package/dist/server-query.cjs +17 -17
- package/dist/server-query.mjs +16 -16
- package/dist/server.cjs +215 -219
- package/dist/server.d.mts +9 -9
- package/dist/server.d.ts +9 -9
- package/dist/server.mjs +178 -182
- package/dist/spa-router-CKuS81mi.d.ts +239 -0
- package/dist/spa-router-CkTPnA4L.d.mts +239 -0
- package/dist/storage.cjs +3 -3
- package/dist/storage.mjs +2 -2
- package/dist/testing.cjs +57 -77
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.mjs +46 -66
- package/dist/theme/client.cjs +5 -5
- package/dist/theme/client.mjs +4 -4
- package/dist/theme/index.cjs +3 -3
- package/dist/theme/index.mjs +2 -2
- package/dist/theme/runtime.cjs +3 -3
- package/dist/theme/runtime.mjs +2 -2
- package/dist/theme/server.cjs +8 -8
- package/dist/theme/server.mjs +7 -7
- package/dist/utils-C0ORLYXc.d.ts +48 -0
- package/dist/utils-IA9wVkef.d.mts +48 -0
- package/dist/version.cjs +3 -3
- package/dist/version.mjs +2 -2
- package/dist/vite.cjs +152 -149
- package/dist/vite.d.mts +4 -4
- package/dist/vite.d.ts +4 -4
- package/dist/vite.mjs +127 -124
- package/dist/workflows.cjs +14 -14
- package/dist/workflows.mjs +13 -13
- package/package.json +26 -2
- package/dist/agent-mcp-BtK_KZ1m.d.ts +0 -115
- package/dist/agent-mcp-Cc-ypyNi.d.mts +0 -115
- package/dist/agent-mcp-handler-HVV5LNXF.mjs +0 -19
- package/dist/agent-mcp-handler-YKG7KVCY.cjs +0 -19
- package/dist/app-2SBLAaNq.d.mts +0 -554
- package/dist/app-BlXGEpdA.d.ts +0 -554
- package/dist/app-manifest-D1Tgp8ya.d.ts +0 -120
- package/dist/app-manifest-nZHIvS3a.d.mts +0 -120
- package/dist/chunk-25LPIZSX.cjs +0 -576
- package/dist/chunk-26CXZR6L.mjs +0 -1242
- package/dist/chunk-26RUNDIR.mjs +0 -2355
- package/dist/chunk-2A3EQHXX.mjs +0 -173
- package/dist/chunk-2CQ74SP6.cjs +0 -13
- package/dist/chunk-2DZFF7F7.cjs +0 -11810
- package/dist/chunk-2FUIT2G2.cjs +0 -85
- package/dist/chunk-2GVF3C2F.cjs +0 -616
- package/dist/chunk-2J7W2WND.mjs +0 -149
- package/dist/chunk-2NROIAA6.cjs +0 -6066
- package/dist/chunk-2NXO5SBY.mjs +0 -57
- package/dist/chunk-2PQNJXFM.mjs +0 -20
- package/dist/chunk-2SJ4RQ6P.cjs +0 -57
- package/dist/chunk-2SLWGLZ7.mjs +0 -8620
- package/dist/chunk-2UC36WAC.mjs +0 -22
- package/dist/chunk-2VQKKQ6D.mjs +0 -51
- package/dist/chunk-2Y3JRYVG.mjs +0 -71
- package/dist/chunk-37VKVISD.mjs +0 -2042
- package/dist/chunk-3BROEWFY.cjs +0 -39
- package/dist/chunk-3HEQSCVV.mjs +0 -9
- package/dist/chunk-3SAWHWDH.cjs +0 -186
- package/dist/chunk-3XEMGDBF.cjs +0 -1242
- package/dist/chunk-44SYJEG3.mjs +0 -13
- package/dist/chunk-45QJHGZM.cjs +0 -1063
- package/dist/chunk-45ZSJLDT.mjs +0 -183
- package/dist/chunk-4GP3XZ4Z.mjs +0 -595
- package/dist/chunk-4JCQDWPX.mjs +0 -24
- package/dist/chunk-4KQDHTWX.mjs +0 -487
- package/dist/chunk-4OOBRCJX.mjs +0 -300
- package/dist/chunk-4PPEPOZZ.cjs +0 -21
- package/dist/chunk-4RB44K6Z.mjs +0 -94
- package/dist/chunk-4SIYUGRY.mjs +0 -93
- package/dist/chunk-4TLUFAIP.cjs +0 -92
- package/dist/chunk-4U5XZDLG.cjs +0 -80
- package/dist/chunk-4ZZNPK25.mjs +0 -178
- package/dist/chunk-53ZV6K65.mjs +0 -241
- package/dist/chunk-54UPOYFS.mjs +0 -35
- package/dist/chunk-55YI3RRB.mjs +0 -192
- package/dist/chunk-5LPHJZSI.cjs +0 -241
- package/dist/chunk-5NAVKJCZ.cjs +0 -435
- package/dist/chunk-5NIWBWDD.mjs +0 -97
- package/dist/chunk-5QIKR7RR.cjs +0 -224
- package/dist/chunk-5WI2S4CO.mjs +0 -20
- package/dist/chunk-63H6BKXG.cjs +0 -389
- package/dist/chunk-64SBBZDU.cjs +0 -102
- package/dist/chunk-666CKENS.mjs +0 -49
- package/dist/chunk-6BWKJ6QS.cjs +0 -43
- package/dist/chunk-6D24SDKO.cjs +0 -145
- package/dist/chunk-6EODJYCX.cjs +0 -183
- package/dist/chunk-6EXBPJ24.cjs +0 -434
- package/dist/chunk-6IZWX6ES.cjs +0 -74
- package/dist/chunk-6LVRDOAW.mjs +0 -74
- package/dist/chunk-6MVFHNYZ.cjs +0 -1033
- package/dist/chunk-6NT6S2VQ.mjs +0 -180
- package/dist/chunk-6QOLZITB.cjs +0 -22
- package/dist/chunk-6QQDAAAZ.cjs +0 -38
- package/dist/chunk-72ADZ6GQ.cjs +0 -19
- package/dist/chunk-72AK62H5.mjs +0 -55
- package/dist/chunk-73WX6PRY.mjs +0 -575
- package/dist/chunk-75RZHGLS.cjs +0 -135
- package/dist/chunk-7GNWGLWB.mjs +0 -14
- package/dist/chunk-7IQQIPRZ.mjs +0 -55
- package/dist/chunk-7LTCDQRS.mjs +0 -166
- package/dist/chunk-7P475T2X.mjs +0 -11809
- package/dist/chunk-7RNAKBWF.cjs +0 -40
- package/dist/chunk-7UEEHAW7.mjs +0 -576
- package/dist/chunk-7W3CPVXS.cjs +0 -24
- package/dist/chunk-A6WIQH5Z.cjs +0 -31
- package/dist/chunk-AELACLOB.mjs +0 -47
- package/dist/chunk-AI7QMY7O.cjs +0 -41
- package/dist/chunk-ALPWLT27.cjs +0 -291
- package/dist/chunk-AMDMVWMI.cjs +0 -39
- package/dist/chunk-APDGOKKE.cjs +0 -148
- package/dist/chunk-ARJWXNQL.cjs +0 -256
- package/dist/chunk-AZBSVLRM.cjs +0 -132
- package/dist/chunk-B2GSRB3P.mjs +0 -1033
- package/dist/chunk-B6XAA7V6.cjs +0 -2042
- package/dist/chunk-BCMSYSN2.mjs +0 -183
- package/dist/chunk-BIDYX3SL.cjs +0 -91
- package/dist/chunk-BJIYRUGQ.mjs +0 -35
- package/dist/chunk-BMOBTMDR.cjs +0 -178
- package/dist/chunk-BOYNDCZL.mjs +0 -54
- package/dist/chunk-BPNRQ5BA.mjs +0 -690
- package/dist/chunk-BRYHOB4X.mjs +0 -18
- package/dist/chunk-BTHHUD7Q.mjs +0 -51
- package/dist/chunk-BUGNQIHC.mjs +0 -449
- package/dist/chunk-C4NCTZLM.mjs +0 -22
- package/dist/chunk-C5GUTBZK.cjs +0 -173
- package/dist/chunk-CALY6QG6.mjs +0 -963
- package/dist/chunk-CBBLJMR5.mjs +0 -74
- package/dist/chunk-CBXBGM72.cjs +0 -212
- package/dist/chunk-CEDPEDNW.cjs +0 -98
- package/dist/chunk-CGR525MJ.cjs +0 -357
- package/dist/chunk-CGVPXIRN.cjs +0 -472
- package/dist/chunk-CMGMGHUZ.cjs +0 -27
- package/dist/chunk-CNOQY6Z7.mjs +0 -156
- package/dist/chunk-COABSY3U.mjs +0 -196
- package/dist/chunk-CQ6OSQ3K.mjs +0 -36
- package/dist/chunk-CU625VAY.mjs +0 -13
- package/dist/chunk-CW6SNEN2.cjs +0 -727
- package/dist/chunk-CXP5U3RW.cjs +0 -54
- package/dist/chunk-CY2ZQ5C6.cjs +0 -56
- package/dist/chunk-CZS6OACQ.mjs +0 -63
- package/dist/chunk-D4ROBNTK.cjs +0 -1378
- package/dist/chunk-D5IHNDHI.cjs +0 -367
- package/dist/chunk-D5RFPV2H.mjs +0 -148
- package/dist/chunk-D64OPY6A.cjs +0 -710
- package/dist/chunk-D7JTOLFK.cjs +0 -285
- package/dist/chunk-DAATZTKJ.mjs +0 -220
- package/dist/chunk-DMRPN25V.mjs +0 -701
- package/dist/chunk-DVM4FKZL.cjs +0 -169
- package/dist/chunk-E22SWCXB.cjs +0 -144
- package/dist/chunk-EMLAPBEM.mjs +0 -256
- package/dist/chunk-ETPEZLS3.mjs +0 -367
- package/dist/chunk-F3VB7ONA.mjs +0 -338
- package/dist/chunk-F646BZ4Y.mjs +0 -581
- package/dist/chunk-FA2W42OV.mjs +0 -25
- package/dist/chunk-FEYQCYT7.cjs +0 -823
- package/dist/chunk-FGH3ZXTP.mjs +0 -1063
- package/dist/chunk-FIAPD365.mjs +0 -85
- package/dist/chunk-FJ3M4CUX.cjs +0 -46
- package/dist/chunk-FK6GO24V.cjs +0 -54
- package/dist/chunk-FP2INE7H.mjs +0 -113
- package/dist/chunk-FQUKOELE.mjs +0 -6066
- package/dist/chunk-FVPXT2JR.cjs +0 -63
- package/dist/chunk-FWCGUVVL.mjs +0 -86
- package/dist/chunk-FXFKIJDA.cjs +0 -168
- package/dist/chunk-G2KY33I6.mjs +0 -202
- package/dist/chunk-G2Z5DGMS.cjs +0 -581
- package/dist/chunk-G4MWPDSE.mjs +0 -19
- package/dist/chunk-G643DQCH.cjs +0 -13
- package/dist/chunk-G7HXGLEC.cjs +0 -175
- package/dist/chunk-GB7LDGY5.cjs +0 -2355
- package/dist/chunk-GC3EM6H4.mjs +0 -80
- package/dist/chunk-GCXWJJKH.mjs +0 -169
- package/dist/chunk-GHFS7RUB.mjs +0 -152
- package/dist/chunk-GS3WR5HX.cjs +0 -595
- package/dist/chunk-GZTUT75U.mjs +0 -293
- package/dist/chunk-GZWHCWLB.mjs +0 -186
- package/dist/chunk-H3EGVQE5.mjs +0 -22
- package/dist/chunk-H4AMB6ZE.mjs +0 -421
- package/dist/chunk-H4LXPWI2.mjs +0 -46
- package/dist/chunk-H77NVNJ2.mjs +0 -57
- package/dist/chunk-H7BLEEAE.cjs +0 -57
- package/dist/chunk-HANGSYMB.mjs +0 -67
- package/dist/chunk-HJ64F4GS.mjs +0 -537
- package/dist/chunk-HKFBMHCD.mjs +0 -291
- package/dist/chunk-HLJ6MBUZ.cjs +0 -183
- package/dist/chunk-HREOKQWT.cjs +0 -45
- package/dist/chunk-I2BHUNBU.mjs +0 -14
- package/dist/chunk-I57LW5VZ.cjs +0 -94
- package/dist/chunk-I5MG3TKE.cjs +0 -487
- package/dist/chunk-I6UVKUYK.mjs +0 -1378
- package/dist/chunk-IE7XCHH3.cjs +0 -85
- package/dist/chunk-IF4NU2NG.mjs +0 -314
- package/dist/chunk-IFWSR7YZ.cjs +0 -416
- package/dist/chunk-IHQIOZLC.mjs +0 -65
- package/dist/chunk-IK6LVLKC.cjs +0 -51
- package/dist/chunk-IM7DY3ED.mjs +0 -40
- package/dist/chunk-IN6RCKLL.mjs +0 -396
- package/dist/chunk-INQ64HTJ.mjs +0 -696
- package/dist/chunk-IOAUK4OI.cjs +0 -2162
- package/dist/chunk-IOEH4VWN.mjs +0 -202
- package/dist/chunk-IOMVXBLZ.mjs +0 -144
- package/dist/chunk-IXFOBGLQ.cjs +0 -1120
- package/dist/chunk-J7FSKED3.cjs +0 -93
- package/dist/chunk-J7K2NZD6.mjs +0 -56
- package/dist/chunk-JAXDRRRC.cjs +0 -701
- package/dist/chunk-JBSVKMC5.mjs +0 -28
- package/dist/chunk-JDNHKPTD.cjs +0 -22
- package/dist/chunk-JEIG3EWE.cjs +0 -690
- package/dist/chunk-JEZO6VUR.cjs +0 -35
- package/dist/chunk-JGHCKIRI.mjs +0 -580
- package/dist/chunk-JGLC4TO3.cjs +0 -192
- package/dist/chunk-JM5XPKWH.mjs +0 -41
- package/dist/chunk-JNZ4TDWM.mjs +0 -445
- package/dist/chunk-JOW4HDJO.mjs +0 -179
- package/dist/chunk-JPLUGGRV.mjs +0 -230
- package/dist/chunk-JVXW76I7.mjs +0 -727
- package/dist/chunk-KCMTCM6I.cjs +0 -53
- package/dist/chunk-KEXK442I.cjs +0 -696
- package/dist/chunk-KF6VDJH7.cjs +0 -86
- package/dist/chunk-KFZZFZ7J.cjs +0 -46
- package/dist/chunk-KGB5UXJJ.mjs +0 -27
- package/dist/chunk-KGZIORNL.cjs +0 -43
- package/dist/chunk-KI3MESHB.mjs +0 -224
- package/dist/chunk-KNBBQHO2.cjs +0 -51
- package/dist/chunk-KNHBTJP6.mjs +0 -472
- package/dist/chunk-KQANE4Q4.mjs +0 -1210
- package/dist/chunk-KR6CKSXT.cjs +0 -15
- package/dist/chunk-KYN5ODF6.mjs +0 -62
- package/dist/chunk-L3KT7IXV.mjs +0 -91
- package/dist/chunk-L5H2GSUC.cjs +0 -49
- package/dist/chunk-L6A26QT5.cjs +0 -537
- package/dist/chunk-LCCBO7PJ.cjs +0 -46
- package/dist/chunk-LFHCG2DU.mjs +0 -43
- package/dist/chunk-LIUGYUX3.cjs +0 -22
- package/dist/chunk-LIZTLA5F.cjs +0 -396
- package/dist/chunk-LLUA2LSC.mjs +0 -157
- package/dist/chunk-LPE3ED4R.cjs +0 -929
- package/dist/chunk-LPEX4YW6.mjs +0 -13
- package/dist/chunk-LRJRXXQZ.cjs +0 -109
- package/dist/chunk-LTNGXMQ6.cjs +0 -55
- package/dist/chunk-LYLEZIG3.cjs +0 -73
- package/dist/chunk-LYV44OIR.mjs +0 -256
- package/dist/chunk-LZESP4IR.cjs +0 -575
- package/dist/chunk-M2L4MYDQ.cjs +0 -14
- package/dist/chunk-M3BXTWJM.mjs +0 -467
- package/dist/chunk-M7MKQXAF.cjs +0 -87
- package/dist/chunk-MEASUNVY.mjs +0 -440
- package/dist/chunk-MGMF4VP7.mjs +0 -102
- package/dist/chunk-MHHCLYXU.mjs +0 -236
- package/dist/chunk-MN4TQJ3W.cjs +0 -157
- package/dist/chunk-MQ3H6LT5.cjs +0 -202
- package/dist/chunk-MWSK6C4J.cjs +0 -18
- package/dist/chunk-MWWVKDW3.cjs +0 -169
- package/dist/chunk-MY5PZYAD.cjs +0 -2083
- package/dist/chunk-N46M65CI.mjs +0 -54
- package/dist/chunk-N4UOK6ZI.cjs +0 -256
- package/dist/chunk-NBPNUQYO.cjs +0 -179
- package/dist/chunk-NFG4PUPI.cjs +0 -64
- package/dist/chunk-NFME7OKZ.cjs +0 -109
- package/dist/chunk-NO3WWW3N.cjs +0 -192
- package/dist/chunk-NPC7VWJE.mjs +0 -277
- package/dist/chunk-NYJMY3JA.cjs +0 -156
- package/dist/chunk-NZKJGRB3.cjs +0 -230
- package/dist/chunk-O6BCQV2T.mjs +0 -46
- package/dist/chunk-O7BH5O46.mjs +0 -175
- package/dist/chunk-O7USYJ4U.mjs +0 -64
- package/dist/chunk-OF4TXHM4.cjs +0 -9
- package/dist/chunk-OHY2ZWUG.cjs +0 -25
- package/dist/chunk-OI6CMLWX.cjs +0 -47
- package/dist/chunk-OILHPMFX.cjs +0 -580
- package/dist/chunk-OJ7JP7RJ.mjs +0 -212
- package/dist/chunk-ONUEYC6N.mjs +0 -27
- package/dist/chunk-OT6ZEW74.mjs +0 -139
- package/dist/chunk-OX6O6WVA.cjs +0 -74
- package/dist/chunk-OYEUREB6.cjs +0 -35
- package/dist/chunk-OYZGFRPA.mjs +0 -714
- package/dist/chunk-OZVEHHMA.cjs +0 -194
- package/dist/chunk-P2UJF4SS.mjs +0 -823
- package/dist/chunk-P4TYB4SF.cjs +0 -417
- package/dist/chunk-P7XDC7UJ.mjs +0 -92
- package/dist/chunk-PCOTGFSM.cjs +0 -139
- package/dist/chunk-PDU4P2IC.cjs +0 -467
- package/dist/chunk-PJ42JESY.cjs +0 -87
- package/dist/chunk-PJEHUSHA.mjs +0 -229
- package/dist/chunk-PNGWZFUQ.mjs +0 -39
- package/dist/chunk-PSV6XKPO.cjs +0 -220
- package/dist/chunk-PZYCPSCC.cjs +0 -35
- package/dist/chunk-Q5B3KJBP.cjs +0 -152
- package/dist/chunk-Q5F32A26.cjs +0 -8621
- package/dist/chunk-QBK2AA4U.cjs +0 -445
- package/dist/chunk-QCFBDFRS.mjs +0 -169
- package/dist/chunk-QCVE2OCI.cjs +0 -169
- package/dist/chunk-QCVIRVHE.mjs +0 -87
- package/dist/chunk-QE6VAKLT.mjs +0 -85
- package/dist/chunk-QGH2RQVF.mjs +0 -132
- package/dist/chunk-QHSH7IH4.mjs +0 -35
- package/dist/chunk-QIBP5EFA.cjs +0 -476
- package/dist/chunk-QNPEUFHQ.cjs +0 -27
- package/dist/chunk-QSG2IX4A.mjs +0 -109
- package/dist/chunk-QVKYGNVM.mjs +0 -27
- package/dist/chunk-QVYLBY73.mjs +0 -93
- package/dist/chunk-R3DS7A2T.mjs +0 -21
- package/dist/chunk-R3ZFQJEF.mjs +0 -616
- package/dist/chunk-R5A5KNVX.cjs +0 -20
- package/dist/chunk-R5JIFR6B.cjs +0 -42
- package/dist/chunk-RHAZ22ZN.mjs +0 -87
- package/dist/chunk-S34OBRMZ.mjs +0 -109
- package/dist/chunk-S3A45T7F.cjs +0 -166
- package/dist/chunk-S3FNNQHR.mjs +0 -31
- package/dist/chunk-S3JO3N4H.cjs +0 -17
- package/dist/chunk-S3ZEMCE6.mjs +0 -1120
- package/dist/chunk-S67OYZU7.mjs +0 -711
- package/dist/chunk-S6ENKNNG.mjs +0 -168
- package/dist/chunk-S6FJO323.cjs +0 -65
- package/dist/chunk-S7MTDRYA.cjs +0 -394
- package/dist/chunk-SAXPH6G5.mjs +0 -169
- package/dist/chunk-SBH2JLLF.cjs +0 -55
- package/dist/chunk-SEJ5N6SL.mjs +0 -38
- package/dist/chunk-SFGWNC43.mjs +0 -97
- package/dist/chunk-SGB4IW7K.mjs +0 -710
- package/dist/chunk-SGBZPZUW.mjs +0 -75
- package/dist/chunk-SHB3GYXI.mjs +0 -285
- package/dist/chunk-SK35NQKK.cjs +0 -27
- package/dist/chunk-SKK6UF5P.cjs +0 -755
- package/dist/chunk-SKNL7VA2.mjs +0 -42
- package/dist/chunk-SLQCDJSO.mjs +0 -18
- package/dist/chunk-SOR334EB.cjs +0 -149
- package/dist/chunk-SU7MH53P.cjs +0 -180
- package/dist/chunk-SVRTJOUF.cjs +0 -113
- package/dist/chunk-SZLNU3GJ.cjs +0 -293
- package/dist/chunk-T76H22WI.mjs +0 -2162
- package/dist/chunk-TFQG7TBC.mjs +0 -43
- package/dist/chunk-TI7UANHI.cjs +0 -77
- package/dist/chunk-TIWHTW3Q.cjs +0 -24
- package/dist/chunk-TKJZFIML.cjs +0 -20
- package/dist/chunk-TVGP4BBZ.mjs +0 -45
- package/dist/chunk-UFDAAQFX.cjs +0 -169
- package/dist/chunk-UFDV5N3C.cjs +0 -711
- package/dist/chunk-UIDWEU7M.mjs +0 -357
- package/dist/chunk-ULQOP5UI.mjs +0 -54
- package/dist/chunk-UP4CW6WP.mjs +0 -169
- package/dist/chunk-UQUEANTY.mjs +0 -2083
- package/dist/chunk-UQZ4AYTH.cjs +0 -168
- package/dist/chunk-US2QVW3E.cjs +0 -36
- package/dist/chunk-UXHS27O6.cjs +0 -75
- package/dist/chunk-UYIHRDE4.cjs +0 -97
- package/dist/chunk-V2FTMRS7.mjs +0 -223
- package/dist/chunk-VB6UCX3V.cjs +0 -421
- package/dist/chunk-VDRM36QB.cjs +0 -963
- package/dist/chunk-VEKFLAQM.cjs +0 -300
- package/dist/chunk-VHRS3MCW.cjs +0 -196
- package/dist/chunk-VNPXKF3G.cjs +0 -314
- package/dist/chunk-VQDBNVOO.cjs +0 -14
- package/dist/chunk-VQGKD7RV.mjs +0 -25
- package/dist/chunk-VTBXE6QG.mjs +0 -476
- package/dist/chunk-W3B4PKAW.mjs +0 -28
- package/dist/chunk-W4E7WMXE.cjs +0 -71
- package/dist/chunk-WBKEZXWE.cjs +0 -449
- package/dist/chunk-WDMIW6Q6.mjs +0 -145
- package/dist/chunk-WLHA5USH.cjs +0 -1514
- package/dist/chunk-WMAPPDMM.cjs +0 -28
- package/dist/chunk-WMBRZI5V.mjs +0 -416
- package/dist/chunk-WMHG64DA.mjs +0 -417
- package/dist/chunk-WMOGFOUJ.cjs +0 -223
- package/dist/chunk-WNSDDRNU.mjs +0 -24
- package/dist/chunk-WPJQN64R.mjs +0 -755
- package/dist/chunk-WROEFVNO.cjs +0 -236
- package/dist/chunk-WU7ZS3EM.cjs +0 -440
- package/dist/chunk-WWYXIECF.mjs +0 -929
- package/dist/chunk-X3GMHKO3.cjs +0 -62
- package/dist/chunk-X3NGFVRF.mjs +0 -237
- package/dist/chunk-XIZO5VDA.cjs +0 -1210
- package/dist/chunk-XJJVLDM6.mjs +0 -194
- package/dist/chunk-XJXBIP67.cjs +0 -277
- package/dist/chunk-XNPDONUH.mjs +0 -389
- package/dist/chunk-XSIRSMAS.cjs +0 -339
- package/dist/chunk-XUC6CFLE.mjs +0 -1514
- package/dist/chunk-XUGFRFD2.mjs +0 -39
- package/dist/chunk-XZNTNMHT.mjs +0 -15
- package/dist/chunk-Y5RG6B7S.mjs +0 -77
- package/dist/chunk-YFILVET3.mjs +0 -192
- package/dist/chunk-YFPGHF5F.cjs +0 -202
- package/dist/chunk-YHOCRI4H.mjs +0 -434
- package/dist/chunk-YJRZR7VU.cjs +0 -28
- package/dist/chunk-YKUEJ3MG.cjs +0 -229
- package/dist/chunk-YN2QEMMO.cjs +0 -714
- package/dist/chunk-YOZYCI6Z.mjs +0 -73
- package/dist/chunk-YWCYV7QC.cjs +0 -54
- package/dist/chunk-YX3DBN4M.cjs +0 -18
- package/dist/chunk-YYQVGKO5.mjs +0 -394
- package/dist/chunk-YZAKIXRL.cjs +0 -67
- package/dist/chunk-Z2RZJZIZ.mjs +0 -168
- package/dist/chunk-Z3HATSKO.mjs +0 -46
- package/dist/chunk-ZEG3OPIB.cjs +0 -93
- package/dist/chunk-ZLAT2CWY.mjs +0 -135
- package/dist/chunk-ZQRCSUSB.cjs +0 -25
- package/dist/chunk-ZTP3BJG6.cjs +0 -237
- package/dist/chunk-ZZGQD7A4.mjs +0 -435
- package/dist/chunk-ZZSRYEYU.mjs +0 -53
- package/dist/client-plugins-DEmIQo5R.d.mts +0 -3801
- package/dist/client-plugins-br48Hpmk.d.ts +0 -3801
- package/dist/devtools-5Q7VRKVH.cjs +0 -478
- package/dist/devtools-LJ4IGYGW.mjs +0 -478
- package/dist/devtools-client-CXQ6PXI6.cjs +0 -254
- package/dist/devtools-client-HJS2T34Y.mjs +0 -254
- package/dist/devtools-ui-5GBDIGMK.cjs +0 -1296
- package/dist/devtools-ui-5KDAVPIF.mjs +0 -1296
- package/dist/index-CyD9Rfso.d.ts +0 -48
- package/dist/index-_nhUt_dh.d.mts +0 -48
- package/dist/integration-orm-P2II2EBK.cjs +0 -14
- package/dist/integration-orm-RBKCIQYZ.mjs +0 -14
- package/dist/layers-UTB43B7A.mjs +0 -18
- package/dist/layers-VUWIOFEO.cjs +0 -18
- package/dist/manager-RT733VRK.mjs +0 -14
- package/dist/manager-XZ5TX7AO.cjs +0 -14
- package/dist/nitro-KDACKNHU.mjs +0 -654
- package/dist/nitro-NPGU6VBT.cjs +0 -654
- package/dist/node-module-bundle-L5L7JCZ4.mjs +0 -11
- package/dist/node-module-bundle-VAFZOXMJ.cjs +0 -11
- package/dist/plugin-DBBZ4JI2.cjs +0 -32
- package/dist/plugin-SYMK7PQ2.mjs +0 -32
- package/dist/production-runtime-BEbIyIUe.d.mts +0 -123
- package/dist/production-runtime-DsHjccVI.d.ts +0 -123
- package/dist/programmatic-routes-client-DlMKstmL.d.ts +0 -184
- package/dist/programmatic-routes-client-Dqr6tHND.d.mts +0 -184
- package/dist/render-plan-Bu6XOxNg.d.mts +0 -25
- package/dist/render-plan-MefW_fLC.d.ts +0 -25
- package/dist/request-BBe1B8Bk.d.mts +0 -24
- package/dist/request-CMsRJQK3.d.ts +0 -24
- package/dist/route-rendering-DTLNruPw.d.ts +0 -44
- package/dist/route-rendering-Do8tuYgh.d.mts +0 -44
- package/dist/router-BJreOZ-k.d.ts +0 -50
- package/dist/router-o2mZB9Y4.d.mts +0 -50
- package/dist/rsc-pipeline-4ZJ6GUVQ.cjs +0 -78
- package/dist/rsc-pipeline-KK6GFDET.mjs +0 -78
- package/dist/runtime-Cp5YZNz4.d.mts +0 -69
- package/dist/runtime-Da57KD8F.d.ts +0 -69
- package/dist/schema-dev-notice-77ZL23PL.cjs +0 -58
- package/dist/schema-dev-notice-BLXOS6U2.mjs +0 -58
- package/dist/search-client-G3RICOFU.cjs +0 -13
- package/dist/search-client-KR7YRIVR.mjs +0 -13
- package/dist/spa-router-CN2vc0GY.d.ts +0 -239
- package/dist/spa-router-COZLIB7k.d.mts +0 -239
- package/dist/utils-BAtVIHfw.d.mts +0 -48
- package/dist/utils-Y8MZrj4b.d.ts +0 -48
|
@@ -0,0 +1,1923 @@
|
|
|
1
|
+
import {
|
|
2
|
+
generateFarmDocsSearchBootstrapRuntime,
|
|
3
|
+
isFarmDocsSearchEnabled
|
|
4
|
+
} from "./chunk-WB6XES4V.mjs";
|
|
5
|
+
import {
|
|
6
|
+
FARM_NAVIGATION_HEAD_SELECTOR
|
|
7
|
+
} from "./chunk-WYL4ODZ4.mjs";
|
|
8
|
+
import {
|
|
9
|
+
docsEngine,
|
|
10
|
+
loadFarmDocsEngine
|
|
11
|
+
} from "./chunk-VE3FWJBO.mjs";
|
|
12
|
+
import {
|
|
13
|
+
resolveFarmDocsFontAssets,
|
|
14
|
+
toFarmDocsPublicFontAssets
|
|
15
|
+
} from "./chunk-NRNAHZ57.mjs";
|
|
16
|
+
import {
|
|
17
|
+
stampFarmCspNonce
|
|
18
|
+
} from "./chunk-22W4FNTG.mjs";
|
|
19
|
+
import {
|
|
20
|
+
farmAcceptQuality
|
|
21
|
+
} from "./chunk-N77JBPLC.mjs";
|
|
22
|
+
import {
|
|
23
|
+
matchesFarmIfNoneMatch
|
|
24
|
+
} from "./chunk-C6U66WWF.mjs";
|
|
25
|
+
|
|
26
|
+
// src/docs/handler.ts
|
|
27
|
+
import {
|
|
28
|
+
existsSync as existsSync2,
|
|
29
|
+
readdirSync as readdirSync2,
|
|
30
|
+
readFileSync as readFileSync2,
|
|
31
|
+
realpathSync as realpathSync2,
|
|
32
|
+
statSync as statSync2
|
|
33
|
+
} from "fs";
|
|
34
|
+
import path2 from "path";
|
|
35
|
+
import { marked, Renderer } from "marked";
|
|
36
|
+
import { highlight } from "sugar-high";
|
|
37
|
+
|
|
38
|
+
// src/docs/last-modified.ts
|
|
39
|
+
import { execFileSync } from "child_process";
|
|
40
|
+
import { existsSync, readFileSync, readdirSync, realpathSync, statSync } from "fs";
|
|
41
|
+
import path from "path";
|
|
42
|
+
var FARM_DOCS_LAST_MODIFIED_MANIFEST = ".farm-docs-last-modified.json";
|
|
43
|
+
var COMMIT_MARKER = "__FARM_DOCS_COMMIT__";
|
|
44
|
+
var DOCS_FILE_EXTENSIONS = /* @__PURE__ */ new Set([".md", ".mdx"]);
|
|
45
|
+
var manifestCache = /* @__PURE__ */ new Map();
|
|
46
|
+
function normalizeRelativePath(value) {
|
|
47
|
+
return value.replace(/\\/g, "/").replace(/^\.\/+/, "");
|
|
48
|
+
}
|
|
49
|
+
function resolveExistingPath(filePath) {
|
|
50
|
+
try {
|
|
51
|
+
return realpathSync(filePath);
|
|
52
|
+
} catch {
|
|
53
|
+
return path.resolve(filePath);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function isDocsSourceFile(filePath) {
|
|
57
|
+
return DOCS_FILE_EXTENSIONS.has(path.extname(filePath).toLowerCase());
|
|
58
|
+
}
|
|
59
|
+
function discoverDocsSourceFiles(contentDir) {
|
|
60
|
+
const files = [];
|
|
61
|
+
const visit = (dir) => {
|
|
62
|
+
for (const entry of readdirSync(dir, { withFileTypes: true }).sort(
|
|
63
|
+
(a, b) => a.name.localeCompare(b.name)
|
|
64
|
+
)) {
|
|
65
|
+
if (entry.name.startsWith(".") || entry.name === "node_modules") continue;
|
|
66
|
+
const absolutePath = path.join(dir, entry.name);
|
|
67
|
+
if (entry.isDirectory()) {
|
|
68
|
+
visit(absolutePath);
|
|
69
|
+
} else if (entry.isFile() && isDocsSourceFile(absolutePath)) {
|
|
70
|
+
files.push(absolutePath);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
if (existsSync(contentDir)) visit(contentDir);
|
|
75
|
+
return files;
|
|
76
|
+
}
|
|
77
|
+
function getGitLastModifiedDates(contentDir) {
|
|
78
|
+
try {
|
|
79
|
+
const gitRoot = execFileSync("git", ["-C", contentDir, "rev-parse", "--show-toplevel"], {
|
|
80
|
+
encoding: "utf8",
|
|
81
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
82
|
+
}).trim();
|
|
83
|
+
if (!gitRoot) return {};
|
|
84
|
+
const contentPathspec = normalizeRelativePath(path.relative(gitRoot, contentDir)) || ".";
|
|
85
|
+
const contentPrefix = contentPathspec === "." ? "" : `${contentPathspec}/`;
|
|
86
|
+
const history = execFileSync(
|
|
87
|
+
"git",
|
|
88
|
+
[
|
|
89
|
+
"-C",
|
|
90
|
+
gitRoot,
|
|
91
|
+
"-c",
|
|
92
|
+
"core.quotePath=false",
|
|
93
|
+
"log",
|
|
94
|
+
`--format=${COMMIT_MARKER}%cI`,
|
|
95
|
+
"--name-only",
|
|
96
|
+
"--",
|
|
97
|
+
contentPathspec
|
|
98
|
+
],
|
|
99
|
+
{
|
|
100
|
+
encoding: "utf8",
|
|
101
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
102
|
+
maxBuffer: 32 * 1024 * 1024
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
const pages = {};
|
|
106
|
+
let commitDate;
|
|
107
|
+
for (const rawLine of history.split(/\r?\n/)) {
|
|
108
|
+
const line = normalizeRelativePath(rawLine.trim());
|
|
109
|
+
if (!line) continue;
|
|
110
|
+
if (line.startsWith(COMMIT_MARKER)) {
|
|
111
|
+
commitDate = line.slice(COMMIT_MARKER.length);
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
if (!commitDate || contentPrefix && !line.startsWith(contentPrefix)) continue;
|
|
115
|
+
const relativePath = contentPrefix ? line.slice(contentPrefix.length) : line;
|
|
116
|
+
if (isDocsSourceFile(relativePath) && !pages[relativePath]) {
|
|
117
|
+
pages[relativePath] = commitDate;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return pages;
|
|
121
|
+
} catch {
|
|
122
|
+
return {};
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
function readManifest(contentDir) {
|
|
126
|
+
const manifestPath = path.join(contentDir, FARM_DOCS_LAST_MODIFIED_MANIFEST);
|
|
127
|
+
if (!existsSync(manifestPath)) return null;
|
|
128
|
+
try {
|
|
129
|
+
const parsed = JSON.parse(
|
|
130
|
+
readFileSync(manifestPath, "utf8")
|
|
131
|
+
);
|
|
132
|
+
if (parsed.version !== 1 || !parsed.pages || typeof parsed.pages !== "object") return null;
|
|
133
|
+
const pages = Object.fromEntries(
|
|
134
|
+
Object.entries(parsed.pages).filter(
|
|
135
|
+
(entry) => typeof entry[1] === "string" && entry[1].length > 0
|
|
136
|
+
)
|
|
137
|
+
);
|
|
138
|
+
return { version: 1, pages };
|
|
139
|
+
} catch {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
function createFarmDocsLastModifiedManifest(contentDir, options = {}) {
|
|
144
|
+
const resolvedContentDir = resolveExistingPath(contentDir);
|
|
145
|
+
const gitDates = getGitLastModifiedDates(resolvedContentDir);
|
|
146
|
+
const fallbackDate = (options.now ?? /* @__PURE__ */ new Date()).toISOString();
|
|
147
|
+
const pages = {};
|
|
148
|
+
for (const sourcePath of discoverDocsSourceFiles(resolvedContentDir)) {
|
|
149
|
+
const relativePath = normalizeRelativePath(path.relative(resolvedContentDir, sourcePath));
|
|
150
|
+
pages[relativePath] = gitDates[relativePath] || (options.fallback === "now" ? fallbackDate : statSync(sourcePath).mtime.toISOString());
|
|
151
|
+
}
|
|
152
|
+
return { version: 1, pages };
|
|
153
|
+
}
|
|
154
|
+
function getLastModifiedManifest(contentDir) {
|
|
155
|
+
const resolvedContentDir = resolveExistingPath(contentDir);
|
|
156
|
+
const manifestPath = path.join(resolvedContentDir, FARM_DOCS_LAST_MODIFIED_MANIFEST);
|
|
157
|
+
const manifestStat = existsSync(manifestPath) ? statSync(manifestPath) : null;
|
|
158
|
+
const signature = manifestStat ? `file:${manifestStat.mtimeMs}:${manifestStat.size}` : "generated";
|
|
159
|
+
const cached = manifestCache.get(resolvedContentDir);
|
|
160
|
+
if (cached?.signature === signature) return cached.manifest;
|
|
161
|
+
const manifest = readManifest(resolvedContentDir) ?? createFarmDocsLastModifiedManifest(resolvedContentDir);
|
|
162
|
+
manifestCache.set(resolvedContentDir, { signature, manifest });
|
|
163
|
+
return manifest;
|
|
164
|
+
}
|
|
165
|
+
function resolveFarmDocsPageLastModified(contentDir, sourcePath, frontmatter) {
|
|
166
|
+
const configured = frontmatter.lastModified || frontmatter.lastmod || frontmatter.lastUpdated || frontmatter.updatedAt;
|
|
167
|
+
if (configured) return configured;
|
|
168
|
+
const resolvedContentDir = resolveExistingPath(contentDir);
|
|
169
|
+
const resolvedSourcePath = resolveExistingPath(sourcePath);
|
|
170
|
+
const relativePath = normalizeRelativePath(path.relative(resolvedContentDir, resolvedSourcePath));
|
|
171
|
+
const isInsideContentDir = relativePath !== ".." && !relativePath.startsWith("../") && !path.isAbsolute(relativePath);
|
|
172
|
+
if (isInsideContentDir) {
|
|
173
|
+
const generated = getLastModifiedManifest(resolvedContentDir).pages[relativePath];
|
|
174
|
+
if (generated) return generated;
|
|
175
|
+
}
|
|
176
|
+
return statSync(resolvedSourcePath).mtime.toISOString();
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// src/docs/social-image.ts
|
|
180
|
+
import { createHash } from "crypto";
|
|
181
|
+
var FARM_DOCS_SOCIAL_IMAGE_WIDTH = 1200;
|
|
182
|
+
var FARM_DOCS_SOCIAL_IMAGE_HEIGHT = 630;
|
|
183
|
+
var FARM_DOCS_SOCIAL_IMAGE_VERSION = 3;
|
|
184
|
+
function normalizeEntry(entry) {
|
|
185
|
+
if (!entry || entry === "/") return "";
|
|
186
|
+
return `/${entry.replace(/^\/+|\/+$/g, "")}`;
|
|
187
|
+
}
|
|
188
|
+
function encodeSlugPath(slug) {
|
|
189
|
+
return slug.split("/").filter(Boolean).map((segment) => encodeURIComponent(segment)).join("/");
|
|
190
|
+
}
|
|
191
|
+
function getSocialImageConfig(docs) {
|
|
192
|
+
return typeof docs.config.socialImage === "object" && docs.config.socialImage ? docs.config.socialImage : void 0;
|
|
193
|
+
}
|
|
194
|
+
function getNavTitle(docs) {
|
|
195
|
+
if (typeof docs.config.nav !== "object" || !docs.config.nav || !("title" in docs.config.nav)) {
|
|
196
|
+
return "Farm.js";
|
|
197
|
+
}
|
|
198
|
+
return String(docs.config.nav.title || "Farm.js");
|
|
199
|
+
}
|
|
200
|
+
function isFalse(value) {
|
|
201
|
+
return value ? /^(false|no|none|off|disabled)$/i.test(value.trim()) : false;
|
|
202
|
+
}
|
|
203
|
+
function isExternalOrRootPath(value) {
|
|
204
|
+
return /^(https?:)?\/\//i.test(value) || value.startsWith("/");
|
|
205
|
+
}
|
|
206
|
+
function isFarmDocsSocialImageEnabled(page, docs) {
|
|
207
|
+
if (docs.config.socialImage === false || getSocialImageConfig(docs)?.enabled === false) {
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
210
|
+
return !isFalse(page.frontmatter.socialImage);
|
|
211
|
+
}
|
|
212
|
+
function getFarmDocsCustomSocialImage(page) {
|
|
213
|
+
const value = page.frontmatter.socialImage || page.frontmatter.openGraphImage || page.frontmatter.ogImage;
|
|
214
|
+
return value && !isFalse(value) && isExternalOrRootPath(value) ? value : void 0;
|
|
215
|
+
}
|
|
216
|
+
function resolveIllustration(page) {
|
|
217
|
+
const explicit = page.frontmatter.socialIllustration?.toLowerCase();
|
|
218
|
+
if (explicit === "auth" || explicit === "cache" || explicit === "cli" || explicit === "integrations" || explicit === "project" || explicit === "routing" || explicit === "runtime") {
|
|
219
|
+
return explicit;
|
|
220
|
+
}
|
|
221
|
+
const source = `${page.slug} ${page.title} ${page.section || ""}`.toLowerCase();
|
|
222
|
+
if (/auth|session|security|csrf/.test(source)) return "auth";
|
|
223
|
+
if (/cache|ppr|render|static|revalid|stream/.test(source)) return "cache";
|
|
224
|
+
if (/integration|stripe|prisma|better.auth|email|job|workflow/.test(source)) {
|
|
225
|
+
return "integrations";
|
|
226
|
+
}
|
|
227
|
+
if (/cli|test|deploy|preview|upgrade|migration|install/.test(source)) return "cli";
|
|
228
|
+
if (/project|structure|config|environment|markdown|docs.engine/.test(source)) {
|
|
229
|
+
return "project";
|
|
230
|
+
}
|
|
231
|
+
if (/rout|endpoint|middleware|navigation|server.function|server.action|api/.test(source)) {
|
|
232
|
+
return "routing";
|
|
233
|
+
}
|
|
234
|
+
return "runtime";
|
|
235
|
+
}
|
|
236
|
+
function createHashValue(value) {
|
|
237
|
+
return createHash("sha256").update(JSON.stringify(value)).digest("hex").slice(0, 16);
|
|
238
|
+
}
|
|
239
|
+
function resolveBaseUrl(requestUrl, config) {
|
|
240
|
+
return config?.baseUrl ? new URL(config.baseUrl) : new URL(requestUrl.origin);
|
|
241
|
+
}
|
|
242
|
+
function createFarmDocsSocialImageDescriptor(page, docs, requestUrl) {
|
|
243
|
+
const config = getSocialImageConfig(docs);
|
|
244
|
+
const siteName = config?.siteName || getNavTitle(docs);
|
|
245
|
+
const brand = config?.brand || siteName;
|
|
246
|
+
const title = page.frontmatter.socialTitle || page.title;
|
|
247
|
+
const description = page.frontmatter.socialDescription || page.description || docs.config.metadata?.description || `Documentation for ${siteName}`;
|
|
248
|
+
const section = page.frontmatter.section || page.section || "Documentation";
|
|
249
|
+
const illustration = resolveIllustration(page);
|
|
250
|
+
const entry = normalizeEntry(docs.entry);
|
|
251
|
+
const slugPath = encodeSlugPath(page.slug) || "index";
|
|
252
|
+
const imagePath = `${entry}/_social/${slugPath}/opengraph-image.svg`;
|
|
253
|
+
const baseUrl = resolveBaseUrl(requestUrl, config);
|
|
254
|
+
const pageUrl = new URL(page.href, baseUrl).href;
|
|
255
|
+
const imageAlt = `${title} \u2014 ${siteName} documentation`;
|
|
256
|
+
const hash = createHashValue({
|
|
257
|
+
version: FARM_DOCS_SOCIAL_IMAGE_VERSION,
|
|
258
|
+
title,
|
|
259
|
+
description,
|
|
260
|
+
section,
|
|
261
|
+
siteName,
|
|
262
|
+
brand,
|
|
263
|
+
pageHref: page.href,
|
|
264
|
+
illustration,
|
|
265
|
+
fonts: config?.fonts
|
|
266
|
+
});
|
|
267
|
+
return {
|
|
268
|
+
title,
|
|
269
|
+
description,
|
|
270
|
+
section,
|
|
271
|
+
siteName,
|
|
272
|
+
brand,
|
|
273
|
+
pageHref: page.href,
|
|
274
|
+
pageUrl,
|
|
275
|
+
imagePath,
|
|
276
|
+
imageUrl: new URL(`${imagePath}?v=${hash}`, baseUrl).href,
|
|
277
|
+
imageAlt,
|
|
278
|
+
illustration,
|
|
279
|
+
fonts: config?.fonts,
|
|
280
|
+
hash
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
function getFarmDocsSocialImageSlug(docs, requestUrl) {
|
|
284
|
+
const entry = normalizeEntry(docs.entry);
|
|
285
|
+
const prefix = `${entry}/_social/`;
|
|
286
|
+
const suffix = "/opengraph-image.svg";
|
|
287
|
+
if (!requestUrl.pathname.startsWith(prefix) || !requestUrl.pathname.endsWith(suffix)) {
|
|
288
|
+
return null;
|
|
289
|
+
}
|
|
290
|
+
const rawSlug = requestUrl.pathname.slice(prefix.length, -suffix.length);
|
|
291
|
+
if (!rawSlug) return null;
|
|
292
|
+
try {
|
|
293
|
+
const slug = rawSlug.split("/").map((segment) => decodeURIComponent(segment)).join("/");
|
|
294
|
+
if (slug.split("/").some((segment) => !segment || segment === ".." || segment === ".")) {
|
|
295
|
+
return null;
|
|
296
|
+
}
|
|
297
|
+
return slug === "index" ? "" : slug;
|
|
298
|
+
} catch {
|
|
299
|
+
return null;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
function escapeXml(value) {
|
|
303
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
304
|
+
}
|
|
305
|
+
function truncate(value, length) {
|
|
306
|
+
if (value.length <= length) return value;
|
|
307
|
+
return `${value.slice(0, Math.max(0, length - 1)).trimEnd()}\u2026`;
|
|
308
|
+
}
|
|
309
|
+
function wrapText(value, maxCharacters, maxLines) {
|
|
310
|
+
const words = value.trim().split(/\s+/).filter(Boolean);
|
|
311
|
+
const lines = [];
|
|
312
|
+
let current = "";
|
|
313
|
+
let consumedWords = 0;
|
|
314
|
+
for (const word of words) {
|
|
315
|
+
const candidate = current ? `${current} ${word}` : word;
|
|
316
|
+
if (candidate.length <= maxCharacters || !current) {
|
|
317
|
+
current = candidate;
|
|
318
|
+
consumedWords += 1;
|
|
319
|
+
continue;
|
|
320
|
+
}
|
|
321
|
+
lines.push(current);
|
|
322
|
+
if (lines.length === maxLines) break;
|
|
323
|
+
current = word;
|
|
324
|
+
consumedWords += 1;
|
|
325
|
+
}
|
|
326
|
+
if (current && lines.length < maxLines) lines.push(current);
|
|
327
|
+
if (consumedWords < words.length && lines.length) {
|
|
328
|
+
lines[lines.length - 1] = truncate(`${lines[lines.length - 1]}\u2026`, maxCharacters);
|
|
329
|
+
}
|
|
330
|
+
return lines;
|
|
331
|
+
}
|
|
332
|
+
function renderTextLines(lines, x, y, lineHeight, attributes) {
|
|
333
|
+
return lines.map(
|
|
334
|
+
(line, index) => `<text x="${x}" y="${y + index * lineHeight}" ${attributes}>${escapeXml(line)}</text>`
|
|
335
|
+
).join("");
|
|
336
|
+
}
|
|
337
|
+
function renderEmbeddedFont(name, source, weight) {
|
|
338
|
+
if (!source) return "";
|
|
339
|
+
return `@font-face{font-family:"${name}";src:url("${escapeXml(source)}") format("woff2");font-style:normal;font-weight:${weight};font-display:block;}`;
|
|
340
|
+
}
|
|
341
|
+
function renderArrow(x1, y, x2, color = "#8b8b8b") {
|
|
342
|
+
return `<path d="M${x1} ${y}H${x2 - 9}" fill="none" stroke="${color}"/><path d="m${x2 - 9} ${y - 5} 9 5-9 5" fill="none" stroke="${color}"/>`;
|
|
343
|
+
}
|
|
344
|
+
function renderPanelHeader(label, status) {
|
|
345
|
+
return `<text x="819" y="171" class="label">${escapeXml(label)}</text><text x="1134" y="171" class="label bright" text-anchor="end">${escapeXml(status)}</text>`;
|
|
346
|
+
}
|
|
347
|
+
function renderRoutingIllustration() {
|
|
348
|
+
return `${renderPanelHeader("ROUTE BLUEPRINT", "TYPED")}
|
|
349
|
+
<rect x="819" y="296" width="92" height="54" fill="#a3a3a3"/>
|
|
350
|
+
<text x="832" y="327" class="diagram-title ink">src/app</text>
|
|
351
|
+
<path d="M911 323h41M952 232v181M952 232h44M952 323h44M952 413h44" fill="none" stroke="#696969"/>
|
|
352
|
+
<rect x="996" y="205" width="138" height="54" fill="#0a0a0a" stroke="#414141"/>
|
|
353
|
+
<text x="1010" y="228" class="diagram-title">/</text><text x="1010" y="246" class="micro">STATIC</text>
|
|
354
|
+
<rect x="996" y="296" width="138" height="54" fill="#0a0a0a" stroke="#414141"/>
|
|
355
|
+
<text x="1010" y="319" class="diagram-title">/blog/:slug</text><text x="1010" y="337" class="micro">DYNAMIC</text>
|
|
356
|
+
<rect x="996" y="386" width="138" height="55" fill="#f0f0f0"/>
|
|
357
|
+
<text x="1010" y="410" class="diagram-title ink">/docs/:path*</text><text x="1010" y="428" class="micro ink-muted">CATCH-ALL</text>
|
|
358
|
+
<line x1="819" y1="450" x2="1134" y2="450" stroke="#343434"/>
|
|
359
|
+
<text x="819" y="475" class="label bright">FILE ROUTES</text><text x="1134" y="475" class="label" text-anchor="end">TYPES INCLUDED</text>`;
|
|
360
|
+
}
|
|
361
|
+
function renderAuthIllustration() {
|
|
362
|
+
return `${renderPanelHeader("REQUEST GUARD", "SERVER VERIFIED")}
|
|
363
|
+
<rect x="819" y="269" width="86" height="54" fill="#0a0a0a" stroke="#454545"/>
|
|
364
|
+
<text x="837" y="292" class="micro bright">REQUEST</text><text x="837" y="310" class="diagram-title">GET /app</text>
|
|
365
|
+
${renderArrow(905, 296, 943)}
|
|
366
|
+
<rect x="943" y="224" width="104" height="118" fill="#f0f0f0"/>
|
|
367
|
+
<path d="M974 271v-12a21 21 0 0 1 42 0v12M968 271h54v45h-54z" fill="#050505"/>
|
|
368
|
+
<circle cx="995" cy="292" r="4" fill="#f0f0f0"/><path d="M995 296v8" stroke="#f0f0f0" stroke-width="3"/>
|
|
369
|
+
<text x="995" y="332" class="micro ink" text-anchor="middle">auth()</text>
|
|
370
|
+
${renderArrow(1047, 296, 1071)}
|
|
371
|
+
<rect x="1071" y="269" width="63" height="54" fill="#0a0a0a" stroke="#454545"/>
|
|
372
|
+
<text x="1082" y="292" class="micro bright">ALLOW</text><text x="1082" y="310" class="micro">/app</text>
|
|
373
|
+
<rect x="819" y="372" width="315" height="38" fill="#090909" stroke="#3d3d3d"/>
|
|
374
|
+
<rect x="832" y="385" width="11" height="11" fill="#a3a3a3"/>
|
|
375
|
+
<text x="856" y="395" class="code">session.user / verified</text>
|
|
376
|
+
<line x1="819" y1="450" x2="1134" y2="450" stroke="#343434"/>
|
|
377
|
+
<text x="819" y="475" class="label bright">SESSION TYPED</text><text x="1134" y="475" class="label" text-anchor="end">CSRF PROTECTED</text>`;
|
|
378
|
+
}
|
|
379
|
+
function renderCacheIllustration() {
|
|
380
|
+
return `${renderPanelHeader("PAGE / PRODUCT", "CACHE + PPR")}
|
|
381
|
+
<rect x="819" y="204" width="315" height="54" fill="#f0f0f0"/>
|
|
382
|
+
<text x="836" y="235" class="diagram-title ink">STATIC SHELL</text><text x="1116" y="235" class="micro ink-muted" text-anchor="end">BUILD</text>
|
|
383
|
+
<rect x="819" y="271" width="198" height="76" fill="#a3a3a3"/>
|
|
384
|
+
<text x="836" y="301" class="diagram-title ink">CACHED DATA</text><text x="836" y="326" class="micro ink-muted">tag: products</text>
|
|
385
|
+
<rect x="1029" y="271" width="105" height="76" fill="#0a0a0a" stroke="#555"/>
|
|
386
|
+
<text x="1045" y="301" class="diagram-title">LIVE</text><text x="1045" y="326" class="micro">stream</text>
|
|
387
|
+
<path d="M1081 347v43m-8-9 8 9 8-9" fill="none" stroke="#d4d4d4"/>
|
|
388
|
+
<line x1="819" y1="450" x2="1134" y2="450" stroke="#343434"/>
|
|
389
|
+
<text x="819" y="475" class="label bright">STATIC FIRST</text><text x="1134" y="475" class="label" text-anchor="end">DYNAMIC WHERE NEEDED</text>`;
|
|
390
|
+
}
|
|
391
|
+
function renderIntegrationsIllustration() {
|
|
392
|
+
return `${renderPanelHeader("INTEGRATION GRAPH", "ONE PRODUCT")}
|
|
393
|
+
<path d="M976 309H879V247M976 309H879v87M1030 309h93V247M1030 309h93v87" fill="none" stroke="#4a4a4a"/>
|
|
394
|
+
<rect x="819" y="214" width="120" height="57" fill="#0a0a0a" stroke="#4b4b4b"/><text x="839" y="247" class="diagram-title">BETTER AUTH</text>
|
|
395
|
+
<rect x="819" y="368" width="120" height="57" fill="#0a0a0a" stroke="#4b4b4b"/><text x="851" y="401" class="diagram-title">PRISMA</text>
|
|
396
|
+
<rect x="1061" y="214" width="73" height="57" fill="#0a0a0a" stroke="#4b4b4b"/><text x="1077" y="247" class="diagram-title">STRIPE</text>
|
|
397
|
+
<rect x="1061" y="368" width="73" height="57" fill="#a3a3a3"/><text x="1075" y="401" class="diagram-title ink">VERCEL</text>
|
|
398
|
+
<rect x="976" y="277" width="94" height="64" fill="#f0f0f0"/>
|
|
399
|
+
<text x="994" y="304" class="diagram-title ink">FARM.JS</text><text x="994" y="324" class="micro ink-muted">CORE</text>
|
|
400
|
+
<line x1="819" y1="450" x2="1134" y2="450" stroke="#343434"/>
|
|
401
|
+
<text x="819" y="475" class="label bright">BRING YOUR STACK</text><text x="1134" y="475" class="label" text-anchor="end">CONNECTED ONCE</text>`;
|
|
402
|
+
}
|
|
403
|
+
function renderCliIllustration() {
|
|
404
|
+
return `${renderPanelHeader("TERMINAL", "PRODUCTION OUTPUT")}
|
|
405
|
+
<rect x="819" y="203" width="315" height="213" fill="#050505" stroke="#555"/>
|
|
406
|
+
<line x1="819" y1="236" x2="1134" y2="236" stroke="#555"/>
|
|
407
|
+
<circle cx="837" cy="220" r="4" fill="#5d5d5d"/><circle cx="850" cy="220" r="4" fill="#7a7a7a"/><circle cx="863" cy="220" r="4" fill="#a3a3a3"/>
|
|
408
|
+
<text x="837" y="273" class="code bright"><tspan fill="#7a7a7a">$</tspan> farm build</text>
|
|
409
|
+
<rect x="837" y="293" width="11" height="11" fill="#a3a3a3"/><path d="m839 298 3 3 6-7" fill="none" stroke="#050505" stroke-width="1.5"/>
|
|
410
|
+
<text x="861" y="303" class="code">64 routes discovered</text>
|
|
411
|
+
<rect x="837" y="320" width="11" height="11" fill="#a3a3a3"/><path d="m839 325 3 3 6-7" fill="none" stroke="#050505" stroke-width="1.5"/>
|
|
412
|
+
<text x="861" y="330" class="code">client + server bundles</text>
|
|
413
|
+
<rect x="837" y="355" width="126" height="30" fill="#f0f0f0"/><text x="853" y="374" class="micro ink">BUILD COMPLETE</text>
|
|
414
|
+
<text x="1115" y="374" class="micro" text-anchor="end">/dist</text>
|
|
415
|
+
<line x1="819" y1="450" x2="1134" y2="450" stroke="#343434"/>
|
|
416
|
+
<text x="819" y="475" class="label bright">REAL COMMANDS</text><text x="1134" y="475" class="label" text-anchor="end">842MS</text>`;
|
|
417
|
+
}
|
|
418
|
+
function renderProjectIllustration() {
|
|
419
|
+
return `${renderPanelHeader("PROJECT MAP", "CONVENTION TYPED")}
|
|
420
|
+
<rect x="819" y="202" width="315" height="216" fill="#050505" stroke="#555"/>
|
|
421
|
+
<text x="837" y="227" class="diagram-title bright">my-app/</text>
|
|
422
|
+
<path d="M847 243v143M847 259h23M847 293h23M847 327h23M847 361h23" fill="none" stroke="#666"/>
|
|
423
|
+
<rect x="870" y="243" width="246" height="33" fill="#0a0a0a" stroke="#444"/><text x="886" y="264" class="code">src/app</text><text x="1098" y="264" class="micro" text-anchor="end">ROUTES</text>
|
|
424
|
+
<rect x="870" y="277" width="246" height="33" fill="#f0f0f0"/><text x="886" y="298" class="code ink">src/app/page.tsx</text>
|
|
425
|
+
<rect x="870" y="311" width="246" height="33" fill="#0a0a0a" stroke="#444"/><text x="886" y="332" class="code">src/app/api/users/route.ts</text><text x="1098" y="332" class="micro" text-anchor="end">API</text>
|
|
426
|
+
<rect x="870" y="345" width="246" height="33" fill="#0a0a0a" stroke="#444"/><text x="886" y="366" class="code">farm.config.ts</text><text x="1098" y="366" class="micro" text-anchor="end">CONFIG</text>
|
|
427
|
+
<line x1="819" y1="450" x2="1134" y2="450" stroke="#343434"/>
|
|
428
|
+
<text x="819" y="475" class="label bright">FILES BECOME FEATURES</text><text x="1134" y="475" class="label" text-anchor="end">ONE CONFIG</text>`;
|
|
429
|
+
}
|
|
430
|
+
function renderRuntimeIllustration() {
|
|
431
|
+
return `${renderPanelHeader("PRODUCT ARCHITECTURE", "FULL STACK")}
|
|
432
|
+
<rect x="819" y="211" width="315" height="55" fill="#f0f0f0"/>
|
|
433
|
+
<text x="836" y="244" class="diagram-title ink">PRODUCT SURFACE</text><text x="1116" y="244" class="micro ink-muted" text-anchor="end">UI + ROUTES</text>
|
|
434
|
+
<path d="M976 266v20m0 61v20" stroke="#727272"/>
|
|
435
|
+
<rect x="855" y="286" width="242" height="61" fill="#a3a3a3"/>
|
|
436
|
+
<text x="874" y="314" class="diagram-title ink">APPLICATION CORE</text><text x="874" y="334" class="micro ink-muted">APIS \xB7 MIDDLEWARE</text>
|
|
437
|
+
<rect x="819" y="367" width="315" height="55" fill="#4c4c4c"/>
|
|
438
|
+
<text x="836" y="400" class="diagram-title bright">CONNECTED STACK</text><text x="1116" y="400" class="micro" text-anchor="end">DATA \xB7 AUTH \xB7 DEPLOY</text>
|
|
439
|
+
<line x1="819" y1="450" x2="1134" y2="450" stroke="#343434"/>
|
|
440
|
+
<text x="819" y="475" class="label bright">ONE FRAMEWORK</text><text x="1134" y="475" class="label" text-anchor="end">ONE DEPLOYMENT MODEL</text>`;
|
|
441
|
+
}
|
|
442
|
+
function renderIllustration(type) {
|
|
443
|
+
switch (type) {
|
|
444
|
+
case "auth":
|
|
445
|
+
return renderAuthIllustration();
|
|
446
|
+
case "cache":
|
|
447
|
+
return renderCacheIllustration();
|
|
448
|
+
case "cli":
|
|
449
|
+
return renderCliIllustration();
|
|
450
|
+
case "integrations":
|
|
451
|
+
return renderIntegrationsIllustration();
|
|
452
|
+
case "project":
|
|
453
|
+
return renderProjectIllustration();
|
|
454
|
+
case "routing":
|
|
455
|
+
return renderRoutingIllustration();
|
|
456
|
+
default:
|
|
457
|
+
return renderRuntimeIllustration();
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
function renderFarmDocsSocialImageSvg(descriptor) {
|
|
461
|
+
const titleLines = wrapText(descriptor.title, 22, 2);
|
|
462
|
+
const longestTitleLine = Math.max(...titleLines.map((line) => line.length));
|
|
463
|
+
const titleSize = titleLines.length === 1 ? longestTitleLine > 17 ? 62 : 74 : 56;
|
|
464
|
+
const titleLineHeight = Math.round(titleSize * 0.98);
|
|
465
|
+
const titleY = titleLines.length === 1 ? 294 : 266;
|
|
466
|
+
const descriptionY = titleY + (titleLines.length - 1) * titleLineHeight + 59;
|
|
467
|
+
const descriptionLines = wrapText(descriptor.description, 68, 2);
|
|
468
|
+
const routeY = Math.max(418, descriptionY + descriptionLines.length * 29 + 24);
|
|
469
|
+
const section = truncate(descriptor.section.toUpperCase(), 27);
|
|
470
|
+
const route = truncate(descriptor.pageHref, 42);
|
|
471
|
+
const footerUrl = truncate(descriptor.pageUrl.replace(/^https?:\/\//, ""), 70);
|
|
472
|
+
const brand = truncate(descriptor.brand.toUpperCase(), 25);
|
|
473
|
+
const titleId = `farm-docs-og-${descriptor.hash}`;
|
|
474
|
+
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
475
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="${FARM_DOCS_SOCIAL_IMAGE_WIDTH}" height="${FARM_DOCS_SOCIAL_IMAGE_HEIGHT}" viewBox="0 0 ${FARM_DOCS_SOCIAL_IMAGE_WIDTH} ${FARM_DOCS_SOCIAL_IMAGE_HEIGHT}" role="img" aria-labelledby="${titleId}-title ${titleId}-description">
|
|
476
|
+
<title id="${titleId}-title">${escapeXml(descriptor.imageAlt)}</title>
|
|
477
|
+
<desc id="${titleId}-description">${escapeXml(descriptor.description)}</desc>
|
|
478
|
+
<metadata>${escapeXml(JSON.stringify({ generator: "Farm.js docs", page: descriptor.pageUrl, illustration: descriptor.illustration }))}</metadata>
|
|
479
|
+
<style type="text/css">
|
|
480
|
+
${renderEmbeddedFont("Farm Sans", descriptor.fonts?.sans, "100 900")}
|
|
481
|
+
${renderEmbeddedFont("Farm Mono", descriptor.fonts?.mono, "100 900")}
|
|
482
|
+
${renderEmbeddedFont("Farm Pixel", descriptor.fonts?.display, "400 700")}
|
|
483
|
+
.sans{font-family:"Farm Sans","Arial",sans-serif}.mono,.label,.code,.diagram-title,.micro{font-family:"Farm Mono","Menlo","DejaVu Sans Mono",monospace}.pixel{font-family:"Farm Pixel","Farm Mono",monospace}.label{fill:#8b8b8b;font-size:10px;font-weight:600;letter-spacing:1.2px}.code{fill:#8b8b8b;font-size:11px}.diagram-title{fill:#e7e7e7;font-size:11px;font-weight:650}.micro{fill:#777;font-size:8px;letter-spacing:.45px}.bright{fill:#f5f5f4}.ink{fill:#050505}.ink-muted{fill:#4c4c4c}
|
|
484
|
+
</style>
|
|
485
|
+
<defs>
|
|
486
|
+
<pattern id="canvas-grid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M40 0H0V40" fill="none" stroke="#151515"/></pattern>
|
|
487
|
+
<pattern id="diagonal" width="12" height="12" patternUnits="userSpaceOnUse" patternTransform="rotate(45)"><line x1="0" y1="0" x2="0" y2="12" stroke="#171717" stroke-width="2"/></pattern>
|
|
488
|
+
<clipPath id="frame-clip"><rect x="28" y="28" width="1144" height="574"/></clipPath>
|
|
489
|
+
</defs>
|
|
490
|
+
<rect width="1200" height="630" fill="#050505"/>
|
|
491
|
+
<rect width="1200" height="630" fill="url(#canvas-grid)"/>
|
|
492
|
+
<g clip-path="url(#frame-clip)">
|
|
493
|
+
<rect x="28" y="28" width="1144" height="574" fill="#020202"/>
|
|
494
|
+
<rect x="782" y="114" width="390" height="411" fill="url(#diagonal)"/>
|
|
495
|
+
</g>
|
|
496
|
+
<rect x="28.5" y="28.5" width="1143" height="573" fill="none" stroke="#323232"/>
|
|
497
|
+
<path d="M28 114.5h1144M28 525.5h1144M781.5 114v411" fill="none" stroke="#303030"/>
|
|
498
|
+
|
|
499
|
+
<g transform="translate(71 51)">
|
|
500
|
+
<rect width="11" height="11" rx="1" fill="#f5f5f4"/><rect x="15" width="28" height="11" rx="1" fill="#f5f5f4"/>
|
|
501
|
+
<rect y="15" width="11" height="11" rx="1" fill="#9b9b9b"/><rect x="15" y="15" width="28" height="11" rx="1" fill="#9b9b9b"/>
|
|
502
|
+
<rect y="30" width="11" height="11" rx="1" fill="#5f5f5f"/><rect x="15" y="30" width="20" height="11" rx="1" fill="#5f5f5f"/>
|
|
503
|
+
<text x="61" y="24" class="mono bright" font-size="24" font-weight="550">FARM<tspan fill="#777">.JS</tspan></text>
|
|
504
|
+
<text x="61" y="43" class="label">BY FARMING LABS</text>
|
|
505
|
+
</g>
|
|
506
|
+
<text x="1134" y="72" class="label" text-anchor="end">${escapeXml(brand)} \xB7 DOCUMENTATION</text>
|
|
507
|
+
|
|
508
|
+
<text x="71" y="198" class="mono bright" font-size="13" font-weight="650">DOCS</text>
|
|
509
|
+
<line x1="117" y1="193" x2="155" y2="193" stroke="#696969"/>
|
|
510
|
+
<text x="166" y="198" class="mono" fill="#9b9b9b" font-size="13">${escapeXml(section)}</text>
|
|
511
|
+
${renderTextLines(titleLines, 71, titleY, titleLineHeight, `class="pixel bright" font-size="${titleSize}" font-weight="500" letter-spacing="-2.4"`)}
|
|
512
|
+
${renderTextLines(descriptionLines, 71, descriptionY, 29, 'class="sans" fill="#a3a3a3" font-size="20" font-weight="430" letter-spacing="-.3"')}
|
|
513
|
+
<rect x="71" y="${routeY}" width="${Math.min(390, 56 + route.length * 8)}" height="36" fill="#050505" stroke="#3c3c3c"/>
|
|
514
|
+
<text x="85" y="${routeY + 23}" class="mono bright" font-size="11" font-weight="600">GET</text>
|
|
515
|
+
<text x="119" y="${routeY + 23}" class="mono" fill="#898989" font-size="11">${escapeXml(route)}</text>
|
|
516
|
+
|
|
517
|
+
${renderIllustration(descriptor.illustration)}
|
|
518
|
+
|
|
519
|
+
<text x="71" y="570" class="mono bright" font-size="13" font-weight="550">${escapeXml(footerUrl)}</text>
|
|
520
|
+
<text x="1134" y="570" class="mono" fill="#9b9b9b" font-size="12" text-anchor="end">FARM.JS DOCUMENTATION</text>
|
|
521
|
+
<path d="M20 20h10M20 20v10M1180 20h-10M1180 20v10M20 610h10M20 610v-10M1180 610h-10M1180 610v-10" fill="none" stroke="#9b9b9b"/>
|
|
522
|
+
</svg>`;
|
|
523
|
+
}
|
|
524
|
+
function renderFarmDocsSocialMetadata(descriptor, customImage) {
|
|
525
|
+
const imageUrl = customImage ? new URL(customImage, descriptor.pageUrl).href : descriptor.imageUrl;
|
|
526
|
+
const customExtension = customImage?.toLowerCase().split(/[?#]/, 1)[0];
|
|
527
|
+
const imageType = customExtension?.endsWith(".webp") ? "image/webp" : customExtension?.endsWith(".png") ? "image/png" : customExtension?.match(/\.jpe?g$/) ? "image/jpeg" : "image/svg+xml";
|
|
528
|
+
const tag = (property, content, name = false) => `<meta ${name ? "name" : "property"}="${property}" content="${escapeXml(content)}">`;
|
|
529
|
+
return [
|
|
530
|
+
tag("og:type", "article"),
|
|
531
|
+
tag("og:site_name", descriptor.siteName),
|
|
532
|
+
tag("og:title", descriptor.title),
|
|
533
|
+
tag("og:description", descriptor.description),
|
|
534
|
+
tag("og:url", descriptor.pageUrl),
|
|
535
|
+
tag("og:image", imageUrl),
|
|
536
|
+
tag("og:image:type", imageType),
|
|
537
|
+
...customImage ? [] : [
|
|
538
|
+
tag("og:image:width", String(FARM_DOCS_SOCIAL_IMAGE_WIDTH)),
|
|
539
|
+
tag("og:image:height", String(FARM_DOCS_SOCIAL_IMAGE_HEIGHT))
|
|
540
|
+
],
|
|
541
|
+
tag("og:image:alt", descriptor.imageAlt),
|
|
542
|
+
tag("twitter:card", "summary_large_image", true),
|
|
543
|
+
tag("twitter:title", descriptor.title, true),
|
|
544
|
+
tag("twitter:description", descriptor.description, true),
|
|
545
|
+
tag("twitter:image", imageUrl, true),
|
|
546
|
+
tag("twitter:image:alt", descriptor.imageAlt, true)
|
|
547
|
+
].join("\n ");
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
// src/docs/handler.ts
|
|
551
|
+
var DOCS_FILE_NAMES = ["page.mdx", "page.md", "index.mdx", "index.md"];
|
|
552
|
+
var DOCS_FILE_EXTENSIONS2 = [".mdx", ".md"];
|
|
553
|
+
var FARM_DOCS_FALLBACK_FAVICON = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' fill='black'/%3E%3Cpath d='M7 8h18v3H10v5h12v3H10v5H7z' fill='white'/%3E%3C/svg%3E";
|
|
554
|
+
var FARM_DOCS_FAVICON_FILES = ["favicon.svg", "favicon.ico", "favicon.png"];
|
|
555
|
+
function trimSlashes(value) {
|
|
556
|
+
return value.replace(/^\/+|\/+$/g, "");
|
|
557
|
+
}
|
|
558
|
+
function normalizeEntry2(entry) {
|
|
559
|
+
if (!entry || entry === "/") return "/";
|
|
560
|
+
return `/${trimSlashes(entry)}`;
|
|
561
|
+
}
|
|
562
|
+
function decodeDocsPath(value) {
|
|
563
|
+
try {
|
|
564
|
+
return decodeURIComponent(value);
|
|
565
|
+
} catch {
|
|
566
|
+
return value;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
function normalizeSlug(value) {
|
|
570
|
+
return trimSlashes(decodeDocsPath(value)).replace(/\.(mdx?|markdown)$/i, "");
|
|
571
|
+
}
|
|
572
|
+
function resolveFarmDocsFavicon(docs, options) {
|
|
573
|
+
const configuredFavicon = docs?.config.favicon;
|
|
574
|
+
if (typeof configuredFavicon === "string" && configuredFavicon.trim()) {
|
|
575
|
+
return configuredFavicon.trim();
|
|
576
|
+
}
|
|
577
|
+
const publicDir = path2.join(path2.resolve(options.root), "public");
|
|
578
|
+
for (const fileName of FARM_DOCS_FAVICON_FILES) {
|
|
579
|
+
const faviconPath = path2.join(publicDir, fileName);
|
|
580
|
+
if (existsSync2(faviconPath) && statSync2(faviconPath).isFile()) {
|
|
581
|
+
return `/${fileName}`;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
return FARM_DOCS_FALLBACK_FAVICON;
|
|
585
|
+
}
|
|
586
|
+
function renderFarmDocsFaviconLink(faviconHref) {
|
|
587
|
+
const normalizedHref = faviconHref.split(/[?#]/, 1)[0]?.toLowerCase() || "";
|
|
588
|
+
const type = normalizedHref.endsWith(".svg") || faviconHref.startsWith("data:image/svg+xml") ? "image/svg+xml" : normalizedHref.endsWith(".png") ? "image/png" : normalizedHref.endsWith(".ico") ? "image/x-icon" : void 0;
|
|
589
|
+
const metadata = type === "image/svg+xml" ? ' sizes="any" type="image/svg+xml"' : type ? ` type="${type}"` : "";
|
|
590
|
+
return `<link rel="icon" href="${escapeAttribute(faviconHref)}"${metadata}>`;
|
|
591
|
+
}
|
|
592
|
+
function renderFarmDocsBrandMark() {
|
|
593
|
+
return `<svg class="sidebar-brand-logo" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
|
|
594
|
+
<rect x="2" y="2" width="5" height="5" rx="0.75" fill="currentColor"></rect>
|
|
595
|
+
<path d="M9.75 2h11.5c.41 0 .75.34.75.75v3.5c0 .41-.34.75-.75.75H9.75A.75.75 0 0 1 9 6.25v-3.5c0-.41.34-.75.75-.75Zm9.75 1.62a.38.38 0 0 0-.38.38v1c0 .21.17.38.38.38h.75c.21 0 .38-.17.38-.38V4a.38.38 0 0 0-.38-.38h-.75Z" fill="currentColor"></path>
|
|
596
|
+
<rect x="2" y="9.5" width="5" height="5" rx="0.75" fill="currentColor" opacity="0.64"></rect>
|
|
597
|
+
<rect x="9" y="9.5" width="13" height="5" rx="0.75" fill="currentColor" opacity="0.64"></rect>
|
|
598
|
+
<rect x="2" y="17" width="5" height="5" rx="0.75" fill="currentColor" opacity="0.34"></rect>
|
|
599
|
+
<rect x="9" y="17" width="7.5" height="5" rx="0.75" fill="currentColor" opacity="0.34"></rect>
|
|
600
|
+
</svg>`;
|
|
601
|
+
}
|
|
602
|
+
function renderFarmDocsBrandTitle(navTitle) {
|
|
603
|
+
const suffix = navTitle.match(/\.js$/i)?.[0];
|
|
604
|
+
if (!suffix) {
|
|
605
|
+
return `<span class="sidebar-brand-title">${escapeHtml(navTitle)}</span>`;
|
|
606
|
+
}
|
|
607
|
+
const productName = navTitle.slice(0, -suffix.length);
|
|
608
|
+
return `<span class="sidebar-brand-title">${escapeHtml(productName)}<span class="sidebar-brand-suffix">${escapeHtml(suffix)}</span></span>`;
|
|
609
|
+
}
|
|
610
|
+
function isSafeSegment(segment) {
|
|
611
|
+
return segment !== ".." && !segment.includes("/") && !segment.includes("\\");
|
|
612
|
+
}
|
|
613
|
+
function resolveInside(root, target) {
|
|
614
|
+
const resolvedRoot = path2.resolve(root);
|
|
615
|
+
const resolvedTarget = path2.resolve(target);
|
|
616
|
+
const relative = path2.relative(resolvedRoot, resolvedTarget);
|
|
617
|
+
if (relative === "" || !relative.startsWith("..") && !path2.isAbsolute(relative)) {
|
|
618
|
+
return resolvedTarget;
|
|
619
|
+
}
|
|
620
|
+
return null;
|
|
621
|
+
}
|
|
622
|
+
function resolveExistingFileInside(root, target) {
|
|
623
|
+
const safePath = resolveInside(root, target);
|
|
624
|
+
if (!safePath) return null;
|
|
625
|
+
try {
|
|
626
|
+
const realRoot = realpathSync2(root);
|
|
627
|
+
const realTarget = realpathSync2(safePath);
|
|
628
|
+
const containedTarget = resolveInside(realRoot, realTarget);
|
|
629
|
+
return containedTarget && statSync2(containedTarget).isFile() ? containedTarget : null;
|
|
630
|
+
} catch {
|
|
631
|
+
return null;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
function isFarmDocsRequest(docs, request) {
|
|
635
|
+
if (!docs?.enabled) return false;
|
|
636
|
+
if (request.method !== "GET" && request.method !== "HEAD") return false;
|
|
637
|
+
const pathname = new URL(request.url).pathname;
|
|
638
|
+
const entry = normalizeEntry2(docs.entry);
|
|
639
|
+
if (entry === "/") return true;
|
|
640
|
+
return pathname === entry || pathname === `${entry}.md` || pathname.startsWith(`${entry}/`);
|
|
641
|
+
}
|
|
642
|
+
function resolveFarmDocsContentDir(docs, options) {
|
|
643
|
+
const root = path2.resolve(options.root);
|
|
644
|
+
const srcDir = options.srcDir || "src";
|
|
645
|
+
const configuredContentDir = docs.contentDir || docs.config.contentDir;
|
|
646
|
+
if (configuredContentDir) {
|
|
647
|
+
return path2.isAbsolute(configuredContentDir) ? configuredContentDir : path2.join(root, configuredContentDir);
|
|
648
|
+
}
|
|
649
|
+
const entryDir = docs.config.entry || trimSlashes(docs.entry) || "docs";
|
|
650
|
+
const appDocsDir = path2.join(root, srcDir, "app", entryDir);
|
|
651
|
+
if (existsSync2(appDocsDir)) return appDocsDir;
|
|
652
|
+
return path2.join(root, entryDir);
|
|
653
|
+
}
|
|
654
|
+
function getFarmDocsRouteTypeEntries(docs) {
|
|
655
|
+
if (!docs?.enabled) return [];
|
|
656
|
+
const entry = normalizeEntry2(docs.entry);
|
|
657
|
+
if (entry === "/") return ["/", "/[...docs]"];
|
|
658
|
+
return [entry, `${entry}/[...docs]`];
|
|
659
|
+
}
|
|
660
|
+
function getFarmDocsDocumentNavigationMatchers(docs) {
|
|
661
|
+
if (!docs?.enabled) return [];
|
|
662
|
+
const entry = normalizeEntry2(docs.entry);
|
|
663
|
+
return [entry === "/" ? "/(.*)" : `${entry}(.*)`];
|
|
664
|
+
}
|
|
665
|
+
function getRequestSlug(docs, request) {
|
|
666
|
+
const pathname = new URL(request.url).pathname;
|
|
667
|
+
const entry = normalizeEntry2(docs.entry);
|
|
668
|
+
if (entry === "/") return normalizeSlug(pathname);
|
|
669
|
+
if (pathname === entry || pathname === `${entry}.md`) return "";
|
|
670
|
+
return normalizeSlug(pathname.slice(entry.length));
|
|
671
|
+
}
|
|
672
|
+
function isDiscoverableDocsEntryName(name) {
|
|
673
|
+
return Boolean(name) && !name.startsWith(".") && name !== "node_modules";
|
|
674
|
+
}
|
|
675
|
+
function isDiscoverableDocsFile(contentDir, filePath) {
|
|
676
|
+
const segments = path2.relative(contentDir, filePath).split(path2.sep);
|
|
677
|
+
let dir = contentDir;
|
|
678
|
+
for (const [index, name] of segments.entries()) {
|
|
679
|
+
if (!isDiscoverableDocsEntryName(name)) return false;
|
|
680
|
+
let entry;
|
|
681
|
+
try {
|
|
682
|
+
entry = readdirSync2(dir, { withFileTypes: true }).find(
|
|
683
|
+
(candidate) => candidate.name === name
|
|
684
|
+
);
|
|
685
|
+
} catch {
|
|
686
|
+
return false;
|
|
687
|
+
}
|
|
688
|
+
const isLast = index === segments.length - 1;
|
|
689
|
+
if (!entry || !(isLast ? entry.isFile() : entry.isDirectory())) return false;
|
|
690
|
+
dir = path2.join(dir, name);
|
|
691
|
+
}
|
|
692
|
+
return true;
|
|
693
|
+
}
|
|
694
|
+
function findDocsPageFile(contentDir, slug) {
|
|
695
|
+
const canonicalSlug = trimSlashes(slug);
|
|
696
|
+
const segments = canonicalSlug ? canonicalSlug.split("/") : [];
|
|
697
|
+
if (!segments.every((segment) => isSafeSegment(segment) && isDiscoverableDocsEntryName(segment))) {
|
|
698
|
+
return null;
|
|
699
|
+
}
|
|
700
|
+
const slugDir = path2.join(contentDir, ...segments);
|
|
701
|
+
const candidates = segments.length === 0 ? DOCS_FILE_NAMES.map((filename) => path2.join(contentDir, filename)) : [
|
|
702
|
+
...DOCS_FILE_NAMES.map((filename) => path2.join(slugDir, filename)),
|
|
703
|
+
...DOCS_FILE_EXTENSIONS2.map(
|
|
704
|
+
(extension) => path2.join(contentDir, `${canonicalSlug}${extension}`)
|
|
705
|
+
)
|
|
706
|
+
];
|
|
707
|
+
for (const candidate of candidates) {
|
|
708
|
+
if (pathToSlug(contentDir, candidate) !== canonicalSlug) continue;
|
|
709
|
+
if (!isDiscoverableDocsFile(contentDir, candidate)) continue;
|
|
710
|
+
const safePath = resolveExistingFileInside(contentDir, candidate);
|
|
711
|
+
if (safePath) {
|
|
712
|
+
return safePath;
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
return null;
|
|
716
|
+
}
|
|
717
|
+
function parseFrontmatter(source) {
|
|
718
|
+
if (!source.startsWith("---")) {
|
|
719
|
+
return { frontmatter: {}, body: source };
|
|
720
|
+
}
|
|
721
|
+
const endIndex = source.indexOf("\n---", 3);
|
|
722
|
+
if (endIndex === -1) return { frontmatter: {}, body: source };
|
|
723
|
+
const frontmatterSource = source.slice(3, endIndex).trim();
|
|
724
|
+
const body = source.slice(source.indexOf("\n", endIndex + 1) + 1);
|
|
725
|
+
const frontmatter = {};
|
|
726
|
+
for (const line of frontmatterSource.split(/\r?\n/)) {
|
|
727
|
+
const separator = line.indexOf(":");
|
|
728
|
+
if (separator === -1) continue;
|
|
729
|
+
const key = line.slice(0, separator).trim();
|
|
730
|
+
const value = line.slice(separator + 1).trim().replace(/^["']|["']$/g, "");
|
|
731
|
+
if (key && value) frontmatter[key] = value;
|
|
732
|
+
}
|
|
733
|
+
return { frontmatter, body };
|
|
734
|
+
}
|
|
735
|
+
function titleFromSlug(slug) {
|
|
736
|
+
const lastSegment = slug.split("/").filter(Boolean).pop() || "Docs";
|
|
737
|
+
return lastSegment.split(/[-_]/).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
|
|
738
|
+
}
|
|
739
|
+
function titleFromMarkdown(body, fallback) {
|
|
740
|
+
const heading = body.match(/^#\s+(.+)$/m)?.[1]?.trim();
|
|
741
|
+
return heading || fallback;
|
|
742
|
+
}
|
|
743
|
+
function loadFarmDocsPage(contentDir, docs, slug) {
|
|
744
|
+
const sourcePath = findDocsPageFile(contentDir, slug);
|
|
745
|
+
if (!sourcePath) return null;
|
|
746
|
+
const source = readFileSync2(sourcePath, "utf8");
|
|
747
|
+
const { frontmatter, body } = parseFrontmatter(source);
|
|
748
|
+
const title = frontmatter.title || titleFromMarkdown(body, titleFromSlug(slug));
|
|
749
|
+
const href = createDocsHref(docs.entry, slug);
|
|
750
|
+
return {
|
|
751
|
+
slug,
|
|
752
|
+
title,
|
|
753
|
+
description: frontmatter.description,
|
|
754
|
+
section: frontmatter.section,
|
|
755
|
+
href,
|
|
756
|
+
sourcePath,
|
|
757
|
+
lastModified: resolveFarmDocsPageLastModified(contentDir, sourcePath, frontmatter),
|
|
758
|
+
frontmatter,
|
|
759
|
+
body
|
|
760
|
+
};
|
|
761
|
+
}
|
|
762
|
+
function getFarmDocsMarkdownPath(href) {
|
|
763
|
+
return href === "/" ? "/.md" : `${href}.md`;
|
|
764
|
+
}
|
|
765
|
+
function createDocsHref(entry, slug) {
|
|
766
|
+
const normalizedEntry = normalizeEntry2(entry);
|
|
767
|
+
const normalizedSlug = trimSlashes(slug);
|
|
768
|
+
if (normalizedEntry === "/") return normalizedSlug ? `/${normalizedSlug}` : "/";
|
|
769
|
+
return normalizedSlug ? `${normalizedEntry}/${normalizedSlug}` : normalizedEntry;
|
|
770
|
+
}
|
|
771
|
+
function pathToSlug(contentDir, filePath) {
|
|
772
|
+
const relative = path2.relative(contentDir, filePath).replace(/\\/g, "/");
|
|
773
|
+
if (relative.startsWith("..")) return null;
|
|
774
|
+
const extension = path2.extname(relative);
|
|
775
|
+
if (!DOCS_FILE_EXTENSIONS2.includes(extension)) return null;
|
|
776
|
+
const withoutExtension = relative.slice(0, -extension.length);
|
|
777
|
+
if (withoutExtension === "page" || withoutExtension === "index") return "";
|
|
778
|
+
if (withoutExtension.endsWith("/page") || withoutExtension.endsWith("/index")) {
|
|
779
|
+
return withoutExtension.replace(/\/(page|index)$/, "");
|
|
780
|
+
}
|
|
781
|
+
return withoutExtension;
|
|
782
|
+
}
|
|
783
|
+
function loadPage(contentDir, docs, request) {
|
|
784
|
+
return loadFarmDocsPage(contentDir, docs, getRequestSlug(docs, request));
|
|
785
|
+
}
|
|
786
|
+
function discoverFarmDocsPages(contentDir, docs) {
|
|
787
|
+
if (!existsSync2(contentDir)) return [];
|
|
788
|
+
const pages = [];
|
|
789
|
+
const visit = (dir) => {
|
|
790
|
+
for (const entry of readdirSync2(dir, { withFileTypes: true })) {
|
|
791
|
+
if (entry.name.startsWith(".") || entry.name === "node_modules") continue;
|
|
792
|
+
const absolutePath = path2.join(dir, entry.name);
|
|
793
|
+
if (entry.isDirectory()) {
|
|
794
|
+
visit(absolutePath);
|
|
795
|
+
continue;
|
|
796
|
+
}
|
|
797
|
+
if (!entry.isFile()) continue;
|
|
798
|
+
const slug = pathToSlug(contentDir, absolutePath);
|
|
799
|
+
if (slug === null) continue;
|
|
800
|
+
const source = readFileSync2(absolutePath, "utf8");
|
|
801
|
+
const { frontmatter, body } = parseFrontmatter(source);
|
|
802
|
+
pages.push({
|
|
803
|
+
slug,
|
|
804
|
+
title: frontmatter.title || titleFromMarkdown(body, titleFromSlug(slug)),
|
|
805
|
+
description: frontmatter.description,
|
|
806
|
+
section: frontmatter.section,
|
|
807
|
+
href: createDocsHref(docs.entry, slug),
|
|
808
|
+
sourcePath: absolutePath,
|
|
809
|
+
lastModified: resolveFarmDocsPageLastModified(contentDir, absolutePath, frontmatter)
|
|
810
|
+
});
|
|
811
|
+
}
|
|
812
|
+
};
|
|
813
|
+
visit(contentDir);
|
|
814
|
+
return pages.sort((a, b) => a.href.localeCompare(b.href));
|
|
815
|
+
}
|
|
816
|
+
function toFarmDocsMarkdownPage(page) {
|
|
817
|
+
const lastModified = page.lastModified || page.frontmatter.lastModified || page.frontmatter.lastmod;
|
|
818
|
+
return {
|
|
819
|
+
slug: page.slug,
|
|
820
|
+
url: page.href,
|
|
821
|
+
title: page.title,
|
|
822
|
+
description: page.description,
|
|
823
|
+
lastModified,
|
|
824
|
+
lastmod: lastModified,
|
|
825
|
+
content: page.body,
|
|
826
|
+
rawContent: page.body
|
|
827
|
+
};
|
|
828
|
+
}
|
|
829
|
+
function getDocsTitle(docs) {
|
|
830
|
+
return typeof docs.config.nav === "object" && docs.config.nav && "title" in docs.config.nav ? String(docs.config.nav.title || "Documentation") : "Documentation";
|
|
831
|
+
}
|
|
832
|
+
function getDocsDescription(docs) {
|
|
833
|
+
return docs.config.metadata?.description;
|
|
834
|
+
}
|
|
835
|
+
function getLoadedDocsPages(contentDir, docs, isPathGuarded) {
|
|
836
|
+
return discoverFarmDocsPages(contentDir, docs).filter((page) => !isPathGuarded?.(page.href)).map((page) => loadFarmDocsPage(contentDir, docs, page.slug)).filter((page) => Boolean(page));
|
|
837
|
+
}
|
|
838
|
+
function toDocsLlmsPage(page) {
|
|
839
|
+
return toFarmDocsMarkdownPage(page);
|
|
840
|
+
}
|
|
841
|
+
function toDocsSitemapPage(page) {
|
|
842
|
+
return {
|
|
843
|
+
...toFarmDocsMarkdownPage(page),
|
|
844
|
+
sourcePath: page.sourcePath
|
|
845
|
+
};
|
|
846
|
+
}
|
|
847
|
+
function resolvePageActionsConfig(docs) {
|
|
848
|
+
return isObjectRecord(docs.config.pageActions) ? docs.config.pageActions : {};
|
|
849
|
+
}
|
|
850
|
+
function resolvePageActionsAlignment(docs) {
|
|
851
|
+
return resolvePageActionsConfig(docs).alignment === "right" ? "right" : "left";
|
|
852
|
+
}
|
|
853
|
+
function resolveCopyMarkdownActionConfig(docs) {
|
|
854
|
+
const raw = resolvePageActionsConfig(docs).copyMarkdown;
|
|
855
|
+
if (raw === void 0 || raw === false) return null;
|
|
856
|
+
const options = isObjectRecord(raw) ? raw : {};
|
|
857
|
+
if (isObjectRecord(raw) && raw.enabled === false) return null;
|
|
858
|
+
return {
|
|
859
|
+
format: options.format === "text" ? "text" : "markdown",
|
|
860
|
+
includeTitle: options.includeTitle === true,
|
|
861
|
+
label: readString(options.label) ?? "Copy page",
|
|
862
|
+
copiedLabel: readString(options.copiedLabel) ?? "Copied!"
|
|
863
|
+
};
|
|
864
|
+
}
|
|
865
|
+
function resolveLastUpdatedDisplayConfig(docs) {
|
|
866
|
+
const raw = docs.config.lastUpdated;
|
|
867
|
+
const options = isObjectRecord(raw) ? raw : {};
|
|
868
|
+
return {
|
|
869
|
+
enabled: raw !== false && (!isObjectRecord(raw) || raw.enabled !== false),
|
|
870
|
+
label: typeof options.label === "string" ? options.label : "Last updated",
|
|
871
|
+
position: options.position === "below-title" ? "below-title" : "footer"
|
|
872
|
+
};
|
|
873
|
+
}
|
|
874
|
+
function formatLastModifiedDate(value) {
|
|
875
|
+
if (!value) return void 0;
|
|
876
|
+
const date = new Date(value);
|
|
877
|
+
if (Number.isNaN(date.getTime())) return value;
|
|
878
|
+
return new Intl.DateTimeFormat("en", {
|
|
879
|
+
day: "numeric",
|
|
880
|
+
month: "long",
|
|
881
|
+
year: "numeric"
|
|
882
|
+
}).format(date);
|
|
883
|
+
}
|
|
884
|
+
function renderLastUpdatedText(page, docs, position) {
|
|
885
|
+
const config = resolveLastUpdatedDisplayConfig(docs);
|
|
886
|
+
const formatted = formatLastModifiedDate(page.lastModified);
|
|
887
|
+
if (!config.enabled || config.position !== position || !formatted) return "";
|
|
888
|
+
const time = `<time datetime="${escapeAttribute(page.lastModified || "")}">${escapeHtml(formatted)}</time>`;
|
|
889
|
+
const label = config.label.trim();
|
|
890
|
+
return label ? `${escapeHtml(label)} ${time}` : time;
|
|
891
|
+
}
|
|
892
|
+
function resolveReadingTimeDisplayConfig(docs) {
|
|
893
|
+
const raw = docs.config.readingTime;
|
|
894
|
+
if (raw === void 0 || raw === false) return null;
|
|
895
|
+
const options = isObjectRecord(raw) ? raw : {};
|
|
896
|
+
if (isObjectRecord(raw) && options.enabled === false) return null;
|
|
897
|
+
const wordsPerMinute = typeof options.wordsPerMinute === "number" && options.wordsPerMinute > 0 ? options.wordsPerMinute : 220;
|
|
898
|
+
return {
|
|
899
|
+
wordsPerMinute,
|
|
900
|
+
format: options.format === "short" ? "short" : "long",
|
|
901
|
+
includeCode: options.includeCode === true
|
|
902
|
+
};
|
|
903
|
+
}
|
|
904
|
+
function countMarkdownWords(body, includeCode) {
|
|
905
|
+
const readable = (includeCode ? body : body.replace(/```[\s\S]*?```/g, " ").replace(/`[^`]*`/g, " ")).replace(/!\[[^\]]*]\([^)]*\)/g, " ").replace(/\[([^\]]+)]\([^)]*\)/g, "$1").replace(/<[^>]+>/g, " ").replace(/[#>*_~`|:-]/g, " ");
|
|
906
|
+
return readable.match(/[A-Za-z0-9]+(?:[-'][A-Za-z0-9]+)*/g)?.length ?? 0;
|
|
907
|
+
}
|
|
908
|
+
function renderReadingTimeMeta(page, docs) {
|
|
909
|
+
const config = resolveReadingTimeDisplayConfig(docs);
|
|
910
|
+
if (!config) return "";
|
|
911
|
+
const words = countMarkdownWords(page.body, config.includeCode);
|
|
912
|
+
const minutes = Math.max(1, Math.ceil(words / config.wordsPerMinute));
|
|
913
|
+
const label = config.format === "short" ? `${minutes} min` : `${minutes} min read`;
|
|
914
|
+
return `<div class="fd-page-meta not-prose" data-page-reading-time>
|
|
915
|
+
<span class="fd-page-meta-dot" aria-hidden="true">\xB7</span>
|
|
916
|
+
<span class="fd-page-meta-item">${escapeHtml(label)}</span>
|
|
917
|
+
</div>`;
|
|
918
|
+
}
|
|
919
|
+
function renderPixelPageActions(page, docs) {
|
|
920
|
+
const copyMarkdown = resolveCopyMarkdownActionConfig(docs);
|
|
921
|
+
if (!copyMarkdown) return "";
|
|
922
|
+
const markdownUrl = `${page.href}.md`;
|
|
923
|
+
const includeTitle = copyMarkdown.includeTitle ? "true" : "false";
|
|
924
|
+
return `<div class="fd-page-actions" data-page-actions data-actions-alignment="${resolvePageActionsAlignment(docs)}">
|
|
925
|
+
<button
|
|
926
|
+
type="button"
|
|
927
|
+
class="fd-page-action-btn"
|
|
928
|
+
data-page-action="copy-markdown"
|
|
929
|
+
data-copied="false"
|
|
930
|
+
data-markdown-url="${escapeAttribute(markdownUrl)}"
|
|
931
|
+
data-copy-markdown-format="${copyMarkdown.format}"
|
|
932
|
+
data-copy-markdown-include-title="${includeTitle}"
|
|
933
|
+
data-copy-label="${escapeAttribute(copyMarkdown.label)}"
|
|
934
|
+
data-copied-label="${escapeAttribute(copyMarkdown.copiedLabel)}"
|
|
935
|
+
aria-label="${escapeAttribute(copyMarkdown.label)}"
|
|
936
|
+
title="${escapeAttribute(copyMarkdown.label)}"
|
|
937
|
+
>
|
|
938
|
+
<svg class="fd-page-action-copy-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>
|
|
939
|
+
<svg class="fd-page-action-check-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M20 6 9 17l-5-5"></path></svg>
|
|
940
|
+
<span data-page-action-label>${escapeHtml(copyMarkdown.label)}</span>
|
|
941
|
+
</button>
|
|
942
|
+
</div>`;
|
|
943
|
+
}
|
|
944
|
+
function renderBelowTitleMeta(page, docs) {
|
|
945
|
+
const lastUpdated = renderLastUpdatedText(page, docs, "below-title");
|
|
946
|
+
const actions = renderPixelPageActions(page, docs);
|
|
947
|
+
const readingTime = renderReadingTimeMeta(page, docs);
|
|
948
|
+
if (!lastUpdated && !actions && !readingTime) return "";
|
|
949
|
+
return `<div class="fd-below-title-block not-prose">
|
|
950
|
+
${lastUpdated ? `<p class="fd-last-updated-inline">${lastUpdated}</p>` : ""}
|
|
951
|
+
${actions}
|
|
952
|
+
${readingTime}
|
|
953
|
+
</div>`;
|
|
954
|
+
}
|
|
955
|
+
function renderMarkdownHtmlWithTitleMeta(page, docs, html) {
|
|
956
|
+
const meta = renderBelowTitleMeta(page, docs);
|
|
957
|
+
if (!meta) return html;
|
|
958
|
+
const withTitleMeta = html.replace(/(<h1\b[\s\S]*?<\/h1>)/, `$1
|
|
959
|
+
${meta}`);
|
|
960
|
+
return withTitleMeta === html ? `${meta}
|
|
961
|
+
${html}` : withTitleMeta;
|
|
962
|
+
}
|
|
963
|
+
function renderPixelPageFooter(page, docs) {
|
|
964
|
+
const lastUpdated = renderLastUpdatedText(page, docs, "footer");
|
|
965
|
+
if (!lastUpdated) return "";
|
|
966
|
+
return `<div class="not-prose fd-page-footer">
|
|
967
|
+
<span class="fd-last-updated-footer">${lastUpdated}</span>
|
|
968
|
+
</div>`;
|
|
969
|
+
}
|
|
970
|
+
function getDocsLlmsOptions(docs, request) {
|
|
971
|
+
const configured = typeof docs.config.llmsTxt === "object" && docs.config.llmsTxt !== null ? docs.config.llmsTxt : {};
|
|
972
|
+
return {
|
|
973
|
+
enabled: true,
|
|
974
|
+
baseUrl: new URL(request.url).origin,
|
|
975
|
+
siteTitle: getDocsTitle(docs),
|
|
976
|
+
siteDescription: getDocsDescription(docs),
|
|
977
|
+
...configured
|
|
978
|
+
};
|
|
979
|
+
}
|
|
980
|
+
function getDocsDiscoveryOptions(docs, request) {
|
|
981
|
+
return {
|
|
982
|
+
origin: new URL(request.url).origin,
|
|
983
|
+
entry: docs.entry,
|
|
984
|
+
i18n: null,
|
|
985
|
+
search: docs.config.search ?? true,
|
|
986
|
+
mcp: {
|
|
987
|
+
enabled: false,
|
|
988
|
+
route: "/api/docs/mcp",
|
|
989
|
+
name: `${getDocsTitle(docs)} MCP`,
|
|
990
|
+
version: "1",
|
|
991
|
+
tools: {
|
|
992
|
+
listDocs: false,
|
|
993
|
+
listPages: false,
|
|
994
|
+
readPage: false,
|
|
995
|
+
searchDocs: false,
|
|
996
|
+
getNavigation: false,
|
|
997
|
+
getCodeExamples: false,
|
|
998
|
+
getConfigSchema: false,
|
|
999
|
+
getContext: false
|
|
1000
|
+
}
|
|
1001
|
+
},
|
|
1002
|
+
feedback: void 0,
|
|
1003
|
+
llms: getDocsLlmsOptions(docs, request),
|
|
1004
|
+
sitemap: docs.config.sitemap ?? true,
|
|
1005
|
+
robots: docs.config.robots ?? true,
|
|
1006
|
+
openapi: void 0,
|
|
1007
|
+
markdown: {
|
|
1008
|
+
acceptHeader: true,
|
|
1009
|
+
signatureAgentHeader: true
|
|
1010
|
+
}
|
|
1011
|
+
};
|
|
1012
|
+
}
|
|
1013
|
+
function createFarmDocsPublicResponse(contentDir, docs, request, isPathGuarded) {
|
|
1014
|
+
const url = new URL(request.url);
|
|
1015
|
+
let loadedPages;
|
|
1016
|
+
const getPages = () => loadedPages ?? (loadedPages = getLoadedDocsPages(contentDir, docs, isPathGuarded));
|
|
1017
|
+
const sitemapManifest = () => docsEngine().buildDocsSitemapManifest({
|
|
1018
|
+
pages: getPages().map(toDocsSitemapPage),
|
|
1019
|
+
entry: docs.entry,
|
|
1020
|
+
siteTitle: getDocsTitle(docs),
|
|
1021
|
+
baseUrl: url.origin
|
|
1022
|
+
});
|
|
1023
|
+
const textHeaders = (contentType) => ({
|
|
1024
|
+
"Content-Type": contentType,
|
|
1025
|
+
"Cache-Control": "public, max-age=60"
|
|
1026
|
+
});
|
|
1027
|
+
const llmsFormat = docsEngine().resolveDocsLlmsTxtFormat(url);
|
|
1028
|
+
if (llmsFormat) {
|
|
1029
|
+
const generated = docsEngine().renderDocsLlmsTxt(
|
|
1030
|
+
getPages().map(toDocsLlmsPage),
|
|
1031
|
+
getDocsLlmsOptions(docs, request)
|
|
1032
|
+
);
|
|
1033
|
+
return new Response(llmsFormat === "llms-full" ? generated.llmsFullTxt : generated.llmsTxt, {
|
|
1034
|
+
status: 200,
|
|
1035
|
+
headers: textHeaders("text/plain; charset=utf-8")
|
|
1036
|
+
});
|
|
1037
|
+
}
|
|
1038
|
+
const sitemapFormat = docsEngine().resolveDocsSitemapRequest(url, docs.config.sitemap ?? true);
|
|
1039
|
+
if (sitemapFormat === "xml") {
|
|
1040
|
+
return new Response(
|
|
1041
|
+
docsEngine().renderDocsSitemapXml(sitemapManifest(), {
|
|
1042
|
+
baseUrl: url.origin,
|
|
1043
|
+
includeLastmod: true
|
|
1044
|
+
}),
|
|
1045
|
+
{
|
|
1046
|
+
status: 200,
|
|
1047
|
+
headers: textHeaders("application/xml; charset=utf-8")
|
|
1048
|
+
}
|
|
1049
|
+
);
|
|
1050
|
+
}
|
|
1051
|
+
if (sitemapFormat === "markdown") {
|
|
1052
|
+
return new Response(
|
|
1053
|
+
docsEngine().renderDocsSitemapMarkdown(sitemapManifest(), {
|
|
1054
|
+
includeDescriptions: true
|
|
1055
|
+
}),
|
|
1056
|
+
{
|
|
1057
|
+
status: 200,
|
|
1058
|
+
headers: textHeaders("text/markdown; charset=utf-8")
|
|
1059
|
+
}
|
|
1060
|
+
);
|
|
1061
|
+
}
|
|
1062
|
+
if (docsEngine().resolveDocsRobotsRequest(url, docs.config.robots ?? true)) {
|
|
1063
|
+
return new Response(
|
|
1064
|
+
docsEngine().renderDocsRobotsTxt({
|
|
1065
|
+
entry: docs.entry,
|
|
1066
|
+
sitemap: docs.config.sitemap ?? true,
|
|
1067
|
+
robots: docs.config.robots ?? true,
|
|
1068
|
+
baseUrl: url.origin
|
|
1069
|
+
}),
|
|
1070
|
+
{
|
|
1071
|
+
status: 200,
|
|
1072
|
+
headers: textHeaders("text/plain; charset=utf-8")
|
|
1073
|
+
}
|
|
1074
|
+
);
|
|
1075
|
+
}
|
|
1076
|
+
if (docsEngine().isDocsAgentDiscoveryRequest(url)) {
|
|
1077
|
+
const spec = docsEngine().buildDocsAgentDiscoverySpec(getDocsDiscoveryOptions(docs, request));
|
|
1078
|
+
const title = getDocsTitle(docs);
|
|
1079
|
+
return new Response(
|
|
1080
|
+
JSON.stringify({
|
|
1081
|
+
...spec,
|
|
1082
|
+
name: title,
|
|
1083
|
+
site: {
|
|
1084
|
+
...spec.site,
|
|
1085
|
+
title,
|
|
1086
|
+
description: getDocsDescription(docs),
|
|
1087
|
+
entry: docs.entry
|
|
1088
|
+
}
|
|
1089
|
+
}),
|
|
1090
|
+
{
|
|
1091
|
+
status: 200,
|
|
1092
|
+
headers: textHeaders("application/json; charset=utf-8")
|
|
1093
|
+
}
|
|
1094
|
+
);
|
|
1095
|
+
}
|
|
1096
|
+
if (docsEngine().isDocsAgentsRequest(url)) {
|
|
1097
|
+
return new Response(
|
|
1098
|
+
`${docsEngine().renderDocsAgentsDocument(getDocsDiscoveryOptions(docs, request)).trim()}
|
|
1099
|
+
`,
|
|
1100
|
+
{
|
|
1101
|
+
status: 200,
|
|
1102
|
+
headers: textHeaders("text/markdown; charset=utf-8")
|
|
1103
|
+
}
|
|
1104
|
+
);
|
|
1105
|
+
}
|
|
1106
|
+
if (docsEngine().isDocsSkillRequest(url)) {
|
|
1107
|
+
return new Response(
|
|
1108
|
+
`${docsEngine().renderDocsSkillDocument(getDocsDiscoveryOptions(docs, request)).trim()}
|
|
1109
|
+
`,
|
|
1110
|
+
{
|
|
1111
|
+
status: 200,
|
|
1112
|
+
headers: textHeaders("text/markdown; charset=utf-8")
|
|
1113
|
+
}
|
|
1114
|
+
);
|
|
1115
|
+
}
|
|
1116
|
+
return null;
|
|
1117
|
+
}
|
|
1118
|
+
function omitFarmDocsHeadBody(request, response) {
|
|
1119
|
+
if (request.method !== "HEAD") return response;
|
|
1120
|
+
return new Response(null, {
|
|
1121
|
+
status: response.status,
|
|
1122
|
+
statusText: response.statusText,
|
|
1123
|
+
headers: response.headers
|
|
1124
|
+
});
|
|
1125
|
+
}
|
|
1126
|
+
function escapeHtml(value) {
|
|
1127
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
1128
|
+
}
|
|
1129
|
+
function shouldReturnMarkdown(request) {
|
|
1130
|
+
const url = new URL(request.url);
|
|
1131
|
+
if (url.pathname.endsWith(".md")) return true;
|
|
1132
|
+
const accept = request.headers.get("accept");
|
|
1133
|
+
const markdown = Math.max(
|
|
1134
|
+
farmAcceptQuality(accept, "text/markdown"),
|
|
1135
|
+
farmAcceptQuality(accept, "text/plain")
|
|
1136
|
+
);
|
|
1137
|
+
if (markdown <= 0) return false;
|
|
1138
|
+
return markdown >= farmAcceptQuality(accept, "text/html", { wildcards: true });
|
|
1139
|
+
}
|
|
1140
|
+
function escapeAttribute(value) {
|
|
1141
|
+
return escapeHtml(value).replace(/'/g, "'");
|
|
1142
|
+
}
|
|
1143
|
+
function slugify(value) {
|
|
1144
|
+
return value.toLowerCase().replace(/<[^>]+>/g, "").replace(/`([^`]+)`/g, "$1").replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
1145
|
+
}
|
|
1146
|
+
function createSlugger() {
|
|
1147
|
+
const seen = /* @__PURE__ */ new Map();
|
|
1148
|
+
return (value) => {
|
|
1149
|
+
const base = slugify(value) || "section";
|
|
1150
|
+
const count = seen.get(base) || 0;
|
|
1151
|
+
seen.set(base, count + 1);
|
|
1152
|
+
return count === 0 ? base : `${base}-${count + 1}`;
|
|
1153
|
+
};
|
|
1154
|
+
}
|
|
1155
|
+
function stripHtml(value) {
|
|
1156
|
+
return value.replace(/<[^>]+>/g, "");
|
|
1157
|
+
}
|
|
1158
|
+
function getCodeFence(line) {
|
|
1159
|
+
const match = /^(?: {0,3})(`{3,}|~{3,})/.exec(line);
|
|
1160
|
+
const value = match?.[1];
|
|
1161
|
+
if (!value) return null;
|
|
1162
|
+
return { marker: value[0], length: value.length };
|
|
1163
|
+
}
|
|
1164
|
+
function isClosingCodeFence(line, fence) {
|
|
1165
|
+
const trimmed = line.trim();
|
|
1166
|
+
return trimmed.length >= fence.length && Array.from(trimmed).every((char) => char === fence.marker);
|
|
1167
|
+
}
|
|
1168
|
+
function stripMdxRuntimeSyntax(body) {
|
|
1169
|
+
const output = [];
|
|
1170
|
+
let fence = null;
|
|
1171
|
+
for (const line of body.split("\n")) {
|
|
1172
|
+
const nextFence = getCodeFence(line);
|
|
1173
|
+
if (fence) {
|
|
1174
|
+
output.push(line);
|
|
1175
|
+
if (nextFence && nextFence.marker === fence.marker && isClosingCodeFence(line, fence)) {
|
|
1176
|
+
fence = null;
|
|
1177
|
+
}
|
|
1178
|
+
continue;
|
|
1179
|
+
}
|
|
1180
|
+
if (nextFence) {
|
|
1181
|
+
fence = nextFence;
|
|
1182
|
+
output.push(line);
|
|
1183
|
+
continue;
|
|
1184
|
+
}
|
|
1185
|
+
if (/^\s*import\s.+$/.test(line) || /^\s*export\s+(const|default)\s.+$/.test(line)) {
|
|
1186
|
+
continue;
|
|
1187
|
+
}
|
|
1188
|
+
output.push(line);
|
|
1189
|
+
}
|
|
1190
|
+
return output.join("\n");
|
|
1191
|
+
}
|
|
1192
|
+
function unescapeHtml(value) {
|
|
1193
|
+
return value.replace(/"/g, '"').replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&");
|
|
1194
|
+
}
|
|
1195
|
+
var CODE_LANGUAGE_LABELS = /* @__PURE__ */ new Set([
|
|
1196
|
+
"bash",
|
|
1197
|
+
"cjs",
|
|
1198
|
+
"cmd",
|
|
1199
|
+
"console",
|
|
1200
|
+
"css",
|
|
1201
|
+
"html",
|
|
1202
|
+
"javascript",
|
|
1203
|
+
"js",
|
|
1204
|
+
"json",
|
|
1205
|
+
"jsx",
|
|
1206
|
+
"md",
|
|
1207
|
+
"mdx",
|
|
1208
|
+
"shell",
|
|
1209
|
+
"sh",
|
|
1210
|
+
"terminal",
|
|
1211
|
+
"text",
|
|
1212
|
+
"ts",
|
|
1213
|
+
"tsx",
|
|
1214
|
+
"txt",
|
|
1215
|
+
"typescript",
|
|
1216
|
+
"yaml",
|
|
1217
|
+
"yml",
|
|
1218
|
+
"zsh"
|
|
1219
|
+
]);
|
|
1220
|
+
var EXTENSIONLESS_CODE_FILENAMES = /* @__PURE__ */ new Set([
|
|
1221
|
+
"dockerfile",
|
|
1222
|
+
"makefile",
|
|
1223
|
+
"procfile",
|
|
1224
|
+
"readme",
|
|
1225
|
+
"license"
|
|
1226
|
+
]);
|
|
1227
|
+
function isCodePathLabel(label) {
|
|
1228
|
+
const trimmed = label.trim();
|
|
1229
|
+
if (!trimmed || /\s/.test(trimmed)) return false;
|
|
1230
|
+
const lower = trimmed.toLowerCase();
|
|
1231
|
+
if (CODE_LANGUAGE_LABELS.has(lower)) return false;
|
|
1232
|
+
const fileName = trimmed.split(/[\\/]/).filter(Boolean).pop() || trimmed;
|
|
1233
|
+
const lowerFileName = fileName.toLowerCase();
|
|
1234
|
+
if (EXTENSIONLESS_CODE_FILENAMES.has(lowerFileName)) return true;
|
|
1235
|
+
if (fileName.startsWith(".") && fileName.length > 1) return true;
|
|
1236
|
+
return /\.[a-z0-9][a-z0-9-]*$/i.test(fileName);
|
|
1237
|
+
}
|
|
1238
|
+
function parseCodeInfo(info) {
|
|
1239
|
+
const source = (info || "").trim();
|
|
1240
|
+
const language = source.match(/^\S+/)?.[0] || "text";
|
|
1241
|
+
const explicitLabel = source.match(/\b(?:title|filename|file|label|name)=["']([^"']+)["']/)?.[1]?.trim();
|
|
1242
|
+
return { language, label: explicitLabel || language, hasExplicitLabel: Boolean(explicitLabel) };
|
|
1243
|
+
}
|
|
1244
|
+
function getStandaloneCodeLabel(line) {
|
|
1245
|
+
const trimmed = line.trim();
|
|
1246
|
+
const match = /^(?:\*\*([^*]+)\*\*|__([^_]+)__|`([^`]+)`)$/u.exec(trimmed);
|
|
1247
|
+
const label = match?.[1] || match?.[2] || match?.[3];
|
|
1248
|
+
return label?.trim() || null;
|
|
1249
|
+
}
|
|
1250
|
+
function hasCodeFenceTitle(info) {
|
|
1251
|
+
return /\b(?:title|filename|file|label|name)=["'][^"']+["']/.test(info);
|
|
1252
|
+
}
|
|
1253
|
+
function escapeCodeFenceTitle(value) {
|
|
1254
|
+
return value.replace(/"/g, """);
|
|
1255
|
+
}
|
|
1256
|
+
function addTitleToCodeFence(line, title) {
|
|
1257
|
+
const match = /^(\s{0,3})(`{3,}|~{3,})(.*)$/u.exec(line);
|
|
1258
|
+
if (!match) return line;
|
|
1259
|
+
const [, indent, marker, infoSource] = match;
|
|
1260
|
+
const info = infoSource.trim();
|
|
1261
|
+
if (hasCodeFenceTitle(info)) return line;
|
|
1262
|
+
const suffix = `title="${escapeCodeFenceTitle(title)}"`;
|
|
1263
|
+
return `${indent}${marker}${info ? `${info} ${suffix}` : `text ${suffix}`}`;
|
|
1264
|
+
}
|
|
1265
|
+
function attachCodeBlockLabels(body) {
|
|
1266
|
+
const lines = body.split("\n");
|
|
1267
|
+
const output = [];
|
|
1268
|
+
let fence = null;
|
|
1269
|
+
for (let index = 0; index < lines.length; index += 1) {
|
|
1270
|
+
const line = lines[index] || "";
|
|
1271
|
+
const nextFence = getCodeFence(line);
|
|
1272
|
+
if (fence) {
|
|
1273
|
+
output.push(line);
|
|
1274
|
+
if (nextFence && nextFence.marker === fence.marker && isClosingCodeFence(line, fence)) {
|
|
1275
|
+
fence = null;
|
|
1276
|
+
}
|
|
1277
|
+
continue;
|
|
1278
|
+
}
|
|
1279
|
+
if (nextFence) {
|
|
1280
|
+
fence = nextFence;
|
|
1281
|
+
output.push(line);
|
|
1282
|
+
continue;
|
|
1283
|
+
}
|
|
1284
|
+
const label = getStandaloneCodeLabel(line);
|
|
1285
|
+
if (!label) {
|
|
1286
|
+
output.push(line);
|
|
1287
|
+
continue;
|
|
1288
|
+
}
|
|
1289
|
+
let fenceIndex = index + 1;
|
|
1290
|
+
while (fenceIndex < lines.length && (lines[fenceIndex] || "").trim() === "") {
|
|
1291
|
+
fenceIndex += 1;
|
|
1292
|
+
}
|
|
1293
|
+
const labeledFence = getCodeFence(lines[fenceIndex] || "");
|
|
1294
|
+
if (!labeledFence) {
|
|
1295
|
+
output.push(line);
|
|
1296
|
+
continue;
|
|
1297
|
+
}
|
|
1298
|
+
output.push(addTitleToCodeFence(lines[fenceIndex] || "", label));
|
|
1299
|
+
fence = labeledFence;
|
|
1300
|
+
index = fenceIndex;
|
|
1301
|
+
}
|
|
1302
|
+
return output.join("\n");
|
|
1303
|
+
}
|
|
1304
|
+
function highlightCodeBlock(code) {
|
|
1305
|
+
return highlight(code.replace(/\n$/, "")).replace(/<\/span>\n<span/g, "</span><span");
|
|
1306
|
+
}
|
|
1307
|
+
function renderCodeCopyButton(className = "code-copy") {
|
|
1308
|
+
return `<button class="${className}" type="button" data-code-copy data-copied="false" aria-label="Copy code" title="Copy code"><svg class="code-copy-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg><svg class="code-copy-check" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M20 6 9 17l-5-5"></path></svg></button>`;
|
|
1309
|
+
}
|
|
1310
|
+
function renderMarkdownDocument(body, depth) {
|
|
1311
|
+
const slug = createSlugger();
|
|
1312
|
+
const renderer = new Renderer();
|
|
1313
|
+
const maxLevel = Math.max(2, Math.min(depth, 6));
|
|
1314
|
+
const tocItems = [];
|
|
1315
|
+
renderer.heading = (text, level, raw) => {
|
|
1316
|
+
const title = raw || stripHtml(text);
|
|
1317
|
+
const id = slug(title);
|
|
1318
|
+
if (level >= 2 && level <= maxLevel) {
|
|
1319
|
+
tocItems.push({ id, title, level });
|
|
1320
|
+
}
|
|
1321
|
+
return `<h${level} id="${escapeAttribute(id)}"><a class="heading-anchor" href="#${escapeAttribute(id)}">${text}</a></h${level}>
|
|
1322
|
+
`;
|
|
1323
|
+
};
|
|
1324
|
+
renderer.code = (code, infostring, escaped) => {
|
|
1325
|
+
const { language, label, hasExplicitLabel } = parseCodeInfo(infostring);
|
|
1326
|
+
const rawCode = escaped ? unescapeHtml(code) : code;
|
|
1327
|
+
const highlighted = highlightCodeBlock(rawCode);
|
|
1328
|
+
const shouldRenderHeader = hasExplicitLabel && isCodePathLabel(label);
|
|
1329
|
+
const header = shouldRenderHeader ? `<div class="code-block-header">
|
|
1330
|
+
<span class="code-block-title">${escapeHtml(label)}</span>
|
|
1331
|
+
${renderCodeCopyButton()}
|
|
1332
|
+
</div>` : renderCodeCopyButton("code-copy code-copy-floating");
|
|
1333
|
+
return `<figure class="shiki code-block ${shouldRenderHeader ? "code-block-framed" : "code-block-plain"}" data-language="${escapeAttribute(language)}">
|
|
1334
|
+
${header}
|
|
1335
|
+
<pre><code class="sh-code language-${escapeAttribute(language)}">${highlighted}</code></pre>
|
|
1336
|
+
</figure>
|
|
1337
|
+
`;
|
|
1338
|
+
};
|
|
1339
|
+
renderer.table = (header, body2) => `<div class="fd-table-wrapper table-wrap relative overflow-auto prose-no-margin my-6"><table><thead>${header}</thead><tbody>${body2}</tbody></table></div>
|
|
1340
|
+
`;
|
|
1341
|
+
renderer.blockquote = (quote) => `<blockquote>${quote}</blockquote>
|
|
1342
|
+
`;
|
|
1343
|
+
renderer.codespan = (code) => `<code>${escapeHtml(code)}</code>`;
|
|
1344
|
+
renderer.link = (href, title, text) => {
|
|
1345
|
+
const safeHref = href || "";
|
|
1346
|
+
const titleAttribute = title ? ` title="${escapeAttribute(title)}"` : "";
|
|
1347
|
+
return `<a href="${escapeAttribute(safeHref)}"${titleAttribute}>${text}</a>`;
|
|
1348
|
+
};
|
|
1349
|
+
renderer.image = (href, title, text) => {
|
|
1350
|
+
const titleAttribute = title ? ` title="${escapeAttribute(title)}"` : "";
|
|
1351
|
+
return `<img src="${escapeAttribute(href)}" alt="${escapeAttribute(text)}"${titleAttribute}>`;
|
|
1352
|
+
};
|
|
1353
|
+
const html = marked(attachCodeBlockLabels(stripMdxRuntimeSyntax(body)), {
|
|
1354
|
+
async: false,
|
|
1355
|
+
breaks: false,
|
|
1356
|
+
gfm: true,
|
|
1357
|
+
renderer
|
|
1358
|
+
});
|
|
1359
|
+
return { html: html.trim(), tocItems };
|
|
1360
|
+
}
|
|
1361
|
+
function getThemeUI(docs) {
|
|
1362
|
+
const theme = docs.config.theme;
|
|
1363
|
+
return theme && typeof theme === "object" && "ui" in theme && typeof theme.ui === "object" ? theme.ui : {};
|
|
1364
|
+
}
|
|
1365
|
+
function getThemeName(docs) {
|
|
1366
|
+
const theme = docs.config.theme;
|
|
1367
|
+
return theme && typeof theme === "object" && "name" in theme ? String(theme.name || "farm-docs") : "farm-docs";
|
|
1368
|
+
}
|
|
1369
|
+
function getThemeTocDepth(docs) {
|
|
1370
|
+
const toc = getThemeUI(docs).layout?.toc;
|
|
1371
|
+
return toc && typeof toc === "object" && typeof toc.depth === "number" ? toc.depth : 3;
|
|
1372
|
+
}
|
|
1373
|
+
var SIDEBAR_SECTION_ORDER = [
|
|
1374
|
+
"Start",
|
|
1375
|
+
"Core",
|
|
1376
|
+
"Data and APIs",
|
|
1377
|
+
"Integrations",
|
|
1378
|
+
"Runtime",
|
|
1379
|
+
"Content",
|
|
1380
|
+
"Extending",
|
|
1381
|
+
"Reference"
|
|
1382
|
+
];
|
|
1383
|
+
var SIDEBAR_PAGE_ORDER = new Map(
|
|
1384
|
+
[
|
|
1385
|
+
"",
|
|
1386
|
+
"getting-started",
|
|
1387
|
+
"project-structure",
|
|
1388
|
+
"configuration",
|
|
1389
|
+
"routing",
|
|
1390
|
+
"layouts",
|
|
1391
|
+
"server-rendering",
|
|
1392
|
+
"middleware",
|
|
1393
|
+
"query",
|
|
1394
|
+
"api-routes",
|
|
1395
|
+
"api-client",
|
|
1396
|
+
"storage",
|
|
1397
|
+
"integrations",
|
|
1398
|
+
"integrations/stripe",
|
|
1399
|
+
"integrations/autumn",
|
|
1400
|
+
"integrations/polar",
|
|
1401
|
+
"integrations/auth",
|
|
1402
|
+
"integrations/email",
|
|
1403
|
+
"integrations/jobs",
|
|
1404
|
+
"integrations/unkey",
|
|
1405
|
+
"integrations/ui-registry",
|
|
1406
|
+
"integrations/orm-storage",
|
|
1407
|
+
"cache-ppr",
|
|
1408
|
+
"observability",
|
|
1409
|
+
"deployment",
|
|
1410
|
+
"docs-engine",
|
|
1411
|
+
"markdown",
|
|
1412
|
+
"openapi",
|
|
1413
|
+
"plugins",
|
|
1414
|
+
"plugins/create-plugin",
|
|
1415
|
+
"cli",
|
|
1416
|
+
"examples",
|
|
1417
|
+
"reference"
|
|
1418
|
+
].map((slug, index) => [slug, index])
|
|
1419
|
+
);
|
|
1420
|
+
function isSidebarNavigationItem(value) {
|
|
1421
|
+
return value !== null;
|
|
1422
|
+
}
|
|
1423
|
+
function compareSidebarPages(a, b) {
|
|
1424
|
+
const aOrder = SIDEBAR_PAGE_ORDER.get(a.slug) ?? 1e3;
|
|
1425
|
+
const bOrder = SIDEBAR_PAGE_ORDER.get(b.slug) ?? 1e3;
|
|
1426
|
+
return aOrder - bOrder || a.title.localeCompare(b.title);
|
|
1427
|
+
}
|
|
1428
|
+
function getSidebarSection(page) {
|
|
1429
|
+
if (page.section) return page.section;
|
|
1430
|
+
if (page.slug.startsWith("integrations/")) return "Integrations";
|
|
1431
|
+
if (page.slug.startsWith("plugins/")) return "Extending";
|
|
1432
|
+
return "Reference";
|
|
1433
|
+
}
|
|
1434
|
+
function sidebarIdFor(section) {
|
|
1435
|
+
return `sidebar-${slugify(section)}`;
|
|
1436
|
+
}
|
|
1437
|
+
function isObjectRecord(value) {
|
|
1438
|
+
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
1439
|
+
}
|
|
1440
|
+
function readString(value) {
|
|
1441
|
+
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
1442
|
+
}
|
|
1443
|
+
function readOptionalString(value) {
|
|
1444
|
+
return typeof value === "string" ? value.trim() : void 0;
|
|
1445
|
+
}
|
|
1446
|
+
function normalizeSidebarSlug(value) {
|
|
1447
|
+
if (value === "/" || value === ".") return "";
|
|
1448
|
+
return trimSlashes(value);
|
|
1449
|
+
}
|
|
1450
|
+
function getSidebarNavigation(docs) {
|
|
1451
|
+
const navigation = docs.config.navigation;
|
|
1452
|
+
if (!isObjectRecord(navigation) || !Array.isArray(navigation.sidebar)) return [];
|
|
1453
|
+
return navigation.sidebar.map(normalizeSidebarNavigationItem).filter(isSidebarNavigationItem);
|
|
1454
|
+
}
|
|
1455
|
+
function normalizeSidebarNavigationItem(value) {
|
|
1456
|
+
if (!isObjectRecord(value)) return null;
|
|
1457
|
+
const label = readString(value.label) ?? readString(value.title);
|
|
1458
|
+
const icon = readString(value.icon);
|
|
1459
|
+
const slug = readOptionalString(value.slug) ?? readOptionalString(value.path);
|
|
1460
|
+
const href = readString(value.href) ?? readString(value.url);
|
|
1461
|
+
const rawChildren = Array.isArray(value.children) ? value.children : Array.isArray(value.items) ? value.items : [];
|
|
1462
|
+
const children = rawChildren.map(normalizeSidebarNavigationItem).filter(isSidebarNavigationItem);
|
|
1463
|
+
if (!label && !slug && !href && children.length === 0) return null;
|
|
1464
|
+
return {
|
|
1465
|
+
...label ? { label } : {},
|
|
1466
|
+
...icon ? { icon } : {},
|
|
1467
|
+
...slug !== void 0 ? { slug: normalizeSidebarSlug(slug) } : {},
|
|
1468
|
+
...href ? { href } : {},
|
|
1469
|
+
children
|
|
1470
|
+
};
|
|
1471
|
+
}
|
|
1472
|
+
function createSidebarPageMaps(pages) {
|
|
1473
|
+
return {
|
|
1474
|
+
bySlug: new Map(pages.map((page) => [page.slug, page])),
|
|
1475
|
+
byHref: new Map(pages.map((page) => [page.href, page]))
|
|
1476
|
+
};
|
|
1477
|
+
}
|
|
1478
|
+
function resolveConfiguredSidebarPage(item, maps) {
|
|
1479
|
+
if (item.slug !== void 0) return maps.bySlug.get(item.slug);
|
|
1480
|
+
if (item.href) return maps.byHref.get(item.href);
|
|
1481
|
+
return void 0;
|
|
1482
|
+
}
|
|
1483
|
+
function getSidebarIconRegistry(docs) {
|
|
1484
|
+
return isObjectRecord(docs.config.icons) ? docs.config.icons : {};
|
|
1485
|
+
}
|
|
1486
|
+
function renderConfiguredIconSvg(value) {
|
|
1487
|
+
if (typeof value !== "string") return "";
|
|
1488
|
+
const icon = value.trim();
|
|
1489
|
+
if (!icon) return "";
|
|
1490
|
+
if (/^<svg[\s>]/i.test(icon)) return icon;
|
|
1491
|
+
if (/^<(path|circle|rect|line|polyline|polygon|ellipse|g)\b/i.test(icon)) {
|
|
1492
|
+
return `<svg viewBox="0 0 24 24" focusable="false">${icon}</svg>`;
|
|
1493
|
+
}
|
|
1494
|
+
return "";
|
|
1495
|
+
}
|
|
1496
|
+
function renderSidebarIcon(docs, icon, className = "sidebar-icon fd-sidebar-icon") {
|
|
1497
|
+
if (!icon) return "";
|
|
1498
|
+
const iconRegistry = getSidebarIconRegistry(docs);
|
|
1499
|
+
const configuredIcon = iconRegistry[icon] ?? icon;
|
|
1500
|
+
const svg = renderConfiguredIconSvg(configuredIcon);
|
|
1501
|
+
if (!svg) return "";
|
|
1502
|
+
return `<span class="${className}" data-sidebar-icon="${escapeAttribute(icon)}" aria-hidden="true">${svg}</span>`;
|
|
1503
|
+
}
|
|
1504
|
+
function renderSidebarLabel(docs, icon, label, className) {
|
|
1505
|
+
return `<span class="${className}">${renderSidebarIcon(docs, icon)}<span class="sidebar-label-text">${escapeHtml(label)}</span></span>`;
|
|
1506
|
+
}
|
|
1507
|
+
function getSidebarPageLabel(item, configured) {
|
|
1508
|
+
if (configured?.label) return configured.label;
|
|
1509
|
+
if (item.slug === "") return "Why?";
|
|
1510
|
+
if (item.slug === "integrations") return "Overview";
|
|
1511
|
+
if (item.slug === "integrations/ui-registry") return "UI Registry";
|
|
1512
|
+
if (item.slug === "integrations/orm-storage") return "ORM Storage";
|
|
1513
|
+
if (item.slug.startsWith("integrations/")) {
|
|
1514
|
+
return item.title.replace(/\s+Integrations?$/i, "");
|
|
1515
|
+
}
|
|
1516
|
+
return item.title;
|
|
1517
|
+
}
|
|
1518
|
+
function renderSidebarLink(item, activeHref, docs, configured) {
|
|
1519
|
+
const active = item.href === activeHref;
|
|
1520
|
+
return `<a class="fd-sidebar-link${active ? " fd-sidebar-link-active" : ""}" data-active="${active ? "true" : "false"}" href="${escapeAttribute(item.href)}">${renderSidebarLabel(docs, configured?.icon, getSidebarPageLabel(item, configured), "sidebar-link-label fd-sidebar-link-label")}</a>`;
|
|
1521
|
+
}
|
|
1522
|
+
function collectConfiguredSidebarPages(items, maps, seen = /* @__PURE__ */ new Set()) {
|
|
1523
|
+
const ordered = [];
|
|
1524
|
+
for (const item of items) {
|
|
1525
|
+
const page = resolveConfiguredSidebarPage(item, maps);
|
|
1526
|
+
if (page && !seen.has(page.slug)) {
|
|
1527
|
+
seen.add(page.slug);
|
|
1528
|
+
ordered.push(page);
|
|
1529
|
+
}
|
|
1530
|
+
ordered.push(...collectConfiguredSidebarPages(item.children, maps, seen));
|
|
1531
|
+
}
|
|
1532
|
+
return ordered;
|
|
1533
|
+
}
|
|
1534
|
+
function getOrderedSidebarPages(pages, docs) {
|
|
1535
|
+
if (!docs) return [...pages].sort(compareSidebarPages);
|
|
1536
|
+
const maps = createSidebarPageMaps(pages);
|
|
1537
|
+
const configuredPages = collectConfiguredSidebarPages(getSidebarNavigation(docs), maps);
|
|
1538
|
+
if (configuredPages.length === 0) return [...pages].sort(compareSidebarPages);
|
|
1539
|
+
const configuredSlugs = new Set(configuredPages.map((page) => page.slug));
|
|
1540
|
+
const remainingPages = pages.filter((page) => !configuredSlugs.has(page.slug)).sort(compareSidebarPages);
|
|
1541
|
+
return [...configuredPages, ...remainingPages];
|
|
1542
|
+
}
|
|
1543
|
+
function renderExternalSidebarLink(item, activeHref, docs) {
|
|
1544
|
+
if (!item.href || !item.label) return "";
|
|
1545
|
+
const active = item.href === activeHref;
|
|
1546
|
+
return `<a class="fd-sidebar-link${active ? " fd-sidebar-link-active" : ""}" data-active="${active ? "true" : "false"}" href="${escapeAttribute(item.href)}">${renderSidebarLabel(docs, item.icon, item.label, "sidebar-link-label fd-sidebar-link-label")}</a>`;
|
|
1547
|
+
}
|
|
1548
|
+
function renderConfiguredSidebarSubgroup(item, childHtml, docs) {
|
|
1549
|
+
const label = item.label;
|
|
1550
|
+
if (!label) return childHtml;
|
|
1551
|
+
return `<div class="sidebar-subgroup fd-sidebar-folder" data-sidebar-subgroup="${escapeAttribute(slugify(label))}">
|
|
1552
|
+
<div class="sidebar-subgroup-title fd-sidebar-folder-trigger">${renderSidebarLabel(docs, item.icon, label, "sidebar-subgroup-label")}</div>
|
|
1553
|
+
<div class="sidebar-subgroup-content fd-sidebar-folder-content">
|
|
1554
|
+
${childHtml}
|
|
1555
|
+
</div>
|
|
1556
|
+
</div>`;
|
|
1557
|
+
}
|
|
1558
|
+
function renderConfiguredSidebarItems(items, maps, activeHref, docs) {
|
|
1559
|
+
const renderedItems = [];
|
|
1560
|
+
for (const item of items) {
|
|
1561
|
+
const page = resolveConfiguredSidebarPage(item, maps);
|
|
1562
|
+
const childHtml = renderConfiguredSidebarItems(item.children, maps, activeHref, docs);
|
|
1563
|
+
if (item.children.length > 0) {
|
|
1564
|
+
renderedItems.push(renderConfiguredSidebarSubgroup(item, childHtml, docs));
|
|
1565
|
+
continue;
|
|
1566
|
+
}
|
|
1567
|
+
const linkHtml = page ? renderSidebarLink(page, activeHref, docs, item) : renderExternalSidebarLink(item, activeHref, docs);
|
|
1568
|
+
if (linkHtml) renderedItems.push(linkHtml);
|
|
1569
|
+
}
|
|
1570
|
+
return renderedItems.join("\n");
|
|
1571
|
+
}
|
|
1572
|
+
function renderConfiguredSidebarSection(section, maps, activeHref, docs) {
|
|
1573
|
+
const label = section.label || "Docs";
|
|
1574
|
+
const id = sidebarIdFor(label);
|
|
1575
|
+
const links = renderConfiguredSidebarItems(section.children, maps, activeHref, docs);
|
|
1576
|
+
return `<div class="sidebar-folder fd-sidebar-folder" data-state="open">
|
|
1577
|
+
<button class="text-fd-muted-foreground sidebar-folder-trigger fd-sidebar-folder-trigger" type="button" aria-controls="${escapeAttribute(id)}" aria-expanded="true">${renderSidebarLabel(docs, section.icon, label, "sidebar-folder-label")}</button>
|
|
1578
|
+
<div id="${escapeAttribute(id)}" class="overflow-hidden sidebar-folder-content fd-sidebar-folder-content" data-state="open">
|
|
1579
|
+
${links}
|
|
1580
|
+
</div>
|
|
1581
|
+
</div>`;
|
|
1582
|
+
}
|
|
1583
|
+
function renderAutoSidebarSectionItems(items, activeHref, docs) {
|
|
1584
|
+
return [...items].sort(compareSidebarPages).map((item) => renderSidebarLink(item, activeHref, docs)).join("\n");
|
|
1585
|
+
}
|
|
1586
|
+
function renderPixelNavItems(pages, activeHref, docs) {
|
|
1587
|
+
const configuredSidebar = getSidebarNavigation(docs);
|
|
1588
|
+
if (configuredSidebar.length > 0) {
|
|
1589
|
+
const maps = createSidebarPageMaps(pages);
|
|
1590
|
+
const renderedSections2 = configuredSidebar.map((section) => {
|
|
1591
|
+
if (section.children.length > 0) {
|
|
1592
|
+
return renderConfiguredSidebarSection(section, maps, activeHref, docs);
|
|
1593
|
+
}
|
|
1594
|
+
const page = resolveConfiguredSidebarPage(section, maps);
|
|
1595
|
+
return page ? renderSidebarLink(page, activeHref, docs, section) : renderExternalSidebarLink(section, activeHref, docs);
|
|
1596
|
+
}).filter(Boolean).join("\n");
|
|
1597
|
+
return `<div class="sidebar-scroll overscroll-contain fd-sidebar-nav">
|
|
1598
|
+
<div class="sidebar-tree">
|
|
1599
|
+
${renderedSections2}
|
|
1600
|
+
</div>
|
|
1601
|
+
</div>`;
|
|
1602
|
+
}
|
|
1603
|
+
const groups = /* @__PURE__ */ new Map();
|
|
1604
|
+
for (const item of pages) {
|
|
1605
|
+
const group = item.slug === "" ? "Start" : getSidebarSection(item);
|
|
1606
|
+
const entries = groups.get(group) ?? [];
|
|
1607
|
+
entries.push(item);
|
|
1608
|
+
groups.set(group, entries);
|
|
1609
|
+
}
|
|
1610
|
+
const renderedSections = Array.from(groups.entries()).sort(([a], [b]) => {
|
|
1611
|
+
const aOrder = SIDEBAR_SECTION_ORDER.indexOf(a);
|
|
1612
|
+
const bOrder = SIDEBAR_SECTION_ORDER.indexOf(b);
|
|
1613
|
+
return (aOrder === -1 ? 100 : aOrder) - (bOrder === -1 ? 100 : bOrder) || a.localeCompare(b);
|
|
1614
|
+
}).map(([section, items]) => {
|
|
1615
|
+
const id = sidebarIdFor(section);
|
|
1616
|
+
const links = renderAutoSidebarSectionItems(items, activeHref, docs);
|
|
1617
|
+
return `<div class="sidebar-folder fd-sidebar-folder" data-state="open">
|
|
1618
|
+
<button class="text-fd-muted-foreground sidebar-folder-trigger fd-sidebar-folder-trigger" type="button" aria-controls="${escapeAttribute(id)}" aria-expanded="true">${renderSidebarLabel(docs, void 0, section, "sidebar-folder-label")}</button>
|
|
1619
|
+
<div id="${escapeAttribute(id)}" class="overflow-hidden sidebar-folder-content fd-sidebar-folder-content" data-state="open">
|
|
1620
|
+
${links}
|
|
1621
|
+
</div>
|
|
1622
|
+
</div>`;
|
|
1623
|
+
}).join("\n");
|
|
1624
|
+
return `<div class="sidebar-scroll overscroll-contain fd-sidebar-nav">
|
|
1625
|
+
<div class="sidebar-tree">
|
|
1626
|
+
${renderedSections}
|
|
1627
|
+
</div>
|
|
1628
|
+
</div>`;
|
|
1629
|
+
}
|
|
1630
|
+
function renderPixelPageNav(pages, activeHref, docs) {
|
|
1631
|
+
const orderedPages = getOrderedSidebarPages(pages, docs);
|
|
1632
|
+
const activeIndex = orderedPages.findIndex((item) => item.href === activeHref);
|
|
1633
|
+
if (activeIndex === -1) return "";
|
|
1634
|
+
const previous = orderedPages[activeIndex - 1];
|
|
1635
|
+
const next = orderedPages[activeIndex + 1];
|
|
1636
|
+
if (!previous && !next) return "";
|
|
1637
|
+
const renderChevron = (direction) => `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="${direction === "prev" ? "15 18 9 12 15 6" : "9 18 15 12 9 6"}" /></svg>`;
|
|
1638
|
+
const renderCard = (item, direction) => `<a class="fd-page-nav-card fd-page-nav-${direction}" href="${escapeAttribute(item.href)}">
|
|
1639
|
+
<span class="fd-page-nav-title fd-page-nav-title-${direction}">${direction === "prev" ? `${renderChevron(direction)}${escapeHtml(item.title)}` : `${escapeHtml(item.title)}${renderChevron(direction)}`}</span>
|
|
1640
|
+
<span class="fd-page-nav-description">${direction === "prev" ? "Previous Page" : "Next Page"}</span>
|
|
1641
|
+
</a>`;
|
|
1642
|
+
return `<nav class="not-prose fd-page-nav" aria-label="Page navigation">
|
|
1643
|
+
${previous ? renderCard(previous, "prev") : ""}
|
|
1644
|
+
${next ? renderCard(next, "next") : ""}
|
|
1645
|
+
</nav>`;
|
|
1646
|
+
}
|
|
1647
|
+
function titleizePathSegment(value) {
|
|
1648
|
+
return value.replace(/[-_]+/g, " ").replace(/\b\w/g, (character) => character.toUpperCase());
|
|
1649
|
+
}
|
|
1650
|
+
function isBreadcrumbEnabled(docs) {
|
|
1651
|
+
const breadcrumb = docs.config.breadcrumb;
|
|
1652
|
+
if (breadcrumb === false) return false;
|
|
1653
|
+
if (breadcrumb && typeof breadcrumb === "object" && "enabled" in breadcrumb) {
|
|
1654
|
+
return breadcrumb.enabled !== false;
|
|
1655
|
+
}
|
|
1656
|
+
return true;
|
|
1657
|
+
}
|
|
1658
|
+
function renderPixelBreadcrumb(page, docs) {
|
|
1659
|
+
if (!isBreadcrumbEnabled(docs)) return "";
|
|
1660
|
+
const segments = trimSlashes(page.slug).split("/").filter(Boolean);
|
|
1661
|
+
if (segments.length < 2) return "";
|
|
1662
|
+
const parentSegments = segments.slice(0, -1);
|
|
1663
|
+
const parentSegment = parentSegments[parentSegments.length - 1];
|
|
1664
|
+
const currentSegment = segments[segments.length - 1];
|
|
1665
|
+
const entry = normalizeEntry2(docs.entry);
|
|
1666
|
+
const parentPath = parentSegments.join("/");
|
|
1667
|
+
const parentHref = entry === "/" ? `/${parentPath}` : `${entry}/${parentPath}`;
|
|
1668
|
+
return `<nav class="fd-breadcrumb" aria-label="Breadcrumb">
|
|
1669
|
+
<span class="fd-breadcrumb-item">
|
|
1670
|
+
<a class="fd-breadcrumb-parent fd-breadcrumb-link" href="${escapeAttribute(parentHref)}">${escapeHtml(titleizePathSegment(parentSegment))}</a>
|
|
1671
|
+
</span>
|
|
1672
|
+
<span class="fd-breadcrumb-item">
|
|
1673
|
+
<span class="fd-breadcrumb-sep">/</span>
|
|
1674
|
+
<span class="fd-breadcrumb-current">${escapeHtml(titleizePathSegment(currentSegment))}</span>
|
|
1675
|
+
</span>
|
|
1676
|
+
</nav>`;
|
|
1677
|
+
}
|
|
1678
|
+
function renderDocsSearchTrigger(showIcon = true, className = "") {
|
|
1679
|
+
return `<button class="fd-docs-search-trigger ${className}" type="button" data-search-full="" aria-label="Search documentation" aria-haspopup="dialog" aria-keyshortcuts="Meta+K Control+K">
|
|
1680
|
+
${showIcon ? '<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><circle cx="11" cy="11" r="7"></circle><path d="m20 20-4-4"></path></svg>' : ""}
|
|
1681
|
+
<kbd><span>\u2318</span><span>K</span></kbd>
|
|
1682
|
+
</button>`;
|
|
1683
|
+
}
|
|
1684
|
+
function renderDocsSearchMount(clientEntry) {
|
|
1685
|
+
return `<div id="farm-docs-search-root" data-farm-docs-search-root data-api="/api/docs"></div>
|
|
1686
|
+
${stampFarmCspNonce(`<script type="module" src="${escapeAttribute(clientEntry)}"></script>`)}`;
|
|
1687
|
+
}
|
|
1688
|
+
function renderDocsSearchBootstrapScript() {
|
|
1689
|
+
return stampFarmCspNonce(`<script>${generateFarmDocsSearchBootstrapRuntime()}</script>`);
|
|
1690
|
+
}
|
|
1691
|
+
function renderPixelToc(items) {
|
|
1692
|
+
if (items.length === 0) return '<p class="toc-empty">No sections</p>';
|
|
1693
|
+
return `<div class="toc-track fd-toc-list">
|
|
1694
|
+
<div class="toc-thumb" data-toc-thumb style="clip-path: polygon(0 0px, 100% 0px, 100% 32px, 0 32px);"></div>
|
|
1695
|
+
<div class="toc-links">
|
|
1696
|
+
${items.map(
|
|
1697
|
+
(item) => `<a class="toc-link fd-toc-link${items[0] === item ? " fd-toc-link-active" : ""}" data-active="${items[0] === item ? "true" : "false"}" data-toc-item data-depth="${item.level}" href="#${escapeAttribute(item.id)}">${escapeHtml(item.title)}</a>`
|
|
1698
|
+
).join("\n")}
|
|
1699
|
+
</div>
|
|
1700
|
+
</div>`;
|
|
1701
|
+
}
|
|
1702
|
+
function renderDocsRuntimeScript(docs) {
|
|
1703
|
+
const docsEntry = JSON.stringify(normalizeEntry2(docs.entry));
|
|
1704
|
+
const reconcileHeadRuntime = `const farmNavigationHeadSelector=${JSON.stringify(FARM_NAVIGATION_HEAD_SELECTOR)};const reconcileDocsHead=(nextDoc)=>{const nextTitle=nextDoc.querySelector("title");document.title=nextTitle?.textContent||"";document.head.querySelectorAll(farmNavigationHeadSelector).forEach((node)=>node.remove());nextDoc.head.querySelectorAll(farmNavigationHeadSelector).forEach((node)=>document.head.appendChild(document.importNode(node,true)))}`;
|
|
1705
|
+
return `<script>(()=>{if(window.__farmDocsRuntime)return;window.__farmDocsRuntime=true;document.documentElement.dataset.farmDocsRuntime="true";document.documentElement.dataset.farmDocsRuntimeId=Math.random().toString(36).slice(2);${reconcileHeadRuntime};const docsEntry=${docsEntry};let cleanupToc=()=>{};let closeMobileSidebar=()=>{};const normalizePath=(path)=>path.length>1?path.replace(/\\/+$/,""):path;const isDocsPath=(path)=>{const next=normalizePath(path);const entry=normalizePath(docsEntry);if(next.endsWith(".md"))return false;if(entry==="/")return true;return next===entry||next.startsWith(entry+"/")};const initToc=()=>{cleanupToc();const toc=document.getElementById("nd-toc");if(!toc){cleanupToc=()=>{};return}const links=Array.from(toc.querySelectorAll("[data-toc-item]"));const thumb=toc.querySelector("[data-toc-thumb]");const pairs=links.map((link)=>{let id=link.hash.slice(1);try{id=decodeURIComponent(id)}catch{}return{link,heading:document.getElementById(id)}}).filter((item)=>item.heading);const setActive=(active)=>{for(const {link} of pairs){const selected=link===active.link;link.dataset.active=selected?"true":"false";link.classList.toggle("fd-toc-link-active",selected)}if(!thumb)return;const styles=getComputedStyle(active.link);const top=active.link.offsetTop+parseFloat(styles.paddingTop||"0");const bottom=active.link.offsetTop+active.link.clientHeight-parseFloat(styles.paddingBottom||"0");thumb.style.clipPath="polygon(0 "+top+"px,100% "+top+"px,100% "+bottom+"px,0 "+bottom+"px)"};const update=()=>{if(pairs.length===0)return;const offset=Math.min(window.innerHeight*0.3,160);let active=pairs[0];for(const pair of pairs){if(pair.heading.getBoundingClientRect().top<=offset)active=pair;else break}setActive(active)};let frame=0;const schedule=()=>{if(frame)return;frame=requestAnimationFrame(()=>{frame=0;update()})};const onHashChange=()=>setTimeout(schedule,0);window.addEventListener("scroll",schedule,{passive:true});window.addEventListener("resize",schedule);window.addEventListener("hashchange",onHashChange);cleanupToc=()=>{window.removeEventListener("scroll",schedule);window.removeEventListener("resize",schedule);window.removeEventListener("hashchange",onHashChange);if(frame)cancelAnimationFrame(frame);frame=0};update()};const getSidebar=()=>document.getElementById("nd-sidebar");const ensureActiveVisible=()=>{const sidebar=getSidebar();if(!sidebar)return;const active=sidebar.querySelector('a[data-active="true"]');if(!(active instanceof HTMLElement))return;const activeRect=active.getBoundingClientRect();const sidebarRect=sidebar.getBoundingClientRect();if(activeRect.top<sidebarRect.top||activeRect.bottom>sidebarRect.bottom)sidebar.scrollTop+=activeRect.top-sidebarRect.top-(sidebar.clientHeight-activeRect.height)/2};const setSidebarActive=(path)=>{const sidebar=getSidebar();if(!sidebar)return;const current=normalizePath(path);for(const link of Array.from(sidebar.querySelectorAll("a[href]"))){try{link.dataset.active=normalizePath(new URL(link.href,location.href).pathname)===current?"true":"false"}catch{}}ensureActiveVisible()};const initMobileSidebar=()=>{const layout=document.getElementById("nd-docs-layout");const sidebar=getSidebar();const toggle=document.querySelector("[data-sidebar-toggle]");const backdrop=document.querySelector("[data-sidebar-backdrop]");if(!layout||!sidebar||!(toggle instanceof HTMLButtonElement))return;const setOpen=(open)=>{layout.dataset.sidebarOpen=open?"true":"false";sidebar.classList.toggle("fd-sidebar-open",open);document.documentElement.dataset.farmDocsSidebar=open?"open":"closed";toggle.setAttribute("aria-expanded",open?"true":"false");toggle.setAttribute("aria-label",open?"Close menu":"Open menu")};const toggleOpen=()=>setOpen(layout.dataset.sidebarOpen!=="true");closeMobileSidebar=()=>setOpen(false);toggle.addEventListener("click",(event)=>{event.preventDefault();toggleOpen()});backdrop?.addEventListener("click",()=>closeMobileSidebar());document.addEventListener("keydown",(event)=>{if(event.key==="Escape")closeMobileSidebar()});sidebar.addEventListener("click",(event)=>{const target=event.target instanceof Element?event.target.closest("a[href]"):null;if(target)closeMobileSidebar()});closeMobileSidebar()};const initSidebarScroll=()=>{const sidebar=getSidebar();if(!sidebar)return;const key="farmdocs:sidebar-scroll:"+location.origin;const getStorage=()=>{try{return window.sessionStorage}catch{return null}};const readSaved=()=>{try{const raw=getStorage()?.getItem(key);if(!raw)return null;const parsed=JSON.parse(raw);return parsed&&typeof parsed==="object"?parsed:null}catch{return null}};const save=(path=location.pathname)=>{try{getStorage()?.setItem(key,JSON.stringify({path,scrollTop:sidebar.scrollTop}))}catch{}};const saved=readSaved();if(saved?.path===location.pathname&&Number.isFinite(Number(saved.scrollTop)))sidebar.scrollTop=Number(saved.scrollTop);ensureActiveVisible();save();sidebar.addEventListener("scroll",()=>save(),{passive:true});sidebar.addEventListener("click",(event)=>{const target=event.target instanceof Element?event.target.closest("a[href]"):null;if(!target)return;try{save(new URL(target.href,location.href).pathname)}catch{save()}});window.addEventListener("beforeunload",()=>save())};let navigateController=null;const getPageKey=(root)=>{const article=root.getElementById("nd-page");if(!article)return"";return article.querySelector("h1")?.textContent?.trim()||article.textContent?.replace(/\\s+/g," ").trim().slice(0,160)||""};const swapDocsPage=(html,url)=>{const nextDoc=new DOMParser().parseFromString(html,"text/html");const nextArticle=nextDoc.getElementById("nd-page");const currentArticle=document.getElementById("nd-page");if(!nextArticle||!currentArticle)return false;const nextKey=getPageKey(nextDoc);const importedArticle=document.importNode(nextArticle,true);currentArticle.replaceWith(importedArticle);const renderedArticle=document.getElementById("nd-page");if(!renderedArticle||renderedArticle===currentArticle||(nextKey&&getPageKey(document)!==nextKey))return false;const nextToc=nextDoc.getElementById("nd-toc");const currentToc=document.getElementById("nd-toc");if(nextToc&¤tToc)currentToc.replaceWith(document.importNode(nextToc,true));reconcileDocsHead(nextDoc);setSidebarActive(url.pathname);initToc();closeMobileSidebar();return true};const navigateDocs=async(url,{replace=false,scroll=true}={})=>{if(!isDocsPath(url.pathname))return false;if(navigateController)navigateController.abort();const controller=new AbortController();navigateController=controller;document.documentElement.dataset.farmDocsNavigating="true";try{const response=await fetch(url.href,{cache:"no-store",headers:{accept:"text/html","x-farm-docs-navigate":"1"},signal:controller.signal});if(!response.ok||!((response.headers.get("content-type")||"").includes("text/html")))return false;const html=await response.text();if(!swapDocsPage(html,url))return false;if(replace)history.replaceState({farmDocs:true},"",url.href);else history.pushState({farmDocs:true},"",url.href);if(scroll){if(url.hash){let id=url.hash.slice(1);try{id=decodeURIComponent(id)}catch{}document.getElementById(id)?.scrollIntoView({block:"start"})}else window.scrollTo({top:0,left:0})}return true}catch(error){if(error?.name==="AbortError")return true;return false}finally{if(navigateController===controller){delete document.documentElement.dataset.farmDocsNavigating;navigateController=null}}};const initClientNavigation=()=>{document.addEventListener("click",(event)=>{if(event.defaultPrevented||event.button!==0||event.metaKey||event.ctrlKey||event.shiftKey||event.altKey)return;const target=event.target instanceof Element?event.target.closest("a[href]"):null;if(!target||target.target||target.hasAttribute("download"))return;let url;try{url=new URL(target.href,location.href)}catch{return}if(url.origin!==location.origin||!isDocsPath(url.pathname))return;if(normalizePath(url.pathname)===normalizePath(location.pathname)&&url.hash)return;event.preventDefault();navigateDocs(url).then((handled)=>{if(!handled)location.href=url.href})});window.addEventListener("popstate",()=>{navigateDocs(new URL(location.href),{replace:true,scroll:false}).then((handled)=>{if(!handled)location.reload()})})};const init=()=>{initToc();initMobileSidebar();initSidebarScroll();initClientNavigation()};if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",init,{once:true});else init()})();</script>`;
|
|
1706
|
+
}
|
|
1707
|
+
function renderDocsPageActionsRuntimeScript() {
|
|
1708
|
+
return `<script>(()=>{if(window.__farmDocsPageActionsRuntime)return;window.__farmDocsPageActionsRuntime=true;const readArticleText=()=>{const article=document.getElementById("nd-page");if(!article)return"";const clone=article.cloneNode(true);if(!(clone instanceof HTMLElement))return article.innerText||"";clone.querySelectorAll("[data-page-actions],.fd-page-footer,.fd-page-nav").forEach((node)=>node.remove());return clone.innerText||""};const withTitle=(content,format,includeTitle)=>{if(!includeTitle)return content;const title=document.querySelector("#nd-page h1")?.textContent?.trim()||document.title.trim();if(!title)return content;const trimmed=content.trimStart();if(trimmed.startsWith(title)||trimmed.startsWith("# "+title))return content;return format==="markdown"?"# "+title+"\\n\\n"+content:title+"\\n\\n"+content};const writeClipboard=async(text)=>{if(navigator.clipboard?.writeText){try{await navigator.clipboard.writeText(text);return}catch{}}const textarea=document.createElement("textarea");textarea.value=text;textarea.setAttribute("readonly","");textarea.style.position="fixed";textarea.style.opacity="0";textarea.style.pointerEvents="none";document.body.appendChild(textarea);textarea.select();document.execCommand("copy");textarea.remove()};const markCopied=(button)=>{const label=button.querySelector("[data-page-action-label]");button.dataset.copied="true";button.setAttribute("aria-label",button.dataset.copiedLabel||"Copied!");button.title=button.dataset.copiedLabel||"Copied!";if(label)label.textContent=button.dataset.copiedLabel||"Copied!";const previous=Number(button.dataset.copyTimeout||0);if(previous)clearTimeout(previous);button.dataset.copyTimeout=String(setTimeout(()=>{button.dataset.copied="false";button.setAttribute("aria-label",button.dataset.copyLabel||"Copy page");button.title=button.dataset.copyLabel||"Copy page";if(label)label.textContent=button.dataset.copyLabel||"Copy page";button.dataset.copyTimeout="0"},4500))};const markCodeCopied=(button)=>{button.dataset.copied="true";button.setAttribute("aria-label","Copied");button.title="Copied";const previous=Number(button.dataset.copyTimeout||0);if(previous)clearTimeout(previous);button.dataset.copyTimeout=String(setTimeout(()=>{button.dataset.copied="false";button.setAttribute("aria-label","Copy code");button.title="Copy code";button.dataset.copyTimeout="0"},4500))};document.addEventListener("click",async(event)=>{const source=event.target instanceof Element?event.target:null;const codeButton=source?.closest("[data-code-copy]");if(codeButton instanceof HTMLButtonElement){event.preventDefault();const code=codeButton.closest("figure")?.querySelector("code");if(!(code instanceof HTMLElement))return;const content=code.innerText||code.textContent||"";if(!content)return;await writeClipboard(content);markCodeCopied(codeButton);return}const target=source?.closest('[data-page-action="copy-markdown"]');if(!(target instanceof HTMLButtonElement))return;event.preventDefault();const format=target.dataset.copyMarkdownFormat==="text"?"text":"markdown";const includeTitle=target.dataset.copyMarkdownIncludeTitle==="true";let content="";target.disabled=true;try{if(format==="markdown"&&target.dataset.markdownUrl){try{const response=await fetch(target.dataset.markdownUrl,{headers:{Accept:"text/markdown"}});if(response.ok)content=await response.text()}catch{}}if(!content)content=readArticleText();content=withTitle(content,format,includeTitle);if(content.trim()){await writeClipboard(content);markCopied(target)}}finally{target.disabled=false}})})();</script>`;
|
|
1709
|
+
}
|
|
1710
|
+
function renderDocsHashRuntimeScript() {
|
|
1711
|
+
return `<script>(()=>{if(window.__farmDocsHashRuntime)return;window.__farmDocsHashRuntime=true;const scrollToHash=()=>{if(!location.hash)return;let id=location.hash.slice(1);try{id=decodeURIComponent(id)}catch{}document.getElementById(id)?.scrollIntoView({block:"start"})};const schedule=()=>requestAnimationFrame(()=>requestAnimationFrame(scrollToHash));if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",schedule,{once:true});else schedule();window.addEventListener("load",schedule,{once:true});window.addEventListener("hashchange",schedule)})();</script>`;
|
|
1712
|
+
}
|
|
1713
|
+
function renderDocsRuntimeScripts(docs) {
|
|
1714
|
+
return stampFarmCspNonce(`${renderDocsRuntimeScript(docs)}
|
|
1715
|
+
${renderDocsHashRuntimeScript()}
|
|
1716
|
+
${renderDocsPageActionsRuntimeScript()}`);
|
|
1717
|
+
}
|
|
1718
|
+
function renderFarmDocsFontPreloads(fontAssets) {
|
|
1719
|
+
return fontAssets.map(
|
|
1720
|
+
({ url }) => `<link rel="preload" href="${escapeAttribute(url)}" as="font" type="font/woff2" crossorigin>`
|
|
1721
|
+
).join("\n ");
|
|
1722
|
+
}
|
|
1723
|
+
function renderFarmDocsFontPreloadHeader(fontAssets) {
|
|
1724
|
+
return fontAssets.map(({ url }) => `<${url}>; rel=preload; as=font; type=font/woff2; crossorigin`).join(", ");
|
|
1725
|
+
}
|
|
1726
|
+
function getFarmLayoutFontPreloads(layoutFonts) {
|
|
1727
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1728
|
+
return [layoutFonts?.body, layoutFonts?.code].flatMap(
|
|
1729
|
+
(font) => (font?.preloads || []).filter(({ href }) => {
|
|
1730
|
+
if (seen.has(href)) return false;
|
|
1731
|
+
seen.add(href);
|
|
1732
|
+
return true;
|
|
1733
|
+
})
|
|
1734
|
+
);
|
|
1735
|
+
}
|
|
1736
|
+
function renderFarmLayoutFontPreloadHeader(layoutFonts) {
|
|
1737
|
+
return getFarmLayoutFontPreloads(layoutFonts).map(({ href, type }) => `<${href}>; rel=preload; as=font; type=${type}; crossorigin`).join(", ");
|
|
1738
|
+
}
|
|
1739
|
+
function renderPixelDocsHtml(page, pages, docs, clientEntry, faviconHref, requestUrl, fontAssets, fontStylesheetHref, globalStylesheetHref) {
|
|
1740
|
+
const navTitle = typeof docs.config.nav === "object" && docs.config.nav && "title" in docs.config.nav ? String(docs.config.nav.title || "Docs") : "Docs";
|
|
1741
|
+
const description = page.description || docs.config.metadata?.description || "";
|
|
1742
|
+
const renderedMarkdown = renderMarkdownDocument(page.body, getThemeTocDepth(docs));
|
|
1743
|
+
const tocItems = renderedMarkdown.tocItems;
|
|
1744
|
+
const themeName = getThemeName(docs);
|
|
1745
|
+
const searchEnabled = isFarmDocsSearchEnabled(docs);
|
|
1746
|
+
const socialMetadata = isFarmDocsSocialImageEnabled(page, docs) ? renderFarmDocsSocialMetadata(
|
|
1747
|
+
createFarmDocsSocialImageDescriptor(page, docs, requestUrl),
|
|
1748
|
+
getFarmDocsCustomSocialImage(page)
|
|
1749
|
+
) : "";
|
|
1750
|
+
return `<!DOCTYPE html>
|
|
1751
|
+
<html class="dark" lang="en" data-docs-theme="${escapeAttribute(themeName)}">
|
|
1752
|
+
<head>
|
|
1753
|
+
<meta charset="utf-8">
|
|
1754
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
1755
|
+
<meta name="generator" content="@farming-labs/docs via Farm.js">
|
|
1756
|
+
<title>${escapeHtml(page.title)}</title>
|
|
1757
|
+
${renderFarmDocsFaviconLink(faviconHref)}
|
|
1758
|
+
${renderFarmDocsFontPreloads(fontAssets)}
|
|
1759
|
+
${fontStylesheetHref ? `<link rel="stylesheet" href="${escapeAttribute(fontStylesheetHref)}">` : ""}
|
|
1760
|
+
${globalStylesheetHref ? `<link rel="stylesheet" href="${escapeAttribute(globalStylesheetHref)}">` : ""}
|
|
1761
|
+
${description ? `<meta name="description" content="${escapeHtml(description)}">` : ""}
|
|
1762
|
+
${socialMetadata}
|
|
1763
|
+
${searchEnabled ? renderDocsSearchBootstrapScript() : ""}
|
|
1764
|
+
</head>
|
|
1765
|
+
<body>
|
|
1766
|
+
<div id="nd-docs-layout" class="fd-layout" data-fd-framework="farmjs">
|
|
1767
|
+
<header class="mobile-topbar fd-header" aria-label="Mobile docs navigation">
|
|
1768
|
+
<button class="fd-mobile-nav-btn fd-menu-btn" type="button" data-sidebar-toggle aria-controls="nd-sidebar" aria-expanded="false" aria-label="Open menu">
|
|
1769
|
+
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg>
|
|
1770
|
+
</button>
|
|
1771
|
+
<a class="fd-header-title" href="/">${escapeHtml(navTitle)}</a>
|
|
1772
|
+
<div class="mobile-topbar-actions">
|
|
1773
|
+
${searchEnabled ? renderDocsSearchTrigger(true, "fd-search-trigger-mobile") : ""}
|
|
1774
|
+
<a class="mobile-topbar-link" href="/llms.txt">llms.txt</a>
|
|
1775
|
+
</div>
|
|
1776
|
+
</header>
|
|
1777
|
+
<aside id="nd-sidebar" class="fd-sidebar">
|
|
1778
|
+
<div class="sidebar-brand fd-sidebar-header">
|
|
1779
|
+
<a class="fd-sidebar-title" href="/">${renderFarmDocsBrandMark()}${renderFarmDocsBrandTitle(navTitle)}</a>
|
|
1780
|
+
<span>/ docs</span>
|
|
1781
|
+
</div>
|
|
1782
|
+
${searchEnabled ? `<div class="fd-sidebar-search">${renderDocsSearchTrigger(true, "fd-sidebar-search-btn")}</div>` : ""}
|
|
1783
|
+
${renderPixelNavItems(pages, page.href, docs)}
|
|
1784
|
+
</aside>
|
|
1785
|
+
<div class="sidebar-backdrop fd-sidebar-overlay" data-sidebar-backdrop></div>
|
|
1786
|
+
<main class="fd-main">
|
|
1787
|
+
<div class="fd-page">
|
|
1788
|
+
<article id="nd-page" class="prose fd-page-article fd-page-body fd-docs-content">
|
|
1789
|
+
${renderPixelBreadcrumb(page, docs)}
|
|
1790
|
+
${renderMarkdownHtmlWithTitleMeta(page, docs, renderedMarkdown.html)}
|
|
1791
|
+
${renderPixelPageFooter(page, docs)}
|
|
1792
|
+
${renderPixelPageNav(pages, page.href, docs)}
|
|
1793
|
+
</article>
|
|
1794
|
+
<nav id="nd-toc" class="fd-toc sticky top-(--fd-docs-row-1) h-[calc(var(--fd-docs-height)-var(--fd-docs-row-1))] flex flex-col [grid-area:toc] w-(--fd-toc-width) pt-12 pe-4 pb-2 max-xl:hidden" data-toc aria-labelledby="toc-title">
|
|
1795
|
+
<div class="fd-toc-inner">
|
|
1796
|
+
<h3 id="toc-title" class="fd-toc-title inline-flex items-center gap-1.5 text-sm text-fd-muted-foreground"><svg class="size-4" viewBox="0 0 24 24" aria-hidden="true" focusable="false" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 7h16"></path><path d="M4 12h16"></path><path d="M4 17h16"></path></svg>On this page</h3>
|
|
1797
|
+
<div class="toc-scroll">
|
|
1798
|
+
${renderPixelToc(tocItems)}
|
|
1799
|
+
</div>
|
|
1800
|
+
</div>
|
|
1801
|
+
</nav>
|
|
1802
|
+
</div>
|
|
1803
|
+
</main>
|
|
1804
|
+
</div>
|
|
1805
|
+
${searchEnabled ? renderDocsSearchMount(clientEntry) : ""}
|
|
1806
|
+
${renderDocsRuntimeScripts(docs)}
|
|
1807
|
+
</body>
|
|
1808
|
+
</html>`;
|
|
1809
|
+
}
|
|
1810
|
+
function createFarmDocsHandler(docs, options) {
|
|
1811
|
+
const faviconHref = resolveFarmDocsFavicon(docs, options);
|
|
1812
|
+
const fontAssets = options.fontAssets ?? toFarmDocsPublicFontAssets(resolveFarmDocsFontAssets(options.root));
|
|
1813
|
+
const fallbackFontPreloadHeader = renderFarmDocsFontPreloadHeader(fontAssets);
|
|
1814
|
+
return async function handleFarmDocsRequest(request) {
|
|
1815
|
+
if (!docs?.enabled || request.method !== "GET" && request.method !== "HEAD") return null;
|
|
1816
|
+
await loadFarmDocsEngine();
|
|
1817
|
+
const contentDir = resolveFarmDocsContentDir(docs, options);
|
|
1818
|
+
const requestUrl = new URL(request.url);
|
|
1819
|
+
const socialImageSlug = getFarmDocsSocialImageSlug(docs, requestUrl);
|
|
1820
|
+
if (socialImageSlug !== null) {
|
|
1821
|
+
const socialImagePage = loadFarmDocsPage(contentDir, docs, socialImageSlug);
|
|
1822
|
+
if (!socialImagePage || // The image sits outside the page's URL, where its guard does not reach, and
|
|
1823
|
+
// draws the page's title.
|
|
1824
|
+
options.isPathGuarded?.(socialImagePage.href) || !isFarmDocsSocialImageEnabled(socialImagePage, docs) || getFarmDocsCustomSocialImage(socialImagePage)) {
|
|
1825
|
+
return null;
|
|
1826
|
+
}
|
|
1827
|
+
const descriptor = createFarmDocsSocialImageDescriptor(socialImagePage, docs, requestUrl);
|
|
1828
|
+
if (requestUrl.pathname !== descriptor.imagePath) return null;
|
|
1829
|
+
const etag = `"${descriptor.hash}"`;
|
|
1830
|
+
const immutable = requestUrl.searchParams.get("v") === descriptor.hash;
|
|
1831
|
+
const headers = new Headers({
|
|
1832
|
+
"Content-Type": "image/svg+xml; charset=utf-8",
|
|
1833
|
+
"Cache-Control": immutable ? "public, max-age=31536000, immutable" : "public, max-age=0, must-revalidate",
|
|
1834
|
+
ETag: etag,
|
|
1835
|
+
"X-Content-Type-Options": "nosniff"
|
|
1836
|
+
});
|
|
1837
|
+
if (matchesFarmIfNoneMatch(request.headers.get("if-none-match"), etag)) {
|
|
1838
|
+
return new Response(null, { status: 304, headers });
|
|
1839
|
+
}
|
|
1840
|
+
if (request.method === "HEAD") return new Response(null, { status: 200, headers });
|
|
1841
|
+
return new Response(renderFarmDocsSocialImageSvg(descriptor), { status: 200, headers });
|
|
1842
|
+
}
|
|
1843
|
+
const publicResponse = createFarmDocsPublicResponse(
|
|
1844
|
+
contentDir,
|
|
1845
|
+
docs,
|
|
1846
|
+
request,
|
|
1847
|
+
options.isPathGuarded
|
|
1848
|
+
);
|
|
1849
|
+
if (publicResponse) return omitFarmDocsHeadBody(request, publicResponse);
|
|
1850
|
+
if (!isFarmDocsRequest(docs, request)) return null;
|
|
1851
|
+
const page = loadPage(contentDir, docs, request);
|
|
1852
|
+
if (!page) return null;
|
|
1853
|
+
const negotiatesAccept = !requestUrl.pathname.endsWith(".md");
|
|
1854
|
+
if (!negotiatesAccept && options.isPathGuarded?.(page.href) && !options.isPathGuarded(getFarmDocsMarkdownPath(page.href))) {
|
|
1855
|
+
return null;
|
|
1856
|
+
}
|
|
1857
|
+
if (shouldReturnMarkdown(request)) {
|
|
1858
|
+
const origin = new URL(request.url).origin;
|
|
1859
|
+
return omitFarmDocsHeadBody(
|
|
1860
|
+
request,
|
|
1861
|
+
new Response(
|
|
1862
|
+
docsEngine().renderDocsMarkdownDocument(toFarmDocsMarkdownPage(page), {
|
|
1863
|
+
origin,
|
|
1864
|
+
llms: docs.config.llmsTxt ?? true,
|
|
1865
|
+
sitemap: docs.config.sitemap
|
|
1866
|
+
}),
|
|
1867
|
+
{
|
|
1868
|
+
status: 200,
|
|
1869
|
+
headers: {
|
|
1870
|
+
"Content-Type": "text/markdown; charset=utf-8",
|
|
1871
|
+
"Cache-Control": "public, max-age=60",
|
|
1872
|
+
...negotiatesAccept ? { Vary: "Accept" } : {}
|
|
1873
|
+
}
|
|
1874
|
+
}
|
|
1875
|
+
)
|
|
1876
|
+
);
|
|
1877
|
+
}
|
|
1878
|
+
const pathname = new URL(request.url).pathname;
|
|
1879
|
+
const layoutFonts = await options.resolveLayoutFonts?.(pathname);
|
|
1880
|
+
const usesLayoutFonts = Boolean(layoutFonts?.body || layoutFonts?.code);
|
|
1881
|
+
const activeFontAssets = usesLayoutFonts ? [] : fontAssets;
|
|
1882
|
+
const fontPreloadHeader = usesLayoutFonts ? renderFarmLayoutFontPreloadHeader(layoutFonts) : fallbackFontPreloadHeader;
|
|
1883
|
+
return omitFarmDocsHeadBody(
|
|
1884
|
+
request,
|
|
1885
|
+
new Response(
|
|
1886
|
+
renderPixelDocsHtml(
|
|
1887
|
+
page,
|
|
1888
|
+
discoverFarmDocsPages(contentDir, docs),
|
|
1889
|
+
docs,
|
|
1890
|
+
options.clientEntry || "/farm-client.js",
|
|
1891
|
+
faviconHref,
|
|
1892
|
+
requestUrl,
|
|
1893
|
+
activeFontAssets,
|
|
1894
|
+
usesLayoutFonts ? options.fontStylesheetHref : void 0,
|
|
1895
|
+
options.globalStylesheetHref
|
|
1896
|
+
),
|
|
1897
|
+
{
|
|
1898
|
+
status: 200,
|
|
1899
|
+
headers: {
|
|
1900
|
+
"Content-Type": "text/html; charset=utf-8",
|
|
1901
|
+
"Cache-Control": "public, s-maxage=60, stale-while-revalidate=300",
|
|
1902
|
+
Vary: "Accept",
|
|
1903
|
+
...fontPreloadHeader ? { Link: fontPreloadHeader } : {}
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
1906
|
+
)
|
|
1907
|
+
);
|
|
1908
|
+
};
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1911
|
+
export {
|
|
1912
|
+
FARM_DOCS_LAST_MODIFIED_MANIFEST,
|
|
1913
|
+
createFarmDocsLastModifiedManifest,
|
|
1914
|
+
isFarmDocsRequest,
|
|
1915
|
+
resolveFarmDocsContentDir,
|
|
1916
|
+
getFarmDocsRouteTypeEntries,
|
|
1917
|
+
getFarmDocsDocumentNavigationMatchers,
|
|
1918
|
+
loadFarmDocsPage,
|
|
1919
|
+
getFarmDocsMarkdownPath,
|
|
1920
|
+
discoverFarmDocsPages,
|
|
1921
|
+
toFarmDocsMarkdownPage,
|
|
1922
|
+
createFarmDocsHandler
|
|
1923
|
+
};
|