@farm.js/core 0.1.31 → 0.1.34
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/README.md +1 -1
- package/dist/agent-runtime.cjs +69 -14
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/agent-runtime.mjs +58 -3
- package/dist/api/route-manager.cjs +16 -13
- package/dist/api/route-manager.d.mts +1 -1
- package/dist/api/route-manager.d.ts +1 -1
- package/dist/api/route-manager.mjs +15 -12
- package/dist/api/runtime.cjs +9 -7
- package/dist/api/runtime.d.mts +1 -1
- package/dist/api/runtime.d.ts +1 -1
- package/dist/api/runtime.mjs +8 -6
- package/dist/api.cjs +19 -16
- package/dist/api.d.mts +2 -2
- package/dist/api.d.ts +2 -2
- package/dist/api.mjs +18 -15
- package/dist/{app-sUJ3jnTZ.d.ts → app-DgotYGbq.d.ts} +3 -3
- package/dist/app-markdown.cjs +8 -6
- package/dist/app-markdown.d.mts +3 -3
- package/dist/app-markdown.d.ts +3 -3
- package/dist/app-markdown.mjs +7 -5
- package/dist/{app-DAuUTIZf.d.mts → app-q4rmZlXK.d.mts} +3 -3
- package/dist/cache.cjs +2 -2
- package/dist/cache.d.mts +10 -1
- package/dist/cache.d.ts +10 -1
- package/dist/cache.mjs +1 -1
- package/dist/{chunk-YZTASLPQ.cjs → chunk-27ZWSI3W.cjs} +2 -2
- package/dist/{chunk-WBIH66JK.mjs → chunk-2ELDTQRN.mjs} +5 -2
- package/dist/{chunk-K7CELQLK.cjs → chunk-2F2ER724.cjs} +54 -29
- package/dist/{chunk-NRVGEI5I.mjs → chunk-2NNMOPDN.mjs} +4 -210
- package/dist/chunk-2NQQ5H5G.cjs +86 -0
- package/dist/{chunk-IFI5FXEZ.cjs → chunk-36MK5YCW.cjs} +334 -163
- package/dist/chunk-3BU22U3M.cjs +237 -0
- package/dist/{chunk-MM5D6VLP.mjs → chunk-3KZS4SUS.mjs} +33 -14
- package/dist/chunk-3SDFA7UF.cjs +701 -0
- package/dist/{chunk-4IEPYMHF.mjs → chunk-3UEVPCGW.mjs} +1 -1
- package/dist/{chunk-5LJCOSKT.mjs → chunk-3VSKDFAT.mjs} +1 -1
- package/dist/{chunk-5HGR3W6O.mjs → chunk-5SJWVY6R.mjs} +8 -0
- package/dist/{chunk-X7WVQMIB.mjs → chunk-657WJNRY.mjs} +10 -4
- package/dist/{chunk-MKMBQSNQ.mjs → chunk-6VVL3MHY.mjs} +3 -3
- package/dist/{chunk-QZRVZSPN.cjs → chunk-77GNHH2Z.cjs} +3 -3
- package/dist/{chunk-KZLND3D2.cjs → chunk-7BT4H4P7.cjs} +7 -5
- package/dist/{chunk-A777V5WU.cjs → chunk-7M52YUMY.cjs} +2 -2
- package/dist/{chunk-VUMAE7NC.mjs → chunk-7Y6ZNFPX.mjs} +81 -30
- package/dist/{chunk-MXDTKXO6.cjs → chunk-A5FGU2WU.cjs} +74 -23
- package/dist/{chunk-7QOCTYBS.mjs → chunk-AGC75XAE.mjs} +37 -1
- package/dist/{chunk-4ZQQL4IU.mjs → chunk-AHGECQEW.mjs} +1 -1
- package/dist/{chunk-RG3ZOTG5.cjs → chunk-AI7QMY7O.cjs} +10 -3
- package/dist/{chunk-O3DTUAX2.mjs → chunk-AQZFOP7S.mjs} +6 -77
- package/dist/{chunk-WNLBF77X.cjs → chunk-ATK2R4CH.cjs} +14 -12
- package/dist/{chunk-SORB3MAR.cjs → chunk-AWC4VUZL.cjs} +17 -17
- package/dist/{chunk-YMCXWPWK.mjs → chunk-BCMSYSN2.mjs} +4 -1
- package/dist/{chunk-FYRBX5IY.cjs → chunk-BTAG7LI7.cjs} +2 -2
- package/dist/{chunk-I6XDAKWQ.mjs → chunk-BTHHUD7Q.mjs} +14 -0
- package/dist/chunk-C4SPBWFM.cjs +26 -0
- package/dist/{chunk-JATSG2ZO.mjs → chunk-CLJYVZAD.mjs} +4 -2
- package/dist/{chunk-J3LOGE4T.cjs → chunk-DQQOKWYA.cjs} +5 -5
- package/dist/{chunk-JLRDISQL.cjs → chunk-DZ4DTRJ5.cjs} +7 -7
- package/dist/chunk-E5GNDG5F.mjs +701 -0
- package/dist/{chunk-E76XC6ZG.mjs → chunk-EZDQRNQ7.mjs} +2 -2
- package/dist/{chunk-TOVMYGYW.mjs → chunk-F2SE2VDO.mjs} +1 -1
- package/dist/{chunk-BSPQVJ4A.mjs → chunk-FDR64H6B.mjs} +13 -0
- package/dist/{chunk-5OVTOKGH.cjs → chunk-FFFW3OQ7.cjs} +2 -2
- package/dist/{chunk-D4JE5NNV.cjs → chunk-FNO7A7CM.cjs} +5 -5
- package/dist/chunk-FZ6YYU2W.mjs +65 -0
- package/dist/{chunk-PZNCMPJF.cjs → chunk-G26MUMKL.cjs} +14 -8
- package/dist/{chunk-IXUY2F5U.mjs → chunk-GCXWJJKH.mjs} +4 -7
- package/dist/{chunk-JLCQGPXE.mjs → chunk-GNSDTTWZ.mjs} +50 -61
- package/dist/{chunk-TEN4FIZU.mjs → chunk-GOABMOX3.mjs} +151 -3
- package/dist/{chunk-HBTUGXHS.cjs → chunk-HLJ6MBUZ.cjs} +7 -4
- package/dist/{chunk-GZYH4OER.mjs → chunk-HR5KPHC2.mjs} +1 -1
- package/dist/{chunk-ZCU4NZ3M.cjs → chunk-IE7XCHH3.cjs} +4 -4
- package/dist/{chunk-I26CZYPV.cjs → chunk-IHNIDL6H.cjs} +50 -7
- package/dist/{chunk-2FQHH5SC.mjs → chunk-IHNMMXHV.mjs} +49 -24
- package/dist/{chunk-VHJGDMCG.cjs → chunk-IWZKTWHZ.cjs} +2 -2
- package/dist/{chunk-DGXN3L4D.mjs → chunk-JDPAKVS4.mjs} +4 -4
- package/dist/chunk-JG6DJF5A.mjs +238 -0
- package/dist/{chunk-5TISYEQF.mjs → chunk-JM5XPKWH.mjs} +10 -3
- package/dist/{chunk-BJJATPEC.mjs → chunk-KN7K4VQN.mjs} +1 -1
- package/dist/{chunk-WPYFSQKK.cjs → chunk-KNBBQHO2.cjs} +15 -1
- package/dist/{chunk-XWAWFQFS.cjs → chunk-KXWRO25S.cjs} +7 -4
- package/dist/{chunk-QG5HNS7P.mjs → chunk-LHODW25H.mjs} +2 -2
- package/dist/{chunk-BXFWA23T.mjs → chunk-LMJ7VRHZ.mjs} +3 -3
- package/dist/{chunk-WG2KHOMN.mjs → chunk-LR5QSC2P.mjs} +380 -209
- package/dist/chunk-LSKZMJMP.cjs +65 -0
- package/dist/{chunk-2N5PX3LS.mjs → chunk-LYV44OIR.mjs} +7 -1
- package/dist/{chunk-5MKEDGLD.cjs → chunk-M64YUMA4.cjs} +11 -6
- package/dist/{chunk-EXLKRR4U.cjs → chunk-MIDIZJZC.cjs} +12 -12
- package/dist/{chunk-ES4B2IXW.cjs → chunk-MOKLYNHV.cjs} +2 -2
- package/dist/{chunk-IV6CQY7O.mjs → chunk-MSSFIQGM.mjs} +63 -13
- package/dist/{chunk-KH7BN726.cjs → chunk-N4UOK6ZI.cjs} +8 -2
- package/dist/{chunk-6VYZOPOT.mjs → chunk-NGVORZVZ.mjs} +1 -1
- package/dist/{chunk-JNGIWIY6.mjs → chunk-NPC7VWJE.mjs} +2 -2
- package/dist/{chunk-ILWLPEVO.mjs → chunk-NRSN7G7E.mjs} +2 -2
- package/dist/{chunk-AHAJGAYD.mjs → chunk-O27L4YAA.mjs} +1 -1
- package/dist/{chunk-VYZSOYR4.cjs → chunk-ODBZYBAB.cjs} +1 -1
- package/dist/{chunk-YVGAEAA5.cjs → chunk-P64MIF5B.cjs} +154 -6
- package/dist/{chunk-DFLLARUK.cjs → chunk-PQDFUSXD.cjs} +14 -14
- package/dist/{chunk-F6XEGFHO.mjs → chunk-PXKIEXZD.mjs} +10 -0
- package/dist/{chunk-S5GDHOE4.mjs → chunk-PZNL3WEG.mjs} +48 -5
- package/dist/{chunk-FV45CKBC.mjs → chunk-QCFBDFRS.mjs} +1 -1
- package/dist/{chunk-75BRBIFP.cjs → chunk-QCVE2OCI.cjs} +5 -8
- package/dist/{chunk-6ZCMSZ5U.mjs → chunk-QE6VAKLT.mjs} +1 -1
- package/dist/{chunk-75DYEVXI.cjs → chunk-QGYRXFU2.cjs} +9 -9
- package/dist/{chunk-CTV2TTNP.cjs → chunk-QJ3J6MZT.cjs} +16 -87
- package/dist/{chunk-O6XNAMBV.mjs → chunk-QLQ32WC4.mjs} +8 -3
- package/dist/{chunk-IMB4PIAR.cjs → chunk-SJVKK4JE.cjs} +839 -420
- package/dist/{chunk-3FCFQP5V.cjs → chunk-TA5G2HWD.cjs} +21 -21
- package/dist/{chunk-Z5HIWVDP.cjs → chunk-TDFPACVX.cjs} +62 -73
- package/dist/{chunk-ND224OE2.cjs → chunk-TKSCR644.cjs} +34 -15
- package/dist/{chunk-UAFSBWNT.mjs → chunk-U4PTAHW3.mjs} +64 -13
- package/dist/{chunk-ZHVYQL3H.cjs → chunk-U74I55WB.cjs} +86 -35
- package/dist/chunk-UBO4SGH4.mjs +86 -0
- package/dist/{chunk-IQXFRNY2.cjs → chunk-UFDAAQFX.cjs} +2 -2
- package/dist/{chunk-X7KZBF63.cjs → chunk-UX5S4JEO.cjs} +40 -4
- package/dist/{chunk-5ZSWG4UX.cjs → chunk-UXFQ3UDA.cjs} +14 -1
- package/dist/{chunk-L4DVIHOC.mjs → chunk-VCCUOMQN.mjs} +1 -1
- package/dist/{chunk-4V7GIE2U.mjs → chunk-VHANUNEG.mjs} +2 -2
- package/dist/{chunk-FXUUWYAX.cjs → chunk-VKNHTSAP.cjs} +10 -0
- package/dist/{chunk-2AKFKCHA.mjs → chunk-W7LF2J2S.mjs} +1 -1
- package/dist/{chunk-MNUGPHLN.mjs → chunk-WNNYOOIB.mjs} +5 -3
- package/dist/{chunk-VA62MHFV.mjs → chunk-X242HVD5.mjs} +1 -1
- package/dist/{chunk-UJ2C4ICS.cjs → chunk-XJXBIP67.cjs} +4 -4
- package/dist/{chunk-6L6DQR5W.mjs → chunk-XV5DJTBX.mjs} +539 -121
- package/dist/{chunk-KJ2TIHZZ.cjs → chunk-XXJU7FCC.cjs} +3 -2
- package/dist/{chunk-DYEJQTDN.cjs → chunk-YSCV4SJF.cjs} +4 -4
- package/dist/{chunk-2SDO73HK.cjs → chunk-YWN746US.cjs} +64 -14
- package/dist/chunk-Z2HLU4IX.cjs +238 -0
- package/dist/{chunk-2FXWWUE5.cjs → chunk-Z2YLTERK.cjs} +4 -4
- package/dist/{chunk-CUMINO7Z.cjs → chunk-ZHPHJPQP.cjs} +4 -4
- package/dist/{chunk-FJZ3DQLK.mjs → chunk-ZKP7C2B6.mjs} +4 -4
- package/dist/{chunk-JBC2FKRW.mjs → chunk-ZUSJDQ2Q.mjs} +2 -1
- package/dist/{client-plugins-BX2ptm4H.d.mts → client-plugins-CLObcuCq.d.mts} +26 -2
- package/dist/{client-plugins-BmxM5KW_.d.ts → client-plugins-DZjHC4Mi.d.ts} +26 -2
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.cjs +8 -8
- package/dist/client.d.mts +5 -5
- package/dist/client.d.ts +5 -5
- package/dist/client.mjs +7 -7
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/{devtools-EWRDHCD5.cjs → devtools-HU6Y2MNV.cjs} +11 -9
- package/dist/{devtools-BPBCYOU6.mjs → devtools-RNXCTS4R.mjs} +10 -8
- package/dist/docs.cjs +13 -11
- package/dist/docs.d.mts +5 -0
- package/dist/docs.d.ts +5 -0
- package/dist/docs.mjs +12 -10
- package/dist/environment/vite.cjs +2 -2
- package/dist/environment/vite.mjs +1 -1
- package/dist/headers.cjs +4 -4
- package/dist/headers.mjs +3 -3
- package/dist/i18n/client.cjs +14 -13
- package/dist/i18n/client.mjs +5 -4
- package/dist/i18n/index.cjs +3 -2
- package/dist/i18n/index.mjs +2 -1
- package/dist/i18n/server.cjs +6 -5
- package/dist/i18n/server.mjs +5 -4
- 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 +67 -55
- package/dist/index.d.mts +14 -14
- package/dist/index.d.ts +14 -14
- package/dist/index.mjs +70 -58
- package/dist/integrations.cjs +6 -3
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/integrations.mjs +7 -4
- package/dist/internal/app-markdown-runtime.cjs +7 -5
- package/dist/internal/app-markdown-runtime.d.mts +14 -3
- package/dist/internal/app-markdown-runtime.d.ts +14 -3
- package/dist/internal/app-markdown-runtime.mjs +6 -4
- package/dist/internal/build-runtime.cjs +38 -35
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +37 -34
- package/dist/internal/cli-runtime.cjs +20 -17
- package/dist/internal/cli-runtime.mjs +19 -16
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +4 -2
- package/dist/internal/client-runtime.d.mts +9 -1
- package/dist/internal/client-runtime.d.ts +9 -1
- package/dist/internal/client-runtime.mjs +3 -1
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +11 -9
- package/dist/internal/config-runtime.d.mts +2 -2
- package/dist/internal/config-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.mjs +10 -8
- package/dist/internal/infra-analytics-runtime.cjs +4 -4
- package/dist/internal/infra-analytics-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 +20 -14
- package/dist/internal/production-runtime.d.mts +115 -8
- package/dist/internal/production-runtime.d.ts +115 -8
- package/dist/internal/production-runtime.mjs +19 -13
- package/dist/internal/request-cookies.cjs +4 -2
- package/dist/internal/request-cookies.d.mts +9 -1
- package/dist/internal/request-cookies.d.ts +9 -1
- package/dist/internal/request-cookies.mjs +3 -1
- package/dist/markdown.cjs +4 -4
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/markdown.mjs +3 -3
- package/dist/{metadata-DsEaK7mQ.d.mts → metadata-2HSU2i_w.d.mts} +1 -1
- package/dist/{metadata-fwZ3gfG6.d.ts → metadata-Cjs8JMRM.d.ts} +1 -1
- package/dist/middleware.cjs +18 -8
- package/dist/middleware.d.mts +24 -5
- package/dist/middleware.d.ts +24 -5
- package/dist/middleware.mjs +18 -8
- package/dist/navigation.cjs +6 -6
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/navigation.mjs +5 -5
- package/dist/{nitro-NAKCRVHX.mjs → nitro-4XGPNIK4.mjs} +3 -3
- package/dist/{nitro-VYDZGYFY.cjs → nitro-HSAQFXSS.cjs} +4 -4
- package/dist/plugin.cjs +33 -30
- package/dist/plugin.d.mts +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.mjs +32 -29
- package/dist/{production-runtime-DNkpFnmg.d.ts → production-runtime-BU5ETAK9.d.ts} +8 -1
- package/dist/{production-runtime-Baqgwtvc.d.mts → production-runtime-CysZl3EV.d.mts} +8 -1
- package/dist/query/client.cjs +7 -7
- package/dist/query/client.mjs +3 -3
- package/dist/{render-plan-DhwQnmmX.d.mts → render-plan-CKr4ltOd.d.mts} +1 -1
- package/dist/{render-plan-rkIK9wd9.d.ts → render-plan-D72O1qm4.d.ts} +1 -1
- package/dist/renderer-client.cjs +39 -19
- package/dist/renderer-client.d.mts +3 -3
- package/dist/renderer-client.d.ts +3 -3
- package/dist/renderer-client.mjs +28 -8
- package/dist/{request-CFy1BltJ.d.mts → request-Be83WafN.d.mts} +7 -2
- package/dist/{request-BcY4RYPC.d.ts → request-DbyOYI2j.d.ts} +7 -2
- package/dist/request.cjs +2 -2
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/request.mjs +1 -1
- package/dist/{route-rendering-BkS0TBlB.d.mts → route-rendering-BG56SzvJ.d.mts} +1 -1
- package/dist/{route-rendering-D4XpMjam.d.ts → route-rendering-CtVMpV-k.d.ts} +1 -1
- package/dist/{router-C4zPlC3V.d.mts → router-ALUvm8gC.d.mts} +1 -1
- package/dist/{router-Cq7BcZxg.d.ts → router-D94-SDlW.d.ts} +1 -1
- package/dist/routes.cjs +3 -3
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/routes.mjs +2 -2
- package/dist/server-fn.cjs +3 -3
- package/dist/server-fn.mjs +2 -2
- package/dist/server-plugins.cjs +4 -4
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server-plugins.mjs +3 -3
- package/dist/server-query-client.cjs +3 -3
- package/dist/server-query-client.mjs +2 -2
- package/dist/server-query.cjs +4 -4
- package/dist/server-query.mjs +3 -3
- package/dist/server.cjs +60 -57
- package/dist/server.d.mts +7 -7
- package/dist/server.d.ts +7 -7
- package/dist/server.mjs +37 -34
- package/dist/{spa-router-B1HI3X9k.d.ts → spa-router-CxK3USIz.d.ts} +2 -2
- package/dist/{spa-router-DzPZH-AO.d.mts → spa-router-DbxNRKOB.d.mts} +2 -2
- package/dist/testing.cjs +19 -17
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.mjs +16 -14
- package/dist/theme/server.cjs +4 -3
- package/dist/theme/server.mjs +3 -2
- package/dist/{utils-DMD1Hzta.d.ts → utils-311Y8eoK.d.ts} +1 -1
- package/dist/{utils-CEBktlBG.d.mts → utils-4wVRcpOw.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +33 -30
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.mjs +32 -29
- package/package.json +2 -2
- package/dist/chunk-22GUSVNJ.cjs +0 -351
- package/dist/chunk-SWN467MP.cjs +0 -18
- package/dist/chunk-XGC343EY.cjs +0 -443
- package/dist/chunk-ZSH2Y4LN.mjs +0 -351
- /package/dist/{chunk-SUIBNSNO.cjs → chunk-SJNMVDDF.cjs} +0 -0
- /package/dist/{chunk-LNZ7JZUS.mjs → chunk-UDNPLXW7.mjs} +0 -0
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseRequestCookieHeader
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JM5XPKWH.mjs";
|
|
4
4
|
import {
|
|
5
5
|
createWebRequestFromFarmRequest
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import {
|
|
8
|
-
canonicalizeRequestPathname
|
|
9
|
-
} from "./chunk-CQ6OSQ3K.mjs";
|
|
6
|
+
} from "./chunk-FDR64H6B.mjs";
|
|
10
7
|
import {
|
|
11
8
|
__name
|
|
12
9
|
} from "./chunk-LPEX4YW6.mjs";
|
|
@@ -93,7 +90,7 @@ function serializeMiddlewareCookie(name, value, options = {}) {
|
|
|
93
90
|
if (resolved.expires) cookie += `; Expires=${resolved.expires.toUTCString()}`;
|
|
94
91
|
cookie += `; Path=${resolved.path || "/"}`;
|
|
95
92
|
if (resolved.domain) cookie += `; Domain=${resolved.domain}`;
|
|
96
|
-
if (resolved.secure) cookie += "; Secure";
|
|
93
|
+
if (resolved.secure || resolved.sameSite === "none") cookie += "; Secure";
|
|
97
94
|
if (resolved.httpOnly) cookie += "; HttpOnly";
|
|
98
95
|
if (resolved.sameSite) {
|
|
99
96
|
cookie += `; SameSite=${resolved.sameSite.charAt(0).toUpperCase()}${resolved.sameSite.slice(1)}`;
|
|
@@ -225,205 +222,6 @@ function normalizeMiddlewareModule(middlewareModule, routePath) {
|
|
|
225
222
|
}
|
|
226
223
|
__name(normalizeMiddlewareModule, "normalizeMiddlewareModule");
|
|
227
224
|
|
|
228
|
-
// src/middleware/matcher.ts
|
|
229
|
-
var compiledConfigCache = /* @__PURE__ */ new WeakMap();
|
|
230
|
-
var compiledRouteCache = /* @__PURE__ */ new WeakMap();
|
|
231
|
-
function compileMiddlewareRoute(entry) {
|
|
232
|
-
const path = entry.path;
|
|
233
|
-
if (path === "/") return void 0;
|
|
234
|
-
const cached = compiledRouteCache.get(entry);
|
|
235
|
-
if (cached?.path === path) return cached;
|
|
236
|
-
const compiled = {
|
|
237
|
-
path,
|
|
238
|
-
exact: compilePattern(path),
|
|
239
|
-
nested: compilePattern(`${path}/:__farmRest*`)
|
|
240
|
-
};
|
|
241
|
-
compiledRouteCache.set(entry, compiled);
|
|
242
|
-
return compiled;
|
|
243
|
-
}
|
|
244
|
-
__name(compileMiddlewareRoute, "compileMiddlewareRoute");
|
|
245
|
-
function matchesMiddlewareRoute(pathname, entry) {
|
|
246
|
-
const compiled = compileMiddlewareRoute(entry);
|
|
247
|
-
if (!compiled) return { matched: true };
|
|
248
|
-
const canonicalPathname = canonicalizeRequestPathname(pathname);
|
|
249
|
-
const exactMatch = matchPattern(compiled.exact, canonicalPathname);
|
|
250
|
-
if (exactMatch.matched) return exactMatch;
|
|
251
|
-
const nestedMatch = matchPattern(compiled.nested, canonicalPathname);
|
|
252
|
-
if (!nestedMatch.matched) return { matched: false };
|
|
253
|
-
const params = { ...nestedMatch.params };
|
|
254
|
-
delete params.__farmRest;
|
|
255
|
-
return { matched: true, params: Object.keys(params).length > 0 ? params : void 0 };
|
|
256
|
-
}
|
|
257
|
-
__name(matchesMiddlewareRoute, "matchesMiddlewareRoute");
|
|
258
|
-
function sameEntries(current, previous) {
|
|
259
|
-
return current === void 0 || previous === void 0 ? current === previous : current.length === previous.length && current.every((entry, index) => entry === previous[index]);
|
|
260
|
-
}
|
|
261
|
-
__name(sameEntries, "sameEntries");
|
|
262
|
-
function toMatcherList(matcher) {
|
|
263
|
-
if (!matcher) return [];
|
|
264
|
-
return Array.isArray(matcher) ? matcher : [matcher];
|
|
265
|
-
}
|
|
266
|
-
__name(toMatcherList, "toMatcherList");
|
|
267
|
-
function escapeRegex(value) {
|
|
268
|
-
return value.replace(/[|\\{}()[\]^$+?.]/g, "\\$&");
|
|
269
|
-
}
|
|
270
|
-
__name(escapeRegex, "escapeRegex");
|
|
271
|
-
function parseColonParam(segment) {
|
|
272
|
-
const raw = segment.slice(1);
|
|
273
|
-
const last = raw[raw.length - 1];
|
|
274
|
-
const modifier = last === "*" || last === "+" || last === "?" ? last : void 0;
|
|
275
|
-
return {
|
|
276
|
-
name: modifier ? raw.slice(0, -1) : raw,
|
|
277
|
-
modifier
|
|
278
|
-
};
|
|
279
|
-
}
|
|
280
|
-
__name(parseColonParam, "parseColonParam");
|
|
281
|
-
function compilePathPattern(pattern, trailingSlash = false) {
|
|
282
|
-
const params = [];
|
|
283
|
-
const segments = pattern.split("/").filter(Boolean);
|
|
284
|
-
if (segments.length === 0) {
|
|
285
|
-
return { kind: "path", regex: /^\/$/, params };
|
|
286
|
-
}
|
|
287
|
-
const parts = segments.map((segment) => {
|
|
288
|
-
if (segment === "**") {
|
|
289
|
-
return "(?:/.*)?";
|
|
290
|
-
}
|
|
291
|
-
if (segment === "*") {
|
|
292
|
-
return "/[^/]+";
|
|
293
|
-
}
|
|
294
|
-
if (segment.startsWith(":")) {
|
|
295
|
-
const { name, modifier } = parseColonParam(segment);
|
|
296
|
-
params.push(name);
|
|
297
|
-
if (modifier === "*") {
|
|
298
|
-
return "(?:/(.*))?";
|
|
299
|
-
}
|
|
300
|
-
if (modifier === "+") {
|
|
301
|
-
return "/(.+)";
|
|
302
|
-
}
|
|
303
|
-
return "/([^/]+)";
|
|
304
|
-
}
|
|
305
|
-
if (segment.startsWith("[...") && segment.endsWith("]")) {
|
|
306
|
-
params.push(segment.slice(4, -1));
|
|
307
|
-
return "(?:/(.*))?";
|
|
308
|
-
}
|
|
309
|
-
if (segment.startsWith("[") && segment.endsWith("]")) {
|
|
310
|
-
params.push(segment.slice(1, -1));
|
|
311
|
-
return "/([^/]+)";
|
|
312
|
-
}
|
|
313
|
-
return `/${escapeRegex(segment).replace(/\\\*/g, "[^/]*")}`;
|
|
314
|
-
});
|
|
315
|
-
return {
|
|
316
|
-
kind: "path",
|
|
317
|
-
regex: new RegExp(`^${parts.join("")}${trailingSlash ? "/?" : ""}$`),
|
|
318
|
-
params
|
|
319
|
-
};
|
|
320
|
-
}
|
|
321
|
-
__name(compilePathPattern, "compilePathPattern");
|
|
322
|
-
function compileMatcherPattern(pattern) {
|
|
323
|
-
if (typeof pattern === "string" && pattern !== "*" && !pattern.endsWith("(.*)")) {
|
|
324
|
-
return compilePathPattern(pattern, true);
|
|
325
|
-
}
|
|
326
|
-
return compilePattern(pattern);
|
|
327
|
-
}
|
|
328
|
-
__name(compileMatcherPattern, "compileMatcherPattern");
|
|
329
|
-
function compilePattern(pattern) {
|
|
330
|
-
if (pattern instanceof RegExp) {
|
|
331
|
-
return { kind: "regexp", regex: pattern };
|
|
332
|
-
}
|
|
333
|
-
if (pattern === "*" || pattern === "/(.*)") {
|
|
334
|
-
return { kind: "all" };
|
|
335
|
-
}
|
|
336
|
-
if (pattern.endsWith("(.*)")) {
|
|
337
|
-
return {
|
|
338
|
-
kind: "subtree",
|
|
339
|
-
prefix: pattern.slice(0, -4).replace(/\/$/, "")
|
|
340
|
-
};
|
|
341
|
-
}
|
|
342
|
-
return compilePathPattern(pattern);
|
|
343
|
-
}
|
|
344
|
-
__name(compilePattern, "compilePattern");
|
|
345
|
-
function compileMiddlewareConfig(config) {
|
|
346
|
-
const compiled = {
|
|
347
|
-
matcher: config.matcher ? toMatcherList(config.matcher).map(
|
|
348
|
-
(matcher) => typeof matcher === "function" ? matcher : compileMatcherPattern(matcher)
|
|
349
|
-
) : void 0,
|
|
350
|
-
exclude: config.exclude?.map(compilePattern)
|
|
351
|
-
};
|
|
352
|
-
compiledConfigCache.set(config, {
|
|
353
|
-
compiled,
|
|
354
|
-
matcher: config.matcher,
|
|
355
|
-
matcherEntries: Array.isArray(config.matcher) ? config.matcher.slice() : void 0,
|
|
356
|
-
excludeEntries: config.exclude?.slice()
|
|
357
|
-
});
|
|
358
|
-
return compiled;
|
|
359
|
-
}
|
|
360
|
-
__name(compileMiddlewareConfig, "compileMiddlewareConfig");
|
|
361
|
-
function matchPattern(pattern, pathname) {
|
|
362
|
-
if (pattern.kind === "all") {
|
|
363
|
-
return { matched: true };
|
|
364
|
-
}
|
|
365
|
-
if (pattern.kind === "subtree") {
|
|
366
|
-
return {
|
|
367
|
-
matched: pathname === pattern.prefix || pathname.startsWith(`${pattern.prefix}/`)
|
|
368
|
-
};
|
|
369
|
-
}
|
|
370
|
-
pattern.regex.lastIndex = 0;
|
|
371
|
-
const match = pattern.regex.exec(pathname);
|
|
372
|
-
if (!match) {
|
|
373
|
-
return { matched: false };
|
|
374
|
-
}
|
|
375
|
-
if (pattern.kind === "regexp") {
|
|
376
|
-
return {
|
|
377
|
-
matched: true,
|
|
378
|
-
params: match.groups ? { ...match.groups } : void 0
|
|
379
|
-
};
|
|
380
|
-
}
|
|
381
|
-
const values = {};
|
|
382
|
-
pattern.params.forEach((param, index) => {
|
|
383
|
-
values[param] = match[index + 1] || "";
|
|
384
|
-
});
|
|
385
|
-
return {
|
|
386
|
-
matched: true,
|
|
387
|
-
params: Object.keys(values).length > 0 ? values : void 0
|
|
388
|
-
};
|
|
389
|
-
}
|
|
390
|
-
__name(matchPattern, "matchPattern");
|
|
391
|
-
function matchesCompiledMiddlewareConfig(pathname, config, ctx) {
|
|
392
|
-
let canonicalPathname;
|
|
393
|
-
const getCanonicalPathname = /* @__PURE__ */ __name(() => canonicalPathname ?? (canonicalPathname = canonicalizeRequestPathname(pathname)), "getCanonicalPathname");
|
|
394
|
-
if (config.exclude) {
|
|
395
|
-
for (const pattern of config.exclude) {
|
|
396
|
-
if (matchPattern(pattern, getCanonicalPathname()).matched) {
|
|
397
|
-
return { matched: false };
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
if (config.matcher) {
|
|
402
|
-
for (const matcher of config.matcher) {
|
|
403
|
-
if (typeof matcher === "function") {
|
|
404
|
-
if (matcher(ctx)) {
|
|
405
|
-
return { matched: true };
|
|
406
|
-
}
|
|
407
|
-
continue;
|
|
408
|
-
}
|
|
409
|
-
const result = matchPattern(matcher, getCanonicalPathname());
|
|
410
|
-
if (result.matched) {
|
|
411
|
-
return result;
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
return { matched: false };
|
|
415
|
-
}
|
|
416
|
-
return { matched: true };
|
|
417
|
-
}
|
|
418
|
-
__name(matchesCompiledMiddlewareConfig, "matchesCompiledMiddlewareConfig");
|
|
419
|
-
function matchesMiddlewareConfig(pathname, config, ctx) {
|
|
420
|
-
const cached = compiledConfigCache.get(config);
|
|
421
|
-
const unchanged = cached && (Array.isArray(config.matcher) ? sameEntries(config.matcher, cached.matcherEntries) : config.matcher === cached.matcher) && sameEntries(config.exclude, cached.excludeEntries);
|
|
422
|
-
const compiled = unchanged ? cached.compiled : compileMiddlewareConfig(config);
|
|
423
|
-
return matchesCompiledMiddlewareConfig(pathname, compiled, ctx);
|
|
424
|
-
}
|
|
425
|
-
__name(matchesMiddlewareConfig, "matchesMiddlewareConfig");
|
|
426
|
-
|
|
427
225
|
export {
|
|
428
226
|
_clearCurrentMiddlewareData,
|
|
429
227
|
_clearCurrentMiddlewareContext,
|
|
@@ -435,9 +233,5 @@ export {
|
|
|
435
233
|
parseMiddlewareCookieHeader,
|
|
436
234
|
serializeMiddlewareCookie,
|
|
437
235
|
serializeMiddlewareCookieDeletion,
|
|
438
|
-
normalizeMiddlewareModule
|
|
439
|
-
compileMiddlewareRoute,
|
|
440
|
-
matchesMiddlewareRoute,
|
|
441
|
-
compileMiddlewareConfig,
|
|
442
|
-
matchesMiddlewareConfig
|
|
236
|
+
normalizeMiddlewareModule
|
|
443
237
|
};
|
|
@@ -0,0 +1,86 @@
|
|
|
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 _chunk5QIKR7RRcjs = require('./chunk-5QIKR7RR.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
7
|
+
|
|
8
|
+
// src/routing/route-slots.ts
|
|
9
|
+
var SLOT_SEGMENT = /^@([A-Za-z][A-Za-z0-9_-]*)$/;
|
|
10
|
+
function isRouteSlotSegment(segment) {
|
|
11
|
+
return SLOT_SEGMENT.test(segment);
|
|
12
|
+
}
|
|
13
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, isRouteSlotSegment, "isRouteSlotSegment");
|
|
14
|
+
function parseRouteSlotFile(filePath) {
|
|
15
|
+
const normalized = filePath.replace(/\\/g, "/");
|
|
16
|
+
const parts = normalized.split("/").filter(Boolean);
|
|
17
|
+
const fileName = _nullishCoalesce(parts.at(-1), () => ( ""));
|
|
18
|
+
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte)$/, "");
|
|
19
|
+
if (baseName !== "page" && baseName !== "default") return null;
|
|
20
|
+
const slotIndex = parts.findIndex((part) => SLOT_SEGMENT.test(part));
|
|
21
|
+
if (slotIndex < 0) return null;
|
|
22
|
+
if (parts.slice(slotIndex + 1, -1).some((part) => SLOT_SEGMENT.test(part))) {
|
|
23
|
+
throw new Error(`Nested route slots are not supported in "${filePath}"`);
|
|
24
|
+
}
|
|
25
|
+
const slotMatch = parts[slotIndex].match(SLOT_SEGMENT);
|
|
26
|
+
const name = _optionalChain([slotMatch, 'optionalAccess', _ => _[1]]);
|
|
27
|
+
if (!name) return null;
|
|
28
|
+
const ownerParts = parts.slice(0, slotIndex);
|
|
29
|
+
const contentParts = parts.slice(slotIndex + 1, -1);
|
|
30
|
+
const marker = parseInterceptionMarker(contentParts[0]);
|
|
31
|
+
let targetBase = ownerParts;
|
|
32
|
+
let targetParts = contentParts;
|
|
33
|
+
if (marker) {
|
|
34
|
+
targetBase = marker.root === true ? [] : ownerParts.slice(0, Math.max(0, ownerParts.length - marker.up));
|
|
35
|
+
targetParts = [...marker.remainder ? [marker.remainder] : [], ...contentParts.slice(1)];
|
|
36
|
+
}
|
|
37
|
+
const ownerFile = [...ownerParts, "layout.tsx"].join("/");
|
|
38
|
+
const routeFile = [
|
|
39
|
+
...baseName === "default" ? ownerParts : targetBase,
|
|
40
|
+
...baseName === "default" ? [] : targetParts,
|
|
41
|
+
"page.tsx"
|
|
42
|
+
].join("/");
|
|
43
|
+
return {
|
|
44
|
+
name,
|
|
45
|
+
ownerRoute: _chunk5QIKR7RRcjs.parseRoutePath.call(void 0, ownerFile || "layout.tsx"),
|
|
46
|
+
route: _chunk5QIKR7RRcjs.parseRoutePath.call(void 0, routeFile || "page.tsx"),
|
|
47
|
+
interception: marker !== null,
|
|
48
|
+
fallback: baseName === "default"
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, parseRouteSlotFile, "parseRouteSlotFile");
|
|
52
|
+
function createRouteSlotContainerId(name, ownerPattern) {
|
|
53
|
+
const owner = ownerPattern === "/" ? "root" : ownerPattern.replace(/^\//, "").replace(/[^A-Za-z0-9_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
54
|
+
return `__farm_slot_${name}_${owner || "root"}__`;
|
|
55
|
+
}
|
|
56
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, createRouteSlotContainerId, "createRouteSlotContainerId");
|
|
57
|
+
function parseInterceptionMarker(segment) {
|
|
58
|
+
if (!segment) return null;
|
|
59
|
+
if (segment.startsWith("(...)")) {
|
|
60
|
+
return {
|
|
61
|
+
up: 0,
|
|
62
|
+
root: true,
|
|
63
|
+
remainder: segment.slice(5)
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
if (segment.startsWith("(.)")) {
|
|
67
|
+
return {
|
|
68
|
+
up: 0,
|
|
69
|
+
remainder: segment.slice(3)
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
let remainder = segment;
|
|
73
|
+
let up = 0;
|
|
74
|
+
while (remainder.startsWith("(..)")) {
|
|
75
|
+
up += 1;
|
|
76
|
+
remainder = remainder.slice(4);
|
|
77
|
+
}
|
|
78
|
+
return up > 0 ? { up, remainder } : null;
|
|
79
|
+
}
|
|
80
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, parseInterceptionMarker, "parseInterceptionMarker");
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
exports.isRouteSlotSegment = isRouteSlotSegment; exports.parseRouteSlotFile = parseRouteSlotFile; exports.createRouteSlotContainerId = createRouteSlotContainerId;
|