@farm.js/core 0.1.34 → 0.1.36
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-BVExL8rZ.d.mts +109 -0
- package/dist/agent-mcp-handler-LPJ2CADR.mjs +19 -0
- package/dist/agent-mcp-handler-SJAHFSPI.cjs +19 -0
- package/dist/agent-mcp-luzfXK-P.d.ts +109 -0
- package/dist/agent-runtime.cjs +5 -3
- package/dist/agent-runtime.d.mts +4 -5
- package/dist/agent-runtime.d.ts +4 -5
- package/dist/agent-runtime.mjs +4 -2
- package/dist/api/route-manager.cjs +7 -7
- package/dist/api/route-manager.d.mts +15 -10
- package/dist/api/route-manager.d.ts +15 -10
- package/dist/api/route-manager.mjs +6 -6
- package/dist/api/runtime.cjs +7 -5
- package/dist/api/runtime.d.mts +7 -66
- package/dist/api/runtime.d.ts +7 -66
- package/dist/api/runtime.mjs +7 -5
- package/dist/api.cjs +9 -9
- package/dist/api.d.mts +8 -9
- package/dist/api.d.ts +8 -9
- package/dist/api.mjs +8 -8
- package/dist/{app-q4rmZlXK.d.mts → app-BukwkFIu.d.mts} +52 -12
- package/dist/{app-DgotYGbq.d.ts → app-Yfa2dsFy.d.ts} +52 -12
- package/dist/app-markdown.cjs +6 -6
- package/dist/app-markdown.d.mts +5 -6
- package/dist/app-markdown.d.ts +5 -6
- package/dist/app-markdown.mjs +5 -5
- package/dist/{chunk-XV5DJTBX.mjs → chunk-276VJSM6.mjs} +627 -260
- package/dist/{chunk-36MK5YCW.cjs → chunk-2YTDKNH3.cjs} +547 -240
- package/dist/{chunk-VHANUNEG.mjs → chunk-35GKZR22.mjs} +2 -2
- package/dist/{chunk-LR5QSC2P.mjs → chunk-35WV46VL.mjs} +399 -92
- package/dist/{chunk-UX5S4JEO.cjs → chunk-42NHY7HW.cjs} +57 -7
- package/dist/{chunk-U4PTAHW3.mjs → chunk-4E5AEDKY.mjs} +7 -11
- package/dist/{chunk-NGVORZVZ.mjs → chunk-4E5WBPEG.mjs} +73 -351
- package/dist/{chunk-AQZFOP7S.mjs → chunk-4GLOOWKE.mjs} +5 -5
- package/dist/{chunk-7BT4H4P7.cjs → chunk-4NU4GGTC.cjs} +2 -2
- package/dist/{chunk-AGC75XAE.mjs → chunk-4WCZJQUO.mjs} +55 -5
- package/dist/chunk-4WQ6PGSJ.cjs +367 -0
- package/dist/{chunk-QCFFHV5H.mjs → chunk-4WVJLURN.mjs} +1 -1
- package/dist/chunk-6SJ2KJTA.mjs +314 -0
- package/dist/chunk-75RZHGLS.cjs +135 -0
- package/dist/{chunk-P64MIF5B.cjs → chunk-ADEA7PN3.cjs} +483 -60
- package/dist/{chunk-YQVSHTMR.mjs → chunk-AJQTP4OO.mjs} +1 -1
- package/dist/{chunk-TA5G2HWD.cjs → chunk-AO6RYU5N.cjs} +31 -28
- package/dist/{chunk-MOKLYNHV.cjs → chunk-BO36SELV.cjs} +6 -6
- package/dist/{chunk-7Y6ZNFPX.mjs → chunk-BPOF5U4N.mjs} +17 -7
- package/dist/{chunk-JHWOVJ3M.mjs → chunk-BUGNQIHC.mjs} +5 -0
- package/dist/{chunk-TDFPACVX.cjs → chunk-CBJJH36A.cjs} +50 -25
- package/dist/{chunk-VKNHTSAP.cjs → chunk-CGBDNNSM.cjs} +2 -2
- package/dist/chunk-CI6E3UOH.cjs +314 -0
- package/dist/{chunk-QZCT2CQ4.mjs → chunk-CXEN47J3.mjs} +64 -2
- package/dist/{chunk-ATK2R4CH.cjs → chunk-D227TIEN.cjs} +14 -4
- package/dist/{chunk-QGYRXFU2.cjs → chunk-D2BB47NB.cjs} +8 -8
- package/dist/chunk-DTSROJ5J.mjs +367 -0
- package/dist/{chunk-ODBZYBAB.cjs → chunk-DZ5ZVB2K.cjs} +1 -1
- package/dist/{chunk-ROUTX2E5.cjs → chunk-ECKF2BAM.cjs} +18 -5
- package/dist/{chunk-3LUF2PE2.cjs → chunk-EK4QAEFZ.cjs} +67 -5
- package/dist/{chunk-VVBO3QH7.mjs → chunk-ENLZ4R3Y.mjs} +10 -1
- package/dist/{chunk-XXJU7FCC.cjs → chunk-EUV4YR3V.cjs} +2 -2
- package/dist/{chunk-HR5KPHC2.mjs → chunk-EWET4D2Y.mjs} +1 -1
- package/dist/{chunk-PXKIEXZD.mjs → chunk-F5QO4FNE.mjs} +1 -1
- package/dist/{chunk-MIDIZJZC.cjs → chunk-FO427P6I.cjs} +22 -12
- package/dist/{chunk-AWC4VUZL.cjs → chunk-GQ3Z3IZI.cjs} +14 -14
- package/dist/{chunk-JDPAKVS4.mjs → chunk-GQRWBCWK.mjs} +8 -5
- package/dist/{chunk-75WGQVQA.cjs → chunk-HITLGIAO.cjs} +10 -1
- package/dist/{chunk-WNNYOOIB.mjs → chunk-HOXTWRGB.mjs} +1 -1
- package/dist/{chunk-KROWKCUH.cjs → chunk-JGLC4TO3.cjs} +8 -1
- package/dist/{chunk-QJ3J6MZT.cjs → chunk-JNUWCDTF.cjs} +8 -8
- package/dist/{chunk-BTAG7LI7.cjs → chunk-JZVADIOD.cjs} +2 -2
- package/dist/{chunk-EM6SBQKM.cjs → chunk-KIIMAWOJ.cjs} +37 -2
- package/dist/{chunk-43FMW62B.mjs → chunk-KMTGADN3.mjs} +28 -0
- package/dist/{chunk-GOABMOX3.mjs → chunk-LSZAVSGY.mjs} +468 -45
- package/dist/{chunk-2NQQ5H5G.cjs → chunk-M7MKQXAF.cjs} +2 -1
- package/dist/{chunk-GNSDTTWZ.mjs → chunk-MKYBIIAQ.mjs} +30 -5
- package/dist/{chunk-ZHPHJPQP.cjs → chunk-MRMI32SN.cjs} +88 -366
- package/dist/{chunk-7M52YUMY.cjs → chunk-N2NAS2AM.cjs} +2 -2
- package/dist/{chunk-SJVKK4JE.cjs → chunk-NMHWYWDR.cjs} +1144 -777
- package/dist/chunk-NRDBW4MP.mjs +45 -0
- package/dist/{chunk-657WJNRY.mjs → chunk-O6I6VWKK.mjs} +20 -5
- package/dist/{chunk-O27L4YAA.mjs → chunk-O6WAEAX3.mjs} +2 -2
- package/dist/chunk-OFZUJMCU.mjs +601 -0
- package/dist/{chunk-ZKP7C2B6.mjs → chunk-OHLSEQ57.mjs} +22 -13
- package/dist/{chunk-X242HVD5.mjs → chunk-OO7GXVSR.mjs} +1 -1
- package/dist/chunk-PTZ2TVNE.cjs +178 -0
- package/dist/{chunk-3ATMYLLJ.mjs → chunk-Q2KB32T4.mjs} +1 -1
- package/dist/{chunk-LHODW25H.mjs → chunk-QORUJDIV.mjs} +2 -2
- package/dist/{chunk-UBO4SGH4.mjs → chunk-RHAZ22ZN.mjs} +2 -1
- package/dist/{chunk-G26MUMKL.cjs → chunk-S6VYG6XU.cjs} +23 -8
- package/dist/{chunk-6VVL3MHY.mjs → chunk-SC2WYWPF.mjs} +1 -1
- package/dist/{chunk-MPEYMSCF.cjs → chunk-SDOTRX3V.cjs} +5 -5
- package/dist/{chunk-BMWDEBXO.cjs → chunk-SHLXACIO.cjs} +31 -3
- package/dist/{chunk-LMJ7VRHZ.mjs → chunk-T4OGRVNS.mjs} +13 -3
- package/dist/{chunk-T5CERMEH.cjs → chunk-T5OJPTVN.cjs} +2 -2
- package/dist/{chunk-Z2YLTERK.cjs → chunk-TE2G5ION.cjs} +6 -6
- package/dist/chunk-UH6QN5NL.mjs +178 -0
- package/dist/{chunk-PQDFUSXD.cjs → chunk-UVW64BCB.cjs} +44 -35
- package/dist/{chunk-VCCUOMQN.mjs → chunk-VILIPRS6.mjs} +1 -1
- package/dist/{chunk-A5FGU2WU.cjs → chunk-VQLJWDVW.cjs} +19 -23
- package/dist/{chunk-VPTDD5XF.cjs → chunk-WBKEZXWE.cjs} +5 -0
- package/dist/{chunk-K3F2E6GS.cjs → chunk-WC5UV2HQ.cjs} +2 -2
- package/dist/chunk-WWFTAUFG.cjs +45 -0
- package/dist/{chunk-ZUSJDQ2Q.mjs → chunk-WWIKMBRN.mjs} +1 -1
- package/dist/{chunk-3VSKDFAT.mjs → chunk-WZ77PUAM.mjs} +1 -1
- package/dist/{chunk-CLJYVZAD.mjs → chunk-XCMCS4DA.mjs} +11 -1
- package/dist/{chunk-F6OHXPWR.mjs → chunk-YFILVET3.mjs} +8 -1
- package/dist/{chunk-DZ4DTRJ5.cjs → chunk-YKX5BK66.cjs} +7 -7
- package/dist/chunk-YSLWRWWP.cjs +601 -0
- package/dist/{chunk-LI2LMOLR.mjs → chunk-YWMZUGIS.mjs} +18 -5
- package/dist/chunk-ZLAT2CWY.mjs +135 -0
- package/dist/{chunk-XF7Q24PF.mjs → chunk-ZMMBIVQM.mjs} +35 -0
- package/dist/{chunk-U74I55WB.cjs → chunk-ZWM5KGAA.cjs} +19 -9
- package/dist/{client-plugins-CLObcuCq.d.mts → client-plugins-C3mK9Pol.d.mts} +300 -7
- package/dist/{client-plugins-DZjHC4Mi.d.ts → client-plugins-r1mOtSC1.d.ts} +300 -7
- package/dist/client-plugins.d.mts +4 -5
- package/dist/client-plugins.d.ts +4 -5
- package/dist/client.cjs +5 -5
- package/dist/client.d.mts +8 -9
- package/dist/client.d.ts +8 -9
- package/dist/client.mjs +4 -4
- package/dist/config.d.mts +4 -5
- package/dist/config.d.ts +4 -5
- package/dist/{devtools-RNXCTS4R.mjs → devtools-ERIKFEXX.mjs} +11 -10
- package/dist/{devtools-HU6Y2MNV.cjs → devtools-JZJJY5CK.cjs} +12 -11
- package/dist/docs.cjs +15 -14
- package/dist/docs.d.mts +41 -4
- package/dist/docs.d.ts +41 -4
- package/dist/docs.mjs +14 -13
- 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-a-8Z5kZU.d.mts → index-BJJfLxJo.d.mts} +2 -2
- package/dist/{index-BWVfxIsO.d.ts → index-CwoOP-MW.d.ts} +2 -2
- package/dist/index.cjs +51 -44
- package/dist/index.d.mts +20 -21
- package/dist/index.d.ts +20 -21
- package/dist/index.mjs +50 -43
- package/dist/integrations.cjs +7 -3
- package/dist/integrations.d.mts +4 -5
- package/dist/integrations.d.ts +4 -5
- package/dist/integrations.mjs +6 -2
- package/dist/internal/app-markdown-runtime.cjs +5 -5
- package/dist/internal/app-markdown-runtime.d.mts +5 -6
- package/dist/internal/app-markdown-runtime.d.ts +5 -6
- package/dist/internal/app-markdown-runtime.mjs +4 -4
- package/dist/internal/build-runtime.cjs +32 -30
- package/dist/internal/build-runtime.d.mts +6 -7
- package/dist/internal/build-runtime.d.ts +6 -7
- package/dist/internal/build-runtime.mjs +31 -29
- package/dist/internal/cli-runtime.cjs +17 -16
- package/dist/internal/cli-runtime.mjs +16 -15
- package/dist/internal/client-error-overlay.cjs +6 -6
- package/dist/internal/client-error-overlay.mjs +2 -2
- package/dist/internal/client-runtime.cjs +2 -2
- package/dist/internal/client-runtime.mjs +1 -1
- package/dist/internal/compression-runtime.d.mts +4 -5
- package/dist/internal/compression-runtime.d.ts +4 -5
- package/dist/internal/config-runtime.cjs +12 -11
- package/dist/internal/config-runtime.d.mts +5 -6
- package/dist/internal/config-runtime.d.ts +5 -6
- package/dist/internal/config-runtime.mjs +11 -10
- package/dist/internal/isolated-boundary.cjs +3 -2
- package/dist/internal/isolated-boundary.d.mts +1 -1
- package/dist/internal/isolated-boundary.d.ts +1 -1
- package/dist/internal/isolated-boundary.mjs +2 -1
- 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 +63 -25
- package/dist/internal/production-runtime.d.mts +117 -37
- package/dist/internal/production-runtime.d.ts +117 -37
- package/dist/internal/production-runtime.mjs +65 -27
- package/dist/internal/server-tree.cjs +12 -0
- package/dist/internal/server-tree.d.mts +27 -0
- package/dist/internal/server-tree.d.ts +27 -0
- package/dist/internal/server-tree.mjs +12 -0
- package/dist/{layers-BRQF5ETU.mjs → layers-UTB43B7A.mjs} +1 -1
- package/dist/layers-VUWIOFEO.cjs +18 -0
- package/dist/markdown.cjs +4 -4
- package/dist/markdown.d.mts +4 -5
- package/dist/markdown.d.ts +4 -5
- package/dist/markdown.mjs +3 -3
- package/dist/middleware.cjs +7 -7
- package/dist/middleware.d.mts +6 -7
- package/dist/middleware.d.ts +6 -7
- package/dist/middleware.mjs +6 -6
- package/dist/navigation.cjs +5 -5
- package/dist/navigation.d.mts +7 -8
- package/dist/navigation.d.ts +7 -8
- package/dist/navigation.mjs +4 -4
- package/dist/{nitro-HSAQFXSS.cjs → nitro-7F65EZZS.cjs} +3 -3
- package/dist/{nitro-4XGPNIK4.mjs → nitro-MPZJGPXK.mjs} +2 -2
- package/dist/{observability-BupkiN0m.d.mts → observability-CoXunYhS.d.mts} +4 -3
- package/dist/{observability-BupkiN0m.d.ts → observability-CoXunYhS.d.ts} +4 -3
- package/dist/observability.d.mts +1 -1
- package/dist/observability.d.ts +1 -1
- package/dist/plugin.cjs +28 -26
- package/dist/plugin.d.mts +4 -5
- package/dist/plugin.d.ts +4 -5
- package/dist/plugin.mjs +27 -25
- package/dist/{production-runtime-CysZl3EV.d.mts → production-runtime-CCeVZXst.d.mts} +4 -4
- package/dist/{production-runtime-BU5ETAK9.d.ts → production-runtime-DPnsggY3.d.ts} +4 -4
- package/dist/query/client.cjs +6 -6
- package/dist/query/client.mjs +2 -2
- package/dist/{render-plan-CKr4ltOd.d.mts → render-plan-BuGaPFe6.d.mts} +1 -1
- package/dist/{render-plan-D72O1qm4.d.ts → render-plan-Cw4f5E_R.d.ts} +1 -1
- package/dist/renderer/react/server.cjs +10 -4
- package/dist/renderer/react/server.d.mts +2 -1
- package/dist/renderer/react/server.d.ts +2 -1
- package/dist/renderer/react/server.mjs +7 -1
- package/dist/renderer-client.cjs +5 -5
- package/dist/renderer-client.d.mts +6 -7
- package/dist/renderer-client.d.ts +6 -7
- package/dist/renderer-client.mjs +2 -2
- package/dist/renderer.d.mts +2 -0
- package/dist/renderer.d.ts +2 -0
- package/dist/{request-DbyOYI2j.d.ts → request-Bkg-hERy.d.ts} +1 -1
- package/dist/{request-Be83WafN.d.mts → request-CsGARcAw.d.mts} +1 -1
- package/dist/request.d.mts +5 -6
- package/dist/request.d.ts +5 -6
- package/dist/{resolver-PPEeiJ6M.d.ts → resolver-DadfRL6F.d.ts} +1 -1
- package/dist/{resolver-DhW0CqZN.d.mts → resolver-khasx3fU.d.mts} +1 -1
- package/dist/{route-rendering-CtVMpV-k.d.ts → route-rendering-BUZMH_64.d.ts} +1 -1
- package/dist/{route-rendering-BG56SzvJ.d.mts → route-rendering-f11yh5dp.d.mts} +1 -1
- package/dist/{router-D94-SDlW.d.ts → router-B8CR9GbD.d.ts} +1 -1
- package/dist/{router-ALUvm8gC.d.mts → router-Cp6yRE8A.d.mts} +1 -1
- package/dist/routes.d.mts +4 -5
- package/dist/routes.d.ts +4 -5
- package/dist/{runtime-BirxPwbZ.d.ts → runtime-BgDQzBiu.d.ts} +2 -2
- package/dist/runtime-CAEv36S_.d.mts +69 -0
- package/dist/runtime-CQVsT330.d.ts +69 -0
- package/dist/{runtime-AOJge4vQ.d.mts → runtime-CV2UCV-5.d.mts} +2 -2
- package/dist/server-action-security.cjs +3 -3
- package/dist/server-action-security.mjs +2 -2
- package/dist/server-fn.cjs +4 -4
- package/dist/server-fn.mjs +3 -3
- package/dist/server-plugins.d.mts +5 -6
- package/dist/server-plugins.d.ts +5 -6
- package/dist/server-query.cjs +5 -5
- package/dist/server-query.mjs +4 -4
- package/dist/server.cjs +47 -45
- package/dist/server.d.mts +13 -14
- package/dist/server.d.ts +13 -14
- package/dist/server.mjs +30 -28
- package/dist/{spa-router-CxK3USIz.d.ts → spa-router-BuciWGCZ.d.ts} +3 -3
- package/dist/{spa-router-DbxNRKOB.d.mts → spa-router-DwbqGkGj.d.mts} +3 -3
- package/dist/testing.cjs +9 -9
- package/dist/testing.d.mts +4 -5
- package/dist/testing.d.ts +4 -5
- package/dist/testing.mjs +7 -7
- package/dist/{types-Z0aotQ8w.d.mts → types-CnH8DOqo.d.mts} +1 -1
- package/dist/{types-Z0aotQ8w.d.ts → types-CnH8DOqo.d.ts} +1 -1
- package/dist/{utils-4wVRcpOw.d.mts → utils-B9V0S_yL.d.mts} +1 -1
- package/dist/{utils-311Y8eoK.d.ts → utils-CaoWKtYM.d.ts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +28 -26
- package/dist/vite.d.mts +4 -5
- package/dist/vite.d.ts +4 -5
- package/dist/vite.mjs +27 -25
- package/dist/{workflows-CR9ex-gz.d.ts → workflows-jZ4BcdoZ.d.mts} +1 -1
- package/dist/{workflows-CR9ex-gz.d.mts → workflows-jZ4BcdoZ.d.ts} +1 -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 +9 -1
- package/dist/chunk-M64YUMA4.cjs +0 -58
- package/dist/chunk-QLQ32WC4.mjs +0 -58
- package/dist/layers-4PNE2HOY.cjs +0 -18
- package/dist/metadata-2HSU2i_w.d.mts +0 -52
- package/dist/metadata-Cjs8JMRM.d.ts +0 -52
- package/dist/types-DFbjpjXX.d.mts +0 -105
- package/dist/types-DFbjpjXX.d.ts +0 -105
- package/dist/{chunk-2F2ER724.cjs → chunk-BPMATOP2.cjs} +2 -2
- package/dist/{chunk-IHNMMXHV.mjs → chunk-OTC5BDGO.mjs} +3 -3
|
@@ -17,7 +17,7 @@ var _chunkLYLEZIG3cjs = require('./chunk-LYLEZIG3.cjs');
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkS6VYG6XUcjs = require('./chunk-S6VYG6XU.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
var _chunkWMAPPDMMcjs = require('./chunk-WMAPPDMM.cjs');
|
|
@@ -31,7 +31,7 @@ var _chunkSOR334EBcjs = require('./chunk-SOR334EB.cjs');
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _chunkSHLXACIOcjs = require('./chunk-SHLXACIO.cjs');
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
var _chunk5QIKR7RRcjs = require('./chunk-5QIKR7RR.cjs');
|
|
@@ -68,6 +68,15 @@ var _APIRouteManager = class _APIRouteManager {
|
|
|
68
68
|
this.i18n = options.i18n;
|
|
69
69
|
this.bodySizeLimit = options.bodySizeLimit;
|
|
70
70
|
this.basePath = options.basePath;
|
|
71
|
+
this.dispatch = options.dispatch;
|
|
72
|
+
}
|
|
73
|
+
/** Every file the current handlers were loaded from: route files and root routes files. */
|
|
74
|
+
getSourceFiles() {
|
|
75
|
+
const files = /* @__PURE__ */ new Set();
|
|
76
|
+
for (const sources of this.endpointSources.values()) {
|
|
77
|
+
for (const { filePath } of sources.values()) files.add(filePath);
|
|
78
|
+
}
|
|
79
|
+
return files;
|
|
71
80
|
}
|
|
72
81
|
/**
|
|
73
82
|
* Discover route.ts files in /app/api and explicit endpoints in root routes.ts
|
|
@@ -93,8 +102,9 @@ var _APIRouteManager = class _APIRouteManager {
|
|
|
93
102
|
await this.loadProgrammaticApiRoutes(appDir);
|
|
94
103
|
}
|
|
95
104
|
this.routes = new Map(
|
|
96
|
-
|
|
97
|
-
bodySizeLimit: this.bodySizeLimit
|
|
105
|
+
_chunkS6VYG6XUcjs.mergePluginAPIRoutes.call(void 0, [...this.routes.values()], this.plugins, void 0, {
|
|
106
|
+
bodySizeLimit: this.bodySizeLimit,
|
|
107
|
+
dispatch: this.dispatch
|
|
98
108
|
}).map((route) => [route.path, route])
|
|
99
109
|
);
|
|
100
110
|
} catch (error) {
|
|
@@ -140,7 +150,7 @@ var _APIRouteManager = class _APIRouteManager {
|
|
|
140
150
|
const routeModule = await this.loadModule(filePath);
|
|
141
151
|
const endpoints = {};
|
|
142
152
|
const availableMethods = [];
|
|
143
|
-
for (const method of
|
|
153
|
+
for (const method of _chunkS6VYG6XUcjs.API_ROUTE_METHODS) {
|
|
144
154
|
if (routeModule[method]) {
|
|
145
155
|
endpoints[method] = routeModule[method];
|
|
146
156
|
availableMethods.push(method);
|
|
@@ -256,11 +266,11 @@ var _APIRouteManager = class _APIRouteManager {
|
|
|
256
266
|
}
|
|
257
267
|
async loadModule(filePath) {
|
|
258
268
|
if (this.viteServer) {
|
|
259
|
-
return await
|
|
269
|
+
return await _chunkSHLXACIOcjs.loadFarmDevModule.call(void 0, this.viteServer, filePath);
|
|
260
270
|
}
|
|
261
271
|
return await import(
|
|
262
272
|
/* @vite-ignore */
|
|
263
|
-
|
|
273
|
+
_chunkSHLXACIOcjs.toFileModuleUrl.call(void 0, filePath)
|
|
264
274
|
);
|
|
265
275
|
}
|
|
266
276
|
addEndpoint(routePath, filePath, method, endpoint, appDir, runtimeConfig = {}) {
|
|
@@ -322,7 +332,7 @@ var _APIRouteManager = class _APIRouteManager {
|
|
|
322
332
|
const url = new URL(request.url);
|
|
323
333
|
const pathname = url.pathname;
|
|
324
334
|
const method = request.method.toUpperCase();
|
|
325
|
-
const match =
|
|
335
|
+
const match = _chunkS6VYG6XUcjs.matchAPIRouteAtBasePath.call(void 0, this.routes, pathname, this.basePath);
|
|
326
336
|
if (!match) {
|
|
327
337
|
return new Response(JSON.stringify({ error: "Not Found" }), {
|
|
328
338
|
status: 404,
|
|
@@ -330,19 +340,19 @@ var _APIRouteManager = class _APIRouteManager {
|
|
|
330
340
|
});
|
|
331
341
|
}
|
|
332
342
|
const { route, params } = match;
|
|
333
|
-
const endpoint =
|
|
343
|
+
const endpoint = _chunkS6VYG6XUcjs.resolveAPIRouteEndpoint.call(void 0, route, method);
|
|
334
344
|
if (!endpoint) {
|
|
335
345
|
return new Response(JSON.stringify({ error: "Method Not Allowed" }), {
|
|
336
346
|
status: 405,
|
|
337
347
|
headers: {
|
|
338
|
-
Allow:
|
|
348
|
+
Allow: _chunkS6VYG6XUcjs.getAllowedAPIRouteMethods.call(void 0, route).join(", "),
|
|
339
349
|
"Content-Type": "application/json"
|
|
340
350
|
}
|
|
341
351
|
});
|
|
342
352
|
}
|
|
343
353
|
const invoke = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
|
|
344
354
|
try {
|
|
345
|
-
return await
|
|
355
|
+
return await _chunkS6VYG6XUcjs.invokeAPIRouteEndpoint.call(void 0, endpoint, request, params, this.bodySizeLimit);
|
|
346
356
|
} catch (error) {
|
|
347
357
|
if (options.throwOnError) throw error;
|
|
348
358
|
console.error(`[API Error] ${pathname}:`, error);
|
|
@@ -364,7 +374,7 @@ var _APIRouteManager = class _APIRouteManager {
|
|
|
364
374
|
return Boolean(this.matchRoute(pathname));
|
|
365
375
|
}
|
|
366
376
|
matchRoute(pathname) {
|
|
367
|
-
return
|
|
377
|
+
return _chunkS6VYG6XUcjs.matchAPIRouteAtBasePath.call(void 0, this.routes, pathname, this.basePath);
|
|
368
378
|
}
|
|
369
379
|
/**
|
|
370
380
|
* Get all routes for client type generation
|
|
@@ -7,7 +7,7 @@ var _chunkSU7MH53Pcjs = require('./chunk-SU7MH53P.cjs');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkD227TIENcjs = require('./chunk-D227TIEN.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunkFFFW3OQ7cjs = require('./chunk-FFFW3OQ7.cjs');
|
|
@@ -52,7 +52,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, shouldBlockUnload, "shouldBlockUnload");
|
|
|
52
52
|
function navigateViaRouter(href, basePath, replace, options = {}) {
|
|
53
53
|
if (typeof window === "undefined") return;
|
|
54
54
|
const url = _chunkI57LW5VZcjs.applyFarmBasePath.call(void 0, href, basePath);
|
|
55
|
-
const spaRouter =
|
|
55
|
+
const spaRouter = _chunkD227TIENcjs.getInstalledFarmSPARouter.call(void 0, );
|
|
56
56
|
if (spaRouter) {
|
|
57
57
|
void spaRouter.navigate(url, {
|
|
58
58
|
replace,
|
|
@@ -65,7 +65,7 @@ function navigateViaRouter(href, basePath, replace, options = {}) {
|
|
|
65
65
|
} else {
|
|
66
66
|
window.history.pushState(null, "", url);
|
|
67
67
|
}
|
|
68
|
-
|
|
68
|
+
_chunkD227TIENcjs.notifyHistoryChange.call(void 0, "url-search");
|
|
69
69
|
}
|
|
70
70
|
_chunkS3JO3N4Hcjs.__name.call(void 0, navigateViaRouter, "navigateViaRouter");
|
|
71
71
|
function useRouter(options = {}) {
|
|
@@ -85,7 +85,7 @@ function useRouter(options = {}) {
|
|
|
85
85
|
setState(readRouterState(basePath, routeMatcher));
|
|
86
86
|
}, "handlePopState");
|
|
87
87
|
handlePopState();
|
|
88
|
-
const unsubscribe =
|
|
88
|
+
const unsubscribe = _chunkD227TIENcjs.subscribeHistoryChange.call(void 0, handlePopState);
|
|
89
89
|
return unsubscribe;
|
|
90
90
|
}, [basePath, routeMatcher]);
|
|
91
91
|
const push = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (href, navigateOptions) => {
|
|
@@ -96,11 +96,11 @@ function useRouter(options = {}) {
|
|
|
96
96
|
}, "replace");
|
|
97
97
|
const pushState = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (pageState, href) => {
|
|
98
98
|
if (typeof window === "undefined") return;
|
|
99
|
-
|
|
99
|
+
_chunkD227TIENcjs.getRouter.call(void 0, ).pushState(pageState, resolveClientHref(href, basePath));
|
|
100
100
|
}, "pushState");
|
|
101
101
|
const replaceState = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (pageState, href) => {
|
|
102
102
|
if (typeof window === "undefined") return;
|
|
103
|
-
|
|
103
|
+
_chunkD227TIENcjs.getRouter.call(void 0, ).replaceState(pageState, resolveClientHref(href, basePath));
|
|
104
104
|
}, "replaceState");
|
|
105
105
|
const back = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => {
|
|
106
106
|
if (typeof window !== "undefined") {
|
|
@@ -124,25 +124,25 @@ function useRouter(options = {}) {
|
|
|
124
124
|
}
|
|
125
125
|
_chunkS3JO3N4Hcjs.__name.call(void 0, useRouter, "useRouter");
|
|
126
126
|
function usePageState() {
|
|
127
|
-
const [state, setState] = _react.useState.call(void 0, () =>
|
|
127
|
+
const [state, setState] = _react.useState.call(void 0, () => _chunkD227TIENcjs.readPageState.call(void 0, ));
|
|
128
128
|
_react.useEffect.call(void 0, () => {
|
|
129
129
|
if (typeof window === "undefined") return;
|
|
130
130
|
const handlePopState = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => {
|
|
131
|
-
setState(
|
|
131
|
+
setState(_chunkD227TIENcjs.readPageState.call(void 0, ));
|
|
132
132
|
}, "handlePopState");
|
|
133
133
|
handlePopState();
|
|
134
|
-
return
|
|
134
|
+
return _chunkD227TIENcjs.subscribeHistoryChange.call(void 0, handlePopState);
|
|
135
135
|
}, []);
|
|
136
136
|
return state;
|
|
137
137
|
}
|
|
138
138
|
_chunkS3JO3N4Hcjs.__name.call(void 0, usePageState, "usePageState");
|
|
139
139
|
function useNavigation() {
|
|
140
140
|
const [state, setState] = _react.useState.call(void 0,
|
|
141
|
-
() =>
|
|
141
|
+
() => _chunkD227TIENcjs.getRouter.call(void 0, ).getNavigationState()
|
|
142
142
|
);
|
|
143
143
|
_react.useEffect.call(void 0, () => {
|
|
144
144
|
if (typeof window === "undefined") return;
|
|
145
|
-
return
|
|
145
|
+
return _chunkD227TIENcjs.getRouter.call(void 0, ).subscribeNavigation(setState);
|
|
146
146
|
}, []);
|
|
147
147
|
return state;
|
|
148
148
|
}
|
|
@@ -155,7 +155,7 @@ function useBlocker(options) {
|
|
|
155
155
|
if (typeof window === "undefined" || !active) {
|
|
156
156
|
return;
|
|
157
157
|
}
|
|
158
|
-
return
|
|
158
|
+
return _chunkD227TIENcjs.getRouter.call(void 0, ).addBlocker(
|
|
159
159
|
async (context) => {
|
|
160
160
|
const current = optionsRef.current;
|
|
161
161
|
const when = typeof current.when === "function" ? current.when(context) : current.when;
|
|
@@ -179,7 +179,7 @@ function useScrollRestoration(key) {
|
|
|
179
179
|
_react.useEffect.call(void 0, () => {
|
|
180
180
|
const element = ref.current;
|
|
181
181
|
if (!element) return;
|
|
182
|
-
return
|
|
182
|
+
return _chunkD227TIENcjs.getRouter.call(void 0, ).registerScrollElement(key, element);
|
|
183
183
|
}, [key]);
|
|
184
184
|
return ref;
|
|
185
185
|
}
|
|
@@ -201,7 +201,7 @@ function readRouterState(basePath, routeMatcher) {
|
|
|
201
201
|
pathname,
|
|
202
202
|
searchParams: url.searchParams,
|
|
203
203
|
params: _optionalChain([routeMatcher, 'optionalAccess', _5 => _5.match, 'call', _6 => _6(routePathname), 'optionalAccess', _7 => _7.params]) || {},
|
|
204
|
-
pageState: typeof window === "undefined" ? null :
|
|
204
|
+
pageState: typeof window === "undefined" ? null : _chunkD227TIENcjs.readPageState.call(void 0, )
|
|
205
205
|
};
|
|
206
206
|
}
|
|
207
207
|
_chunkS3JO3N4Hcjs.__name.call(void 0, readRouterState, "readRouterState");
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-IOEH4VWN.mjs";
|
|
7
7
|
import {
|
|
8
8
|
APIRouteConflictError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-T4OGRVNS.mjs";
|
|
10
10
|
import {
|
|
11
11
|
findProgrammaticRouteFilesInDir
|
|
12
12
|
} from "./chunk-UDNPLXW7.mjs";
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
matchAPIRouteAtBasePath,
|
|
21
21
|
mergePluginAPIRoutes,
|
|
22
22
|
resolveAPIRouteEndpoint
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-O6I6VWKK.mjs";
|
|
24
24
|
import {
|
|
25
25
|
isProgrammaticRoutesFileName
|
|
26
26
|
} from "./chunk-EA5K5BKU.mjs";
|
|
@@ -28,13 +28,13 @@ import {
|
|
|
28
28
|
createFarmRequestBodyErrorResponse,
|
|
29
29
|
readNodeRequestBody,
|
|
30
30
|
resolveFarmServerConfig
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-ZMMBIVQM.mjs";
|
|
32
32
|
import {
|
|
33
33
|
createCliColors
|
|
34
34
|
} from "./chunk-I2BHUNBU.mjs";
|
|
35
35
|
import {
|
|
36
36
|
loadFarmDevModule
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-KMTGADN3.mjs";
|
|
38
38
|
import {
|
|
39
39
|
toPosixPath,
|
|
40
40
|
toViteModuleId
|
|
@@ -187,7 +187,10 @@ function farmApiPlugin(options = {}) {
|
|
|
187
187
|
const plugins = options.plugins ? await (routePlugins ?? (routePlugins = Promise.resolve(options.plugins({ root: projectRoot })))) : [];
|
|
188
188
|
pluginMergedRoutes = plugins.length ? new Map(
|
|
189
189
|
mergePluginAPIRoutes([...apiRoutesCache.values()], plugins, void 0, {
|
|
190
|
-
bodySizeLimit
|
|
190
|
+
bodySizeLimit,
|
|
191
|
+
// A plugin calling an app endpoint (an MCP tool, say) goes back through this server,
|
|
192
|
+
// so the middleware that guards the endpoint's path runs for it.
|
|
193
|
+
dispatch: /* @__PURE__ */ __name((request) => fetch(request, { redirect: "manual" }), "dispatch")
|
|
191
194
|
}).map((route) => [route.path, route])
|
|
192
195
|
) : null;
|
|
193
196
|
const totalEndpoints = Array.from(servedRoutes().values()).reduce(
|
|
@@ -40,7 +40,16 @@ async function hydrateFarmDocsAdapterRuntime() {
|
|
|
40
40
|
}
|
|
41
41
|
_chunkS3JO3N4Hcjs.__name.call(void 0, generateFarmDocsAdapterClientRuntime, "generateFarmDocsAdapterClientRuntime");
|
|
42
42
|
|
|
43
|
+
// src/docs/config-secrets.ts
|
|
44
|
+
function isSecretDocsConfigKey(key) {
|
|
45
|
+
const normalized = key.replace(/[-_]/g, "").toLowerCase();
|
|
46
|
+
if (!normalized || normalized.endsWith("env")) return false;
|
|
47
|
+
return /apikey|token|secret|password|authorization|credential/.test(normalized);
|
|
48
|
+
}
|
|
49
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, isSecretDocsConfigKey, "isSecretDocsConfigKey");
|
|
50
|
+
|
|
51
|
+
|
|
43
52
|
|
|
44
53
|
|
|
45
54
|
|
|
46
|
-
exports.getFarmDocsAdapterConfigModule = getFarmDocsAdapterConfigModule; exports.generateFarmDocsAdapterClientRuntime = generateFarmDocsAdapterClientRuntime;
|
|
55
|
+
exports.getFarmDocsAdapterConfigModule = getFarmDocsAdapterConfigModule; exports.generateFarmDocsAdapterClientRuntime = generateFarmDocsAdapterClientRuntime; exports.isSecretDocsConfigKey = isSecretDocsConfigKey;
|
|
@@ -137,7 +137,14 @@ function getEventTargetAssetUrl(value) {
|
|
|
137
137
|
return void 0;
|
|
138
138
|
}
|
|
139
139
|
const tagName = typeof target.tagName === "string" ? target.tagName.toLowerCase() : "";
|
|
140
|
-
if (tagName
|
|
140
|
+
if (tagName === "script") {
|
|
141
|
+
if (target.type !== "module" && target.noModule !== true) return void 0;
|
|
142
|
+
} else if (tagName === "link") {
|
|
143
|
+
const rel = typeof target.rel === "string" ? target.rel.toLowerCase().split(/\s+/) : [];
|
|
144
|
+
if (!rel.some((value2) => ["stylesheet", "modulepreload", "preload"].includes(value2))) {
|
|
145
|
+
return void 0;
|
|
146
|
+
}
|
|
147
|
+
} else {
|
|
141
148
|
return void 0;
|
|
142
149
|
}
|
|
143
150
|
return typeof target.src === "string" && target.src ? target.src : typeof target.href === "string" && target.href ? target.href : void 0;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } 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 _chunkXSIRSMAScjs = require('./chunk-XSIRSMAS.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkE2ROOWQCcjs = require('./chunk-E2ROOWQC.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkJSROZYYOcjs = require('./chunk-JSROZYYO.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _chunkSYQ3MOWWcjs = require('./chunk-SYQ3MOWW.cjs');
|
|
@@ -20,13 +20,13 @@ var _chunkTIWHTW3Qcjs = require('./chunk-TIWHTW3Q.cjs');
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var _chunkWBKEZXWEcjs = require('./chunk-WBKEZXWE.cjs');
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
var _chunkPSV6XKPOcjs = require('./chunk-PSV6XKPO.cjs');
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
var
|
|
29
|
+
var _chunkM7MKQXAFcjs = require('./chunk-M7MKQXAF.cjs');
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
var _chunkSJNMVDDFcjs = require('./chunk-SJNMVDDF.cjs');
|
|
@@ -727,7 +727,7 @@ async function createRouteTypeDeclarations(options, outPath) {
|
|
|
727
727
|
}
|
|
728
728
|
);
|
|
729
729
|
for (const file of routeModuleFiles) {
|
|
730
|
-
if (
|
|
730
|
+
if (_chunkM7MKQXAFcjs.parseRouteSlotFile.call(void 0, file)) continue;
|
|
731
731
|
const route = _chunk5QIKR7RRcjs.parseRoutePath.call(void 0, file);
|
|
732
732
|
const pattern = createRoutePattern(route);
|
|
733
733
|
routeModulePatterns.add(pattern);
|
|
@@ -1089,8 +1089,8 @@ async function generateFarmTypeArtifacts(options) {
|
|
|
1089
1089
|
const shouldGenerateEnv = options.env !== false;
|
|
1090
1090
|
const shouldGenerateImages = options.images !== false;
|
|
1091
1091
|
const shouldGenerateI18n = options.i18n !== false && _optionalChain([options, 'access', _46 => _46.i18nConfig, 'optionalAccess', _47 => _47.enabled]);
|
|
1092
|
-
const sourceRoots =
|
|
1093
|
-
const appDirs =
|
|
1092
|
+
const sourceRoots = _chunkWBKEZXWEcjs.getFarmSourceRoots.call(void 0, { root, srcDir, layers: options.layers });
|
|
1093
|
+
const appDirs = _chunkWBKEZXWEcjs.getFarmAppDirectories.call(void 0, { root, srcDir, layers: options.layers });
|
|
1094
1094
|
const result = {
|
|
1095
1095
|
apiRoutes: [],
|
|
1096
1096
|
stalePaths: []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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 _chunk42NHY7HWcjs = require('./chunk-42NHY7HW.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
@@ -11,7 +11,7 @@ var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
|
11
11
|
var _url = require('url');
|
|
12
12
|
async function createFarmMarkdownRouteModuleFromFile(filePath, options = {}) {
|
|
13
13
|
const source = await _promises.readFile.call(void 0, filePath, "utf8");
|
|
14
|
-
return
|
|
14
|
+
return _chunk42NHY7HWcjs.createFarmMarkdownRouteModule.call(void 0, {
|
|
15
15
|
source,
|
|
16
16
|
filePath,
|
|
17
17
|
components: options.components,
|
|
@@ -118,6 +118,15 @@ var DEFAULT_FARM_SERVER_REQUEST_TIMEOUT = 3e5;
|
|
|
118
118
|
var DEFAULT_FARM_SERVER_KEEP_ALIVE_TIMEOUT = 5e3;
|
|
119
119
|
var DEFAULT_FARM_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT = 3e4;
|
|
120
120
|
var MAX_FARM_SERVER_TIMEOUT = 2147483647;
|
|
121
|
+
function createFarmWeakETag(body) {
|
|
122
|
+
let hash = 2166136261;
|
|
123
|
+
for (let index = 0; index < body.length; index++) {
|
|
124
|
+
hash ^= body.charCodeAt(index);
|
|
125
|
+
hash = Math.imul(hash, 16777619);
|
|
126
|
+
}
|
|
127
|
+
return `W/"${(hash >>> 0).toString(16).padStart(8, "0")}"`;
|
|
128
|
+
}
|
|
129
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, createFarmWeakETag, "createFarmWeakETag");
|
|
121
130
|
function matchesFarmIfNoneMatch(value, etag) {
|
|
122
131
|
const expected = parseEntityTag(trimOptionalWhitespace(etag));
|
|
123
132
|
if (!expected) return false;
|
|
@@ -419,6 +428,30 @@ async function readNodeRequestBody(request, limit) {
|
|
|
419
428
|
});
|
|
420
429
|
}
|
|
421
430
|
_chunkS3JO3N4Hcjs.__name.call(void 0, readNodeRequestBody, "readNodeRequestBody");
|
|
431
|
+
function createFarmNodeRequestBodyStream(request) {
|
|
432
|
+
let iterator;
|
|
433
|
+
return new ReadableStream(
|
|
434
|
+
{
|
|
435
|
+
async pull(controller) {
|
|
436
|
+
_nullishCoalesce(iterator, () => ( (iterator = request[Symbol.asyncIterator]())));
|
|
437
|
+
const { value, done } = await iterator.next();
|
|
438
|
+
if (done) {
|
|
439
|
+
controller.close();
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
controller.enqueue(
|
|
443
|
+
value instanceof Uint8Array ? value : new TextEncoder().encode(String(value))
|
|
444
|
+
);
|
|
445
|
+
},
|
|
446
|
+
async cancel(reason) {
|
|
447
|
+
await _optionalChain([iterator, 'optionalAccess', _31 => _31.return, 'optionalCall', _32 => _32(reason)]);
|
|
448
|
+
}
|
|
449
|
+
},
|
|
450
|
+
// No eager pull: the request stays untouched until the handler reads it.
|
|
451
|
+
{ highWaterMark: 0 }
|
|
452
|
+
);
|
|
453
|
+
}
|
|
454
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, createFarmNodeRequestBodyStream, "createFarmNodeRequestBodyStream");
|
|
422
455
|
function createFarmRequestBodyErrorResponse(error) {
|
|
423
456
|
if (!(error instanceof FarmRequestBodyError)) return null;
|
|
424
457
|
return new Response(error.status === 413 ? "Payload Too Large" : "Bad Request", {
|
|
@@ -432,7 +465,7 @@ function createFarmRequestBodyErrorResponse(error) {
|
|
|
432
465
|
}
|
|
433
466
|
_chunkS3JO3N4Hcjs.__name.call(void 0, createFarmRequestBodyErrorResponse, "createFarmRequestBodyErrorResponse");
|
|
434
467
|
function validateContentLength(value, limit) {
|
|
435
|
-
const contentLength = _optionalChain([value, 'optionalAccess',
|
|
468
|
+
const contentLength = _optionalChain([value, 'optionalAccess', _33 => _33.trim, 'call', _34 => _34()]);
|
|
436
469
|
if (!contentLength) return;
|
|
437
470
|
if (!/^\d+$/.test(contentLength)) {
|
|
438
471
|
throw new FarmRequestBodyError("INVALID_CONTENT_LENGTH", 400, "Invalid content-length header");
|
|
@@ -467,4 +500,6 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, throwIfAborted, "throwIfAborted");
|
|
|
467
500
|
|
|
468
501
|
|
|
469
502
|
|
|
470
|
-
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
exports.setRequestContext = setRequestContext; exports.getRequestContext = getRequestContext; exports.hasRequestContext = hasRequestContext; exports.deleteRequestContext = deleteRequestContext; exports.clearRequestContext = clearRequestContext; exports.getRequestContextSnapshot = getRequestContextSnapshot; exports.copyRequestContext = copyRequestContext; exports.createFarmNodeRequestAbortSignal = createFarmNodeRequestAbortSignal; exports.DEFAULT_FARM_SERVER_BODY_SIZE_LIMIT = DEFAULT_FARM_SERVER_BODY_SIZE_LIMIT; exports.createFarmWeakETag = createFarmWeakETag; exports.matchesFarmIfNoneMatch = matchesFarmIfNoneMatch; exports.resolveFarmServerConfig = resolveFarmServerConfig; exports.parseBodySizeLimit = parseBodySizeLimit; exports.cloneFarmRequestWithContext = cloneFarmRequestWithContext; exports.bufferFarmRequestBody = bufferFarmRequestBody; exports.readFarmRequestBody = readFarmRequestBody; exports.readNodeRequestBody = readNodeRequestBody; exports.createFarmNodeRequestBodyStream = createFarmNodeRequestBodyStream; exports.createFarmRequestBodyErrorResponse = createFarmRequestBodyErrorResponse;
|
|
@@ -34,6 +34,33 @@ async function loadFarmDevModule(server, id, environmentName = "ssr") {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
__name(loadFarmDevModule, "loadFarmDevModule");
|
|
37
|
+
function invalidateFarmDevDependents(server, file, targets, environmentName = "ssr") {
|
|
38
|
+
const environment = server.environments[environmentName];
|
|
39
|
+
const graph = environment?.moduleGraph;
|
|
40
|
+
if (!graph || targets.size === 0) return [];
|
|
41
|
+
const posix = /* @__PURE__ */ __name((filePath) => filePath.replace(/\\/g, "/"), "posix");
|
|
42
|
+
const byFile = new Map([...targets].map((target) => [posix(target), target]));
|
|
43
|
+
const reached = /* @__PURE__ */ new Set();
|
|
44
|
+
const seen = /* @__PURE__ */ new Set();
|
|
45
|
+
const queue = [...graph.getModulesByFile(posix(file)) ?? []];
|
|
46
|
+
while (queue.length > 0) {
|
|
47
|
+
const node = queue.pop();
|
|
48
|
+
if (seen.has(node)) continue;
|
|
49
|
+
seen.add(node);
|
|
50
|
+
const target = node.file ? byFile.get(posix(node.file)) : void 0;
|
|
51
|
+
if (target) reached.add(target);
|
|
52
|
+
queue.push(...node.importers);
|
|
53
|
+
}
|
|
54
|
+
if (reached.size === 0) return [];
|
|
55
|
+
const evaluatedModules = environment.runner?.evaluatedModules;
|
|
56
|
+
for (const node of seen) {
|
|
57
|
+
graph.invalidateModule(node);
|
|
58
|
+
const evaluated = node.id ? evaluatedModules?.getModuleById(node.id) : void 0;
|
|
59
|
+
if (evaluated) evaluatedModules.invalidateModule(evaluated);
|
|
60
|
+
}
|
|
61
|
+
return [...reached];
|
|
62
|
+
}
|
|
63
|
+
__name(invalidateFarmDevDependents, "invalidateFarmDevDependents");
|
|
37
64
|
function invalidateFailedFarmDevModules(server) {
|
|
38
65
|
for (const entry of Object.values(server.environments)) {
|
|
39
66
|
const environment = entry;
|
|
@@ -62,6 +89,7 @@ __name(toFileModuleUrl, "toFileModuleUrl");
|
|
|
62
89
|
export {
|
|
63
90
|
FarmDevEnvironmentError,
|
|
64
91
|
loadFarmDevModule,
|
|
92
|
+
invalidateFarmDevDependents,
|
|
65
93
|
invalidateFailedFarmDevModules,
|
|
66
94
|
toFileModuleUrl
|
|
67
95
|
};
|