@farm.js/core 0.1.68 → 0.1.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-mcp.d-wkVPK1GA.d.mts → agent-mcp.d-DOfBMEzP.d.mts} +1 -1
- package/dist/{agent-mcp.d-Uh5xr7aX.d.ts → agent-mcp.d-DnIgriX1.d.ts} +1 -1
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/{analyzer-CQDU7E3Y.mjs → analyzer-NAL5TJUP.mjs} +2 -2
- package/dist/analyzer-SAJSV6SP.cjs +16 -0
- package/dist/api/node.d.mts +3 -3
- package/dist/api/node.d.ts +3 -3
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api.cjs +2 -2
- package/dist/api.d.mts +4 -21
- package/dist/api.d.ts +4 -21
- package/dist/api.mjs +1 -1
- package/dist/{app-manifest.d-BT5i2F-o.d.ts → app-manifest.d-CaAcaukR.d.ts} +1 -1
- package/dist/{app-manifest.d-Dd4q5CFx.d.mts → app-manifest.d-_BVbI0xp.d.mts} +1 -1
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/{app.d-BVOpL_f2.d.ts → app.d-BWeDqOaF.d.ts} +4 -4
- package/dist/{app.d-BhiDXex_.d.mts → app.d-CaPwtytN.d.mts} +4 -4
- package/dist/{base-path.d-BOUV5ozD.d.mts → base-path.d-CTDVF0Fc.d.mts} +2 -1
- package/dist/{base-path.d-BOUV5ozD.d.ts → base-path.d-CTDVF0Fc.d.ts} +2 -1
- package/dist/{chunk-SQ6IWJ3H.cjs → chunk-22LGTSBA.cjs} +1 -1
- package/dist/{chunk-T5XFZQCL.mjs → chunk-2P7UYHZP.mjs} +1 -1
- package/dist/{chunk-LDEXTX4I.cjs → chunk-4JRAMCUP.cjs} +11 -4
- package/dist/{chunk-TNK2TVRS.cjs → chunk-4W4ZWSV2.cjs} +196 -155
- package/dist/{chunk-MNJDNTGO.mjs → chunk-5TOWKGV3.mjs} +1 -1
- package/dist/{chunk-7LK5CTUM.cjs → chunk-6GQJVY4E.cjs} +18 -13
- package/dist/{chunk-5JKDFRTK.cjs → chunk-ABIBASLJ.cjs} +2 -2
- package/dist/{chunk-F6CMGWAL.mjs → chunk-ANMIR6US.mjs} +1 -1
- package/dist/{chunk-Z6SOXHAD.mjs → chunk-CKCKCUYO.mjs} +72 -31
- package/dist/{chunk-2ZOYOYEE.mjs → chunk-D5F7RPZP.mjs} +71 -1
- package/dist/{chunk-F36LS2C7.cjs → chunk-DHR2WDSL.cjs} +27 -27
- package/dist/{chunk-URN7VFO7.cjs → chunk-F6YLXK5L.cjs} +10 -11
- package/dist/{chunk-YTNBCXCW.cjs → chunk-GQ6QOH7T.cjs} +9 -5
- package/dist/{chunk-BZWTBELF.cjs → chunk-GTQOEEE7.cjs} +77 -7
- package/dist/{chunk-IGDYL2IA.cjs → chunk-GUMKIQJL.cjs} +2 -2
- package/dist/{chunk-4UAQB5LB.mjs → chunk-IYLZZTP6.mjs} +4 -4
- package/dist/{chunk-WUTFJOV7.cjs → chunk-JFPKARWM.cjs} +16 -8
- package/dist/{chunk-225APHKC.cjs → chunk-L5OZN6YW.cjs} +3 -3
- package/dist/{chunk-KWCZKJYU.cjs → chunk-L6NWQ3DR.cjs} +351 -277
- package/dist/{chunk-6OFOIMNS.mjs → chunk-MAGFDK4Q.mjs} +1 -1
- package/dist/{chunk-5IQ2ERQA.cjs → chunk-O47W53D3.cjs} +1 -1
- package/dist/{chunk-3TXKFRSO.mjs → chunk-OEL5EPOJ.mjs} +1 -1
- package/dist/{chunk-A3T445WK.mjs → chunk-PDQ6EGPK.mjs} +8 -1
- package/dist/{chunk-VRGY3X2I.mjs → chunk-PEYDQMSA.mjs} +5 -6
- package/dist/{chunk-KSZK34HU.mjs → chunk-PJQ5W356.mjs} +16 -8
- package/dist/{chunk-JSOCDYER.cjs → chunk-Q4HH5Q6A.cjs} +15 -1
- package/dist/{chunk-NT4W4H52.mjs → chunk-SZORL7EW.mjs} +18 -13
- package/dist/{chunk-Z3PW3DIR.cjs → chunk-TKYOJ5G2.cjs} +3 -3
- package/dist/{chunk-DIXFKAPM.mjs → chunk-UHU4QALN.mjs} +153 -79
- package/dist/{chunk-WPB67LE5.mjs → chunk-ULMXZYOA.mjs} +1 -1
- package/dist/{chunk-MZ4CRSY7.cjs → chunk-VO65MYJD.cjs} +4 -4
- package/dist/{chunk-DXZ57EPE.mjs → chunk-YOHHL2UE.mjs} +14 -0
- package/dist/{chunk-VFNAK6A5.mjs → chunk-ZR2QB45W.mjs} +7 -3
- package/dist/{chunk-KDO6T6OB.mjs → chunk-ZYCEEE3V.mjs} +1 -1
- package/dist/{client-component.d-DNVSLEPi.d.ts → client-component.d-CfJxuXZl.d.ts} +2 -2
- package/dist/{client-component.d-BvQOxSqh.d.mts → client-component.d-CnEeVvGG.d.mts} +2 -2
- package/dist/{client-plugins.d-CNDqcAuf.d.ts → client-plugins.d-D7dHV1Nf.d.ts} +15 -3
- package/dist/{client-plugins.d-CE1lVK2R.d.mts → client-plugins.d-Do5ULA0x.d.mts} +15 -3
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.d.mts +6 -6
- package/dist/client.d.ts +6 -6
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/desktop.d.mts +2 -2
- package/dist/desktop.d.ts +2 -2
- package/dist/{devtools-R27T3BRY.cjs → devtools-7HNDS4SY.cjs} +2 -2
- package/dist/{devtools-2A2GPC7B.mjs → devtools-BP4EBTKQ.mjs} +1 -1
- package/dist/docs.cjs +5 -3
- package/dist/docs.d.mts +15 -3
- package/dist/docs.d.ts +15 -3
- package/dist/docs.mjs +5 -3
- package/dist/environment/vite.cjs +3 -3
- package/dist/environment/vite.mjs +2 -2
- package/dist/image/server.cjs +2 -2
- package/dist/image/server.mjs +1 -1
- package/dist/image/sharp.cjs +9 -9
- package/dist/image/sharp.mjs +1 -1
- package/dist/index.cjs +17 -16
- package/dist/{index.d-Bt3kl19W.d.mts → index.d-B1MpEJAo.d.mts} +1 -1
- package/dist/{index.d-Cx_-DaKV.d.ts → index.d-CVFk37uX.d.ts} +1 -1
- package/dist/index.d.mts +17 -17
- package/dist/index.d.ts +17 -17
- package/dist/index.mjs +17 -16
- package/dist/integrations/orm.d.mts +1 -1
- package/dist/integrations/orm.d.ts +1 -1
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/internal/app-markdown-runtime.d.mts +2 -2
- package/dist/internal/app-markdown-runtime.d.ts +2 -2
- package/dist/internal/build-runtime.cjs +15 -16
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +14 -15
- package/dist/internal/cli-runtime.cjs +2 -2
- package/dist/internal/cli-runtime.mjs +1 -1
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.d.mts +5 -5
- package/dist/internal/client-runtime.d.ts +5 -5
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +3 -3
- package/dist/internal/config-runtime.d.mts +3 -3
- package/dist/internal/config-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.mjs +2 -2
- package/dist/internal/infra-analytics-runtime.cjs +6 -6
- package/dist/internal/infra-analytics-runtime.mjs +4 -4
- package/dist/internal/native-server-fns.cjs +4 -4
- package/dist/internal/native-server-fns.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-runtime.cjs +8 -4
- package/dist/internal/production-runtime.d.mts +19 -12
- package/dist/internal/production-runtime.d.ts +19 -12
- package/dist/internal/production-runtime.mjs +8 -4
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/middleware.d.mts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/{mount.d-Bki4pOaJ.d.mts → mount.d-CBqr-LfI.d.mts} +1 -1
- package/dist/{mount.d-DjR5aerM.d.ts → mount.d-CGzN61Kq.d.ts} +1 -1
- package/dist/{navigation-delegate.d-VDkziXTK.d.mts → navigation-delegate.d-BwCOhpj7.d.mts} +1 -1
- package/dist/{navigation-delegate.d-CtghaSP3.d.ts → navigation-delegate.d-CLH2dXjy.d.ts} +1 -1
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/{plugin-WIU4GDD4.cjs → plugin-F2O4BFTK.cjs} +2 -2
- package/dist/{plugin-SAS22JL7.mjs → plugin-VEBRN7A3.mjs} +1 -1
- package/dist/plugin.cjs +10 -10
- package/dist/plugin.d.mts +3 -3
- package/dist/plugin.d.ts +3 -3
- package/dist/plugin.mjs +9 -9
- package/dist/{render-plan.d-BSwV8PE4.d.mts → render-plan.d-CzGDjcT0.d.mts} +1 -1
- package/dist/{render-plan.d-i9sI4tc9.d.ts → render-plan.d-W6LmjD6y.d.ts} +1 -1
- package/dist/renderer-client.d.mts +4 -4
- package/dist/renderer-client.d.ts +4 -4
- package/dist/{request.d-Dgln8tuI.d.ts → request.d-CTVRZiQv.d.ts} +1 -1
- package/dist/{request.d-C24FNQ_7.d.mts → request.d-CgNVderU.d.mts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering.d-Ds0BfwQi.d.mts → route-rendering.d-D0bmZVJA.d.mts} +1 -1
- package/dist/{route-rendering.d-CUylZKJA.d.ts → route-rendering.d-FDSNtCMg.d.ts} +1 -1
- package/dist/{router.d-B56rMOFm.d.ts → router.d-DZ3ldniI.d.ts} +1 -1
- package/dist/{router.d-CFPcbqzc.d.mts → router.d-GRKm_uAV.d.mts} +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/{rsc-pipeline-3T7V6OUT.cjs → rsc-pipeline-J4KKBSCH.cjs} +4 -5
- package/dist/{rsc-pipeline-GA4AQWZI.mjs → rsc-pipeline-PJZOVYSY.mjs} +3 -4
- package/dist/{runtime-REUTNTI5.cjs → runtime-OLEO5NXF.cjs} +4 -4
- package/dist/{runtime-ZYCKKY7L.mjs → runtime-QDBSE4H6.mjs} +2 -2
- package/dist/{runtime.d-DLRO-ExG.d.mts → runtime.d-DqXihlxm.d.mts} +1 -1
- package/dist/{runtime.d-H7k9hOQE.d.ts → runtime.d-pqFQBU2N.d.ts} +1 -1
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server.cjs +31 -31
- package/dist/server.d.mts +9 -9
- package/dist/server.d.ts +9 -9
- package/dist/server.mjs +12 -12
- package/dist/{spa-router.d-Dr7oanhl.d.ts → spa-router.d-DhOhaQ-7.d.ts} +2 -2
- package/dist/{spa-router.d-g4CzhEH1.d.mts → spa-router.d-Dhvy60p4.d.mts} +2 -2
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{utils.d-BxxyDEb8.d.ts → utils.d-BVCMRRau.d.ts} +1 -1
- package/dist/{utils.d-HIla3pD_.d.mts → utils.d-Q8EHCpkF.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +10 -10
- package/dist/vite.d.mts +4 -4
- package/dist/vite.d.ts +4 -4
- package/dist/vite.mjs +9 -9
- package/package.json +2 -2
- package/dist/analyzer-PPAHM4AW.cjs +0 -16
- package/dist/chunk-HHLEYA4B.cjs +0 -17
- package/dist/chunk-QYNZ3CTI.mjs +0 -17
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
var _chunk65Y5SIBHcjs = require('./chunk-65Y5SIBH.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkO47W53D3cjs = require('./chunk-O47W53D3.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
@@ -30,14 +30,15 @@ var _chunk5IQ2ERQAcjs = require('./chunk-5IQ2ERQA.cjs');
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
var
|
|
33
|
+
var _chunkDHR2WDSLcjs = require('./chunk-DHR2WDSL.cjs');
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var _chunkJSOCDYERcjs = require('./chunk-JSOCDYER.cjs');
|
|
38
37
|
|
|
38
|
+
var _chunkQ4HH5Q6Acjs = require('./chunk-Q4HH5Q6A.cjs');
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
|
|
41
|
+
var _chunkJFPKARWMcjs = require('./chunk-JFPKARWM.cjs');
|
|
41
42
|
|
|
42
43
|
|
|
43
44
|
var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
@@ -78,13 +79,13 @@ var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
|
|
|
78
79
|
|
|
79
80
|
|
|
80
81
|
|
|
81
|
-
var
|
|
82
|
+
var _chunkGQ6QOH7Tcjs = require('./chunk-GQ6QOH7T.cjs');
|
|
82
83
|
|
|
83
84
|
|
|
84
85
|
var _chunkX3MHKLCOcjs = require('./chunk-X3MHKLCO.cjs');
|
|
85
86
|
|
|
86
87
|
|
|
87
|
-
var
|
|
88
|
+
var _chunkGUMKIQJLcjs = require('./chunk-GUMKIQJL.cjs');
|
|
88
89
|
|
|
89
90
|
|
|
90
91
|
var _chunk7EPYN7GWcjs = require('./chunk-7EPYN7GW.cjs');
|
|
@@ -119,7 +120,7 @@ var _chunk7EPYN7GWcjs = require('./chunk-7EPYN7GW.cjs');
|
|
|
119
120
|
|
|
120
121
|
|
|
121
122
|
|
|
122
|
-
var
|
|
123
|
+
var _chunkVO65MYJDcjs = require('./chunk-VO65MYJD.cjs');
|
|
123
124
|
|
|
124
125
|
|
|
125
126
|
|
|
@@ -277,7 +278,7 @@ var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
|
|
|
277
278
|
var _chunkEVIWKPJVcjs = require('./chunk-EVIWKPJV.cjs');
|
|
278
279
|
|
|
279
280
|
|
|
280
|
-
var
|
|
281
|
+
var _chunk22LGTSBAcjs = require('./chunk-22LGTSBA.cjs');
|
|
281
282
|
|
|
282
283
|
|
|
283
284
|
var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
|
|
@@ -1067,7 +1068,7 @@ function loadFarmWorkflowsDevRuntime() {
|
|
|
1067
1068
|
return import("./workflows.cjs");
|
|
1068
1069
|
}
|
|
1069
1070
|
function loadFarmDevtoolsSnapshotRuntime() {
|
|
1070
|
-
return import("./devtools-
|
|
1071
|
+
return import("./devtools-7HNDS4SY.cjs");
|
|
1071
1072
|
}
|
|
1072
1073
|
function loadFarmDevtoolsUIRuntime() {
|
|
1073
1074
|
return import("./devtools-ui-SYRUXUA7.cjs");
|
|
@@ -1098,16 +1099,16 @@ var FARM_SERVER_ONLY_PACKAGE_ID = "\0farm:server-only";
|
|
|
1098
1099
|
var FARM_PLATFORM_ENTRY = "@farm.js/core/platform";
|
|
1099
1100
|
var FARM_PLATFORM_CLIENT_ID = "\0farm:platform-client";
|
|
1100
1101
|
var FARM_SERVER_ONLY_ENTRIES_RESOLVE_FILTER = [
|
|
1101
|
-
|
|
1102
|
-
new RegExp(`^${
|
|
1102
|
+
_chunkDHR2WDSLcjs.exactIdPattern.call(void 0, [FARM_PLATFORM_ENTRY, SERVER_ONLY_PACKAGE, ...FARM_SERVER_ONLY_ENTRIES]),
|
|
1103
|
+
new RegExp(`^${_chunkVO65MYJDcjs.FARM_RESOLVE_FROM_PREFIX}`),
|
|
1103
1104
|
// What isBuiltin() accepts: `node:` ids and the builtin names, subpaths such as fs/promises
|
|
1104
1105
|
// included.
|
|
1105
1106
|
/^node:/,
|
|
1106
|
-
|
|
1107
|
+
_chunkDHR2WDSLcjs.exactIdPattern.call(void 0, _module.builtinModules)
|
|
1107
1108
|
];
|
|
1108
1109
|
var FARM_SERVER_ONLY_ENTRIES_LOAD_FILTER = [
|
|
1109
|
-
|
|
1110
|
-
new RegExp(`^${
|
|
1110
|
+
_chunkDHR2WDSLcjs.exactIdPattern.call(void 0, [FARM_SERVER_ONLY_PACKAGE_ID, FARM_PLATFORM_CLIENT_ID]),
|
|
1111
|
+
new RegExp(`^${_chunkVO65MYJDcjs.FARM_BROWSER_BUILTIN_PREFIX}`)
|
|
1111
1112
|
];
|
|
1112
1113
|
function createFarmPlatformClientModule(platform) {
|
|
1113
1114
|
return `export function platform() { return ${JSON.stringify(platform)}; }
|
|
@@ -1135,11 +1136,11 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1135
1136
|
name: "farm:server-only-entries",
|
|
1136
1137
|
enforce: "pre",
|
|
1137
1138
|
config(config) {
|
|
1138
|
-
const bundledPackages =
|
|
1139
|
+
const bundledPackages = _chunkVO65MYJDcjs.collectFarmServerBundledPackageInfo.call(void 0,
|
|
1139
1140
|
path6.resolve(_nullishCoalesce(config.root, () => ( process.cwd())))
|
|
1140
1141
|
);
|
|
1141
1142
|
return {
|
|
1142
|
-
optimizeDeps: { rolldownOptions: { plugins: [
|
|
1143
|
+
optimizeDeps: { rolldownOptions: { plugins: [_chunkVO65MYJDcjs.farmBrowserBuiltinsOptimizerPlugin.call(void 0, )] } },
|
|
1143
1144
|
ssr: {
|
|
1144
1145
|
noExternal: [
|
|
1145
1146
|
// Resolve `server-only` here rather than in Node, which would load its throwing build.
|
|
@@ -1167,9 +1168,9 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1167
1168
|
);
|
|
1168
1169
|
}
|
|
1169
1170
|
if (!_optionalChain([options2, 'optionalAccess', _67 => _67.ssr]) && _module.isBuiltin.call(void 0, id)) {
|
|
1170
|
-
return
|
|
1171
|
+
return _chunkVO65MYJDcjs.resolveFarmBrowserBuiltin.call(void 0, this, id, importer, options2);
|
|
1171
1172
|
}
|
|
1172
|
-
const resolveFrom = importer ?
|
|
1173
|
+
const resolveFrom = importer ? _chunkVO65MYJDcjs.parseFarmResolveFrom.call(void 0, id, importer.split("?", 1)[0]) : null;
|
|
1173
1174
|
if (resolveFrom) {
|
|
1174
1175
|
const directory = path6.dirname(resolveFrom.importer);
|
|
1175
1176
|
return this.resolve(resolveFrom.specifier, resolveFrom.importer, {
|
|
@@ -1205,7 +1206,7 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1205
1206
|
if (id === FARM_PLATFORM_CLIENT_ID) {
|
|
1206
1207
|
return createFarmPlatformClientModule(_nullishCoalesce(options.platform, () => ( _chunkAQLHD6HZcjs.resolveFarmPlatform.call(void 0, ))));
|
|
1207
1208
|
}
|
|
1208
|
-
return _nullishCoalesce(
|
|
1209
|
+
return _nullishCoalesce(_chunkVO65MYJDcjs.loadFarmBrowserBuiltin.call(void 0, id), () => ( null));
|
|
1209
1210
|
}
|
|
1210
1211
|
}
|
|
1211
1212
|
};
|
|
@@ -1301,11 +1302,18 @@ function createFarmDevMiddlewareErrorResponse() {
|
|
|
1301
1302
|
headers: { "Content-Type": "application/json", "Cache-Control": "private, no-store" }
|
|
1302
1303
|
});
|
|
1303
1304
|
}
|
|
1304
|
-
function
|
|
1305
|
+
function setFarmDevRuntimeHookErrorHead(res, json) {
|
|
1306
|
+
for (const name of res.getHeaderNames()) res.removeHeader(name);
|
|
1305
1307
|
res.statusCode = 500;
|
|
1306
1308
|
res.setHeader("Content-Type", json ? "application/json" : "text/plain; charset=utf-8");
|
|
1309
|
+
}
|
|
1310
|
+
function sendFarmDevRuntimeHookError(res, json) {
|
|
1311
|
+
setFarmDevRuntimeHookErrorHead(res, json);
|
|
1307
1312
|
res.end(json ? _chunkXGTFLG73cjs.FARM_INTERNAL_SERVER_ERROR_BODY : "Internal Server Error");
|
|
1308
1313
|
}
|
|
1314
|
+
function opensFarmDevRuntimeSession(pm) {
|
|
1315
|
+
return pm.hasRuntimeRequestHooks() || _chunkQ4HH5Q6Acjs.hasFarmServerRuntimePlugins.call(void 0, pm.getPlugins());
|
|
1316
|
+
}
|
|
1309
1317
|
var FARM_CONFIG_ROUTE_PLUGIN_NAMES = /* @__PURE__ */ new Set([
|
|
1310
1318
|
_chunkAKIQ54FKcjs.FARM_CONFIG_HEADERS_PLUGIN_NAME,
|
|
1311
1319
|
_chunkAKIQ54FKcjs.FARM_CONFIG_REDIRECTS_PLUGIN_NAME,
|
|
@@ -1417,7 +1425,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1417
1425
|
res.end = originalEnd;
|
|
1418
1426
|
res.writeHead = originalWriteHead;
|
|
1419
1427
|
if (originalFlushHeaders) res.flushHeaders = originalFlushHeaders;
|
|
1420
|
-
delete res[
|
|
1428
|
+
delete res[_chunkJFPKARWMcjs.FARM_NODE_RESPONSE_END_PENDING];
|
|
1421
1429
|
};
|
|
1422
1430
|
let runtimeHookFailed = false;
|
|
1423
1431
|
const endRuntimeRequest = (response) => pm.endRuntimeRequest(runtimeSession, response).catch((error) => {
|
|
@@ -1429,12 +1437,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1429
1437
|
console.error("Error in afterResponse hook:", error);
|
|
1430
1438
|
};
|
|
1431
1439
|
const writeRuntimeHookFailure = () => {
|
|
1432
|
-
res.
|
|
1433
|
-
res.removeHeader("Content-Length");
|
|
1434
|
-
res.setHeader(
|
|
1435
|
-
"Content-Type",
|
|
1436
|
-
options.jsonError ? "application/json" : "text/plain; charset=utf-8"
|
|
1437
|
-
);
|
|
1440
|
+
setFarmDevRuntimeHookErrorHead(res, Boolean(options.jsonError));
|
|
1438
1441
|
originalWriteHead(500);
|
|
1439
1442
|
originalWrite(options.jsonError ? _chunkXGTFLG73cjs.FARM_INTERNAL_SERVER_ERROR_BODY : "Internal Server Error");
|
|
1440
1443
|
};
|
|
@@ -1546,7 +1549,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1546
1549
|
});
|
|
1547
1550
|
res.end = ((...args) => {
|
|
1548
1551
|
interceptedEnd = true;
|
|
1549
|
-
res[
|
|
1552
|
+
res[_chunkJFPKARWMcjs.FARM_NODE_RESPONSE_END_PENDING] = true;
|
|
1550
1553
|
if (afterResponseCalled) return res;
|
|
1551
1554
|
afterResponseCalled = true;
|
|
1552
1555
|
options.logResponse(method, urlPath, res.statusCode || 200, Date.now() - startTime, "PAGE");
|
|
@@ -1629,7 +1632,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1629
1632
|
res.end = originalEnd;
|
|
1630
1633
|
res.writeHead = originalWriteHead;
|
|
1631
1634
|
if (originalFlushHeaders) res.flushHeaders = originalFlushHeaders;
|
|
1632
|
-
delete res[
|
|
1635
|
+
delete res[_chunkJFPKARWMcjs.FARM_NODE_RESPONSE_END_PENDING];
|
|
1633
1636
|
originalEnd(...originalEndArgs);
|
|
1634
1637
|
}).catch((error) => {
|
|
1635
1638
|
reportFailure(error);
|
|
@@ -1646,14 +1649,14 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1646
1649
|
res.end = originalEnd;
|
|
1647
1650
|
res.writeHead = originalWriteHead;
|
|
1648
1651
|
if (originalFlushHeaders) res.flushHeaders = originalFlushHeaders;
|
|
1649
|
-
delete res[
|
|
1652
|
+
delete res[_chunkJFPKARWMcjs.FARM_NODE_RESPONSE_END_PENDING];
|
|
1650
1653
|
originalEnd(body, callback);
|
|
1651
1654
|
} else {
|
|
1652
1655
|
res.write = originalWrite;
|
|
1653
1656
|
res.end = originalEnd;
|
|
1654
1657
|
res.writeHead = originalWriteHead;
|
|
1655
1658
|
if (originalFlushHeaders) res.flushHeaders = originalFlushHeaders;
|
|
1656
|
-
delete res[
|
|
1659
|
+
delete res[_chunkJFPKARWMcjs.FARM_NODE_RESPONSE_END_PENDING];
|
|
1657
1660
|
originalEnd(...originalEndArgs);
|
|
1658
1661
|
}
|
|
1659
1662
|
});
|
|
@@ -1812,7 +1815,7 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
1812
1815
|
return null;
|
|
1813
1816
|
}
|
|
1814
1817
|
const body = Array.isArray(ast.body) ? ast.body : [];
|
|
1815
|
-
const everyExportIsComponent = options.code.includes(
|
|
1818
|
+
const everyExportIsComponent = options.code.includes(_chunkVO65MYJDcjs.FARM_CLIENT_REFERENCE_PRAGMA) || options.moduleReference.includes(_chunkVO65MYJDcjs.FARM_CLIENT_REFERENCE_DIRECTORY);
|
|
1816
1819
|
const replacements = [];
|
|
1817
1820
|
const wrapperStatements = [];
|
|
1818
1821
|
const originalEntries = [];
|
|
@@ -1979,7 +1982,7 @@ function hasViteAlias(alias, find) {
|
|
|
1979
1982
|
function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
1980
1983
|
const rendererDisabled = _chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, options.renderer);
|
|
1981
1984
|
const imageImports = farmImageImportsPlugin();
|
|
1982
|
-
const fontImports =
|
|
1985
|
+
const fontImports = _chunkDHR2WDSLcjs.farmFontImportsPlugin.call(void 0, {
|
|
1983
1986
|
root: options.root,
|
|
1984
1987
|
basePath: options.basePath,
|
|
1985
1988
|
publicDir: options.publicDir
|
|
@@ -2024,7 +2027,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2024
2027
|
config(userConfig, configEnv) {
|
|
2025
2028
|
isBuild = configEnv.command === "build";
|
|
2026
2029
|
const layerAliases = _chunkMTBDJ326cjs.getFarmLayerAliases.call(void 0, options.layers);
|
|
2027
|
-
const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access', _105 => _105.resolve, 'optionalAccess', _106 => _106.alias]), "@") ? {} :
|
|
2030
|
+
const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access', _105 => _105.resolve, 'optionalAccess', _106 => _106.alias]), "@") ? {} : _chunkDHR2WDSLcjs.createFarmSourceAlias.call(void 0, options.root || process.cwd(), options.srcDir);
|
|
2028
2031
|
const layerRoots = (_nullishCoalesce(options.layers, () => ( []))).map((layer) => layer.root);
|
|
2029
2032
|
farmOwnsDevCors = !isBuild && _optionalChain([userConfig, 'access', _107 => _107.server, 'optionalAccess', _108 => _108.cors]) === void 0;
|
|
2030
2033
|
return {
|
|
@@ -2088,7 +2091,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2088
2091
|
} catch (e21) {
|
|
2089
2092
|
}
|
|
2090
2093
|
};
|
|
2091
|
-
farmApp = new (0,
|
|
2094
|
+
farmApp = new (0, _chunkDHR2WDSLcjs.FarmApp)(
|
|
2092
2095
|
{
|
|
2093
2096
|
...options,
|
|
2094
2097
|
root: resolveDevelopmentRoot(options.root, server.config.root)
|
|
@@ -2096,7 +2099,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2096
2099
|
server
|
|
2097
2100
|
);
|
|
2098
2101
|
farmApp.getRouteManager().usePackageClientBoundaryCacheFile(
|
|
2099
|
-
|
|
2102
|
+
_chunkVO65MYJDcjs.resolvePackageClientBoundaryCacheFile.call(void 0,
|
|
2100
2103
|
farmApp.getConfig().root,
|
|
2101
2104
|
options.distDir || ".farm"
|
|
2102
2105
|
)
|
|
@@ -2106,7 +2109,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2106
2109
|
let farmAppPackages;
|
|
2107
2110
|
if (_optionalChain([farmConfig, 'access', _128 => _128.agent, 'optionalAccess', _129 => _129.noindexPreviews])) {
|
|
2108
2111
|
farmMiddlewares.use((_req, res, next) => {
|
|
2109
|
-
if (
|
|
2112
|
+
if (_chunkGUMKIQJLcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
|
|
2110
2113
|
res.setHeader("X-Robots-Tag", _chunk4E57QHPWcjs.FARM_PREVIEW_ROBOTS_TAG);
|
|
2111
2114
|
}
|
|
2112
2115
|
next();
|
|
@@ -2114,7 +2117,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2114
2117
|
}
|
|
2115
2118
|
const apiServerBasePath = _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, farmConfig.api);
|
|
2116
2119
|
const devBuiltInRoutePaths = new Set(
|
|
2117
|
-
|
|
2120
|
+
_chunkGQ6QOH7Tcjs.listFarmBuiltInRoutePaths.call(void 0, {
|
|
2118
2121
|
agent: {
|
|
2119
2122
|
apiCatalog: true,
|
|
2120
2123
|
mcp: true,
|
|
@@ -2130,7 +2133,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2130
2133
|
let imageHandler = null;
|
|
2131
2134
|
if (farmConfig.images.provider !== "none") {
|
|
2132
2135
|
const { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } = await import("./image/sharp.cjs");
|
|
2133
|
-
imageHandler =
|
|
2136
|
+
imageHandler = _chunkO47W53D3cjs.createFarmImageHandler.call(void 0, farmConfig.images, {
|
|
2134
2137
|
transform: createSharpImageTransformer(),
|
|
2135
2138
|
fetchRemote: createNodeImageFetcher(farmConfig.images),
|
|
2136
2139
|
validateRemoteUrl: createNodeImageUrlValidator(farmConfig.images),
|
|
@@ -2457,7 +2460,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2457
2460
|
clientEntry: "/@farm/client.js",
|
|
2458
2461
|
resolveLayoutFonts: resolveDocsLayoutFonts,
|
|
2459
2462
|
fontStylesheetHref: "/@farm/fonts.css",
|
|
2460
|
-
globalStylesheetHref:
|
|
2463
|
+
globalStylesheetHref: _chunkDHR2WDSLcjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
2461
2464
|
farmConfig.root,
|
|
2462
2465
|
farmConfig.srcDir
|
|
2463
2466
|
),
|
|
@@ -2488,22 +2491,50 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2488
2491
|
fontAssets: _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, farmDocsFontAssetList),
|
|
2489
2492
|
resolveLayoutFonts: resolveDocsLayoutFonts,
|
|
2490
2493
|
fontStylesheetHref: "/@farm/fonts.css",
|
|
2491
|
-
globalStylesheetHref:
|
|
2494
|
+
globalStylesheetHref: _chunkDHR2WDSLcjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
2492
2495
|
farmConfig.root,
|
|
2493
2496
|
farmConfig.srcDir
|
|
2494
2497
|
),
|
|
2495
2498
|
isPathGuarded: isFarmDocsPathGuarded,
|
|
2496
2499
|
basePath: farmConfig.basePath
|
|
2497
2500
|
}) : null;
|
|
2501
|
+
const farmDocsListsPages = Boolean(
|
|
2502
|
+
farmDocsDevRuntime && _optionalChain([pm, 'optionalAccess', _163 => _163.getPlugins, 'call', _164 => _164(), 'access', _165 => _165.some, 'call', _166 => _166((plugin2) => plugin2.name === "farm:infra-analytics")])
|
|
2503
|
+
);
|
|
2504
|
+
let farmDocsPagePaths;
|
|
2505
|
+
const getFarmDocsPagePaths = () => {
|
|
2506
|
+
if (!farmDocsDevRuntime || !farmDocsListsPages) return void 0;
|
|
2507
|
+
_nullishCoalesce(farmDocsPagePaths, () => ( (farmDocsPagePaths = farmDocsDevRuntime.listFarmDocsPagePaths(farmConfig.docs, {
|
|
2508
|
+
root: farmConfig.root,
|
|
2509
|
+
srcDir: farmConfig.srcDir,
|
|
2510
|
+
adapter: farmDocsDevRuntime.hasFarmDocsRuntimeAdapter(farmConfig.docs)
|
|
2511
|
+
}).then(
|
|
2512
|
+
(pages) => new Set(pages),
|
|
2513
|
+
(error) => {
|
|
2514
|
+
_chunkQMNWKQL4cjs.logger.warn(
|
|
2515
|
+
`Farm Infra analytics reports docs pages by the docs route, not each page's path: listing them failed (${error instanceof Error ? error.message : String(error)}).`
|
|
2516
|
+
);
|
|
2517
|
+
return void 0;
|
|
2518
|
+
}
|
|
2519
|
+
))));
|
|
2520
|
+
return farmDocsPagePaths;
|
|
2521
|
+
};
|
|
2522
|
+
if (farmDocsListsPages) {
|
|
2523
|
+
for (const event of ["add", "unlink"]) {
|
|
2524
|
+
server.watcher.on(event, () => {
|
|
2525
|
+
farmDocsPagePaths = void 0;
|
|
2526
|
+
});
|
|
2527
|
+
}
|
|
2528
|
+
}
|
|
2498
2529
|
const wrapFarmDocsResponseWithLayouts = async (request, response) => {
|
|
2499
|
-
if (request.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access',
|
|
2530
|
+
if (request.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _167 => _167.headers, 'access', _168 => _168.get, 'call', _169 => _169("content-type"), 'optionalAccess', _170 => _170.toLowerCase, 'call', _171 => _171(), 'access', _172 => _172.includes, 'call', _173 => _173("text/html")])) {
|
|
2500
2531
|
return response;
|
|
2501
2532
|
}
|
|
2502
2533
|
const pathname = new URL(request.url).pathname;
|
|
2503
2534
|
const matchedRoute = routeManager.matchRoute(pathname);
|
|
2504
2535
|
const layoutEntries = matchedRoute.layouts.map((layout) => ({
|
|
2505
2536
|
...layout,
|
|
2506
|
-
metadata:
|
|
2537
|
+
metadata: _chunkVO65MYJDcjs.getClientModuleMetadata.call(void 0, layout.modulePath, farmConfig.root)
|
|
2507
2538
|
}));
|
|
2508
2539
|
if (!layoutEntries.some((layout) => layout.metadata.shouldHydrate)) {
|
|
2509
2540
|
return response;
|
|
@@ -2517,7 +2548,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2517
2548
|
headers: response.headers
|
|
2518
2549
|
});
|
|
2519
2550
|
}
|
|
2520
|
-
const docsRenderer = _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
2551
|
+
const docsRenderer = _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _174 => _174.getConfig, 'call', _175 => _175()]), () => ( options))).renderer);
|
|
2521
2552
|
const [rendererRuntime, layoutModules] = await Promise.all([
|
|
2522
2553
|
_chunk67MZTLTFcjs.isReactRenderer.call(void 0, docsRenderer) ? import("./renderer/react/server.cjs") : _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, docsRenderer.server),
|
|
2523
2554
|
Promise.all(
|
|
@@ -2546,7 +2577,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2546
2577
|
])
|
|
2547
2578
|
);
|
|
2548
2579
|
const inlineValue = (value) => JSON.stringify(value).replace(/</g, "\\u003c").replace(/>/g, "\\u003e");
|
|
2549
|
-
const pageModulePath = _optionalChain([matchedRoute, 'access',
|
|
2580
|
+
const pageModulePath = _optionalChain([matchedRoute, 'access', _176 => _176.route, 'optionalAccess', _177 => _177.modulePath]) ? toUrlPath(matchedRoute.route.modulePath) : "";
|
|
2550
2581
|
const bootstrapScript = `<script>
|
|
2551
2582
|
window.__FARM_PROPS__ = ${inlineValue({ params })};
|
|
2552
2583
|
window.__FARM_ROUTE_SLOTS__ = [];
|
|
@@ -2643,7 +2674,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2643
2674
|
}
|
|
2644
2675
|
},
|
|
2645
2676
|
(request) => {
|
|
2646
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
2677
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _178 => _178.getConfig, 'call', _179 => _179()]), () => ( options));
|
|
2647
2678
|
const currentServerConfig = _chunkCFG4QERRcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
|
|
2648
2679
|
return _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, request, {
|
|
2649
2680
|
trustProxy: currentServerConfig.trustProxy
|
|
@@ -2659,7 +2690,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2659
2690
|
withAPIRequestTracing(async function handleFarmDevRequest(req, res, next) {
|
|
2660
2691
|
const requestUrl = req.url || "/";
|
|
2661
2692
|
const requestMethod = req.method || "GET";
|
|
2662
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
2693
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _180 => _180.getConfig, 'call', _181 => _181()]), () => ( options));
|
|
2663
2694
|
const currentServerConfig = _chunkCFG4QERRcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
|
|
2664
2695
|
const parsedRequestUrl = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
2665
2696
|
trustProxy: currentServerConfig.trustProxy
|
|
@@ -2753,7 +2784,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2753
2784
|
openapi: options.openapi
|
|
2754
2785
|
},
|
|
2755
2786
|
workflows: discoveredWorkflows,
|
|
2756
|
-
plugins: _optionalChain([pm, 'optionalAccess',
|
|
2787
|
+
plugins: _optionalChain([pm, 'optionalAccess', _182 => _182.getSortedPlugins, 'call', _183 => _183()])
|
|
2757
2788
|
});
|
|
2758
2789
|
res.statusCode = 200;
|
|
2759
2790
|
res.setHeader(
|
|
@@ -2804,7 +2835,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2804
2835
|
status: redirect.statusCode,
|
|
2805
2836
|
headers: { Location: redirect.destination }
|
|
2806
2837
|
});
|
|
2807
|
-
if (pm
|
|
2838
|
+
if (opensFarmDevRuntimeSession(pm)) {
|
|
2808
2839
|
const redirectResponse = response;
|
|
2809
2840
|
try {
|
|
2810
2841
|
response = await pm.runRuntimeRequest(
|
|
@@ -2827,7 +2858,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2827
2858
|
}
|
|
2828
2859
|
}
|
|
2829
2860
|
const runAppMiddlewareForContentRoute = async () => {
|
|
2830
|
-
if (!_optionalChain([middlewareManager, 'optionalAccess',
|
|
2861
|
+
if (!_optionalChain([middlewareManager, 'optionalAccess', _184 => _184.hasMiddleware, 'call', _185 => _185()])) return false;
|
|
2831
2862
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
2832
2863
|
return runFarmMiddlewareWithNavigation(
|
|
2833
2864
|
farmApp.getServerRenderer(),
|
|
@@ -2837,8 +2868,35 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2837
2868
|
() => middlewareManager.execute(req, res)
|
|
2838
2869
|
);
|
|
2839
2870
|
};
|
|
2871
|
+
const sendDevErrorPage = (error) => {
|
|
2872
|
+
if (!res.headersSent) {
|
|
2873
|
+
res.setHeader("Content-Type", "text/html; charset=utf-8");
|
|
2874
|
+
res.setHeader("Cache-Control", "private, no-store");
|
|
2875
|
+
}
|
|
2876
|
+
next(error);
|
|
2877
|
+
};
|
|
2878
|
+
const sendMiddlewareErrorJSON = async (runtimeSession2, error) => {
|
|
2879
|
+
let response = createFarmDevMiddlewareErrorResponse();
|
|
2880
|
+
if (runtimeSession2) {
|
|
2881
|
+
const errorResponse = response;
|
|
2882
|
+
try {
|
|
2883
|
+
response = await pm.completeRuntimeRequest(
|
|
2884
|
+
runtimeSession2,
|
|
2885
|
+
async (_request, runtime) => {
|
|
2886
|
+
await runtime.reportError(error);
|
|
2887
|
+
return errorResponse;
|
|
2888
|
+
}
|
|
2889
|
+
);
|
|
2890
|
+
} catch (e24) {
|
|
2891
|
+
sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
|
|
2892
|
+
return 500;
|
|
2893
|
+
}
|
|
2894
|
+
}
|
|
2895
|
+
await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, response);
|
|
2896
|
+
return response.status;
|
|
2897
|
+
};
|
|
2840
2898
|
const runAppMiddlewareInRuntimeSession = async (runtimeSession2, logResponse2) => {
|
|
2841
|
-
const interceptor = runtimeSession2 && _optionalChain([pm, 'optionalAccess',
|
|
2899
|
+
const interceptor = runtimeSession2 && _optionalChain([pm, 'optionalAccess', _186 => _186.hasRuntimeHook, 'call', _187 => _187("after")]) && _optionalChain([middlewareManager, 'optionalAccess', _188 => _188.hasMiddleware, 'call', _189 => _189()]) ? interceptFarmDevPageResponse({
|
|
2842
2900
|
req,
|
|
2843
2901
|
res,
|
|
2844
2902
|
pm,
|
|
@@ -2851,7 +2909,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2851
2909
|
urlPath: requestUrl,
|
|
2852
2910
|
pathname: requestPathname,
|
|
2853
2911
|
startTime: Date.now(),
|
|
2854
|
-
logResponse: (_method, _path, status) => _optionalChain([logResponse2, 'optionalCall',
|
|
2912
|
+
logResponse: (_method, _path, status) => _optionalChain([logResponse2, 'optionalCall', _190 => _190(status)]),
|
|
2855
2913
|
// The runtime reports a runtime.after failure itself.
|
|
2856
2914
|
emitError: async () => {
|
|
2857
2915
|
},
|
|
@@ -2861,14 +2919,19 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2861
2919
|
try {
|
|
2862
2920
|
handled = await runAppMiddlewareForContentRoute();
|
|
2863
2921
|
} catch (error) {
|
|
2864
|
-
|
|
2865
|
-
|
|
2922
|
+
if (runtimeHookErrorAnswersJSON || res.headersSent) {
|
|
2923
|
+
_optionalChain([interceptor, 'optionalAccess', _191 => _191.release, 'call', _192 => _192()]);
|
|
2924
|
+
throw error;
|
|
2925
|
+
}
|
|
2926
|
+
if (runtimeSession2) await pm.reportRuntimeRequestError(runtimeSession2, error);
|
|
2927
|
+
sendDevErrorPage(error);
|
|
2928
|
+
return true;
|
|
2866
2929
|
}
|
|
2867
2930
|
if (!handled) {
|
|
2868
|
-
_optionalChain([interceptor, 'optionalAccess',
|
|
2931
|
+
_optionalChain([interceptor, 'optionalAccess', _193 => _193.release, 'call', _194 => _194()]);
|
|
2869
2932
|
return false;
|
|
2870
2933
|
}
|
|
2871
|
-
if (!_optionalChain([interceptor, 'optionalAccess',
|
|
2934
|
+
if (!_optionalChain([interceptor, 'optionalAccess', _195 => _195.isEnded, 'call', _196 => _196()])) _optionalChain([logResponse2, 'optionalCall', _197 => _197(res.statusCode || 200)]);
|
|
2872
2935
|
return true;
|
|
2873
2936
|
};
|
|
2874
2937
|
const serveBuiltInRoute = async (respond, {
|
|
@@ -2877,32 +2940,32 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2877
2940
|
label
|
|
2878
2941
|
} = {}) => {
|
|
2879
2942
|
const discard = async () => {
|
|
2880
|
-
await _optionalChain([computed, 'optionalAccess',
|
|
2943
|
+
await _optionalChain([computed, 'optionalAccess', _198 => _198.body, 'optionalAccess', _199 => _199.cancel, 'call', _200 => _200(), 'access', _201 => _201.catch, 'call', _202 => _202(() => {
|
|
2881
2944
|
})]);
|
|
2882
2945
|
};
|
|
2883
2946
|
const sendRuntimeResponse = async (runtimeSession3, response2) => {
|
|
2884
2947
|
let runtimeResponse;
|
|
2885
2948
|
try {
|
|
2886
2949
|
runtimeResponse = await pm.endRuntimeRequest(runtimeSession3, response2);
|
|
2887
|
-
} catch (
|
|
2950
|
+
} catch (e25) {
|
|
2888
2951
|
sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
|
|
2889
2952
|
return;
|
|
2890
2953
|
}
|
|
2891
2954
|
await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, runtimeResponse);
|
|
2892
2955
|
};
|
|
2893
2956
|
let runtimeSession2;
|
|
2894
|
-
if (
|
|
2957
|
+
if (pm && opensFarmDevRuntimeSession(pm)) {
|
|
2895
2958
|
try {
|
|
2896
2959
|
const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath);
|
|
2897
|
-
const route =
|
|
2960
|
+
const route = _chunkGQ6QOH7Tcjs.setFarmRouteLabel.call(void 0,
|
|
2898
2961
|
{ pathname: requestPathname },
|
|
2899
|
-
label !== void 0 ? label : devBuiltInRoutePaths.has(routePathname) ? routePathname :
|
|
2962
|
+
label !== void 0 ? label : devBuiltInRoutePaths.has(routePathname) ? routePathname : _chunkGQ6QOH7Tcjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath)
|
|
2900
2963
|
);
|
|
2901
2964
|
runtimeSession2 = await pm.beginRuntimeRequest(
|
|
2902
2965
|
createRequestFromNodeRequest(req, new URL(fullUrl)),
|
|
2903
2966
|
{ kind, route }
|
|
2904
2967
|
);
|
|
2905
|
-
} catch (
|
|
2968
|
+
} catch (e26) {
|
|
2906
2969
|
await discard();
|
|
2907
2970
|
sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
|
|
2908
2971
|
return;
|
|
@@ -2924,11 +2987,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2924
2987
|
}
|
|
2925
2988
|
responding = true;
|
|
2926
2989
|
response = await respond(
|
|
2927
|
-
_nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess',
|
|
2990
|
+
_nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess', _203 => _203.request]), () => ( createRequestFromNodeRequest(req, new URL(fullUrl))))
|
|
2928
2991
|
);
|
|
2929
2992
|
} catch (error) {
|
|
2993
|
+
if (!responding && !res.headersSent) {
|
|
2994
|
+
_chunkQMNWKQL4cjs.logger.error(`Middleware error: ${error}`);
|
|
2995
|
+
await discard();
|
|
2996
|
+
await sendMiddlewareErrorJSON(runtimeSession2, error);
|
|
2997
|
+
return;
|
|
2998
|
+
}
|
|
2930
2999
|
if (runtimeSession2) await pm.failRuntimeRequest(runtimeSession2, error);
|
|
2931
|
-
if (!runtimeSession2 ||
|
|
3000
|
+
if (!runtimeSession2 || res.headersSent) throw error;
|
|
2932
3001
|
console.error("[FARM] Built-in route error:", error);
|
|
2933
3002
|
sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
|
|
2934
3003
|
return;
|
|
@@ -2938,7 +3007,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2938
3007
|
else await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, response);
|
|
2939
3008
|
};
|
|
2940
3009
|
const openAPIRequestPathname = openAPIManager ? _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) : requestPathname;
|
|
2941
|
-
if (openAPIManager && _optionalChain([options, 'access',
|
|
3010
|
+
if (openAPIManager && _optionalChain([options, 'access', _204 => _204.openapi, 'optionalAccess', _205 => _205.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
|
|
2942
3011
|
const specManager = openAPIManager;
|
|
2943
3012
|
await serveBuiltInRoute(async () => {
|
|
2944
3013
|
if (requestMethod !== "GET" && requestMethod !== "HEAD") {
|
|
@@ -2958,7 +3027,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2958
3027
|
});
|
|
2959
3028
|
return;
|
|
2960
3029
|
}
|
|
2961
|
-
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access',
|
|
3030
|
+
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _206 => _206.openapi, 'optionalAccess', _207 => _207.route])) {
|
|
2962
3031
|
const docsManager = openAPIManager;
|
|
2963
3032
|
await serveBuiltInRoute(
|
|
2964
3033
|
async () => {
|
|
@@ -2969,20 +3038,20 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2969
3038
|
);
|
|
2970
3039
|
return;
|
|
2971
3040
|
}
|
|
2972
|
-
if (_optionalChain([options, 'access',
|
|
3041
|
+
if (_optionalChain([options, 'access', _208 => _208.agent, 'optionalAccess', _209 => _209.manifest]) !== false && _chunkGQ6QOH7Tcjs.isFarmAppManifestPath.call(void 0, _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath))) {
|
|
2973
3042
|
await serveBuiltInRoute(async () => {
|
|
2974
|
-
_nullishCoalesce(farmAppPackages, () => ( (farmAppPackages =
|
|
2975
|
-
const manifest = await
|
|
3043
|
+
_nullishCoalesce(farmAppPackages, () => ( (farmAppPackages = _chunkDHR2WDSLcjs.resolveFarmAppPackages.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd()))))));
|
|
3044
|
+
const manifest = await _chunkGQ6QOH7Tcjs.createFarmAppManifestResponse.call(void 0,
|
|
2976
3045
|
new Request(parsedRequestUrl, {
|
|
2977
3046
|
method: requestMethod,
|
|
2978
3047
|
headers: { "if-none-match": String(_nullishCoalesce(req.headers["if-none-match"], () => ( ""))) }
|
|
2979
3048
|
}),
|
|
2980
3049
|
{
|
|
2981
|
-
...
|
|
3050
|
+
..._chunkGQ6QOH7Tcjs.resolveFarmAppManifestInput.call(void 0, farmConfig, {
|
|
2982
3051
|
build: "development",
|
|
2983
3052
|
packages: farmAppPackages,
|
|
2984
3053
|
// Read again on each request; unchanged files come from a cache.
|
|
2985
|
-
webmcpTools: _optionalChain([farmConfig, 'access',
|
|
3054
|
+
webmcpTools: _optionalChain([farmConfig, 'access', _210 => _210.plugins, 'optionalAccess', _211 => _211.some, 'call', _212 => _212(({ name }) => name === "farm:webmcp")]) ? _chunkDHR2WDSLcjs.collectFarmWebMCPTools.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd())), farmConfig.srcDir) : []
|
|
2986
3055
|
}),
|
|
2987
3056
|
defaultMCP: () => farmApp.getServerRenderer().getDefaultMCPServer(),
|
|
2988
3057
|
// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
@@ -3000,11 +3069,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3000
3069
|
});
|
|
3001
3070
|
return;
|
|
3002
3071
|
}
|
|
3003
|
-
if (_optionalChain([options, 'access',
|
|
3072
|
+
if (_optionalChain([options, 'access', _213 => _213.agent, 'optionalAccess', _214 => _214.apiCatalog]) && _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunkGQ6QOH7Tcjs.FARM_API_CATALOG_PATH) {
|
|
3004
3073
|
await serveBuiltInRoute(
|
|
3005
|
-
() =>
|
|
3074
|
+
() => _chunkGQ6QOH7Tcjs.createFarmApiCatalogResponse.call(void 0,
|
|
3006
3075
|
requestMethod,
|
|
3007
|
-
|
|
3076
|
+
_chunkGQ6QOH7Tcjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
|
|
3008
3077
|
new Request(parsedRequestUrl, {
|
|
3009
3078
|
headers: { "user-agent": String(_nullishCoalesce(req.headers["user-agent"], () => ( ""))) }
|
|
3010
3079
|
})
|
|
@@ -3012,8 +3081,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3012
3081
|
);
|
|
3013
3082
|
return;
|
|
3014
3083
|
}
|
|
3015
|
-
if (_optionalChain([options, 'access',
|
|
3016
|
-
const aiCatalog =
|
|
3084
|
+
if (_optionalChain([options, 'access', _215 => _215.agent, 'optionalAccess', _216 => _216.aiCatalog]) !== false) {
|
|
3085
|
+
const aiCatalog = _chunkGQ6QOH7Tcjs.createFarmAiCatalogResponse.call(void 0,
|
|
3017
3086
|
new Request(parsedRequestUrl, {
|
|
3018
3087
|
method: requestMethod,
|
|
3019
3088
|
headers: {
|
|
@@ -3061,11 +3130,12 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3061
3130
|
{
|
|
3062
3131
|
kind: "docs",
|
|
3063
3132
|
computed: docsResponse,
|
|
3064
|
-
label:
|
|
3133
|
+
label: _chunkGQ6QOH7Tcjs.resolveFarmDocsEngineRouteLabel.call(void 0,
|
|
3065
3134
|
_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath),
|
|
3066
3135
|
{
|
|
3067
|
-
path: _optionalChain([farmConfig, 'access',
|
|
3068
|
-
roots: _optionalChain([farmConfig, 'access',
|
|
3136
|
+
path: _optionalChain([farmConfig, 'access', _217 => _217.docs, 'optionalAccess', _218 => _218.entry]) || "/docs",
|
|
3137
|
+
roots: _optionalChain([farmConfig, 'access', _219 => _219.docs, 'optionalAccess', _220 => _220.roots, 'optionalAccess', _221 => _221.map, 'call', _222 => _222((root) => root.entry)]),
|
|
3138
|
+
pages: await getFarmDocsPagePaths()
|
|
3069
3139
|
}
|
|
3070
3140
|
)
|
|
3071
3141
|
}
|
|
@@ -3073,7 +3143,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3073
3143
|
return;
|
|
3074
3144
|
}
|
|
3075
3145
|
}
|
|
3076
|
-
if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD" || requestMethod === "POST") && _optionalChain([req, 'access',
|
|
3146
|
+
if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD" || requestMethod === "POST") && _optionalChain([req, 'access', _223 => _223.headers, 'access', _224 => _224.accept, 'optionalAccess', _225 => _225.includes, 'call', _226 => _226(_chunk3HLQTOVUcjs.FARM_NATIVE_TREE_CONTENT_TYPE)])) {
|
|
3077
3147
|
const { createFarmNativeTreeResponse } = await import("./native-tree-W2SSJB3Y.cjs");
|
|
3078
3148
|
const treeBodyInit = requestMethod === "POST" ? { body: _chunkCFG4QERRcjs.createFarmNodeRequestBodyStream.call(void 0, req), duplex: "half" } : {};
|
|
3079
3149
|
const treeResponse = await createFarmNativeTreeResponse({
|
|
@@ -3091,15 +3161,15 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3091
3161
|
});
|
|
3092
3162
|
await serveBuiltInRoute(() => treeResponse, {
|
|
3093
3163
|
computed: treeResponse,
|
|
3094
|
-
label: _nullishCoalesce(_optionalChain([farmApp, 'access',
|
|
3164
|
+
label: _nullishCoalesce(_optionalChain([farmApp, 'access', _227 => _227.getRouteManager, 'call', _228 => _228(), 'access', _229 => _229.matchRoute, 'call', _230 => _230(_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath)), 'access', _231 => _231.route, 'optionalAccess', _232 => _232.pattern]), () => ( null))
|
|
3095
3165
|
});
|
|
3096
3166
|
return;
|
|
3097
3167
|
}
|
|
3098
3168
|
const markdownRouteLabel = () => (
|
|
3099
3169
|
// On the route path, as production labels it: /fr/index.md is /index.md.
|
|
3100
|
-
|
|
3170
|
+
_chunkGQ6QOH7Tcjs.resolveFarmMarkdownRouteLabel.call(void 0,
|
|
3101
3171
|
toRoutePathname(requestPathname),
|
|
3102
|
-
(page) => _optionalChain([farmApp, 'access',
|
|
3172
|
+
(page) => _optionalChain([farmApp, 'access', _233 => _233.getRouteManager, 'call', _234 => _234(), 'access', _235 => _235.matchRoute, 'call', _236 => _236(page), 'access', _237 => _237.route, 'optionalAccess', _238 => _238.pattern])
|
|
3103
3173
|
)
|
|
3104
3174
|
);
|
|
3105
3175
|
const markdownSourceResponse = viteModuleRequest ? null : await _chunk3EEINK7Gcjs.createFarmMarkdownSourceResponse.call(void 0, {
|
|
@@ -3111,7 +3181,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3111
3181
|
routePathname: toRoutePathname,
|
|
3112
3182
|
resolveSource: async (pathname2) => {
|
|
3113
3183
|
const match = farmApp.getRouteManager().matchRoute(pathname2);
|
|
3114
|
-
const sourcePath = _optionalChain([match, 'access',
|
|
3184
|
+
const sourcePath = _optionalChain([match, 'access', _239 => _239.route, 'optionalAccess', _240 => _240.markdownSourcePath]) || (match.route && _chunk3EEINK7Gcjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
|
|
3115
3185
|
if (!sourcePath) {
|
|
3116
3186
|
return null;
|
|
3117
3187
|
}
|
|
@@ -3253,7 +3323,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3253
3323
|
"beforeRequest",
|
|
3254
3324
|
(plugin2) => {
|
|
3255
3325
|
const owner = _chunkBDYM2TN3cjs.getFarmIntegrationPluginOwner.call(void 0, plugin2);
|
|
3256
|
-
return !isFarmConfigRoutePlugin(plugin2) && (_optionalChain([owner, 'optionalAccess',
|
|
3326
|
+
return !isFarmConfigRoutePlugin(plugin2) && (_optionalChain([owner, 'optionalAccess', _241 => _241.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
|
|
3257
3327
|
},
|
|
3258
3328
|
req,
|
|
3259
3329
|
res
|
|
@@ -3290,7 +3360,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3290
3360
|
isProd: false
|
|
3291
3361
|
},
|
|
3292
3362
|
request,
|
|
3293
|
-
{ clientAddress: _optionalChain([req, 'access',
|
|
3363
|
+
{ clientAddress: _optionalChain([req, 'access', _242 => _242.socket, 'optionalAccess', _243 => _243.remoteAddress]) }
|
|
3294
3364
|
);
|
|
3295
3365
|
if (!result) {
|
|
3296
3366
|
throw new Error(`Matched integration route did not return a response`);
|
|
@@ -3298,7 +3368,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3298
3368
|
return result;
|
|
3299
3369
|
} catch (error) {
|
|
3300
3370
|
_chunkQMNWKQL4cjs.logger.error(`Integration route error: ${error}`);
|
|
3301
|
-
await _optionalChain([runtime, 'optionalAccess',
|
|
3371
|
+
await _optionalChain([runtime, 'optionalAccess', _244 => _244.reportError, 'call', _245 => _245(error)]);
|
|
3302
3372
|
return _chunkXGTFLG73cjs.createFarmInternalServerErrorResponse.call(void 0, );
|
|
3303
3373
|
}
|
|
3304
3374
|
};
|
|
@@ -3349,7 +3419,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3349
3419
|
_chunkBDYM2TN3cjs.matchIntegrationRoute.call(void 0, configuredIntegrations, {
|
|
3350
3420
|
pathname: requestPathname,
|
|
3351
3421
|
method: requestMethod
|
|
3352
|
-
}) || routeManager3.matchRedirect(requestPathname) || apiRouteManager.matchRoute(requestPathname) || farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
3422
|
+
}) || routeManager3.matchRedirect(requestPathname) || apiRouteManager.matchRoute(requestPathname) || farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _246 => _246.isFarmDocsAPIRequest, 'call', _247 => _247(requestPathname)]) || routeManager3.matchRoute(requestPathname).route || routeManager3.matchMetadataRoute(requestPathname) || routeManager3.matchMetadataImage(requestPathname)
|
|
3353
3423
|
);
|
|
3354
3424
|
};
|
|
3355
3425
|
try {
|
|
@@ -3441,21 +3511,21 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3441
3511
|
});
|
|
3442
3512
|
};
|
|
3443
3513
|
const isDocsAPIRequest = Boolean(
|
|
3444
|
-
farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
3514
|
+
farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _248 => _248.isFarmDocsAPIRequest, 'call', _249 => _249(pathname2)])
|
|
3445
3515
|
);
|
|
3446
3516
|
const docsRuntimeOptions = () => ({
|
|
3447
3517
|
kind: "docs",
|
|
3448
|
-
route:
|
|
3518
|
+
route: _chunkGQ6QOH7Tcjs.setFarmRouteLabel.call(void 0,
|
|
3449
3519
|
{ pathname: pathname2, pattern: urlPath2 },
|
|
3450
|
-
|
|
3451
|
-
path: _optionalChain([farmConfig, 'access',
|
|
3452
|
-
roots: _optionalChain([farmConfig, 'access',
|
|
3520
|
+
_chunkGQ6QOH7Tcjs.resolveFarmDocsRouteLabel.call(void 0, pathname2, {
|
|
3521
|
+
path: _optionalChain([farmConfig, 'access', _250 => _250.docs, 'optionalAccess', _251 => _251.entry]) || "/docs",
|
|
3522
|
+
roots: _optionalChain([farmConfig, 'access', _252 => _252.docs, 'optionalAccess', _253 => _253.roots, 'optionalAccess', _254 => _254.map, 'call', _255 => _255((root) => root.entry)])
|
|
3453
3523
|
})
|
|
3454
3524
|
)
|
|
3455
3525
|
});
|
|
3456
3526
|
let runtimeSession2;
|
|
3457
3527
|
let sessionRequestUrl;
|
|
3458
|
-
if (
|
|
3528
|
+
if (pm && opensFarmDevRuntimeSession(pm)) {
|
|
3459
3529
|
try {
|
|
3460
3530
|
runtimeSession2 = await pm.beginRuntimeRequest(
|
|
3461
3531
|
await createAPIRequest(),
|
|
@@ -3487,9 +3557,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3487
3557
|
return;
|
|
3488
3558
|
}
|
|
3489
3559
|
_chunkQMNWKQL4cjs.logger.error(`API route error: ${error}`);
|
|
3490
|
-
res
|
|
3491
|
-
res.setHeader("Content-Type", "application/json");
|
|
3492
|
-
res.end(_chunkXGTFLG73cjs.FARM_INTERNAL_SERVER_ERROR_BODY);
|
|
3560
|
+
sendFarmDevRuntimeHookError(res, true);
|
|
3493
3561
|
return;
|
|
3494
3562
|
}
|
|
3495
3563
|
pm.copyRequestContext(runtimeSession2.request, req);
|
|
@@ -3509,25 +3577,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3509
3577
|
throw error;
|
|
3510
3578
|
}
|
|
3511
3579
|
_chunkQMNWKQL4cjs.logger.error(`Middleware error: ${error}`);
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
const errorResponse = response;
|
|
3515
|
-
try {
|
|
3516
|
-
response = await pm.completeRuntimeRequest(
|
|
3517
|
-
runtimeSession2,
|
|
3518
|
-
async (_request, runtime) => {
|
|
3519
|
-
await runtime.reportError(error);
|
|
3520
|
-
return errorResponse;
|
|
3521
|
-
}
|
|
3522
|
-
);
|
|
3523
|
-
} catch (e26) {
|
|
3524
|
-
logResponse(method2, urlPath2, 500, Date.now() - startTime2, "API");
|
|
3525
|
-
sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
|
|
3526
|
-
return;
|
|
3527
|
-
}
|
|
3528
|
-
}
|
|
3529
|
-
logResponse(method2, urlPath2, response.status, Date.now() - startTime2, "API");
|
|
3530
|
-
await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, response);
|
|
3580
|
+
const status = await sendMiddlewareErrorJSON(runtimeSession2, error);
|
|
3581
|
+
logResponse(method2, urlPath2, status, Date.now() - startTime2, "API");
|
|
3531
3582
|
return;
|
|
3532
3583
|
}
|
|
3533
3584
|
const createHandlerRequest = async () => {
|
|
@@ -3634,9 +3685,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3634
3685
|
return;
|
|
3635
3686
|
}
|
|
3636
3687
|
_chunkQMNWKQL4cjs.logger.error(`API route error: ${error}`);
|
|
3637
|
-
res
|
|
3638
|
-
res.setHeader("Content-Type", "application/json");
|
|
3639
|
-
res.end(_chunkXGTFLG73cjs.FARM_INTERNAL_SERVER_ERROR_BODY);
|
|
3688
|
+
sendFarmDevRuntimeHookError(res, true);
|
|
3640
3689
|
return;
|
|
3641
3690
|
}
|
|
3642
3691
|
}
|
|
@@ -3678,9 +3727,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3678
3727
|
return;
|
|
3679
3728
|
}
|
|
3680
3729
|
_chunkQMNWKQL4cjs.logger.error(`Docs API route error: ${error}`);
|
|
3681
|
-
res
|
|
3682
|
-
res.setHeader("Content-Type", "application/json");
|
|
3683
|
-
res.end(_chunkXGTFLG73cjs.FARM_INTERNAL_SERVER_ERROR_BODY);
|
|
3730
|
+
sendFarmDevRuntimeHookError(res, true);
|
|
3684
3731
|
return;
|
|
3685
3732
|
}
|
|
3686
3733
|
}
|
|
@@ -3704,9 +3751,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3704
3751
|
await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, response);
|
|
3705
3752
|
} catch (error) {
|
|
3706
3753
|
_chunkQMNWKQL4cjs.logger.error(`API route error: ${error}`);
|
|
3707
|
-
res
|
|
3708
|
-
res.setHeader("Content-Type", "application/json");
|
|
3709
|
-
res.end(_chunkXGTFLG73cjs.FARM_INTERNAL_SERVER_ERROR_BODY);
|
|
3754
|
+
sendFarmDevRuntimeHookError(res, true);
|
|
3710
3755
|
}
|
|
3711
3756
|
return;
|
|
3712
3757
|
}
|
|
@@ -3813,7 +3858,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3813
3858
|
);
|
|
3814
3859
|
const loadingModule = loadingBoundary ? await routeManager3.loadRouteModule(loadingBoundary.modulePath) : null;
|
|
3815
3860
|
const navigationManifest = routeManager3.generateClientManifest(server.config.root);
|
|
3816
|
-
const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => (
|
|
3861
|
+
const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => ( _chunkVO65MYJDcjs.getClientModuleMetadata.call(void 0, route.modulePath, server.config.root)));
|
|
3817
3862
|
const isClientComponent = moduleMetadata.isClientComponent;
|
|
3818
3863
|
const shouldHydrate = moduleMetadata.shouldHydrate;
|
|
3819
3864
|
let mergedMetadata = {};
|
|
@@ -3821,7 +3866,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3821
3866
|
layouts.map((layout) => routeManager3.loadLayoutModule(layout.modulePath))
|
|
3822
3867
|
);
|
|
3823
3868
|
const layoutHydrationMetadata = layouts.map(
|
|
3824
|
-
(layout) => _nullishCoalesce(navigationManifest.layouts.find((entry) => entry.pattern === layout.pattern), () => (
|
|
3869
|
+
(layout) => _nullishCoalesce(navigationManifest.layouts.find((entry) => entry.pattern === layout.pattern), () => ( _chunkVO65MYJDcjs.getClientModuleMetadata.call(void 0, layout.modulePath, server.config.root)))
|
|
3825
3870
|
);
|
|
3826
3871
|
const shouldHydrateLayout = layoutHydrationMetadata.some(
|
|
3827
3872
|
(metadata) => metadata.shouldHydrate
|
|
@@ -3834,7 +3879,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3834
3879
|
];
|
|
3835
3880
|
const hydrationIslandStrategy = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0,
|
|
3836
3881
|
_optionalChain([(_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _278 => _278.getConfig, 'call', _279 => _279()]), () => ( options))), 'access', _280 => _280.experimental, 'optionalAccess', _281 => _281.serverComponents])
|
|
3837
|
-
) === "islands" ?
|
|
3882
|
+
) === "islands" ? _chunkDHR2WDSLcjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
3838
3883
|
route,
|
|
3839
3884
|
{ shouldHydrate, islandStrategy: _nullishCoalesce(moduleMetadata.islandStrategy, () => ( null)) },
|
|
3840
3885
|
layouts.map((layout, index) => ({
|
|
@@ -3900,7 +3945,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3900
3945
|
const slotModule = await routeManager3.loadRouteModule(slot.route.modulePath);
|
|
3901
3946
|
const slotMetadata = _nullishCoalesce(navigationManifest.slots.find(
|
|
3902
3947
|
(entry) => entry.name === slot.name && entry.ownerPattern === slot.ownerPattern && entry.pattern === slot.route.pattern
|
|
3903
|
-
), () => (
|
|
3948
|
+
), () => ( _chunkVO65MYJDcjs.getClientModuleMetadata.call(void 0, slot.route.modulePath, server.config.root)));
|
|
3904
3949
|
const slotContext = await _chunkX333W5KVcjs.resolveFarmRouteContext.call(void 0, farmApp.getConfig(), {
|
|
3905
3950
|
request: targetRequest,
|
|
3906
3951
|
params: slot.params,
|
|
@@ -4083,29 +4128,29 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4083
4128
|
const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _295 => _295.hasHook, 'call', _296 => _296("beforeRender")]), () => ( false));
|
|
4084
4129
|
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _297 => _297.hasHook, 'call', _298 => _298("afterResponse")]), () => ( false));
|
|
4085
4130
|
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _299 => _299.hasHook, 'call', _300 => _300("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _301 => _301.hasHook, 'call', _302 => _302("afterRender")]), () => ( false)));
|
|
4086
|
-
const
|
|
4087
|
-
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
4131
|
+
const opensRuntimeSession = pm ? opensFarmDevRuntimeSession(pm) : false;
|
|
4132
|
+
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _303 => _303.hasRuntimeHook, 'call', _304 => _304("after")]), () => ( false));
|
|
4088
4133
|
const requestedMatch = routeManager2.matchRoute(requestedPathname);
|
|
4089
4134
|
const pageBuiltInRouteLabel = (pathname2) => {
|
|
4090
4135
|
const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, pathname2, farmConfig.basePath);
|
|
4091
|
-
const mcpLabel =
|
|
4136
|
+
const mcpLabel = _chunkGQ6QOH7Tcjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath);
|
|
4092
4137
|
if (mcpLabel) return mcpLabel;
|
|
4093
4138
|
if (farmAgentGeneratedPaths(farmConfig).includes(routePathname)) return routePathname;
|
|
4094
4139
|
return routePathname === _chunkX3MHKLCOcjs.FARM_DEFAULT_MCP_PATH && farmApp.getServerRenderer().getDefaultMCPServer() ? _chunkX3MHKLCOcjs.FARM_DEFAULT_MCP_PATH : null;
|
|
4095
4140
|
};
|
|
4096
4141
|
let runtimeSession;
|
|
4097
4142
|
let pathname = requestedPathname;
|
|
4098
|
-
if (pm &&
|
|
4143
|
+
if (pm && opensRuntimeSession) {
|
|
4099
4144
|
try {
|
|
4100
4145
|
const sessionOptions = {
|
|
4101
4146
|
kind: "page",
|
|
4102
|
-
route:
|
|
4147
|
+
route: _chunkGQ6QOH7Tcjs.setFarmRouteLabel.call(void 0,
|
|
4103
4148
|
{
|
|
4104
4149
|
pathname: requestedPathname,
|
|
4105
|
-
pattern: _optionalChain([requestedMatch, 'optionalAccess',
|
|
4106
|
-
params: _optionalChain([requestedMatch, 'optionalAccess',
|
|
4150
|
+
pattern: _optionalChain([requestedMatch, 'optionalAccess', _305 => _305.route, 'optionalAccess', _306 => _306.pattern]) || null,
|
|
4151
|
+
params: _optionalChain([requestedMatch, 'optionalAccess', _307 => _307.params]) || {}
|
|
4107
4152
|
},
|
|
4108
|
-
_optionalChain([requestedMatch, 'optionalAccess',
|
|
4153
|
+
_optionalChain([requestedMatch, 'optionalAccess', _308 => _308.route]) ? null : pageBuiltInRouteLabel(requestedPathname)
|
|
4109
4154
|
)
|
|
4110
4155
|
};
|
|
4111
4156
|
runtimeSession = await pm.beginRuntimeRequest(
|
|
@@ -4132,20 +4177,39 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4132
4177
|
}
|
|
4133
4178
|
}
|
|
4134
4179
|
const routeMatch = pathname === requestedPathname ? requestedMatch : routeManager2.matchRoute(pathname);
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4180
|
+
const failPageHook = async (error, interceptor) => {
|
|
4181
|
+
_optionalChain([interceptor, 'optionalAccess', _309 => _309.release, 'call', _310 => _310()]);
|
|
4182
|
+
logResponse(method, urlPath, 500, Date.now() - startTime, "PAGE");
|
|
4183
|
+
if (runtimeSession) {
|
|
4184
|
+
await pm.failRuntimeRequest(runtimeSession, error);
|
|
4185
|
+
} else {
|
|
4186
|
+
await emitPluginError("runtime", error, {
|
|
4187
|
+
kind: "page",
|
|
4188
|
+
pathname,
|
|
4189
|
+
durationMs: Date.now() - startTime
|
|
4190
|
+
});
|
|
4191
|
+
}
|
|
4192
|
+
if (!res.headersSent) sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
|
|
4193
|
+
};
|
|
4194
|
+
try {
|
|
4195
|
+
if (pm && hasBeforeRouteMatchHook) {
|
|
4196
|
+
await pm.runHookParallel("beforeRouteMatch", {
|
|
4197
|
+
pathname,
|
|
4198
|
+
method
|
|
4199
|
+
});
|
|
4200
|
+
}
|
|
4201
|
+
if (pm && hasAfterRouteMatchHook) {
|
|
4202
|
+
await pm.runHookParallel("afterRouteMatch", {
|
|
4203
|
+
pathname,
|
|
4204
|
+
matched: !!_optionalChain([routeMatch, 'optionalAccess', _311 => _311.route]),
|
|
4205
|
+
routePattern: _optionalChain([routeMatch, 'optionalAccess', _312 => _312.route, 'optionalAccess', _313 => _313.pattern]) || null,
|
|
4206
|
+
params: _optionalChain([routeMatch, 'optionalAccess', _314 => _314.params]) || {},
|
|
4207
|
+
layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess', _315 => _315.layouts]) || []).map((l) => l.pattern)
|
|
4208
|
+
});
|
|
4209
|
+
}
|
|
4210
|
+
} catch (error) {
|
|
4211
|
+
await failPageHook(error);
|
|
4212
|
+
return;
|
|
4149
4213
|
}
|
|
4150
4214
|
const renderPayload = {
|
|
4151
4215
|
pathname,
|
|
@@ -4212,7 +4276,12 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4212
4276
|
}
|
|
4213
4277
|
const renderer = farmApp.getServerRenderer();
|
|
4214
4278
|
if (pm && hasBeforeRenderHook) {
|
|
4215
|
-
|
|
4279
|
+
try {
|
|
4280
|
+
await pm.runHookParallel("beforeRender", renderPayload);
|
|
4281
|
+
} catch (error) {
|
|
4282
|
+
await failPageHook(error, responseInterceptor);
|
|
4283
|
+
return;
|
|
4284
|
+
}
|
|
4216
4285
|
}
|
|
4217
4286
|
await renderer.renderPage(req, res);
|
|
4218
4287
|
if (!shouldInterceptResponse) {
|
|
@@ -4222,24 +4291,29 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4222
4291
|
const duration = Date.now() - startTime;
|
|
4223
4292
|
logResponse(method, urlPath, 500, duration, "PAGE");
|
|
4224
4293
|
if (pm && runtimeSession) {
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4294
|
+
if (middlewareFailed) {
|
|
4295
|
+
await pm.reportRuntimeRequestError(runtimeSession, error);
|
|
4296
|
+
} else {
|
|
4297
|
+
await pm.failRuntimeRequest(runtimeSession, error);
|
|
4298
|
+
if (!res.headersSent && !_optionalChain([responseInterceptor, 'optionalAccess', _327 => _327.isEnded, 'call', _328 => _328()])) {
|
|
4299
|
+
_optionalChain([responseInterceptor, 'optionalAccess', _329 => _329.release, 'call', _330 => _330()]);
|
|
4300
|
+
console.error("[FARM] Page error:", error);
|
|
4301
|
+
sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
|
|
4302
|
+
return;
|
|
4303
|
+
}
|
|
4304
|
+
}
|
|
4305
|
+
} else {
|
|
4228
4306
|
await emitPluginError("render-page", error, { pathname });
|
|
4229
4307
|
}
|
|
4230
4308
|
if (rendererDisabled && !res.headersSent) {
|
|
4231
4309
|
sendFarmDevErrorJSON(res);
|
|
4232
4310
|
return;
|
|
4233
4311
|
}
|
|
4234
|
-
|
|
4235
|
-
res.setHeader("Content-Type", "text/html; charset=utf-8");
|
|
4236
|
-
res.setHeader("Cache-Control", "private, no-store");
|
|
4237
|
-
}
|
|
4238
|
-
next(error);
|
|
4312
|
+
sendDevErrorPage(error);
|
|
4239
4313
|
}
|
|
4240
4314
|
})
|
|
4241
4315
|
);
|
|
4242
|
-
const farmRequestMiddleware = _optionalChain([farmMiddlewares, 'access',
|
|
4316
|
+
const farmRequestMiddleware = _optionalChain([farmMiddlewares, 'access', _331 => _331.stack, 'access', _332 => _332.at, 'call', _333 => _333(-1), 'optionalAccess', _334 => _334.handle]);
|
|
4243
4317
|
if (farmOwnsDevCors && viteServer.config.server.cors === false) {
|
|
4244
4318
|
farmMiddlewares.use(createFarmDevViteCorsMiddleware());
|
|
4245
4319
|
}
|
|
@@ -4262,7 +4336,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4262
4336
|
},
|
|
4263
4337
|
async resolveId(id, importer, resolveOptions) {
|
|
4264
4338
|
if (id.startsWith("@farm.js/core/internal/") && importer) {
|
|
4265
|
-
const root = _optionalChain([farmApp, 'optionalAccess',
|
|
4339
|
+
const root = _optionalChain([farmApp, 'optionalAccess', _335 => _335.getConfig, 'call', _336 => _336(), 'access', _337 => _337.root]) || _optionalChain([server, 'optionalAccess', _338 => _338.config, 'access', _339 => _339.root]) || options.root;
|
|
4266
4340
|
const relative4 = root ? path6.relative(root, importer.split("?", 1)[0]) : "";
|
|
4267
4341
|
if (root && (relative4.startsWith("..") || path6.isAbsolute(relative4))) {
|
|
4268
4342
|
return this.resolve(id, path6.join(root, "package.json"), {
|
|
@@ -4293,7 +4367,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4293
4367
|
}
|
|
4294
4368
|
},
|
|
4295
4369
|
async load(id, loadOptions) {
|
|
4296
|
-
if (pendingClientSetup && !_optionalChain([loadOptions, 'optionalAccess',
|
|
4370
|
+
if (pendingClientSetup && !_optionalChain([loadOptions, 'optionalAccess', _340 => _340.ssr]) && !farmSetupContext.getStore()) {
|
|
4297
4371
|
await pendingClientSetup;
|
|
4298
4372
|
}
|
|
4299
4373
|
if (_chunkPIUTGRDIcjs.isFarmServerFnBoundaryId.call(void 0, id) && islandsServerFns()) {
|
|
@@ -4311,8 +4385,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4311
4385
|
if (imageModule) return imageModule;
|
|
4312
4386
|
}
|
|
4313
4387
|
if (_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
|
|
4314
|
-
const renderer = _optionalChain([farmApp, 'optionalAccess',
|
|
4315
|
-
const root = _optionalChain([server, 'optionalAccess',
|
|
4388
|
+
const renderer = _optionalChain([farmApp, 'optionalAccess', _341 => _341.getConfig, 'call', _342 => _342(), 'access', _343 => _343.renderer]) || _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
4389
|
+
const root = _optionalChain([server, 'optionalAccess', _344 => _344.config, 'access', _345 => _345.root]) || options.root;
|
|
4316
4390
|
if (isClientEnvironment(this, loadOptions)) {
|
|
4317
4391
|
return generateProgrammaticClientRouteModuleForId(
|
|
4318
4392
|
id,
|
|
@@ -4328,21 +4402,21 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4328
4402
|
return FARM_DEV_CLIENT_BOOT_MODULE;
|
|
4329
4403
|
}
|
|
4330
4404
|
if (isFarmClientVirtualId(id)) {
|
|
4331
|
-
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
4332
|
-
const renderer = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4333
|
-
const integrations = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4334
|
-
const root = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4335
|
-
const docs = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4405
|
+
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _346 => _346.getConfig, 'call', _347 => _347()]);
|
|
4406
|
+
const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _348 => _348.renderer]) || _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
4407
|
+
const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _349 => _349.integrations]) || options.integrations;
|
|
4408
|
+
const root = _optionalChain([resolvedConfig, 'optionalAccess', _350 => _350.root]) || _optionalChain([server, 'optionalAccess', _351 => _351.config, 'access', _352 => _352.root]) || process.cwd();
|
|
4409
|
+
const docs = _optionalChain([resolvedConfig, 'optionalAccess', _353 => _353.docs]);
|
|
4336
4410
|
const adapterOwnsDocsRuntime = Boolean(
|
|
4337
|
-
_chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess',
|
|
4411
|
+
_chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _354 => _354.adapter, 'optionalAccess', _355 => _355.server]) && docs.adapter.react
|
|
4338
4412
|
);
|
|
4339
|
-
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4413
|
+
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _356 => _356.devtools]), () => ( _chunkSTF6VDYQcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
|
|
4340
4414
|
const [docsRuntime, docsSearchRuntime, devtoolsClientRuntime] = await Promise.all([
|
|
4341
|
-
_optionalChain([docs, 'optionalAccess',
|
|
4342
|
-
_optionalChain([docs, 'optionalAccess',
|
|
4415
|
+
_optionalChain([docs, 'optionalAccess', _357 => _357.enabled]) ? loadFarmDocsDevRuntime() : null,
|
|
4416
|
+
_optionalChain([docs, 'optionalAccess', _358 => _358.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
|
|
4343
4417
|
devtools.enabled ? loadFarmDevtoolsClientRuntime() : null
|
|
4344
4418
|
]);
|
|
4345
|
-
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess',
|
|
4419
|
+
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _359 => _359.isFarmDocsSearchEnabled, 'call', _360 => _360(docs)]), () => ( false));
|
|
4346
4420
|
const generatedDocsSearchRuntime = docsSearchRuntime ? docsSearchRuntime.generateFarmDocsSearchClientRuntime(
|
|
4347
4421
|
docsSearchEnabled,
|
|
4348
4422
|
docsSearchEnabled ? docsSearchRuntime.resolveFarmDocsSearchClientModule(root) : void 0
|
|
@@ -4350,10 +4424,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4350
4424
|
const generatedDevtoolsClientRuntime = devtoolsClientRuntime ? devtoolsClientRuntime.generateFarmDevtoolsClientRuntime(devtools) : "";
|
|
4351
4425
|
const generatedDevIndicatorsClientRuntime = farmApp ? _chunkUVV3I5QAcjs.generateFarmDevIndicatorsClientRuntime.call(void 0, farmApp.getConfig().devIndicators) : "";
|
|
4352
4426
|
const integrationProviders = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? _chunkBDYM2TN3cjs.getIntegrationProviders.call(void 0, integrations) : [];
|
|
4353
|
-
const isolatedHydrationMode =
|
|
4354
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4427
|
+
const isolatedHydrationMode = _chunkVO65MYJDcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
4428
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _361 => _361.experimental, 'optionalAccess', _362 => _362.isolatedClientHydration]),
|
|
4355
4429
|
{
|
|
4356
|
-
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4430
|
+
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _363 => _363.experimental, 'optionalAccess', _364 => _364.serverComponents])) === "rsc",
|
|
4357
4431
|
hasUnsupportedIntegrationProvider: integrationProviders.filter((provider) => provider.component || provider.type === "clerk").some((provider) => provider.supportsIsolatedHydration !== true)
|
|
4358
4432
|
}
|
|
4359
4433
|
);
|
|
@@ -4361,32 +4435,32 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4361
4435
|
integrationProviders,
|
|
4362
4436
|
[
|
|
4363
4437
|
..._chunkBDYM2TN3cjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
|
|
4364
|
-
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess',
|
|
4438
|
+
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _365 => _365.getFarmDocsDocumentNavigationMatchers, 'call', _366 => _366(docs)]), () => ( []))
|
|
4365
4439
|
],
|
|
4366
4440
|
generatedDocsSearchRuntime,
|
|
4367
4441
|
`${generatedDevtoolsClientRuntime}
|
|
4368
4442
|
${generatedDevIndicatorsClientRuntime}`,
|
|
4369
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4443
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _367 => _367.plugins]) || [],
|
|
4370
4444
|
root,
|
|
4371
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4372
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4373
|
-
_chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess',
|
|
4445
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _368 => _368.srcDir]) || options.srcDir || "src",
|
|
4446
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _369 => _369.publicRuntimeConfig]) || options.publicRuntimeConfig,
|
|
4447
|
+
_chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _370 => _370.adapter, 'optionalAccess', _371 => _371.react]) : void 0,
|
|
4374
4448
|
renderer,
|
|
4375
|
-
isolatedHydrationMode === "enabled" || _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
4376
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4377
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4378
|
-
|
|
4379
|
-
|
|
4449
|
+
isolatedHydrationMode === "enabled" || _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _372 => _372.getRouteManager, 'call', _373 => _373(), 'access', _374 => _374.getIsolatedClientBoundaryModules, 'call', _375 => _375(root)])))), 'optionalAccess', _376 => _376.size]) > 0,
|
|
4450
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _377 => _377.trailingSlash]), () => ( false)),
|
|
4451
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _378 => _378.basePath]), () => ( "/")),
|
|
4452
|
+
_chunkDHR2WDSLcjs.generateClientCachePersistenceCode.call(void 0,
|
|
4453
|
+
_chunkDHR2WDSLcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, _optionalChain([resolvedConfig, 'optionalAccess', _379 => _379.cache]))
|
|
4380
4454
|
),
|
|
4381
4455
|
_chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0,
|
|
4382
|
-
_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4456
|
+
_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _380 => _380.experimental, 'optionalAccess', _381 => _381.serverComponents])) === "islands"
|
|
4383
4457
|
);
|
|
4384
4458
|
}
|
|
4385
4459
|
if (id === "/@farm/server") {
|
|
4386
4460
|
return generateServerCode();
|
|
4387
4461
|
}
|
|
4388
4462
|
if (id === "/@farm/manifest") {
|
|
4389
|
-
const routeManager = _optionalChain([farmApp, 'optionalAccess',
|
|
4463
|
+
const routeManager = _optionalChain([farmApp, 'optionalAccess', _382 => _382.getRouteManager, 'call', _383 => _383()]);
|
|
4390
4464
|
if (!routeManager) {
|
|
4391
4465
|
return `
|
|
4392
4466
|
export const getManifest = () => ({
|
|
@@ -4399,9 +4473,9 @@ export const getManifest = () => ({
|
|
|
4399
4473
|
`;
|
|
4400
4474
|
}
|
|
4401
4475
|
const manifest = routeManager.generateClientManifest(server.config.root);
|
|
4402
|
-
const globalStylesheetHref =
|
|
4476
|
+
const globalStylesheetHref = _chunkDHR2WDSLcjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
4403
4477
|
server.config.root,
|
|
4404
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
4478
|
+
_optionalChain([farmApp, 'optionalAccess', _384 => _384.getConfig, 'call', _385 => _385(), 'access', _386 => _386.srcDir])
|
|
4405
4479
|
);
|
|
4406
4480
|
const fullManifest = {
|
|
4407
4481
|
clientEntry: "/@farm/client.js",
|
|
@@ -4457,54 +4531,54 @@ export const manifest = getManifest();
|
|
|
4457
4531
|
}
|
|
4458
4532
|
},
|
|
4459
4533
|
async transform(code, id, transformOptions) {
|
|
4460
|
-
if (pendingClientSetup && !_optionalChain([transformOptions, 'optionalAccess',
|
|
4534
|
+
if (pendingClientSetup && !_optionalChain([transformOptions, 'optionalAccess', _387 => _387.ssr]) && !farmSetupContext.getStore()) {
|
|
4461
4535
|
await pendingClientSetup;
|
|
4462
4536
|
}
|
|
4463
|
-
const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
4537
|
+
const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _388 => _388.getConfig, 'call', _389 => _389()]), () => ( options));
|
|
4464
4538
|
let rewrotePackageImports = false;
|
|
4465
|
-
if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access',
|
|
4539
|
+
if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access', _390 => _390.experimental, 'optionalAccess', _391 => _391.serverComponents])) === "islands" && (!id.includes("/node_modules/") || _optionalChain([transformOptions, 'optionalAccess', _392 => _392.ssr]) === true && farmReactServerFiles.has(id.split("?", 1)[0])) && !id.startsWith("\0") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id) && !_chunkVO65MYJDcjs.hasUseClientDirective.call(void 0, code)) {
|
|
4466
4540
|
const file = id.split("?", 1)[0];
|
|
4467
|
-
const projectRoot = actionConfig.root || _optionalChain([server, 'optionalAccess',
|
|
4468
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
4541
|
+
const projectRoot = actionConfig.root || _optionalChain([server, 'optionalAccess', _393 => _393.config, 'access', _394 => _394.root]) || process.cwd();
|
|
4542
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _395 => _395.ssr]) === true) {
|
|
4469
4543
|
if (farmReactServerFiles.has(file)) {
|
|
4470
|
-
for (const child of
|
|
4544
|
+
for (const child of _chunkVO65MYJDcjs.farmRelativeImportFiles.call(void 0, code, file))
|
|
4471
4545
|
farmReactServerFiles.add(child);
|
|
4472
4546
|
}
|
|
4473
|
-
const serverModule = farmReactServerFiles.has(file) || !
|
|
4547
|
+
const serverModule = farmReactServerFiles.has(file) || !_chunkVO65MYJDcjs.getFarmClientReachableModules.call(void 0,
|
|
4474
4548
|
path6.resolve(projectRoot, actionConfig.srcDir || "src"),
|
|
4475
4549
|
projectRoot
|
|
4476
4550
|
).has(path6.resolve(file));
|
|
4477
|
-
const reactServer = !serverModule ? null :
|
|
4551
|
+
const reactServer = !serverModule ? null : _chunkVO65MYJDcjs.rewriteFarmReactServerImports.call(void 0, {
|
|
4478
4552
|
code,
|
|
4479
4553
|
file,
|
|
4480
|
-
reference: (specifier, exportName) =>
|
|
4554
|
+
reference: (specifier, exportName) => _chunkVO65MYJDcjs.ensureFarmPackageClientReference.call(void 0, projectRoot, specifier, exportName, file),
|
|
4481
4555
|
onServerFile: (serverFile) => farmReactServerFiles.add(serverFile)
|
|
4482
4556
|
});
|
|
4483
4557
|
if (reactServer !== null) {
|
|
4484
4558
|
code = reactServer;
|
|
4485
4559
|
rewrotePackageImports = true;
|
|
4486
4560
|
}
|
|
4487
|
-
const internal = farmReactServerFiles.has(file) ?
|
|
4561
|
+
const internal = farmReactServerFiles.has(file) ? _chunkVO65MYJDcjs.rewriteFarmReactServerClientModuleImports.call(void 0, {
|
|
4488
4562
|
code,
|
|
4489
4563
|
file,
|
|
4490
|
-
reference: (clientFile) =>
|
|
4564
|
+
reference: (clientFile) => _chunkVO65MYJDcjs.ensureFarmInternalClientReference.call(void 0, projectRoot, clientFile)
|
|
4491
4565
|
}) : null;
|
|
4492
4566
|
if (internal !== null) {
|
|
4493
4567
|
code = internal;
|
|
4494
4568
|
rewrotePackageImports = true;
|
|
4495
4569
|
}
|
|
4496
4570
|
}
|
|
4497
|
-
const referenced =
|
|
4571
|
+
const referenced = _chunkVO65MYJDcjs.rewriteFarmPackageClientImports.call(void 0, {
|
|
4498
4572
|
code,
|
|
4499
4573
|
file,
|
|
4500
4574
|
root: projectRoot,
|
|
4501
|
-
isClientPackage: (specifier) =>
|
|
4575
|
+
isClientPackage: (specifier) => _chunkVO65MYJDcjs.isFarmPackageClientBoundary.call(void 0, file, specifier, projectRoot)
|
|
4502
4576
|
});
|
|
4503
4577
|
if (referenced !== null) {
|
|
4504
4578
|
code = referenced;
|
|
4505
4579
|
rewrotePackageImports = true;
|
|
4506
4580
|
}
|
|
4507
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
4581
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _396 => _396.ssr]) === true) {
|
|
4508
4582
|
const cached = rewriteFarmReactCacheImport(code, file);
|
|
4509
4583
|
if (cached !== null) {
|
|
4510
4584
|
code = cached;
|
|
@@ -4514,43 +4588,43 @@ export const manifest = getManifest();
|
|
|
4514
4588
|
}
|
|
4515
4589
|
if (islandsServerFns() && !_chunkPIUTGRDIcjs.isFarmServerFnBoundaryId.call(void 0, id) && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
|
|
4516
4590
|
const serverFns = _chunkPIUTGRDIcjs.transformFarmServerFns.call(void 0, code, id, {
|
|
4517
|
-
environment: _optionalChain([transformOptions, 'optionalAccess',
|
|
4591
|
+
environment: _optionalChain([transformOptions, 'optionalAccess', _397 => _397.ssr]) === true ? "rsc" : "client"
|
|
4518
4592
|
});
|
|
4519
4593
|
if (serverFns) {
|
|
4520
4594
|
if (!serverFns.code.includes("use server")) return { code: serverFns.code, map: null };
|
|
4521
4595
|
code = serverFns.code;
|
|
4522
4596
|
}
|
|
4523
4597
|
}
|
|
4524
|
-
if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access',
|
|
4598
|
+
if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access', _398 => _398.experimental, 'optionalAccess', _399 => _399.serverComponents])) === "islands" && code.includes("use server") && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
|
|
4525
4599
|
const file = id.split("?", 1)[0];
|
|
4526
4600
|
const actionModule = transformFarmFormActionModule({
|
|
4527
4601
|
code,
|
|
4528
4602
|
id,
|
|
4529
|
-
root: actionConfig.root || _optionalChain([server, 'optionalAccess',
|
|
4530
|
-
ssr: _optionalChain([transformOptions, 'optionalAccess',
|
|
4603
|
+
root: actionConfig.root || _optionalChain([server, 'optionalAccess', _400 => _400.config, 'access', _401 => _401.root]) || process.cwd(),
|
|
4604
|
+
ssr: _optionalChain([transformOptions, 'optionalAccess', _402 => _402.ssr]) === true,
|
|
4531
4605
|
// Parsed by file type: page components are TSX.
|
|
4532
4606
|
parse: (source) => _vite.parseSync.call(void 0, file, source).program
|
|
4533
4607
|
});
|
|
4534
4608
|
if (actionModule) return { code: actionModule, map: null };
|
|
4535
4609
|
}
|
|
4536
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
4537
|
-
const docsConfigModule = _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess',
|
|
4538
|
-
if (
|
|
4539
|
-
const redacted =
|
|
4610
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _403 => _403.ssr])) {
|
|
4611
|
+
const docsConfigModule = _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess', _404 => _404.getConfig, 'call', _405 => _405(), 'optionalAccess', _406 => _406.docs]));
|
|
4612
|
+
if (_chunkDHR2WDSLcjs.isFarmDocsClientConfigModule.call(void 0, id, docsConfigModule)) {
|
|
4613
|
+
const redacted = _chunkDHR2WDSLcjs.redactFarmDocsClientConfig.call(void 0, code, id.split("?")[0]);
|
|
4540
4614
|
if (redacted !== null) return { code: redacted, map: null };
|
|
4541
4615
|
}
|
|
4542
4616
|
}
|
|
4543
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
4544
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
4545
|
-
if ((_optionalChain([currentConfig, 'access',
|
|
4617
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _407 => _407.ssr])) {
|
|
4618
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _408 => _408.getConfig, 'call', _409 => _409()]), () => ( options));
|
|
4619
|
+
if ((_optionalChain([currentConfig, 'access', _410 => _410.experimental, 'optionalAccess', _411 => _411.serverActions]) !== true || !serverFnTransformActive) && !islandsServerFns()) {
|
|
4546
4620
|
const violation = findClientServerFnViolation(code, id);
|
|
4547
4621
|
if (violation) {
|
|
4548
4622
|
this.error(formatServerFnBoundaryError(violation, id));
|
|
4549
4623
|
}
|
|
4550
4624
|
}
|
|
4551
4625
|
}
|
|
4552
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
4553
|
-
warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
4626
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _412 => _412.ssr]) && shouldInspectClientBoundary(id, code)) {
|
|
4627
|
+
warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _413 => _413.getConfig, 'call', _414 => _414()]), () => ( options)));
|
|
4554
4628
|
}
|
|
4555
4629
|
if (typeof imageImports.transform === "function") {
|
|
4556
4630
|
const imageModule = await imageImports.transform.call(this, code, id, transformOptions);
|
|
@@ -4565,13 +4639,13 @@ export const manifest = getManifest();
|
|
|
4565
4639
|
id,
|
|
4566
4640
|
transformOptions
|
|
4567
4641
|
);
|
|
4568
|
-
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess',
|
|
4642
|
+
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _415 => _415.code, 'optionalAccess', _416 => _416.toString, 'call', _417 => _417()]);
|
|
4569
4643
|
if (fontCode) {
|
|
4570
4644
|
transformedCode = fontCode;
|
|
4571
4645
|
transformed = true;
|
|
4572
4646
|
}
|
|
4573
4647
|
}
|
|
4574
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
4648
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _418 => _418.ssr]) && server) {
|
|
4575
4649
|
const rewrittenImports = rewriteEarlySsrRelativeImports({
|
|
4576
4650
|
code: transformedCode,
|
|
4577
4651
|
id,
|
|
@@ -4583,26 +4657,26 @@ export const manifest = getManifest();
|
|
|
4583
4657
|
transformed = true;
|
|
4584
4658
|
}
|
|
4585
4659
|
}
|
|
4586
|
-
if (
|
|
4660
|
+
if (_chunkVO65MYJDcjs.hasUseClientDirective.call(void 0, transformedCode)) {
|
|
4587
4661
|
const clientBoundarySource = transformedCode;
|
|
4588
4662
|
const moduleInfo = this.getModuleInfo(id);
|
|
4589
4663
|
if (moduleInfo) {
|
|
4590
4664
|
moduleInfo.isClientComponent = true;
|
|
4591
4665
|
}
|
|
4592
|
-
transformedCode =
|
|
4666
|
+
transformedCode = _chunkVO65MYJDcjs.stripUseClientDirective.call(void 0, transformedCode);
|
|
4593
4667
|
transformed = true;
|
|
4594
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
4668
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _419 => _419.getConfig, 'call', _420 => _420()]), () => ( options));
|
|
4595
4669
|
let isolatedModuleReference = null;
|
|
4596
|
-
const root = currentConfig.root || _optionalChain([server, 'optionalAccess',
|
|
4670
|
+
const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _421 => _421.config, 'access', _422 => _422.root]) || process.cwd();
|
|
4597
4671
|
const cleanId = id.split("?", 1)[0];
|
|
4598
|
-
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
4599
|
-
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess',
|
|
4600
|
-
if (_chunk67MZTLTFcjs.isReactRenderer.call(void 0, _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && (
|
|
4601
|
-
cleanId.replace(/\\/g, "/").includes(
|
|
4672
|
+
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _423 => _423.getRouteManager, 'call', _424 => _424(), 'access', _425 => _425.getIsolatedClientBoundaryModules, 'call', _426 => _426(root)])));
|
|
4673
|
+
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _427 => _427.has, 'call', _428 => _428(path6.resolve(cleanId))]) === true;
|
|
4674
|
+
if (_chunk67MZTLTFcjs.isReactRenderer.call(void 0, _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && (_chunkVO65MYJDcjs.isIsolatableClientBoundarySource.call(void 0, clientBoundarySource) || // A generated client reference, whose marker comment compiled TSX no longer has.
|
|
4675
|
+
cleanId.replace(/\\/g, "/").includes(_chunkVO65MYJDcjs.FARM_CLIENT_REFERENCE_DIRECTORY))) {
|
|
4602
4676
|
isolatedModuleReference = _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, cleanId, root);
|
|
4603
|
-
const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([currentConfig, 'access',
|
|
4604
|
-
const explicitStrategy =
|
|
4605
|
-
const inference = islandsMode && explicitStrategy === null ?
|
|
4677
|
+
const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([currentConfig, 'access', _429 => _429.experimental, 'optionalAccess', _430 => _430.serverComponents])) === "islands";
|
|
4678
|
+
const explicitStrategy = _chunkVO65MYJDcjs.getIslandStrategyExport.call(void 0, clientBoundarySource);
|
|
4679
|
+
const inference = islandsMode && explicitStrategy === null ? _chunkDHR2WDSLcjs.inferFarmIslandStrategy.call(void 0, cleanId, root) : null;
|
|
4606
4680
|
if (inference) {
|
|
4607
4681
|
for (const file of inference.files) {
|
|
4608
4682
|
if (file !== path6.resolve(cleanId)) this.addWatchFile(file);
|
|
@@ -4615,8 +4689,8 @@ export const manifest = getManifest();
|
|
|
4615
4689
|
islandStrategy: _nullishCoalesce(explicitStrategy, () => ( "load")),
|
|
4616
4690
|
parse: (source) => this.parse(source),
|
|
4617
4691
|
slots: islandsMode,
|
|
4618
|
-
browser: _optionalChain([transformOptions, 'optionalAccess',
|
|
4619
|
-
inferredInteraction: _optionalChain([inference, 'optionalAccess',
|
|
4692
|
+
browser: _optionalChain([transformOptions, 'optionalAccess', _431 => _431.ssr]) !== true,
|
|
4693
|
+
inferredInteraction: _optionalChain([inference, 'optionalAccess', _432 => _432.strategy]) === "interaction"
|
|
4620
4694
|
});
|
|
4621
4695
|
if (!transformedBoundary) {
|
|
4622
4696
|
this.error(
|
|
@@ -4646,7 +4720,7 @@ export const manifest = getManifest();
|
|
|
4646
4720
|
);
|
|
4647
4721
|
return;
|
|
4648
4722
|
}` : "";
|
|
4649
|
-
const hmrCode = _optionalChain([transformOptions, 'optionalAccess',
|
|
4723
|
+
const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _433 => _433.ssr]) || reactRefreshActive || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
|
|
4650
4724
|
if (import.meta.hot) {
|
|
4651
4725
|
import.meta.hot.accept((newModule) => {
|
|
4652
4726
|
${isolatedHmrUpdate}
|
|
@@ -4702,14 +4776,14 @@ if (import.meta.hot) {
|
|
|
4702
4776
|
}
|
|
4703
4777
|
_chunkQMNWKQL4cjs.logger.info(`Found ${ssgPages.length} SSG pages, ${ssrRoutes.length} SSR routes`);
|
|
4704
4778
|
_chunkQMNWKQL4cjs.logger.info("Pre-rendering SSG pages...");
|
|
4705
|
-
const outDir = path6.join(_optionalChain([server, 'optionalAccess',
|
|
4779
|
+
const outDir = path6.join(_optionalChain([server, 'optionalAccess', _434 => _434.config, 'access', _435 => _435.root]) || process.cwd(), options.outDir || "dist");
|
|
4706
4780
|
const clientDir = path6.join(outDir, "client");
|
|
4707
4781
|
for (const page of ssgPages) {
|
|
4708
4782
|
try {
|
|
4709
4783
|
const staticRequest = new Request(new URL(page.urlPath, "http://farm.static"));
|
|
4710
4784
|
await farmApp.getServerRenderer().runWithRequestContext(staticRequest, async () => {
|
|
4711
4785
|
const mod = await routeManager.loadRouteModule(page.filePath);
|
|
4712
|
-
if (!_optionalChain([mod, 'optionalAccess',
|
|
4786
|
+
if (!_optionalChain([mod, 'optionalAccess', _436 => _436.default])) return;
|
|
4713
4787
|
const { layouts } = routeManager.matchRoute(page.urlPath);
|
|
4714
4788
|
const layoutModules = await Promise.all(
|
|
4715
4789
|
layouts.map((l) => routeManager.loadLayoutModule(l.modulePath))
|
|
@@ -4741,7 +4815,7 @@ if (import.meta.hot) {
|
|
|
4741
4815
|
const i18nSnapshot = _chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
4742
4816
|
const i18nHead = renderFarmI18nStaticHead(page.urlPath, i18nSnapshot);
|
|
4743
4817
|
const fullHtml = `<!DOCTYPE html>
|
|
4744
|
-
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
4818
|
+
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _437 => _437.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
|
|
4745
4819
|
<head>
|
|
4746
4820
|
<meta charset="utf-8">
|
|
4747
4821
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
@@ -4784,8 +4858,8 @@ if (import.meta.hot) {
|
|
|
4784
4858
|
}
|
|
4785
4859
|
},
|
|
4786
4860
|
watchChange() {
|
|
4787
|
-
|
|
4788
|
-
|
|
4861
|
+
_chunkVO65MYJDcjs.invalidateFarmClientReachableModules.call(void 0, );
|
|
4862
|
+
_chunkVO65MYJDcjs.invalidateFarmClientOnlyScan.call(void 0, );
|
|
4789
4863
|
},
|
|
4790
4864
|
async handleHotUpdate(ctx) {
|
|
4791
4865
|
if (pendingClientSetup && !farmSetupContext.getStore()) await pendingClientSetup;
|
|
@@ -4810,13 +4884,13 @@ if (import.meta.hot) {
|
|
|
4810
4884
|
server2.moduleGraph.invalidateModule(mod);
|
|
4811
4885
|
}
|
|
4812
4886
|
}
|
|
4813
|
-
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
4887
|
+
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _438 => _438.getConfig, 'call', _439 => _439()]);
|
|
4814
4888
|
const normalizedFile = file.replace(/\\/g, "/");
|
|
4815
4889
|
if (currentFarmConfig && /\/route\.(?:ts|tsx|js|jsx)$/.test(normalizedFile) && _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, currentFarmConfig).some(
|
|
4816
4890
|
(appDir) => normalizedFile.startsWith(`${_chunkQMNWKQL4cjs.toPosixPath.call(void 0, appDir)}/api/`)
|
|
4817
4891
|
)) {
|
|
4818
4892
|
for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
|
|
4819
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
4893
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _440 => _440(`updated ${file}`)]);
|
|
4820
4894
|
server2.ws.send({ type: "full-reload", path: "*" });
|
|
4821
4895
|
return [];
|
|
4822
4896
|
}
|
|
@@ -4826,7 +4900,7 @@ if (import.meta.hot) {
|
|
|
4826
4900
|
for (const mod of modules) {
|
|
4827
4901
|
server2.moduleGraph.invalidateModule(mod);
|
|
4828
4902
|
}
|
|
4829
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
4903
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _441 => _441(`updated ${file}`)]);
|
|
4830
4904
|
server2.ws.send({
|
|
4831
4905
|
type: "full-reload",
|
|
4832
4906
|
path: "*"
|
|
@@ -4839,7 +4913,7 @@ if (import.meta.hot) {
|
|
|
4839
4913
|
for (const mod of modules) {
|
|
4840
4914
|
server2.moduleGraph.invalidateModule(mod);
|
|
4841
4915
|
}
|
|
4842
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
4916
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _442 => _442(`updated ${file}`)]);
|
|
4843
4917
|
server2.ws.send({
|
|
4844
4918
|
type: "full-reload",
|
|
4845
4919
|
path: "*"
|
|
@@ -4847,12 +4921,12 @@ if (import.meta.hot) {
|
|
|
4847
4921
|
return [];
|
|
4848
4922
|
}
|
|
4849
4923
|
if (apiRouteManager && _chunkJYNNIGQOcjs.invalidateFarmDevDependents.call(void 0, server2, file, apiRouteManager.getSourceFiles()).length > 0) {
|
|
4850
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
4924
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _443 => _443(`updated ${file}`)]);
|
|
4851
4925
|
}
|
|
4852
|
-
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
4853
|
-
const planRouteManager = _optionalChain([farmApp, 'optionalAccess',
|
|
4926
|
+
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _444 => _444.experimental, 'optionalAccess', _445 => _445.isolatedClientHydration]);
|
|
4927
|
+
const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _446 => _446.getRouteManager, 'call', _447 => _447()]);
|
|
4854
4928
|
const isHydrationPlanSource = currentSrcRoot !== null && normalizedFile.startsWith(`${currentSrcRoot}/`) && /\.[cm]?[jt]sx?$/.test(normalizedFile);
|
|
4855
|
-
const tracksAsyncOwnerIslands = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
4929
|
+
const tracksAsyncOwnerIslands = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _448 => _448.renderer])) && planRouteManager !== void 0;
|
|
4856
4930
|
let clientPlanCurrent = false;
|
|
4857
4931
|
if (isHydrationPlanSource && (isolatedHydrationMode === "enabled" || isolatedHydrationMode === "analyze" || tracksAsyncOwnerIslands)) {
|
|
4858
4932
|
const routeManager = planRouteManager;
|
|
@@ -4914,7 +4988,7 @@ if (import.meta.hot) {
|
|
|
4914
4988
|
}
|
|
4915
4989
|
return [];
|
|
4916
4990
|
}
|
|
4917
|
-
if (!clientPlanCurrent) _optionalChain([farmApp, 'optionalAccess',
|
|
4991
|
+
if (!clientPlanCurrent) _optionalChain([farmApp, 'optionalAccess', _449 => _449.getRouteManager, 'call', _450 => _450(), 'access', _451 => _451.invalidateClientManifest, 'call', _452 => _452()]);
|
|
4918
4992
|
const manifestModule = server2.moduleGraph.getModuleById("/@farm/manifest");
|
|
4919
4993
|
if (manifestModule) {
|
|
4920
4994
|
server2.moduleGraph.invalidateModule(manifestModule);
|
|
@@ -5018,7 +5092,7 @@ function createPageDataMiddlewareResponse(res) {
|
|
|
5018
5092
|
return (...args) => {
|
|
5019
5093
|
if (captures(target.statusCode, target.getHeader("location"))) {
|
|
5020
5094
|
const callback = args.find((arg) => typeof arg === "function");
|
|
5021
|
-
_optionalChain([callback, 'optionalCall',
|
|
5095
|
+
_optionalChain([callback, 'optionalCall', _453 => _453()]);
|
|
5022
5096
|
return property === "write" ? true : response;
|
|
5023
5097
|
}
|
|
5024
5098
|
return target[property](...args);
|
|
@@ -5082,12 +5156,12 @@ function isFarmClientVirtualId(id) {
|
|
|
5082
5156
|
}
|
|
5083
5157
|
function isClientEnvironment(context, loadOptions) {
|
|
5084
5158
|
const environment = context.environment;
|
|
5085
|
-
if (_optionalChain([environment, 'optionalAccess',
|
|
5086
|
-
if (_optionalChain([environment, 'optionalAccess',
|
|
5087
|
-
return _optionalChain([loadOptions, 'optionalAccess',
|
|
5159
|
+
if (_optionalChain([environment, 'optionalAccess', _454 => _454.config, 'optionalAccess', _455 => _455.consumer])) return environment.config.consumer === "client";
|
|
5160
|
+
if (_optionalChain([environment, 'optionalAccess', _456 => _456.name])) return environment.name === "client";
|
|
5161
|
+
return _optionalChain([loadOptions, 'optionalAccess', _457 => _457.ssr]) !== true;
|
|
5088
5162
|
}
|
|
5089
5163
|
function invalidateProgrammaticClientRouteModules(server) {
|
|
5090
|
-
const graph = _optionalChain([server, 'access',
|
|
5164
|
+
const graph = _optionalChain([server, 'access', _458 => _458.environments, 'optionalAccess', _459 => _459.client, 'optionalAccess', _460 => _460.moduleGraph]);
|
|
5091
5165
|
if (!graph) return;
|
|
5092
5166
|
for (const [id, module] of graph.idToModuleMap) {
|
|
5093
5167
|
if (_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id)) graph.invalidateModule(module);
|
|
@@ -5097,19 +5171,19 @@ function generateProgrammaticClientRouteModuleForId(moduleId, root, renderer, cl
|
|
|
5097
5171
|
const parsed = _chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, moduleId);
|
|
5098
5172
|
const routesFile = resolveRealModuleFile(parsed.filePath, root);
|
|
5099
5173
|
watchFile(routesFile);
|
|
5100
|
-
return
|
|
5174
|
+
return _chunkVO65MYJDcjs.generateProgrammaticClientRouteModule.call(void 0, {
|
|
5101
5175
|
kind: parsed.kind,
|
|
5102
5176
|
routePath: parsed.routePath,
|
|
5103
5177
|
routesFile,
|
|
5104
|
-
route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess',
|
|
5105
|
-
|
|
5178
|
+
route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess', _461 => _461.routes, 'access', _462 => _462.get, 'call', _463 => _463(
|
|
5179
|
+
_chunkVO65MYJDcjs.programmaticClientRouteKey.call(void 0, routesFile, parsed.kind, parsed.routePath)
|
|
5106
5180
|
)]),
|
|
5107
5181
|
rendererServer: renderer.server,
|
|
5108
5182
|
toImportSpecifier: (file) => toProgrammaticRouteImportSpecifier(file, root)
|
|
5109
5183
|
});
|
|
5110
5184
|
}
|
|
5111
5185
|
function resolveRealModuleFile(filePath, root) {
|
|
5112
|
-
const resolved = _nullishCoalesce(
|
|
5186
|
+
const resolved = _nullishCoalesce(_chunkVO65MYJDcjs.resolveModuleSourcePath.call(void 0, filePath, root), () => ( filePath));
|
|
5113
5187
|
try {
|
|
5114
5188
|
return _chunkQMNWKQL4cjs.toPosixPath.call(void 0, fs2.realpathSync(resolved));
|
|
5115
5189
|
} catch (e28) {
|
|
@@ -5423,12 +5497,12 @@ async function parseRouteModuleProps(routeModule, input) {
|
|
|
5423
5497
|
}
|
|
5424
5498
|
const schemas = routeModule.__farmRouteSchemas;
|
|
5425
5499
|
const params = parseRouteModuleSchema(
|
|
5426
|
-
_optionalChain([schemas, 'optionalAccess',
|
|
5500
|
+
_optionalChain([schemas, 'optionalAccess', _464 => _464.params]),
|
|
5427
5501
|
input.props.params,
|
|
5428
5502
|
"params",
|
|
5429
5503
|
input.routePath
|
|
5430
5504
|
);
|
|
5431
|
-
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess',
|
|
5505
|
+
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _465 => _465.search]), input.search, "search", input.routePath);
|
|
5432
5506
|
return {
|
|
5433
5507
|
...input.props,
|
|
5434
5508
|
params,
|
|
@@ -5448,12 +5522,12 @@ function parseRouteModuleSchema(schema, value, label, routePath) {
|
|
|
5448
5522
|
}
|
|
5449
5523
|
}
|
|
5450
5524
|
function generateClientCode(integrationProviders = [], documentNavigationMatchers = [], docsSearchClientRuntime = EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME, devtoolsClientRuntime = "", plugins = [], root = process.cwd(), srcDir = "src", publicRuntimeConfig = void 0, docsAdapterReact, renderer = _chunk67MZTLTFcjs.REACT_RENDERER, isolatedHydrationEnabled = false, trailingSlash = false, basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false) {
|
|
5451
|
-
const providerClientCode =
|
|
5525
|
+
const providerClientCode = _chunkDHR2WDSLcjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
5452
5526
|
integrationProviders,
|
|
5453
5527
|
root,
|
|
5454
5528
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
5455
5529
|
);
|
|
5456
|
-
const clientPluginEntry =
|
|
5530
|
+
const clientPluginEntry = _chunkQ4HH5Q6Acjs.generateFarmClientPluginEntryCode.call(void 0,
|
|
5457
5531
|
plugins,
|
|
5458
5532
|
root,
|
|
5459
5533
|
srcDir,
|
|
@@ -5501,7 +5575,7 @@ async function createFarmServerTreePageElement(source, pathname) {
|
|
|
5501
5575
|
return null;
|
|
5502
5576
|
}
|
|
5503
5577
|
}
|
|
5504
|
-
${islandValues ? `${
|
|
5578
|
+
${islandValues ? `${_chunkDHR2WDSLcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
|
|
5505
5579
|
let farmLastRouteState = null;
|
|
5506
5580
|
|
|
5507
5581
|
// A hot update to a layout tree's client module renders the route again.
|
|
@@ -6312,7 +6386,7 @@ async function loadLayoutComponents(layouts = [], params = {}, source) {
|
|
|
6312
6386
|
return loadedLayouts;
|
|
6313
6387
|
}
|
|
6314
6388
|
|
|
6315
|
-
${
|
|
6389
|
+
${_chunkDHR2WDSLcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
6316
6390
|
function wrapWithLoadedLayouts(element, loadedLayouts, params) {
|
|
6317
6391
|
let wrapped = element;
|
|
6318
6392
|
for (let index = loadedLayouts.length - 1; index >= 0; index--) {
|
|
@@ -6597,7 +6671,7 @@ function readActiveLayoutPatterns() {
|
|
|
6597
6671
|
.filter(Boolean);
|
|
6598
6672
|
}
|
|
6599
6673
|
|
|
6600
|
-
${
|
|
6674
|
+
${_chunkDHR2WDSLcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
|
|
6601
6675
|
|
|
6602
6676
|
function activateFragmentScripts(root) {
|
|
6603
6677
|
for (const script of Array.from(root.querySelectorAll?.('script') || [])) {
|
|
@@ -6656,7 +6730,7 @@ function getLayoutShell(root, patterns, index, find) {
|
|
|
6656
6730
|
return shell.innerHTML;
|
|
6657
6731
|
}
|
|
6658
6732
|
|
|
6659
|
-
${islandValues ?
|
|
6733
|
+
${islandValues ? _chunkDHR2WDSLcjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceNavigationBoundary(
|
|
6660
6734
|
container,
|
|
6661
6735
|
fragment,
|
|
6662
6736
|
currentPatterns,
|
|
@@ -6729,7 +6803,7 @@ ${islandValues ? `
|
|
|
6729
6803
|
return nextTarget;
|
|
6730
6804
|
}
|
|
6731
6805
|
|
|
6732
|
-
${islandValues ? `${
|
|
6806
|
+
${islandValues ? `${_chunkDHR2WDSLcjs.FARM_NAVIGATION_STREAM_READER_SOURCE}
|
|
6733
6807
|
|
|
6734
6808
|
// Islands mode navigates as the production client does: it fetches the page itself, names the
|
|
6735
6809
|
// layouts it shows by key (F-Layouts), and asks for flush markers (F-Stream), so the shell arrives
|
|
@@ -7424,9 +7498,9 @@ function generateClientManifest(bundle) {
|
|
|
7424
7498
|
return manifest;
|
|
7425
7499
|
}
|
|
7426
7500
|
async function defineConfig(config = {}) {
|
|
7427
|
-
const tailwindVitePlugin = await
|
|
7501
|
+
const tailwindVitePlugin = await _chunkQ4HH5Q6Acjs.loadTailwindVitePlugin.call(void 0, );
|
|
7428
7502
|
const appRoot = path6.resolve(config.root || process.cwd());
|
|
7429
|
-
if (_optionalChain([config, 'access',
|
|
7503
|
+
if (_optionalChain([config, 'access', _466 => _466.extends, 'optionalAccess', _467 => _467.length])) {
|
|
7430
7504
|
const { config: layeredConfig } = await import("./layers-7P4RLKVX.cjs").then(
|
|
7431
7505
|
({ resolveFarmLayers }) => resolveFarmLayers(config, {
|
|
7432
7506
|
root: appRoot,
|
|
@@ -7436,7 +7510,7 @@ async function defineConfig(config = {}) {
|
|
|
7436
7510
|
config = layeredConfig;
|
|
7437
7511
|
}
|
|
7438
7512
|
config.renderer = _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, config.renderer);
|
|
7439
|
-
config.images =
|
|
7513
|
+
config.images = _chunkDHR2WDSLcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, { root: appRoot, dev: true });
|
|
7440
7514
|
const rendererVitePlugins = await _chunk67MZTLTFcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, appRoot, {
|
|
7441
7515
|
ssr: true
|
|
7442
7516
|
});
|
|
@@ -7528,13 +7602,13 @@ async function defineConfig(config = {}) {
|
|
|
7528
7602
|
if (!serverStarted) {
|
|
7529
7603
|
serverStarted = true;
|
|
7530
7604
|
const elapsed = Date.now() - startTime;
|
|
7531
|
-
const address = _optionalChain([server, 'access',
|
|
7605
|
+
const address = _optionalChain([server, 'access', _468 => _468.httpServer, 'optionalAccess', _469 => _469.address, 'call', _470 => _470()]);
|
|
7532
7606
|
const resolvedPort = typeof address === "object" && address ? address.port : server.config.server.port || port || 3e3;
|
|
7533
7607
|
const hostConfig = server.config.server.host;
|
|
7534
7608
|
const isExposed = hostConfig === true || hostConfig === "0.0.0.0";
|
|
7535
7609
|
console.log("");
|
|
7536
7610
|
console.log(
|
|
7537
|
-
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${
|
|
7611
|
+
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunk22LGTSBAcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
|
|
7538
7612
|
);
|
|
7539
7613
|
console.log("");
|
|
7540
7614
|
console.log(
|
|
@@ -7568,7 +7642,7 @@ async function defineConfig(config = {}) {
|
|
|
7568
7642
|
plugins: [
|
|
7569
7643
|
// `farm dev --desktop`: only the desktop window gets an answer, as in the packaged app.
|
|
7570
7644
|
_chunk65Y5SIBHcjs.farmDesktopDevGuardPlugin.call(void 0, config.basePath),
|
|
7571
|
-
|
|
7645
|
+
_chunkDHR2WDSLcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
7572
7646
|
tailwindVitePlugin,
|
|
7573
7647
|
...rendererVitePlugins,
|
|
7574
7648
|
...reactRefreshPlugins,
|
|
@@ -7576,14 +7650,14 @@ async function defineConfig(config = {}) {
|
|
|
7576
7650
|
farmI18nClientBridgePlugin(),
|
|
7577
7651
|
farmServerOnlyEntriesPlugin(),
|
|
7578
7652
|
farmPlugin(config),
|
|
7579
|
-
|
|
7653
|
+
_chunkVO65MYJDcjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
|
|
7580
7654
|
farmBrandingPlugin
|
|
7581
7655
|
],
|
|
7582
7656
|
customLogger: farmLogger,
|
|
7583
7657
|
clearScreen: false,
|
|
7584
7658
|
optimizeDeps: {
|
|
7585
|
-
...
|
|
7586
|
-
|
|
7659
|
+
..._chunkDHR2WDSLcjs.createFarmClientOptimizeDepsConfig.call(void 0,
|
|
7660
|
+
_chunkDHR2WDSLcjs.createFarmClientOptimizeDepsEntries.call(void 0,
|
|
7587
7661
|
appRoot,
|
|
7588
7662
|
_chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, { ...config, root: appRoot })
|
|
7589
7663
|
),
|
|
@@ -7626,7 +7700,7 @@ async function defineConfig(config = {}) {
|
|
|
7626
7700
|
// Stub out problematic server-only modules during dev mode
|
|
7627
7701
|
alias: {
|
|
7628
7702
|
..._chunkMTBDJ326cjs.getFarmLayerAliases.call(void 0, config.layers),
|
|
7629
|
-
...
|
|
7703
|
+
..._chunkDHR2WDSLcjs.createFarmSourceAlias.call(void 0, appRoot, config.srcDir),
|
|
7630
7704
|
// Nitro internals that should not be resolved in browser
|
|
7631
7705
|
"supports-color": "data:text/javascript,export default false; export const supportsColor = false; export const stdout = false; export const stderr = false;",
|
|
7632
7706
|
"@poppinss/dumper": "data:text/javascript,export default {};",
|