@farm.js/core 0.1.26 → 0.1.27
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-runtime.d.mts +7 -9
- package/dist/agent-runtime.d.ts +7 -9
- package/dist/api/client.cjs +3 -3
- package/dist/api/client.d.mts +4 -5
- package/dist/api/client.d.ts +4 -5
- package/dist/api/client.mjs +2 -2
- package/dist/api/route-manager.cjs +6 -5
- package/dist/api/route-manager.d.mts +6 -8
- package/dist/api/route-manager.d.ts +6 -8
- package/dist/api/route-manager.mjs +5 -4
- package/dist/api/runtime.cjs +10 -4
- package/dist/api/runtime.d.mts +35 -3
- package/dist/api/runtime.d.ts +35 -3
- package/dist/api/runtime.mjs +9 -3
- package/dist/{api-client-Cx54IR5g.d.mts → api-client-BjMmY8OD.d.mts} +2 -3
- package/dist/{api-client-DykpaKcY.d.ts → api-client-CyFtZFJ4.d.ts} +2 -3
- package/dist/api.cjs +9 -8
- package/dist/api.d.mts +8 -10
- package/dist/api.d.ts +8 -10
- package/dist/api.mjs +9 -8
- package/dist/{app-29vG5tmY.d.mts → app-BfzZdjgX.d.mts} +3 -4
- package/dist/{app-Cx71s_PT.d.ts → app-CXK7Prrt.d.ts} +3 -4
- package/dist/app-markdown.cjs +10 -4
- package/dist/app-markdown.d.mts +8 -10
- package/dist/app-markdown.d.ts +8 -10
- package/dist/app-markdown.mjs +9 -3
- package/dist/{chunk-74RZNRY6.mjs → chunk-3PTVHMLD.mjs} +1 -1
- package/dist/{chunk-OFKG57MZ.mjs → chunk-4FHDV7VM.mjs} +2 -2
- package/dist/{chunk-KLSSO6YD.mjs → chunk-4UNKCNSL.mjs} +1 -1
- package/dist/chunk-5MKEDGLD.cjs +53 -0
- package/dist/{chunk-2CT6XUNO.cjs → chunk-DQMTHWPI.cjs} +4 -4
- package/dist/{chunk-ALIFMS4A.cjs → chunk-FOT7LZEO.cjs} +1 -1
- package/dist/{chunk-DU2CASV6.mjs → chunk-FPW4W3VW.mjs} +1 -1
- package/dist/{chunk-RCYINC4A.cjs → chunk-HF5SIACK.cjs} +3 -3
- package/dist/{chunk-ARXCHQLX.mjs → chunk-HG237IEY.mjs} +4 -4
- package/dist/{chunk-BD2U4ZL6.cjs → chunk-JQGDQO2I.cjs} +8 -8
- package/dist/{chunk-RAI7NULA.mjs → chunk-JT25KHDI.mjs} +1 -1
- package/dist/{chunk-WFPRVVF2.cjs → chunk-KAERLFD3.cjs} +16 -11
- package/dist/{chunk-H7CJRJ4L.cjs → chunk-LAHZ7LZA.cjs} +16 -16
- package/dist/{chunk-JM5GQL4H.mjs → chunk-MBFURXAC.mjs} +1 -1
- package/dist/{chunk-QLXEYIAW.cjs → chunk-NPFGGBM5.cjs} +13 -13
- package/dist/{chunk-VZWO3XVL.mjs → chunk-O2LV5XDG.mjs} +2 -2
- package/dist/chunk-O6XNAMBV.mjs +53 -0
- package/dist/{chunk-UXQXGB5A.mjs → chunk-OGHTEYXS.mjs} +11 -10
- package/dist/{chunk-OOIL3BWR.mjs → chunk-POXI72VV.mjs} +12 -0
- package/dist/{chunk-QGG336NI.mjs → chunk-Q4BHBO6V.mjs} +1 -1
- package/dist/{chunk-3WSWXPYM.cjs → chunk-QI7WQSMI.cjs} +4 -4
- package/dist/{chunk-PPIW3MH6.mjs → chunk-QQQNJS2E.mjs} +1 -1
- package/dist/{chunk-W2HZKYES.cjs → chunk-TDWFCC2T.cjs} +2 -2
- package/dist/{chunk-3TQG7CGC.cjs → chunk-UNSKL6BI.cjs} +78 -77
- package/dist/{chunk-QPPQHB6X.mjs → chunk-UWTQTZFN.mjs} +17 -11
- package/dist/{chunk-YMUH2BLR.mjs → chunk-WIVTGKLY.mjs} +7 -2
- package/dist/{chunk-QJ4D3UKJ.cjs → chunk-WJKVTJJR.cjs} +4 -4
- package/dist/{chunk-OAVTUMJP.cjs → chunk-YXM74XOW.cjs} +9 -9
- package/dist/{chunk-SZ4LYNUX.cjs → chunk-YZBV7733.cjs} +82 -76
- package/dist/{chunk-QIH2HD6H.cjs → chunk-ZSO5GWGD.cjs} +33 -21
- package/dist/{client-plugins-B8RPJnot.d.mts → client-plugins-1GS4zubE.d.mts} +1799 -1623
- package/dist/{client-plugins-bPBf4haK.d.ts → client-plugins-B1Za6F5x.d.ts} +1799 -1623
- package/dist/client-plugins.d.mts +7 -9
- package/dist/client-plugins.d.ts +7 -9
- package/dist/client.cjs +4 -4
- package/dist/client.d.mts +9 -11
- package/dist/client.d.ts +9 -11
- package/dist/client.mjs +3 -3
- package/dist/config.d.mts +7 -9
- package/dist/config.d.ts +7 -9
- package/dist/{devtools-5D4ZDRPR.mjs → devtools-6RN6KHTW.mjs} +6 -3
- package/dist/{devtools-QZJEUOJW.cjs → devtools-CQJ3H6MX.cjs} +7 -4
- package/dist/docs.cjs +9 -6
- package/dist/docs.mjs +8 -5
- package/dist/{endpoint-1zA994xL.d.ts → endpoint-CA-TNX60.d.ts} +1 -1
- package/dist/{endpoint-DAc96i93.d.mts → endpoint-CCHFqyTE.d.mts} +1 -1
- package/dist/index.cjs +21 -20
- package/dist/index.d.mts +15 -17
- package/dist/index.d.ts +15 -17
- package/dist/index.mjs +21 -20
- package/dist/{integration-api-BbaiokCC.d.ts → integration-api-0y4FXJpC.d.mts} +128 -1
- package/dist/{integration-api-BbaiokCC.d.mts → integration-api-BPJo5oXb.d.ts} +128 -1
- package/dist/integrations.d.mts +7 -9
- package/dist/integrations.d.ts +7 -9
- package/dist/internal/app-markdown-runtime.cjs +9 -3
- package/dist/internal/app-markdown-runtime.d.mts +8 -9
- package/dist/internal/app-markdown-runtime.d.ts +8 -9
- package/dist/internal/app-markdown-runtime.mjs +8 -2
- package/dist/internal/build-runtime.cjs +17 -16
- package/dist/internal/build-runtime.d.mts +9 -11
- package/dist/internal/build-runtime.d.ts +9 -11
- package/dist/internal/build-runtime.mjs +16 -15
- package/dist/internal/cli-runtime.cjs +8 -5
- package/dist/internal/cli-runtime.mjs +7 -4
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/compression-runtime.d.mts +7 -9
- package/dist/internal/compression-runtime.d.ts +7 -9
- package/dist/internal/config-runtime.cjs +7 -4
- package/dist/internal/config-runtime.d.mts +8 -10
- package/dist/internal/config-runtime.d.ts +8 -10
- package/dist/internal/config-runtime.mjs +6 -3
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +7 -5
- package/dist/internal/production-runtime.d.mts +12 -14
- package/dist/internal/production-runtime.d.ts +12 -14
- package/dist/internal/production-runtime.mjs +6 -4
- package/dist/markdown.cjs +8 -2
- package/dist/markdown.d.mts +35 -153
- package/dist/markdown.d.ts +35 -153
- package/dist/markdown.mjs +7 -1
- package/dist/{metadata-CzBP4Mfp.d.ts → metadata-7LKgQEWF.d.ts} +1 -1
- package/dist/{metadata-C3na4CBj.d.mts → metadata-B9mCxKgp.d.mts} +1 -1
- package/dist/middleware.d.mts +8 -10
- package/dist/middleware.d.ts +8 -10
- package/dist/navigation.d.mts +9 -11
- package/dist/navigation.d.ts +9 -11
- package/dist/{nitro-ZKLGOTVY.mjs → nitro-NAKCRVHX.mjs} +4 -3
- package/dist/{nitro-KQDU7CFE.cjs → nitro-VYDZGYFY.cjs} +4 -3
- package/dist/plugin.cjs +13 -12
- package/dist/plugin.d.mts +8 -10
- package/dist/plugin.d.ts +8 -10
- package/dist/plugin.mjs +12 -11
- package/dist/{production-runtime-CYg4wM4E.d.ts → production-runtime-B3xnY6fI.d.ts} +1 -1
- package/dist/{production-runtime-DP94hPGe.d.mts → production-runtime-DramhI0c.d.mts} +1 -1
- package/dist/{render-plan-Bl6Fzg5z.d.ts → render-plan-CpW32tOL.d.ts} +1 -1
- package/dist/{render-plan-CKAJg0jC.d.mts → render-plan-CtQB-zHS.d.mts} +1 -1
- package/dist/renderer-client.d.mts +5 -7
- package/dist/renderer-client.d.ts +5 -7
- package/dist/{request-CR-Bp1Px.d.ts → request-BVGGeQv4.d.ts} +1 -1
- package/dist/{request-CrBCcPZZ.d.mts → request-DlLVBKe3.d.mts} +1 -1
- package/dist/request.d.mts +8 -10
- package/dist/request.d.ts +8 -10
- package/dist/{route-rendering-CZH5FegB.d.ts → route-rendering-BdEldajn.d.ts} +1 -1
- package/dist/{route-rendering-C1NAHo-C.d.mts → route-rendering-DChYLNdh.d.mts} +1 -1
- package/dist/{router-Cg_kD3Bd.d.ts → router-D0Az-1Nu.d.ts} +1 -1
- package/dist/{router-B57eDJ3u.d.mts → router-D5htHn_M.d.mts} +1 -1
- package/dist/routes.d.mts +5 -7
- package/dist/routes.d.ts +5 -7
- package/dist/server-fn-client.d.mts +3 -4
- package/dist/server-fn-client.d.ts +3 -4
- package/dist/server-fn.d.mts +1 -1
- package/dist/server-fn.d.ts +1 -1
- package/dist/server-plugins.d.mts +7 -9
- package/dist/server-plugins.d.ts +7 -9
- package/dist/server-query-client.d.mts +1 -1
- package/dist/server-query-client.d.ts +1 -1
- package/dist/server-query.d.mts +1 -1
- package/dist/server-query.d.ts +1 -1
- package/dist/server.cjs +198 -104
- package/dist/server.d.mts +12 -14
- package/dist/server.d.ts +12 -14
- package/dist/server.mjs +184 -90
- package/dist/{spa-router-DTdbuinx.d.mts → spa-router-DVfSJZ5o.d.mts} +2 -2
- package/dist/{spa-router-BstQUO6Q.d.ts → spa-router-DmwP_7QL.d.ts} +2 -2
- package/dist/testing.cjs +6 -5
- package/dist/testing.d.mts +6 -8
- package/dist/testing.d.ts +6 -8
- package/dist/testing.mjs +5 -4
- package/dist/{utils-CS3ZLnEJ.d.mts → utils-B_Rmr0-n.d.mts} +1 -1
- package/dist/{utils-D3rdsIvM.d.ts → utils-Dv0OuLtF.d.ts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +13 -12
- package/dist/vite.d.mts +7 -9
- package/dist/vite.d.ts +7 -9
- package/dist/vite.mjs +12 -11
- package/package.json +1 -1
- package/dist/route-B0XrsrFk.d.mts +0 -128
- package/dist/route-DOEpbyWZ.d.ts +0 -128
- package/dist/{chunk-GDUYXFIS.mjs → chunk-6EG7U4NF.mjs} +3 -3
- package/dist/{chunk-YAOX43YI.cjs → chunk-C7OUJ6JI.cjs} +2 -2
- package/dist/{chunk-IXTFU4PL.cjs → chunk-NL3ZSMZB.cjs} +2 -2
- package/dist/{chunk-L6V3P73N.mjs → chunk-UOXGA6TO.mjs} +4 -4
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { cE as RedirectConfig, e as FarmRequest, f as FarmResponse, h as FarmPluginContext, a as FarmPlugin, cF as HeaderConfig, cG as RewriteConfig } from './client-plugins-1GS4zubE.mjs';
|
|
2
|
+
export { c0 as FarmPluginLifecycle, c9 as FarmPluginRuntimeEndpoint, ca as FarmPluginRuntimeEndpointEvent, c1 as FarmRequestPluginContext, c2 as FarmRequestStore } from './client-plugins-1GS4zubE.mjs';
|
|
3
3
|
import { R as ResolvedFarmI18nConfig } from './types-Z0aotQ8w.mjs';
|
|
4
4
|
export { createCompressionPlugin } from './internal/compression-runtime.mjs';
|
|
5
5
|
import './lifecycle-DK06VuKP.mjs';
|
|
6
|
-
import './
|
|
7
|
-
import './endpoint-
|
|
6
|
+
import './integration-api-0y4FXJpC.mjs';
|
|
7
|
+
import './endpoint-CCHFqyTE.mjs';
|
|
8
8
|
import './cache.mjs';
|
|
9
9
|
import './renderer.mjs';
|
|
10
10
|
import './deployment.mjs';
|
|
11
11
|
import 'http';
|
|
12
|
-
import './
|
|
12
|
+
import './server-fn.mjs';
|
|
13
|
+
import './server-fn-error-DDh14a0V.mjs';
|
|
14
|
+
import './server-query.mjs';
|
|
13
15
|
import './types-Cc8l9IqS.mjs';
|
|
14
16
|
import 'db0';
|
|
15
17
|
import 'unstorage';
|
|
16
18
|
import './schema.mjs';
|
|
17
19
|
import 'react';
|
|
18
|
-
import './integration-api-BbaiokCC.mjs';
|
|
19
20
|
import '@farming-labs/orm';
|
|
20
21
|
import './types-DFbjpjXX.mjs';
|
|
21
22
|
import '@farming-labs/docs';
|
|
@@ -26,12 +27,9 @@ import './workflows-CR9ex-gz.mjs';
|
|
|
26
27
|
import './cron.mjs';
|
|
27
28
|
import './env.mjs';
|
|
28
29
|
import './server-action-security.mjs';
|
|
29
|
-
import './server-fn-error-DDh14a0V.mjs';
|
|
30
30
|
import 'rolldown/utils';
|
|
31
31
|
import 'rolldown';
|
|
32
32
|
import './image-config-Duob7wER.mjs';
|
|
33
|
-
import './server-fn.mjs';
|
|
34
|
-
import './server-query.mjs';
|
|
35
33
|
import './types-DQnyD3VD.mjs';
|
|
36
34
|
import './font.mjs';
|
|
37
35
|
import './after.mjs';
|
package/dist/server-plugins.d.ts
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { cE as RedirectConfig, e as FarmRequest, f as FarmResponse, h as FarmPluginContext, a as FarmPlugin, cF as HeaderConfig, cG as RewriteConfig } from './client-plugins-B1Za6F5x.js';
|
|
2
|
+
export { c0 as FarmPluginLifecycle, c9 as FarmPluginRuntimeEndpoint, ca as FarmPluginRuntimeEndpointEvent, c1 as FarmRequestPluginContext, c2 as FarmRequestStore } from './client-plugins-B1Za6F5x.js';
|
|
3
3
|
import { R as ResolvedFarmI18nConfig } from './types-Z0aotQ8w.js';
|
|
4
4
|
export { createCompressionPlugin } from './internal/compression-runtime.js';
|
|
5
5
|
import './lifecycle-DK06VuKP.js';
|
|
6
|
-
import './
|
|
7
|
-
import './endpoint-
|
|
6
|
+
import './integration-api-BPJo5oXb.js';
|
|
7
|
+
import './endpoint-CA-TNX60.js';
|
|
8
8
|
import './cache.js';
|
|
9
9
|
import './renderer.js';
|
|
10
10
|
import './deployment.js';
|
|
11
11
|
import 'http';
|
|
12
|
-
import './
|
|
12
|
+
import './server-fn.js';
|
|
13
|
+
import './server-fn-error-DDh14a0V.js';
|
|
14
|
+
import './server-query.js';
|
|
13
15
|
import './types-Cc8l9IqS.js';
|
|
14
16
|
import 'db0';
|
|
15
17
|
import 'unstorage';
|
|
16
18
|
import './schema.js';
|
|
17
19
|
import 'react';
|
|
18
|
-
import './integration-api-BbaiokCC.js';
|
|
19
20
|
import '@farming-labs/orm';
|
|
20
21
|
import './types-DFbjpjXX.js';
|
|
21
22
|
import '@farming-labs/docs';
|
|
@@ -26,12 +27,9 @@ import './workflows-CR9ex-gz.js';
|
|
|
26
27
|
import './cron.js';
|
|
27
28
|
import './env.js';
|
|
28
29
|
import './server-action-security.js';
|
|
29
|
-
import './server-fn-error-DDh14a0V.js';
|
|
30
30
|
import 'rolldown/utils';
|
|
31
31
|
import 'rolldown';
|
|
32
32
|
import './image-config-Duob7wER.js';
|
|
33
|
-
import './server-fn.js';
|
|
34
|
-
import './server-query.js';
|
|
35
33
|
import './types-DQnyD3VD.js';
|
|
36
34
|
import './font.js';
|
|
37
35
|
import './after.js';
|
|
@@ -5,7 +5,7 @@ export { F as FarmServerQueryActionInvocation, b as beginFarmServerQueryAction,
|
|
|
5
5
|
import './cache.mjs';
|
|
6
6
|
import './server-fn.mjs';
|
|
7
7
|
import './server-fn-error-DDh14a0V.mjs';
|
|
8
|
-
import './endpoint-
|
|
8
|
+
import './endpoint-CCHFqyTE.mjs';
|
|
9
9
|
|
|
10
10
|
type UseServerQueryOptions = ServerQueryFetchOptions & {
|
|
11
11
|
enabled?: boolean;
|
|
@@ -5,7 +5,7 @@ export { F as FarmServerQueryActionInvocation, b as beginFarmServerQueryAction,
|
|
|
5
5
|
import './cache.js';
|
|
6
6
|
import './server-fn.js';
|
|
7
7
|
import './server-fn-error-DDh14a0V.js';
|
|
8
|
-
import './endpoint-
|
|
8
|
+
import './endpoint-CA-TNX60.js';
|
|
9
9
|
|
|
10
10
|
type UseServerQueryOptions = ServerQueryFetchOptions & {
|
|
11
11
|
enabled?: boolean;
|
package/dist/server-query.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RouteDataCacheKey } from './cache.mjs';
|
|
2
2
|
import { ServerFnContext, ServerFnSchema, AnyServerFnMiddleware, InferServerFnSchemaOutput, ServerFnMiddlewareContext, ServerFnMCPMetadata, ServerFnHandler, InferServerFnSchemaInput } from './server-fn.mjs';
|
|
3
3
|
import './server-fn-error-DDh14a0V.mjs';
|
|
4
|
-
import './endpoint-
|
|
4
|
+
import './endpoint-CCHFqyTE.mjs';
|
|
5
5
|
|
|
6
6
|
type MaybePromise<T> = T | Promise<T>;
|
|
7
7
|
type ServerQueryStaleTime = number | false | `${number}${"ms" | "s" | "m" | "h"}`;
|
package/dist/server-query.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RouteDataCacheKey } from './cache.js';
|
|
2
2
|
import { ServerFnContext, ServerFnSchema, AnyServerFnMiddleware, InferServerFnSchemaOutput, ServerFnMiddlewareContext, ServerFnMCPMetadata, ServerFnHandler, InferServerFnSchemaInput } from './server-fn.js';
|
|
3
3
|
import './server-fn-error-DDh14a0V.js';
|
|
4
|
-
import './endpoint-
|
|
4
|
+
import './endpoint-CA-TNX60.js';
|
|
5
5
|
|
|
6
6
|
type MaybePromise<T> = T | Promise<T>;
|
|
7
7
|
type ServerQueryStaleTime = number | false | `${number}${"ms" | "s" | "m" | "h"}`;
|
package/dist/server.cjs
CHANGED
|
@@ -19,7 +19,8 @@ var _chunkIK6LVLKCcjs = require('./chunk-IK6LVLKC.cjs');
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
|
|
23
|
+
var _chunkKAERLFD3cjs = require('./chunk-KAERLFD3.cjs');
|
|
23
24
|
require('./chunk-KR6CKSXT.cjs');
|
|
24
25
|
|
|
25
26
|
|
|
@@ -46,14 +47,14 @@ require('./chunk-SK35NQKK.cjs');
|
|
|
46
47
|
|
|
47
48
|
|
|
48
49
|
|
|
49
|
-
var
|
|
50
|
+
var _chunkUNSKL6BIcjs = require('./chunk-UNSKL6BI.cjs');
|
|
50
51
|
require('./chunk-DW34V5SM.cjs');
|
|
51
52
|
|
|
52
53
|
|
|
53
54
|
var _chunkE2ROOWQCcjs = require('./chunk-E2ROOWQC.cjs');
|
|
54
55
|
require('./chunk-JSROZYYO.cjs');
|
|
55
56
|
require('./chunk-XSIRSMAS.cjs');
|
|
56
|
-
require('./chunk-
|
|
57
|
+
require('./chunk-WJKVTJJR.cjs');
|
|
57
58
|
require('./chunk-SYQ3MOWW.cjs');
|
|
58
59
|
require('./chunk-CXP5U3RW.cjs');
|
|
59
60
|
require('./chunk-K3F2E6GS.cjs');
|
|
@@ -87,7 +88,7 @@ var _chunkVPTDD5XFcjs = require('./chunk-VPTDD5XF.cjs');
|
|
|
87
88
|
|
|
88
89
|
|
|
89
90
|
var _chunkPSV6XKPOcjs = require('./chunk-PSV6XKPO.cjs');
|
|
90
|
-
require('./chunk-
|
|
91
|
+
require('./chunk-DQMTHWPI.cjs');
|
|
91
92
|
require('./chunk-YFPGHF5F.cjs');
|
|
92
93
|
require('./chunk-6EXBPJ24.cjs');
|
|
93
94
|
|
|
@@ -103,11 +104,13 @@ require('./chunk-6EXBPJ24.cjs');
|
|
|
103
104
|
|
|
104
105
|
|
|
105
106
|
var _chunkT5CERMEHcjs = require('./chunk-T5CERMEH.cjs');
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
require('./chunk-
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
var _chunkVEKFLAQMcjs = require('./chunk-VEKFLAQM.cjs');
|
|
110
|
+
require('./chunk-TDWFCC2T.cjs');
|
|
111
|
+
require('./chunk-HF5SIACK.cjs');
|
|
109
112
|
require('./chunk-OHY2ZWUG.cjs');
|
|
110
|
-
require('./chunk-
|
|
113
|
+
require('./chunk-ZSO5GWGD.cjs');
|
|
111
114
|
require('./chunk-J63ZH5OQ.cjs');
|
|
112
115
|
require('./chunk-UYIHRDE4.cjs');
|
|
113
116
|
require('./chunk-MPEYMSCF.cjs');
|
|
@@ -156,17 +159,18 @@ require('./chunk-4PPEPOZZ.cjs');
|
|
|
156
159
|
|
|
157
160
|
|
|
158
161
|
var _chunkMQ3H6LT5cjs = require('./chunk-MQ3H6LT5.cjs');
|
|
159
|
-
require('./chunk-
|
|
162
|
+
require('./chunk-JQGDQO2I.cjs');
|
|
160
163
|
require('./chunk-N4RLRSWW.cjs');
|
|
161
164
|
require('./chunk-2CQ74SP6.cjs');
|
|
162
165
|
require('./chunk-UJ2C4ICS.cjs');
|
|
163
166
|
require('./chunk-IQXFRNY2.cjs');
|
|
164
167
|
require('./chunk-LYLEZIG3.cjs');
|
|
165
|
-
require('./chunk-
|
|
168
|
+
require('./chunk-C7OUJ6JI.cjs');
|
|
166
169
|
require('./chunk-I4J452B7.cjs');
|
|
167
170
|
require('./chunk-WMAPPDMM.cjs');
|
|
168
|
-
require('./chunk-WPYFSQKK.cjs');
|
|
169
171
|
require('./chunk-TKJZFIML.cjs');
|
|
172
|
+
require('./chunk-5MKEDGLD.cjs');
|
|
173
|
+
require('./chunk-WPYFSQKK.cjs');
|
|
170
174
|
require('./chunk-6V4TDWEC.cjs');
|
|
171
175
|
require('./chunk-SOR334EB.cjs');
|
|
172
176
|
require('./chunk-EM6SBQKM.cjs');
|
|
@@ -198,13 +202,13 @@ require('./chunk-QNPEUFHQ.cjs');
|
|
|
198
202
|
var _chunkUQZ4AYTHcjs = require('./chunk-UQZ4AYTH.cjs');
|
|
199
203
|
|
|
200
204
|
|
|
201
|
-
var
|
|
205
|
+
var _chunkFOT7LZEOcjs = require('./chunk-FOT7LZEO.cjs');
|
|
202
206
|
require('./chunk-OYEUREB6.cjs');
|
|
203
207
|
require('./chunk-7W3CPVXS.cjs');
|
|
204
208
|
require('./chunk-NZKJGRB3.cjs');
|
|
205
209
|
require('./chunk-72ADZ6GQ.cjs');
|
|
206
|
-
require('./chunk-G7HXGLEC.cjs');
|
|
207
210
|
require('./chunk-ARJWXNQL.cjs');
|
|
211
|
+
require('./chunk-G7HXGLEC.cjs');
|
|
208
212
|
require('./chunk-S3A45T7F.cjs');
|
|
209
213
|
require('./chunk-75BRBIFP.cjs');
|
|
210
214
|
require('./chunk-3TQWUUNP.cjs');
|
|
@@ -262,11 +266,30 @@ require('./chunk-NO3WWW3N.cjs');
|
|
|
262
266
|
|
|
263
267
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
264
268
|
|
|
265
|
-
// src/server/create-server.ts
|
|
266
|
-
var _vite = require('vite');
|
|
267
|
-
|
|
268
269
|
// src/server/dev-lifecycle.ts
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
var _vite = require('vite');
|
|
269
274
|
var VITE_CLOSE_TIMEOUT_MS = 1e4;
|
|
275
|
+
async function createViteDevServer(config, capture) {
|
|
276
|
+
const resolved = await _vite.resolveConfig.call(void 0,
|
|
277
|
+
config,
|
|
278
|
+
"serve",
|
|
279
|
+
void 0,
|
|
280
|
+
void 0,
|
|
281
|
+
false,
|
|
282
|
+
void 0,
|
|
283
|
+
(plugins) => {
|
|
284
|
+
plugins.unshift({
|
|
285
|
+
name: "farm:dev-construction",
|
|
286
|
+
configureServer: { order: "pre", handler: capture }
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
);
|
|
290
|
+
return _vite.createServer.call(void 0, resolved);
|
|
291
|
+
}
|
|
292
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, createViteDevServer, "createViteDevServer");
|
|
270
293
|
async function drainVitePendingWork(server) {
|
|
271
294
|
const environments = Object.values(_nullishCoalesce(server.environments, () => ( {})));
|
|
272
295
|
await Promise.allSettled(
|
|
@@ -286,6 +309,44 @@ async function drainVitePendingWork(server) {
|
|
|
286
309
|
}
|
|
287
310
|
}
|
|
288
311
|
_chunkS3JO3N4Hcjs.__name.call(void 0, drainVitePendingWork, "drainVitePendingWork");
|
|
312
|
+
async function closeViteDevServer(server, closeViteServer) {
|
|
313
|
+
const closingHttpServer = server.httpServer;
|
|
314
|
+
const closingWatcher = server.watcher;
|
|
315
|
+
const closingWebSocket = server.ws;
|
|
316
|
+
let timer;
|
|
317
|
+
const timedOut = new Promise((resolve) => {
|
|
318
|
+
timer = setTimeout(() => resolve("timeout"), VITE_CLOSE_TIMEOUT_MS);
|
|
319
|
+
_optionalChain([timer, 'access', _4 => _4.unref, 'optionalCall', _5 => _5()]);
|
|
320
|
+
});
|
|
321
|
+
try {
|
|
322
|
+
const outcome = await Promise.race([
|
|
323
|
+
(async () => {
|
|
324
|
+
await drainVitePendingWork(server);
|
|
325
|
+
await closeViteServer();
|
|
326
|
+
return "closed";
|
|
327
|
+
})(),
|
|
328
|
+
timedOut
|
|
329
|
+
]);
|
|
330
|
+
if (outcome === "timeout") {
|
|
331
|
+
_chunk5QIKR7RRcjs.logger.error(
|
|
332
|
+
`Vite server close did not settle within ${VITE_CLOSE_TIMEOUT_MS}ms; continuing shutdown without it (https://github.com/farming-labs/farm.js/issues/1263)`
|
|
333
|
+
);
|
|
334
|
+
await Promise.allSettled([
|
|
335
|
+
new Promise((resolve) => {
|
|
336
|
+
if (!closingHttpServer || !closingHttpServer.listening) return resolve();
|
|
337
|
+
closingHttpServer.close(() => resolve());
|
|
338
|
+
}),
|
|
339
|
+
Promise.resolve(_optionalChain([closingWatcher, 'optionalAccess', _6 => _6.close, 'optionalCall', _7 => _7()])).catch(() => {
|
|
340
|
+
}),
|
|
341
|
+
Promise.resolve(_optionalChain([closingWebSocket, 'optionalAccess', _8 => _8.close, 'optionalCall', _9 => _9()])).catch(() => {
|
|
342
|
+
})
|
|
343
|
+
]);
|
|
344
|
+
}
|
|
345
|
+
} finally {
|
|
346
|
+
if (timer) clearTimeout(timer);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, closeViteDevServer, "closeViteDevServer");
|
|
289
350
|
function createFarmDevLifecyclePlugin(pluginManager, instrumentation) {
|
|
290
351
|
let runtimeServer;
|
|
291
352
|
const pendingRestarts = /* @__PURE__ */ new Set();
|
|
@@ -295,9 +356,6 @@ function createFarmDevLifecyclePlugin(pluginManager, instrumentation) {
|
|
|
295
356
|
_nullishCoalesce(shutdownPromise, () => ( (shutdownPromise = (async () => {
|
|
296
357
|
await Promise.allSettled(pendingRestarts);
|
|
297
358
|
const closeViteServer = viteClosers.get(server.environments);
|
|
298
|
-
const closingHttpServer = server.httpServer;
|
|
299
|
-
const closingWatcher = server.watcher;
|
|
300
|
-
const closingWebSocket = server.ws;
|
|
301
359
|
const failures = [];
|
|
302
360
|
const step = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (label, run) => {
|
|
303
361
|
try {
|
|
@@ -306,45 +364,12 @@ function createFarmDevLifecyclePlugin(pluginManager, instrumentation) {
|
|
|
306
364
|
failures.push({ label, error });
|
|
307
365
|
}
|
|
308
366
|
}, "step");
|
|
309
|
-
await step("Vite server close",
|
|
310
|
-
let timer;
|
|
311
|
-
const timedOut = new Promise((resolve) => {
|
|
312
|
-
timer = setTimeout(() => resolve("timeout"), VITE_CLOSE_TIMEOUT_MS);
|
|
313
|
-
_optionalChain([timer, 'access', _4 => _4.unref, 'optionalCall', _5 => _5()]);
|
|
314
|
-
});
|
|
315
|
-
try {
|
|
316
|
-
const outcome = await Promise.race([
|
|
317
|
-
(async () => {
|
|
318
|
-
await drainVitePendingWork(server);
|
|
319
|
-
await closeViteServer();
|
|
320
|
-
return "closed";
|
|
321
|
-
})(),
|
|
322
|
-
timedOut
|
|
323
|
-
]);
|
|
324
|
-
if (outcome === "timeout") {
|
|
325
|
-
_chunk5QIKR7RRcjs.logger.error(
|
|
326
|
-
`Vite server close did not settle within ${VITE_CLOSE_TIMEOUT_MS}ms; continuing shutdown without it (https://github.com/farming-labs/farm.js/issues/1263)`
|
|
327
|
-
);
|
|
328
|
-
await Promise.allSettled([
|
|
329
|
-
new Promise((resolve) => {
|
|
330
|
-
if (!closingHttpServer || !closingHttpServer.listening) return resolve();
|
|
331
|
-
closingHttpServer.close(() => resolve());
|
|
332
|
-
}),
|
|
333
|
-
Promise.resolve(_optionalChain([closingWatcher, 'optionalAccess', _6 => _6.close, 'optionalCall', _7 => _7()])).catch(() => {
|
|
334
|
-
}),
|
|
335
|
-
Promise.resolve(_optionalChain([closingWebSocket, 'optionalAccess', _8 => _8.close, 'optionalCall', _9 => _9()])).catch(() => {
|
|
336
|
-
})
|
|
337
|
-
]);
|
|
338
|
-
}
|
|
339
|
-
} finally {
|
|
340
|
-
if (timer) clearTimeout(timer);
|
|
341
|
-
}
|
|
342
|
-
});
|
|
367
|
+
await step("Vite server close", () => closeViteDevServer(server, closeViteServer));
|
|
343
368
|
await step("Plugin runtime shutdown", () => pluginManager.closeRuntime("dev-server-closed"));
|
|
344
369
|
await step("Instrumentation shutdown", () => instrumentation.shutdown());
|
|
345
370
|
if (failures.length === 1) throw failures[0].error;
|
|
346
371
|
if (failures.length > 1) {
|
|
347
|
-
throw new (0,
|
|
372
|
+
throw new (0, _chunkUNSKL6BIcjs.FarmRuntimeShutdownError)(
|
|
348
373
|
`Dev server shutdown failed during ${failures.map(({ label }) => label).join(", ")}`,
|
|
349
374
|
failures.map(({ error }) => error)
|
|
350
375
|
);
|
|
@@ -419,7 +444,7 @@ function createBrandingPlugin() {
|
|
|
419
444
|
const pc = _chunkM2L4MYDQcjs.createCliColors.call(void 0, );
|
|
420
445
|
console.log("");
|
|
421
446
|
console.log(
|
|
422
|
-
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${
|
|
447
|
+
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkFOT7LZEOcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
|
|
423
448
|
);
|
|
424
449
|
console.log("");
|
|
425
450
|
console.log(
|
|
@@ -478,19 +503,66 @@ function withPortFlag(vite, port) {
|
|
|
478
503
|
return port === void 0 ? vite : { ...vite, server: { ..._optionalChain([vite, 'optionalAccess', _15 => _15.server]), port } };
|
|
479
504
|
}
|
|
480
505
|
_chunkS3JO3N4Hcjs.__name.call(void 0, withPortFlag, "withPortFlag");
|
|
481
|
-
|
|
506
|
+
function inlineEnvScope(scope) {
|
|
507
|
+
return Object.fromEntries(
|
|
508
|
+
Object.entries(scope || {}).map(([key, value]) => [
|
|
509
|
+
key,
|
|
510
|
+
typeof value === "function" || value && typeof value === "object" && "parse" in value && typeof value.parse === "function" ? value : () => value
|
|
511
|
+
])
|
|
512
|
+
);
|
|
513
|
+
}
|
|
514
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, inlineEnvScope, "inlineEnvScope");
|
|
515
|
+
async function resolveInlineConfig(config, mode) {
|
|
516
|
+
if (_chunkKAERLFD3cjs.isResolvedFarmConfig.call(void 0, config)) {
|
|
517
|
+
_chunkVEKFLAQMcjs.setEnv.call(void 0, config.env);
|
|
518
|
+
return { ...config };
|
|
519
|
+
}
|
|
520
|
+
const docs = config.docs;
|
|
521
|
+
const resolvedDocs = docs && typeof docs === "object" && "enabled" in docs && "entry" in docs && "config" in docs ? docs : void 0;
|
|
522
|
+
const i18n = config.i18n;
|
|
523
|
+
const resolvedI18n = i18n && "enabled" in i18n ? i18n : void 0;
|
|
524
|
+
const auth = config.auth;
|
|
525
|
+
const resolvedAuth = auth && typeof auth === "object" && typeof auth.emailAndPassword === "object" && "enabled" in auth.emailAndPassword ? auth : void 0;
|
|
526
|
+
const resolved = await _chunkKAERLFD3cjs.resolveConfig.call(void 0,
|
|
527
|
+
{
|
|
528
|
+
...config,
|
|
529
|
+
...resolvedDocs ? { docs: false } : {},
|
|
530
|
+
...resolvedI18n ? { i18n: false } : {},
|
|
531
|
+
...resolvedAuth ? { auth: false } : {},
|
|
532
|
+
...config.layers ? { extends: [] } : {},
|
|
533
|
+
// FarmConfig also accepts literal runtime env values. Adapt only inline
|
|
534
|
+
// input; file/layer config keeps the normal parser validation contract.
|
|
535
|
+
env: config.env && {
|
|
536
|
+
server: inlineEnvScope(config.env.server),
|
|
537
|
+
public: inlineEnvScope(config.env.public)
|
|
538
|
+
}
|
|
539
|
+
},
|
|
540
|
+
mode
|
|
541
|
+
);
|
|
542
|
+
if (resolvedDocs) resolved.docs = resolvedDocs;
|
|
543
|
+
if (resolvedI18n) resolved.i18n = resolvedI18n;
|
|
544
|
+
if (resolvedAuth) resolved.auth = resolvedAuth;
|
|
545
|
+
if (config.layers) {
|
|
546
|
+
resolved.extends = config.extends || [];
|
|
547
|
+
resolved.layers = [...config.layers];
|
|
548
|
+
}
|
|
549
|
+
return resolved;
|
|
550
|
+
}
|
|
551
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveInlineConfig, "resolveInlineConfig");
|
|
552
|
+
async function createServer2(config = {}, options = {}) {
|
|
482
553
|
let pluginManager = null;
|
|
483
554
|
let instrumentation = null;
|
|
555
|
+
let server;
|
|
556
|
+
let pendingViteServer;
|
|
484
557
|
try {
|
|
485
558
|
const root = config.root || process.cwd();
|
|
486
559
|
const mode = process.env.NODE_ENV === "production" ? "production" : "development";
|
|
487
|
-
const userConfig = await
|
|
488
|
-
const resolvedConfig = userConfig ? await
|
|
489
|
-
const
|
|
490
|
-
const instrumentationRoot = instrumentationConfig.root || root;
|
|
560
|
+
const userConfig = await _chunkKAERLFD3cjs.loadConfig.call(void 0, root, void 0, mode);
|
|
561
|
+
const resolvedConfig = userConfig ? await _chunkKAERLFD3cjs.resolveConfig.call(void 0, userConfig, mode) : await resolveInlineConfig(config, mode);
|
|
562
|
+
const instrumentationRoot = resolvedConfig.root;
|
|
491
563
|
const instrumentationFile = _chunkKCMTCM6Icjs.resolveFarmInstrumentationFile.call(void 0,
|
|
492
564
|
instrumentationRoot,
|
|
493
|
-
|
|
565
|
+
resolvedConfig.srcDir
|
|
494
566
|
);
|
|
495
567
|
const instrumentationModule = await _chunkKCMTCM6Icjs.loadFarmInstrumentation.call(void 0,
|
|
496
568
|
instrumentationFile,
|
|
@@ -502,32 +574,28 @@ async function createServer(config = {}, options = {}) {
|
|
|
502
574
|
runtime: "nodejs"
|
|
503
575
|
});
|
|
504
576
|
await instrumentation.start();
|
|
505
|
-
pluginManager = new (0,
|
|
506
|
-
config: resolvedConfig
|
|
577
|
+
pluginManager = new (0, _chunkUNSKL6BIcjs.PluginManager)({
|
|
578
|
+
config: resolvedConfig,
|
|
507
579
|
isDev: mode === "development",
|
|
508
580
|
isProd: mode === "production"
|
|
509
581
|
});
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
pluginManager.addPlugin(_chunkYZTASLPQcjs.createRewritesPlugin.call(void 0, rewrites, { i18n: resolvedConfig.i18n }));
|
|
522
|
-
}
|
|
523
|
-
if (resolvedConfig.compress && mode === "production") {
|
|
524
|
-
pluginManager.addPlugin(_chunkR6AIILIIcjs.createCompressionPlugin.call(void 0, ));
|
|
525
|
-
}
|
|
526
|
-
if (resolvedConfig.plugins) {
|
|
527
|
-
pluginManager.addPlugins(resolvedConfig.plugins);
|
|
528
|
-
}
|
|
582
|
+
const redirects = await resolvedConfig.redirects();
|
|
583
|
+
const headers = await resolvedConfig.headers();
|
|
584
|
+
const rewrites = await resolvedConfig.rewrites();
|
|
585
|
+
if (redirects.length > 0) {
|
|
586
|
+
pluginManager.addPlugin(_chunkQZRVZSPNcjs.createRedirectsPlugin.call(void 0, redirects, { i18n: resolvedConfig.i18n }));
|
|
587
|
+
}
|
|
588
|
+
if (headers.length > 0) {
|
|
589
|
+
pluginManager.addPlugin(_chunkQZRVZSPNcjs.createHeadersPlugin.call(void 0, headers, { i18n: resolvedConfig.i18n }));
|
|
590
|
+
}
|
|
591
|
+
if (rewrites.length > 0) {
|
|
592
|
+
pluginManager.addPlugin(_chunkYZTASLPQcjs.createRewritesPlugin.call(void 0, rewrites, { i18n: resolvedConfig.i18n }));
|
|
529
593
|
}
|
|
530
|
-
|
|
594
|
+
if (resolvedConfig.compress && mode === "production") {
|
|
595
|
+
pluginManager.addPlugin(_chunkR6AIILIIcjs.createCompressionPlugin.call(void 0, ));
|
|
596
|
+
}
|
|
597
|
+
pluginManager.addPlugins(resolvedConfig.plugins);
|
|
598
|
+
const infraAnalytics = resolvedConfig.analytics !== false ? _chunkND224OE2cjs.createFarmInfraAnalyticsPlugin.call(void 0, ) : null;
|
|
531
599
|
if (infraAnalytics) pluginManager.addPlugin(infraAnalytics);
|
|
532
600
|
if (mode === "development") {
|
|
533
601
|
const hasLogger = pluginManager.getPlugins().some((p) => p.name === "farm:logger");
|
|
@@ -536,11 +604,11 @@ async function createServer(config = {}, options = {}) {
|
|
|
536
604
|
}
|
|
537
605
|
}
|
|
538
606
|
await pluginManager.runHookParallel("init");
|
|
539
|
-
let finalConfig = resolvedConfig
|
|
607
|
+
let finalConfig = resolvedConfig;
|
|
540
608
|
finalConfig = await pluginManager.runHookSerial("config", finalConfig);
|
|
541
609
|
finalConfig.renderer = _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, finalConfig.renderer);
|
|
542
610
|
const projectRoot = finalConfig.root || process.cwd();
|
|
543
|
-
finalConfig.images =
|
|
611
|
+
finalConfig.images = _chunkUNSKL6BIcjs.resolveFarmImageProviderForRuntime.call(void 0, finalConfig.images, {
|
|
544
612
|
root: projectRoot,
|
|
545
613
|
dev: true
|
|
546
614
|
});
|
|
@@ -557,21 +625,21 @@ async function createServer(config = {}, options = {}) {
|
|
|
557
625
|
if (shouldUseProjectPostcss) {
|
|
558
626
|
_chunk5QIKR7RRcjs.logger.info("\u{1F4E6} Using project PostCSS/Tailwind configuration");
|
|
559
627
|
} else {
|
|
560
|
-
tailwindVitePlugin = await
|
|
628
|
+
tailwindVitePlugin = await _chunkUNSKL6BIcjs.loadTailwindVitePlugin.call(void 0, );
|
|
561
629
|
}
|
|
562
|
-
|
|
563
|
-
|
|
630
|
+
server = await createViteDevServer(
|
|
631
|
+
_chunkUNSKL6BIcjs.mergeFarmViteConfig.call(void 0,
|
|
564
632
|
{
|
|
565
633
|
root: projectRoot,
|
|
566
634
|
css: shouldUseProjectPostcss ? void 0 : { postcss: { plugins: [] } },
|
|
567
635
|
plugins: [
|
|
568
|
-
|
|
636
|
+
_chunkUNSKL6BIcjs.createFarmThemeCssPlugin.call(void 0, finalConfig.theme, finalConfig.basePath),
|
|
569
637
|
...tailwindVitePlugin ? [tailwindVitePlugin] : [],
|
|
570
638
|
...rendererVitePlugins,
|
|
571
639
|
createDevDependencyStubsPlugin(),
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
640
|
+
_chunkUNSKL6BIcjs.farmI18nClientBridgePlugin.call(void 0, ),
|
|
641
|
+
_chunkUNSKL6BIcjs.farmServerOnlyEntriesPlugin.call(void 0, ),
|
|
642
|
+
_chunkUNSKL6BIcjs.farmPlugin.call(void 0, finalConfig, pluginManager),
|
|
575
643
|
_chunk22GUSVNJcjs.farmEnvironmentFunctionsPlugin.call(void 0, ),
|
|
576
644
|
createBrandingPlugin(),
|
|
577
645
|
createFarmDevLifecyclePlugin(pluginManager, instrumentation)
|
|
@@ -586,8 +654,8 @@ async function createServer(config = {}, options = {}) {
|
|
|
586
654
|
dedupe: [...finalConfig.renderer.dedupe || []]
|
|
587
655
|
},
|
|
588
656
|
optimizeDeps: {
|
|
589
|
-
...
|
|
590
|
-
|
|
657
|
+
..._chunkUNSKL6BIcjs.createFarmClientOptimizeDepsConfig.call(void 0,
|
|
658
|
+
_chunkUNSKL6BIcjs.createFarmClientOptimizeDepsEntries.call(void 0, projectRoot, _chunkVPTDD5XFcjs.getFarmAppDirectories.call(void 0, finalConfig)),
|
|
591
659
|
finalConfig.renderer
|
|
592
660
|
),
|
|
593
661
|
exclude: [
|
|
@@ -631,8 +699,12 @@ async function createServer(config = {}, options = {}) {
|
|
|
631
699
|
}
|
|
632
700
|
},
|
|
633
701
|
withPortFlag(finalConfig.vite, options.port)
|
|
634
|
-
)
|
|
702
|
+
),
|
|
703
|
+
(candidate) => {
|
|
704
|
+
pendingViteServer = candidate;
|
|
705
|
+
}
|
|
635
706
|
);
|
|
707
|
+
pendingViteServer = void 0;
|
|
636
708
|
server.__farmPluginManager = pluginManager;
|
|
637
709
|
server.__farmResolvedConfig = resolvedConfig;
|
|
638
710
|
server.__farmInstrumentation = instrumentation;
|
|
@@ -643,19 +715,41 @@ async function createServer(config = {}, options = {}) {
|
|
|
643
715
|
await pluginManager.runHookParallel("buildStart");
|
|
644
716
|
return server;
|
|
645
717
|
} catch (error) {
|
|
646
|
-
|
|
647
|
-
|
|
718
|
+
const attempt = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (operation, run) => {
|
|
719
|
+
try {
|
|
720
|
+
await run();
|
|
721
|
+
} catch (cleanupError) {
|
|
722
|
+
console.error(`Failed to ${operation} after a server creation failure:`, cleanupError);
|
|
723
|
+
}
|
|
724
|
+
}, "attempt");
|
|
725
|
+
await attempt(
|
|
726
|
+
"run plugin error hooks",
|
|
727
|
+
() => _optionalChain([pluginManager, 'optionalAccess', _16 => _16.runHookParallel, 'call', _17 => _17("onError", {
|
|
648
728
|
phase: "createServer",
|
|
649
729
|
error
|
|
650
|
-
})
|
|
730
|
+
})])
|
|
731
|
+
);
|
|
732
|
+
if (server) {
|
|
733
|
+
await attempt("close the dev server", server.close.bind(server));
|
|
734
|
+
} else {
|
|
735
|
+
const partialServer = pendingViteServer;
|
|
736
|
+
if (partialServer) {
|
|
737
|
+
await attempt(
|
|
738
|
+
"close the partially created Vite server",
|
|
739
|
+
() => closeViteDevServer(partialServer, partialServer.close.bind(partialServer))
|
|
740
|
+
);
|
|
741
|
+
}
|
|
742
|
+
await attempt(
|
|
743
|
+
"close the plugin runtime",
|
|
744
|
+
() => _optionalChain([pluginManager, 'optionalAccess', _18 => _18.closeRuntime, 'call', _19 => _19("dev-server-creation-failed")])
|
|
745
|
+
);
|
|
746
|
+
await attempt("shut down instrumentation", () => _optionalChain([instrumentation, 'optionalAccess', _20 => _20.shutdown, 'call', _21 => _21()]));
|
|
651
747
|
}
|
|
652
|
-
await _optionalChain([instrumentation, 'optionalAccess', _16 => _16.shutdown, 'call', _17 => _17(), 'access', _18 => _18.catch, 'call', _19 => _19(() => {
|
|
653
|
-
})]);
|
|
654
748
|
_chunk5QIKR7RRcjs.logger.error(`Failed to create server: ${error}`);
|
|
655
749
|
throw error;
|
|
656
750
|
}
|
|
657
751
|
}
|
|
658
|
-
_chunkS3JO3N4Hcjs.__name.call(void 0,
|
|
752
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, createServer2, "createServer");
|
|
659
753
|
function noticeSchemaChangesInBackground(config) {
|
|
660
754
|
if (!config) return false;
|
|
661
755
|
const candidates = [
|
|
@@ -669,11 +763,11 @@ function noticeSchemaChangesInBackground(config) {
|
|
|
669
763
|
}
|
|
670
764
|
_chunkS3JO3N4Hcjs.__name.call(void 0, noticeSchemaChangesInBackground, "noticeSchemaChangesInBackground");
|
|
671
765
|
async function startDevServer(config = {}, port) {
|
|
672
|
-
const server = await
|
|
766
|
+
const server = await createServer2(config, { port });
|
|
673
767
|
try {
|
|
674
768
|
await server.listen(port);
|
|
675
769
|
const pluginManager = server.__farmPluginManager;
|
|
676
|
-
await _optionalChain([pluginManager, 'optionalAccess',
|
|
770
|
+
await _optionalChain([pluginManager, 'optionalAccess', _22 => _22.startRuntime, 'call', _23 => _23()]);
|
|
677
771
|
noticeSchemaChangesInBackground(server.__farmResolvedConfig);
|
|
678
772
|
} catch (error) {
|
|
679
773
|
try {
|
|
@@ -787,4 +881,4 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, startDevServer, "startDevServer");
|
|
|
787
881
|
|
|
788
882
|
|
|
789
883
|
|
|
790
|
-
exports.DEFAULT_FARM_DEV_SERVER_PORT = DEFAULT_FARM_DEV_SERVER_PORT; exports.DEFAULT_SERVER_ACTION_BODY_SIZE_LIMIT = _chunkT5CERMEHcjs.DEFAULT_SERVER_ACTION_BODY_SIZE_LIMIT; exports.FARM_SERVER_QUERY_SYMBOL = _chunkZMN3H73Hcjs.FARM_SERVER_QUERY_SYMBOL; exports.FarmApp =
|
|
884
|
+
exports.DEFAULT_FARM_DEV_SERVER_PORT = DEFAULT_FARM_DEV_SERVER_PORT; exports.DEFAULT_SERVER_ACTION_BODY_SIZE_LIMIT = _chunkT5CERMEHcjs.DEFAULT_SERVER_ACTION_BODY_SIZE_LIMIT; exports.FARM_SERVER_QUERY_SYMBOL = _chunkZMN3H73Hcjs.FARM_SERVER_QUERY_SYMBOL; exports.FarmApp = _chunkUNSKL6BIcjs.FarmApp; exports.FarmDataCache = _chunkH6G5INWMcjs.FarmDataCache; exports.FarmEnvironmentError = _chunkW4E7WMXEcjs.FarmEnvironmentError; exports.RouteManager = _chunkUNSKL6BIcjs.RouteManager; exports.ServerActionRequestError = _chunkT5CERMEHcjs.ServerActionRequestError; exports.ServerRenderer = _chunkUNSKL6BIcjs.ServerRenderer; exports._runWithAfterNodeResponse = _chunkMQ3H6LT5cjs._runWithAfterNodeResponse; exports._runWithAfterRequest = _chunkMQ3H6LT5cjs._runWithAfterRequest; exports._withAfterNodeMiddleware = _chunkMQ3H6LT5cjs._withAfterNodeMiddleware; exports.after = _chunkMQ3H6LT5cjs.after; exports.applyFarmCacheInvalidationTargets = _chunkH6G5INWMcjs.applyFarmCacheInvalidationTargets; exports.applyFarmCacheInvalidations = _chunkZEG3OPIBcjs.applyFarmCacheInvalidations; exports.configureFarmCache = _chunkH6G5INWMcjs.configureFarmCache; exports.createClientOnlyFn = _chunkW4E7WMXEcjs.createClientOnlyFn; exports.createFarmApp = _chunkUNSKL6BIcjs.createFarmApp; exports.createFarmCacheInvalidationStream = _chunkH6G5INWMcjs.createFarmCacheInvalidationStream; exports.createFarmCacheKey = _chunkH6G5INWMcjs.createFarmCacheKey; exports.createFarmConfigResolutionPlugin = _chunkVPTDD5XFcjs.createFarmConfigResolutionPlugin; exports.createFarmStorage = _chunk4ZFL5GFNcjs.createFarmStorage; exports.createIsomorphicFn = _chunkW4E7WMXEcjs.createIsomorphicFn; exports.createPathCacheTag = _chunkH6G5INWMcjs.createPathCacheTag; exports.createRouteDataCacheKey = _chunkH6G5INWMcjs.createRouteDataCacheKey; exports.createRouteDataCacheTag = _chunkH6G5INWMcjs.createRouteDataCacheTag; exports.createServer = createServer2; exports.createServerActionRequestErrorResponse = _chunkT5CERMEHcjs.createServerActionRequestErrorResponse; exports.createServerOnlyFn = _chunkW4E7WMXEcjs.createServerOnlyFn; exports.createServerQuery = _chunkZMN3H73Hcjs.createServerQuery; exports.createStorageClient = _chunk4ZFL5GFNcjs.createStorageClient; exports.databaseStorage = _chunk4ZFL5GFNcjs.databaseStorage; exports.defineCacheKey = _chunkH6G5INWMcjs.defineCacheKey; exports.defineConfig = _chunkUNSKL6BIcjs.defineConfig; exports.defineStorageClient = _chunk4ZFL5GFNcjs.defineStorageClient; exports.disposeStorage = _chunk4ZFL5GFNcjs.disposeStorage; exports.driverStorage = _chunk4ZFL5GFNcjs.driverStorage; exports.farmPlugin = _chunkUNSKL6BIcjs.farmPlugin; exports.fileExists = _chunk5QIKR7RRcjs.fileExists; exports.getCurrentRequest = _chunk5ZSWG4UXcjs.getCurrentRequest; exports.getFarmAppDirectories = _chunkVPTDD5XFcjs.getFarmAppDirectories; exports.getFarmDataCache = _chunkH6G5INWMcjs.getFarmDataCache; exports.getFarmLayerAliases = _chunkVPTDD5XFcjs.getFarmLayerAliases; exports.getFarmSourceRoots = _chunkVPTDD5XFcjs.getFarmSourceRoots; exports.getServerActionExecutionContext = _chunkT5CERMEHcjs.getServerActionExecutionContext; exports.getServerActionInvalidations = _chunkT5CERMEHcjs.getServerActionInvalidations; exports.getServerActionSignal = _chunkT5CERMEHcjs.getServerActionSignal; exports.getStorage = _chunk4ZFL5GFNcjs.getStorage; exports.getTheme = _chunkXWAWFQFScjs.getTheme; exports.getThemeSnapshot = _chunkXWAWFQFScjs.getThemeSnapshot; exports.globFiles = _chunk5QIKR7RRcjs.globFiles; exports.initStorage = _chunk4ZFL5GFNcjs.initStorage; exports.invalidate = _chunkH6G5INWMcjs.invalidate; exports.invalidateRouteData = _chunkH6G5INWMcjs.invalidateRouteData; exports.libsqlStorage = _chunk4ZFL5GFNcjs.libsqlStorage; exports.loadFarmConfigFile = _chunkVPTDD5XFcjs.loadFarmConfigFile; exports.localStorage = _chunk4ZFL5GFNcjs.localStorage; exports.logger = _chunk5QIKR7RRcjs.logger; exports.matchRoute = _chunk5QIKR7RRcjs.matchRoute; exports.matchRouteParts = _chunk5QIKR7RRcjs.matchRouteParts; exports.matchRoutePrefix = _chunk5QIKR7RRcjs.matchRoutePrefix; exports.matchRoutePrefixParts = _chunk5QIKR7RRcjs.matchRoutePrefixParts; exports.memoryStorage = _chunk4ZFL5GFNcjs.memoryStorage; exports.mongodbStorage = _chunk4ZFL5GFNcjs.mongodbStorage; exports.mysql2Storage = _chunk4ZFL5GFNcjs.mysql2Storage; exports.mysqlStorage = _chunk4ZFL5GFNcjs.mysqlStorage; exports.netlifyBlobsStorage = _chunk4ZFL5GFNcjs.netlifyBlobsStorage; exports.normalizeRevalidatePath = _chunkH6G5INWMcjs.normalizeRevalidatePath; exports.parseRoutePath = _chunk5QIKR7RRcjs.parseRoutePath; exports.parseSearchParams = _chunk5QIKR7RRcjs.parseSearchParams; exports.pgStorage = _chunk4ZFL5GFNcjs.pgStorage; exports.pgliteStorage = _chunk4ZFL5GFNcjs.pgliteStorage; exports.planetscaleStorage = _chunk4ZFL5GFNcjs.planetscaleStorage; exports.postgresStorage = _chunk4ZFL5GFNcjs.postgresStorage; exports.prepareServerActionRequest = _chunkT5CERMEHcjs.prepareServerActionRequest; exports.redisStorage = _chunk4ZFL5GFNcjs.redisStorage; exports.resolveAppPath = _chunk5QIKR7RRcjs.resolveAppPath; exports.resolveFarmLayers = _chunkVPTDD5XFcjs.resolveFarmLayers; exports.resolveServerActionsConfig = _chunkT5CERMEHcjs.resolveServerActionsConfig; exports.resolveStorageRuntimeClient = _chunk4ZFL5GFNcjs.resolveStorageRuntimeClient; exports.revalidatePath = _chunkH6G5INWMcjs.revalidatePath; exports.revalidateTag = _chunkH6G5INWMcjs.revalidateTag; exports.runWithServerActionRequest = _chunkT5CERMEHcjs.runWithServerActionRequest; exports.s3Storage = _chunk4ZFL5GFNcjs.s3Storage; exports.sanitizeServerActionError = _chunkT5CERMEHcjs.sanitizeServerActionError; exports.segmentsToPattern = _chunk5QIKR7RRcjs.segmentsToPattern; exports.sendWebResponse = _chunkUQZ4AYTHcjs.sendWebResponse; exports.splitRoutePath = _chunk5QIKR7RRcjs.splitRoutePath; exports.sqliteStorage = _chunk4ZFL5GFNcjs.sqliteStorage; exports.startDevServer = startDevServer; exports.storageCacheAdapter = _chunkH6G5INWMcjs.storageCacheAdapter; exports.toPosixPath = _chunk5QIKR7RRcjs.toPosixPath; exports.toRootRelativeUrlPath = _chunk5QIKR7RRcjs.toRootRelativeUrlPath; exports.toViteModuleId = _chunk5QIKR7RRcjs.toViteModuleId; exports.unstable_cache = _chunkH6G5INWMcjs.unstable_cache; exports.updateTag = _chunkH6G5INWMcjs.updateTag; exports.upstashStorage = _chunk4ZFL5GFNcjs.upstashStorage; exports.validateServerActionRequest = _chunkT5CERMEHcjs.validateServerActionRequest; exports.vercelBlobStorage = _chunk4ZFL5GFNcjs.vercelBlobStorage; exports.vercelKVStorage = _chunk4ZFL5GFNcjs.vercelKVStorage;
|