@farm.js/core 0.1.75 → 0.1.77
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.d-Djvao5eV.d.ts → agent-mcp.d-B1h3RznZ.d.ts} +1 -1
- package/dist/{agent-mcp.d-wA13pwmS.d.mts → agent-mcp.d-WFQotg8M.d.mts} +1 -1
- package/dist/agent-runtime.cjs +2 -2
- package/dist/agent-runtime.d.mts +7 -5
- package/dist/agent-runtime.d.ts +7 -5
- package/dist/agent-runtime.mjs +1 -1
- package/dist/{analyzer-LJHMFCDW.mjs → analyzer-64YS2OXQ.mjs} +2 -2
- package/dist/analyzer-HTNXLX6N.cjs +16 -0
- package/dist/api/node.d.mts +9 -7
- package/dist/api/node.d.ts +9 -7
- package/dist/api/route-manager.d.mts +9 -7
- package/dist/api/route-manager.d.ts +9 -7
- package/dist/api/runtime.d.mts +8 -6
- package/dist/api/runtime.d.ts +8 -6
- package/dist/api.d.mts +10 -8
- package/dist/api.d.ts +10 -8
- package/dist/{app-manifest.d-DIuqSi9k.d.mts → app-manifest.d-EZEYG-tD.d.mts} +1 -1
- package/dist/{app-manifest.d-BukcP_EV.d.ts → app-manifest.d-Ktsqsuk9.d.ts} +1 -1
- package/dist/app-markdown.d.mts +8 -6
- package/dist/app-markdown.d.ts +8 -6
- package/dist/{app.d-BQqmM6Gy.d.ts → app.d-CSh3y8w8.d.ts} +5 -4
- package/dist/{app.d-YVuFb10p.d.mts → app.d-DTkqYcIr.d.mts} +5 -4
- package/dist/{chunk-CL2ONP73.cjs → chunk-2PE5STAR.cjs} +36 -27
- package/dist/{chunk-HV2WZFUW.mjs → chunk-2QPTZMGK.mjs} +1 -1
- package/dist/{chunk-E7VF3LQ5.mjs → chunk-4STJ6LGR.mjs} +13 -1
- package/dist/{chunk-LQBV2Y37.mjs → chunk-65XXHTVJ.mjs} +38 -2
- package/dist/{chunk-XGDI4OUB.cjs → chunk-6ZFGWB75.cjs} +13 -1
- package/dist/{chunk-IDOUCM2X.mjs → chunk-7EXFAJST.mjs} +57 -44
- package/dist/{chunk-HVJ7IACB.cjs → chunk-7SAGHWWU.cjs} +2 -2
- package/dist/{chunk-GNY7BO7R.mjs → chunk-BTHNOAOF.mjs} +2 -2
- package/dist/{chunk-TJVUTGED.mjs → chunk-D2RLADWN.mjs} +285 -93
- package/dist/chunk-DS2KZ5BT.mjs +16 -0
- package/dist/{chunk-WHCNJVYU.cjs → chunk-DSRWQ4SJ.cjs} +3 -3
- package/dist/{chunk-ZPCZWEU3.cjs → chunk-FCHEO3LG.cjs} +2 -2
- package/dist/{chunk-75XSZIRE.mjs → chunk-FD6BMUA3.mjs} +35 -26
- package/dist/{chunk-4T2RB4JA.mjs → chunk-FNVGK72M.mjs} +5 -5
- package/dist/{chunk-TFEODQLG.mjs → chunk-FPGSIOWS.mjs} +2 -2
- package/dist/{chunk-4BS3HSY7.cjs → chunk-FTQUNBRN.cjs} +2 -2
- package/dist/{chunk-ZV76IQG7.cjs → chunk-FVVGEGQ2.cjs} +2 -2
- package/dist/{chunk-7564NP5Z.cjs → chunk-GC2BSXQS.cjs} +39 -3
- package/dist/{chunk-HT2SZKXG.mjs → chunk-H76C5AOU.mjs} +12 -0
- package/dist/{chunk-OFIFRB62.mjs → chunk-IHMSLS2O.mjs} +36 -20
- package/dist/{chunk-BUC3FDYC.cjs → chunk-IIVZTGGP.cjs} +2 -2
- package/dist/{chunk-6MATGOEF.mjs → chunk-IXC6WDMT.mjs} +1 -1
- package/dist/{chunk-KPYQ32BA.cjs → chunk-JD42G6BN.cjs} +2 -2
- package/dist/{chunk-WJ5CCQBM.cjs → chunk-LTDMJD2F.cjs} +4 -4
- package/dist/{chunk-XX6ZA2IO.cjs → chunk-MQW4LHJR.cjs} +1 -1
- package/dist/{chunk-BNTRXJL4.cjs → chunk-NQZWLIPT.cjs} +3 -3
- package/dist/{chunk-QGYHE6VJ.mjs → chunk-NTHAZLVS.mjs} +28 -27
- package/dist/{chunk-OCLCA3X3.mjs → chunk-OCKQ3YOH.mjs} +1 -1
- package/dist/{chunk-PBQGIA27.cjs → chunk-OQZF6H6G.cjs} +4 -4
- package/dist/{chunk-YSTKSZD2.mjs → chunk-ORWXJDUN.mjs} +1 -1
- package/dist/{chunk-JNZDTE75.cjs → chunk-PMKUTZGR.cjs} +8 -8
- package/dist/{chunk-4ZSZI6XL.cjs → chunk-PUEPDMWY.cjs} +16 -16
- package/dist/{chunk-MTBDJ326.cjs → chunk-QMR2TUVZ.cjs} +13 -1
- package/dist/{chunk-A5F55ZFA.mjs → chunk-QODXWUGQ.mjs} +2 -2
- package/dist/chunk-RFXEQYPH.cjs +723 -0
- package/dist/{chunk-IK33N2AN.cjs → chunk-SIYELCIX.cjs} +158 -142
- package/dist/{chunk-MFU7SXAB.mjs → chunk-SL2BSPDJ.mjs} +1 -1
- package/dist/{chunk-H7QY7ZE4.mjs → chunk-SMYDCZBW.mjs} +1 -1
- package/dist/{chunk-GLF44JKY.mjs → chunk-TQOYIPMQ.mjs} +1 -1
- package/dist/{chunk-IVBDRAOR.cjs → chunk-UYACD4SH.cjs} +1 -1
- package/dist/{chunk-B4CWYGCG.mjs → chunk-WHNNDFCJ.mjs} +1 -1
- package/dist/{chunk-4MU4QCX4.mjs → chunk-WXMR3OHY.mjs} +1 -1
- package/dist/{chunk-YL7BKHYE.cjs → chunk-WZVESREI.cjs} +291 -278
- package/dist/chunk-XRRHPBG2.cjs +16 -0
- package/dist/{chunk-NPGXX7HN.cjs → chunk-YROK6CJC.cjs} +7 -7
- package/dist/{chunk-OZARLCYQ.cjs → chunk-YRQ44JTF.cjs} +179 -178
- package/dist/{chunk-2NQ3S2SJ.mjs → chunk-YTGNMKRA.mjs} +1 -1
- package/dist/{chunk-YCNKS6SD.mjs → chunk-ZBE5EHVJ.mjs} +4 -4
- package/dist/cli-runtime.d-DljFfr8T.d.ts +537 -0
- package/dist/cli-runtime.d-HSkdfvoq.d.mts +537 -0
- package/dist/client/lifecycle.d.mts +1 -1
- package/dist/client/lifecycle.d.ts +1 -1
- package/dist/{client-component.d-BeqVuqy2.d.mts → client-component.d-B-1dIlsw.d.mts} +2 -137
- package/dist/{client-component.d-CZ1NpHAY.d.ts → client-component.d-_otXB__v.d.ts} +2 -137
- package/dist/{client-plugins.d-ChceYO9t.d.mts → client-plugins.d-BmBzvfSP.d.mts} +4 -4
- package/dist/{client-plugins.d-D9kWC0QB.d.ts → client-plugins.d-MjxlvbCK.d.ts} +4 -4
- package/dist/client-plugins.d.mts +7 -5
- package/dist/client-plugins.d.ts +7 -5
- package/dist/client.d.mts +12 -10
- package/dist/client.d.ts +12 -10
- package/dist/config.d.mts +7 -5
- package/dist/config.d.ts +7 -5
- package/dist/desktop.d.mts +8 -6
- package/dist/desktop.d.ts +8 -6
- package/dist/{devtools-B3W3DLPG.mjs → devtools-7LHXG2VS.mjs} +4 -3
- package/dist/{devtools-T5I2WHRX.cjs → devtools-NNQN66EZ.cjs} +5 -4
- package/dist/docs.cjs +6 -5
- package/dist/docs.d.mts +10 -65
- package/dist/docs.d.ts +10 -65
- package/dist/docs.mjs +5 -4
- package/dist/environment/vite.cjs +5 -4
- package/dist/environment/vite.mjs +4 -3
- package/dist/handler.d-C53zFDmp.d.ts +62 -0
- package/dist/handler.d-CaYopqaD.d.mts +62 -0
- package/dist/{headers.d-Aux4JVnm.d.ts → headers.d-BvtpC90T.d.ts} +1 -1
- package/dist/{headers.d-BawakaPv.d.mts → headers.d-MBkD9ZLf.d.mts} +1 -1
- package/dist/index.cjs +31 -24
- package/dist/index.d-2hQpPZ-P.d.ts +16 -0
- package/dist/index.d-Mikf-tdP.d.mts +16 -0
- package/dist/index.d.mts +39 -556
- package/dist/index.d.ts +39 -556
- package/dist/index.mjs +30 -23
- package/dist/integrations/orm.cjs +4 -3
- package/dist/integrations/orm.d.mts +6 -4
- package/dist/integrations/orm.d.ts +6 -4
- package/dist/integrations/orm.mjs +3 -2
- package/dist/integrations.cjs +2 -2
- package/dist/integrations.d.mts +7 -5
- package/dist/integrations.d.ts +7 -5
- package/dist/integrations.mjs +1 -1
- package/dist/internal/app-markdown-runtime.d.mts +8 -6
- package/dist/internal/app-markdown-runtime.d.ts +8 -6
- package/dist/internal/build-runtime.cjs +23 -22
- package/dist/internal/build-runtime.d.mts +10 -7
- package/dist/internal/build-runtime.d.ts +10 -7
- package/dist/internal/build-runtime.mjs +22 -21
- package/dist/internal/cli-runtime.cjs +17 -9
- package/dist/internal/cli-runtime.d.mts +46 -0
- package/dist/internal/cli-runtime.d.ts +46 -0
- package/dist/internal/cli-runtime.mjs +16 -8
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.d.mts +11 -9
- package/dist/internal/client-runtime.d.ts +11 -9
- package/dist/internal/compression-runtime.cjs +2 -2
- package/dist/internal/compression-runtime.d.mts +11 -6
- package/dist/internal/compression-runtime.d.ts +11 -6
- package/dist/internal/compression-runtime.mjs +1 -1
- package/dist/internal/config-runtime.cjs +6 -5
- package/dist/internal/config-runtime.d.mts +9 -7
- package/dist/internal/config-runtime.d.ts +9 -7
- package/dist/internal/config-runtime.mjs +5 -4
- package/dist/internal/infra-analytics-runtime.cjs +6 -6
- package/dist/internal/infra-analytics-runtime.mjs +4 -4
- 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 +8 -7
- package/dist/internal/production-runtime.d.mts +16 -14
- package/dist/internal/production-runtime.d.ts +16 -14
- package/dist/internal/production-runtime.mjs +7 -6
- package/dist/internal/start-manifest.d.mts +7 -5
- package/dist/internal/start-manifest.d.ts +7 -5
- package/dist/{layers-XQ7VFMWO.mjs → layers-I7VE5Q2Y.mjs} +2 -1
- package/dist/layers-WP5K5F7W.cjs +21 -0
- package/dist/{lifecycle.d-OtGWAvJT.d.ts → lifecycle.d-VzcXyEyn.d.mts} +1 -1
- package/dist/{lifecycle.d-OtGWAvJT.d.mts → lifecycle.d-VzcXyEyn.d.ts} +1 -1
- package/dist/markdown.d.mts +7 -5
- package/dist/markdown.d.ts +7 -5
- package/dist/middleware.d.mts +7 -5
- package/dist/middleware.d.ts +7 -5
- package/dist/{mount.d-BomEt2kV.d.mts → mount.d-DsP46XCy.d.mts} +1 -1
- package/dist/{mount.d-Ca8eb9GB.d.ts → mount.d-GU-tNxbE.d.ts} +1 -1
- package/dist/{navigation-delegate.d-B1ujRkYo.d.mts → navigation-delegate.d-CUtNOYLi.d.mts} +1 -1
- package/dist/{navigation-delegate.d-DJCC2jXF.d.ts → navigation-delegate.d-DsxNPrLT.d.ts} +1 -1
- package/dist/navigation.d.mts +10 -8
- package/dist/navigation.d.ts +10 -8
- package/dist/{plugin-FD4S2QEJ.mjs → plugin-2KWR2X4B.mjs} +1 -1
- package/dist/{plugin-5BNPYCER.cjs → plugin-MW7IDV76.cjs} +2 -2
- package/dist/plugin.cjs +15 -14
- package/dist/plugin.d.mts +11 -8
- package/dist/plugin.d.ts +11 -8
- package/dist/plugin.mjs +14 -13
- package/dist/{render-plan.d-BxRbaxYA.d.ts → render-plan.d-8K6S0h0L.d.ts} +1 -1
- package/dist/{render-plan.d-CFod_Zf-.d.mts → render-plan.d-B7Xp-PPW.d.mts} +1 -1
- package/dist/renderer-client.d.mts +10 -8
- package/dist/renderer-client.d.ts +10 -8
- package/dist/{request.d-DRQgaXGG.d.ts → request.d-CuQxmOqX.d.ts} +1 -1
- package/dist/{request.d-DG4TeXMM.d.mts → request.d-nhqciCAz.d.mts} +1 -1
- package/dist/request.d.mts +8 -6
- package/dist/request.d.ts +8 -6
- package/dist/{route-rendering.d-Db07UNVG.d.ts → route-rendering.d-BSsdDYC1.d.ts} +1 -1
- package/dist/{route-rendering.d-BXtZKgqu.d.mts → route-rendering.d-CeF1FOnl.d.mts} +1 -1
- package/dist/{router.d-BC3hyjf0.d.ts → router.d-C7yGlhDL.d.ts} +1 -1
- package/dist/{router.d-B61kXqxJ.d.mts → router.d-D462OX24.d.mts} +1 -1
- package/dist/routes.d.mts +7 -5
- package/dist/routes.d.ts +7 -5
- package/dist/{rsc-pipeline-VENBFYXW.cjs → rsc-pipeline-7PV6ARDS.cjs} +8 -7
- package/dist/{rsc-pipeline-LJ7YCGY6.mjs → rsc-pipeline-EZU4W4RL.mjs} +7 -6
- package/dist/{runtime-UNDTYGQS.cjs → runtime-QOE3NRXF.cjs} +8 -7
- package/dist/{runtime-4DWUXZHS.mjs → runtime-RWLFEPS3.mjs} +5 -4
- package/dist/{runtime.d-Cl6EBGmC.d.mts → runtime.d-C-BHQMy5.d.mts} +1 -1
- package/dist/{runtime.d-SC95yDzr.d.ts → runtime.d-CORDJQMy.d.ts} +1 -1
- package/dist/{schema.d-Dny9pnrm.d.mts → schema.d-BM-uVGpx.d.mts} +1 -1
- package/dist/{schema.d-Dny9pnrm.d.ts → schema.d-BM-uVGpx.d.ts} +1 -1
- package/dist/schema.d.mts +1 -1
- package/dist/schema.d.ts +1 -1
- package/dist/{index.d-r1MLpgeE.d.ts → server-components-status.d-BJ6huueH.d.mts} +2 -15
- package/dist/{index.d-Ccq42CPU.d.mts → server-components-status.d-BbADqqjq.d.ts} +2 -15
- package/dist/server-plugins.cjs +2 -2
- package/dist/server-plugins.d.mts +9 -7
- package/dist/server-plugins.d.ts +9 -7
- package/dist/server-plugins.mjs +1 -1
- package/dist/server.cjs +46 -39
- package/dist/server.d.mts +17 -14
- package/dist/server.d.ts +17 -14
- package/dist/server.mjs +24 -17
- package/dist/session-OU7M4CIF.cjs +24 -0
- package/dist/{session-QZXZOPR2.mjs → session-WPAT6H76.mjs} +3 -2
- package/dist/{spa-router.d-DrlXgDqY.d.mts → spa-router.d-DfjafHyX.d.mts} +4 -4
- package/dist/{spa-router.d-DwM02Mwd.d.ts → spa-router.d-DyGJLQc_.d.ts} +4 -4
- package/dist/ssg.d-D11lz_wr.d.ts +138 -0
- package/dist/ssg.d-iiLTyLAO.d.mts +138 -0
- package/dist/storage.cjs +9 -2
- package/dist/storage.d.mts +266 -34
- package/dist/storage.d.ts +266 -34
- package/dist/storage.mjs +8 -1
- package/dist/testing.d.mts +7 -5
- package/dist/testing.d.ts +7 -5
- package/dist/types.d-DC97bnjj.d.mts +131 -0
- package/dist/types.d-DC97bnjj.d.ts +131 -0
- package/dist/{utils.d-C6KXz3uB.d.ts → utils.d-D-GQeEfa.d.ts} +1 -1
- package/dist/{utils.d-CHzxAshz.d.mts → utils.d-fW-95yEh.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +15 -14
- package/dist/vite.d.mts +12 -9
- package/dist/vite.d.ts +12 -9
- package/dist/vite.mjs +14 -13
- package/package.json +11 -4
- package/dist/analyzer-23GCBYFI.cjs +0 -16
- package/dist/chunk-JMYXO572.cjs +0 -531
- package/dist/layers-7P4RLKVX.cjs +0 -20
- package/dist/session-2Q72D4QV.cjs +0 -23
- package/dist/types.d-BnIqOn9w.d.mts +0 -73
- package/dist/types.d-BnIqOn9w.d.ts +0 -73
- /package/dist/{chunk-6DBBMQWT.cjs → chunk-AF3PNVVF.cjs} +0 -0
- /package/dist/{chunk-5O3SK3ZC.mjs → chunk-BEXH6BGH.mjs} +0 -0
- /package/dist/{chunk-PMU4U2W2.cjs → chunk-PC5OZ4YR.cjs} +0 -0
- /package/dist/{chunk-Z5ZZAGIH.mjs → chunk-RL47VZ6J.mjs} +0 -0
package/dist/vite.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
shouldEmitFarmClientRootHmr,
|
|
12
12
|
transformIsolatedClientBoundaryModule,
|
|
13
13
|
withFarmRequestTracing
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-7EXFAJST.mjs";
|
|
15
15
|
import "./chunk-QVBXTSIZ.mjs";
|
|
16
16
|
import "./chunk-4PWGLPL6.mjs";
|
|
17
17
|
import "./chunk-UD6KTSJS.mjs";
|
|
@@ -23,25 +23,25 @@ import {
|
|
|
23
23
|
resolveFarmClientCacheAdapterEntry,
|
|
24
24
|
resolveFarmImageProviderForRuntime,
|
|
25
25
|
resolveFarmImageServerRuntime
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
26
|
+
} from "./chunk-IHMSLS2O.mjs";
|
|
27
|
+
import "./chunk-SL2BSPDJ.mjs";
|
|
28
|
+
import "./chunk-RL47VZ6J.mjs";
|
|
29
29
|
import "./chunk-SMUW7UST.mjs";
|
|
30
30
|
import "./chunk-UB7RVEMX.mjs";
|
|
31
31
|
import {
|
|
32
32
|
readRouteRenderingDirectiveFromFile
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-65XXHTVJ.mjs";
|
|
34
34
|
import "./chunk-3GMD2E4Q.mjs";
|
|
35
35
|
import "./chunk-ZJGFAW5U.mjs";
|
|
36
36
|
import "./chunk-HQ2VAJLW.mjs";
|
|
37
37
|
import "./chunk-UTUS6JUH.mjs";
|
|
38
|
-
import "./chunk-
|
|
38
|
+
import "./chunk-H76C5AOU.mjs";
|
|
39
39
|
import "./chunk-LLZSYFOM.mjs";
|
|
40
40
|
import "./chunk-UUMKLGUU.mjs";
|
|
41
41
|
import "./chunk-ZXDX7VYZ.mjs";
|
|
42
|
-
import "./chunk-
|
|
42
|
+
import "./chunk-BTHNOAOF.mjs";
|
|
43
43
|
import "./chunk-JA6RML7C.mjs";
|
|
44
|
-
import "./chunk-
|
|
44
|
+
import "./chunk-ORWXJDUN.mjs";
|
|
45
45
|
import "./chunk-HONTCUK6.mjs";
|
|
46
46
|
import "./chunk-L4RTTTVE.mjs";
|
|
47
47
|
import "./chunk-GNZIAJGB.mjs";
|
|
@@ -56,7 +56,7 @@ import "./chunk-HZOMT5DY.mjs";
|
|
|
56
56
|
import {
|
|
57
57
|
collectFarmClientPackageImports,
|
|
58
58
|
resolveFarmClientOptimizeDeps
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-QODXWUGQ.mjs";
|
|
60
60
|
import "./chunk-S32PDOLO.mjs";
|
|
61
61
|
import "./chunk-ZEWWZJPZ.mjs";
|
|
62
62
|
import "./chunk-EJCVG25Z.mjs";
|
|
@@ -70,7 +70,7 @@ import "./chunk-SQ5O7I3L.mjs";
|
|
|
70
70
|
import "./chunk-S7QEQCVV.mjs";
|
|
71
71
|
import "./chunk-22W4FNTG.mjs";
|
|
72
72
|
import "./chunk-4QENVMG7.mjs";
|
|
73
|
-
import "./chunk-
|
|
73
|
+
import "./chunk-4STJ6LGR.mjs";
|
|
74
74
|
import "./chunk-GCRT6GJG.mjs";
|
|
75
75
|
import {
|
|
76
76
|
getPublicFarmImageConfig,
|
|
@@ -89,14 +89,15 @@ import "./chunk-3AJQFVWW.mjs";
|
|
|
89
89
|
import "./chunk-WXFY5JIY.mjs";
|
|
90
90
|
import "./chunk-YP7YO3S3.mjs";
|
|
91
91
|
import "./chunk-YWPNIYUP.mjs";
|
|
92
|
-
import "./chunk-
|
|
92
|
+
import "./chunk-BEXH6BGH.mjs";
|
|
93
93
|
import "./chunk-H4WUWLQR.mjs";
|
|
94
94
|
import "./chunk-CZOXZ6WQ.mjs";
|
|
95
95
|
import "./chunk-WNLPQW7W.mjs";
|
|
96
96
|
import "./chunk-F3N52U7S.mjs";
|
|
97
97
|
import "./chunk-VZBAW44S.mjs";
|
|
98
98
|
import "./chunk-K63OWRY2.mjs";
|
|
99
|
-
import "./chunk-
|
|
99
|
+
import "./chunk-D2RLADWN.mjs";
|
|
100
|
+
import "./chunk-DS2KZ5BT.mjs";
|
|
100
101
|
import "./chunk-BMQAPZXD.mjs";
|
|
101
102
|
import "./chunk-GAAK3HDZ.mjs";
|
|
102
103
|
import "./chunk-PKXGFQZS.mjs";
|
|
@@ -138,7 +139,7 @@ import {
|
|
|
138
139
|
import "./chunk-D2LCAV6L.mjs";
|
|
139
140
|
import "./chunk-H3ASZDT7.mjs";
|
|
140
141
|
import "./chunk-2DA7CLY7.mjs";
|
|
141
|
-
import "./chunk-
|
|
142
|
+
import "./chunk-SMYDCZBW.mjs";
|
|
142
143
|
import "./chunk-VDQZV6BX.mjs";
|
|
143
144
|
import "./chunk-QPNVDSFZ.mjs";
|
|
144
145
|
import "./chunk-GYMGK467.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farm.js/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.77",
|
|
4
4
|
"description": "The core of Farm.js, the framework for the web and agents",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"@farm.js/core",
|
|
@@ -230,7 +230,7 @@
|
|
|
230
230
|
"./dist/internal/production-node-env.d.ts"
|
|
231
231
|
],
|
|
232
232
|
"internal/cli-runtime": [
|
|
233
|
-
"./dist/
|
|
233
|
+
"./dist/internal/cli-runtime.d.ts"
|
|
234
234
|
],
|
|
235
235
|
"internal/request-cookies": [
|
|
236
236
|
"./dist/internal/request-cookies.d.ts"
|
|
@@ -820,7 +820,7 @@
|
|
|
820
820
|
"require": "./dist/internal/production-node-env.cjs"
|
|
821
821
|
},
|
|
822
822
|
"./internal/cli-runtime": {
|
|
823
|
-
"types": "./dist/
|
|
823
|
+
"types": "./dist/internal/cli-runtime.d.ts",
|
|
824
824
|
"import": "./dist/internal/cli-runtime.mjs",
|
|
825
825
|
"require": "./dist/internal/cli-runtime.cjs"
|
|
826
826
|
},
|
|
@@ -834,11 +834,13 @@
|
|
|
834
834
|
"access": "public"
|
|
835
835
|
},
|
|
836
836
|
"dependencies": {
|
|
837
|
-
"@farm.js/islx": "0.0.
|
|
837
|
+
"@farm.js/islx": "0.0.25",
|
|
838
838
|
"@farming-labs/orm": "0.0.66",
|
|
839
839
|
"@farming-labs/orm-runtime": "0.0.66",
|
|
840
|
+
"@farming-labs/orm-sql": "0.0.66",
|
|
840
841
|
"@formatjs/icu-messageformat-parser": "3.5.15",
|
|
841
842
|
"@jridgewell/trace-mapping": "0.3.31",
|
|
843
|
+
"@libsql/core": "0.17.4",
|
|
842
844
|
"@mdx-js/mdx": "^3.1.1",
|
|
843
845
|
"@opentelemetry/api": "1.9.1",
|
|
844
846
|
"@vitejs/plugin-react": "6.1.2",
|
|
@@ -864,6 +866,7 @@
|
|
|
864
866
|
"devDependencies": {
|
|
865
867
|
"@clerk/react": "^6.4.3",
|
|
866
868
|
"@farming-labs/docs": "^0.2.143",
|
|
869
|
+
"@libsql/client": "0.17.4",
|
|
867
870
|
"@nestjs/common": "11.2.8",
|
|
868
871
|
"@nestjs/core": "11.2.8",
|
|
869
872
|
"@nestjs/platform-express": "11.2.8",
|
|
@@ -897,6 +900,7 @@
|
|
|
897
900
|
},
|
|
898
901
|
"peerDependencies": {
|
|
899
902
|
"@farming-labs/docs": "^0.2.118",
|
|
903
|
+
"@libsql/client": "^0.17.4",
|
|
900
904
|
"@tailwindcss/vite": "^4.3.3",
|
|
901
905
|
"@vercel/og": "^1.0.1",
|
|
902
906
|
"react": "^18.2.0 || ^19.0.0",
|
|
@@ -907,6 +911,9 @@
|
|
|
907
911
|
"@farming-labs/docs": {
|
|
908
912
|
"optional": true
|
|
909
913
|
},
|
|
914
|
+
"@libsql/client": {
|
|
915
|
+
"optional": true
|
|
916
|
+
},
|
|
910
917
|
"@tailwindcss/vite": {
|
|
911
918
|
"optional": true
|
|
912
919
|
},
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _chunkZV76IQG7cjs = require('./chunk-ZV76IQG7.cjs');
|
|
7
|
-
require('./chunk-WBTHHTBO.cjs');
|
|
8
|
-
require('./chunk-CCAUIBIS.cjs');
|
|
9
|
-
require('./chunk-IVBDRAOR.cjs');
|
|
10
|
-
require('./chunk-BTZ5O6VM.cjs');
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
exports.CORE_PORTABLE = _chunkZV76IQG7cjs.CORE_PORTABLE; exports.analyzeFarmMobileRoutes = _chunkZV76IQG7cjs.analyzeFarmMobileRoutes; exports.readAliases = _chunkZV76IQG7cjs.readAliases; exports.resolveFile = _chunkZV76IQG7cjs.resolveFile;
|
package/dist/chunk-JMYXO572.cjs
DELETED
|
@@ -1,531 +0,0 @@
|
|
|
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 _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; }// src/storage/index.ts
|
|
2
|
-
var _unstorage = require('unstorage');
|
|
3
|
-
var _memory = require('unstorage/drivers/memory'); var _memory2 = _interopRequireDefault(_memory);
|
|
4
|
-
var STORAGE_MODULES_KEY = /* @__PURE__ */ Symbol.for("farmjs.storage.modules");
|
|
5
|
-
function getRegisteredStorageModules() {
|
|
6
|
-
return globalThis[STORAGE_MODULES_KEY];
|
|
7
|
-
}
|
|
8
|
-
var loadModule = (specifier) => {
|
|
9
|
-
const registered = _optionalChain([getRegisteredStorageModules, 'call', _ => _(), 'optionalAccess', _2 => _2[specifier]]);
|
|
10
|
-
return registered ? registered() : import(
|
|
11
|
-
/* @vite-ignore */
|
|
12
|
-
specifier
|
|
13
|
-
);
|
|
14
|
-
};
|
|
15
|
-
function _registerFarmStorageModules(loaders) {
|
|
16
|
-
globalThis[STORAGE_MODULES_KEY] = {
|
|
17
|
-
...getRegisteredStorageModules(),
|
|
18
|
-
...loaders
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
var DATABASE_CONNECTORS = {
|
|
22
|
-
sqlite: {
|
|
23
|
-
connector: "node-sqlite",
|
|
24
|
-
module: "db0/connectors/node-sqlite"
|
|
25
|
-
},
|
|
26
|
-
"node-sqlite": {
|
|
27
|
-
connector: "node-sqlite",
|
|
28
|
-
module: "db0/connectors/node-sqlite"
|
|
29
|
-
},
|
|
30
|
-
sqlite3: {
|
|
31
|
-
connector: "sqlite3",
|
|
32
|
-
module: "db0/connectors/sqlite3"
|
|
33
|
-
},
|
|
34
|
-
"better-sqlite3": {
|
|
35
|
-
connector: "better-sqlite3",
|
|
36
|
-
module: "db0/connectors/better-sqlite3"
|
|
37
|
-
},
|
|
38
|
-
postgres: {
|
|
39
|
-
connector: "postgresql",
|
|
40
|
-
module: "db0/connectors/postgresql"
|
|
41
|
-
},
|
|
42
|
-
postgresql: {
|
|
43
|
-
connector: "postgresql",
|
|
44
|
-
module: "db0/connectors/postgresql"
|
|
45
|
-
},
|
|
46
|
-
pg: {
|
|
47
|
-
connector: "postgresql",
|
|
48
|
-
module: "db0/connectors/postgresql"
|
|
49
|
-
},
|
|
50
|
-
mysql: {
|
|
51
|
-
connector: "mysql2",
|
|
52
|
-
module: "db0/connectors/mysql2"
|
|
53
|
-
},
|
|
54
|
-
mysql2: {
|
|
55
|
-
connector: "mysql2",
|
|
56
|
-
module: "db0/connectors/mysql2"
|
|
57
|
-
},
|
|
58
|
-
pglite: {
|
|
59
|
-
connector: "pglite",
|
|
60
|
-
module: "db0/connectors/pglite"
|
|
61
|
-
},
|
|
62
|
-
planetscale: {
|
|
63
|
-
connector: "planetscale",
|
|
64
|
-
module: "db0/connectors/planetscale"
|
|
65
|
-
},
|
|
66
|
-
libsql: {
|
|
67
|
-
connector: "libsql",
|
|
68
|
-
module: "db0/connectors/libsql/node"
|
|
69
|
-
},
|
|
70
|
-
"libsql-node": {
|
|
71
|
-
connector: "libsql-node",
|
|
72
|
-
module: "db0/connectors/libsql/node"
|
|
73
|
-
},
|
|
74
|
-
"libsql-http": {
|
|
75
|
-
connector: "libsql-http",
|
|
76
|
-
module: "db0/connectors/libsql/http"
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
function createMemoryStorage() {
|
|
80
|
-
return _unstorage.createStorage.call(void 0, {
|
|
81
|
-
driver: _memory2.default.call(void 0, )
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
var GLOBAL_STORAGE_KEY = /* @__PURE__ */ Symbol.for("farmjs.storage.global");
|
|
85
|
-
function readGlobalStorage() {
|
|
86
|
-
return globalThis[GLOBAL_STORAGE_KEY];
|
|
87
|
-
}
|
|
88
|
-
function writeGlobalStorage(storage) {
|
|
89
|
-
globalThis[GLOBAL_STORAGE_KEY] = storage;
|
|
90
|
-
return storage;
|
|
91
|
-
}
|
|
92
|
-
function getActiveGlobalStorage() {
|
|
93
|
-
const existing = readGlobalStorage();
|
|
94
|
-
if (existing) {
|
|
95
|
-
return existing;
|
|
96
|
-
}
|
|
97
|
-
return writeGlobalStorage(createMemoryStorage());
|
|
98
|
-
}
|
|
99
|
-
var globalStorage = getActiveGlobalStorage();
|
|
100
|
-
function normalizeMountKey(base) {
|
|
101
|
-
return (base || "").trim().replace(/^[:/\\]+|[:/\\]+$/g, "").replace(/[\\/]+/g, ":");
|
|
102
|
-
}
|
|
103
|
-
function isDriverInstance(value) {
|
|
104
|
-
return !!value && typeof value === "object" && typeof value.getItem === "function" && typeof value.getKeys === "function";
|
|
105
|
-
}
|
|
106
|
-
function isStorageInstance(value) {
|
|
107
|
-
return !!value && typeof value === "object" && typeof value.mount === "function" && typeof value.getMount === "function";
|
|
108
|
-
}
|
|
109
|
-
function isStorageClient(value) {
|
|
110
|
-
return !!value && typeof value === "object" && value.kind === "farm-storage-client" && typeof value.resolveDriver === "function" && typeof value.createStorage === "function";
|
|
111
|
-
}
|
|
112
|
-
function isDatabaseDriverName(name) {
|
|
113
|
-
return name in DATABASE_CONNECTORS;
|
|
114
|
-
}
|
|
115
|
-
function extractDriverOptions(config) {
|
|
116
|
-
const source = config;
|
|
117
|
-
const {
|
|
118
|
-
client: _client,
|
|
119
|
-
driver: _driver,
|
|
120
|
-
mounts: _mounts,
|
|
121
|
-
options,
|
|
122
|
-
tableName: _tableName,
|
|
123
|
-
...inlineOptions
|
|
124
|
-
} = source;
|
|
125
|
-
const hasInlineOptions = Object.keys(inlineOptions).length > 0;
|
|
126
|
-
if (options && typeof options === "object" && !Array.isArray(options)) {
|
|
127
|
-
return hasInlineOptions ? { ...inlineOptions, ...options } : options;
|
|
128
|
-
}
|
|
129
|
-
if (hasInlineOptions) {
|
|
130
|
-
return inlineOptions;
|
|
131
|
-
}
|
|
132
|
-
return options;
|
|
133
|
-
}
|
|
134
|
-
async function loadBuiltinDriver(name, options) {
|
|
135
|
-
if (name === "memory") return _memory2.default.call(void 0, );
|
|
136
|
-
const modulePath = _unstorage.builtinDrivers[name];
|
|
137
|
-
if (!modulePath) {
|
|
138
|
-
throw new Error(`Unsupported storage driver "${name}".`);
|
|
139
|
-
}
|
|
140
|
-
const module = await loadModule(modulePath);
|
|
141
|
-
return module.default(options);
|
|
142
|
-
}
|
|
143
|
-
async function loadDatabaseDriver(config) {
|
|
144
|
-
const connectorEntry = DATABASE_CONNECTORS[config.driver];
|
|
145
|
-
const [{ createDatabase }, connectorModule, db0DriverModule] = await Promise.all([
|
|
146
|
-
loadModule("db0"),
|
|
147
|
-
loadModule(connectorEntry.module),
|
|
148
|
-
loadModule("unstorage/drivers/db0")
|
|
149
|
-
]);
|
|
150
|
-
const database = createDatabase(connectorModule.default(extractDriverOptions(config) || {}));
|
|
151
|
-
const driver = db0DriverModule.default({
|
|
152
|
-
database,
|
|
153
|
-
tableName: config.tableName
|
|
154
|
-
});
|
|
155
|
-
return {
|
|
156
|
-
...driver,
|
|
157
|
-
async dispose() {
|
|
158
|
-
await database.dispose();
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
async function resolveDriver(config) {
|
|
163
|
-
if (config && isStorageClient(config)) {
|
|
164
|
-
return config.resolveDriver();
|
|
165
|
-
}
|
|
166
|
-
const driverInput = _nullishCoalesce(_optionalChain([config, 'optionalAccess', _3 => _3.driver]), () => ( "memory"));
|
|
167
|
-
if (typeof driverInput === "function") {
|
|
168
|
-
return await driverInput();
|
|
169
|
-
}
|
|
170
|
-
if (isDriverInstance(driverInput)) {
|
|
171
|
-
return driverInput;
|
|
172
|
-
}
|
|
173
|
-
if (isDatabaseDriverName(driverInput)) {
|
|
174
|
-
return loadDatabaseDriver(config);
|
|
175
|
-
}
|
|
176
|
-
if (driverInput === "local") {
|
|
177
|
-
return loadBuiltinDriver("fs-lite", extractDriverOptions(config));
|
|
178
|
-
}
|
|
179
|
-
return loadBuiltinDriver(
|
|
180
|
-
driverInput,
|
|
181
|
-
extractDriverOptions(config)
|
|
182
|
-
);
|
|
183
|
-
}
|
|
184
|
-
var STORAGE_CLIENT_MODULES_KEY = /* @__PURE__ */ Symbol.for("farmjs.storage.clientModules");
|
|
185
|
-
function createStorageClientFromResolver(resolveDriver2, modules = []) {
|
|
186
|
-
let driverPromise;
|
|
187
|
-
let storagePromise;
|
|
188
|
-
const ensureDriver = () => {
|
|
189
|
-
if (driverPromise) return driverPromise;
|
|
190
|
-
const pending = Promise.resolve().then(resolveDriver2);
|
|
191
|
-
driverPromise = pending;
|
|
192
|
-
void pending.catch(() => {
|
|
193
|
-
if (driverPromise === pending) {
|
|
194
|
-
driverPromise = void 0;
|
|
195
|
-
storagePromise = void 0;
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
return pending;
|
|
199
|
-
};
|
|
200
|
-
const ensureStorage = () => {
|
|
201
|
-
if (storagePromise) return storagePromise;
|
|
202
|
-
const pending = ensureDriver().then(
|
|
203
|
-
(driver) => _unstorage.createStorage.call(void 0, {
|
|
204
|
-
driver
|
|
205
|
-
})
|
|
206
|
-
);
|
|
207
|
-
storagePromise = pending;
|
|
208
|
-
void pending.catch(() => {
|
|
209
|
-
if (storagePromise === pending) storagePromise = void 0;
|
|
210
|
-
});
|
|
211
|
-
return pending;
|
|
212
|
-
};
|
|
213
|
-
const target = {
|
|
214
|
-
kind: "farm-storage-client",
|
|
215
|
-
ready: ensureStorage,
|
|
216
|
-
createStorage: ensureStorage,
|
|
217
|
-
resolveDriver: ensureDriver,
|
|
218
|
-
[STORAGE_CLIENT_MODULES_KEY]: modules
|
|
219
|
-
};
|
|
220
|
-
return new Proxy(target, {
|
|
221
|
-
get(currentTarget, prop, receiver) {
|
|
222
|
-
if (prop === "then") {
|
|
223
|
-
return void 0;
|
|
224
|
-
}
|
|
225
|
-
if (Reflect.has(currentTarget, prop)) {
|
|
226
|
-
return Reflect.get(currentTarget, prop, receiver);
|
|
227
|
-
}
|
|
228
|
-
return (...args) => ensureStorage().then(async (storage) => {
|
|
229
|
-
const member = Reflect.get(storage, prop);
|
|
230
|
-
if (typeof member !== "function") {
|
|
231
|
-
return member;
|
|
232
|
-
}
|
|
233
|
-
const result = Reflect.apply(member, storage, args);
|
|
234
|
-
if (prop === "dispose") {
|
|
235
|
-
return Promise.resolve(result).finally(() => {
|
|
236
|
-
storagePromise = void 0;
|
|
237
|
-
driverPromise = void 0;
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
return result;
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
function defineStorageClient(resolveDriver2) {
|
|
246
|
-
return createStorageClientFromResolver(resolveDriver2);
|
|
247
|
-
}
|
|
248
|
-
function createStorageClient(config) {
|
|
249
|
-
return createStorageClientFromResolver(
|
|
250
|
-
() => resolveDriver(config),
|
|
251
|
-
_collectFarmStorageModules(config)
|
|
252
|
-
);
|
|
253
|
-
}
|
|
254
|
-
function driverStorage(driver) {
|
|
255
|
-
return defineStorageClient(() => typeof driver === "function" ? driver() : driver);
|
|
256
|
-
}
|
|
257
|
-
function databaseStorage(database, options = {}) {
|
|
258
|
-
return createStorageClientFromResolver(async () => {
|
|
259
|
-
const db0DriverModule = await loadModule("unstorage/drivers/db0");
|
|
260
|
-
const { dispose: _dispose, ...driver } = db0DriverModule.default({
|
|
261
|
-
database,
|
|
262
|
-
tableName: options.tableName
|
|
263
|
-
});
|
|
264
|
-
return driver;
|
|
265
|
-
}, ["unstorage/drivers/db0"]);
|
|
266
|
-
}
|
|
267
|
-
function memoryStorage() {
|
|
268
|
-
return createStorageClient({ driver: "memory" });
|
|
269
|
-
}
|
|
270
|
-
function localStorage(options = {}) {
|
|
271
|
-
return createStorageClient({
|
|
272
|
-
driver: "local",
|
|
273
|
-
...options
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
function sqliteStorage(options) {
|
|
277
|
-
return createStorageClient({
|
|
278
|
-
driver: "sqlite",
|
|
279
|
-
...options
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
function mysqlStorage(options) {
|
|
283
|
-
return createStorageClient({
|
|
284
|
-
driver: "mysql",
|
|
285
|
-
...options
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
function mysql2Storage(options) {
|
|
289
|
-
return mysqlStorage(options);
|
|
290
|
-
}
|
|
291
|
-
function postgresStorage(options) {
|
|
292
|
-
return createStorageClient({
|
|
293
|
-
driver: "postgres",
|
|
294
|
-
...options
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
function pgStorage(options) {
|
|
298
|
-
return postgresStorage(options);
|
|
299
|
-
}
|
|
300
|
-
function pgliteStorage(options) {
|
|
301
|
-
return createStorageClient({
|
|
302
|
-
driver: "pglite",
|
|
303
|
-
...options
|
|
304
|
-
});
|
|
305
|
-
}
|
|
306
|
-
function planetscaleStorage(options) {
|
|
307
|
-
return createStorageClient({
|
|
308
|
-
driver: "planetscale",
|
|
309
|
-
...options
|
|
310
|
-
});
|
|
311
|
-
}
|
|
312
|
-
function libsqlStorage(options) {
|
|
313
|
-
return createStorageClient({
|
|
314
|
-
driver: "libsql",
|
|
315
|
-
...options
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
function redisStorage(options) {
|
|
319
|
-
return createStorageClient({
|
|
320
|
-
driver: "redis",
|
|
321
|
-
...options
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
function s3Storage(options) {
|
|
325
|
-
return createStorageClient({
|
|
326
|
-
driver: "s3",
|
|
327
|
-
...options
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
function mongodbStorage(options) {
|
|
331
|
-
return createStorageClient({
|
|
332
|
-
driver: "mongodb",
|
|
333
|
-
...options
|
|
334
|
-
});
|
|
335
|
-
}
|
|
336
|
-
function upstashStorage(options) {
|
|
337
|
-
return createStorageClient({
|
|
338
|
-
driver: "upstash",
|
|
339
|
-
...options
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
function netlifyBlobsStorage(options) {
|
|
343
|
-
return createStorageClient({
|
|
344
|
-
driver: "netlify-blobs",
|
|
345
|
-
...options
|
|
346
|
-
});
|
|
347
|
-
}
|
|
348
|
-
function vercelKVStorage(options) {
|
|
349
|
-
return createStorageClient({
|
|
350
|
-
driver: "vercel-kv",
|
|
351
|
-
...options
|
|
352
|
-
});
|
|
353
|
-
}
|
|
354
|
-
function vercelBlobStorage(options) {
|
|
355
|
-
return createStorageClient({
|
|
356
|
-
driver: "vercel-blob",
|
|
357
|
-
...options
|
|
358
|
-
});
|
|
359
|
-
}
|
|
360
|
-
function collectDriverModules(config, modules) {
|
|
361
|
-
if (!config || typeof config !== "object") return;
|
|
362
|
-
if (isStorageClient(config)) {
|
|
363
|
-
const clientModules = config[STORAGE_CLIENT_MODULES_KEY];
|
|
364
|
-
if (Array.isArray(clientModules)) for (const module of clientModules) modules.add(module);
|
|
365
|
-
return;
|
|
366
|
-
}
|
|
367
|
-
if (isStorageInstance(config)) return;
|
|
368
|
-
const source = config;
|
|
369
|
-
const driver = source.driver;
|
|
370
|
-
if (typeof driver === "string") {
|
|
371
|
-
if (isDatabaseDriverName(driver)) {
|
|
372
|
-
modules.add("db0");
|
|
373
|
-
modules.add(DATABASE_CONNECTORS[driver].module);
|
|
374
|
-
modules.add("unstorage/drivers/db0");
|
|
375
|
-
} else if (driver !== "memory") {
|
|
376
|
-
const module = _unstorage.builtinDrivers[driver === "local" ? "fs-lite" : driver];
|
|
377
|
-
if (module) modules.add(module);
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
collectDriverModules(source.client, modules);
|
|
381
|
-
if (source.mounts && typeof source.mounts === "object") {
|
|
382
|
-
for (const mount of Object.values(source.mounts)) collectDriverModules(mount, modules);
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
function _collectFarmStorageModules(config) {
|
|
386
|
-
const modules = /* @__PURE__ */ new Set();
|
|
387
|
-
collectDriverModules(config, modules);
|
|
388
|
-
return [...modules];
|
|
389
|
-
}
|
|
390
|
-
async function mountNamespaces(storage, mounts) {
|
|
391
|
-
if (!mounts) {
|
|
392
|
-
return;
|
|
393
|
-
}
|
|
394
|
-
for (const [base, config] of Object.entries(mounts)) {
|
|
395
|
-
storage.mount(normalizeMountKey(base), await resolveDriver(config));
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
async function createFarmStorage(config = {}) {
|
|
399
|
-
if (isStorageInstance(config)) {
|
|
400
|
-
return config;
|
|
401
|
-
}
|
|
402
|
-
if (isStorageClient(config)) {
|
|
403
|
-
return config.createStorage();
|
|
404
|
-
}
|
|
405
|
-
const rootConfig = isStorageClient(config.client) ? config.client : config;
|
|
406
|
-
const storage = _unstorage.createStorage.call(void 0, {
|
|
407
|
-
driver: await resolveDriver(rootConfig)
|
|
408
|
-
});
|
|
409
|
-
try {
|
|
410
|
-
await mountNamespaces(storage, config.mounts);
|
|
411
|
-
} catch (error) {
|
|
412
|
-
await storage.dispose().catch(() => {
|
|
413
|
-
});
|
|
414
|
-
throw error;
|
|
415
|
-
}
|
|
416
|
-
return storage;
|
|
417
|
-
}
|
|
418
|
-
async function resolveStorageRuntimeClient(config) {
|
|
419
|
-
if (!config || isStorageInstance(config) || isStorageClient(config)) {
|
|
420
|
-
return void 0;
|
|
421
|
-
}
|
|
422
|
-
const client = config.client;
|
|
423
|
-
if (!client || isStorageInstance(client) || isStorageClient(client)) {
|
|
424
|
-
return void 0;
|
|
425
|
-
}
|
|
426
|
-
return typeof client === "function" ? await client() : client;
|
|
427
|
-
}
|
|
428
|
-
async function initStorage(config = {}) {
|
|
429
|
-
globalStorage = getActiveGlobalStorage();
|
|
430
|
-
const nextStorage = await createFarmStorage(config);
|
|
431
|
-
const previousStorage = globalStorage;
|
|
432
|
-
globalStorage = writeGlobalStorage(nextStorage);
|
|
433
|
-
if (previousStorage !== nextStorage) {
|
|
434
|
-
await previousStorage.dispose().catch(() => {
|
|
435
|
-
});
|
|
436
|
-
}
|
|
437
|
-
return globalStorage;
|
|
438
|
-
}
|
|
439
|
-
function getStorage(namespace) {
|
|
440
|
-
globalStorage = getActiveGlobalStorage();
|
|
441
|
-
const base = normalizeMountKey(namespace);
|
|
442
|
-
if (!base) {
|
|
443
|
-
if (namespace) {
|
|
444
|
-
throw new TypeError(
|
|
445
|
-
`getStorage(${JSON.stringify(namespace)}) names no namespace. Pass a non-empty name, or call getStorage() for the root store.`
|
|
446
|
-
);
|
|
447
|
-
}
|
|
448
|
-
return globalStorage;
|
|
449
|
-
}
|
|
450
|
-
const namespaced = _unstorage.prefixStorage.call(void 0, globalStorage, base);
|
|
451
|
-
const store = globalStorage;
|
|
452
|
-
const prefix = `${base}:`;
|
|
453
|
-
const stripPrefix = (key) => key.startsWith(prefix) ? key.slice(prefix.length) : key;
|
|
454
|
-
const viewUnwatchers = /* @__PURE__ */ new Set();
|
|
455
|
-
const releaseViewWatchers = async () => {
|
|
456
|
-
const current = [...viewUnwatchers];
|
|
457
|
-
viewUnwatchers.clear();
|
|
458
|
-
await Promise.all(current.map((unwatch) => unwatch()));
|
|
459
|
-
};
|
|
460
|
-
return {
|
|
461
|
-
...namespaced,
|
|
462
|
-
// Scope the wipe to the namespace instead of the whole storage, and keep
|
|
463
|
-
// the caller's base so `clear("sessions")` cannot take unrelated keys with
|
|
464
|
-
// it. Dropping the argument silently widens a targeted clear into a
|
|
465
|
-
// namespace-wide delete.
|
|
466
|
-
async clear(base2, opts) {
|
|
467
|
-
const keys = await namespaced.getKeys(base2);
|
|
468
|
-
await Promise.all(keys.map((key) => namespaced.removeItem(key, opts)));
|
|
469
|
-
},
|
|
470
|
-
async watch(callback) {
|
|
471
|
-
const unwatch = await store.watch((event, key) => {
|
|
472
|
-
if (key.startsWith(prefix)) callback(event, stripPrefix(key));
|
|
473
|
-
});
|
|
474
|
-
viewUnwatchers.add(unwatch);
|
|
475
|
-
return async () => {
|
|
476
|
-
viewUnwatchers.delete(unwatch);
|
|
477
|
-
await unwatch();
|
|
478
|
-
};
|
|
479
|
-
},
|
|
480
|
-
async unwatch() {
|
|
481
|
-
await releaseViewWatchers();
|
|
482
|
-
},
|
|
483
|
-
async dispose() {
|
|
484
|
-
await releaseViewWatchers();
|
|
485
|
-
},
|
|
486
|
-
getMount(key = "") {
|
|
487
|
-
return store.getMount(prefix + key);
|
|
488
|
-
},
|
|
489
|
-
getMounts(base2 = "", options) {
|
|
490
|
-
return store.getMounts(prefix + base2, options).map((mount) => ({ ...mount, base: stripPrefix(mount.base) }));
|
|
491
|
-
}
|
|
492
|
-
};
|
|
493
|
-
}
|
|
494
|
-
async function disposeStorage() {
|
|
495
|
-
globalStorage = getActiveGlobalStorage();
|
|
496
|
-
const previousStorage = globalStorage;
|
|
497
|
-
globalStorage = writeGlobalStorage(createMemoryStorage());
|
|
498
|
-
await previousStorage.dispose().catch(() => {
|
|
499
|
-
});
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
exports._registerFarmStorageModules = _registerFarmStorageModules; exports.defineStorageClient = defineStorageClient; exports.createStorageClient = createStorageClient; exports.driverStorage = driverStorage; exports.databaseStorage = databaseStorage; exports.memoryStorage = memoryStorage; exports.localStorage = localStorage; exports.sqliteStorage = sqliteStorage; exports.mysqlStorage = mysqlStorage; exports.mysql2Storage = mysql2Storage; exports.postgresStorage = postgresStorage; exports.pgStorage = pgStorage; exports.pgliteStorage = pgliteStorage; exports.planetscaleStorage = planetscaleStorage; exports.libsqlStorage = libsqlStorage; exports.redisStorage = redisStorage; exports.s3Storage = s3Storage; exports.mongodbStorage = mongodbStorage; exports.upstashStorage = upstashStorage; exports.netlifyBlobsStorage = netlifyBlobsStorage; exports.vercelKVStorage = vercelKVStorage; exports.vercelBlobStorage = vercelBlobStorage; exports._collectFarmStorageModules = _collectFarmStorageModules; exports.createFarmStorage = createFarmStorage; exports.resolveStorageRuntimeClient = resolveStorageRuntimeClient; exports.initStorage = initStorage; exports.getStorage = getStorage; exports.disposeStorage = disposeStorage;
|