@farm.js/core 0.1.68 → 0.1.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-mcp-handler-FER4MQDF.cjs → agent-mcp-handler-6T2Z7TB6.cjs} +8 -5
- package/dist/{agent-mcp-handler-AZ7QW4UP.mjs → agent-mcp-handler-CPU354QQ.mjs} +7 -4
- package/dist/{agent-mcp.d-Uh5xr7aX.d.ts → agent-mcp.d-DulgFLBt.d.ts} +13 -4
- package/dist/{agent-mcp.d-wkVPK1GA.d.mts → agent-mcp.d-TAs1ES2F.d.mts} +13 -4
- package/dist/agent-runtime.cjs +3 -3
- package/dist/agent-runtime.d.mts +3 -2
- package/dist/agent-runtime.d.ts +3 -2
- package/dist/agent-runtime.mjs +2 -2
- package/dist/analyzer-GUIRJWZH.cjs +16 -0
- package/dist/{analyzer-CQDU7E3Y.mjs → analyzer-QGRBLETM.mjs} +2 -2
- package/dist/api/node.d.mts +5 -4
- package/dist/api/node.d.ts +5 -4
- package/dist/api/route-manager.cjs +4 -4
- package/dist/api/route-manager.d.mts +16 -7
- package/dist/api/route-manager.d.ts +16 -7
- package/dist/api/route-manager.mjs +3 -3
- package/dist/api/runtime.d.mts +4 -3
- package/dist/api/runtime.d.ts +4 -3
- package/dist/api.cjs +6 -6
- package/dist/api.d.mts +8 -24
- package/dist/api.d.ts +8 -24
- package/dist/api.mjs +5 -5
- package/dist/{app-manifest.d-Dd4q5CFx.d.mts → app-manifest.d-6zXb90o6.d.mts} +1 -1
- package/dist/{app-manifest.d-BT5i2F-o.d.ts → app-manifest.d-C-nf3Vmm.d.ts} +1 -1
- package/dist/app-markdown.cjs +5 -4
- package/dist/app-markdown.d.mts +4 -3
- package/dist/app-markdown.d.ts +4 -3
- package/dist/app-markdown.mjs +4 -3
- package/dist/{app.d-BVOpL_f2.d.ts → app.d-C2xeMIYT.d.ts} +18 -8
- package/dist/{app.d-BhiDXex_.d.mts → app.d-DF0aundc.d.mts} +18 -8
- package/dist/{base-path.d-BOUV5ozD.d.mts → base-path.d-BJ3SYpB8.d.mts} +7 -1
- package/dist/{base-path.d-BOUV5ozD.d.ts → base-path.d-BJ3SYpB8.d.ts} +7 -1
- package/dist/{chunk-4ZXKYCYK.mjs → chunk-255J7K4X.mjs} +1 -1
- package/dist/{chunk-RVGLYMJM.cjs → chunk-2AM26UGI.cjs} +2 -2
- package/dist/{chunk-UPOYKX4S.cjs → chunk-2MR4MABG.cjs} +4 -4
- package/dist/chunk-2RCCFB2Y.cjs +129 -0
- package/dist/{chunk-K6VFYFOY.cjs → chunk-2W4GNXGX.cjs} +2 -2
- package/dist/{chunk-URN7VFO7.cjs → chunk-32SYRIQ7.cjs} +21 -22
- package/dist/{chunk-CV6MFQ4Y.mjs → chunk-3AUINHFG.mjs} +1 -1
- package/dist/{chunk-KDO6T6OB.mjs → chunk-3EXCZJEN.mjs} +2 -2
- package/dist/{chunk-MMDKYJ5V.cjs → chunk-3GNVIYPO.cjs} +7 -7
- package/dist/{chunk-65Y5SIBH.cjs → chunk-3QM74STY.cjs} +1 -1
- package/dist/{chunk-NT4W4H52.mjs → chunk-3WS5AZ3R.mjs} +23 -18
- package/dist/{chunk-FJMC24KG.cjs → chunk-42KMUIWZ.cjs} +0 -3
- package/dist/{chunk-LR4KP3I7.cjs → chunk-4AC4PXZO.cjs} +2 -2
- package/dist/{chunk-YVPX5PI5.mjs → chunk-4O26BPUY.mjs} +8 -0
- package/dist/{chunk-LENKRGBV.mjs → chunk-5CFHQ7HM.mjs} +1 -1
- package/dist/{chunk-G7NBPP7H.mjs → chunk-5IJRJWJS.mjs} +1 -1
- package/dist/{chunk-MV7NWU23.mjs → chunk-5R3JQPWD.mjs} +1 -1
- package/dist/{chunk-3Y52TWYU.mjs → chunk-62ZRA7XU.mjs} +0 -3
- package/dist/{chunk-5JKDFRTK.cjs → chunk-65FPDDT4.cjs} +2 -2
- package/dist/{chunk-K6SXMVXO.mjs → chunk-75E5FDX2.mjs} +22 -7
- package/dist/{chunk-K76CBYQM.mjs → chunk-7A3URI2F.mjs} +20 -0
- package/dist/{chunk-VFNAK6A5.mjs → chunk-A2TH5MKE.mjs} +9 -5
- package/dist/{chunk-225APHKC.cjs → chunk-A7HCBHMC.cjs} +3 -3
- package/dist/{chunk-VX2HZGC7.cjs → chunk-ACGBXN3U.cjs} +2 -2
- package/dist/{chunk-Z3PW3DIR.cjs → chunk-BPUVDCGG.cjs} +5 -5
- package/dist/{chunk-FT6KJHS3.cjs → chunk-C2JOS77Z.cjs} +4 -1
- package/dist/{chunk-DIXFKAPM.mjs → chunk-CCHJWJGP.mjs} +297 -148
- package/dist/{chunk-CRVSYDHV.mjs → chunk-CKQAQFF6.mjs} +2 -2
- package/dist/chunk-DC2AXGNZ.mjs +129 -0
- package/dist/{chunk-TNK2TVRS.cjs → chunk-DIHBWZDZ.cjs} +449 -352
- package/dist/{chunk-JSOCDYER.cjs → chunk-DMXMIE2C.cjs} +15 -1
- package/dist/{chunk-23VJEGKC.cjs → chunk-DVJM55D2.cjs} +9 -1
- package/dist/{chunk-QSUYB3RH.cjs → chunk-DZHTNSQ5.cjs} +14 -14
- package/dist/{chunk-OIOPQ25L.mjs → chunk-E77IA5IF.mjs} +46 -33
- package/dist/{chunk-VRGY3X2I.mjs → chunk-EDZU7YRK.mjs} +8 -9
- package/dist/{chunk-EZTKXD6P.cjs → chunk-FDGYDQGL.cjs} +8 -1
- package/dist/{chunk-PLJKJJ2H.mjs → chunk-FETMUBIA.mjs} +27 -82
- package/dist/{chunk-HJZZSBVK.cjs → chunk-FILXOEWD.cjs} +2 -2
- package/dist/{chunk-KWCZKJYU.cjs → chunk-FJ5YCERM.cjs} +581 -432
- package/dist/{chunk-PDFFYZAT.cjs → chunk-GF22VGMS.cjs} +2 -2
- package/dist/{chunk-OOJBBHYW.cjs → chunk-GVYZCJZH.cjs} +30 -1
- package/dist/{chunk-MNJDNTGO.mjs → chunk-HAXFV2CD.mjs} +1 -1
- package/dist/{chunk-DXZ57EPE.mjs → chunk-I4KPA2C6.mjs} +14 -0
- package/dist/{chunk-LDEXTX4I.cjs → chunk-I7NUT24Z.cjs} +29 -22
- package/dist/{chunk-MZ4CRSY7.cjs → chunk-IEN2EFE5.cjs} +4 -4
- package/dist/{chunk-NVOMQLI2.mjs → chunk-IWJONXPF.mjs} +11 -0
- package/dist/{chunk-RLH5AH2M.mjs → chunk-JDO346NV.mjs} +1 -1
- package/dist/{chunk-WUTFJOV7.cjs → chunk-JFPKARWM.cjs} +16 -8
- package/dist/{chunk-A3T445WK.mjs → chunk-JFVT5ZZV.mjs} +9 -2
- package/dist/{chunk-WPB67LE5.mjs → chunk-JRF2SKCD.mjs} +1 -1
- package/dist/{chunk-YIHRZBD7.cjs → chunk-JRGR5Z4K.cjs} +1 -1
- package/dist/{chunk-UKZ6AWKZ.cjs → chunk-JWY66PID.cjs} +44 -1
- package/dist/{chunk-BDYM2TN3.cjs → chunk-JX5VOLAV.cjs} +8 -8
- package/dist/{chunk-WMLSZAKN.mjs → chunk-JZQS3ZOI.mjs} +1 -1
- package/dist/{chunk-YTNBCXCW.cjs → chunk-K4UGCUXX.cjs} +17 -13
- package/dist/{chunk-OFBLGH6V.cjs → chunk-K66JILV3.cjs} +47 -34
- package/dist/{chunk-QOGIZKSO.cjs → chunk-K7JMTAFH.cjs} +5 -5
- package/dist/{chunk-IFR74W6S.mjs → chunk-KPJYBSHL.mjs} +4 -1
- package/dist/{chunk-Z6SOXHAD.mjs → chunk-KPMLDT3B.mjs} +208 -111
- package/dist/{chunk-KI3MU7B5.mjs → chunk-LDVJIBGN.mjs} +1 -1
- package/dist/{chunk-IGDYL2IA.cjs → chunk-LECZ5DPZ.cjs} +2 -2
- package/dist/{chunk-5FBZJJGA.mjs → chunk-LXEJNWF5.mjs} +2 -2
- package/dist/{chunk-F36LS2C7.cjs → chunk-M6U6E4F7.cjs} +335 -285
- package/dist/{chunk-AKIQ54FK.cjs → chunk-MBCRWU3P.cjs} +26 -81
- package/dist/{chunk-P2NBQ5JI.mjs → chunk-MWUDEYBI.mjs} +1 -1
- package/dist/{chunk-SQ6IWJ3H.cjs → chunk-MZLJFNMH.cjs} +1 -1
- package/dist/{chunk-6OFOIMNS.mjs → chunk-N62IYXYD.mjs} +1 -1
- package/dist/{chunk-ZPKJPM7K.mjs → chunk-NA77GEIU.mjs} +2 -2
- package/dist/{chunk-FVYBEMOD.cjs → chunk-NAXKOTPP.cjs} +6 -6
- package/dist/{chunk-I7J5RLGO.cjs → chunk-NLBHLPEO.cjs} +12 -1
- package/dist/{chunk-3EEINK7G.cjs → chunk-NSZY3EWG.cjs} +10 -7
- package/dist/{chunk-F6CMGWAL.mjs → chunk-NYF7A4UW.mjs} +1 -1
- package/dist/{chunk-QO43L7Z4.cjs → chunk-O32QPFVV.cjs} +25 -7
- package/dist/{chunk-5IQ2ERQA.cjs → chunk-O47W53D3.cjs} +1 -1
- package/dist/{chunk-CO6UYM2D.mjs → chunk-O5QUJEWT.mjs} +1 -1
- package/dist/{chunk-JL2YW5KX.mjs → chunk-OAEDVXVE.mjs} +44 -1
- package/dist/{chunk-3TXKFRSO.mjs → chunk-OEL5EPOJ.mjs} +1 -1
- package/dist/{chunk-KSZK34HU.mjs → chunk-PJQ5W356.mjs} +16 -8
- package/dist/{chunk-BZWTBELF.cjs → chunk-Q5HMVGR5.cjs} +87 -17
- package/dist/{chunk-5NFQ6AZI.cjs → chunk-QEWWKYDL.cjs} +25 -10
- package/dist/{chunk-QOSDWGKT.mjs → chunk-QVBXTSIZ.mjs} +1 -1
- package/dist/{chunk-T5XFZQCL.mjs → chunk-QZHTDVH4.mjs} +1 -1
- package/dist/{chunk-HEJM46HQ.mjs → chunk-R7254L3R.mjs} +5 -2
- package/dist/{chunk-OGVTUGMU.mjs → chunk-REP6HWJN.mjs} +13 -3
- package/dist/{chunk-4UAQB5LB.mjs → chunk-RMOU3PR4.mjs} +112 -62
- package/dist/{chunk-WYL4ODZ4.mjs → chunk-SE7HPBYK.mjs} +30 -1
- package/dist/{chunk-2ZOYOYEE.mjs → chunk-THG2TVDH.mjs} +73 -3
- package/dist/{chunk-TEJ67GD2.mjs → chunk-TLSSIYAL.mjs} +20 -5
- package/dist/{chunk-DWLNLU55.cjs → chunk-TPYAYFMF.cjs} +2 -2
- package/dist/{chunk-Y6KHPJDB.cjs → chunk-U7VH3Q5E.cjs} +2 -2
- package/dist/{chunk-X3MHKLCO.cjs → chunk-VG6HYT5K.cjs} +26 -11
- package/dist/{chunk-437QZIC2.cjs → chunk-VNBDN5W2.cjs} +5 -5
- package/dist/{chunk-AJNBTOVQ.mjs → chunk-WW3LRNQV.mjs} +1 -1
- package/dist/{chunk-GFPS7MNE.mjs → chunk-WX63N6C5.mjs} +4 -4
- package/dist/{chunk-7LK5CTUM.cjs → chunk-XYVPTTUT.cjs} +31 -26
- package/dist/{chunk-VOQ7XZZT.cjs → chunk-Y2SZVIVH.cjs} +20 -0
- package/dist/{chunk-XCAQTCGK.mjs → chunk-YBY34UHB.mjs} +1 -1
- package/dist/{chunk-YGJ5P3TJ.mjs → chunk-Z3GPAFIA.mjs} +21 -3
- package/dist/{chunk-4E57QHPW.cjs → chunk-ZUVAGMQ5.cjs} +17 -7
- package/dist/{chunk-23LVFSID.mjs → chunk-ZXDX7VYZ.mjs} +7 -0
- package/dist/{client-component.d-BvQOxSqh.d.mts → client-component.d-Bk5qKJM-.d.mts} +2 -2
- package/dist/{client-component.d-DNVSLEPi.d.ts → client-component.d-DNbC4oWI.d.ts} +2 -2
- package/dist/{client-plugins.d-CNDqcAuf.d.ts → client-plugins.d-DwUqh4gp.d.ts} +50 -5
- package/dist/{client-plugins.d-CE1lVK2R.d.mts → client-plugins.d-Pi9nG0W0.d.mts} +50 -5
- package/dist/client-plugins.d.mts +3 -2
- package/dist/client-plugins.d.ts +3 -2
- package/dist/client.cjs +6 -6
- package/dist/client.d.mts +8 -7
- package/dist/client.d.ts +8 -7
- package/dist/client.mjs +5 -5
- package/dist/config.d.mts +3 -2
- package/dist/config.d.ts +3 -2
- package/dist/deployment.cjs +4 -2
- package/dist/deployment.d.mts +7 -1
- package/dist/deployment.d.ts +7 -1
- package/dist/deployment.mjs +5 -3
- package/dist/desktop.d.mts +4 -3
- package/dist/desktop.d.ts +4 -3
- package/dist/{dev-guard-ONNMVQUN.mjs → dev-guard-ZDIELV6Q.mjs} +1 -1
- package/dist/{dev-guard-2UW2KERP.cjs → dev-guard-ZLLKVO5T.cjs} +2 -2
- package/dist/{devtools-2A2GPC7B.mjs → devtools-CB43AHEP.mjs} +8 -7
- package/dist/{devtools-R27T3BRY.cjs → devtools-L5DUNDF3.cjs} +9 -8
- package/dist/docs.cjs +14 -11
- package/dist/docs.d.mts +17 -4
- package/dist/docs.d.ts +17 -4
- package/dist/docs.mjs +14 -11
- package/dist/environment/vite.cjs +3 -3
- package/dist/environment/vite.mjs +2 -2
- package/dist/headers.d-CE6OWB-n.d.ts +18 -0
- package/dist/headers.d-DED1hHh4.d.mts +18 -0
- package/dist/i18n/client.cjs +2 -2
- package/dist/i18n/client.d.mts +2 -2
- package/dist/i18n/client.d.ts +2 -2
- package/dist/i18n/client.mjs +1 -1
- package/dist/i18n/index.cjs +2 -2
- package/dist/i18n/index.d.mts +3 -3
- package/dist/i18n/index.d.ts +3 -3
- package/dist/i18n/index.mjs +1 -1
- package/dist/i18n/server.cjs +3 -3
- package/dist/i18n/server.d.mts +5 -5
- package/dist/i18n/server.d.ts +5 -5
- package/dist/i18n/server.mjs +2 -2
- package/dist/image/server.cjs +2 -2
- package/dist/image/server.mjs +1 -1
- package/dist/image/sharp.cjs +9 -9
- package/dist/image/sharp.mjs +1 -1
- package/dist/index.cjs +49 -45
- package/dist/{index.d-Bt3kl19W.d.mts → index.d-CbvOjJcp.d.mts} +1 -1
- package/dist/{index.d-Cx_-DaKV.d.ts → index.d-c9UwIqDy.d.ts} +1 -1
- package/dist/index.d.mts +26 -24
- package/dist/index.d.ts +26 -24
- package/dist/index.mjs +63 -59
- package/dist/integrations/orm.d.mts +3 -2
- package/dist/integrations/orm.d.ts +3 -2
- package/dist/integrations.cjs +3 -3
- package/dist/integrations.d.mts +3 -2
- package/dist/integrations.d.ts +3 -2
- package/dist/integrations.mjs +2 -2
- package/dist/internal/app-markdown-runtime.cjs +4 -3
- package/dist/internal/app-markdown-runtime.d.mts +4 -3
- package/dist/internal/app-markdown-runtime.d.ts +4 -3
- package/dist/internal/app-markdown-runtime.mjs +3 -2
- package/dist/internal/build-runtime.cjs +36 -37
- package/dist/internal/build-runtime.d.mts +5 -4
- package/dist/internal/build-runtime.d.ts +5 -4
- package/dist/internal/build-runtime.mjs +35 -36
- package/dist/internal/cli-runtime.cjs +15 -14
- package/dist/internal/cli-runtime.mjs +14 -13
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +5 -3
- package/dist/internal/client-runtime.d.mts +17 -7
- package/dist/internal/client-runtime.d.ts +17 -7
- package/dist/internal/client-runtime.mjs +4 -2
- package/dist/internal/compression-runtime.d.mts +3 -2
- package/dist/internal/compression-runtime.d.ts +3 -2
- package/dist/internal/config-runtime.cjs +10 -9
- package/dist/internal/config-runtime.d.mts +6 -5
- package/dist/internal/config-runtime.d.ts +6 -5
- package/dist/internal/config-runtime.mjs +9 -8
- package/dist/internal/infra-analytics-runtime.cjs +12 -9
- package/dist/internal/infra-analytics-runtime.mjs +10 -7
- package/dist/internal/native-server-fns.cjs +4 -4
- package/dist/internal/native-server-fns.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-runtime.cjs +52 -17
- package/dist/internal/production-runtime.d.mts +57 -20
- package/dist/internal/production-runtime.d.ts +57 -20
- package/dist/internal/production-runtime.mjs +55 -20
- package/dist/internal/vercel-edge-middleware.cjs +3 -2
- package/dist/internal/vercel-edge-middleware.d.mts +2 -2
- package/dist/internal/vercel-edge-middleware.d.ts +2 -2
- package/dist/internal/vercel-edge-middleware.mjs +2 -1
- package/dist/markdown.cjs +3 -2
- package/dist/markdown.d.mts +3 -2
- package/dist/markdown.d.ts +3 -2
- package/dist/markdown.mjs +2 -1
- package/dist/middleware.cjs +6 -5
- package/dist/middleware.d.mts +4 -3
- package/dist/middleware.d.ts +4 -3
- package/dist/middleware.mjs +5 -4
- package/dist/mobile.d.mts +3 -3
- package/dist/mobile.d.ts +3 -3
- package/dist/{mount.d-Bki4pOaJ.d.mts → mount.d-BvWxf8ZE.d.mts} +1 -1
- package/dist/{mount.d-DjR5aerM.d.ts → mount.d-DngLY7NL.d.ts} +1 -1
- package/dist/{native-tree-W2SSJB3Y.cjs → native-tree-GF4BH33L.cjs} +4 -3
- package/dist/{native-tree-Y5YQANW7.mjs → native-tree-L2IIEBXH.mjs} +3 -2
- package/dist/{navigation-delegate.d-VDkziXTK.d.mts → navigation-delegate.d-CMyl1h2l.d.mts} +1 -1
- package/dist/{navigation-delegate.d-CtghaSP3.d.ts → navigation-delegate.d-zZogiDfa.d.ts} +1 -1
- package/dist/navigation.cjs +5 -5
- package/dist/navigation.d.mts +6 -5
- package/dist/navigation.d.ts +6 -5
- package/dist/navigation.mjs +4 -4
- package/dist/{plugin-WIU4GDD4.cjs → plugin-F2O4BFTK.cjs} +2 -2
- package/dist/{plugin-SAS22JL7.mjs → plugin-VEBRN7A3.mjs} +1 -1
- package/dist/plugin.cjs +30 -29
- package/dist/plugin.d.mts +6 -4
- package/dist/plugin.d.ts +6 -4
- package/dist/plugin.mjs +29 -28
- package/dist/{production-runtime.d-DMZY3OgV.d.mts → production-runtime.d-B0IeWWyO.d.mts} +23 -2
- package/dist/{production-runtime.d-BMyyLGBB.d.ts → production-runtime.d-q3aHIv5Y.d.ts} +23 -2
- package/dist/query/client.cjs +6 -6
- package/dist/query/client.mjs +2 -2
- package/dist/{render-plan.d-i9sI4tc9.d.ts → render-plan.d-DQj2bzd2.d.ts} +1 -1
- package/dist/{render-plan.d-BSwV8PE4.d.mts → render-plan.d-Di1znBDW.d.mts} +1 -1
- package/dist/renderer-client.cjs +7 -7
- package/dist/renderer-client.d.mts +6 -5
- package/dist/renderer-client.d.ts +6 -5
- package/dist/renderer-client.mjs +3 -3
- package/dist/{request.d-Dgln8tuI.d.ts → request.d-C5vyoYeL.d.ts} +1 -1
- package/dist/{request.d-C24FNQ_7.d.mts → request.d-CJWzfDYJ.d.mts} +1 -1
- package/dist/request.d.mts +4 -3
- package/dist/request.d.ts +4 -3
- package/dist/{resolver.d-JnZKKsc5.d.mts → resolver.d-9iKC79CU.d.mts} +1 -1
- package/dist/{resolver.d-BHyZgpa7.d.ts → resolver.d-CY6mEa_F.d.ts} +1 -1
- package/dist/response.d-B_MtBCnF.d.mts +12 -0
- package/dist/response.d-B_MtBCnF.d.ts +12 -0
- package/dist/{route-rendering.d-Ds0BfwQi.d.mts → route-rendering.d-C-et2TZ1.d.mts} +9 -2
- package/dist/{route-rendering.d-CUylZKJA.d.ts → route-rendering.d-DhsY5M2I.d.ts} +9 -2
- package/dist/{router.d-CFPcbqzc.d.mts → router.d-BMDS5s5X.d.mts} +1 -1
- package/dist/{router.d-B56rMOFm.d.ts → router.d-CJB-Ntni.d.ts} +1 -1
- package/dist/{routes.d-CrEy0lJS.d.mts → routes.d-D3aJw1H5.d.mts} +1 -1
- package/dist/{routes.d-9GFFNioh.d.ts → routes.d-K-Qg79AA.d.ts} +1 -1
- package/dist/routes.d.mts +3 -2
- package/dist/routes.d.ts +3 -2
- package/dist/{index.d-BNNDpql4.d.ts → routing.d-BxOZ2YWc.d.ts} +1 -2
- package/dist/{index.d-BqcfqJvt.d.mts → routing.d-DwSUVZbF.d.mts} +1 -2
- package/dist/{rsc-pipeline-GA4AQWZI.mjs → rsc-pipeline-AXQJCCHI.mjs} +12 -12
- package/dist/{rsc-pipeline-3T7V6OUT.cjs → rsc-pipeline-NJKLZ3YE.cjs} +13 -13
- package/dist/{runtime-REUTNTI5.cjs → runtime-DMW6DDOI.cjs} +19 -18
- package/dist/{runtime-ZYCKKY7L.mjs → runtime-JXNEKOSE.mjs} +11 -10
- package/dist/{runtime.d-BtL3PCL3.d.ts → runtime.d-B_uPfMjA.d.ts} +2 -2
- package/dist/{runtime.d-DLRO-ExG.d.mts → runtime.d-BonodRI9.d.mts} +1 -1
- package/dist/{runtime.d-3iJAKptR.d.mts → runtime.d-nUz0HAL4.d.mts} +2 -2
- package/dist/{runtime.d-H7k9hOQE.d.ts → runtime.d-uw4123iI.d.ts} +1 -1
- package/dist/server-plugins.cjs +3 -2
- package/dist/server-plugins.d.mts +6 -12
- package/dist/server-plugins.d.ts +6 -12
- package/dist/server-plugins.mjs +2 -1
- package/dist/server.cjs +64 -56
- package/dist/server.d.mts +23 -14
- package/dist/server.d.ts +23 -14
- package/dist/server.mjs +40 -32
- package/dist/{spa-router.d-Dr7oanhl.d.ts → spa-router.d-l0d9pPZj.d.ts} +3 -3
- package/dist/{spa-router.d-g4CzhEH1.d.mts → spa-router.d-rha3M95y.d.mts} +3 -3
- package/dist/testing.cjs +3 -3
- package/dist/testing.d.mts +3 -2
- package/dist/testing.d.ts +3 -2
- package/dist/testing.mjs +3 -3
- package/dist/{types.d-C41ePjvP.d.ts → types.d-wVRlLtBf.d.mts} +1 -1
- package/dist/{types.d-C41ePjvP.d.mts → types.d-wVRlLtBf.d.ts} +1 -1
- package/dist/{utils.d-BxxyDEb8.d.ts → utils.d-BK-PTOF8.d.ts} +1 -1
- package/dist/{utils.d-HIla3pD_.d.mts → utils.d-BzuTobEc.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +37 -29
- package/dist/vite.d.mts +26 -6
- package/dist/vite.d.ts +26 -6
- package/dist/vite.mjs +36 -28
- package/package.json +3 -3
- package/dist/analyzer-PPAHM4AW.cjs +0 -16
- package/dist/chunk-HHLEYA4B.cjs +0 -17
- package/dist/chunk-QYNZ3CTI.mjs +0 -17
- package/dist/response.d-BolW0Vx_.d.mts +0 -10
- package/dist/response.d-BolW0Vx_.d.ts +0 -10
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
var _chunkJX5VOLAVcjs = require('./chunk-JX5VOLAV.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
6
9
|
|
|
7
10
|
var _chunkKORZ6PREcjs = require('./chunk-KORZ6PRE.cjs');
|
|
8
11
|
|
|
@@ -278,6 +281,16 @@ function isArrayIndex(key) {
|
|
|
278
281
|
return Number.isInteger(value) && value >= 0 && value < 4294967295 && String(value) === key;
|
|
279
282
|
}
|
|
280
283
|
|
|
284
|
+
// src/plugin-server-runtime.ts
|
|
285
|
+
function hasFarmServerRuntimePlugins(plugins) {
|
|
286
|
+
return (plugins || []).some((plugin) => {
|
|
287
|
+
if (_chunkJX5VOLAVcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) === false) return false;
|
|
288
|
+
return Boolean(
|
|
289
|
+
plugin.setup || plugin.init || plugin.ready || plugin.shutdown || plugin.runtime || plugin.router || plugin.render || plugin.beforeRouteMatch || plugin.afterRouteMatch || plugin.beforeRender || plugin.afterRender || plugin.onError || plugin.transformHTML
|
|
290
|
+
);
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
|
|
281
294
|
// src/build/tailwind.ts
|
|
282
295
|
|
|
283
296
|
|
|
@@ -372,4 +385,5 @@ function createMissingTailwindPlugin() {
|
|
|
372
385
|
|
|
373
386
|
|
|
374
387
|
|
|
375
|
-
|
|
388
|
+
|
|
389
|
+
exports.resolveFarmAppClientEntry = resolveFarmAppClientEntry; exports.resolveFarmClientPlugins = resolveFarmClientPlugins; exports.generateFarmClientPluginEntryCode = generateFarmClientPluginEntryCode; exports.hasFarmServerRuntimePlugins = hasFarmServerRuntimePlugins; exports.loadTailwindVitePlugin = loadTailwindVitePlugin;
|
|
@@ -14,6 +14,13 @@ function normalizeFarmTrailingSlashPathname(pathname, enabled) {
|
|
|
14
14
|
if (enabled) return pathname.endsWith("/") ? pathname : `${pathname}/`;
|
|
15
15
|
return pathname.replace(/\/+$/, "") || "/";
|
|
16
16
|
}
|
|
17
|
+
function toFarmTrailingSlashPageRequest(request, enabled) {
|
|
18
|
+
const url = new URL(request.url);
|
|
19
|
+
const pathname = normalizeFarmTrailingSlashPathname(url.pathname, enabled);
|
|
20
|
+
if (pathname === url.pathname) return request;
|
|
21
|
+
url.pathname = pathname;
|
|
22
|
+
return new Request(url, request);
|
|
23
|
+
}
|
|
17
24
|
function resolveFarmTrailingSlashRedirect(url, enabled) {
|
|
18
25
|
const pathname = normalizeFarmTrailingSlashPathname(url.pathname, enabled);
|
|
19
26
|
if (pathname === url.pathname) return null;
|
|
@@ -25,4 +32,5 @@ function resolveFarmTrailingSlashRedirect(url, enabled) {
|
|
|
25
32
|
|
|
26
33
|
|
|
27
34
|
|
|
28
|
-
|
|
35
|
+
|
|
36
|
+
exports.setFarmTrailingSlashPreference = setFarmTrailingSlashPreference; exports.getFarmTrailingSlashPreference = getFarmTrailingSlashPreference; exports.normalizeFarmTrailingSlashPathname = normalizeFarmTrailingSlashPathname; exports.toFarmTrailingSlashPageRequest = toFarmTrailingSlashPageRequest; exports.resolveFarmTrailingSlashRedirect = resolveFarmTrailingSlashRedirect;
|
|
@@ -7,7 +7,7 @@ var _chunk53EHWHT2cjs = require('./chunk-53EHWHT2.cjs');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkVNBDN5W2cjs = require('./chunk-VNBDN5W2.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunkRI3EVPKDcjs = require('./chunk-RI3EVPKD.cjs');
|
|
@@ -52,7 +52,7 @@ function shouldBlockUnload(options) {
|
|
|
52
52
|
function navigateViaRouter(href, basePath, replace, options = {}) {
|
|
53
53
|
if (typeof window === "undefined") return;
|
|
54
54
|
const url = _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, href, basePath);
|
|
55
|
-
const spaRouter =
|
|
55
|
+
const spaRouter = _chunkVNBDN5W2cjs.getInstalledFarmSPARouter.call(void 0, );
|
|
56
56
|
if (spaRouter) {
|
|
57
57
|
void spaRouter.navigate(url, {
|
|
58
58
|
replace,
|
|
@@ -72,7 +72,7 @@ function writeHistory(url, replace) {
|
|
|
72
72
|
} else {
|
|
73
73
|
window.history.pushState(null, "", url);
|
|
74
74
|
}
|
|
75
|
-
|
|
75
|
+
_chunkVNBDN5W2cjs.notifyHistoryChange.call(void 0, "url-search");
|
|
76
76
|
}
|
|
77
77
|
async function writeHistoryUnlessDelegated(url, replace) {
|
|
78
78
|
const target = new URL(url, window.location.href);
|
|
@@ -105,7 +105,7 @@ function useRouter(options = {}) {
|
|
|
105
105
|
setState(readRouterState(basePath, routeMatcher));
|
|
106
106
|
};
|
|
107
107
|
handlePopState();
|
|
108
|
-
const unsubscribe =
|
|
108
|
+
const unsubscribe = _chunkVNBDN5W2cjs.subscribeHistoryChange.call(void 0, handlePopState);
|
|
109
109
|
return unsubscribe;
|
|
110
110
|
}, [basePath, routeMatcher]);
|
|
111
111
|
const push = (href, navigateOptions) => {
|
|
@@ -116,11 +116,11 @@ function useRouter(options = {}) {
|
|
|
116
116
|
};
|
|
117
117
|
const pushState = (pageState, href) => {
|
|
118
118
|
if (typeof window === "undefined") return;
|
|
119
|
-
|
|
119
|
+
_chunkVNBDN5W2cjs.getRouter.call(void 0, ).pushState(pageState, resolveClientHref(href, basePath));
|
|
120
120
|
};
|
|
121
121
|
const replaceState = (pageState, href) => {
|
|
122
122
|
if (typeof window === "undefined") return;
|
|
123
|
-
|
|
123
|
+
_chunkVNBDN5W2cjs.getRouter.call(void 0, ).replaceState(pageState, resolveClientHref(href, basePath));
|
|
124
124
|
};
|
|
125
125
|
const back = () => {
|
|
126
126
|
if (typeof window !== "undefined") {
|
|
@@ -143,24 +143,24 @@ function useRouter(options = {}) {
|
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
145
|
function usePageState() {
|
|
146
|
-
const [state, setState] = _react.useState.call(void 0, () =>
|
|
146
|
+
const [state, setState] = _react.useState.call(void 0, () => _chunkVNBDN5W2cjs.readPageState.call(void 0, ));
|
|
147
147
|
_react.useEffect.call(void 0, () => {
|
|
148
148
|
if (typeof window === "undefined") return;
|
|
149
149
|
const handlePopState = () => {
|
|
150
|
-
setState(
|
|
150
|
+
setState(_chunkVNBDN5W2cjs.readPageState.call(void 0, ));
|
|
151
151
|
};
|
|
152
152
|
handlePopState();
|
|
153
|
-
return
|
|
153
|
+
return _chunkVNBDN5W2cjs.subscribeHistoryChange.call(void 0, handlePopState);
|
|
154
154
|
}, []);
|
|
155
155
|
return state;
|
|
156
156
|
}
|
|
157
157
|
function useNavigation() {
|
|
158
158
|
const [state, setState] = _react.useState.call(void 0,
|
|
159
|
-
() =>
|
|
159
|
+
() => _chunkVNBDN5W2cjs.getRouter.call(void 0, ).getNavigationState()
|
|
160
160
|
);
|
|
161
161
|
_react.useEffect.call(void 0, () => {
|
|
162
162
|
if (typeof window === "undefined") return;
|
|
163
|
-
return
|
|
163
|
+
return _chunkVNBDN5W2cjs.getRouter.call(void 0, ).subscribeNavigation(setState);
|
|
164
164
|
}, []);
|
|
165
165
|
return state;
|
|
166
166
|
}
|
|
@@ -172,7 +172,7 @@ function useBlocker(options) {
|
|
|
172
172
|
if (typeof window === "undefined" || !active) {
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
175
|
-
return
|
|
175
|
+
return _chunkVNBDN5W2cjs.getRouter.call(void 0, ).addBlocker(
|
|
176
176
|
async (context) => {
|
|
177
177
|
const current = optionsRef.current;
|
|
178
178
|
const when = typeof current.when === "function" ? current.when(context) : current.when;
|
|
@@ -195,7 +195,7 @@ function useScrollRestoration(key) {
|
|
|
195
195
|
_react.useEffect.call(void 0, () => {
|
|
196
196
|
const element = ref.current;
|
|
197
197
|
if (!element) return;
|
|
198
|
-
return
|
|
198
|
+
return _chunkVNBDN5W2cjs.getRouter.call(void 0, ).registerScrollElement(key, element);
|
|
199
199
|
}, [key]);
|
|
200
200
|
return ref;
|
|
201
201
|
}
|
|
@@ -216,7 +216,7 @@ function readRouterState(basePath, routeMatcher) {
|
|
|
216
216
|
pathname,
|
|
217
217
|
searchParams: url.searchParams,
|
|
218
218
|
params: _optionalChain([routeMatcher, 'optionalAccess', _5 => _5.match, 'call', _6 => _6(routePathname), 'optionalAccess', _7 => _7.params]) || {},
|
|
219
|
-
pageState: typeof window === "undefined" ? null :
|
|
219
|
+
pageState: typeof window === "undefined" ? null : _chunkVNBDN5W2cjs.readPageState.call(void 0, )
|
|
220
220
|
};
|
|
221
221
|
}
|
|
222
222
|
function readCurrentUrl() {
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-YX6AFPXC.mjs";
|
|
7
7
|
import {
|
|
8
8
|
_runWithFarmI18nRequest
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3AUINHFG.mjs";
|
|
10
10
|
import {
|
|
11
11
|
explainMissingOptionalPeer
|
|
12
12
|
} from "./chunk-NR63PD3P.mjs";
|
|
@@ -54,11 +54,12 @@ var APIRouteConflictError = class extends Error {
|
|
|
54
54
|
this.name = "APIRouteConflictError";
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
|
-
var APIRouteManager = class {
|
|
57
|
+
var APIRouteManager = class _APIRouteManager {
|
|
58
58
|
constructor(appDir, viteServer, options = {}) {
|
|
59
59
|
this.routes = /* @__PURE__ */ new Map();
|
|
60
60
|
this.endpointSources = /* @__PURE__ */ new Map();
|
|
61
61
|
this.routeShapes = /* @__PURE__ */ new Map();
|
|
62
|
+
this.discovery = Promise.resolve();
|
|
62
63
|
this.appDirs = Array.isArray(appDir) ? [...appDir] : [appDir];
|
|
63
64
|
this.viteServer = viteServer;
|
|
64
65
|
this.plugins = options.plugins ?? [];
|
|
@@ -77,40 +78,52 @@ var APIRouteManager = class {
|
|
|
77
78
|
return files;
|
|
78
79
|
}
|
|
79
80
|
/**
|
|
80
|
-
* Discover route.ts files in /app/api and explicit endpoints in root routes.ts
|
|
81
|
+
* Discover route.ts files in /app/api and explicit endpoints in root routes.ts.
|
|
82
|
+
*
|
|
83
|
+
* Requests keep matching the current routes until discovery finishes, and a failed discovery
|
|
84
|
+
* keeps them: discovery awaits each route module, and a dev server runs it again for each route
|
|
85
|
+
* file a watcher reports. Discoveries run one at a time, so an older scan never replaces a newer
|
|
86
|
+
* one.
|
|
81
87
|
*/
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
88
|
+
discoverRoutes() {
|
|
89
|
+
const discovery = this.discovery.catch(() => {
|
|
90
|
+
}).then(async () => {
|
|
91
|
+
const next = new _APIRouteManager(this.appDirs, this.viteServer, {
|
|
92
|
+
plugins: this.plugins,
|
|
93
|
+
throwOnLoadError: this.throwOnLoadError,
|
|
94
|
+
i18n: this.i18n,
|
|
95
|
+
bodySizeLimit: this.bodySizeLimit,
|
|
96
|
+
basePath: this.basePath,
|
|
97
|
+
dispatch: this.dispatch
|
|
98
|
+
});
|
|
99
|
+
await next.discoverInto();
|
|
100
|
+
this.routes = next.routes;
|
|
101
|
+
this.endpointSources = next.endpointSources;
|
|
102
|
+
this.routeShapes = next.routeShapes;
|
|
103
|
+
});
|
|
104
|
+
this.discovery = discovery;
|
|
105
|
+
return discovery;
|
|
106
|
+
}
|
|
107
|
+
/** Fill this manager's empty route tables. Only a fresh manager made by discoverRoutes runs it. */
|
|
108
|
+
async discoverInto() {
|
|
109
|
+
for (const appDir of this.appDirs) {
|
|
110
|
+
const apiDir = path.join(appDir, "api");
|
|
111
|
+
let routeFiles = [];
|
|
112
|
+
if (fs.existsSync(apiDir)) {
|
|
113
|
+
routeFiles = this.findRouteFiles(apiDir);
|
|
101
114
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
);
|
|
108
|
-
} catch (error) {
|
|
109
|
-
this.routes = previousRoutes;
|
|
110
|
-
this.endpointSources = previousEndpointSources;
|
|
111
|
-
this.routeShapes = previousRouteShapes;
|
|
112
|
-
throw error;
|
|
115
|
+
for (const filePath of routeFiles) {
|
|
116
|
+
await this.loadRoute(filePath, appDir);
|
|
117
|
+
}
|
|
118
|
+
await this.loadRootRoutes(appDir);
|
|
119
|
+
await this.loadProgrammaticApiRoutes(appDir);
|
|
113
120
|
}
|
|
121
|
+
this.routes = new Map(
|
|
122
|
+
mergePluginAPIRoutes([...this.routes.values()], this.plugins, void 0, {
|
|
123
|
+
bodySizeLimit: this.bodySizeLimit,
|
|
124
|
+
dispatch: this.dispatch
|
|
125
|
+
}).map((route) => [route.path, route])
|
|
126
|
+
);
|
|
114
127
|
if (process.env.FARM_VERBOSE) {
|
|
115
128
|
logger.success(`Discovered ${this.routes.size} API routes`);
|
|
116
129
|
for (const [routePath, route] of this.routes) {
|
|
@@ -1,27 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
hasFarmServerRuntimePlugins
|
|
3
|
-
} from "./chunk-QYNZ3CTI.mjs";
|
|
4
1
|
import {
|
|
5
2
|
FARM_RSC_INSTALL_HINT,
|
|
6
3
|
findFarmAppPackageDir,
|
|
7
4
|
formatFarmRscBlockingMessage,
|
|
8
5
|
inspectFarmServerComponents,
|
|
9
6
|
resolveFarmRscCheckConfig
|
|
10
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-62ZRA7XU.mjs";
|
|
11
8
|
import {
|
|
12
9
|
createFarmDevLoopbackPlugin
|
|
13
10
|
} from "./chunk-FN5UEC7I.mjs";
|
|
14
11
|
import {
|
|
15
12
|
resolveDeployOutputPath
|
|
16
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-3WS5AZ3R.mjs";
|
|
17
14
|
import {
|
|
18
15
|
farmDesktopDevGuardPlugin,
|
|
19
16
|
loadFarmReactPlugin
|
|
20
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-QVBXTSIZ.mjs";
|
|
21
18
|
import {
|
|
22
19
|
generateFarmClientPluginEntryCode,
|
|
20
|
+
hasFarmServerRuntimePlugins,
|
|
23
21
|
loadTailwindVitePlugin
|
|
24
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-I4KPA2C6.mjs";
|
|
25
23
|
import {
|
|
26
24
|
resolveFarmPlatform
|
|
27
25
|
} from "./chunk-SMUW7UST.mjs";
|
|
@@ -39,6 +37,7 @@ var FARM_RSC_CONFIG_KEYS = [
|
|
|
39
37
|
"srcDir",
|
|
40
38
|
"extends",
|
|
41
39
|
"basePath",
|
|
40
|
+
"trailingSlash",
|
|
42
41
|
"api",
|
|
43
42
|
"server",
|
|
44
43
|
"middleware",
|
|
@@ -50,7 +49,7 @@ var FARM_RSC_CONFIG_KEYS = [
|
|
|
50
49
|
"agent",
|
|
51
50
|
"mcp"
|
|
52
51
|
];
|
|
53
|
-
var FARM_RSC_PASSTHROUGH_KEYS = ["i18n", "cache"];
|
|
52
|
+
var FARM_RSC_PASSTHROUGH_KEYS = ["i18n", "cache", "redirects", "rewrites", "headers"];
|
|
54
53
|
function pickImportTarget(entry) {
|
|
55
54
|
if (typeof entry === "string") return entry;
|
|
56
55
|
if (!entry || typeof entry !== "object") return void 0;
|
|
@@ -211,7 +210,7 @@ async function resolveFarmRscServerPlugins(userConfig, config, root) {
|
|
|
211
210
|
}
|
|
212
211
|
async function configureFarmRscPlugins(config, command) {
|
|
213
212
|
if (config.plugins.length === 0) return config;
|
|
214
|
-
const { PluginManager } = await import("./plugin-
|
|
213
|
+
const { PluginManager } = await import("./plugin-VEBRN7A3.mjs");
|
|
215
214
|
const manager = new PluginManager({
|
|
216
215
|
config,
|
|
217
216
|
isDev: command === "serve",
|
|
@@ -61,6 +61,12 @@ function mergeRouteRenderingDirectiveConfig(directiveConfig, mod, options) {
|
|
|
61
61
|
directive: _optionalChain([directiveConfig, 'optionalAccess', _15 => _15.directive])
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
+
function resolveRouteSharedCacheControl(view, pprCanCache = false) {
|
|
65
|
+
if (view.dynamic === "force-dynamic") return null;
|
|
66
|
+
if (!view.ssg && !pprCanCache) return null;
|
|
67
|
+
const revalidate = typeof view.revalidate === "number" && view.revalidate > 0 ? view.revalidate : 60;
|
|
68
|
+
return `public, s-maxage=${revalidate}, stale-while-revalidate=300`;
|
|
69
|
+
}
|
|
64
70
|
|
|
65
71
|
// src/ssg-paths.ts
|
|
66
72
|
var OPTIONAL_CATCH_ALL_SEGMENT = /^\[\[\.\.\.([^\]]+)\]\]$/;
|
|
@@ -179,4 +185,5 @@ function encodePathSegment(value) {
|
|
|
179
185
|
|
|
180
186
|
|
|
181
187
|
|
|
182
|
-
|
|
188
|
+
|
|
189
|
+
exports.mergeRouteRenderingDirectiveConfig = mergeRouteRenderingDirectiveConfig; exports.resolveRouteSharedCacheControl = resolveRouteSharedCacheControl; exports.materializeSSGRoutePath = materializeSSGRoutePath; exports.getOptionalCatchAllParameterNames = getOptionalCatchAllParameterNames; exports.normalizeStaticPathParams = normalizeStaticPathParams;
|
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
interpolateConfigRouteDestination,
|
|
7
|
-
localizeConfigRouteDestination,
|
|
8
|
-
resolveConfigRedirectDestination,
|
|
9
|
-
resolveConfigRoutePathname
|
|
10
|
-
} from "./chunk-JZGL2PIH.mjs";
|
|
2
|
+
createConfigHeadersMatcher,
|
|
3
|
+
createConfigRedirectMatcher,
|
|
4
|
+
createConfigRewriteMatcher
|
|
5
|
+
} from "./chunk-DC2AXGNZ.mjs";
|
|
11
6
|
import {
|
|
12
7
|
resolveFarmRequestURL
|
|
13
8
|
} from "./chunk-5OFNUETM.mjs";
|
|
14
|
-
import {
|
|
15
|
-
isFarmRedirectStatus
|
|
16
|
-
} from "./chunk-JNYFXL7X.mjs";
|
|
17
9
|
|
|
18
10
|
// src/plugins/redirects.ts
|
|
19
11
|
var FARM_CONFIG_REDIRECTS_PLUGIN_NAME = "farm:redirects";
|
|
@@ -24,35 +16,7 @@ function createRedirectsPlugin(redirects, {
|
|
|
24
16
|
i18n,
|
|
25
17
|
basePath
|
|
26
18
|
} = {}) {
|
|
27
|
-
|
|
28
|
-
if (redirect.statusCode !== void 0 && !isFarmRedirectStatus(redirect.statusCode)) {
|
|
29
|
-
throw new RangeError(
|
|
30
|
-
`Redirect "${redirect.source}" statusCode must be one of 301, 302, 303, 307, or 308.`
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
const compiledRedirects = redirects.map((redirect) => ({
|
|
35
|
-
redirect,
|
|
36
|
-
pattern: compileConfigRoutePattern(redirect.source)
|
|
37
|
-
}));
|
|
38
|
-
const matchRedirect = (url) => {
|
|
39
|
-
const routePath = resolveConfigRoutePathname(url.pathname, i18n, basePath);
|
|
40
|
-
for (const { redirect, pattern } of compiledRedirects) {
|
|
41
|
-
const match = routePath.pathname.match(pattern.regex);
|
|
42
|
-
if (!match) continue;
|
|
43
|
-
const localizedDestination = resolveConfigRedirectDestination(
|
|
44
|
-
interpolateConfigRouteDestination(redirect.destination, match, pattern.tokens),
|
|
45
|
-
routePath.locale,
|
|
46
|
-
i18n,
|
|
47
|
-
basePath
|
|
48
|
-
);
|
|
49
|
-
return {
|
|
50
|
-
destination: appendFarmRedirectQuery(localizedDestination, url.search),
|
|
51
|
-
statusCode: redirect.statusCode ?? (redirect.permanent ? 308 : 307)
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
return null;
|
|
55
|
-
};
|
|
19
|
+
const matchRedirect = createConfigRedirectMatcher(redirects, { i18n, basePath });
|
|
56
20
|
const plugin = {
|
|
57
21
|
name: FARM_CONFIG_REDIRECTS_PLUGIN_NAME,
|
|
58
22
|
enforce: "pre",
|
|
@@ -144,16 +108,28 @@ function applyWriteHeadHeaders(res, headers) {
|
|
|
144
108
|
if (value !== void 0) res.setHeader(key, value);
|
|
145
109
|
}
|
|
146
110
|
}
|
|
111
|
+
function installConfigResponseHeaders(res, matchedHeaders) {
|
|
112
|
+
applyResponseHeaders(res, matchedHeaders);
|
|
113
|
+
const responseWithFinalizer = res;
|
|
114
|
+
if (matchedHeaders.length === 0 || responseWithFinalizer[FARM_CONFIG_HEADERS_FINALIZER]) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
responseWithFinalizer[FARM_CONFIG_HEADERS_FINALIZER] = true;
|
|
118
|
+
const writeHead = res.writeHead;
|
|
119
|
+
res.writeHead = ((statusCode, ...args) => {
|
|
120
|
+
const statusMessage = typeof args[0] === "string" ? args.shift() : void 0;
|
|
121
|
+
applyWriteHeadHeaders(res, args[0]);
|
|
122
|
+
applyResponseHeaders(res, matchedHeaders);
|
|
123
|
+
return statusMessage === void 0 ? writeHead.call(res, statusCode) : writeHead.call(res, statusCode, statusMessage);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
147
126
|
function createHeadersPlugin(headers, {
|
|
148
127
|
beforeRequest: overrideBeforeRequest,
|
|
149
128
|
afterResponse: overrideAfterResponse,
|
|
150
129
|
i18n,
|
|
151
130
|
basePath
|
|
152
131
|
} = {}) {
|
|
153
|
-
const
|
|
154
|
-
config,
|
|
155
|
-
pattern: compileConfigRoutePattern(config.source)
|
|
156
|
-
}));
|
|
132
|
+
const matchHeaders = createConfigHeadersMatcher(headers, { i18n, basePath });
|
|
157
133
|
return {
|
|
158
134
|
name: FARM_CONFIG_HEADERS_PLUGIN_NAME,
|
|
159
135
|
enforce: "pre",
|
|
@@ -161,22 +137,7 @@ function createHeadersPlugin(headers, {
|
|
|
161
137
|
if (overrideBeforeRequest) {
|
|
162
138
|
await overrideBeforeRequest(req, res, context);
|
|
163
139
|
}
|
|
164
|
-
|
|
165
|
-
const pathname = resolveConfigRoutePathname(url.pathname, i18n, basePath).pathname;
|
|
166
|
-
const matchedHeaders = compiledHeaders.filter(({ pattern }) => pattern.regex.test(pathname)).map(({ config }) => config.headers);
|
|
167
|
-
applyResponseHeaders(res, matchedHeaders);
|
|
168
|
-
const responseWithFinalizer = res;
|
|
169
|
-
if (matchedHeaders.length === 0 || responseWithFinalizer[FARM_CONFIG_HEADERS_FINALIZER]) {
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
responseWithFinalizer[FARM_CONFIG_HEADERS_FINALIZER] = true;
|
|
173
|
-
const writeHead = res.writeHead;
|
|
174
|
-
res.writeHead = ((statusCode, ...args) => {
|
|
175
|
-
const statusMessage = typeof args[0] === "string" ? args.shift() : void 0;
|
|
176
|
-
applyWriteHeadHeaders(res, args[0]);
|
|
177
|
-
applyResponseHeaders(res, matchedHeaders);
|
|
178
|
-
return statusMessage === void 0 ? writeHead.call(res, statusCode) : writeHead.call(res, statusCode, statusMessage);
|
|
179
|
-
});
|
|
140
|
+
installConfigResponseHeaders(res, matchHeaders(resolveFarmRequestURL(req)));
|
|
180
141
|
},
|
|
181
142
|
async afterResponse(req, res, context) {
|
|
182
143
|
if (overrideAfterResponse) {
|
|
@@ -194,10 +155,7 @@ function createRewritesPlugin(rewrites, {
|
|
|
194
155
|
i18n,
|
|
195
156
|
basePath
|
|
196
157
|
} = {}) {
|
|
197
|
-
const
|
|
198
|
-
rewrite,
|
|
199
|
-
pattern: compileConfigRoutePattern(rewrite.source)
|
|
200
|
-
}));
|
|
158
|
+
const matchRewrite = createConfigRewriteMatcher(rewrites, { i18n, basePath });
|
|
201
159
|
return {
|
|
202
160
|
name: FARM_CONFIG_REWRITES_PLUGIN_NAME,
|
|
203
161
|
enforce: "pre",
|
|
@@ -206,23 +164,9 @@ function createRewritesPlugin(rewrites, {
|
|
|
206
164
|
await overrideBeforeRequest(req, res, context);
|
|
207
165
|
}
|
|
208
166
|
const url = resolveFarmRequestURL(req);
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
const match = pathname.match(pattern.regex);
|
|
213
|
-
if (match) {
|
|
214
|
-
const newPath = localizeConfigRouteDestination(
|
|
215
|
-
interpolateConfigRouteDestination(rewrite.destination, match, pattern.tokens),
|
|
216
|
-
routePath.locale,
|
|
217
|
-
i18n
|
|
218
|
-
);
|
|
219
|
-
const destinationUrl = new URL(newPath, url);
|
|
220
|
-
if (!destinationUrl.search && url.search) {
|
|
221
|
-
destinationUrl.search = url.search;
|
|
222
|
-
}
|
|
223
|
-
req.url = destinationUrl.origin === url.origin ? destinationUrl.pathname + destinationUrl.search : destinationUrl.href;
|
|
224
|
-
break;
|
|
225
|
-
}
|
|
167
|
+
const destinationUrl = matchRewrite(url);
|
|
168
|
+
if (destinationUrl) {
|
|
169
|
+
req.url = destinationUrl.origin === url.origin ? destinationUrl.pathname + destinationUrl.search : destinationUrl.href;
|
|
226
170
|
}
|
|
227
171
|
},
|
|
228
172
|
async afterResponse(req, res, context) {
|
|
@@ -238,6 +182,7 @@ export {
|
|
|
238
182
|
createRedirectsPlugin,
|
|
239
183
|
getConfigRedirectMatcher,
|
|
240
184
|
FARM_CONFIG_HEADERS_PLUGIN_NAME,
|
|
185
|
+
installConfigResponseHeaders,
|
|
241
186
|
createHeadersPlugin,
|
|
242
187
|
FARM_CONFIG_REWRITES_PLUGIN_NAME,
|
|
243
188
|
createRewritesPlugin
|
|
@@ -1,6 +1,6 @@
|
|
|
1
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
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkACGBXN3Ucjs = require('./chunk-ACGBXN3U.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunk5DX3O6TTcjs = require('./chunk-5DX3O6TT.cjs');
|
|
@@ -394,7 +394,7 @@ function farmMiddlewarePlugin(options = {}) {
|
|
|
394
394
|
mode: server.config.mode === "production" ? "production" : "development",
|
|
395
395
|
basePath: _nullishCoalesce(options.basePath, () => ( "/"))
|
|
396
396
|
});
|
|
397
|
-
manager = new (0,
|
|
397
|
+
manager = new (0, _chunkACGBXN3Ucjs.MiddlewareManager)(
|
|
398
398
|
getMiddlewareAppDirectory(server.config.root, srcDir),
|
|
399
399
|
server,
|
|
400
400
|
options.middleware,
|