@farm.js/core 0.1.48 → 0.1.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-mcp-DAjB8Eyu.d.ts → agent-mcp-9BMbRgg_.d.ts} +1 -1
- package/dist/{agent-mcp-CXN3g0eX.d.mts → agent-mcp-CIMH324y.d.mts} +1 -1
- package/dist/agent-runtime.cjs +3 -3
- package/dist/agent-runtime.d.mts +6 -6
- package/dist/agent-runtime.d.ts +6 -6
- package/dist/agent-runtime.mjs +2 -2
- package/dist/analyzer-CN7C74WX.cjs +1066 -0
- package/dist/analyzer-DDW34OMC.mjs +1066 -0
- package/dist/api/client.d.mts +0 -1
- package/dist/api/client.d.ts +0 -1
- package/dist/api/route-manager.cjs +5 -5
- package/dist/api/route-manager.d.mts +10 -10
- package/dist/api/route-manager.d.ts +10 -10
- package/dist/api/route-manager.mjs +4 -4
- package/dist/api/runtime.cjs +3 -3
- package/dist/api/runtime.d.mts +7 -7
- package/dist/api/runtime.d.ts +7 -7
- package/dist/api/runtime.mjs +2 -2
- package/dist/api.cjs +6 -6
- package/dist/api.d.mts +10 -10
- package/dist/api.d.ts +10 -10
- package/dist/api.mjs +5 -5
- package/dist/{app-VK9sHDn5.d.ts → app-BWibTHVT.d.ts} +7 -7
- package/dist/{app-DytgRPjJ.d.mts → app-DVJ13FPA.d.mts} +7 -7
- package/dist/{app-manifest-DPgW5ke5.d.mts → app-manifest-CQDJOKL2.d.mts} +1 -1
- package/dist/{app-manifest-BUu7YGAx.d.ts → app-manifest-D0kaXdwu.d.ts} +1 -1
- package/dist/app-markdown.d.mts +7 -7
- package/dist/app-markdown.d.ts +7 -7
- package/dist/cache.d.mts +4 -3
- package/dist/cache.d.ts +4 -3
- package/dist/{chunk-VJXLUTBM.mjs → chunk-2DEPNLXK.mjs} +7 -7
- package/dist/chunk-2G63BIRL.mjs +227 -0
- package/dist/chunk-2GLQSIZD.mjs +55 -0
- package/dist/{chunk-HRLYO2XJ.mjs → chunk-2VCC3GVC.mjs} +1 -1
- package/dist/chunk-3ATXWZPH.cjs +227 -0
- package/dist/{chunk-YSPMY4B7.cjs → chunk-474FO3UE.cjs} +233 -157
- package/dist/{chunk-QNQEK3OF.cjs → chunk-4T25YCZ5.cjs} +14 -14
- package/dist/{chunk-ATHPRVP2.mjs → chunk-5V4KZOZO.mjs} +1 -1
- package/dist/{chunk-FGJQS4EC.cjs → chunk-6QA2SXVH.cjs} +2 -2
- package/dist/{chunk-XLYXG73A.mjs → chunk-75WWOZ5C.mjs} +22 -0
- package/dist/{chunk-QFQDRJKJ.mjs → chunk-76R5GJER.mjs} +2 -2
- package/dist/{chunk-NG44F7AH.mjs → chunk-7ONZDKVY.mjs} +2 -2
- package/dist/{chunk-MZZA6ZQV.mjs → chunk-7PZVXMWG.mjs} +4 -4
- package/dist/{chunk-4IICUBQX.cjs → chunk-A5BJKSZE.cjs} +2 -2
- package/dist/{chunk-TTYXOAB7.mjs → chunk-ANHZ6SUL.mjs} +1 -1
- package/dist/{chunk-ZBS3GOQZ.cjs → chunk-AQLHD6HZ.cjs} +35 -61
- package/dist/{chunk-Q2ZKQ6GD.cjs → chunk-B5S2JS6M.cjs} +127 -125
- package/dist/{chunk-AXRNEVCS.cjs → chunk-B6PREBN6.cjs} +8 -8
- package/dist/{chunk-JOHXK4BB.mjs → chunk-BW6SCVYX.mjs} +1 -1
- package/dist/{chunk-LZBM35DH.mjs → chunk-C73RIAEF.mjs} +4 -4
- package/dist/chunk-CGCJ2TJU.cjs +55 -0
- package/dist/{chunk-UYQOIPXE.mjs → chunk-CPXDDWGL.mjs} +1 -1
- package/dist/{chunk-JPAVNDZH.cjs → chunk-CY7H5KS4.cjs} +25 -25
- package/dist/{chunk-4S7M63WX.cjs → chunk-DGOLAZLV.cjs} +22 -1
- package/dist/{chunk-73XBJRZW.cjs → chunk-E2BMCNMJ.cjs} +2 -2
- package/dist/{chunk-WUEDTW6E.cjs → chunk-F5LERVY3.cjs} +23 -5
- package/dist/{chunk-A7DK663W.cjs → chunk-FACTMUPI.cjs} +27 -27
- package/dist/chunk-G2KTRMWA.mjs +40 -0
- package/dist/{chunk-C6U66WWF.mjs → chunk-GFT5AHAT.mjs} +13 -0
- package/dist/{chunk-ZGS3ZDF7.cjs → chunk-GOOK2J2W.cjs} +7 -7
- package/dist/{chunk-NW2BKDVT.mjs → chunk-HHFMECFO.mjs} +1 -1
- package/dist/{chunk-6M3HXUBQ.mjs → chunk-HWCHIBJZ.mjs} +21 -3
- package/dist/{chunk-HUL4LTC6.cjs → chunk-HYN3LLG7.cjs} +63 -20
- package/dist/{chunk-HELQXYVI.cjs → chunk-I2DQGS56.cjs} +11 -9
- package/dist/{chunk-SSNN55Q6.cjs → chunk-IQXGHGZF.cjs} +5 -5
- package/dist/{chunk-ZSIGEHSE.cjs → chunk-IUBDMDZZ.cjs} +21 -180
- package/dist/{chunk-TQWGOQ7O.mjs → chunk-IWJKJDNW.mjs} +116 -40
- package/dist/{chunk-NRFUVDTH.mjs → chunk-JJOWY3XD.mjs} +2 -2
- package/dist/{chunk-6XFGJBYX.cjs → chunk-JYNNIGQO.cjs} +16 -7
- package/dist/{chunk-XO6WL6NL.mjs → chunk-KGP76FSV.mjs} +1 -1
- package/dist/{chunk-GXSMF7UR.mjs → chunk-KO2NWUKN.mjs} +1 -1
- package/dist/{chunk-VDLF2DJA.cjs → chunk-KZH6YLND.cjs} +375 -162
- package/dist/{chunk-5566GNEG.cjs → chunk-LIFUPCXW.cjs} +13 -0
- package/dist/{chunk-I2SWKWO7.mjs → chunk-LJDIFIJ2.mjs} +1 -1
- package/dist/{chunk-KZT2VHRQ.cjs → chunk-LYWAGXXW.cjs} +11 -11
- package/dist/{chunk-N6SIQJEJ.mjs → chunk-M7LKA632.mjs} +54 -11
- package/dist/{chunk-6LH33DLL.cjs → chunk-NJVFPJ2Y.cjs} +2 -2
- package/dist/{chunk-JWP56HCP.mjs → chunk-OD6WM3I7.mjs} +2 -2
- package/dist/{chunk-MJ6IC4K2.mjs → chunk-OTOOJIUB.mjs} +1 -1
- package/dist/{chunk-TFA6BUAE.cjs → chunk-OY5XDG24.cjs} +4 -4
- package/dist/{chunk-R2SEZEBC.cjs → chunk-OYNNA4DD.cjs} +4 -4
- package/dist/{chunk-GBPDSUFE.mjs → chunk-OZK2DS44.mjs} +1 -1
- package/dist/chunk-QXJADAQB.cjs +40 -0
- package/dist/{chunk-JLS6ZLFM.cjs → chunk-RHOR2J6V.cjs} +1 -1
- package/dist/{chunk-YQGZLCT4.cjs → chunk-RWT2BTJT.cjs} +6 -6
- package/dist/{chunk-3HBFI373.cjs → chunk-S5AQ7CAC.cjs} +14 -14
- package/dist/{chunk-HNAUK3SC.mjs → chunk-SHJJM6OG.mjs} +40 -199
- package/dist/{chunk-LL7TDMOM.mjs → chunk-SMUW7UST.mjs} +33 -59
- package/dist/{chunk-VCFBQFOV.mjs → chunk-SN5VSO3Q.mjs} +9 -7
- package/dist/{chunk-DM3TFCC2.cjs → chunk-SUV6YO4Q.cjs} +5 -5
- package/dist/{chunk-JUMPFVMK.mjs → chunk-TUOO6IK3.mjs} +9 -0
- package/dist/chunk-UB7RVEMX.mjs +73 -0
- package/dist/{chunk-CDTIXBKN.mjs → chunk-UN6N623E.mjs} +2 -2
- package/dist/{chunk-BEXYFR2R.cjs → chunk-UY6HS5PF.cjs} +2 -2
- package/dist/{chunk-HAH4FBTA.mjs → chunk-VAHBCI6X.mjs} +1 -1
- package/dist/{chunk-C2R5RVLA.cjs → chunk-VCKGOXFI.cjs} +73 -1
- package/dist/{chunk-N25RPPO5.cjs → chunk-WAPQWAE6.cjs} +10 -10
- package/dist/{chunk-NE33FRQ5.mjs → chunk-WVBUXNBX.mjs} +274 -61
- package/dist/{chunk-ALD2WMLA.mjs → chunk-WXHDVXJE.mjs} +2 -2
- package/dist/{chunk-EVCQX243.cjs → chunk-X2EL3BLH.cjs} +2 -2
- package/dist/{chunk-EA5PMJDU.mjs → chunk-X3HOVNHI.mjs} +1 -1
- package/dist/{chunk-XXB37YET.cjs → chunk-XLRLSTJ6.cjs} +7 -7
- package/dist/{chunk-DRFADSKY.mjs → chunk-XXXRRVY6.mjs} +4 -4
- package/dist/{chunk-EXHEPWFJ.cjs → chunk-YAXOEAND.cjs} +10 -10
- package/dist/{chunk-PEHL3IZL.cjs → chunk-YB44NKC2.cjs} +2 -2
- package/dist/chunk-YKHRCY4T.cjs +73 -0
- package/dist/{chunk-NIPKC4DA.mjs → chunk-ZIBIE7AH.mjs} +72 -0
- package/dist/{chunk-N7SPZJLY.mjs → chunk-ZLOQQ2UF.mjs} +33 -31
- package/dist/client/lifecycle.d.mts +1 -1
- package/dist/client/lifecycle.d.ts +1 -1
- package/dist/{client-plugins-DqjCsKMN.d.ts → client-plugins-BPfltM5m.d.ts} +19 -10
- package/dist/{client-plugins-BlEzV5FO.d.mts → client-plugins-D4RO59f0.d.mts} +19 -10
- package/dist/client-plugins.d.mts +6 -6
- package/dist/client-plugins.d.ts +6 -6
- package/dist/client.cjs +11 -8
- package/dist/client.d.mts +11 -10
- package/dist/client.d.ts +11 -10
- package/dist/client.mjs +12 -9
- package/dist/client.react-server.mjs +1 -1
- package/dist/config-CnhyvvmT.d.mts +188 -0
- package/dist/config-CnhyvvmT.d.ts +188 -0
- package/dist/config.d.mts +6 -6
- package/dist/config.d.ts +6 -6
- package/dist/desktop.d.mts +7 -7
- package/dist/desktop.d.ts +7 -7
- package/dist/{dev-guard-MPZUJFIV.mjs → dev-guard-4PFQNXQX.mjs} +4 -2
- package/dist/{dev-guard-4NQ3LFO5.cjs → dev-guard-YLO5DE3H.cjs} +7 -5
- package/dist/{devtools-A37WWJZL.cjs → devtools-N5XTOECL.cjs} +8 -8
- package/dist/{devtools-BLKHPY3C.mjs → devtools-STG7HPRV.mjs} +7 -7
- package/dist/docs.cjs +10 -10
- package/dist/docs.d.mts +7 -7
- package/dist/docs.d.ts +7 -7
- package/dist/docs.mjs +9 -9
- package/dist/environment/vite.d.mts +1 -1
- package/dist/environment/vite.d.ts +1 -1
- package/dist/generate-route-types-DQP0cUzk.d.ts +33 -0
- package/dist/generate-route-types-TF5Wwtvz.d.mts +33 -0
- package/dist/i18n/client.d.mts +2 -2
- package/dist/i18n/client.d.ts +2 -2
- package/dist/i18n/index.d.mts +3 -3
- package/dist/i18n/index.d.ts +3 -3
- package/dist/i18n/server.d.mts +5 -5
- package/dist/i18n/server.d.ts +5 -5
- package/dist/image/server.cjs +3 -3
- package/dist/image/server.mjs +2 -2
- package/dist/image/sharp.cjs +10 -10
- package/dist/image/sharp.mjs +2 -2
- package/dist/{index-CMigAr9f.d.mts → index-C-N3Pwg-.d.ts} +2 -2
- package/dist/{index-MocnSP3a.d.ts → index-D3l4tREW.d.ts} +2 -2
- package/dist/{index-Cl3akY5U.d.mts → index-DPUAPho_.d.mts} +2 -2
- package/dist/{index-n3hjOvVC.d.ts → index-k8o8eUOd.d.mts} +2 -2
- package/dist/index.cjs +73 -66
- package/dist/index.d.mts +29 -45
- package/dist/index.d.ts +29 -45
- package/dist/index.mjs +78 -71
- package/dist/integrations.cjs +3 -3
- package/dist/integrations.d.mts +6 -6
- package/dist/integrations.d.ts +6 -6
- package/dist/integrations.mjs +2 -2
- package/dist/internal/app-markdown-runtime.d.mts +7 -7
- package/dist/internal/app-markdown-runtime.d.ts +7 -7
- package/dist/internal/build-runtime.cjs +36 -32
- package/dist/internal/build-runtime.d.mts +9 -9
- package/dist/internal/build-runtime.d.ts +9 -9
- package/dist/internal/build-runtime.mjs +35 -31
- package/dist/internal/cli-runtime.cjs +16 -15
- package/dist/internal/cli-runtime.mjs +16 -15
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +19 -2
- package/dist/internal/client-runtime.d.mts +45 -3
- package/dist/internal/client-runtime.d.ts +45 -3
- package/dist/internal/client-runtime.mjs +19 -2
- package/dist/internal/compression-runtime.d.mts +6 -6
- package/dist/internal/compression-runtime.d.ts +6 -6
- package/dist/internal/config-runtime.cjs +17 -10
- package/dist/internal/config-runtime.d.mts +259 -18
- package/dist/internal/config-runtime.d.ts +259 -18
- package/dist/internal/config-runtime.mjs +15 -8
- package/dist/internal/desktop-guard.cjs +2 -2
- package/dist/internal/desktop-guard.d.mts +7 -0
- package/dist/internal/desktop-guard.d.ts +7 -0
- package/dist/internal/desktop-guard.mjs +1 -1
- package/dist/internal/form-actions.cjs +4 -4
- package/dist/internal/form-actions.mjs +3 -3
- package/dist/internal/infra-analytics-runtime.cjs +6 -6
- package/dist/internal/infra-analytics-runtime.mjs +4 -4
- package/dist/internal/islands-runtime.cjs +4 -1
- package/dist/internal/islands-runtime.d.mts +9 -12
- package/dist/internal/islands-runtime.d.ts +9 -12
- package/dist/internal/islands-runtime.mjs +5 -2
- package/dist/internal/metadata-image-runtime.cjs +3 -3
- package/dist/internal/metadata-image-runtime.mjs +2 -2
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +13 -13
- package/dist/internal/production-runtime.d.mts +19 -19
- package/dist/internal/production-runtime.d.ts +19 -19
- package/dist/internal/production-runtime.mjs +15 -15
- package/dist/{layers-D9fbe-rz.d.ts → layers-CcS42OGR.d.mts} +1 -1
- package/dist/{layers-D9fbe-rz.d.mts → layers-CcS42OGR.d.ts} +1 -1
- package/dist/{lifecycle-DK06VuKP.d.ts → lifecycle-C2aLBOwu.d.mts} +1 -1
- package/dist/{lifecycle-DK06VuKP.d.mts → lifecycle-C2aLBOwu.d.ts} +1 -1
- package/dist/markdown.d.mts +6 -6
- package/dist/markdown.d.ts +6 -6
- package/dist/middleware.cjs +7 -7
- package/dist/middleware.d.mts +8 -8
- package/dist/middleware.d.ts +8 -8
- package/dist/middleware.mjs +6 -6
- package/dist/mobile.cjs +9 -0
- package/dist/mobile.d.mts +67 -0
- package/dist/mobile.d.ts +67 -0
- package/dist/mobile.mjs +9 -0
- package/dist/navigation-delegate-8xg3Zvp4.d.ts +29 -0
- package/dist/navigation-delegate-ji6elCKy.d.mts +29 -0
- package/dist/navigation.cjs +5 -5
- package/dist/navigation.d.mts +9 -9
- package/dist/navigation.d.ts +9 -9
- package/dist/navigation.mjs +4 -4
- package/dist/{nitro-UT2J5A5D.mjs → nitro-2Q5NVY7L.mjs} +2 -2
- package/dist/{nitro-BIXIKJZS.cjs → nitro-YPSZBYDK.cjs} +3 -3
- package/dist/platform.cjs +2 -1
- package/dist/platform.d.mts +4 -3
- package/dist/platform.d.ts +4 -3
- package/dist/platform.mjs +2 -1
- package/dist/{plugin-4KYXV7BB.mjs → plugin-53SY5YBS.mjs} +1 -1
- package/dist/{plugin-WBANOZQM.cjs → plugin-HZIBL3DW.cjs} +2 -2
- package/dist/plugin.cjs +31 -29
- package/dist/plugin.d.mts +13 -8
- package/dist/plugin.d.ts +13 -8
- package/dist/plugin.mjs +30 -28
- package/dist/{production-runtime-bWZJMcQb.d.mts → production-runtime-DXnQQkQf.d.mts} +3 -3
- package/dist/{production-runtime-YVDGYWBG.d.ts → production-runtime-TdKaYRj0.d.ts} +3 -3
- package/dist/production-vite-BQFAlG7n.d.mts +13 -0
- package/dist/production-vite-BQFAlG7n.d.ts +13 -0
- package/dist/{programmatic-routes-client-DviwGeAv.d.ts → programmatic-routes-client-BwiTndEC.d.ts} +2 -2
- package/dist/{programmatic-routes-client-BFKOTEXN.d.mts → programmatic-routes-client-Dh1SDLSM.d.mts} +2 -2
- package/dist/query/client.cjs +6 -6
- package/dist/query/client.mjs +2 -2
- package/dist/{render-plan-DqWXo3-B.d.ts → render-plan-BPbwRbuN.d.ts} +1 -1
- package/dist/{render-plan-CS8l0zaK.d.mts → render-plan-BvCGXF6K.d.mts} +1 -1
- package/dist/renderer-client.cjs +9 -6
- package/dist/renderer-client.d.mts +9 -8
- package/dist/renderer-client.d.ts +9 -8
- package/dist/renderer-client.mjs +6 -3
- package/dist/{request-CBrHpaCC.d.ts → request-B8PGTZNR.d.ts} +1 -1
- package/dist/{request-D4XqmnJF.d.mts → request-C_xTkJib.d.mts} +1 -1
- package/dist/request.d.mts +7 -7
- package/dist/request.d.ts +7 -7
- package/dist/{resolver-DC57A4vz.d.ts → resolver-CJ-D9nP-.d.ts} +1 -1
- package/dist/{resolver-C2G-3Tm6.d.mts → resolver-TDyZKgKI.d.mts} +1 -1
- package/dist/{route-rendering-3pRPtyO2.d.mts → route-rendering-DlddURL1.d.mts} +1 -1
- package/dist/{route-rendering-Bltnu8a3.d.ts → route-rendering-RNtcj607.d.ts} +1 -1
- package/dist/{router-BFSmKGtI.d.mts → router-B97eB0Mq.d.mts} +1 -1
- package/dist/{router-DDT7bkg7.d.ts → router-qUVaoEN8.d.ts} +1 -1
- package/dist/routes-8PT9cl60.d.ts +121 -0
- package/dist/routes-kEUsXHx3.d.mts +121 -0
- package/dist/routes.d.mts +6 -6
- package/dist/routes.d.ts +6 -6
- package/dist/{rsc-pipeline-4KOITP64.cjs → rsc-pipeline-L4XOZ2TE.cjs} +13 -10
- package/dist/{rsc-pipeline-ULFIB3UT.mjs → rsc-pipeline-T3775JUA.mjs} +12 -9
- package/dist/runtime-BIBGJO7V.cjs +1005 -0
- package/dist/{runtime-B9HmxiZc.d.ts → runtime-C4CmlOOh.d.ts} +2 -2
- package/dist/{runtime-C6yG64je.d.ts → runtime-C8GUnNeP.d.ts} +1 -1
- package/dist/{runtime-Cpylaypt.d.mts → runtime-CaDswfWi.d.mts} +1 -1
- package/dist/{runtime-CCxTmGuf.d.mts → runtime-CihDZ2Rn.d.mts} +2 -2
- package/dist/runtime-HRSFC4ZC.mjs +1005 -0
- package/dist/{schema-dev-notice-O3I5HLXK.mjs → schema-dev-notice-LZ5NXGLN.mjs} +2 -2
- package/dist/{schema-dev-notice-Z73J3NJ6.cjs → schema-dev-notice-XV7GZ3QJ.cjs} +4 -4
- package/dist/server-action-security.cjs +3 -3
- package/dist/server-action-security.mjs +2 -2
- package/dist/server-fn-client.d.mts +0 -1
- package/dist/server-fn-client.d.ts +0 -1
- package/dist/server-fn.cjs +4 -4
- package/dist/server-fn.d.mts +0 -1
- package/dist/server-fn.d.ts +0 -1
- package/dist/server-fn.mjs +3 -3
- package/dist/server-plugins.cjs +1 -1
- package/dist/server-plugins.d.mts +7 -7
- package/dist/server-plugins.d.ts +7 -7
- package/dist/server-plugins.mjs +1 -1
- package/dist/server-query-client.d.mts +0 -1
- package/dist/server-query-client.d.ts +0 -1
- package/dist/server-query.cjs +5 -5
- package/dist/server-query.d.mts +0 -1
- package/dist/server-query.d.ts +0 -1
- package/dist/server-query.mjs +4 -4
- package/dist/server.cjs +89 -66
- package/dist/server.d.mts +22 -17
- package/dist/server.d.ts +22 -17
- package/dist/server.mjs +64 -41
- package/dist/{spa-router-CkTPnA4L.d.mts → spa-router-Dlv5ofg0.d.mts} +4 -4
- package/dist/{spa-router-CKuS81mi.d.ts → spa-router-qapSboKz.d.ts} +4 -4
- package/dist/testing.cjs +7 -7
- package/dist/testing.d.mts +6 -6
- package/dist/testing.d.ts +6 -6
- package/dist/testing.mjs +5 -5
- package/dist/{types--Wh02r5_.d.mts → types-C41ePjvP.d.mts} +1 -1
- package/dist/{types--Wh02r5_.d.ts → types-C41ePjvP.d.ts} +1 -1
- package/dist/{utils-C0ORLYXc.d.ts → utils-A-cYF81u.d.ts} +1 -1
- package/dist/{utils-IA9wVkef.d.mts → utils-DyvlSxFk.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +31 -29
- package/dist/vite.d.mts +9 -9
- package/dist/vite.d.ts +9 -9
- package/dist/vite.mjs +30 -28
- package/dist/{workflows-Df1C_7OG.d.mts → workflows-CRMzQZ3k.d.mts} +2 -1
- package/dist/{workflows-Df1C_7OG.d.ts → workflows-CRMzQZ3k.d.ts} +2 -1
- package/dist/workflows.cjs +3 -3
- package/dist/workflows.d.mts +1 -1
- package/dist/workflows.d.ts +1 -1
- package/dist/workflows.mjs +2 -2
- package/package.json +10 -2
- package/dist/cache-invalidation-BD0z_lfu.d.mts +0 -4
- package/dist/cache-invalidation-BD0z_lfu.d.ts +0 -4
- package/dist/chunk-45EUIICW.mjs +0 -15
- package/dist/chunk-V7KTQR4C.cjs +0 -15
- package/dist/{chunk-BR5FSKZ5.cjs → chunk-EQWWOQTK.cjs} +0 -0
- package/dist/{chunk-5OJVKXFV.cjs → chunk-N7JQXQAV.cjs} +2 -2
- package/dist/{chunk-VR4SEDEM.mjs → chunk-VOZ5DI7D.mjs} +0 -0
- package/dist/{chunk-72KABRWN.mjs → chunk-WSDKXV4E.mjs} +4 -4
|
@@ -1,12 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createRouteTypeDeclarations,
|
|
3
|
+
generateRouteTypes
|
|
4
|
+
} from "./chunk-2G63BIRL.mjs";
|
|
1
5
|
import {
|
|
2
6
|
readSchemaTables
|
|
3
7
|
} from "./chunk-2DLGV2ZG.mjs";
|
|
4
|
-
import {
|
|
5
|
-
APITypeGenerator
|
|
6
|
-
} from "./chunk-HPP2II4Z.mjs";
|
|
7
8
|
import {
|
|
8
9
|
resolveSchemaModels
|
|
9
10
|
} from "./chunk-F3N52U7S.mjs";
|
|
11
|
+
import {
|
|
12
|
+
APITypeGenerator
|
|
13
|
+
} from "./chunk-HPP2II4Z.mjs";
|
|
10
14
|
import {
|
|
11
15
|
getOptionalCatchAllParameterNames,
|
|
12
16
|
materializeSSGRoutePath,
|
|
@@ -20,28 +24,16 @@ import {
|
|
|
20
24
|
import {
|
|
21
25
|
writeFileIfChanged
|
|
22
26
|
} from "./chunk-Q5B4LNON.mjs";
|
|
23
|
-
import {
|
|
24
|
-
resolveFarmComponentExtensions
|
|
25
|
-
} from "./chunk-ES2LD2YD.mjs";
|
|
26
27
|
import {
|
|
27
28
|
getFarmAppDirectories,
|
|
28
29
|
getFarmSourceRoots
|
|
29
30
|
} from "./chunk-52Y3C3HG.mjs";
|
|
30
|
-
import {
|
|
31
|
-
parseRouteSlotFile
|
|
32
|
-
} from "./chunk-CBJKDB6F.mjs";
|
|
33
|
-
import {
|
|
34
|
-
discoverProgrammaticRoutePaths
|
|
35
|
-
} from "./chunk-2H3FJYY6.mjs";
|
|
36
31
|
import {
|
|
37
32
|
readFarmI18nCatalogs
|
|
38
33
|
} from "./chunk-DU4VHHPJ.mjs";
|
|
39
34
|
import {
|
|
40
35
|
resolvePluginRoutes
|
|
41
36
|
} from "./chunk-R62SF5R4.mjs";
|
|
42
|
-
import {
|
|
43
|
-
parseRoutePath
|
|
44
|
-
} from "./chunk-2SVJGOAX.mjs";
|
|
45
37
|
|
|
46
38
|
// src/ssg.ts
|
|
47
39
|
import { readFileSync } from "fs";
|
|
@@ -511,163 +503,13 @@ function matchSSGPage(urlPath, ssgPages) {
|
|
|
511
503
|
return ssgPages.find((page) => page.urlPath === normalizedPath);
|
|
512
504
|
}
|
|
513
505
|
|
|
514
|
-
// src/routing/generate-route-types.ts
|
|
515
|
-
import * as path from "path";
|
|
516
|
-
import * as fs from "fs";
|
|
517
|
-
function routeSegmentsToTsTypeLiteral(segments) {
|
|
518
|
-
if (segments.length === 0) return '"/"';
|
|
519
|
-
const hasDynamic = segments.some((s) => s.startsWith("["));
|
|
520
|
-
if (!hasDynamic) return JSON.stringify("/" + segments.join("/"));
|
|
521
|
-
const parts = segments.map((s) => {
|
|
522
|
-
if (s.startsWith("[[...") || s.startsWith("[...")) return "${string}";
|
|
523
|
-
if (s.startsWith("[")) return "${string}";
|
|
524
|
-
return s;
|
|
525
|
-
});
|
|
526
|
-
return "`/" + parts.join("/") + "`";
|
|
527
|
-
}
|
|
528
|
-
function routePatternToTsTypeLiterals(pattern) {
|
|
529
|
-
if (pattern === "/") return ['"/"'];
|
|
530
|
-
let variants = [[]];
|
|
531
|
-
for (const segment of pattern.slice(1).split("/").filter(Boolean)) {
|
|
532
|
-
if (segment.startsWith("[[...") && segment.endsWith("]]")) {
|
|
533
|
-
variants = variants.flatMap((parts) => [parts, [...parts, segment]]);
|
|
534
|
-
} else {
|
|
535
|
-
variants = variants.map((parts) => [...parts, segment]);
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
return variants.map(routeSegmentsToTsTypeLiteral);
|
|
539
|
-
}
|
|
540
|
-
function routePatternToRouteLiteral(pattern) {
|
|
541
|
-
return JSON.stringify(pattern);
|
|
542
|
-
}
|
|
543
|
-
function renderTypeUnion(values) {
|
|
544
|
-
return values.length <= 1 ? values[0] || "never" : `
|
|
545
|
-
| ${values.join("\n | ")}`;
|
|
546
|
-
}
|
|
547
|
-
function renderTypeAlias(name, value) {
|
|
548
|
-
return `export type ${name} =${value.startsWith("\n") ? "" : " "}${value};`;
|
|
549
|
-
}
|
|
550
|
-
function createRoutePattern(route) {
|
|
551
|
-
if (route.segments.length === 0) return "/";
|
|
552
|
-
return "/" + route.segments.map((seg) => {
|
|
553
|
-
if (!seg.isDynamic) return seg.segment;
|
|
554
|
-
if (seg.isCatchAll) return seg.isOptional ? `[[...${seg.segment}]]` : `[...${seg.segment}]`;
|
|
555
|
-
return `[${seg.segment}]`;
|
|
556
|
-
}).join("/");
|
|
557
|
-
}
|
|
558
|
-
var DEFAULT_OUT_FILE = "farm-routes.d.ts";
|
|
559
|
-
async function generateRouteTypes(options) {
|
|
560
|
-
const root = path.resolve(options.root);
|
|
561
|
-
const srcDir = options.srcDir || "src";
|
|
562
|
-
const outFile = options.outFile || DEFAULT_OUT_FILE;
|
|
563
|
-
const outPath = path.isAbsolute(outFile) ? outFile : path.join(root, srcDir, outFile);
|
|
564
|
-
const content = await createRouteTypeDeclarations(options, outPath);
|
|
565
|
-
fs.mkdirSync(path.dirname(outPath), { recursive: true });
|
|
566
|
-
writeFileIfChanged(outPath, content);
|
|
567
|
-
return outPath;
|
|
568
|
-
}
|
|
569
|
-
async function createRouteTypeDeclarations(options, outPath) {
|
|
570
|
-
const { root, srcDir = "src", extraRoutes = [], suppressLintOnLink = false } = options;
|
|
571
|
-
const sourceRoots = options.sourceRoots ?? [{ name: "project", root, srcDir, layer: false }];
|
|
572
|
-
const componentExtensions = resolveFarmComponentExtensions(options.componentExtensions).map(
|
|
573
|
-
(extension) => extension.slice(1)
|
|
574
|
-
);
|
|
575
|
-
const patterns = /* @__PURE__ */ new Set();
|
|
576
|
-
const routeModulePatterns = /* @__PURE__ */ new Set();
|
|
577
|
-
const glob = await import("fast-glob");
|
|
578
|
-
for (const source of sourceRoots) {
|
|
579
|
-
const appDir = path.join(source.root, source.srcDir, "app");
|
|
580
|
-
if (fs.existsSync(appDir)) {
|
|
581
|
-
const routeModuleFiles = await glob.default(
|
|
582
|
-
`**/{page,layout,loading,error}.{${componentExtensions.join(",")},md,mdx}`,
|
|
583
|
-
{
|
|
584
|
-
cwd: appDir,
|
|
585
|
-
absolute: false
|
|
586
|
-
}
|
|
587
|
-
);
|
|
588
|
-
for (const file of routeModuleFiles) {
|
|
589
|
-
if (parseRouteSlotFile(file)) continue;
|
|
590
|
-
const route = parseRoutePath(file);
|
|
591
|
-
const pattern = createRoutePattern(route);
|
|
592
|
-
routeModulePatterns.add(pattern);
|
|
593
|
-
if (route.type === "page") {
|
|
594
|
-
patterns.add(pattern);
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
for (const route of await discoverProgrammaticRoutePaths(source.root, source.srcDir)) {
|
|
599
|
-
patterns.add(route);
|
|
600
|
-
routeModulePatterns.add(route);
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
for (const route of extraRoutes) {
|
|
604
|
-
if (route.startsWith("/")) {
|
|
605
|
-
patterns.add(route);
|
|
606
|
-
routeModulePatterns.add(route);
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
const sortedPatterns = Array.from(patterns).sort();
|
|
610
|
-
const typeLiterals = Array.from(new Set(sortedPatterns.flatMap(routePatternToTsTypeLiterals)));
|
|
611
|
-
const patternLiterals = sortedPatterns.map(routePatternToRouteLiteral);
|
|
612
|
-
const routeModulePatternLiterals = Array.from(routeModulePatterns).sort().map(routePatternToRouteLiteral);
|
|
613
|
-
const routePathType = suppressLintOnLink ? "string" : renderTypeUnion(typeLiterals);
|
|
614
|
-
const routePatternType = suppressLintOnLink ? "string" : renderTypeUnion(patternLiterals);
|
|
615
|
-
const routeModulePatternType = renderTypeUnion(routeModulePatternLiterals);
|
|
616
|
-
const routeTypesImportPath = `./${path.basename(outPath).replace(/\.d\.ts$/, "")}`;
|
|
617
|
-
const linkAugmentationBlock = suppressLintOnLink ? "" : `
|
|
618
|
-
declare module "@farm.js/core/client" {
|
|
619
|
-
interface LinkDefaultRoute {
|
|
620
|
-
_: import(${JSON.stringify(routeTypesImportPath)}).RoutePath;
|
|
621
|
-
pattern: import(${JSON.stringify(routeTypesImportPath)}).RoutePattern;
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
declare module "@farm.js/core" {
|
|
626
|
-
interface LinkDefaultRoute {
|
|
627
|
-
_: import(${JSON.stringify(routeTypesImportPath)}).RoutePath;
|
|
628
|
-
pattern: import(${JSON.stringify(routeTypesImportPath)}).RoutePattern;
|
|
629
|
-
}
|
|
630
|
-
// Ensure root import ("@farm.js/core") uses the same typed Link signature as client entry.
|
|
631
|
-
const Link: typeof import("@farm.js/core/client").Link;
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
// Internal declaration path used by @farm.js/core root type re-exports.
|
|
635
|
-
declare module "@farm.js/core/dist/client.js" {
|
|
636
|
-
interface LinkDefaultRoute {
|
|
637
|
-
_: import(${JSON.stringify(routeTypesImportPath)}).RoutePath;
|
|
638
|
-
pattern: import(${JSON.stringify(routeTypesImportPath)}).RoutePattern;
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
|
-
`;
|
|
642
|
-
const routeModuleAugmentationBlock = `
|
|
643
|
-
declare global {
|
|
644
|
-
namespace FarmJS {
|
|
645
|
-
interface RouteRegistry {
|
|
646
|
-
pattern: import(${JSON.stringify(routeTypesImportPath)}).RouteModulePattern;
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
`;
|
|
651
|
-
const content = `/**
|
|
652
|
-
* Auto-generated route types from src/app.
|
|
653
|
-
* Link href and route component props are typed automatically from generated declarations.
|
|
654
|
-
* Regenerated on dev start and when routes change.
|
|
655
|
-
* Set suppressLintOnLink: true in farm.config.ts to accept any string on Link href.
|
|
656
|
-
*/
|
|
657
|
-
${renderTypeAlias("RoutePath", routePathType)}
|
|
658
|
-
${renderTypeAlias("RoutePattern", routePatternType)}
|
|
659
|
-
${renderTypeAlias("RouteModulePattern", routeModulePatternType)}${linkAugmentationBlock}${routeModuleAugmentationBlock}
|
|
660
|
-
`;
|
|
661
|
-
return content;
|
|
662
|
-
}
|
|
663
|
-
|
|
664
506
|
// src/image-types.ts
|
|
665
|
-
import { mkdirSync
|
|
666
|
-
import
|
|
507
|
+
import { mkdirSync } from "fs";
|
|
508
|
+
import path from "path";
|
|
667
509
|
var FARM_STATIC_IMAGE_EXTENSIONS = ["avif", "gif", "jpeg", "jpg", "png", "webp"];
|
|
668
510
|
function generateFarmImageTypes(options) {
|
|
669
|
-
const outputPath = options.outFile ?
|
|
670
|
-
|
|
511
|
+
const outputPath = options.outFile ? path.resolve(options.root, options.outFile) : path.join(options.root, options.srcDir || "src", "farm-images.d.ts");
|
|
512
|
+
mkdirSync(path.dirname(outputPath), { recursive: true });
|
|
671
513
|
writeFileIfChanged(outputPath, createFarmImageTypeDeclarations());
|
|
672
514
|
return outputPath;
|
|
673
515
|
}
|
|
@@ -693,14 +535,14 @@ declare module "*?url" {
|
|
|
693
535
|
}
|
|
694
536
|
|
|
695
537
|
// src/i18n/type-generator.ts
|
|
696
|
-
import { mkdirSync as
|
|
697
|
-
import { dirname
|
|
538
|
+
import { mkdirSync as mkdirSync2 } from "fs";
|
|
539
|
+
import { dirname, join, resolve } from "path";
|
|
698
540
|
async function generateFarmI18nTypes(options) {
|
|
699
541
|
if (!options.config.enabled) return void 0;
|
|
700
542
|
const { signatures } = await readFarmI18nCatalogs(options.config);
|
|
701
|
-
const outFile = options.outFile ?
|
|
543
|
+
const outFile = options.outFile ? resolve(options.root, options.outFile) : join(resolve(options.root), options.srcDir || "src", "farm-i18n.d.ts");
|
|
702
544
|
const content = renderFarmI18nTypes(options.config.locales, signatures);
|
|
703
|
-
|
|
545
|
+
mkdirSync2(dirname(outFile), { recursive: true });
|
|
704
546
|
writeFileIfChanged(outFile, content);
|
|
705
547
|
return outFile;
|
|
706
548
|
}
|
|
@@ -743,12 +585,12 @@ function argumentType(kind) {
|
|
|
743
585
|
}
|
|
744
586
|
|
|
745
587
|
// src/type-artifacts.ts
|
|
746
|
-
import { existsSync as
|
|
747
|
-
import { dirname as
|
|
588
|
+
import { existsSync as existsSync2, mkdirSync as mkdirSync3, readFileSync as readFileSync2, unlinkSync } from "fs";
|
|
589
|
+
import { dirname as dirname3, isAbsolute as isAbsolute2, join as join3, resolve as resolve3 } from "path";
|
|
748
590
|
|
|
749
591
|
// src/content-types.ts
|
|
750
|
-
import * as
|
|
751
|
-
import * as
|
|
592
|
+
import * as fs from "fs";
|
|
593
|
+
import * as path2 from "path";
|
|
752
594
|
var CONFIG_FILENAMES = [
|
|
753
595
|
"farm.config.ts",
|
|
754
596
|
"farm.config.tsx",
|
|
@@ -768,10 +610,10 @@ var CONFIG_FILENAMES = [
|
|
|
768
610
|
"config.cjs"
|
|
769
611
|
];
|
|
770
612
|
function createContentTypeDeclarations(options, outPath) {
|
|
771
|
-
const root =
|
|
613
|
+
const root = path2.resolve(options.root);
|
|
772
614
|
const projectConfig = findConfigPath(root, options.configPath);
|
|
773
615
|
const configPaths = [
|
|
774
|
-
...(options.layerConfigPaths ?? []).filter((value) =>
|
|
616
|
+
...(options.layerConfigPaths ?? []).filter((value) => fs.existsSync(value)),
|
|
775
617
|
...projectConfig ? [projectConfig] : []
|
|
776
618
|
];
|
|
777
619
|
if (configPaths.length === 0) return createEmptyContentTypes();
|
|
@@ -839,17 +681,17 @@ export {};
|
|
|
839
681
|
}
|
|
840
682
|
function findConfigPath(root, configPath) {
|
|
841
683
|
if (configPath) {
|
|
842
|
-
const resolvedPath =
|
|
843
|
-
return
|
|
684
|
+
const resolvedPath = path2.isAbsolute(configPath) ? configPath : path2.join(root, configPath);
|
|
685
|
+
return fs.existsSync(resolvedPath) ? resolvedPath : null;
|
|
844
686
|
}
|
|
845
687
|
for (const filename of CONFIG_FILENAMES) {
|
|
846
|
-
const resolvedPath =
|
|
847
|
-
if (
|
|
688
|
+
const resolvedPath = path2.join(root, filename);
|
|
689
|
+
if (fs.existsSync(resolvedPath)) return resolvedPath;
|
|
848
690
|
}
|
|
849
691
|
return null;
|
|
850
692
|
}
|
|
851
693
|
function toTypeImportPath(outPath, targetPath) {
|
|
852
|
-
const relativePath =
|
|
694
|
+
const relativePath = path2.relative(path2.dirname(outPath), targetPath).replace(/\\/g, "/").replace(/\.(tsx?|jsx?|mjs|cjs|mts|cts)$/, "");
|
|
853
695
|
return relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
854
696
|
}
|
|
855
697
|
|
|
@@ -925,7 +767,7 @@ function propertyName(key) {
|
|
|
925
767
|
|
|
926
768
|
// src/type-artifacts.ts
|
|
927
769
|
async function generateFarmTypeArtifacts(options) {
|
|
928
|
-
const root =
|
|
770
|
+
const root = resolve3(options.root);
|
|
929
771
|
const srcDir = options.srcDir || "src";
|
|
930
772
|
const shouldGenerateRoutes = options.routes !== false;
|
|
931
773
|
const shouldGenerateApi = options.api !== false;
|
|
@@ -938,7 +780,7 @@ async function generateFarmTypeArtifacts(options) {
|
|
|
938
780
|
apiRoutes: [],
|
|
939
781
|
stalePaths: []
|
|
940
782
|
};
|
|
941
|
-
const unifiedTypesPath =
|
|
783
|
+
const unifiedTypesPath = join3(root, srcDir, "farm.d.ts");
|
|
942
784
|
const shouldRefreshUnifiedTypes = shouldGenerateRoutes && !options.routeTypesOutFile || shouldGenerateEnv && !options.envTypesOutFile || shouldGenerateI18n && !options.i18nTypesOutFile;
|
|
943
785
|
const unifiedSections = [];
|
|
944
786
|
if (shouldRefreshUnifiedTypes && !options.routeTypesOutFile) {
|
|
@@ -974,11 +816,11 @@ async function generateFarmTypeArtifacts(options) {
|
|
|
974
816
|
if (shouldGenerateApi) {
|
|
975
817
|
const generator = new APITypeGenerator(appDirs);
|
|
976
818
|
const apiRoutes = generator.scanAPIRoutes();
|
|
977
|
-
const apiTypesPath = options.apiTypesOutFile ?
|
|
819
|
+
const apiTypesPath = options.apiTypesOutFile ? resolve3(root, options.apiTypesOutFile) : join3(root, srcDir, "lib", "api.generated.ts");
|
|
978
820
|
const pluginRoutes = resolvePluginRoutes(options.plugins);
|
|
979
821
|
const configFiles = [
|
|
980
822
|
...(options.layers ?? []).map((layer) => layer.configFile).filter((file) => Boolean(file)),
|
|
981
|
-
options.configPath ?
|
|
823
|
+
options.configPath ? resolve3(root, options.configPath) : [
|
|
982
824
|
"farm.config.ts",
|
|
983
825
|
"farm.config.mts",
|
|
984
826
|
"farm.config.js",
|
|
@@ -987,14 +829,14 @@ async function generateFarmTypeArtifacts(options) {
|
|
|
987
829
|
"farm.config.cjs",
|
|
988
830
|
"config.ts",
|
|
989
831
|
"config.js"
|
|
990
|
-
].map((name) =>
|
|
832
|
+
].map((name) => join3(root, name)).find((file) => existsSync2(file))
|
|
991
833
|
].filter((file) => Boolean(file));
|
|
992
834
|
if (pluginRoutes.length && !configFiles.length) {
|
|
993
835
|
throw new Error(
|
|
994
836
|
"Cannot generate plugin API types without a Farm config file. Pass configPath."
|
|
995
837
|
);
|
|
996
838
|
}
|
|
997
|
-
if (apiRoutes.length > 0 || pluginRoutes.length > 0 ||
|
|
839
|
+
if (apiRoutes.length > 0 || pluginRoutes.length > 0 || existsSync2(apiTypesPath)) {
|
|
998
840
|
const content = generator.generateAPIRouter(apiRoutes, {
|
|
999
841
|
outFile: apiTypesPath,
|
|
1000
842
|
pluginConfigs: pluginRoutes.length ? [...new Set(configFiles)] : [],
|
|
@@ -1119,19 +961,19 @@ function normalizeUnifiedTypeSection(section) {
|
|
|
1119
961
|
return section.trimEnd().replace(/\n+export \{\};$/, "");
|
|
1120
962
|
}
|
|
1121
963
|
function resolveGeneratedPath(root, srcDir, outFile, relativeToSrc = true) {
|
|
1122
|
-
if (
|
|
1123
|
-
return
|
|
964
|
+
if (isAbsolute2(outFile)) return resolve3(outFile);
|
|
965
|
+
return resolve3(root, relativeToSrc ? join3(srcDir, outFile) : outFile);
|
|
1124
966
|
}
|
|
1125
967
|
function writeOrCheckGeneratedFile(filePath, content, check, stalePaths) {
|
|
1126
968
|
if (check) {
|
|
1127
969
|
checkGeneratedFile(filePath, content, stalePaths);
|
|
1128
970
|
return;
|
|
1129
971
|
}
|
|
1130
|
-
|
|
972
|
+
mkdirSync3(dirname3(filePath), { recursive: true });
|
|
1131
973
|
writeFileIfChanged(filePath, content);
|
|
1132
974
|
}
|
|
1133
975
|
function checkGeneratedFile(filePath, content, stalePaths) {
|
|
1134
|
-
if (!
|
|
976
|
+
if (!existsSync2(filePath) || readFileSync2(filePath, "utf8") !== content) {
|
|
1135
977
|
stalePaths.push(filePath);
|
|
1136
978
|
}
|
|
1137
979
|
}
|
|
@@ -1143,8 +985,8 @@ var LEGACY_TYPE_ARTIFACTS = [
|
|
|
1143
985
|
];
|
|
1144
986
|
function removeLegacyTypeArtifacts(root, srcDir) {
|
|
1145
987
|
for (const [fileName, marker] of LEGACY_TYPE_ARTIFACTS) {
|
|
1146
|
-
const filePath =
|
|
1147
|
-
if (!
|
|
988
|
+
const filePath = join3(root, srcDir, fileName);
|
|
989
|
+
if (!existsSync2(filePath)) continue;
|
|
1148
990
|
const source = readFileSync2(filePath, "utf8");
|
|
1149
991
|
if (source.includes(marker)) {
|
|
1150
992
|
unlinkSync(filePath);
|
|
@@ -1153,8 +995,8 @@ function removeLegacyTypeArtifacts(root, srcDir) {
|
|
|
1153
995
|
}
|
|
1154
996
|
function collectLegacyTypeArtifacts(root, srcDir, stalePaths) {
|
|
1155
997
|
for (const [fileName, marker] of LEGACY_TYPE_ARTIFACTS) {
|
|
1156
|
-
const filePath =
|
|
1157
|
-
if (!
|
|
998
|
+
const filePath = join3(root, srcDir, fileName);
|
|
999
|
+
if (!existsSync2(filePath)) continue;
|
|
1158
1000
|
if (readFileSync2(filePath, "utf8").includes(marker)) stalePaths.push(filePath);
|
|
1159
1001
|
}
|
|
1160
1002
|
}
|
|
@@ -1173,7 +1015,6 @@ export {
|
|
|
1173
1015
|
hasPPR,
|
|
1174
1016
|
generateSSGManifest,
|
|
1175
1017
|
matchSSGPage,
|
|
1176
|
-
generateRouteTypes,
|
|
1177
1018
|
generateFarmImageTypes,
|
|
1178
1019
|
createFarmImageTypeDeclarations,
|
|
1179
1020
|
generateFarmI18nTypes,
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createPlatformBlockChecker,
|
|
3
|
+
isPlainObject,
|
|
4
|
+
readAppPackageJson,
|
|
5
|
+
resolveAppPackageName,
|
|
6
|
+
resolvePlatformBlock,
|
|
7
|
+
resolvePlatformProfile
|
|
8
|
+
} from "./chunk-UB7RVEMX.mjs";
|
|
9
|
+
|
|
1
10
|
// src/desktop/config.ts
|
|
2
|
-
import { existsSync
|
|
11
|
+
import { existsSync } from "fs";
|
|
3
12
|
import * as path from "path";
|
|
4
13
|
var FARM_PLATFORM_ENV = "FARM_PLATFORM";
|
|
5
14
|
var FARM_DESKTOP_DEV_SESSION = /* @__PURE__ */ Symbol.for("@farm.js/core/desktop-dev-session");
|
|
@@ -9,33 +18,18 @@ function setFarmDesktopDevSession(session) {
|
|
|
9
18
|
else delete store[FARM_DESKTOP_DEV_SESSION];
|
|
10
19
|
}
|
|
11
20
|
function resolveFarmPlatform(env = process.env) {
|
|
12
|
-
|
|
21
|
+
const value = env[FARM_PLATFORM_ENV];
|
|
22
|
+
return value === "desktop" || value === "mobile" ? value : "web";
|
|
13
23
|
}
|
|
14
24
|
var DESKTOP_KEYS = /* @__PURE__ */ new Set(["name", "id", "version", "icon", "window", "shell"]);
|
|
15
25
|
var WINDOW_KEYS = /* @__PURE__ */ new Set(["width", "height", "title"]);
|
|
16
26
|
var APP_ID = /^[A-Za-z][A-Za-z0-9-]*(?:\.[A-Za-z0-9][A-Za-z0-9-]*)+$/;
|
|
17
27
|
var SHELL_NAME = /^[a-z][a-z0-9-]*$/;
|
|
18
28
|
var SHELL_PACKAGE = /^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*(?:\/[a-z0-9][a-z0-9._-]*)*$/;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
throw new TypeError(`${failPrefix}: ${message}`);
|
|
22
|
-
}
|
|
23
|
-
function isPlainObject(value) {
|
|
24
|
-
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
25
|
-
}
|
|
26
|
-
function checkKeys(value, allowed, where) {
|
|
27
|
-
for (const key of Object.keys(value)) {
|
|
28
|
-
if (!allowed.has(key)) {
|
|
29
|
-
fail(`unknown option ${where}${key}. Supported: ${[...allowed].join(", ")}.`);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
function optionalString(value, key) {
|
|
34
|
-
if (value === void 0) return void 0;
|
|
35
|
-
if (typeof value !== "string" || !value.trim()) fail(`${key} must be a non-empty string.`);
|
|
36
|
-
return value.trim();
|
|
29
|
+
function desktopChecker(context) {
|
|
30
|
+
return createPlatformBlockChecker(context ? `desktop (os: ${context.os})` : "desktop");
|
|
37
31
|
}
|
|
38
|
-
function optionalSize(value, key) {
|
|
32
|
+
function optionalSize({ fail }, value, key) {
|
|
39
33
|
if (value === void 0) return void 0;
|
|
40
34
|
if (typeof value !== "number" || !Number.isInteger(value) || value < 100 || value > 16384) {
|
|
41
35
|
fail(`${key} must be a whole number of points between 100 and 16384.`);
|
|
@@ -43,7 +37,11 @@ function optionalSize(value, key) {
|
|
|
43
37
|
return value;
|
|
44
38
|
}
|
|
45
39
|
function validateFarmDesktopConfig(input, context) {
|
|
46
|
-
|
|
40
|
+
const check = desktopChecker(context);
|
|
41
|
+
const { checkKeys, optionalString } = check;
|
|
42
|
+
function fail(message) {
|
|
43
|
+
return check.fail(message);
|
|
44
|
+
}
|
|
47
45
|
if (input === void 0) return void 0;
|
|
48
46
|
if (!isPlainObject(input)) {
|
|
49
47
|
fail(
|
|
@@ -64,8 +62,8 @@ function validateFarmDesktopConfig(input, context) {
|
|
|
64
62
|
if (input.window !== void 0) {
|
|
65
63
|
if (!isPlainObject(input.window)) fail("window must be an object, such as { width: 1024 }.");
|
|
66
64
|
checkKeys(input.window, WINDOW_KEYS, "window.");
|
|
67
|
-
optionalSize(input.window.width, "window.width");
|
|
68
|
-
optionalSize(input.window.height, "window.height");
|
|
65
|
+
optionalSize(check, input.window.width, "window.width");
|
|
66
|
+
optionalSize(check, input.window.height, "window.height");
|
|
69
67
|
optionalString(input.window.title, "window.title");
|
|
70
68
|
}
|
|
71
69
|
const shell = optionalString(input.shell, "shell");
|
|
@@ -77,14 +75,6 @@ function validateFarmDesktopConfig(input, context) {
|
|
|
77
75
|
}
|
|
78
76
|
return input;
|
|
79
77
|
}
|
|
80
|
-
function readPackageJson(root) {
|
|
81
|
-
try {
|
|
82
|
-
const parsed = JSON.parse(readFileSync(path.join(root, "package.json"), "utf8"));
|
|
83
|
-
return isPlainObject(parsed) ? parsed : {};
|
|
84
|
-
} catch {
|
|
85
|
-
return {};
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
78
|
function slug(value) {
|
|
89
79
|
return value.replace(/^@[^/]+\//, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "app";
|
|
90
80
|
}
|
|
@@ -93,12 +83,13 @@ function resolveFarmDesktopShellPackage(shell) {
|
|
|
93
83
|
}
|
|
94
84
|
function resolveFarmDesktopConfig(input, root, context) {
|
|
95
85
|
const config = validateFarmDesktopConfig(input, context) ?? {};
|
|
96
|
-
const pkg =
|
|
97
|
-
const packageName =
|
|
86
|
+
const pkg = readAppPackageJson(root);
|
|
87
|
+
const packageName = resolveAppPackageName(root, pkg);
|
|
98
88
|
const name = config.name?.trim() || packageName || "Farm App";
|
|
99
89
|
const shell = config.shell?.trim() || "electrobun";
|
|
100
90
|
const icon = config.icon ? path.resolve(root, config.icon.trim()) : void 0;
|
|
101
|
-
if (icon && !existsSync(icon))
|
|
91
|
+
if (icon && !existsSync(icon))
|
|
92
|
+
desktopChecker(context).fail(`icon ${config.icon} was not found in ${root}.`);
|
|
102
93
|
return {
|
|
103
94
|
name,
|
|
104
95
|
id: config.id?.trim() || `local.farm.${slug(name)}`,
|
|
@@ -132,10 +123,7 @@ function createFarmDesktopContext(options) {
|
|
|
132
123
|
if (!DESKTOP_OS.has(os)) {
|
|
133
124
|
throw new TypeError(`--os must be macos, windows, or linux, got "${os}".`);
|
|
134
125
|
}
|
|
135
|
-
const profile = options.profile
|
|
136
|
-
if (typeof profile !== "string" || !/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(profile)) {
|
|
137
|
-
throw new TypeError(`--profile must be a name such as "beta", got "${String(profile)}".`);
|
|
138
|
-
}
|
|
126
|
+
const profile = resolvePlatformProfile(options.profile);
|
|
139
127
|
return Object.freeze({
|
|
140
128
|
os,
|
|
141
129
|
mode: options.mode,
|
|
@@ -146,26 +134,12 @@ function createFarmDesktopContext(options) {
|
|
|
146
134
|
});
|
|
147
135
|
}
|
|
148
136
|
async function resolveFarmDesktopBlock(input, context, cache) {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
context.os,
|
|
156
|
-
context.mode,
|
|
157
|
-
context.command,
|
|
158
|
-
context.profile,
|
|
159
|
-
context.root,
|
|
160
|
-
String(input)
|
|
161
|
-
].join("\0");
|
|
162
|
-
let resolved = cache.get(key);
|
|
163
|
-
if (!resolved) {
|
|
164
|
-
resolved = call();
|
|
165
|
-
cache.set(key, resolved);
|
|
166
|
-
resolved.catch(() => cache.delete(key));
|
|
167
|
-
}
|
|
168
|
-
return resolved;
|
|
137
|
+
return resolvePlatformBlock(
|
|
138
|
+
input,
|
|
139
|
+
context,
|
|
140
|
+
(value, ctx) => validateFarmDesktopConfig(value, ctx) ?? {},
|
|
141
|
+
cache
|
|
142
|
+
);
|
|
169
143
|
}
|
|
170
144
|
var FARM_DESKTOP_SETUP = /* @__PURE__ */ Symbol.for("@farm.js/core/desktop-setup");
|
|
171
145
|
async function createFarmDesktopSetup(userConfig, root, mode, options, cache) {
|
|
@@ -3,8 +3,9 @@ import {
|
|
|
3
3
|
isFarmLocaleChangeHref
|
|
4
4
|
} from "./chunk-PTLXHRJZ.mjs";
|
|
5
5
|
import {
|
|
6
|
-
getHashTargetElement
|
|
7
|
-
|
|
6
|
+
getHashTargetElement,
|
|
7
|
+
runFarmNavigationDelegates
|
|
8
|
+
} from "./chunk-G2KTRMWA.mjs";
|
|
8
9
|
import {
|
|
9
10
|
isFarmBlockedNavigationURL,
|
|
10
11
|
isFarmExternalNavigationURL,
|
|
@@ -252,11 +253,12 @@ var SPARouter = class {
|
|
|
252
253
|
return;
|
|
253
254
|
}
|
|
254
255
|
const from = window.location.pathname + window.location.search;
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
})) {
|
|
256
|
+
const action = replace ? "replace" : "push";
|
|
257
|
+
if (await this.shouldBlockNavigation({ from, to: fullPath, action })) {
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
if (!(refresh && fullPath === from) && await runFarmNavigationDelegates({ url: url.href, from, to: fullPath, action })) {
|
|
261
|
+
this.cancelActiveNavigation();
|
|
260
262
|
return;
|
|
261
263
|
}
|
|
262
264
|
if (this.options.scrollRestoration) {
|
|
@@ -17,18 +17,18 @@ var _chunk5DX3O6TTcjs = require('./chunk-5DX3O6TT.cjs');
|
|
|
17
17
|
var _chunkEVIWKPJVcjs = require('./chunk-EVIWKPJV.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkLIFUPCXWcjs = require('./chunk-LIFUPCXW.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
var _chunkB5BBTPJQcjs = require('./chunk-B5BBTPJQ.cjs');
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var _chunkA25FXJ7Dcjs = require('./chunk-A25FXJ7D.cjs');
|
|
27
26
|
|
|
28
27
|
|
|
28
|
+
var _chunk7JUIK547cjs = require('./chunk-7JUIK547.cjs');
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
var
|
|
31
|
+
var _chunkA25FXJ7Dcjs = require('./chunk-A25FXJ7D.cjs');
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
var _chunkOWQV6MLMcjs = require('./chunk-OWQV6MLM.cjs');
|
|
@@ -240,7 +240,7 @@ function createHandledResponse(body, init, headers) {
|
|
|
240
240
|
return new Response(body, { ...init, headers: responseHeaders });
|
|
241
241
|
}
|
|
242
242
|
function createWebMiddlewareContext(request, parent, trustProxy = false, clientAddress, toRoutePathname) {
|
|
243
|
-
let currentRequest =
|
|
243
|
+
let currentRequest = _chunkLIFUPCXWcjs.withFarmRequestClientAddress.call(void 0, request, trustProxy, clientAddress);
|
|
244
244
|
let handledResponse = null;
|
|
245
245
|
const url = new URL(currentRequest.url);
|
|
246
246
|
const data = _optionalChain([parent, 'optionalAccess', _3 => _3.data]) ? new Map(parent.data) : /* @__PURE__ */ new Map();
|
|
@@ -295,7 +295,7 @@ function createWebMiddlewareContext(request, parent, trustProxy = false, clientA
|
|
|
295
295
|
rewrite(rewriteUrl) {
|
|
296
296
|
ctx._rewriteUrl = rewriteUrl;
|
|
297
297
|
const nextUrl = new URL(rewriteUrl, currentRequest.url);
|
|
298
|
-
currentRequest =
|
|
298
|
+
currentRequest = _chunkLIFUPCXWcjs.withFarmRequestClientAddress.call(void 0,
|
|
299
299
|
new Request(nextUrl, currentRequest),
|
|
300
300
|
trustProxy,
|
|
301
301
|
clientAddress
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
// src/dev-module.ts
|
|
2
2
|
var failedModules = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
var startedContainers = /* @__PURE__ */ new WeakSet();
|
|
4
|
+
async function startPluginContainer(server) {
|
|
5
|
+
if (server.config?.experimental?.bundledDev) return;
|
|
6
|
+
const container = server.environments.client?.pluginContainer;
|
|
7
|
+
if (!container || startedContainers.has(container)) return;
|
|
8
|
+
await container.buildStart?.();
|
|
9
|
+
startedContainers.add(container);
|
|
10
|
+
}
|
|
3
11
|
var FarmDevEnvironmentError = class extends Error {
|
|
4
12
|
};
|
|
5
13
|
async function loadFarmDevModule(server, id, environmentName = "ssr") {
|
|
@@ -11,6 +19,7 @@ async function loadFarmDevModule(server, id, environmentName = "ssr") {
|
|
|
11
19
|
);
|
|
12
20
|
}
|
|
13
21
|
try {
|
|
22
|
+
await startPluginContainer(server);
|
|
14
23
|
return await runner.import(id);
|
|
15
24
|
} catch (error) {
|
|
16
25
|
const failures = failedModules.get(environment) ?? /* @__PURE__ */ new Map();
|