@farm.js/core 0.1.0-beta.1 → 0.1.0-beta.3
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.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/api/route-manager.cjs +97 -5
- package/dist/api/route-manager.cjs.map +1 -1
- package/dist/api/route-manager.d.mts +3 -2
- package/dist/api/route-manager.d.ts +3 -2
- package/dist/api/route-manager.mjs +8 -8
- package/dist/api/runtime.cjs +441 -5
- package/dist/api/runtime.cjs.map +1 -1
- package/dist/api/runtime.d.mts +2 -16
- package/dist/api/runtime.d.ts +2 -16
- package/dist/api/runtime.mjs +7 -1
- package/dist/api.cjs +579 -263
- package/dist/api.cjs.map +1 -1
- package/dist/api.d.mts +4 -147
- package/dist/api.d.ts +4 -147
- package/dist/api.mjs +30 -20
- package/dist/{app-BiX4qb-d.d.mts → app-BB3Iu3xh.d.mts} +2 -2
- package/dist/{app-CFRNJXP1.d.ts → app-DOKxo-LH.d.ts} +2 -2
- package/dist/app-markdown.cjs +1 -1
- package/dist/app-markdown.cjs.map +1 -1
- package/dist/app-markdown.d.mts +1 -1
- package/dist/app-markdown.d.ts +1 -1
- package/dist/app-markdown.mjs +1 -1
- package/dist/cache.cjs +19 -0
- package/dist/cache.cjs.map +1 -1
- package/dist/cache.d.mts +21 -1
- package/dist/cache.d.ts +21 -1
- package/dist/cache.mjs +5 -3
- package/dist/{chunk-QF4PHCMA.mjs → chunk-2ED5Q2GH.mjs} +3 -3
- package/dist/chunk-2ED5Q2GH.mjs.map +1 -0
- package/dist/{chunk-GZP5W4K3.mjs → chunk-32W4QEJP.mjs} +1 -1
- package/dist/chunk-32W4QEJP.mjs.map +1 -0
- package/dist/{chunk-AGS7UJ52.mjs → chunk-45LKHSHJ.mjs} +2 -2
- package/dist/{chunk-TU4YJICB.mjs → chunk-5FW6PQ3J.mjs} +1 -1
- package/dist/{chunk-TU4YJICB.mjs.map → chunk-5FW6PQ3J.mjs.map} +1 -1
- package/dist/{chunk-TRORP7E4.mjs → chunk-5QH4IKY3.mjs} +2 -2
- package/dist/{chunk-RKI6TN3A.mjs → chunk-6VS6CKAV.mjs} +2 -2
- package/dist/chunk-6VS6CKAV.mjs.map +1 -0
- package/dist/{chunk-25D7G34K.mjs → chunk-6WXJ54TC.mjs} +4 -4
- package/dist/{chunk-3QJO55ZF.mjs → chunk-BIOIOWXZ.mjs} +5 -3
- package/dist/{chunk-3QJO55ZF.mjs.map → chunk-BIOIOWXZ.mjs.map} +1 -1
- package/dist/{chunk-QFQRHRZS.mjs → chunk-C33RALN7.mjs} +75 -11
- package/dist/chunk-C33RALN7.mjs.map +1 -0
- package/dist/{chunk-B6N4ZB2H.mjs → chunk-CSU4KJJF.mjs} +3 -3
- package/dist/{chunk-JN3UU635.mjs → chunk-EJ7T4TPB.mjs} +2 -2
- package/dist/chunk-EJ7T4TPB.mjs.map +1 -0
- package/dist/{chunk-ZJQNATYV.mjs → chunk-FRPWCMMG.mjs} +3 -3
- package/dist/chunk-FRPWCMMG.mjs.map +1 -0
- package/dist/{chunk-PRNYWD7K.mjs → chunk-G5I34UA6.mjs} +67 -239
- package/dist/chunk-G5I34UA6.mjs.map +1 -0
- package/dist/{chunk-QM6VV26B.mjs → chunk-GQVGIUSN.mjs} +3 -3
- package/dist/{chunk-QM6VV26B.mjs.map → chunk-GQVGIUSN.mjs.map} +1 -1
- package/dist/{chunk-UREJA4GZ.mjs → chunk-GXASWWJU.mjs} +1 -1
- package/dist/{chunk-UREJA4GZ.mjs.map → chunk-GXASWWJU.mjs.map} +1 -1
- package/dist/{chunk-4PTK6KT4.mjs → chunk-GZWT6VI5.mjs} +22 -4
- package/dist/chunk-GZWT6VI5.mjs.map +1 -0
- package/dist/{chunk-JLWMCADZ.mjs → chunk-HZYXGV4K.mjs} +2 -2
- package/dist/chunk-JNYVN7YP.mjs +10 -0
- package/dist/chunk-JNYVN7YP.mjs.map +1 -0
- package/dist/{chunk-YHU7SS6L.mjs → chunk-LG3YINQN.mjs} +11 -11
- package/dist/chunk-LWMGIEJA.mjs +593 -0
- package/dist/chunk-LWMGIEJA.mjs.map +1 -0
- package/dist/{chunk-HXP3ZSPC.mjs → chunk-MH6FKW2I.mjs} +3 -3
- package/dist/{chunk-O3HADRW6.mjs → chunk-MIUW47JX.mjs} +2 -2
- package/dist/{chunk-O3HADRW6.mjs.map → chunk-MIUW47JX.mjs.map} +1 -1
- package/dist/{chunk-6XDUHOEM.mjs → chunk-NRRFGX45.mjs} +3 -3
- package/dist/{chunk-G3B5BRDY.mjs → chunk-OHC6VCDI.mjs} +24 -25
- package/dist/{chunk-G3B5BRDY.mjs.map → chunk-OHC6VCDI.mjs.map} +1 -1
- package/dist/{chunk-S2XHZS7W.mjs → chunk-QGQX7SFC.mjs} +2 -2
- package/dist/chunk-QGQX7SFC.mjs.map +1 -0
- package/dist/{chunk-TXCFGOHW.mjs → chunk-SHRJG6OG.mjs} +25 -1
- package/dist/chunk-SHRJG6OG.mjs.map +1 -0
- package/dist/{chunk-UHE2TTLK.mjs → chunk-T543TMFY.mjs} +8 -8
- package/dist/chunk-T543TMFY.mjs.map +1 -0
- package/dist/{chunk-SXZTEK3V.mjs → chunk-UXUAWNO5.mjs} +2 -2
- package/dist/{chunk-Y2OJJD7R.mjs → chunk-XIVV5IWN.mjs} +7 -9
- package/dist/chunk-XIVV5IWN.mjs.map +1 -0
- package/dist/{chunk-CHFHNEMO.mjs → chunk-XJSHJN4M.mjs} +41 -42
- package/dist/chunk-XJSHJN4M.mjs.map +1 -0
- package/dist/{chunk-Y7A27276.mjs → chunk-XUBZ7JI4.mjs} +178 -15
- package/dist/chunk-XUBZ7JI4.mjs.map +1 -0
- package/dist/{chunk-OYXO65LI.mjs → chunk-YW7OBE6Q.mjs} +4 -4
- package/dist/chunk-YW7OBE6Q.mjs.map +1 -0
- package/dist/{chunk-SOU3Q3ZA.mjs → chunk-ZZ57EH5Z.mjs} +1 -1
- package/dist/chunk-ZZ57EH5Z.mjs.map +1 -0
- package/dist/{client-D_yUjVhe.d.mts → client-DiViK9yK.d.mts} +33 -7
- package/dist/{client-Dkc03WP8.d.ts → client-DpEBJbts.d.ts} +33 -7
- package/dist/{client-plugins-BZnpeTGA.d.ts → client-plugins-CTnsZz_A.d.ts} +1 -0
- package/dist/{client-plugins-g4bzuCmo.d.mts → client-plugins-Cnr0D3kk.d.mts} +1 -0
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.cjs +302 -54
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.mts +54 -2
- package/dist/client.d.ts +54 -2
- package/dist/client.mjs +20 -16
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/cron.cjs.map +1 -1
- package/dist/cron.mjs +1 -1
- package/dist/{devtools-AE4RVXCM.mjs → devtools-HE4FTUDN.mjs} +10 -10
- package/dist/{devtools-client-6WPY2AQU.mjs → devtools-client-3XRTBND5.mjs} +2 -11
- package/dist/devtools-client-3XRTBND5.mjs.map +1 -0
- package/dist/docs.cjs +3 -1
- package/dist/docs.cjs.map +1 -1
- package/dist/docs.mjs +10 -10
- package/dist/i18n/server.cjs +2 -2
- package/dist/i18n/server.cjs.map +1 -1
- package/dist/i18n/server.mjs +1 -1
- package/dist/index.cjs +791 -317
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.mjs +125 -110
- package/dist/index.mjs.map +1 -1
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/internal/build-runtime.cjs +162 -60
- package/dist/internal/build-runtime.cjs.map +1 -1
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +26 -25
- package/dist/internal/client-runtime.cjs.map +1 -1
- package/dist/internal/client-runtime.mjs +1 -1
- package/dist/internal/config-runtime.cjs +1 -1
- package/dist/internal/config-runtime.cjs.map +1 -1
- package/dist/internal/config-runtime.d.mts +2 -2
- package/dist/internal/config-runtime.d.ts +2 -2
- package/dist/internal/config-runtime.mjs +9 -9
- package/dist/internal/production-runtime.cjs +3 -3
- package/dist/internal/production-runtime.cjs.map +1 -1
- package/dist/internal/production-runtime.d.mts +3 -3
- package/dist/internal/production-runtime.d.ts +3 -3
- package/dist/internal/production-runtime.mjs +8 -8
- package/dist/{metadata-C9NZxMDW.d.mts → metadata-Dp8AdvsB.d.mts} +1 -1
- package/dist/{metadata-DAXRaOHx.d.ts → metadata-eoVmHoyv.d.ts} +1 -1
- package/dist/middleware.cjs +2 -2
- package/dist/middleware.cjs.map +1 -1
- package/dist/middleware.d.mts +3 -3
- package/dist/middleware.d.ts +3 -3
- package/dist/middleware.mjs +3 -3
- package/dist/navigation.cjs.map +1 -1
- package/dist/navigation.mjs +3 -3
- package/dist/{nitro-KME62MWG.mjs → nitro-QO5LV6QK.mjs} +11 -13
- package/dist/{nitro-KME62MWG.mjs.map → nitro-QO5LV6QK.mjs.map} +1 -1
- package/dist/plugin.cjs +119 -39
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.mts +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.mjs +22 -21
- package/dist/{production-runtime-DRkCHUvJ.d.ts → production-runtime-BqTnUTai.d.ts} +1 -1
- package/dist/{production-runtime-flrjp_nC.d.mts → production-runtime-DtDdG9fc.d.mts} +1 -1
- package/dist/routes.cjs.map +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/routes.mjs +4 -4
- package/dist/runtime-C1B7pSGT.d.mts +207 -0
- package/dist/runtime-CdPHt0bv.d.ts +207 -0
- package/dist/server-action-security.cjs.map +1 -1
- package/dist/server-action-security.mjs +2 -2
- package/dist/server-fn-client.cjs.map +1 -1
- package/dist/server-fn-client.mjs +1 -1
- package/dist/server-fn.cjs.map +1 -1
- package/dist/server-fn.mjs +3 -3
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server-query-client.cjs.map +1 -1
- package/dist/server-query-client.mjs +4 -4
- package/dist/server-query.cjs.map +1 -1
- package/dist/server-query.mjs +5 -5
- package/dist/server.cjs +148 -43
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.mts +6 -6
- package/dist/server.d.ts +6 -6
- package/dist/server.mjs +36 -31
- package/dist/server.mjs.map +1 -1
- package/dist/testing.cjs +95 -5
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.mts +3 -3
- package/dist/testing.d.ts +3 -3
- package/dist/testing.mjs +18 -18
- package/dist/{utils-DOXXivjL.d.mts → utils-8USa5BiY.d.mts} +1 -1
- package/dist/{utils-DA1yo54_.d.ts → utils-DKJb6K6G.d.ts} +1 -1
- package/dist/version.cjs +36 -0
- package/dist/version.cjs.map +1 -0
- package/dist/version.d.mts +3 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.mjs +8 -0
- package/dist/version.mjs.map +1 -0
- package/dist/vite.cjs +126 -40
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.mjs +22 -21
- package/dist/workflows.cjs +6 -8
- package/dist/workflows.cjs.map +1 -1
- package/dist/workflows.mjs +1 -1
- package/package.json +12 -5
- package/types/client.d.ts +136 -13
- package/dist/chunk-4PTK6KT4.mjs.map +0 -1
- package/dist/chunk-CHFHNEMO.mjs.map +0 -1
- package/dist/chunk-EVGBEZDF.mjs +0 -215
- package/dist/chunk-EVGBEZDF.mjs.map +0 -1
- package/dist/chunk-GZP5W4K3.mjs.map +0 -1
- package/dist/chunk-JN3UU635.mjs.map +0 -1
- package/dist/chunk-OYXO65LI.mjs.map +0 -1
- package/dist/chunk-PRNYWD7K.mjs.map +0 -1
- package/dist/chunk-QF4PHCMA.mjs.map +0 -1
- package/dist/chunk-QFQRHRZS.mjs.map +0 -1
- package/dist/chunk-RKI6TN3A.mjs.map +0 -1
- package/dist/chunk-S2XHZS7W.mjs.map +0 -1
- package/dist/chunk-SOU3Q3ZA.mjs.map +0 -1
- package/dist/chunk-TXCFGOHW.mjs.map +0 -1
- package/dist/chunk-UHE2TTLK.mjs.map +0 -1
- package/dist/chunk-Y2OJJD7R.mjs.map +0 -1
- package/dist/chunk-Y7A27276.mjs.map +0 -1
- package/dist/chunk-ZJQNATYV.mjs.map +0 -1
- package/dist/devtools-client-6WPY2AQU.mjs.map +0 -1
- /package/dist/{chunk-AGS7UJ52.mjs.map → chunk-45LKHSHJ.mjs.map} +0 -0
- /package/dist/{chunk-TRORP7E4.mjs.map → chunk-5QH4IKY3.mjs.map} +0 -0
- /package/dist/{chunk-25D7G34K.mjs.map → chunk-6WXJ54TC.mjs.map} +0 -0
- /package/dist/{chunk-B6N4ZB2H.mjs.map → chunk-CSU4KJJF.mjs.map} +0 -0
- /package/dist/{chunk-JLWMCADZ.mjs.map → chunk-HZYXGV4K.mjs.map} +0 -0
- /package/dist/{chunk-YHU7SS6L.mjs.map → chunk-LG3YINQN.mjs.map} +0 -0
- /package/dist/{chunk-HXP3ZSPC.mjs.map → chunk-MH6FKW2I.mjs.map} +0 -0
- /package/dist/{chunk-6XDUHOEM.mjs.map → chunk-NRRFGX45.mjs.map} +0 -0
- /package/dist/{chunk-SXZTEK3V.mjs.map → chunk-UXUAWNO5.mjs.map} +0 -0
- /package/dist/{devtools-AE4RVXCM.mjs.map → devtools-HE4FTUDN.mjs.map} +0 -0
package/dist/testing.d.mts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import './types-BH1lhg5G.mjs';
|
|
3
|
-
import { APIRouteParams } from './
|
|
3
|
+
import { b as APIRouteParams } from './runtime-C1B7pSGT.mjs';
|
|
4
4
|
import { ProgrammaticPageRoute, InferProgrammaticRouteData, ProgrammaticRouteComponentProps, ProgrammaticApiRoute } from './routes.mjs';
|
|
5
5
|
import { FarmRouterQueryValue, FarmRouterPathParams } from './router.mjs';
|
|
6
6
|
import { ServerFn } from './server-fn.mjs';
|
|
7
|
-
import { g as FarmContextFactory, M as MiddlewareProps, P as PluginContextProps, p as RouteModule } from './client-plugins-
|
|
8
|
-
import './route-runtime-DoOHzCAD.mjs';
|
|
7
|
+
import { g as FarmContextFactory, M as MiddlewareProps, P as PluginContextProps, p as RouteModule } from './client-plugins-Cnr0D3kk.mjs';
|
|
9
8
|
import './cache.mjs';
|
|
9
|
+
import './route-runtime-DoOHzCAD.mjs';
|
|
10
10
|
import './plugin-BJDf43dc.mjs';
|
|
11
11
|
import 'http';
|
|
12
12
|
import './types-D1A6-XvH.mjs';
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import './types-BH1lhg5G.js';
|
|
3
|
-
import { APIRouteParams } from './
|
|
3
|
+
import { b as APIRouteParams } from './runtime-CdPHt0bv.js';
|
|
4
4
|
import { ProgrammaticPageRoute, InferProgrammaticRouteData, ProgrammaticRouteComponentProps, ProgrammaticApiRoute } from './routes.js';
|
|
5
5
|
import { FarmRouterQueryValue, FarmRouterPathParams } from './router.js';
|
|
6
6
|
import { ServerFn } from './server-fn.js';
|
|
7
|
-
import { g as FarmContextFactory, M as MiddlewareProps, P as PluginContextProps, p as RouteModule } from './client-plugins-
|
|
8
|
-
import './route-runtime-DoOHzCAD.js';
|
|
7
|
+
import { g as FarmContextFactory, M as MiddlewareProps, P as PluginContextProps, p as RouteModule } from './client-plugins-CTnsZz_A.js';
|
|
9
8
|
import './cache.js';
|
|
9
|
+
import './route-runtime-DoOHzCAD.js';
|
|
10
10
|
import './plugin-BJDf43dc.js';
|
|
11
11
|
import 'http';
|
|
12
12
|
import './types-D1A6-XvH.js';
|
package/dist/testing.mjs
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runWithServerActionRequest
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-45LKHSHJ.mjs";
|
|
4
|
+
import "./chunk-LG3YINQN.mjs";
|
|
5
|
+
import "./chunk-2ED5Q2GH.mjs";
|
|
6
6
|
import "./chunk-GN72QAIH.mjs";
|
|
7
7
|
import "./chunk-FQYDHKKU.mjs";
|
|
8
|
-
import "./chunk-J4FNJ5IU.mjs";
|
|
9
|
-
import {
|
|
10
|
-
invokeAPIRouteEndpoint,
|
|
11
|
-
matchAPIRoute
|
|
12
|
-
} from "./chunk-EVGBEZDF.mjs";
|
|
13
|
-
import "./chunk-RHIFZZUI.mjs";
|
|
14
|
-
import "./chunk-LM2YNO4U.mjs";
|
|
15
8
|
import {
|
|
16
9
|
createRouteModuleFromProgrammaticPage
|
|
17
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-CSU4KJJF.mjs";
|
|
18
11
|
import {
|
|
19
12
|
resolveFarmRouteContext,
|
|
20
13
|
withFarmRouteContext
|
|
21
14
|
} from "./chunk-QKVUNGAH.mjs";
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-GQVGIUSN.mjs";
|
|
16
|
+
import "./chunk-J4FNJ5IU.mjs";
|
|
24
17
|
import {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
} from "./chunk-
|
|
18
|
+
invokeAPIRouteEndpoint,
|
|
19
|
+
matchAPIRoute
|
|
20
|
+
} from "./chunk-LWMGIEJA.mjs";
|
|
21
|
+
import "./chunk-RHIFZZUI.mjs";
|
|
22
|
+
import "./chunk-LM2YNO4U.mjs";
|
|
23
|
+
import "./chunk-44ZCFSKE.mjs";
|
|
28
24
|
import {
|
|
29
25
|
getFarmDataCache
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import "./chunk-TXCFGOHW.mjs";
|
|
26
|
+
} from "./chunk-GZWT6VI5.mjs";
|
|
32
27
|
import "./chunk-WZ5QFROO.mjs";
|
|
28
|
+
import "./chunk-SHRJG6OG.mjs";
|
|
33
29
|
import "./chunk-7ZY5AIJO.mjs";
|
|
30
|
+
import {
|
|
31
|
+
buildFarmRoutePath,
|
|
32
|
+
matchFarmRoute
|
|
33
|
+
} from "./chunk-ZBE6MLHL.mjs";
|
|
34
34
|
import {
|
|
35
35
|
__name
|
|
36
36
|
} from "./chunk-CGILA3WO.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { x as ParsedRoute, w as RouteSegment } from './client-plugins-
|
|
1
|
+
import { x as ParsedRoute, w as RouteSegment } from './client-plugins-Cnr0D3kk.mjs';
|
|
2
2
|
|
|
3
3
|
declare function parseRoutePath(filePath: string): ParsedRoute;
|
|
4
4
|
declare function segmentsToPattern(segments: RouteSegment[]): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { x as ParsedRoute, w as RouteSegment } from './client-plugins-
|
|
1
|
+
import { x as ParsedRoute, w as RouteSegment } from './client-plugins-CTnsZz_A.js';
|
|
2
2
|
|
|
3
3
|
declare function parseRoutePath(filePath: string): ParsedRoute;
|
|
4
4
|
declare function segmentsToPattern(segments: RouteSegment[]): string;
|
package/dist/version.cjs
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/version.ts
|
|
21
|
+
var version_exports = {};
|
|
22
|
+
__export(version_exports, {
|
|
23
|
+
FARM_VERSION: () => FARM_VERSION
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(version_exports);
|
|
26
|
+
|
|
27
|
+
// package.json
|
|
28
|
+
var version = "0.1.0-beta.3";
|
|
29
|
+
|
|
30
|
+
// src/version.ts
|
|
31
|
+
var FARM_VERSION = version;
|
|
32
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
+
0 && (module.exports = {
|
|
34
|
+
FARM_VERSION
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=version.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/version.ts","../package.json"],"sourcesContent":["import { version } from \"../package.json\";\n\nexport const FARM_VERSION = version;\n","{\n \"name\": \"@farm.js/core\",\n \"version\": \"0.1.0-beta.3\",\n \"description\": \"Core Farm.js framework for modern integrated apps\",\n \"keywords\": [\n \"@farm.js/core\",\n \"framework\",\n \"react\",\n \"rsc\",\n \"server-components\",\n \"ssr\",\n \"vite\"\n ],\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/farming-labs/farm.js\",\n \"directory\": \"packages/farm\"\n },\n \"files\": [\n \"dist\",\n \"types\"\n ],\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"typesVersions\": {\n \"*\": {\n \"middleware\": [\n \"./types/middleware.d.ts\",\n \"./dist/middleware.d.ts\"\n ],\n \"version\": [\n \"./dist/version.d.ts\"\n ],\n \"router\": [\n \"./dist/router.d.ts\"\n ],\n \"routes\": [\n \"./dist/routes.d.ts\"\n ],\n \"storage\": [\n \"./dist/storage.d.ts\"\n ],\n \"integrations\": [\n \"./dist/integrations.d.ts\"\n ],\n \"cache\": [\n \"./dist/cache.d.ts\"\n ],\n \"deferred\": [\n \"./dist/deferred.d.ts\"\n ],\n \"after\": [\n \"./dist/after.d.ts\"\n ],\n \"navigation\": [\n \"./dist/navigation.d.ts\"\n ],\n \"headers\": [\n \"./dist/headers.d.ts\"\n ],\n \"docs\": [\n \"./dist/docs.d.ts\"\n ],\n \"markdown\": [\n \"./dist/markdown.d.ts\"\n ],\n \"app-markdown\": [\n \"./dist/app-markdown.d.ts\"\n ],\n \"observability\": [\n \"./dist/observability.d.ts\"\n ],\n \"workflows\": [\n \"./dist/workflows.d.ts\"\n ],\n \"cron\": [\n \"./dist/cron.d.ts\"\n ],\n \"server-fn\": [\n \"./dist/server-fn.d.ts\"\n ],\n \"server-fn/client\": [\n \"./dist/server-fn-client.d.ts\"\n ],\n \"server-action-security\": [\n \"./dist/server-action-security.d.ts\"\n ],\n \"deployment\": [\n \"./dist/deployment.d.ts\"\n ],\n \"env\": [\n \"./dist/env.d.ts\"\n ],\n \"env-types\": [\n \"./dist/env-types.d.ts\"\n ],\n \"environment\": [\n \"./dist/environment.d.ts\"\n ],\n \"environment/vite\": [\n \"./dist/environment/vite.d.ts\"\n ],\n \"testing\": [\n \"./dist/testing.d.ts\"\n ],\n \"agent-runtime\": [\n \"./dist/agent-runtime.d.ts\"\n ],\n \"image\": [\n \"./dist/image.d.ts\"\n ],\n \"image/server\": [\n \"./dist/image/server.d.ts\"\n ],\n \"image/sharp\": [\n \"./dist/image/sharp.d.ts\"\n ],\n \"i18n\": [\n \"./dist/i18n/index.d.ts\"\n ],\n \"i18n/server\": [\n \"./dist/i18n/server.d.ts\"\n ],\n \"i18n/client\": [\n \"./dist/i18n/client.d.ts\"\n ],\n \"internal/production-runtime\": [\n \"./dist/internal/production-runtime.d.ts\"\n ],\n \"internal/client-runtime\": [\n \"./dist/internal/client-runtime.d.ts\"\n ],\n \"internal/build-runtime\": [\n \"./dist/internal/build-runtime.d.ts\"\n ],\n \"internal/config-runtime\": [\n \"./dist/internal/config-runtime.d.ts\"\n ],\n \"internal/production-node-env\": [\n \"./dist/internal/production-node-env.d.ts\"\n ],\n \"config\": [\n \"./dist/config.d.ts\"\n ],\n \"api\": [\n \"./types/api.d.ts\",\n \"./dist/api.d.ts\"\n ],\n \"api/route-manager\": [\n \"./dist/api/route-manager.d.ts\"\n ],\n \"api/runtime\": [\n \"./dist/api/runtime.d.ts\"\n ],\n \"request\": [\n \"./dist/request.d.ts\"\n ],\n \"client\": [\n \"./types/client.d.ts\",\n \"./dist/client.d.ts\"\n ],\n \"server\": [\n \"./dist/server.d.ts\"\n ],\n \"vite\": [\n \"./dist/vite.d.ts\"\n ],\n \"plugin\": [\n \"./dist/plugin.d.ts\"\n ],\n \"query\": [\n \"./dist/query/index.d.ts\"\n ],\n \"*\": [\n \"./dist/*.d.ts\"\n ]\n }\n },\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.mjs\",\n \"require\": \"./dist/index.cjs\",\n \"default\": \"./dist/index.mjs\"\n },\n \"./version\": {\n \"types\": \"./dist/version.d.ts\",\n \"import\": \"./dist/version.mjs\",\n \"require\": \"./dist/version.cjs\"\n },\n \"./config\": {\n \"types\": \"./dist/config.d.ts\",\n \"import\": \"./dist/config.mjs\",\n \"require\": \"./dist/config.cjs\"\n },\n \"./server\": {\n \"types\": \"./dist/server.d.ts\",\n \"import\": \"./dist/server.mjs\",\n \"require\": \"./dist/server.cjs\"\n },\n \"./client\": {\n \"types\": \"./types/client.d.ts\",\n \"import\": \"./dist/client.mjs\",\n \"require\": \"./dist/client.cjs\"\n },\n \"./storage\": {\n \"types\": \"./dist/storage.d.ts\",\n \"import\": \"./dist/storage.mjs\",\n \"require\": \"./dist/storage.cjs\"\n },\n \"./integrations\": {\n \"types\": \"./dist/integrations.d.ts\",\n \"import\": \"./dist/integrations.mjs\",\n \"require\": \"./dist/integrations.cjs\"\n },\n \"./cache\": {\n \"types\": \"./dist/cache.d.ts\",\n \"import\": \"./dist/cache.mjs\",\n \"require\": \"./dist/cache.cjs\"\n },\n \"./deferred\": {\n \"types\": \"./dist/deferred.d.ts\",\n \"import\": \"./dist/deferred.mjs\",\n \"require\": \"./dist/deferred.cjs\"\n },\n \"./after\": {\n \"types\": \"./dist/after.d.ts\",\n \"import\": \"./dist/after.mjs\",\n \"require\": \"./dist/after.cjs\"\n },\n \"./navigation\": {\n \"types\": \"./dist/navigation.d.ts\",\n \"import\": \"./dist/navigation.mjs\",\n \"require\": \"./dist/navigation.cjs\"\n },\n \"./headers\": {\n \"types\": \"./dist/headers.d.ts\",\n \"import\": \"./dist/headers.mjs\",\n \"require\": \"./dist/headers.cjs\"\n },\n \"./docs\": {\n \"types\": \"./dist/docs.d.ts\",\n \"import\": \"./dist/docs.mjs\",\n \"require\": \"./dist/docs.cjs\"\n },\n \"./markdown\": {\n \"types\": \"./dist/markdown.d.ts\",\n \"import\": \"./dist/markdown.mjs\",\n \"require\": \"./dist/markdown.cjs\"\n },\n \"./app-markdown\": {\n \"types\": \"./dist/app-markdown.d.ts\",\n \"import\": \"./dist/app-markdown.mjs\",\n \"require\": \"./dist/app-markdown.cjs\"\n },\n \"./observability\": {\n \"types\": \"./dist/observability.d.ts\",\n \"import\": \"./dist/observability.mjs\",\n \"require\": \"./dist/observability.cjs\"\n },\n \"./workflows\": {\n \"types\": \"./dist/workflows.d.ts\",\n \"import\": \"./dist/workflows.mjs\",\n \"require\": \"./dist/workflows.cjs\"\n },\n \"./cron\": {\n \"types\": \"./dist/cron.d.ts\",\n \"import\": \"./dist/cron.mjs\",\n \"require\": \"./dist/cron.cjs\"\n },\n \"./server-fn\": {\n \"types\": \"./dist/server-fn.d.ts\",\n \"import\": \"./dist/server-fn.mjs\",\n \"require\": \"./dist/server-fn.cjs\"\n },\n \"./server-fn/client\": {\n \"types\": \"./dist/server-fn-client.d.ts\",\n \"import\": \"./dist/server-fn-client.mjs\",\n \"require\": \"./dist/server-fn-client.cjs\"\n },\n \"./server-query\": {\n \"types\": \"./dist/server-query.d.ts\",\n \"import\": \"./dist/server-query.mjs\",\n \"require\": \"./dist/server-query.cjs\"\n },\n \"./server-query/client\": {\n \"types\": \"./dist/server-query-client.d.ts\",\n \"import\": \"./dist/server-query-client.mjs\",\n \"require\": \"./dist/server-query-client.cjs\"\n },\n \"./server-action-security\": {\n \"types\": \"./dist/server-action-security.d.ts\",\n \"import\": \"./dist/server-action-security.mjs\",\n \"require\": \"./dist/server-action-security.cjs\"\n },\n \"./deployment\": {\n \"types\": \"./dist/deployment.d.ts\",\n \"import\": \"./dist/deployment.mjs\",\n \"require\": \"./dist/deployment.cjs\"\n },\n \"./env\": {\n \"types\": \"./dist/env.d.ts\",\n \"import\": \"./dist/env.mjs\",\n \"require\": \"./dist/env.cjs\"\n },\n \"./env-types\": {\n \"types\": \"./dist/env-types.d.ts\",\n \"import\": \"./dist/env-types.mjs\",\n \"require\": \"./dist/env-types.cjs\"\n },\n \"./environment\": {\n \"types\": \"./dist/environment.d.ts\",\n \"import\": \"./dist/environment.mjs\",\n \"require\": \"./dist/environment.cjs\"\n },\n \"./environment/vite\": {\n \"types\": \"./dist/environment/vite.d.ts\",\n \"import\": \"./dist/environment/vite.mjs\",\n \"require\": \"./dist/environment/vite.cjs\"\n },\n \"./vite\": {\n \"types\": \"./dist/vite.d.ts\",\n \"import\": \"./dist/vite.mjs\",\n \"require\": \"./dist/vite.cjs\"\n },\n \"./plugin\": {\n \"types\": \"./dist/plugin.d.ts\",\n \"import\": \"./dist/plugin.mjs\",\n \"require\": \"./dist/plugin.cjs\"\n },\n \"./plugin/server\": {\n \"types\": \"./dist/server-plugins.d.ts\",\n \"import\": \"./dist/server-plugins.mjs\",\n \"require\": \"./dist/server-plugins.cjs\"\n },\n \"./plugin/client\": {\n \"types\": \"./dist/client-plugins.d.ts\",\n \"import\": \"./dist/client-plugins.mjs\",\n \"require\": \"./dist/client-plugins.cjs\"\n },\n \"./query\": {\n \"types\": \"./dist/query/index.d.ts\",\n \"import\": \"./dist/query/index.mjs\",\n \"require\": \"./dist/query/index.cjs\"\n },\n \"./query/parsers\": {\n \"types\": \"./dist/query/parsers.d.ts\",\n \"import\": \"./dist/query/parsers.mjs\",\n \"require\": \"./dist/query/parsers.cjs\"\n },\n \"./query/client\": {\n \"types\": \"./dist/query/client.d.ts\",\n \"import\": \"./dist/query/client.mjs\",\n \"require\": \"./dist/query/client.cjs\"\n },\n \"./query/server\": {\n \"types\": \"./dist/query/server.d.ts\",\n \"import\": \"./dist/query/server.mjs\",\n \"require\": \"./dist/query/server.cjs\"\n },\n \"./middleware\": {\n \"types\": \"./dist/middleware.d.ts\",\n \"import\": \"./dist/middleware.mjs\",\n \"require\": \"./dist/middleware.cjs\"\n },\n \"./api\": {\n \"types\": \"./dist/api.d.ts\",\n \"import\": \"./dist/api.mjs\",\n \"require\": \"./dist/api.cjs\"\n },\n \"./api/route-manager\": {\n \"types\": \"./dist/api/route-manager.d.ts\",\n \"import\": \"./dist/api/route-manager.mjs\",\n \"require\": \"./dist/api/route-manager.cjs\"\n },\n \"./api/runtime\": {\n \"types\": \"./dist/api/runtime.d.ts\",\n \"import\": \"./dist/api/runtime.mjs\",\n \"require\": \"./dist/api/runtime.cjs\"\n },\n \"./request\": {\n \"types\": \"./dist/request.d.ts\",\n \"import\": \"./dist/request.mjs\",\n \"require\": \"./dist/request.cjs\"\n },\n \"./router\": {\n \"types\": \"./dist/router.d.ts\",\n \"import\": \"./dist/router.mjs\",\n \"require\": \"./dist/router.cjs\"\n },\n \"./routes\": {\n \"types\": \"./dist/routes.d.ts\",\n \"import\": \"./dist/routes.mjs\",\n \"require\": \"./dist/routes.cjs\"\n },\n \"./testing\": {\n \"types\": \"./dist/testing.d.ts\",\n \"import\": \"./dist/testing.mjs\",\n \"require\": \"./dist/testing.cjs\"\n },\n \"./agent-runtime\": {\n \"types\": \"./dist/agent-runtime.d.ts\",\n \"import\": \"./dist/agent-runtime.mjs\",\n \"require\": \"./dist/agent-runtime.cjs\"\n },\n \"./image\": {\n \"types\": \"./dist/image.d.ts\",\n \"import\": \"./dist/image.mjs\",\n \"require\": \"./dist/image.cjs\"\n },\n \"./image/server\": {\n \"types\": \"./dist/image/server.d.ts\",\n \"import\": \"./dist/image/server.mjs\",\n \"require\": \"./dist/image/server.cjs\"\n },\n \"./image/sharp\": {\n \"types\": \"./dist/image/sharp.d.ts\",\n \"import\": \"./dist/image/sharp.mjs\",\n \"require\": \"./dist/image/sharp.cjs\"\n },\n \"./i18n\": {\n \"types\": \"./dist/i18n/index.d.ts\",\n \"import\": \"./dist/i18n/index.mjs\",\n \"require\": \"./dist/i18n/index.cjs\"\n },\n \"./i18n/server\": {\n \"types\": \"./dist/i18n/server.d.ts\",\n \"import\": \"./dist/i18n/server.mjs\",\n \"require\": \"./dist/i18n/server.cjs\"\n },\n \"./i18n/client\": {\n \"types\": \"./dist/i18n/client.d.ts\",\n \"import\": \"./dist/i18n/client.mjs\",\n \"require\": \"./dist/i18n/client.cjs\"\n },\n \"./internal/production-runtime\": {\n \"types\": \"./dist/internal/production-runtime.d.ts\",\n \"import\": \"./dist/internal/production-runtime.mjs\",\n \"require\": \"./dist/internal/production-runtime.cjs\"\n },\n \"./internal/client-runtime\": {\n \"types\": \"./dist/internal/client-runtime.d.ts\",\n \"import\": \"./dist/internal/client-runtime.mjs\",\n \"require\": \"./dist/internal/client-runtime.cjs\"\n },\n \"./internal/build-runtime\": {\n \"types\": \"./dist/internal/build-runtime.d.ts\",\n \"import\": \"./dist/internal/build-runtime.mjs\",\n \"require\": \"./dist/internal/build-runtime.cjs\"\n },\n \"./internal/config-runtime\": {\n \"types\": \"./dist/internal/config-runtime.d.ts\",\n \"import\": \"./dist/internal/config-runtime.mjs\",\n \"require\": \"./dist/internal/config-runtime.cjs\"\n },\n \"./internal/production-node-env\": {\n \"types\": \"./dist/internal/production-node-env.d.ts\",\n \"import\": \"./dist/internal/production-node-env.mjs\",\n \"require\": \"./dist/internal/production-node-env.cjs\"\n }\n },\n \"publishConfig\": {\n \"access\": \"public\"\n },\n \"scripts\": {\n \"build\": \"tsup\",\n \"build:runtime\": \"tsup --config tsup.runtime.config.ts\",\n \"dev\": \"tsup --watch\",\n \"test\": \"vitest run\",\n \"test:coverage\": \"vitest --coverage\",\n \"lint\": \"biome lint .\",\n \"lint:fix\": \"biome lint --write .\",\n \"format\": \"biome format --write .\",\n \"type-check\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist\"\n },\n \"dependencies\": {\n \"@farming-labs/docs\": \"^0.2.44\",\n \"@farming-labs/orm\": \"0.0.62\",\n \"@farming-labs/orm-runtime\": \"0.0.62\",\n \"@formatjs/icu-messageformat-parser\": \"3.5.15\",\n \"@mdx-js/mdx\": \"^3.1.1\",\n \"@scalar/api-reference\": \"^1.38.1\",\n \"@scalar/openapi-parser\": \"^0.22.3\",\n \"@tailwindcss/vite\": \"4.1.18\",\n \"@vitejs/plugin-react\": \"^4.2.1\",\n \"better-call\": \"^1.0.19\",\n \"db0\": \"^0.3.4\",\n \"esbuild\": \"^0.28.0\",\n \"fast-glob\": \"^3.3.2\",\n \"h3\": \"2.0.1-rc.5\",\n \"image-size\": \"^2.0.2\",\n \"intl-messageformat\": \"11.2.12\",\n \"marked\": \"^12.0.2\",\n \"nitro\": \"3.0.1-alpha.0\",\n \"pg\": \"^8.20.0\",\n \"picocolors\": \"^1.0.0\",\n \"remark-gfm\": \"^4.0.1\",\n \"sirv\": \"^2.0.4\",\n \"sugar-high\": \"^0.9.5\",\n \"supports-color\": \"^10.2.2\",\n \"tailwindcss\": \"4.1.18\",\n \"unstorage\": \"^2.0.0-alpha.3\",\n \"vite\": \"^5.0.10\",\n \"zod\": \"^4.1.12\"\n },\n \"devDependencies\": {\n \"@clerk/react\": \"^6.1.0\",\n \"@types/react\": \"^18.2.45\",\n \"@types/react-dom\": \"^18.2.18\",\n \"@vitest/coverage-v8\": \"^1.1.0\",\n \"jsdom\": \"^25.0.0\",\n \"react\": \"19.2.8\",\n \"react-dom\": \"19.2.8\",\n \"tsup\": \"^8.3.5\",\n \"typescript\": \"^5.3.3\",\n \"vitest\": \"^1.1.0\"\n },\n \"peerDependencies\": {\n \"react\": \"^18.2.0 || ^19.0.0\",\n \"react-dom\": \"^18.2.0 || ^19.0.0\"\n },\n \"optionalDependencies\": {\n \"rolldown\": \"1.2.0\",\n \"sharp\": \"^0.34.5\",\n \"vite-rolldown\": \"npm:vite@8.1.5\"\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEE,cAAW;;;ADAN,IAAM,eAAe;","names":[]}
|
package/dist/version.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/vite.cjs
CHANGED
|
@@ -118,7 +118,7 @@ function createFarmMarkdownRouteModule(input) {
|
|
|
118
118
|
...props,
|
|
119
119
|
components: {
|
|
120
120
|
...components,
|
|
121
|
-
...props?.components
|
|
121
|
+
...props?.components
|
|
122
122
|
}
|
|
123
123
|
})
|
|
124
124
|
);
|
|
@@ -635,7 +635,11 @@ async function prepareFarmWorkflowsForNitro(config) {
|
|
|
635
635
|
};
|
|
636
636
|
}
|
|
637
637
|
const handlerPath = path22.join(generatedDir, "http-handler.mjs");
|
|
638
|
-
await fs8.writeFile(
|
|
638
|
+
await fs8.writeFile(
|
|
639
|
+
handlerPath,
|
|
640
|
+
createNitroWorkflowHTTPHandler(workflowConfig, workflows),
|
|
641
|
+
"utf8"
|
|
642
|
+
);
|
|
639
643
|
const manifestPath = path22.join(generatedDir, "manifest.json");
|
|
640
644
|
await fs8.writeFile(
|
|
641
645
|
manifestPath,
|
|
@@ -709,13 +713,7 @@ function normalizeSchedule(schedule) {
|
|
|
709
713
|
return (Array.isArray(schedule) ? schedule : [schedule]).map((value) => value.trim()).filter(Boolean);
|
|
710
714
|
}
|
|
711
715
|
function resolveWorkflowDefinition(module2) {
|
|
712
|
-
const candidates = [
|
|
713
|
-
module2.default,
|
|
714
|
-
module2.workflow,
|
|
715
|
-
module2.cron,
|
|
716
|
-
module2.task,
|
|
717
|
-
module2.job
|
|
718
|
-
];
|
|
716
|
+
const candidates = [module2.default, module2.workflow, module2.cron, module2.task, module2.job];
|
|
719
717
|
for (const candidate of candidates) {
|
|
720
718
|
if (candidate && typeof candidate === "object" && typeof candidate.run === "function") {
|
|
721
719
|
return candidate;
|
|
@@ -1708,8 +1706,8 @@ function compareFarmRouteRuleSpecificity(left, right) {
|
|
|
1708
1706
|
}
|
|
1709
1707
|
function getFarmRouteRuleSpecificity(pattern) {
|
|
1710
1708
|
return normalizeRoutePattern(pattern).split("/").filter(Boolean).reduce((score, segment) => {
|
|
1711
|
-
if (segment === "**" ||
|
|
1712
|
-
if (segment === "*" ||
|
|
1709
|
+
if (segment === "**" || segment.startsWith("[[...")) return score + 1;
|
|
1710
|
+
if (segment === "*" || segment.startsWith("[...")) return score + 10;
|
|
1713
1711
|
if (/^\[.+\]$/.test(segment) || /^:.+$/.test(segment)) return score + 50;
|
|
1714
1712
|
return score + 100;
|
|
1715
1713
|
}, 0);
|
|
@@ -1772,18 +1770,39 @@ function getFarmCacheInvalidationState() {
|
|
|
1772
1770
|
listeners: /* @__PURE__ */ new Set()
|
|
1773
1771
|
});
|
|
1774
1772
|
}
|
|
1773
|
+
function encodeFarmCacheInvalidations(keys) {
|
|
1774
|
+
const normalized = Array.from(
|
|
1775
|
+
new Set(keys.filter((key) => typeof key === "string" && key.length > 0))
|
|
1776
|
+
);
|
|
1777
|
+
if (normalized.length === 0) return null;
|
|
1778
|
+
return encodeURIComponent(JSON.stringify(normalized));
|
|
1779
|
+
}
|
|
1780
|
+
function decodeFarmCacheInvalidations(value) {
|
|
1781
|
+
if (!value) return [];
|
|
1782
|
+
try {
|
|
1783
|
+
const parsed = JSON.parse(decodeURIComponent(value));
|
|
1784
|
+
return Array.isArray(parsed) ? Array.from(
|
|
1785
|
+
new Set(parsed.filter((key) => typeof key === "string" && key.length > 0))
|
|
1786
|
+
) : [];
|
|
1787
|
+
} catch {
|
|
1788
|
+
return [];
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1775
1791
|
function subscribeFarmCacheInvalidation(listener) {
|
|
1776
1792
|
const state = getFarmCacheInvalidationState();
|
|
1777
1793
|
state.listeners.add(listener);
|
|
1778
1794
|
return () => state.listeners.delete(listener);
|
|
1779
1795
|
}
|
|
1780
|
-
var FARM_CACHE_INVALIDATION_STATE, globalState;
|
|
1796
|
+
var FARM_CACHE_INVALIDATION_HEADER, FARM_CACHE_INVALIDATION_STATE, globalState;
|
|
1781
1797
|
var init_cache_invalidation = __esm({
|
|
1782
1798
|
"src/cache-invalidation.ts"() {
|
|
1783
1799
|
"use strict";
|
|
1800
|
+
FARM_CACHE_INVALIDATION_HEADER = "x-farm-cache-invalidations";
|
|
1784
1801
|
FARM_CACHE_INVALIDATION_STATE = /* @__PURE__ */ Symbol.for("farm.cacheInvalidationState");
|
|
1785
1802
|
globalState = globalThis;
|
|
1786
1803
|
__name(getFarmCacheInvalidationState, "getFarmCacheInvalidationState");
|
|
1804
|
+
__name(encodeFarmCacheInvalidations, "encodeFarmCacheInvalidations");
|
|
1805
|
+
__name(decodeFarmCacheInvalidations, "decodeFarmCacheInvalidations");
|
|
1787
1806
|
__name(subscribeFarmCacheInvalidation, "subscribeFarmCacheInvalidation");
|
|
1788
1807
|
}
|
|
1789
1808
|
});
|
|
@@ -4833,7 +4852,9 @@ function readManifest(contentDir) {
|
|
|
4833
4852
|
const manifestPath = import_node_path7.default.join(contentDir, FARM_DOCS_LAST_MODIFIED_MANIFEST);
|
|
4834
4853
|
if (!(0, import_node_fs5.existsSync)(manifestPath)) return null;
|
|
4835
4854
|
try {
|
|
4836
|
-
const parsed = JSON.parse(
|
|
4855
|
+
const parsed = JSON.parse(
|
|
4856
|
+
(0, import_node_fs5.readFileSync)(manifestPath, "utf8")
|
|
4857
|
+
);
|
|
4837
4858
|
if (parsed.version !== 1 || !parsed.pages || typeof parsed.pages !== "object") return null;
|
|
4838
4859
|
const pages = Object.fromEntries(
|
|
4839
4860
|
Object.entries(parsed.pages).filter(
|
|
@@ -11115,16 +11136,7 @@ __export(devtools_client_exports, {
|
|
|
11115
11136
|
function parseShortcut(shortcut) {
|
|
11116
11137
|
const tokens = shortcut.toLowerCase().split("+").map((token) => token.trim()).filter(Boolean);
|
|
11117
11138
|
const key = tokens.find(
|
|
11118
|
-
(token) => ![
|
|
11119
|
-
"alt",
|
|
11120
|
-
"ctrl",
|
|
11121
|
-
"control",
|
|
11122
|
-
"meta",
|
|
11123
|
-
"cmd",
|
|
11124
|
-
"command",
|
|
11125
|
-
"mod",
|
|
11126
|
-
"shift"
|
|
11127
|
-
].includes(token)
|
|
11139
|
+
(token) => !["alt", "ctrl", "control", "meta", "cmd", "command", "mod", "shift"].includes(token)
|
|
11128
11140
|
);
|
|
11129
11141
|
if (!key) {
|
|
11130
11142
|
return null;
|
|
@@ -14522,7 +14534,7 @@ function mergeMetadata(base, next) {
|
|
|
14522
14534
|
__name(mergeMetadata, "mergeMetadata");
|
|
14523
14535
|
function addMetadataImageReference(metadata, reference) {
|
|
14524
14536
|
if (reference.kind === "opengraph") {
|
|
14525
|
-
const openGraph = { ...metadata.openGraph
|
|
14537
|
+
const openGraph = { ...metadata.openGraph };
|
|
14526
14538
|
if (!hasMetadataImages(openGraph.images) && !hasMetadataImages(openGraph.image)) {
|
|
14527
14539
|
openGraph.images = [
|
|
14528
14540
|
{
|
|
@@ -14539,7 +14551,7 @@ function addMetadataImageReference(metadata, reference) {
|
|
|
14539
14551
|
openGraph
|
|
14540
14552
|
};
|
|
14541
14553
|
}
|
|
14542
|
-
const twitter = { ...metadata.twitter
|
|
14554
|
+
const twitter = { ...metadata.twitter };
|
|
14543
14555
|
if (!hasMetadataImages(twitter.images)) {
|
|
14544
14556
|
twitter.images = [reference.href];
|
|
14545
14557
|
twitter.card = twitter.card || "summary_large_image";
|
|
@@ -15145,8 +15157,8 @@ var _FarmI18nRuntime = class _FarmI18nRuntime {
|
|
|
15145
15157
|
cookie: this.config.cookie,
|
|
15146
15158
|
direction: getFarmLocaleDirection(resolution.locale, this.config.direction),
|
|
15147
15159
|
messages: {
|
|
15148
|
-
...this.catalogs[this.config.fallbackLocale]
|
|
15149
|
-
...this.catalogs[resolution.locale]
|
|
15160
|
+
...this.catalogs[this.config.fallbackLocale],
|
|
15161
|
+
...this.catalogs[resolution.locale]
|
|
15150
15162
|
}
|
|
15151
15163
|
};
|
|
15152
15164
|
}
|
|
@@ -16620,11 +16632,7 @@ var _FarmApp = class _FarmApp {
|
|
|
16620
16632
|
_setDefaultFarmI18nRuntime(this.i18nRuntime);
|
|
16621
16633
|
this.viteServer = viteServer;
|
|
16622
16634
|
this.routeManager = new RouteManager(this.config, viteServer);
|
|
16623
|
-
this.serverRenderer = new ServerRenderer(
|
|
16624
|
-
this.config,
|
|
16625
|
-
this.routeManager,
|
|
16626
|
-
this.i18nRuntime
|
|
16627
|
-
);
|
|
16635
|
+
this.serverRenderer = new ServerRenderer(this.config, this.routeManager, this.i18nRuntime);
|
|
16628
16636
|
}
|
|
16629
16637
|
async initialize() {
|
|
16630
16638
|
if (process.env.FARM_VERBOSE) {
|
|
@@ -17069,6 +17077,29 @@ var fs3 = __toESM(require("fs"));
|
|
|
17069
17077
|
var path10 = __toESM(require("path"));
|
|
17070
17078
|
init_route_runtime();
|
|
17071
17079
|
|
|
17080
|
+
// src/api/runtime.ts
|
|
17081
|
+
init_cache_invalidation();
|
|
17082
|
+
|
|
17083
|
+
// src/api/endpoint.ts
|
|
17084
|
+
var import_better_call = require("better-call");
|
|
17085
|
+
var _EndpointFailure = class _EndpointFailure extends Error {
|
|
17086
|
+
constructor(code, data, options) {
|
|
17087
|
+
super(options.message);
|
|
17088
|
+
this.name = "EndpointFailure";
|
|
17089
|
+
this.code = code;
|
|
17090
|
+
this.data = data;
|
|
17091
|
+
this.status = options.status;
|
|
17092
|
+
}
|
|
17093
|
+
};
|
|
17094
|
+
__name(_EndpointFailure, "EndpointFailure");
|
|
17095
|
+
var EndpointFailure = _EndpointFailure;
|
|
17096
|
+
function isEndpointFailure(value) {
|
|
17097
|
+
return value instanceof EndpointFailure;
|
|
17098
|
+
}
|
|
17099
|
+
__name(isEndpointFailure, "isEndpointFailure");
|
|
17100
|
+
var EMPTY_ENDPOINT_MIDDLEWARE = Object.freeze([]);
|
|
17101
|
+
var EMPTY_ENDPOINT_CONTEXT = Object.freeze(/* @__PURE__ */ Object.create(null));
|
|
17102
|
+
|
|
17072
17103
|
// src/api/runtime.ts
|
|
17073
17104
|
function matchAPIRoute(routes, pathname) {
|
|
17074
17105
|
const exactRoute = routes.get(pathname);
|
|
@@ -17101,10 +17132,10 @@ __name(invokeAPIRouteEndpoint, "invokeAPIRouteEndpoint");
|
|
|
17101
17132
|
async function invokeAPIRouteEndpointInContext(endpoint, request, params) {
|
|
17102
17133
|
const farmHandler = endpoint.__handler || (isFarmContextHandler(endpoint) ? endpoint : null);
|
|
17103
17134
|
if (!farmHandler) {
|
|
17104
|
-
const
|
|
17135
|
+
const result = await endpoint(request, {
|
|
17105
17136
|
params: Promise.resolve(params)
|
|
17106
17137
|
});
|
|
17107
|
-
return normalizeRouteResponse(
|
|
17138
|
+
return normalizeRouteResponse(result);
|
|
17108
17139
|
}
|
|
17109
17140
|
const url = new URL(request.url);
|
|
17110
17141
|
const query = {};
|
|
@@ -17129,15 +17160,30 @@ async function invokeAPIRouteEndpointInContext(endpoint, request, params) {
|
|
|
17129
17160
|
if (headersValidation instanceof Response) {
|
|
17130
17161
|
return headersValidation;
|
|
17131
17162
|
}
|
|
17132
|
-
const
|
|
17163
|
+
const handlerContext = {
|
|
17133
17164
|
query: queryValidation,
|
|
17134
17165
|
body: bodyValidation,
|
|
17135
17166
|
headers: headersValidation,
|
|
17136
17167
|
request,
|
|
17137
17168
|
context: {},
|
|
17138
17169
|
params
|
|
17139
|
-
}
|
|
17140
|
-
|
|
17170
|
+
};
|
|
17171
|
+
let execution;
|
|
17172
|
+
try {
|
|
17173
|
+
execution = typeof endpoint.__farmInvoke === "function" ? await endpoint.__farmInvoke(handlerContext) : {
|
|
17174
|
+
result: await farmHandler(handlerContext),
|
|
17175
|
+
context: handlerContext.context,
|
|
17176
|
+
handlerExecuted: true,
|
|
17177
|
+
invalidations: []
|
|
17178
|
+
};
|
|
17179
|
+
} catch (error) {
|
|
17180
|
+
if (isEndpointFailure(error)) {
|
|
17181
|
+
return createEndpointFailureResponse(error);
|
|
17182
|
+
}
|
|
17183
|
+
throw error;
|
|
17184
|
+
}
|
|
17185
|
+
const response = normalizeRouteResponse(execution.result);
|
|
17186
|
+
return attachEndpointInvalidations(response, execution.invalidations);
|
|
17141
17187
|
}
|
|
17142
17188
|
__name(invokeAPIRouteEndpointInContext, "invokeAPIRouteEndpointInContext");
|
|
17143
17189
|
function normalizeRouteResponse(result) {
|
|
@@ -17157,6 +17203,40 @@ function isWebResponse2(value) {
|
|
|
17157
17203
|
return value instanceof Response || typeof value === "object" && value !== null && "headers" in value && "status" in value && typeof value.arrayBuffer === "function";
|
|
17158
17204
|
}
|
|
17159
17205
|
__name(isWebResponse2, "isWebResponse");
|
|
17206
|
+
function attachEndpointInvalidations(response, keys) {
|
|
17207
|
+
const existing = decodeFarmCacheInvalidations(
|
|
17208
|
+
response.headers.get(FARM_CACHE_INVALIDATION_HEADER)
|
|
17209
|
+
);
|
|
17210
|
+
const encoded = encodeFarmCacheInvalidations([...existing, ...keys]);
|
|
17211
|
+
if (!encoded) return response;
|
|
17212
|
+
const headers = new Headers(response.headers);
|
|
17213
|
+
headers.set(FARM_CACHE_INVALIDATION_HEADER, encoded);
|
|
17214
|
+
return new Response(response.body, {
|
|
17215
|
+
status: response.status,
|
|
17216
|
+
statusText: response.statusText,
|
|
17217
|
+
headers
|
|
17218
|
+
});
|
|
17219
|
+
}
|
|
17220
|
+
__name(attachEndpointInvalidations, "attachEndpointInvalidations");
|
|
17221
|
+
function createEndpointFailureResponse(failure) {
|
|
17222
|
+
return new Response(
|
|
17223
|
+
JSON.stringify({
|
|
17224
|
+
error: {
|
|
17225
|
+
code: failure.code,
|
|
17226
|
+
message: failure.message,
|
|
17227
|
+
data: failure.data
|
|
17228
|
+
}
|
|
17229
|
+
}),
|
|
17230
|
+
{
|
|
17231
|
+
status: failure.status,
|
|
17232
|
+
headers: {
|
|
17233
|
+
"cache-control": "no-store",
|
|
17234
|
+
"content-type": "application/json"
|
|
17235
|
+
}
|
|
17236
|
+
}
|
|
17237
|
+
);
|
|
17238
|
+
}
|
|
17239
|
+
__name(createEndpointFailureResponse, "createEndpointFailureResponse");
|
|
17160
17240
|
function isFarmContextHandler(endpoint) {
|
|
17161
17241
|
if (typeof endpoint !== "function") {
|
|
17162
17242
|
return false;
|
|
@@ -18185,7 +18265,7 @@ var _MiddlewareManager = class _MiddlewareManager {
|
|
|
18185
18265
|
if (!nestedMatch.matched) {
|
|
18186
18266
|
return { matched: false };
|
|
18187
18267
|
}
|
|
18188
|
-
const params = { ...nestedMatch.params
|
|
18268
|
+
const params = { ...nestedMatch.params };
|
|
18189
18269
|
delete params.__farmRest;
|
|
18190
18270
|
return {
|
|
18191
18271
|
matched: true,
|
|
@@ -19067,6 +19147,12 @@ function transformError(id, message) {
|
|
|
19067
19147
|
}
|
|
19068
19148
|
__name(transformError, "transformError");
|
|
19069
19149
|
|
|
19150
|
+
// package.json
|
|
19151
|
+
var version = "0.1.0-beta.3";
|
|
19152
|
+
|
|
19153
|
+
// src/version.ts
|
|
19154
|
+
var FARM_VERSION = version;
|
|
19155
|
+
|
|
19070
19156
|
// src/after.ts
|
|
19071
19157
|
var import_node_async_hooks4 = require("async_hooks");
|
|
19072
19158
|
var AFTER_STORAGE = /* @__PURE__ */ Symbol.for("@farm.js/core/after-storage");
|
|
@@ -19447,7 +19533,7 @@ function isResolvedEnvScope(value) {
|
|
|
19447
19533
|
}
|
|
19448
19534
|
__name(isResolvedEnvScope, "isResolvedEnvScope");
|
|
19449
19535
|
function isPotentialProgrammaticRouteSourceFile(normalizedFile, srcDirSlug) {
|
|
19450
|
-
return normalizedFile.startsWith(`${srcDirSlug}/`) && /\.(ts|tsx|js|jsx)$/.test(normalizedFile) &&
|
|
19536
|
+
return normalizedFile.startsWith(`${srcDirSlug}/`) && /\.(ts|tsx|js|jsx)$/.test(normalizedFile) && !normalizedFile.endsWith(".d.ts") && !normalizedFile.endsWith("/farm-routes.d.ts") && !normalizedFile.endsWith("/farm-env.d.ts") && !normalizedFile.endsWith("/lib/api.generated.ts");
|
|
19451
19537
|
}
|
|
19452
19538
|
__name(isPotentialProgrammaticRouteSourceFile, "isPotentialProgrammaticRouteSourceFile");
|
|
19453
19539
|
function fileContainsProgrammaticPageRoute(file) {
|
|
@@ -22573,7 +22659,7 @@ async function defineConfig2(config = {}) {
|
|
|
22573
22659
|
const isExposed = hostConfig === true || hostConfig === "0.0.0.0";
|
|
22574
22660
|
console.log("");
|
|
22575
22661
|
console.log(
|
|
22576
|
-
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(
|
|
22662
|
+
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
|
|
22577
22663
|
);
|
|
22578
22664
|
console.log("");
|
|
22579
22665
|
console.log(
|