@farm.js/core 0.1.16 → 0.1.18
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 +12 -225
- package/dist/agent-runtime.cjs +83 -2800
- package/dist/agent-runtime.d.mts +3 -3
- package/dist/agent-runtime.d.ts +3 -3
- package/dist/api/client.cjs +17 -4026
- package/dist/api/client.d.mts +3 -3
- package/dist/api/client.d.ts +3 -3
- package/dist/api/client.mjs +3 -3
- package/dist/api/route-manager.cjs +34 -4317
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/route-manager.mjs +5 -5
- package/dist/api/runtime.cjs +29 -2660
- package/dist/api/runtime.d.mts +3 -3
- package/dist/api/runtime.d.ts +3 -3
- package/dist/api/runtime.mjs +6 -3
- package/dist/{api-client-B-n3pm_Q.d.mts → api-client-Cx54IR5g.d.mts} +2 -2
- package/dist/{api-client-C0_NZEBl.d.ts → api-client-DykpaKcY.d.ts} +2 -2
- package/dist/api.cjs +88 -8361
- package/dist/api.d.mts +5 -5
- package/dist/api.d.ts +5 -5
- package/dist/api.mjs +8 -8
- package/dist/{app-AyjEsCBq.d.ts → app-BHY_10Lm.d.ts} +3 -3
- package/dist/{app-CYPHeOo_.d.mts → app-BMk0do23.d.mts} +3 -3
- package/dist/app-markdown.cjs +39 -280
- package/dist/app-markdown.d.mts +4 -4
- package/dist/app-markdown.d.ts +4 -4
- package/dist/app-markdown.mjs +3 -3
- package/dist/cache.cjs +38 -1526
- package/dist/cache.d.mts +11 -1
- package/dist/cache.d.ts +11 -1
- package/dist/cache.mjs +1 -1
- package/dist/chunk-22GUSVNJ.cjs +351 -0
- package/dist/chunk-2CQ74SP6.cjs +13 -0
- package/dist/chunk-2SJ4RQ6P.cjs +57 -0
- package/dist/chunk-3376ZTRC.cjs +1 -0
- package/dist/{chunk-IL5RWYK7.mjs → chunk-3XG26Z3J.mjs} +1 -1
- package/dist/{chunk-7HDZYYS4.mjs → chunk-4OOBRCJX.mjs} +27 -5
- package/dist/chunk-4PNUXIVU.cjs +472 -0
- package/dist/chunk-4PPEPOZZ.cjs +21 -0
- package/dist/chunk-4ZFL5GFN.cjs +520 -0
- package/dist/{chunk-B76DT5Y6.mjs → chunk-57J3Y7Y3.mjs} +1 -1
- package/dist/chunk-5OVTOKGH.cjs +65 -0
- package/dist/chunk-5QIKR7RR.cjs +224 -0
- package/dist/{chunk-MOQNHLTS.mjs → chunk-5QOEPUYE.mjs} +5 -2
- package/dist/{chunk-HKLRP3BN.mjs → chunk-5SPPCN5J.mjs} +1 -1
- package/dist/chunk-5ZSWG4UX.cjs +127 -0
- package/dist/chunk-62YJ2IEB.cjs +238 -0
- package/dist/chunk-6EODJYCX.cjs +183 -0
- package/dist/chunk-6EXBPJ24.cjs +434 -0
- package/dist/chunk-6QQDAAAZ.cjs +38 -0
- package/dist/chunk-6V4TDWEC.cjs +455 -0
- package/dist/{chunk-LUC2FAGW.mjs → chunk-6VQIKZZO.mjs} +1 -1
- package/dist/chunk-72ADZ6GQ.cjs +19 -0
- package/dist/chunk-75BRBIFP.cjs +172 -0
- package/dist/{chunk-7ZWL7XOU.mjs → chunk-76DG3LF3.mjs} +1 -1
- package/dist/chunk-7W3CPVXS.cjs +24 -0
- package/dist/chunk-A6WIQH5Z.cjs +31 -0
- package/dist/{chunk-EWDK36MM.mjs → chunk-A72YEUZ3.mjs} +1 -1
- package/dist/chunk-AFOD3LYZ.cjs +377 -0
- package/dist/chunk-AMDMVWMI.cjs +39 -0
- package/dist/chunk-AORPIPNB.cjs +552 -0
- package/dist/chunk-ARJWXNQL.cjs +256 -0
- package/dist/{chunk-ZHOIQC6U.mjs → chunk-ATERBVHQ.mjs} +2 -2
- package/dist/chunk-AWRISO2H.cjs +2199 -0
- package/dist/chunk-AYJR42WX.cjs +711 -0
- package/dist/chunk-B4CH33IG.cjs +644 -0
- package/dist/chunk-BIDYX3SL.cjs +91 -0
- package/dist/chunk-BSTRERPP.cjs +40 -0
- package/dist/chunk-BYODCJD6.cjs +663 -0
- package/dist/chunk-C3VRMB6H.cjs +85 -0
- package/dist/chunk-C5GUTBZK.cjs +173 -0
- package/dist/chunk-CIAGU2X4.cjs +337 -0
- package/dist/chunk-CMGMGHUZ.cjs +27 -0
- package/dist/chunk-CXP5U3RW.cjs +54 -0
- package/dist/chunk-D2ULAULS.cjs +166 -0
- package/dist/chunk-D7JTOLFK.cjs +285 -0
- package/dist/chunk-DVM4FKZL.cjs +169 -0
- package/dist/chunk-DYEJQTDN.cjs +49 -0
- package/dist/chunk-E2BMSZ2W.cjs +151 -0
- package/dist/chunk-E3UK5IIB.cjs +593 -0
- package/dist/chunk-EM6SBQKM.cjs +470 -0
- package/dist/{chunk-27JNCYEK.mjs → chunk-EN7WTEAY.mjs} +2 -2
- package/dist/{chunk-IGO2HEV7.mjs → chunk-F6SJAKFJ.mjs} +62 -28
- package/dist/{chunk-GSDIZACQ.mjs → chunk-FG5H2VCJ.mjs} +2 -2
- package/dist/chunk-FJSWYIR7.cjs +482 -0
- package/dist/chunk-FK6GO24V.cjs +54 -0
- package/dist/chunk-FXUUWYAX.cjs +654 -0
- package/dist/chunk-G3HRIVEY.cjs +395 -0
- package/dist/chunk-G643DQCH.cjs +13 -0
- package/dist/chunk-G7HXGLEC.cjs +175 -0
- package/dist/chunk-GDSHDTJ4.cjs +152 -0
- package/dist/chunk-GNEO2XOF.cjs +2040 -0
- package/dist/{chunk-NHHKW2T6.mjs → chunk-GYKJCFTS.mjs} +170 -52
- package/dist/chunk-H6G5INWM.cjs +1094 -0
- package/dist/chunk-HBTUGXHS.cjs +180 -0
- package/dist/chunk-HREOKQWT.cjs +45 -0
- package/dist/chunk-I4J452B7.cjs +435 -0
- package/dist/chunk-I57LW5VZ.cjs +94 -0
- package/dist/chunk-I7PUUDGY.cjs +389 -0
- package/dist/chunk-IAMRBF3Z.cjs +86 -0
- package/dist/chunk-IKNRN4VS.cjs +14214 -0
- package/dist/chunk-IQXFRNY2.cjs +169 -0
- package/dist/chunk-IXTFU4PL.cjs +2355 -0
- package/dist/chunk-J2OP5GG3.cjs +725 -0
- package/dist/chunk-J3LOGE4T.cjs +42 -0
- package/dist/chunk-J7FSKED3.cjs +93 -0
- package/dist/chunk-JDNHKPTD.cjs +22 -0
- package/dist/chunk-JSROZYYO.cjs +164 -0
- package/dist/chunk-K6FNHVDR.cjs +696 -0
- package/dist/chunk-KGZIORNL.cjs +43 -0
- package/dist/{chunk-LZK5CXDW.mjs → chunk-KLSSO6YD.mjs} +2 -2
- package/dist/{chunk-TYVVIQ5M.mjs → chunk-KPNVGRBL.mjs} +32 -25
- package/dist/chunk-KR6CKSXT.cjs +15 -0
- package/dist/chunk-KROWKCUH.cjs +185 -0
- package/dist/chunk-KVFPGF2M.cjs +46 -0
- package/dist/{chunk-KUO3GBPK.mjs → chunk-L6V3P73N.mjs} +1 -1
- package/dist/chunk-LCCBO7PJ.cjs +46 -0
- package/dist/chunk-LIUGYUX3.cjs +22 -0
- package/dist/chunk-LTNGXMQ6.cjs +55 -0
- package/dist/chunk-M2L4MYDQ.cjs +14 -0
- package/dist/chunk-MCJLA63J.cjs +1 -0
- package/dist/chunk-MKB2EGIR.cjs +148 -0
- package/dist/chunk-MQ3H6LT5.cjs +202 -0
- package/dist/chunk-MT763TDW.cjs +43 -0
- package/dist/chunk-MWSK6C4J.cjs +18 -0
- package/dist/chunk-MWWVKDW3.cjs +169 -0
- package/dist/{chunk-KTGFMHET.mjs → chunk-N6UROPT7.mjs} +1 -1
- package/dist/chunk-NO3WWW3N.cjs +192 -0
- package/dist/{chunk-NDD2YVGU.mjs → chunk-NRVGEI5I.mjs} +10 -3
- package/dist/chunk-NV3A5DXM.cjs +862 -0
- package/dist/chunk-NWOD6NIT.cjs +9 -0
- package/dist/chunk-NZKJGRB3.cjs +230 -0
- package/dist/chunk-OAVTUMJP.cjs +1496 -0
- package/dist/chunk-OHY2ZWUG.cjs +25 -0
- package/dist/chunk-OI6CMLWX.cjs +47 -0
- package/dist/chunk-OIEOCXKG.cjs +453 -0
- package/dist/chunk-OWOUTKIJ.cjs +558 -0
- package/dist/chunk-OX6O6WVA.cjs +74 -0
- package/dist/chunk-OXSIH4D6.cjs +476 -0
- package/dist/chunk-OYEUREB6.cjs +35 -0
- package/dist/chunk-PCOTGFSM.cjs +139 -0
- package/dist/chunk-PZYCPSCC.cjs +35 -0
- package/dist/chunk-QBK2AA4U.cjs +445 -0
- package/dist/chunk-QBPXNZGV.cjs +487 -0
- package/dist/{chunk-IXTEENRS.mjs → chunk-QGVJVSNX.mjs} +5 -5
- package/dist/chunk-QNPEUFHQ.cjs +27 -0
- package/dist/chunk-QZRVZSPN.cjs +236 -0
- package/dist/chunk-R5A5KNVX.cjs +20 -0
- package/dist/chunk-R5JIFR6B.cjs +42 -0
- package/dist/chunk-R6AIILII.cjs +193 -0
- package/dist/chunk-RG3ZOTG5.cjs +34 -0
- package/dist/chunk-ROUTX2E5.cjs +390 -0
- package/dist/chunk-RTHIVJ2G.cjs +54 -0
- package/dist/chunk-S3A45T7F.cjs +166 -0
- package/dist/chunk-S3JO3N4H.cjs +17 -0
- package/dist/chunk-SK35NQKK.cjs +27 -0
- package/dist/chunk-SU7MH53P.cjs +180 -0
- package/dist/chunk-SVRTJOUF.cjs +113 -0
- package/dist/chunk-SWN467MP.cjs +18 -0
- package/dist/{chunk-6SCB2MXB.mjs → chunk-SXHV42UQ.mjs} +16 -1
- package/dist/{chunk-OWTIOHON.mjs → chunk-SYGGPS4A.mjs} +2 -2
- package/dist/chunk-SYQ3MOWW.cjs +73 -0
- package/dist/chunk-T5CERMEH.cjs +417 -0
- package/dist/chunk-TFAXUHWX.cjs +206 -0
- package/dist/chunk-TIWHTW3Q.cjs +24 -0
- package/dist/chunk-TKJZFIML.cjs +20 -0
- package/dist/chunk-TKNSDBBN.cjs +193 -0
- package/dist/{chunk-NC333MFA.mjs → chunk-TSWW5BVH.mjs} +7 -4
- package/dist/chunk-TWGMSEHX.cjs +525 -0
- package/dist/chunk-TYQUSXUG.cjs +1357 -0
- package/dist/chunk-U4KT7QP3.cjs +23 -0
- package/dist/{chunk-LK6FGAQR.mjs → chunk-UDBJCUPA.mjs} +7 -4
- package/dist/chunk-UJ2C4ICS.cjs +277 -0
- package/dist/chunk-UN5GHC5V.cjs +10244 -0
- package/dist/chunk-UQZ4AYTH.cjs +168 -0
- package/dist/chunk-US2QVW3E.cjs +36 -0
- package/dist/{chunk-NUD6XBMO.mjs → chunk-UTBVHYS3.mjs} +2 -2
- package/dist/{chunk-76MNRHTS.mjs → chunk-UUYF3CHN.mjs} +2 -2
- package/dist/chunk-VB6UCX3V.cjs +421 -0
- package/dist/chunk-VEKFLAQM.cjs +300 -0
- package/dist/chunk-VQDBNVOO.cjs +14 -0
- package/dist/chunk-W4E7WMXE.cjs +71 -0
- package/dist/{chunk-VVTREAG5.mjs → chunk-WD4YXVLV.mjs} +11 -3
- package/dist/{chunk-UQZPTIML.mjs → chunk-WD5PNSOB.mjs} +2 -2
- package/dist/chunk-WJ3HK3LJ.cjs +1102 -0
- package/dist/chunk-WMAPPDMM.cjs +28 -0
- package/dist/chunk-WMOGFOUJ.cjs +223 -0
- package/dist/chunk-WPYFSQKK.cjs +37 -0
- package/dist/chunk-WZMNW2IW.cjs +1415 -0
- package/dist/chunk-XGC343EY.cjs +443 -0
- package/dist/{chunk-DPZUDPVJ.mjs → chunk-XP777LRD.mjs} +1 -1
- package/dist/chunk-XSKZORAS.cjs +727 -0
- package/dist/chunk-XWAWFQFS.cjs +82 -0
- package/dist/{chunk-KATQ6I56.mjs → chunk-XWAYMDLB.mjs} +1 -1
- package/dist/chunk-Y4YMF2NQ.cjs +460 -0
- package/dist/chunk-Y4YWHNKU.cjs +250 -0
- package/dist/chunk-Y53ZSFN6.cjs +504 -0
- package/dist/chunk-YA6LLTIJ.cjs +411 -0
- package/dist/chunk-YFPGHF5F.cjs +202 -0
- package/dist/chunk-YJRZR7VU.cjs +28 -0
- package/dist/chunk-YTAABQEV.cjs +1 -0
- package/dist/chunk-YX3DBN4M.cjs +18 -0
- package/dist/chunk-YZTASLPQ.cjs +64 -0
- package/dist/chunk-Z5HIWVDP.cjs +2173 -0
- package/dist/{chunk-Q3MDL7TM.mjs → chunk-ZCNJKLA2.mjs} +30 -11
- package/dist/chunk-ZEG3OPIB.cjs +93 -0
- package/dist/chunk-ZMN3H73H.cjs +155 -0
- package/dist/client/lifecycle.cjs +6 -35
- package/dist/{client-plugins-CqVtZi5X.d.ts → client-plugins-C089bQhN.d.ts} +2 -2
- package/dist/{client-plugins-CIPRtSsW.d.mts → client-plugins-JXXmZliS.d.mts} +2 -2
- package/dist/client-plugins.cjs +7 -448
- package/dist/client-plugins.d.mts +3 -3
- package/dist/client-plugins.d.ts +3 -3
- package/dist/client.cjs +171 -9774
- package/dist/client.d.mts +8 -8
- package/dist/client.d.ts +8 -8
- package/dist/client.mjs +6 -6
- package/dist/config.cjs +8 -36
- package/dist/config.d.mts +3 -3
- package/dist/config.d.ts +3 -3
- package/dist/cron.cjs +24 -491
- package/dist/cron.mjs +2 -2
- package/dist/deferred.cjs +26 -475
- package/dist/deployment.cjs +39 -210
- package/dist/devtools-OUIPHVV6.cjs +388 -0
- package/dist/{devtools-IU7LKZOH.mjs → devtools-UFVTMQX5.mjs} +7 -7
- package/dist/devtools-client-4WAPJY5L.cjs +254 -0
- package/dist/devtools-ui-5GBDIGMK.cjs +1296 -0
- package/dist/docs.cjs +46 -5649
- package/dist/docs.mjs +9 -9
- package/dist/{endpoint-kSAxE52R.d.ts → endpoint-1zA994xL.d.ts} +1 -1
- package/dist/{endpoint-Bu3XgeMK.d.mts → endpoint-DAc96i93.d.mts} +1 -1
- package/dist/env-types.cjs +5 -226
- package/dist/env.cjs +23 -306
- package/dist/env.d.mts +5 -3
- package/dist/env.d.ts +5 -3
- package/dist/env.mjs +2 -1
- package/dist/environment/vite.cjs +8 -372
- package/dist/environment.cjs +12 -94
- package/dist/font.cjs +13 -63
- package/dist/headers.cjs +7 -123
- package/dist/i18n/client.cjs +55 -294
- package/dist/i18n/index.cjs +22 -209
- package/dist/i18n/server.cjs +22 -745
- package/dist/image/server.cjs +13 -729
- package/dist/image/sharp.cjs +33 -171
- package/dist/image.cjs +41 -85
- package/dist/index.cjs +1151 -67862
- package/dist/index.d.mts +14 -14
- package/dist/index.d.ts +14 -14
- package/dist/index.mjs +34 -34
- package/dist/instrumentation.cjs +12 -138
- package/dist/integration-orm-55F7CII5.cjs +13 -0
- package/dist/integrations.cjs +55 -4090
- package/dist/integrations.d.mts +3 -3
- package/dist/integrations.d.ts +3 -3
- package/dist/internal/app-markdown-runtime.cjs +27 -224
- package/dist/internal/app-markdown-runtime.d.mts +3 -3
- package/dist/internal/app-markdown-runtime.d.ts +3 -3
- package/dist/internal/app-markdown-runtime.mjs +2 -2
- package/dist/internal/build-runtime.cjs +120 -52038
- package/dist/internal/build-runtime.d.mts +5 -5
- package/dist/internal/build-runtime.d.ts +5 -5
- package/dist/internal/build-runtime.mjs +23 -23
- package/dist/internal/cli-runtime.cjs +67 -13765
- package/dist/internal/cli-runtime.mjs +13 -13
- package/dist/internal/client-error-overlay.cjs +80 -733
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +81 -913
- package/dist/internal/compression-runtime.cjs +8 -214
- package/dist/internal/compression-runtime.d.mts +3 -3
- package/dist/internal/compression-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.cjs +42 -6535
- package/dist/internal/config-runtime.d.mts +4 -4
- package/dist/internal/config-runtime.d.ts +4 -4
- package/dist/internal/config-runtime.mjs +7 -7
- package/dist/internal/docs-precompiled-runtime.cjs +26 -46
- package/dist/internal/infra-analytics-runtime.cjs +10 -536
- package/dist/internal/isolated-boundary.cjs +14 -414
- package/dist/internal/metadata-image-runtime.cjs +7 -285
- package/dist/internal/product-telemetry-runtime.cjs +42 -97
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-node-env.cjs +6 -63
- package/dist/internal/production-runtime.cjs +418 -7073
- package/dist/internal/production-runtime.d.mts +9 -9
- package/dist/internal/production-runtime.d.ts +9 -9
- package/dist/internal/production-runtime.mjs +6 -6
- package/dist/internal/request-cookies.cjs +6 -54
- package/dist/json-ld.cjs +24 -50
- package/dist/layers-E4WPJNY5.cjs +17 -0
- package/dist/manager-G4B2IPYE.cjs +14 -0
- package/dist/markdown.cjs +21 -532
- package/dist/markdown.mjs +1 -1
- package/dist/{metadata-8g__AMPM.d.ts → metadata-BcNJP4fq.d.ts} +1 -1
- package/dist/{metadata-OMX6wFNf.d.mts → metadata-C1Z9vLbb.d.mts} +1 -1
- package/dist/middleware.cjs +36 -2988
- package/dist/middleware.d.mts +5 -5
- package/dist/middleware.d.ts +5 -5
- package/dist/middleware.mjs +4 -4
- package/dist/navigation.cjs +22 -2588
- package/dist/nitro-4I2MYLY2.cjs +652 -0
- package/dist/{nitro-3N4ZXRYM.mjs → nitro-CVZ36JM5.mjs} +4 -4
- package/dist/observability.cjs +22 -614
- package/dist/og.cjs +5 -28
- package/dist/plugin.cjs +106 -37291
- package/dist/plugin.d.mts +3 -3
- package/dist/plugin.d.ts +3 -3
- package/dist/plugin.mjs +19 -19
- package/dist/{production-runtime-W3M0eNDV.d.mts → production-runtime-jcrTlRTb.d.mts} +1 -1
- package/dist/{production-runtime-BJh7o6Cr.d.ts → production-runtime-oKmC0WU-.d.ts} +1 -1
- package/dist/query/client.cjs +113 -449
- package/dist/query/index.cjs +26 -288
- package/dist/query/parsers.cjs +23 -247
- package/dist/query/server.cjs +36 -298
- package/dist/{render-plan-io7pvDNc.d.mts → render-plan-BLIfc4jt.d.mts} +1 -1
- package/dist/{render-plan-Be4ZGTJP.d.ts → render-plan-DOB9cV-h.d.ts} +1 -1
- package/dist/renderer/react/client.cjs +9 -43
- package/dist/renderer/react/server.cjs +40 -103
- package/dist/renderer/react/vite.cjs +7 -29
- package/dist/renderer-client.cjs +126 -4261
- package/dist/renderer-client.d.mts +5 -5
- package/dist/renderer-client.d.ts +5 -5
- package/dist/renderer-client.mjs +3 -3
- package/dist/renderer.cjs +31 -249
- package/dist/{request-DZkHYQ89.d.mts → request-Cr53NRHr.d.mts} +1 -1
- package/dist/{request-G8JhKr4F.d.ts → request-Dt2gNuQD.d.ts} +1 -1
- package/dist/request.cjs +5 -68
- package/dist/request.d.mts +4 -4
- package/dist/request.d.ts +4 -4
- package/dist/{route-C_eLaFTZ.d.mts → route-B0XrsrFk.d.mts} +1 -1
- package/dist/{route-BxNJT447.d.ts → route-DOEpbyWZ.d.ts} +1 -1
- package/dist/{route-rendering-BcLLPJgN.d.ts → route-rendering-CWYd8Mv1.d.ts} +1 -1
- package/dist/{route-rendering-CbAKr1TY.d.mts → route-rendering-CeFBEAoZ.d.mts} +1 -1
- package/dist/router.cjs +11 -474
- package/dist/routes.cjs +42 -2424
- package/dist/routes.d.mts +4 -4
- package/dist/routes.d.ts +4 -4
- package/dist/routes.mjs +2 -2
- package/dist/schema-dev-notice-MXSZMVDG.cjs +56 -0
- package/dist/schema.cjs +6 -33
- package/dist/search-client-G3RICOFU.cjs +13 -0
- package/dist/server-action-security.cjs +25 -541
- package/dist/server-fn-client.cjs +6 -337
- package/dist/server-fn-client.d.mts +3 -3
- package/dist/server-fn-client.d.ts +3 -3
- package/dist/server-fn.cjs +32 -1799
- package/dist/server-fn.d.mts +1 -1
- package/dist/server-fn.d.ts +1 -1
- package/dist/server-fn.mjs +2 -2
- package/dist/server-plugins.cjs +15 -884
- package/dist/server-plugins.d.mts +4 -4
- package/dist/server-plugins.d.ts +4 -4
- package/dist/server-query-client.cjs +15 -1849
- package/dist/server-query-client.d.mts +1 -1
- package/dist/server-query-client.d.ts +1 -1
- package/dist/server-query-client.mjs +4 -4
- package/dist/server-query.cjs +16 -1796
- package/dist/server-query.d.mts +1 -1
- package/dist/server-query.d.ts +1 -1
- package/dist/server-query.mjs +3 -3
- package/dist/server.cjs +296 -44522
- package/dist/server.d.mts +9 -9
- package/dist/server.d.ts +9 -9
- package/dist/server.mjs +22 -22
- package/dist/{spa-router-BcS_4nqm.d.mts → spa-router-CQWiYGxS.d.mts} +2 -2
- package/dist/{spa-router-BzFBUJkn.d.ts → spa-router-Wjiw-8hB.d.ts} +2 -2
- package/dist/storage.cjs +57 -576
- package/dist/testing.cjs +92 -3148
- package/dist/testing.d.mts +3 -3
- package/dist/testing.d.ts +3 -3
- package/dist/testing.mjs +11 -7
- package/dist/theme/client.cjs +13 -108
- package/dist/theme/index.cjs +6 -68
- package/dist/theme/runtime.cjs +13 -78
- package/dist/theme/server.cjs +10 -179
- package/dist/{utils-C4yrAhNc.d.ts → utils-B0XJmG_b.d.ts} +1 -1
- package/dist/{utils-5kQP1mFR.d.mts → utils-uUxF0K0P.d.mts} +1 -1
- package/dist/version.cjs +4 -32
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +119 -37622
- package/dist/vite.d.mts +3 -3
- package/dist/vite.d.ts +3 -3
- package/dist/vite.mjs +19 -19
- package/dist/workflows.cjs +19 -1040
- package/dist/workflows.mjs +2 -2
- package/package.json +2 -2
- package/dist/{chunk-VO5SCWF5.mjs → chunk-BNGS6KJ6.mjs} +0 -0
- package/dist/{chunk-MUUZJLCI.mjs → chunk-EGJDUF4Q.mjs} +3 -3
- package/dist/{chunk-4L7SZOHZ.mjs → chunk-YHOCRI4H.mjs} +3 -3
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
4
|
+
|
|
5
|
+
// src/app-markdown-config.ts
|
|
6
|
+
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
7
|
+
function resolveMdxConfig(config) {
|
|
8
|
+
return {
|
|
9
|
+
components: _optionalChain([config, 'optionalAccess', _ => _.components]),
|
|
10
|
+
markdownRoutes: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _2 => _2.markdownRoutes]), () => ( true)),
|
|
11
|
+
className: _nullishCoalesce(_optionalChain([config, 'optionalAccess', _3 => _3.className]), () => ( "farm-markdown"))
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveMdxConfig, "resolveMdxConfig");
|
|
15
|
+
function resolveFarmMdxComponentsModulePath(config, root) {
|
|
16
|
+
const components = _optionalChain([config, 'optionalAccess', _4 => _4.components]);
|
|
17
|
+
if (typeof components !== "string") return void 0;
|
|
18
|
+
return _path2.default.isAbsolute(components) ? components : _path2.default.join(root, components);
|
|
19
|
+
}
|
|
20
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmMdxComponentsModulePath, "resolveFarmMdxComponentsModulePath");
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
exports.resolveMdxConfig = resolveMdxConfig; exports.resolveFarmMdxComponentsModulePath = resolveFarmMdxComponentsModulePath;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
4
|
+
|
|
5
|
+
// src/theme/config.ts
|
|
6
|
+
var DEFAULT_FARM_THEME_STORAGE_KEY = "farm-theme";
|
|
7
|
+
var STORAGE_KEY_PATTERN = /^[A-Za-z0-9._-]+$/;
|
|
8
|
+
function resolveFarmThemeConfig(config, basePath = "/") {
|
|
9
|
+
if (config && "enabled" in config) {
|
|
10
|
+
return config;
|
|
11
|
+
}
|
|
12
|
+
if (!config) {
|
|
13
|
+
return {
|
|
14
|
+
enabled: false,
|
|
15
|
+
default: "system",
|
|
16
|
+
storageKey: DEFAULT_FARM_THEME_STORAGE_KEY,
|
|
17
|
+
cookiePath: normalizeCookiePath(basePath)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
const storageKey = _optionalChain([config, 'access', _ => _.storageKey, 'optionalAccess', _2 => _2.trim, 'call', _3 => _3()]) || DEFAULT_FARM_THEME_STORAGE_KEY;
|
|
21
|
+
if (!STORAGE_KEY_PATTERN.test(storageKey)) {
|
|
22
|
+
throw new Error(
|
|
23
|
+
"theme.storageKey may only contain letters, numbers, dots, underscores, and hyphens."
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
const defaultTheme = _nullishCoalesce(config.default, () => ( "system"));
|
|
27
|
+
if (defaultTheme !== "light" && defaultTheme !== "dark" && defaultTheme !== "system") {
|
|
28
|
+
throw new Error('theme.default must be "light", "dark", or "system".');
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
enabled: true,
|
|
32
|
+
default: defaultTheme,
|
|
33
|
+
storageKey,
|
|
34
|
+
cookiePath: normalizeCookiePath(basePath)
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmThemeConfig, "resolveFarmThemeConfig");
|
|
38
|
+
function normalizeCookiePath(basePath) {
|
|
39
|
+
const normalized = `/${basePath}`.replace(/\/{2,}/g, "/");
|
|
40
|
+
if (normalized === "/") return normalized;
|
|
41
|
+
return normalized.replace(/\/$/, "");
|
|
42
|
+
}
|
|
43
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, normalizeCookiePath, "normalizeCookiePath");
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
exports.resolveFarmThemeConfig = resolveFarmThemeConfig;
|
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
var _chunkOWOUTKIJcjs = require('./chunk-OWOUTKIJ.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkTYQUSXUGcjs = require('./chunk-TYQUSXUG.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunkOI6CMLWXcjs = require('./chunk-OI6CMLWX.cjs');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
var _chunkTKJZFIMLcjs = require('./chunk-TKJZFIML.cjs');
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
var _chunkBIDYX3SLcjs = require('./chunk-BIDYX3SL.cjs');
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
19
|
+
|
|
20
|
+
// src/i18n/alternates.ts
|
|
21
|
+
function renderFarmLocaleAlternateLinks(pathname, config, options = {}) {
|
|
22
|
+
if (config.routing === "none") return "";
|
|
23
|
+
const base = resolveAlternateBase(options);
|
|
24
|
+
const link = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (hreflang, locale) => `<link rel="alternate" hreflang="${escapeHtmlAttribute(hreflang)}" href="${escapeHtmlAttribute(
|
|
25
|
+
resolveAlternateHref(_chunkBIDYX3SLcjs.localizeFarmPathname.call(void 0, pathname, locale, config), base)
|
|
26
|
+
)}">`, "link");
|
|
27
|
+
const links = config.locales.map((locale) => link(locale, locale));
|
|
28
|
+
links.push(link("x-default", config.defaultLocale));
|
|
29
|
+
return links.join("");
|
|
30
|
+
}
|
|
31
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, renderFarmLocaleAlternateLinks, "renderFarmLocaleAlternateLinks");
|
|
32
|
+
function resolveAlternateBase(options) {
|
|
33
|
+
for (const candidate of [options.metadataBase, options.origin]) {
|
|
34
|
+
if (typeof candidate !== "string" && !(candidate instanceof URL)) continue;
|
|
35
|
+
try {
|
|
36
|
+
const url = new URL(candidate);
|
|
37
|
+
if (url.protocol === "http:" || url.protocol === "https:") return url;
|
|
38
|
+
} catch (e) {
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return void 0;
|
|
42
|
+
}
|
|
43
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveAlternateBase, "resolveAlternateBase");
|
|
44
|
+
function resolveAlternateHref(pathname, base) {
|
|
45
|
+
if (!base) return pathname;
|
|
46
|
+
return new URL(pathname.replace(/^[/\\]+/, "/"), base).href;
|
|
47
|
+
}
|
|
48
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveAlternateHref, "resolveAlternateHref");
|
|
49
|
+
function escapeHtmlAttribute(value) {
|
|
50
|
+
return value.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
51
|
+
}
|
|
52
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, escapeHtmlAttribute, "escapeHtmlAttribute");
|
|
53
|
+
|
|
54
|
+
// src/navigation/late-navigation-recovery.ts
|
|
55
|
+
var PAGE_CONTAINER_ID = "__farm_page__";
|
|
56
|
+
var TEMPLATE_ID = "__farm_late_not_found__";
|
|
57
|
+
function serializeForInlineScript(value) {
|
|
58
|
+
return JSON.stringify(value).replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
59
|
+
}
|
|
60
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, serializeForInlineScript, "serializeForInlineScript");
|
|
61
|
+
function isLateRedirectTarget(url) {
|
|
62
|
+
try {
|
|
63
|
+
const protocol = new URL(url, "https://farm.invalid").protocol;
|
|
64
|
+
return protocol === "http:" || protocol === "https:";
|
|
65
|
+
} catch (e2) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, isLateRedirectTarget, "isLateRedirectTarget");
|
|
70
|
+
function createLateRedirectRecovery(url) {
|
|
71
|
+
if (!isLateRedirectTarget(url)) return "";
|
|
72
|
+
return `<script>window.location.replace(${serializeForInlineScript(url)})</script>`;
|
|
73
|
+
}
|
|
74
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, createLateRedirectRecovery, "createLateRedirectRecovery");
|
|
75
|
+
function createLateNotFoundRecovery(content) {
|
|
76
|
+
return `<template id="${TEMPLATE_ID}">${content}</template><script>(function(){var t=document.getElementById("${TEMPLATE_ID}");var p=document.getElementById("${PAGE_CONTAINER_ID}");if(t&&p){p.replaceChildren(t.content.cloneNode(true));}if(t)t.remove();document.documentElement.dataset.farmLateNotFound="true";var m=document.createElement("meta");m.name="robots";m.content="noindex";document.head.appendChild(m);})();</script>`;
|
|
77
|
+
}
|
|
78
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, createLateNotFoundRecovery, "createLateNotFoundRecovery");
|
|
79
|
+
|
|
80
|
+
// src/metadata-route.ts
|
|
81
|
+
function isResponse(value) {
|
|
82
|
+
return typeof Response !== "undefined" && (value instanceof Response || Boolean(
|
|
83
|
+
value && typeof value === "object" && typeof value.arrayBuffer === "function" && value.headers
|
|
84
|
+
));
|
|
85
|
+
}
|
|
86
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, isResponse, "isResponse");
|
|
87
|
+
function isRecord(value) {
|
|
88
|
+
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
89
|
+
}
|
|
90
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, isRecord, "isRecord");
|
|
91
|
+
function resolveCacheControl(revalidate) {
|
|
92
|
+
if (revalidate === false) {
|
|
93
|
+
return "public, max-age=31536000, immutable";
|
|
94
|
+
}
|
|
95
|
+
if (typeof revalidate === "number" && Number.isFinite(revalidate) && revalidate > 0) {
|
|
96
|
+
return `public, s-maxage=${Math.floor(revalidate)}, stale-while-revalidate=300`;
|
|
97
|
+
}
|
|
98
|
+
return "public, max-age=0, must-revalidate";
|
|
99
|
+
}
|
|
100
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveCacheControl, "resolveCacheControl");
|
|
101
|
+
function escapeXml(value) {
|
|
102
|
+
return String(value).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
103
|
+
}
|
|
104
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, escapeXml, "escapeXml");
|
|
105
|
+
function serializeSitemap(value) {
|
|
106
|
+
if (!Array.isArray(value)) {
|
|
107
|
+
throw new TypeError("sitemap.ts must return an array or a Response");
|
|
108
|
+
}
|
|
109
|
+
const entries = value.map((candidate, index) => {
|
|
110
|
+
if (!isRecord(candidate) || typeof candidate.url !== "string" || !candidate.url) {
|
|
111
|
+
throw new TypeError(`sitemap.ts entry ${index} must include a non-empty url`);
|
|
112
|
+
}
|
|
113
|
+
return candidate;
|
|
114
|
+
});
|
|
115
|
+
const hasLanguageAlternates = entries.some(
|
|
116
|
+
(entry) => _optionalChain([entry, 'access', _ => _.alternates, 'optionalAccess', _2 => _2.languages]) && Object.keys(entry.alternates.languages).length > 0
|
|
117
|
+
);
|
|
118
|
+
const namespace = hasLanguageAlternates ? ' xmlns:xhtml="http://www.w3.org/1999/xhtml"' : "";
|
|
119
|
+
const lines = [
|
|
120
|
+
'<?xml version="1.0" encoding="UTF-8"?>',
|
|
121
|
+
`<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"${namespace}>`
|
|
122
|
+
];
|
|
123
|
+
for (const entry of entries) {
|
|
124
|
+
lines.push(" <url>", ` <loc>${escapeXml(entry.url)}</loc>`);
|
|
125
|
+
if (entry.lastModified !== void 0) {
|
|
126
|
+
const lastModified = entry.lastModified instanceof Date ? entry.lastModified.toISOString() : entry.lastModified;
|
|
127
|
+
lines.push(` <lastmod>${escapeXml(lastModified)}</lastmod>`);
|
|
128
|
+
}
|
|
129
|
+
if (entry.changeFrequency) {
|
|
130
|
+
lines.push(` <changefreq>${escapeXml(entry.changeFrequency)}</changefreq>`);
|
|
131
|
+
}
|
|
132
|
+
if (entry.priority !== void 0) {
|
|
133
|
+
lines.push(` <priority>${escapeXml(entry.priority)}</priority>`);
|
|
134
|
+
}
|
|
135
|
+
for (const [language, href] of Object.entries(_optionalChain([entry, 'access', _3 => _3.alternates, 'optionalAccess', _4 => _4.languages]) || {})) {
|
|
136
|
+
lines.push(
|
|
137
|
+
` <xhtml:link rel="alternate" hreflang="${escapeXml(language)}" href="${escapeXml(href)}" />`
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
lines.push(" </url>");
|
|
141
|
+
}
|
|
142
|
+
lines.push("</urlset>");
|
|
143
|
+
return `${lines.join("\n")}
|
|
144
|
+
`;
|
|
145
|
+
}
|
|
146
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, serializeSitemap, "serializeSitemap");
|
|
147
|
+
function toArray(value) {
|
|
148
|
+
return value === void 0 ? [] : Array.isArray(value) ? value : [value];
|
|
149
|
+
}
|
|
150
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, toArray, "toArray");
|
|
151
|
+
function serializeRobots(value) {
|
|
152
|
+
if (!isRecord(value)) {
|
|
153
|
+
throw new TypeError("robots.ts must return a robots object or a Response");
|
|
154
|
+
}
|
|
155
|
+
const robots = value;
|
|
156
|
+
const rules = toArray(robots.rules);
|
|
157
|
+
if (rules.length === 0) {
|
|
158
|
+
throw new TypeError("robots.ts must return at least one rule");
|
|
159
|
+
}
|
|
160
|
+
const sections = rules.map((rule, index) => {
|
|
161
|
+
if (!isRecord(rule)) {
|
|
162
|
+
throw new TypeError(`robots.ts rule ${index} must be an object`);
|
|
163
|
+
}
|
|
164
|
+
const userAgents = toArray(rule.userAgent).filter(
|
|
165
|
+
(userAgent) => typeof userAgent === "string" && Boolean(userAgent)
|
|
166
|
+
);
|
|
167
|
+
if (userAgents.length === 0) {
|
|
168
|
+
throw new TypeError(`robots.ts rule ${index} must include a userAgent`);
|
|
169
|
+
}
|
|
170
|
+
const lines = userAgents.map((userAgent) => `User-agent: ${userAgent}`);
|
|
171
|
+
for (const allow of toArray(rule.allow)) lines.push(`Allow: ${allow}`);
|
|
172
|
+
for (const disallow of toArray(rule.disallow)) lines.push(`Disallow: ${disallow}`);
|
|
173
|
+
if (rule.crawlDelay !== void 0) lines.push(`Crawl-delay: ${rule.crawlDelay}`);
|
|
174
|
+
return lines.join("\n");
|
|
175
|
+
});
|
|
176
|
+
const globalLines = [
|
|
177
|
+
...toArray(robots.sitemap).map((sitemap) => `Sitemap: ${sitemap}`),
|
|
178
|
+
...robots.host ? [`Host: ${robots.host}`] : []
|
|
179
|
+
];
|
|
180
|
+
return `${[...sections, ...globalLines.length ? [globalLines.join("\n")] : []].join("\n\n")}
|
|
181
|
+
`;
|
|
182
|
+
}
|
|
183
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, serializeRobots, "serializeRobots");
|
|
184
|
+
function serializeManifest(value) {
|
|
185
|
+
if (!isRecord(value)) {
|
|
186
|
+
throw new TypeError("manifest.ts must return a manifest object or a Response");
|
|
187
|
+
}
|
|
188
|
+
return `${JSON.stringify(value, null, 2)}
|
|
189
|
+
`;
|
|
190
|
+
}
|
|
191
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, serializeManifest, "serializeManifest");
|
|
192
|
+
function createFarmMetadataRouteResponse(kind, value, routeModule = {}, options = {}) {
|
|
193
|
+
const method = (options.method || "GET").toUpperCase();
|
|
194
|
+
if (method !== "GET" && method !== "HEAD") {
|
|
195
|
+
return new Response(null, { status: 405, headers: { Allow: "GET, HEAD" } });
|
|
196
|
+
}
|
|
197
|
+
if (isResponse(value)) {
|
|
198
|
+
return method === "HEAD" ? _chunkTKJZFIMLcjs.omitFarmResponseBody.call(void 0, value) : value;
|
|
199
|
+
}
|
|
200
|
+
const body = kind === "sitemap" ? serializeSitemap(value) : kind === "robots" ? serializeRobots(value) : kind === "llms" || kind === "llms-full" ? _chunkTYQUSXUGcjs.serializeFarmLlmsTxt.call(void 0, value) : serializeManifest(value);
|
|
201
|
+
const contentType = kind === "sitemap" ? "application/xml; charset=utf-8" : kind === "robots" || kind === "llms" || kind === "llms-full" ? "text/plain; charset=utf-8" : "application/manifest+json; charset=utf-8";
|
|
202
|
+
return new Response(method === "HEAD" ? null : body, {
|
|
203
|
+
headers: {
|
|
204
|
+
"Content-Type": contentType,
|
|
205
|
+
"Cache-Control": resolveCacheControl(routeModule.revalidate),
|
|
206
|
+
"X-Content-Type-Options": "nosniff"
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, createFarmMetadataRouteResponse, "createFarmMetadataRouteResponse");
|
|
211
|
+
|
|
212
|
+
// src/components/error-page.ts
|
|
213
|
+
var ERROR_STATUS_TEXT = {
|
|
214
|
+
400: "Bad Request",
|
|
215
|
+
401: "Unauthorized",
|
|
216
|
+
402: "Payment Required",
|
|
217
|
+
403: "Forbidden",
|
|
218
|
+
404: "Not Found",
|
|
219
|
+
405: "Method Not Allowed",
|
|
220
|
+
406: "Not Acceptable",
|
|
221
|
+
408: "Request Timeout",
|
|
222
|
+
409: "Conflict",
|
|
223
|
+
410: "Gone",
|
|
224
|
+
411: "Length Required",
|
|
225
|
+
412: "Precondition Failed",
|
|
226
|
+
413: "Content Too Large",
|
|
227
|
+
414: "URI Too Long",
|
|
228
|
+
415: "Unsupported Media Type",
|
|
229
|
+
416: "Range Not Satisfiable",
|
|
230
|
+
418: "I'm a Teapot",
|
|
231
|
+
422: "Unprocessable Content",
|
|
232
|
+
423: "Locked",
|
|
233
|
+
424: "Failed Dependency",
|
|
234
|
+
425: "Too Early",
|
|
235
|
+
426: "Upgrade Required",
|
|
236
|
+
428: "Precondition Required",
|
|
237
|
+
429: "Too Many Requests",
|
|
238
|
+
431: "Request Header Fields Too Large",
|
|
239
|
+
451: "Unavailable For Legal Reasons",
|
|
240
|
+
500: "Internal Server Error",
|
|
241
|
+
501: "Not Implemented",
|
|
242
|
+
502: "Bad Gateway",
|
|
243
|
+
503: "Service Unavailable",
|
|
244
|
+
504: "Gateway Timeout",
|
|
245
|
+
505: "HTTP Version Not Supported",
|
|
246
|
+
506: "Variant Also Negotiates",
|
|
247
|
+
507: "Insufficient Storage",
|
|
248
|
+
508: "Loop Detected",
|
|
249
|
+
510: "Not Extended",
|
|
250
|
+
511: "Network Authentication Required"
|
|
251
|
+
};
|
|
252
|
+
var ERROR_TITLES = {
|
|
253
|
+
400: "This request could not be completed",
|
|
254
|
+
401: "Authentication is required",
|
|
255
|
+
403: "You do not have access to this page",
|
|
256
|
+
404: "This page could not be found",
|
|
257
|
+
405: "This request method is not supported",
|
|
258
|
+
408: "The request took too long",
|
|
259
|
+
409: "The request conflicts with the current state",
|
|
260
|
+
410: "This resource is no longer available",
|
|
261
|
+
413: "The request is too large",
|
|
262
|
+
422: "The request could not be processed",
|
|
263
|
+
429: "Too many requests were sent",
|
|
264
|
+
500: "Something went wrong",
|
|
265
|
+
501: "This operation is not implemented",
|
|
266
|
+
502: "An upstream service returned an invalid response",
|
|
267
|
+
503: "The service is temporarily unavailable",
|
|
268
|
+
504: "An upstream service took too long to respond"
|
|
269
|
+
};
|
|
270
|
+
var ERROR_PUBLIC_MESSAGES = {
|
|
271
|
+
400: "Check the request details, then try again.",
|
|
272
|
+
401: "Sign in and try this request again.",
|
|
273
|
+
403: "Use an account with the required permissions or return home.",
|
|
274
|
+
404: "Check the address or return to the home page.",
|
|
275
|
+
405: "Use a supported request method and try again.",
|
|
276
|
+
408: "Try the request again in a moment.",
|
|
277
|
+
409: "Refresh the page, review the latest state, and try again.",
|
|
278
|
+
410: "Return home to continue browsing.",
|
|
279
|
+
413: "Reduce the request size and try again.",
|
|
280
|
+
422: "Review the request data and try again.",
|
|
281
|
+
429: "Wait a moment before trying again.",
|
|
282
|
+
500: "The application ran into an unexpected problem. Try again in a moment.",
|
|
283
|
+
501: "This operation is not available yet.",
|
|
284
|
+
502: "Try again after the upstream service recovers.",
|
|
285
|
+
503: "Try again in a moment.",
|
|
286
|
+
504: "Try again after the upstream service recovers."
|
|
287
|
+
};
|
|
288
|
+
function escapeHtml(value) {
|
|
289
|
+
return String(_nullishCoalesce(value, () => ( ""))).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
290
|
+
}
|
|
291
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, escapeHtml, "escapeHtml");
|
|
292
|
+
function serializeJsonForHtml(value) {
|
|
293
|
+
return JSON.stringify(value).replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
294
|
+
}
|
|
295
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, serializeJsonForHtml, "serializeJsonForHtml");
|
|
296
|
+
function normalizeErrorStatus(status) {
|
|
297
|
+
const value = typeof status === "string" && status.trim() ? Number(status) : status;
|
|
298
|
+
return typeof value === "number" && Number.isInteger(value) && value >= 400 && value <= 599 ? value : void 0;
|
|
299
|
+
}
|
|
300
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, normalizeErrorStatus, "normalizeErrorStatus");
|
|
301
|
+
function resolveDefaultErrorStatus(error) {
|
|
302
|
+
if (error && typeof error === "object") {
|
|
303
|
+
const candidate = error;
|
|
304
|
+
return _nullishCoalesce(_nullishCoalesce(normalizeErrorStatus(candidate.status), () => ( normalizeErrorStatus(candidate.statusCode))), () => ( 500));
|
|
305
|
+
}
|
|
306
|
+
return 500;
|
|
307
|
+
}
|
|
308
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveDefaultErrorStatus, "resolveDefaultErrorStatus");
|
|
309
|
+
function getDefaultErrorStatusText(statusCode) {
|
|
310
|
+
return ERROR_STATUS_TEXT[statusCode] || (statusCode >= 500 ? "Server Error" : "Request Error");
|
|
311
|
+
}
|
|
312
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, getDefaultErrorStatusText, "getDefaultErrorStatusText");
|
|
313
|
+
function getDefaultErrorTitle(statusCode) {
|
|
314
|
+
return ERROR_TITLES[statusCode] || (statusCode >= 500 ? "The server could not complete the request" : "The request could not be completed");
|
|
315
|
+
}
|
|
316
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, getDefaultErrorTitle, "getDefaultErrorTitle");
|
|
317
|
+
function getDefaultErrorPublicMessage(statusCode) {
|
|
318
|
+
return ERROR_PUBLIC_MESSAGES[statusCode] || "Try again or return to the home page.";
|
|
319
|
+
}
|
|
320
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, getDefaultErrorPublicMessage, "getDefaultErrorPublicMessage");
|
|
321
|
+
function createSourceFrameMarkup(sourceFrame) {
|
|
322
|
+
if (!sourceFrame) {
|
|
323
|
+
return `<p class="farm-default-error__details-empty">Source location is unavailable. Copy the debug report to inspect the filtered stack trace.</p>`;
|
|
324
|
+
}
|
|
325
|
+
const lines = sourceFrame.lines.map(
|
|
326
|
+
(line) => `<span class="farm-default-error__source-line${line.highlight ? " farm-default-error__source-line--active" : ""}"><span class="farm-default-error__source-gutter">${line.highlight ? ">" : " "} ${line.number}</span><span class="farm-default-error__source-text">${escapeHtml(line.content || " ")}</span></span>`
|
|
327
|
+
).join("\n");
|
|
328
|
+
return `<div class="farm-default-error__source"><p class="farm-default-error__source-path">${escapeHtml(sourceFrame.file)}:${sourceFrame.line}:${sourceFrame.column}</p><pre class="farm-default-error__source-code" tabindex="0"><code>${lines}</code></pre></div>`;
|
|
329
|
+
}
|
|
330
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, createSourceFrameMarkup, "createSourceFrameMarkup");
|
|
331
|
+
function createDebugReport(options) {
|
|
332
|
+
const statusText = options.statusText || getDefaultErrorStatusText(options.statusCode);
|
|
333
|
+
const sourceFrame = options.sourceFrame;
|
|
334
|
+
const source = sourceFrame ? [
|
|
335
|
+
`\`${sourceFrame.file}:${sourceFrame.line}:${sourceFrame.column}\``,
|
|
336
|
+
"",
|
|
337
|
+
"```text",
|
|
338
|
+
...sourceFrame.lines.map(
|
|
339
|
+
(line) => `${line.highlight ? ">" : " "} ${String(line.number).padStart(4, " ")} | ${line.content}`
|
|
340
|
+
),
|
|
341
|
+
"```"
|
|
342
|
+
].join("\n") : "Source frame unavailable.";
|
|
343
|
+
return [
|
|
344
|
+
"# Farm.js debug report",
|
|
345
|
+
"",
|
|
346
|
+
"## Error",
|
|
347
|
+
`- Status: ${options.statusCode} ${statusText}`,
|
|
348
|
+
`- Name: ${options.errorName || "Error"}`,
|
|
349
|
+
`- Message: ${options.message || getDefaultErrorPublicMessage(options.statusCode)}`,
|
|
350
|
+
`- Request: ${(options.method || "GET").toUpperCase()} ${options.requestPath || "/"}`,
|
|
351
|
+
"",
|
|
352
|
+
"## Runtime",
|
|
353
|
+
`- Farm.js: ${options.farmVersion || "unknown"}`,
|
|
354
|
+
`- Node.js: ${options.nodeVersion || "unknown"}`,
|
|
355
|
+
`- Mode: ${options.mode || "development"}`,
|
|
356
|
+
"",
|
|
357
|
+
"## Source",
|
|
358
|
+
source,
|
|
359
|
+
"",
|
|
360
|
+
"## Filtered stack",
|
|
361
|
+
"```text",
|
|
362
|
+
options.stack || "Stack trace unavailable.",
|
|
363
|
+
"```"
|
|
364
|
+
].join("\n");
|
|
365
|
+
}
|
|
366
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, createDebugReport, "createDebugReport");
|
|
367
|
+
var ERROR_PAGE_SCRIPT = `<script>(function(){var root=document.querySelector("[data-farm-default-error]");if(!root)return;var retry=root.querySelector("[data-farm-error-retry]");var back=root.querySelector("[data-farm-error-back]");if(retry)retry.addEventListener("click",function(){window.location.reload()});if(back)back.addEventListener("click",function(){if(window.history.length>1){window.history.back()}else{window.location.assign("/")}})})();</script>`;
|
|
368
|
+
var ERROR_COPY_SCRIPT = `<script>(function(){var root=document.querySelector("[data-farm-default-error]");var copy=root&&root.querySelector("[data-farm-error-copy]");var report=document.getElementById("farm-default-error-report");if(!copy||!report)return;copy.addEventListener("click",async function(){var value="";try{value=JSON.parse(report.textContent||'""')}catch(_error){value=report.textContent||""}try{if(navigator.clipboard&&window.isSecureContext){await navigator.clipboard.writeText(value)}else{var area=document.createElement("textarea");area.value=value;area.setAttribute("readonly","");area.style.position="fixed";area.style.opacity="0";document.body.appendChild(area);area.select();document.execCommand("copy");area.remove()}var label=copy.querySelector("[data-farm-error-copy-label]");var status=copy.querySelector("[data-farm-error-copy-status]");if(label)label.textContent="COPIED";if(status)status.textContent="Debug report copied";window.setTimeout(function(){if(label)label.textContent="COPY DEBUG REPORT";if(status)status.textContent=""},1800)}catch(_error){var status=copy.querySelector("[data-farm-error-copy-status]");if(status)status.textContent="Unable to copy the debug report"}})})();</script>`;
|
|
369
|
+
var ERROR_DOCS_ICON = `<svg class="farm-default-error__docs-icon" viewBox="0 0 16 16" fill="none" aria-hidden="true" focusable="false"><path d="M2.75 2.75h3.5A1.75 1.75 0 0 1 8 4.5v8.75a1.75 1.75 0 0 0-1.75-1.75h-3.5v-8.75Z"/><path d="M13.25 2.75h-3.5A1.75 1.75 0 0 0 8 4.5v8.75a1.75 1.75 0 0 1 1.75-1.75h3.5v-8.75Z"/></svg>`;
|
|
370
|
+
function createDefaultErrorMarkup(options = {}) {
|
|
371
|
+
const statusCode = _nullishCoalesce(normalizeErrorStatus(options.statusCode), () => ( 500));
|
|
372
|
+
const statusText = options.statusText || getDefaultErrorStatusText(statusCode);
|
|
373
|
+
const development = options.development === true;
|
|
374
|
+
const title = getDefaultErrorTitle(statusCode);
|
|
375
|
+
const message = development && options.message ? options.message : getDefaultErrorPublicMessage(statusCode);
|
|
376
|
+
const requestPath = options.requestPath || "/";
|
|
377
|
+
const method = (options.method || "GET").toUpperCase();
|
|
378
|
+
const isServerError = statusCode >= 500;
|
|
379
|
+
const details = development ? `<section class="farm-default-error__details" aria-labelledby="farm-default-error-details-title"><div class="farm-default-error__details-header"><h2 id="farm-default-error-details-title" class="farm-default-error__details-title">Technical details</h2></div>${createSourceFrameMarkup(options.sourceFrame)}<p class="farm-default-error__meta">Farm.js v${escapeHtml(options.farmVersion || "unknown")} \xB7 ${escapeHtml(options.mode || "development")} \xB7 Node.js ${escapeHtml(options.nodeVersion || "unknown")}</p></section>` : "";
|
|
380
|
+
const report = development ? `<script id="farm-default-error-report" type="application/json">${serializeJsonForHtml(createDebugReport({ ...options, statusCode, statusText, requestPath, method }))}</script>${ERROR_COPY_SCRIPT}` : "";
|
|
381
|
+
const primaryAction = isServerError ? `<button class="farm-default-error__action farm-default-error__action--primary" type="button" data-farm-error-retry>TRY AGAIN</button>` : `<button class="farm-default-error__action farm-default-error__action--primary" type="button" data-farm-error-back>GO BACK</button>`;
|
|
382
|
+
const debugAction = development ? `<span class="farm-default-error__footer-divider" aria-hidden="true">/</span><button class="farm-default-error__footer-action" type="button" data-farm-error-copy><span data-farm-error-copy-label>COPY DEBUG REPORT</span><span class="farm-default-error__sr-only" aria-live="polite" data-farm-error-copy-status></span></button>` : "";
|
|
383
|
+
return `<style>${_chunkOWOUTKIJcjs.DEFAULT_ERROR_STYLES}</style><main class="farm-default-error${development ? " farm-default-error--development" : ""}" data-farm-default-error role="alert" aria-labelledby="farm-default-error-title" aria-describedby="farm-default-error-description"><div class="farm-default-error__frame"><div class="farm-default-error__brand" aria-hidden="true"><span>FARM.JS</span><span class="farm-default-error__brand-divider">/</span><span>ERROR</span></div><div class="farm-default-error__content"><p class="farm-default-error__status"><span class="farm-default-error__status-mark" aria-hidden="true"></span><span>${statusCode}</span><span class="farm-default-error__status-divider" aria-hidden="true">/</span><span>${escapeHtml(statusText)}</span></p><header class="farm-default-error__summary"><h1 id="farm-default-error-title" class="farm-default-error__title">${escapeHtml(title)}</h1><p id="farm-default-error-description" class="farm-default-error__message">${escapeHtml(message)}</p></header><div class="farm-default-error__actions">${primaryAction}<a class="farm-default-error__action" href="/">RETURN HOME</a></div><section class="farm-default-error__panel" aria-label="Error information"><div class="farm-default-error__row"><span class="farm-default-error__label">Request</span><span class="farm-default-error__value">${escapeHtml(method)} ${escapeHtml(requestPath)}</span></div><div class="farm-default-error__row"><span class="farm-default-error__label">Status</span><span class="farm-default-error__value">${statusCode} ${escapeHtml(statusText)}</span></div>${details}</section></div><footer class="farm-default-error__footer"><a class="farm-default-error__footer-action" href="https://farmjs.dev/docs" target="_blank" rel="noopener noreferrer">${ERROR_DOCS_ICON}<span>VIEW DOCUMENTATION</span></a>${debugAction}</footer></div>${report}${ERROR_PAGE_SCRIPT}</main>`;
|
|
384
|
+
}
|
|
385
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, createDefaultErrorMarkup, "createDefaultErrorMarkup");
|
|
386
|
+
|
|
387
|
+
// src/theme/server-runtime.ts
|
|
388
|
+
var THEME_SCRIPT_ID = "farm-theme-script";
|
|
389
|
+
var THEME_STYLE_ID = "farm-theme-style";
|
|
390
|
+
function createFarmThemeDocumentParts(input, basePath = "/", serverTheme) {
|
|
391
|
+
const config = _chunkOI6CMLWXcjs.resolveFarmThemeConfig.call(void 0, input, basePath);
|
|
392
|
+
if (!config.enabled) return { attributes: "", head: "" };
|
|
393
|
+
const hydrationTheme = _nullishCoalesce(serverTheme, () => ( config.default));
|
|
394
|
+
const initialTheme = hydrationTheme === "system" ? "light" : hydrationTheme;
|
|
395
|
+
const script = createFarmThemeBootstrapScript(config, hydrationTheme);
|
|
396
|
+
return {
|
|
397
|
+
attributes: ` data-theme="${initialTheme}"`,
|
|
398
|
+
head: `<style id="${THEME_STYLE_ID}">:root[data-theme="light"]{color-scheme:light}:root[data-theme="dark"]{color-scheme:dark}</style><script id="${THEME_SCRIPT_ID}">${script}</script>`
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, createFarmThemeDocumentParts, "createFarmThemeDocumentParts");
|
|
402
|
+
function createFarmThemeBootstrapScript(config, serverTheme = config.default) {
|
|
403
|
+
return `(function(config,serverTheme){
|
|
404
|
+
var isTheme=function(value){return value==="light"||value==="dark"||value==="system";};
|
|
405
|
+
var decode=function(value){try{return decodeURIComponent(value);}catch(_error){return value;}};
|
|
406
|
+
var readCookie=function(){var entries=document.cookie.split(";");for(var index=0;index<entries.length;index++){var entry=entries[index];var separator=entry.indexOf("=");if(separator<0)continue;if(decode(entry.slice(0,separator).trim())===config.storageKey)return decode(entry.slice(separator+1).trim());}};
|
|
407
|
+
var media=window.matchMedia("(prefers-color-scheme: dark)");
|
|
408
|
+
var resolveTheme=function(theme){return theme==="system"?(media.matches?"dark":"light"):theme;};
|
|
409
|
+
var storedTheme=readCookie();
|
|
410
|
+
var preference=isTheme(storedTheme)?storedTheme:config.default;
|
|
411
|
+
var serverSnapshot={theme:serverTheme,resolvedTheme:serverTheme==="system"?undefined:serverTheme,mounted:false};
|
|
412
|
+
var apply=function(){var resolvedTheme=resolveTheme(preference);document.documentElement.dataset.theme=resolvedTheme;var snapshot={theme:preference,resolvedTheme:resolvedTheme,mounted:true};if(window.__FARM_THEME__)window.__FARM_THEME__.snapshot=snapshot;return snapshot;};
|
|
413
|
+
var emit=function(){var snapshot=apply();window.dispatchEvent(new CustomEvent("farm:themechange",{detail:snapshot}));};
|
|
414
|
+
var persist=function(theme){var secure=window.location.protocol==="https:"?"; Secure":"";document.cookie=encodeURIComponent(config.storageKey)+"="+encodeURIComponent(theme)+"; Path="+config.cookiePath+"; Max-Age=31536000; SameSite=Lax"+secure;try{localStorage.setItem(config.storageKey,theme);}catch(_error){}};
|
|
415
|
+
var setTheme=function(theme){if(!isTheme(theme))throw new TypeError("Unknown FARMJS theme: "+String(theme));preference=theme;persist(theme);emit();};
|
|
416
|
+
var initialSnapshot={theme:preference,resolvedTheme:resolveTheme(preference),mounted:true};
|
|
417
|
+
window.__FARM_THEME__={config:config,serverSnapshot:serverSnapshot,snapshot:initialSnapshot,setTheme:setTheme};
|
|
418
|
+
document.documentElement.dataset.theme=initialSnapshot.resolvedTheme;
|
|
419
|
+
var handleSystemChange=function(){if(preference==="system")emit();};
|
|
420
|
+
if(typeof media.addEventListener==="function")media.addEventListener("change",handleSystemChange);else if(typeof media.addListener==="function")media.addListener(handleSystemChange);
|
|
421
|
+
window.addEventListener("storage",function(event){if(event.key!==config.storageKey||!isTheme(event.newValue))return;preference=event.newValue;persist(preference);emit();});
|
|
422
|
+
})(${serializeInlineValue(config)},${serializeInlineValue(serverTheme)});`;
|
|
423
|
+
}
|
|
424
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, createFarmThemeBootstrapScript, "createFarmThemeBootstrapScript");
|
|
425
|
+
function applyFarmThemeDocument(html, input, basePath = "/", serverTheme) {
|
|
426
|
+
const parts = createFarmThemeDocumentParts(input, basePath, serverTheme);
|
|
427
|
+
if (!parts.head) return html;
|
|
428
|
+
let output = html.replace(/<html([^>]*)>/i, (_match, attributes) => {
|
|
429
|
+
const nextAttributes = attributes.replace(/\sdata-theme=(?:"[^"]*"|'[^']*'|[^\s>]+)/i, "");
|
|
430
|
+
return `<html${nextAttributes}${parts.attributes}>`;
|
|
431
|
+
});
|
|
432
|
+
if (!output.includes(`id="${THEME_SCRIPT_ID}"`)) {
|
|
433
|
+
output = output.replace(/<head([^>]*)>/i, `<head$1>${parts.head}`);
|
|
434
|
+
}
|
|
435
|
+
return output;
|
|
436
|
+
}
|
|
437
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, applyFarmThemeDocument, "applyFarmThemeDocument");
|
|
438
|
+
function serializeInlineValue(value) {
|
|
439
|
+
return JSON.stringify(value).replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
440
|
+
}
|
|
441
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, serializeInlineValue, "serializeInlineValue");
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
exports.renderFarmLocaleAlternateLinks = renderFarmLocaleAlternateLinks; exports.createLateRedirectRecovery = createLateRedirectRecovery; exports.createLateNotFoundRecovery = createLateNotFoundRecovery; exports.createFarmMetadataRouteResponse = createFarmMetadataRouteResponse; exports.resolveDefaultErrorStatus = resolveDefaultErrorStatus; exports.getDefaultErrorStatusText = getDefaultErrorStatusText; exports.createDefaultErrorMarkup = createDefaultErrorMarkup; exports.createFarmThemeDocumentParts = createFarmThemeDocumentParts; exports.applyFarmThemeDocument = applyFarmThemeDocument;
|