@farm.js/core 0.1.64 → 0.1.66
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/{analyzer-Q3QXC6PD.mjs → analyzer-4UFP4HVP.mjs} +3 -3
- package/dist/analyzer-H7SIX6BJ.cjs +16 -0
- package/dist/{chunk-XVWSDSUM.mjs → chunk-27FPUFWR.mjs} +60 -5
- package/dist/{chunk-JCEFKP5M.mjs → chunk-423SSBYQ.mjs} +6 -0
- package/dist/{chunk-SLYDIHLW.mjs → chunk-435QJNC2.mjs} +2 -2
- package/dist/{chunk-XZLZ6YPP.cjs → chunk-4OSOLDPL.cjs} +118 -50
- package/dist/{chunk-MG356ROI.cjs → chunk-4TVPYN32.cjs} +3 -3
- package/dist/chunk-672ISQIG.mjs +3704 -0
- package/dist/{chunk-NXFA7G3Y.cjs → chunk-752IHQTD.cjs} +4 -4
- package/dist/chunk-7ONGIFYX.cjs +3704 -0
- package/dist/{chunk-RAH5MT53.mjs → chunk-AZUUKA66.mjs} +153 -42
- package/dist/{chunk-O2XFIPNL.cjs → chunk-BIF5MLTH.cjs} +1 -1
- package/dist/{chunk-FH45OB37.mjs → chunk-BYRZ5VTH.mjs} +1 -1
- package/dist/{chunk-V727H3RI.cjs → chunk-CCAUIBIS.cjs} +6 -0
- package/dist/{chunk-DUSHDZQL.cjs → chunk-CHYTADNK.cjs} +15 -13
- package/dist/chunk-CJNAUEVC.mjs +34 -0
- package/dist/{chunk-S25BQIFW.cjs → chunk-DVKH2RVN.cjs} +2 -2
- package/dist/{chunk-FAP7CX7C.cjs → chunk-E4UDLFWR.cjs} +527 -3019
- package/dist/{chunk-EFZGB7JC.cjs → chunk-E5UN4OWX.cjs} +1 -0
- package/dist/{chunk-WNYRYI4D.mjs → chunk-EMNKZGF4.mjs} +380 -2872
- package/dist/{chunk-VVTJTMGQ.cjs → chunk-GL7N5UHF.cjs} +4 -4
- package/dist/{chunk-UR25Z5Z6.mjs → chunk-HCGWDRZO.mjs} +1 -1
- package/dist/{chunk-EL4364S2.cjs → chunk-HZPKJRYA.cjs} +74 -19
- package/dist/{chunk-3EBHJET2.cjs → chunk-IT6WRNGB.cjs} +380 -269
- package/dist/{chunk-LQDLEWPO.mjs → chunk-MPIGW42F.mjs} +1 -1
- package/dist/{chunk-S7ZW72JH.cjs → chunk-MPJEIHW2.cjs} +2 -2
- package/dist/{chunk-53ZCZ46B.cjs → chunk-NHQM2Q4I.cjs} +2 -1
- package/dist/{chunk-UYRI6U3P.mjs → chunk-O75GQVUK.mjs} +2 -1
- package/dist/{chunk-OYF23QLG.mjs → chunk-OB7VKCUZ.mjs} +38 -33
- package/dist/{chunk-JCPSA4X5.cjs → chunk-OP7LHY4Y.cjs} +128 -123
- package/dist/{chunk-O7IEMY55.cjs → chunk-RY4ABNPE.cjs} +3 -3
- package/dist/{chunk-6NHSGVVA.mjs → chunk-SK7QSNWE.mjs} +1 -1
- package/dist/{chunk-NNLFW3P4.mjs → chunk-TKK5QHKZ.mjs} +1 -1
- package/dist/{chunk-ZNXTU4YH.mjs → chunk-TM2E623I.mjs} +1 -0
- package/dist/{chunk-PAKCHVUS.mjs → chunk-TPA2PV5J.mjs} +3 -35
- package/dist/{chunk-6NNYPY5W.mjs → chunk-UBMHQVWN.mjs} +78 -10
- package/dist/{chunk-BPNOYILC.cjs → chunk-UVV3I5QA.cjs} +3 -35
- package/dist/{chunk-N3Z3PLHC.cjs → chunk-VBCQ5WOI.cjs} +6 -6
- package/dist/{chunk-WFNAOWH4.mjs → chunk-WFWFECDW.mjs} +2 -2
- package/dist/{chunk-SNFTMSHX.mjs → chunk-WVYRLP5E.mjs} +1 -1
- package/dist/{chunk-O4FWNLQK.mjs → chunk-XBSLKXBL.mjs} +10 -8
- package/dist/chunk-ZIHWAN55.cjs +34 -0
- package/dist/{devtools-WET5NAKO.cjs → devtools-N2JQCMXB.cjs} +5 -4
- package/dist/{devtools-MX3FE733.mjs → devtools-NZUVNUP3.mjs} +4 -3
- package/dist/docs.cjs +6 -5
- package/dist/docs.mjs +5 -4
- package/dist/environment/vite.cjs +9 -2
- package/dist/environment/vite.d.mts +3 -0
- package/dist/environment/vite.d.ts +3 -0
- package/dist/environment/vite.mjs +8 -1
- package/dist/index.cjs +22 -21
- package/dist/index.mjs +21 -20
- package/dist/internal/build-runtime.cjs +20 -19
- package/dist/internal/build-runtime.mjs +19 -18
- package/dist/internal/cli-runtime.cjs +6 -5
- package/dist/internal/cli-runtime.mjs +5 -4
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/config-runtime.cjs +6 -5
- package/dist/internal/config-runtime.mjs +5 -4
- package/dist/internal/infra-analytics-runtime.cjs +6 -6
- package/dist/internal/infra-analytics-runtime.mjs +4 -4
- package/dist/internal/native-server-fns.cjs +5 -5
- package/dist/internal/native-server-fns.mjs +4 -4
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-runtime.cjs +7 -7
- package/dist/internal/production-runtime.d.mts +14 -0
- package/dist/internal/production-runtime.d.ts +14 -0
- package/dist/internal/production-runtime.mjs +6 -6
- package/dist/{native-tree-WOX3JMBG.cjs → native-tree-7LPH57Z4.cjs} +3 -3
- package/dist/{native-tree-BPEE2LAL.mjs → native-tree-VV6WN3GX.mjs} +2 -2
- package/dist/plugin.cjs +11 -10
- package/dist/plugin.mjs +10 -9
- package/dist/{port-UFUZL6RI.mjs → port-CLL4BC4O.mjs} +1 -1
- package/dist/{port-VTLHPZOI.cjs → port-HASZTQGY.cjs} +9 -9
- package/dist/{rsc-pipeline-3LNVP2OO.mjs → rsc-pipeline-7PNVJSTR.mjs} +6 -5
- package/dist/{rsc-pipeline-G5WELVW3.cjs → rsc-pipeline-Z7QBZOIJ.cjs} +7 -6
- package/dist/{runtime-DMEULPE7.cjs → runtime-FKFCUHSK.cjs} +21 -20
- package/dist/{runtime-HQJ2LLQL.mjs → runtime-QQHX4BP3.mjs} +12 -11
- package/dist/server.cjs +36 -35
- package/dist/server.mjs +19 -18
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +14 -12
- package/dist/vite.mjs +13 -11
- package/package.json +1 -1
- package/dist/analyzer-ODLF2Z6O.cjs +0 -16
- package/dist/chunk-NK2VWS7P.cjs +0 -954
- package/dist/chunk-ZQ5BDNKW.mjs +0 -954
|
@@ -28,34 +28,36 @@ var _chunk5IQ2ERQAcjs = require('./chunk-5IQ2ERQA.cjs');
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
|
+
var _chunkE4UDLFWRcjs = require('./chunk-E4UDLFWR.cjs');
|
|
31
32
|
|
|
32
33
|
|
|
34
|
+
var _chunkR53QDV6Tcjs = require('./chunk-R53QDV6T.cjs');
|
|
33
35
|
|
|
34
36
|
|
|
37
|
+
var _chunk3EEET2Q5cjs = require('./chunk-3EEET2Q5.cjs');
|
|
35
38
|
|
|
36
39
|
|
|
40
|
+
var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
37
41
|
|
|
38
42
|
|
|
39
43
|
|
|
44
|
+
var _chunkX4K7TYN6cjs = require('./chunk-X4K7TYN6.cjs');
|
|
40
45
|
|
|
41
46
|
|
|
42
47
|
|
|
43
48
|
|
|
44
49
|
|
|
45
|
-
var _chunkFAP7CX7Ccjs = require('./chunk-FAP7CX7C.cjs');
|
|
46
50
|
|
|
47
51
|
|
|
48
|
-
var _chunkR53QDV6Tcjs = require('./chunk-R53QDV6T.cjs');
|
|
49
52
|
|
|
50
53
|
|
|
51
|
-
var _chunk3EEET2Q5cjs = require('./chunk-3EEET2Q5.cjs');
|
|
52
54
|
|
|
55
|
+
var _chunkUJ3R2AH2cjs = require('./chunk-UJ3R2AH2.cjs');
|
|
53
56
|
|
|
54
|
-
var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
55
57
|
|
|
58
|
+
var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
|
|
56
59
|
|
|
57
60
|
|
|
58
|
-
var _chunkX4K7TYN6cjs = require('./chunk-X4K7TYN6.cjs');
|
|
59
61
|
|
|
60
62
|
|
|
61
63
|
|
|
@@ -66,39 +68,37 @@ var _chunkX4K7TYN6cjs = require('./chunk-X4K7TYN6.cjs');
|
|
|
66
68
|
|
|
67
69
|
|
|
68
70
|
|
|
69
|
-
var _chunkUJ3R2AH2cjs = require('./chunk-UJ3R2AH2.cjs');
|
|
70
71
|
|
|
71
72
|
|
|
72
|
-
var
|
|
73
|
+
var _chunk752IHQTDcjs = require('./chunk-752IHQTD.cjs');
|
|
73
74
|
|
|
74
75
|
|
|
76
|
+
var _chunkY5TOT5F6cjs = require('./chunk-Y5TOT5F6.cjs');
|
|
75
77
|
|
|
76
78
|
|
|
79
|
+
var _chunkMPJEIHW2cjs = require('./chunk-MPJEIHW2.cjs');
|
|
77
80
|
|
|
78
81
|
|
|
79
82
|
|
|
80
83
|
|
|
84
|
+
var _chunkPIUTGRDIcjs = require('./chunk-PIUTGRDI.cjs');
|
|
81
85
|
|
|
82
86
|
|
|
87
|
+
var _chunk7EPYN7GWcjs = require('./chunk-7EPYN7GW.cjs');
|
|
83
88
|
|
|
84
89
|
|
|
85
90
|
|
|
86
91
|
|
|
87
|
-
var _chunkNXFA7G3Ycjs = require('./chunk-NXFA7G3Y.cjs');
|
|
88
92
|
|
|
89
93
|
|
|
90
|
-
var _chunkY5TOT5F6cjs = require('./chunk-Y5TOT5F6.cjs');
|
|
91
94
|
|
|
92
95
|
|
|
93
|
-
var _chunkS7ZW72JHcjs = require('./chunk-S7ZW72JH.cjs');
|
|
94
96
|
|
|
95
97
|
|
|
96
98
|
|
|
97
99
|
|
|
98
|
-
var _chunkPIUTGRDIcjs = require('./chunk-PIUTGRDI.cjs');
|
|
99
100
|
|
|
100
101
|
|
|
101
|
-
var _chunk7EPYN7GWcjs = require('./chunk-7EPYN7GW.cjs');
|
|
102
102
|
|
|
103
103
|
|
|
104
104
|
|
|
@@ -106,7 +106,11 @@ var _chunk7EPYN7GWcjs = require('./chunk-7EPYN7GW.cjs');
|
|
|
106
106
|
|
|
107
107
|
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
var _chunk7ONGIFYXcjs = require('./chunk-7ONGIFYX.cjs');
|
|
110
114
|
|
|
111
115
|
|
|
112
116
|
|
|
@@ -117,8 +121,7 @@ var _chunkSM2SYWARcjs = require('./chunk-SM2SYWAR.cjs');
|
|
|
117
121
|
var _chunkERMUL73Lcjs = require('./chunk-ERMUL73L.cjs');
|
|
118
122
|
|
|
119
123
|
|
|
120
|
-
|
|
121
|
-
var _chunkBPNOYILCcjs = require('./chunk-BPNOYILC.cjs');
|
|
124
|
+
var _chunkUVV3I5QAcjs = require('./chunk-UVV3I5QA.cjs');
|
|
122
125
|
|
|
123
126
|
|
|
124
127
|
|
|
@@ -128,24 +131,27 @@ var _chunkSTF6VDYQcjs = require('./chunk-STF6VDYQ.cjs');
|
|
|
128
131
|
|
|
129
132
|
|
|
130
133
|
|
|
134
|
+
var _chunkO6L3YYPMcjs = require('./chunk-O6L3YYPM.cjs');
|
|
131
135
|
|
|
132
136
|
|
|
137
|
+
var _chunkFJWN7RV4cjs = require('./chunk-FJWN7RV4.cjs');
|
|
133
138
|
|
|
134
139
|
|
|
135
|
-
var
|
|
140
|
+
var _chunkZIHWAN55cjs = require('./chunk-ZIHWAN55.cjs');
|
|
136
141
|
|
|
137
142
|
|
|
138
143
|
|
|
139
144
|
|
|
140
|
-
var
|
|
145
|
+
var _chunk5Y2P454Ocjs = require('./chunk-5Y2P454O.cjs');
|
|
146
|
+
|
|
141
147
|
|
|
142
148
|
|
|
143
|
-
var _chunkFJWN7RV4cjs = require('./chunk-FJWN7RV4.cjs');
|
|
144
149
|
|
|
145
150
|
|
|
146
151
|
|
|
147
152
|
|
|
148
|
-
|
|
153
|
+
|
|
154
|
+
var _chunkRD623KW4cjs = require('./chunk-RD623KW4.cjs');
|
|
149
155
|
|
|
150
156
|
|
|
151
157
|
|
|
@@ -257,7 +263,7 @@ var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
|
|
|
257
263
|
var _chunkCFG4QERRcjs = require('./chunk-CFG4QERR.cjs');
|
|
258
264
|
|
|
259
265
|
|
|
260
|
-
var
|
|
266
|
+
var _chunkBIF5MLTHcjs = require('./chunk-BIF5MLTH.cjs');
|
|
261
267
|
|
|
262
268
|
|
|
263
269
|
var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
|
|
@@ -880,7 +886,7 @@ function loadFarmWorkflowsDevRuntime() {
|
|
|
880
886
|
return import("./workflows.cjs");
|
|
881
887
|
}
|
|
882
888
|
function loadFarmDevtoolsSnapshotRuntime() {
|
|
883
|
-
return import("./devtools-
|
|
889
|
+
return import("./devtools-N2JQCMXB.cjs");
|
|
884
890
|
}
|
|
885
891
|
function loadFarmDevtoolsUIRuntime() {
|
|
886
892
|
return import("./devtools-ui-SYRUXUA7.cjs");
|
|
@@ -923,11 +929,17 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
923
929
|
return {
|
|
924
930
|
name: "farm:server-only-entries",
|
|
925
931
|
enforce: "pre",
|
|
926
|
-
config() {
|
|
932
|
+
config(config) {
|
|
927
933
|
return {
|
|
928
|
-
optimizeDeps: { rolldownOptions: { plugins: [
|
|
929
|
-
|
|
930
|
-
|
|
934
|
+
optimizeDeps: { rolldownOptions: { plugins: [_chunk7ONGIFYXcjs.farmBrowserBuiltinsOptimizerPlugin.call(void 0, )] } },
|
|
935
|
+
ssr: {
|
|
936
|
+
noExternal: [
|
|
937
|
+
// Resolve `server-only` here rather than in Node, which would load its throwing build.
|
|
938
|
+
SERVER_ONLY_PACKAGE,
|
|
939
|
+
// Packages Node cannot load as a bundler does (stylesheet imports, `module`-only ESM).
|
|
940
|
+
..._chunk7ONGIFYXcjs.collectFarmServerBundledPackages.call(void 0, path6.resolve(_nullishCoalesce(config.root, () => ( process.cwd()))))
|
|
941
|
+
]
|
|
942
|
+
}
|
|
931
943
|
};
|
|
932
944
|
},
|
|
933
945
|
configResolved(config) {
|
|
@@ -944,7 +956,7 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
944
956
|
);
|
|
945
957
|
}
|
|
946
958
|
if (!_optionalChain([options2, 'optionalAccess', _63 => _63.ssr]) && _module.isBuiltin.call(void 0, id)) {
|
|
947
|
-
return
|
|
959
|
+
return _chunk7ONGIFYXcjs.resolveFarmBrowserBuiltin.call(void 0, this, id, importer, options2);
|
|
948
960
|
}
|
|
949
961
|
if (!FARM_SERVER_ONLY_ENTRIES.has(id)) return null;
|
|
950
962
|
const importedBy = importer ? ` (imported by ${importer})` : "";
|
|
@@ -966,7 +978,7 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
966
978
|
if (id === FARM_PLATFORM_CLIENT_ID) {
|
|
967
979
|
return createFarmPlatformClientModule(_nullishCoalesce(options.platform, () => ( _chunkAQLHD6HZcjs.resolveFarmPlatform.call(void 0, ))));
|
|
968
980
|
}
|
|
969
|
-
return _nullishCoalesce(
|
|
981
|
+
return _nullishCoalesce(_chunk7ONGIFYXcjs.loadFarmBrowserBuiltin.call(void 0, id), () => ( null));
|
|
970
982
|
}
|
|
971
983
|
};
|
|
972
984
|
}
|
|
@@ -1157,23 +1169,86 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1157
1169
|
const contentType = typeof contentTypeHeader === "string" ? contentTypeHeader : "";
|
|
1158
1170
|
return contentType.includes("text/html") ? bufferPluginResponse : Boolean(runtimeSession && hasRuntimeAfterHook);
|
|
1159
1171
|
};
|
|
1172
|
+
let runtimeStream;
|
|
1173
|
+
const streamsThroughRuntime = () => {
|
|
1174
|
+
if (runtimeStream) return true;
|
|
1175
|
+
if (!runtimeSession || !hasRuntimeAfterHook) return false;
|
|
1176
|
+
if (!hasHTMLTransformHook) return true;
|
|
1177
|
+
const contentTypeHeader = res.getHeader("content-type") || res.getHeader("Content-Type");
|
|
1178
|
+
return !(typeof contentTypeHeader === "string" && contentTypeHeader.includes("text/html"));
|
|
1179
|
+
};
|
|
1180
|
+
const startRuntimeStream = () => {
|
|
1181
|
+
if (runtimeStream) return runtimeStream;
|
|
1182
|
+
let controller;
|
|
1183
|
+
const body = new ReadableStream({
|
|
1184
|
+
start(streamController) {
|
|
1185
|
+
controller = streamController;
|
|
1186
|
+
}
|
|
1187
|
+
});
|
|
1188
|
+
const status = res.statusCode || 200;
|
|
1189
|
+
const canHaveBody = method !== "HEAD" && status !== 204 && status !== 205 && status !== 304;
|
|
1190
|
+
pm.copyRequestContext(req, runtimeSession.request);
|
|
1191
|
+
const done = pm.endRuntimeRequest(
|
|
1192
|
+
runtimeSession,
|
|
1193
|
+
new Response(canHaveBody ? body : null, {
|
|
1194
|
+
status,
|
|
1195
|
+
headers: createHeadersFromNodeResponse(res)
|
|
1196
|
+
})
|
|
1197
|
+
).then(async (runtimeResponse) => {
|
|
1198
|
+
applyWebResponseToNodeResponse(runtimeResponse, res);
|
|
1199
|
+
if (!res.headersSent) originalWriteHead(res.statusCode);
|
|
1200
|
+
_optionalChain([originalFlushHeaders, 'optionalCall', _72 => _72()]);
|
|
1201
|
+
if (!runtimeResponse.body) return;
|
|
1202
|
+
const reader = runtimeResponse.body.getReader();
|
|
1203
|
+
for (; ; ) {
|
|
1204
|
+
const chunk = await reader.read();
|
|
1205
|
+
if (chunk.done) break;
|
|
1206
|
+
originalWrite(chunk.value);
|
|
1207
|
+
if (typeof res.flush === "function") res.flush();
|
|
1208
|
+
}
|
|
1209
|
+
});
|
|
1210
|
+
done.catch(() => {
|
|
1211
|
+
});
|
|
1212
|
+
runtimeStream = { controller, done };
|
|
1213
|
+
return runtimeStream;
|
|
1214
|
+
};
|
|
1215
|
+
const streamRuntimeChunk = (chunk) => {
|
|
1216
|
+
const stream = startRuntimeStream();
|
|
1217
|
+
if (!chunk || chunk.byteLength === 0) return;
|
|
1218
|
+
try {
|
|
1219
|
+
stream.controller.enqueue(new Uint8Array(chunk));
|
|
1220
|
+
} catch (e9) {
|
|
1221
|
+
}
|
|
1222
|
+
};
|
|
1160
1223
|
res.writeHead = ((statusCode, ...args) => {
|
|
1161
1224
|
const statusMessage = typeof args[0] === "string" ? args[0] : void 0;
|
|
1162
1225
|
const headers = statusMessage === void 0 ? args[0] : args[1];
|
|
1163
1226
|
res.statusCode = statusCode;
|
|
1164
1227
|
if (statusMessage !== void 0) res.statusMessage = statusMessage;
|
|
1165
1228
|
applyNodeWriteHeadHeaders(res, headers);
|
|
1166
|
-
if (shouldBufferCurrentResponse()) return res;
|
|
1229
|
+
if (streamsThroughRuntime() || shouldBufferCurrentResponse()) return res;
|
|
1167
1230
|
return statusMessage === void 0 ? originalWriteHead(statusCode) : originalWriteHead(statusCode, statusMessage);
|
|
1168
1231
|
});
|
|
1169
1232
|
if (originalFlushHeaders) {
|
|
1170
|
-
res.flushHeaders = (() =>
|
|
1233
|
+
res.flushHeaders = (() => {
|
|
1234
|
+
if (streamsThroughRuntime()) {
|
|
1235
|
+
startRuntimeStream();
|
|
1236
|
+
return void 0;
|
|
1237
|
+
}
|
|
1238
|
+
return shouldBufferCurrentResponse() ? void 0 : originalFlushHeaders();
|
|
1239
|
+
});
|
|
1171
1240
|
}
|
|
1172
1241
|
res.write = ((chunk, ...args) => {
|
|
1173
1242
|
const contentTypeHeader = res.getHeader("content-type") || res.getHeader("Content-Type");
|
|
1174
1243
|
const contentType = typeof contentTypeHeader === "string" ? contentTypeHeader : "";
|
|
1175
1244
|
const isHtmlResponse = contentType.includes("text/html");
|
|
1176
1245
|
const bufferChunk = toNodeResponseBuffer(chunk, args[0]);
|
|
1246
|
+
if (streamsThroughRuntime()) {
|
|
1247
|
+
streamRuntimeChunk(bufferChunk);
|
|
1248
|
+
const callback = args.find((arg) => typeof arg === "function");
|
|
1249
|
+
_optionalChain([callback, 'optionalCall', _73 => _73()]);
|
|
1250
|
+
return true;
|
|
1251
|
+
}
|
|
1177
1252
|
if (isHtmlResponse && bufferChunk) {
|
|
1178
1253
|
htmlChunks.push(bufferChunk);
|
|
1179
1254
|
didStreamHtml = true;
|
|
@@ -1183,7 +1258,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1183
1258
|
const shouldBufferResponse = isHtmlResponse ? bufferPluginResponse : Boolean(runtimeSession && hasRuntimeAfterHook);
|
|
1184
1259
|
if (shouldBufferResponse) {
|
|
1185
1260
|
const callback = args.find((arg) => typeof arg === "function");
|
|
1186
|
-
_optionalChain([callback, 'optionalCall',
|
|
1261
|
+
_optionalChain([callback, 'optionalCall', _74 => _74()]);
|
|
1187
1262
|
return true;
|
|
1188
1263
|
}
|
|
1189
1264
|
const writeResult = originalWrite(chunk, ...args);
|
|
@@ -1198,6 +1273,39 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1198
1273
|
options.logResponse(method, urlPath, res.statusCode || 200, Date.now() - startTime, "PAGE");
|
|
1199
1274
|
const originalEndArgs = [...args];
|
|
1200
1275
|
const callback = typeof originalEndArgs[originalEndArgs.length - 1] === "function" ? originalEndArgs[originalEndArgs.length - 1] : void 0;
|
|
1276
|
+
const restore = () => {
|
|
1277
|
+
res.write = originalWrite;
|
|
1278
|
+
res.end = originalEnd;
|
|
1279
|
+
res.writeHead = originalWriteHead;
|
|
1280
|
+
if (originalFlushHeaders) res.flushHeaders = originalFlushHeaders;
|
|
1281
|
+
delete res[_chunk3EEET2Q5cjs.FARM_NODE_RESPONSE_END_PENDING];
|
|
1282
|
+
};
|
|
1283
|
+
if (streamsThroughRuntime()) {
|
|
1284
|
+
const stream = startRuntimeStream();
|
|
1285
|
+
streamRuntimeChunk(toNodeResponseBuffer(args[0], args[1]));
|
|
1286
|
+
try {
|
|
1287
|
+
stream.controller.close();
|
|
1288
|
+
} catch (e10) {
|
|
1289
|
+
}
|
|
1290
|
+
stream.done.then(
|
|
1291
|
+
() => hasAfterResponseHook ? pm.runHookParallel("afterResponse", req, res) : void 0
|
|
1292
|
+
).catch((error) => {
|
|
1293
|
+
void options.emitError(error);
|
|
1294
|
+
console.error("Error in afterResponse hook:", error);
|
|
1295
|
+
if (!res.headersSent) {
|
|
1296
|
+
res.statusCode = 500;
|
|
1297
|
+
res.removeHeader("Content-Length");
|
|
1298
|
+
res.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
1299
|
+
originalWriteHead(500);
|
|
1300
|
+
originalWrite("Internal Server Error");
|
|
1301
|
+
}
|
|
1302
|
+
}).finally(() => {
|
|
1303
|
+
restore();
|
|
1304
|
+
if (callback) originalEnd(callback);
|
|
1305
|
+
else originalEnd();
|
|
1306
|
+
});
|
|
1307
|
+
return res;
|
|
1308
|
+
}
|
|
1201
1309
|
const contentTypeHeader = res.getHeader("content-type") || res.getHeader("Content-Type");
|
|
1202
1310
|
const contentType = typeof contentTypeHeader === "string" ? contentTypeHeader : "";
|
|
1203
1311
|
const isHtmlResponse = contentType.includes("text/html");
|
|
@@ -1296,13 +1404,13 @@ function getEnvDefines(config, configEnv) {
|
|
|
1296
1404
|
_chunkHEPJIKKQcjs.getPublicFarmImageConfig.call(void 0, _chunkHEPJIKKQcjs.resolveFarmImageConfig.call(void 0, config.images))
|
|
1297
1405
|
)
|
|
1298
1406
|
};
|
|
1299
|
-
if (_optionalChain([configEnv, 'optionalAccess',
|
|
1407
|
+
if (_optionalChain([configEnv, 'optionalAccess', _75 => _75.isSsrBuild])) {
|
|
1300
1408
|
defines.__FARM_ENV__ = JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, getFullEnvDefine(config)));
|
|
1301
1409
|
}
|
|
1302
1410
|
return defines;
|
|
1303
1411
|
}
|
|
1304
1412
|
function getFarmAPIBaseURLDefine(config) {
|
|
1305
|
-
const baseURL = _optionalChain([config, 'access',
|
|
1413
|
+
const baseURL = _optionalChain([config, 'access', _76 => _76.api, 'optionalAccess', _77 => _77.baseURL]);
|
|
1306
1414
|
return typeof baseURL === "string" && baseURL ? baseURL : _chunkPMJSG4JScjs.DEFAULT_FARM_API_BASE_PATH;
|
|
1307
1415
|
}
|
|
1308
1416
|
function isResolvedEnvScope(value) {
|
|
@@ -1322,7 +1430,7 @@ function fileContainsProgrammaticPageRoute(file) {
|
|
|
1322
1430
|
}
|
|
1323
1431
|
try {
|
|
1324
1432
|
return _chunkE7QOEV5Zcjs.scanProgrammaticPagePaths.call(void 0, fs2.readFileSync(file, "utf8")).length > 0;
|
|
1325
|
-
} catch (
|
|
1433
|
+
} catch (e11) {
|
|
1326
1434
|
return false;
|
|
1327
1435
|
}
|
|
1328
1436
|
}
|
|
@@ -1335,7 +1443,7 @@ function rewriteEarlySsrRelativeImports(options) {
|
|
|
1335
1443
|
let ast;
|
|
1336
1444
|
try {
|
|
1337
1445
|
ast = options.parse(options.code);
|
|
1338
|
-
} catch (
|
|
1446
|
+
} catch (e12) {
|
|
1339
1447
|
return null;
|
|
1340
1448
|
}
|
|
1341
1449
|
walkModuleAst(ast, (node) => {
|
|
@@ -1374,17 +1482,18 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
1374
1482
|
from: "@farm.js/core/internal/islx-react"
|
|
1375
1483
|
});
|
|
1376
1484
|
if (rewritten) options = { ...options, code: rewritten.code };
|
|
1377
|
-
} catch (
|
|
1485
|
+
} catch (e13) {
|
|
1378
1486
|
return null;
|
|
1379
1487
|
}
|
|
1380
1488
|
}
|
|
1381
1489
|
let ast;
|
|
1382
1490
|
try {
|
|
1383
1491
|
ast = options.parse(options.code);
|
|
1384
|
-
} catch (
|
|
1492
|
+
} catch (e14) {
|
|
1385
1493
|
return null;
|
|
1386
1494
|
}
|
|
1387
1495
|
const body = Array.isArray(ast.body) ? ast.body : [];
|
|
1496
|
+
const everyExportIsComponent = options.code.includes(_chunk7ONGIFYXcjs.FARM_CLIENT_REFERENCE_PRAGMA) || options.moduleReference.includes(_chunk7ONGIFYXcjs.FARM_CLIENT_REFERENCE_DIRECTORY);
|
|
1388
1497
|
const replacements = [];
|
|
1389
1498
|
const wrapperStatements = [];
|
|
1390
1499
|
const originalEntries = [];
|
|
@@ -1403,9 +1512,9 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
1403
1512
|
transformedExports++;
|
|
1404
1513
|
};
|
|
1405
1514
|
for (const node of body) {
|
|
1406
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
1515
|
+
if (_optionalChain([node, 'optionalAccess', _78 => _78.type]) === "ExportDefaultDeclaration" && node.declaration) {
|
|
1407
1516
|
const declaration2 = node.declaration;
|
|
1408
|
-
if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access',
|
|
1517
|
+
if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access', _79 => _79.id, 'optionalAccess', _80 => _80.name])) {
|
|
1409
1518
|
replacements.push({
|
|
1410
1519
|
start: node.start,
|
|
1411
1520
|
end: node.end,
|
|
@@ -1423,14 +1532,14 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
1423
1532
|
}
|
|
1424
1533
|
continue;
|
|
1425
1534
|
}
|
|
1426
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
1535
|
+
if (_optionalChain([node, 'optionalAccess', _81 => _81.type]) === "ExportNamedDeclaration" && !node.declaration && node.exportKind !== "type") {
|
|
1427
1536
|
const specifiers = (node.specifiers || []).filter(
|
|
1428
1537
|
(specifier) => specifier.type === "ExportSpecifier" && specifier.exportKind !== "type"
|
|
1429
1538
|
);
|
|
1430
|
-
const specifierName = (name) => _nullishCoalesce(_optionalChain([name, 'optionalAccess',
|
|
1539
|
+
const specifierName = (name) => _nullishCoalesce(_optionalChain([name, 'optionalAccess', _82 => _82.name]), () => ( String(_nullishCoalesce(_optionalChain([name, 'optionalAccess', _83 => _83.value]), () => ( "")))));
|
|
1431
1540
|
const isComponentExport = (specifier) => {
|
|
1432
1541
|
const exported = specifierName(specifier.exported);
|
|
1433
|
-
return exported === "default" || /^[A-Z]/.test(exported);
|
|
1542
|
+
return everyExportIsComponent || exported === "default" || /^[A-Z]/.test(exported);
|
|
1434
1543
|
};
|
|
1435
1544
|
if (!specifiers.some(isComponentExport)) continue;
|
|
1436
1545
|
const imports = [];
|
|
@@ -1454,14 +1563,14 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
1454
1563
|
if (kept.length > 0) wrapperStatements.push(`export { ${kept.join(", ")} };`);
|
|
1455
1564
|
continue;
|
|
1456
1565
|
}
|
|
1457
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
1566
|
+
if (_optionalChain([node, 'optionalAccess', _84 => _84.type]) !== "ExportNamedDeclaration" || !node.declaration) continue;
|
|
1458
1567
|
const declaration = node.declaration;
|
|
1459
1568
|
const declaredNames = [];
|
|
1460
|
-
if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access',
|
|
1569
|
+
if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access', _85 => _85.id, 'optionalAccess', _86 => _86.name])) {
|
|
1461
1570
|
declaredNames.push(declaration.id.name);
|
|
1462
1571
|
} else if (declaration.type === "VariableDeclaration") {
|
|
1463
1572
|
for (const declarator of declaration.declarations || []) {
|
|
1464
|
-
if (_optionalChain([declarator, 'access',
|
|
1573
|
+
if (_optionalChain([declarator, 'access', _87 => _87.id, 'optionalAccess', _88 => _88.type]) === "Identifier") declaredNames.push(declarator.id.name);
|
|
1465
1574
|
}
|
|
1466
1575
|
}
|
|
1467
1576
|
const componentNames = declaredNames.filter((name) => /^[A-Z]/.test(name));
|
|
@@ -1522,10 +1631,10 @@ function warnClientBoundaryOnce(context, id, code, config) {
|
|
|
1522
1631
|
let program;
|
|
1523
1632
|
try {
|
|
1524
1633
|
program = context.parse(code);
|
|
1525
|
-
} catch (
|
|
1634
|
+
} catch (e15) {
|
|
1526
1635
|
return;
|
|
1527
1636
|
}
|
|
1528
|
-
const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access',
|
|
1637
|
+
const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access', _89 => _89.env, 'optionalAccess', _90 => _90.public]), () => ( {}))));
|
|
1529
1638
|
const findings = analyzeClientBoundary(program, publicKeys);
|
|
1530
1639
|
if (findings.envKeys.length === 0 && findings.publicEnvKeys.length === 0 && findings.builtinImports.length === 0) {
|
|
1531
1640
|
return;
|
|
@@ -1545,7 +1654,7 @@ function hasViteAlias(alias, find) {
|
|
|
1545
1654
|
}
|
|
1546
1655
|
function farmPlugin(options = {}, initialPluginManager) {
|
|
1547
1656
|
const imageImports = farmImageImportsPlugin();
|
|
1548
|
-
const fontImports =
|
|
1657
|
+
const fontImports = _chunkE4UDLFWRcjs.farmFontImportsPlugin.call(void 0, {
|
|
1549
1658
|
root: options.root,
|
|
1550
1659
|
basePath: options.basePath,
|
|
1551
1660
|
publicDir: options.publicDir
|
|
@@ -1553,8 +1662,8 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1553
1662
|
let farmApp;
|
|
1554
1663
|
let serverFnTransformActive = false;
|
|
1555
1664
|
const islandsServerFns = () => {
|
|
1556
|
-
const config = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
1557
|
-
return _optionalChain([config, 'access',
|
|
1665
|
+
const config = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _91 => _91.getConfig, 'call', _92 => _92()]), () => ( options));
|
|
1666
|
+
return _optionalChain([config, 'access', _93 => _93.experimental, 'optionalAccess', _94 => _94.serverActions]) === true && _chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _95 => _95.experimental, 'optionalAccess', _96 => _96.serverComponents])) === "islands";
|
|
1558
1667
|
};
|
|
1559
1668
|
let reactRefreshActive = false;
|
|
1560
1669
|
let server;
|
|
@@ -1579,14 +1688,14 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1579
1688
|
].join(" ");
|
|
1580
1689
|
console.log(log);
|
|
1581
1690
|
};
|
|
1582
|
-
const getProgrammaticClientRoutes = () => _nullishCoalesce(options.programmaticClientRoutes, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
1691
|
+
const getProgrammaticClientRoutes = () => _nullishCoalesce(options.programmaticClientRoutes, () => ( _optionalChain([farmApp, 'optionalAccess', _97 => _97.getRouteManager, 'call', _98 => _98(), 'access', _99 => _99.getProgrammaticClientRoutes, 'call', _100 => _100()])));
|
|
1583
1692
|
return {
|
|
1584
1693
|
name: "farm",
|
|
1585
1694
|
api: { getProgrammaticClientRoutes },
|
|
1586
1695
|
config(userConfig, configEnv) {
|
|
1587
1696
|
isBuild = configEnv.command === "build";
|
|
1588
1697
|
const layerAliases = _chunk5Y2P454Ocjs.getFarmLayerAliases.call(void 0, options.layers);
|
|
1589
|
-
const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access',
|
|
1698
|
+
const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access', _101 => _101.resolve, 'optionalAccess', _102 => _102.alias]), "@") ? {} : _chunkE4UDLFWRcjs.createFarmSourceAlias.call(void 0, options.root || process.cwd(), options.srcDir);
|
|
1590
1699
|
const layerRoots = (_nullishCoalesce(options.layers, () => ( []))).map((layer) => layer.root);
|
|
1591
1700
|
return {
|
|
1592
1701
|
// Honor Farm's publicDir so the dev server serves the same static
|
|
@@ -1602,7 +1711,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1602
1711
|
server: {
|
|
1603
1712
|
fs: {
|
|
1604
1713
|
...layerRoots.length ? { allow: [path6.resolve(options.root || process.cwd()), ...layerRoots] } : {},
|
|
1605
|
-
deny: getFarmDevFsDeny(_optionalChain([userConfig, 'access',
|
|
1714
|
+
deny: getFarmDevFsDeny(_optionalChain([userConfig, 'access', _103 => _103.server, 'optionalAccess', _104 => _104.fs, 'optionalAccess', _105 => _105.deny]), options)
|
|
1606
1715
|
}
|
|
1607
1716
|
}
|
|
1608
1717
|
};
|
|
@@ -1615,7 +1724,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1615
1724
|
(plugin) => plugin.name === SERVER_FN_TRANSFORM_PLUGIN
|
|
1616
1725
|
);
|
|
1617
1726
|
reactRefreshActive = _chunk65Y5SIBHcjs.isFarmReactRefreshActive.call(void 0, config);
|
|
1618
|
-
if (_optionalChain([options, 'access',
|
|
1727
|
+
if (_optionalChain([options, 'access', _106 => _106.experimental, 'optionalAccess', _107 => _107.serverActions]) === true && !serverFnTransformActive && !islandsServerFns()) {
|
|
1619
1728
|
_chunkQMNWKQL4cjs.logger.warn(
|
|
1620
1729
|
"experimental.serverActions has no effect without @farm.js/plugin/rsc in the Vite plugins. Server functions stay server-only, and importing one from client code is a build error."
|
|
1621
1730
|
);
|
|
@@ -1624,7 +1733,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1624
1733
|
async configureServer(viteServer) {
|
|
1625
1734
|
viteServer.middlewares.use(
|
|
1626
1735
|
createFarmDevPreviewGuard(viteServer, {
|
|
1627
|
-
getSourceRoots: () => _chunk5Y2P454Ocjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
1736
|
+
getSourceRoots: () => _chunk5Y2P454Ocjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _108 => _108.getConfig, 'call', _109 => _109()]), () => ( options)))
|
|
1628
1737
|
})
|
|
1629
1738
|
);
|
|
1630
1739
|
if (typeof fontImports.configureServer === "function") {
|
|
@@ -1636,10 +1745,10 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1636
1745
|
if (!pm) return;
|
|
1637
1746
|
try {
|
|
1638
1747
|
await pm.runHookParallel("onError", { phase, error, meta });
|
|
1639
|
-
} catch (
|
|
1748
|
+
} catch (e16) {
|
|
1640
1749
|
}
|
|
1641
1750
|
};
|
|
1642
|
-
farmApp = new (0,
|
|
1751
|
+
farmApp = new (0, _chunkE4UDLFWRcjs.FarmApp)(
|
|
1643
1752
|
{
|
|
1644
1753
|
...options,
|
|
1645
1754
|
root: resolveDevelopmentRoot(options.root, server.config.root)
|
|
@@ -1649,9 +1758,9 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1649
1758
|
await farmApp.initialize();
|
|
1650
1759
|
const farmConfig = farmApp.getConfig();
|
|
1651
1760
|
let farmAppPackages;
|
|
1652
|
-
if (_optionalChain([farmConfig, 'access',
|
|
1761
|
+
if (_optionalChain([farmConfig, 'access', _110 => _110.agent, 'optionalAccess', _111 => _111.noindexPreviews])) {
|
|
1653
1762
|
server.middlewares.use((_req, res, next) => {
|
|
1654
|
-
if (
|
|
1763
|
+
if (_chunkMPJEIHW2cjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
|
|
1655
1764
|
res.setHeader("X-Robots-Tag", _chunkO6L3YYPMcjs.FARM_PREVIEW_ROBOTS_TAG);
|
|
1656
1765
|
}
|
|
1657
1766
|
next();
|
|
@@ -1659,7 +1768,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1659
1768
|
}
|
|
1660
1769
|
const apiServerBasePath = _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, farmConfig.api);
|
|
1661
1770
|
const devBuiltInRoutePaths = new Set(
|
|
1662
|
-
|
|
1771
|
+
_chunk752IHQTDcjs.listFarmBuiltInRoutePaths.call(void 0, {
|
|
1663
1772
|
agent: {
|
|
1664
1773
|
apiCatalog: true,
|
|
1665
1774
|
mcp: true,
|
|
@@ -1681,7 +1790,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1681
1790
|
validateRemoteUrl: createNodeImageUrlValidator(farmConfig.images),
|
|
1682
1791
|
// Vite owns this address. Unlike request.url, it cannot be replaced by
|
|
1683
1792
|
// a caller-controlled Host header.
|
|
1684
|
-
trustedLocalOrigin: () => _optionalChain([server, 'access',
|
|
1793
|
+
trustedLocalOrigin: () => _optionalChain([server, 'access', _112 => _112.resolvedUrls, 'optionalAccess', _113 => _113.local, 'access', _114 => _114[0]]),
|
|
1685
1794
|
onError(error) {
|
|
1686
1795
|
_chunkQMNWKQL4cjs.logger.error(
|
|
1687
1796
|
`Image optimization failed: ${error instanceof Error ? error.message : String(error)}`
|
|
@@ -1701,8 +1810,8 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1701
1810
|
const workflowConfig = farmConfig.workflows;
|
|
1702
1811
|
const farmDocsDevRuntime = farmConfig.docs.enabled ? await loadFarmDocsDevRuntime() : null;
|
|
1703
1812
|
const getExtraRouteTypes = () => [
|
|
1704
|
-
..._optionalChain([options, 'access',
|
|
1705
|
-
..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
1813
|
+
..._optionalChain([options, 'access', _115 => _115.openapi, 'optionalAccess', _116 => _116.enabled]) && options.openapi.route ? [options.openapi.route] : [],
|
|
1814
|
+
..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess', _117 => _117.getFarmDocsRouteTypeEntries, 'call', _118 => _118(farmConfig.docs)]), () => ( []))
|
|
1706
1815
|
];
|
|
1707
1816
|
const appDirSlugs = sourceRoots.map(
|
|
1708
1817
|
(source) => path6.join(source.root, source.srcDir, "app").replace(/\\/g, "/")
|
|
@@ -1749,7 +1858,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1749
1858
|
(source) => path6.join(source.root, source.srcDir).replace(/\\/g, "/")
|
|
1750
1859
|
);
|
|
1751
1860
|
const layerConfigFiles = new Set(
|
|
1752
|
-
farmConfig.layers.map((layer) => _optionalChain([layer, 'access',
|
|
1861
|
+
farmConfig.layers.map((layer) => _optionalChain([layer, 'access', _119 => _119.configFile, 'optionalAccess', _120 => _120.replace, 'call', _121 => _121(/\\/g, "/")])).filter((file) => Boolean(file))
|
|
1753
1862
|
);
|
|
1754
1863
|
const routeModuleExtensions = /* @__PURE__ */ new Set([
|
|
1755
1864
|
..._chunkRD623KW4cjs.resolveFarmComponentExtensions.call(void 0, farmConfig.renderer.componentExtensions),
|
|
@@ -1828,7 +1937,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1828
1937
|
scheduleTypeArtifactGen(file, ev, typeArtifacts);
|
|
1829
1938
|
}
|
|
1830
1939
|
if (isI18nCatalogFile(file)) {
|
|
1831
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
1940
|
+
_optionalChain([farmApp, 'optionalAccess', _122 => _122.getI18nRuntime, 'call', _123 => _123(), 'access', _124 => _124.reload, 'call', _125 => _125(), 'access', _126 => _126.then, 'call', _127 => _127(() => server.ws.send({ type: "full-reload", path: "*" })), 'access', _128 => _128.catch, 'call', _129 => _129((error) => _chunkQMNWKQL4cjs.logger.warn(`i18n catalog reload failed: ${error.message}`))]);
|
|
1832
1941
|
}
|
|
1833
1942
|
const isRouteRefreshEvent = (ev !== "change" || isStaticMetadataImageFile(file)) && (isAppRuntimeFile(file) || isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file)));
|
|
1834
1943
|
if (isRouteRefreshEvent) {
|
|
@@ -1841,8 +1950,8 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1841
1950
|
const reloadsMiddleware = pendingRouteRefreshIncludesMiddleware;
|
|
1842
1951
|
pendingRouteRefreshIncludesMiddleware = false;
|
|
1843
1952
|
Promise.all([
|
|
1844
|
-
_optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
1845
|
-
reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess',
|
|
1953
|
+
_optionalChain([refreshRouteDiscovery, 'optionalCall', _130 => _130(`${ev} ${file}`)]),
|
|
1954
|
+
reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess', _131 => _131.reload, 'call', _132 => _132()]) : void 0
|
|
1846
1955
|
]).then(() => server.ws.send({ type: "full-reload", path: "*" })).catch((error) => _chunkQMNWKQL4cjs.logger.warn(`Route refresh failed: ${error.message}`));
|
|
1847
1956
|
}, 50);
|
|
1848
1957
|
}
|
|
@@ -1881,7 +1990,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1881
1990
|
const { FARM_DEV_SERVER_MODULE_LOADER } = await import("./internal/native-server-fns.cjs");
|
|
1882
1991
|
const load = (file) => _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, file);
|
|
1883
1992
|
globalThis[FARM_DEV_SERVER_MODULE_LOADER] = load;
|
|
1884
|
-
_optionalChain([server, 'access',
|
|
1993
|
+
_optionalChain([server, 'access', _133 => _133.httpServer, 'optionalAccess', _134 => _134.once, 'call', _135 => _135("close", () => {
|
|
1885
1994
|
const globals = globalThis;
|
|
1886
1995
|
if (globals[FARM_DEV_SERVER_MODULE_LOADER] === load) {
|
|
1887
1996
|
delete globals[FARM_DEV_SERVER_MODULE_LOADER];
|
|
@@ -1955,11 +2064,11 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1955
2064
|
});
|
|
1956
2065
|
}
|
|
1957
2066
|
}
|
|
1958
|
-
if (_optionalChain([options, 'access',
|
|
2067
|
+
if (_optionalChain([options, 'access', _136 => _136.openapi, 'optionalAccess', _137 => _137.enabled])) {
|
|
1959
2068
|
const { OpenAPIManager } = await loadFarmOpenAPIDevRuntime();
|
|
1960
2069
|
openAPIManager = new OpenAPIManager(appDirs, options.openapi, {
|
|
1961
2070
|
mode: "development",
|
|
1962
|
-
apiBaseURL: typeof _optionalChain([options, 'access',
|
|
2071
|
+
apiBaseURL: typeof _optionalChain([options, 'access', _138 => _138.api, 'optionalAccess', _139 => _139.baseURL]) === "string" ? options.api.baseURL : void 0
|
|
1963
2072
|
});
|
|
1964
2073
|
const spec = await openAPIManager.generateSpec();
|
|
1965
2074
|
reportOpenAPIDevGenerationResult(spec);
|
|
@@ -2001,19 +2110,19 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
2001
2110
|
clientEntry: "/@farm/client.js",
|
|
2002
2111
|
resolveLayoutFonts: resolveDocsLayoutFonts,
|
|
2003
2112
|
fontStylesheetHref: "/@farm/fonts.css",
|
|
2004
|
-
globalStylesheetHref:
|
|
2113
|
+
globalStylesheetHref: _chunkE4UDLFWRcjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
2005
2114
|
farmConfig.root,
|
|
2006
2115
|
farmConfig.srcDir
|
|
2007
2116
|
),
|
|
2008
2117
|
loadModule: async (specifier) => {
|
|
2009
2118
|
const resolved = await server.environments.ssr.pluginContainer.resolveId(specifier);
|
|
2010
|
-
if (specifier === _optionalChain([farmConfig, 'access',
|
|
2119
|
+
if (specifier === _optionalChain([farmConfig, 'access', _140 => _140.docs, 'access', _141 => _141.adapter, 'optionalAccess', _142 => _142.server]) && _optionalChain([resolved, 'optionalAccess', _143 => _143.id])) {
|
|
2011
2120
|
return import(
|
|
2012
2121
|
/* @vite-ignore */
|
|
2013
2122
|
_url.pathToFileURL.call(void 0, resolved.id).href
|
|
2014
2123
|
);
|
|
2015
2124
|
}
|
|
2016
|
-
return _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess',
|
|
2125
|
+
return _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess', _144 => _144.id]), () => ( specifier)));
|
|
2017
2126
|
},
|
|
2018
2127
|
registerMCPServer: (mcpServer) => {
|
|
2019
2128
|
const dispose = _chunkLRB5OVRTcjs.registerFarmMCPServer.call(void 0, mcpServer);
|
|
@@ -2031,21 +2140,21 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
2031
2140
|
fontAssets: _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, farmDocsFontAssetList),
|
|
2032
2141
|
resolveLayoutFonts: resolveDocsLayoutFonts,
|
|
2033
2142
|
fontStylesheetHref: "/@farm/fonts.css",
|
|
2034
|
-
globalStylesheetHref:
|
|
2143
|
+
globalStylesheetHref: _chunkE4UDLFWRcjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
2035
2144
|
farmConfig.root,
|
|
2036
2145
|
farmConfig.srcDir
|
|
2037
2146
|
),
|
|
2038
2147
|
isPathGuarded: isFarmDocsPathGuarded
|
|
2039
2148
|
}) : null;
|
|
2040
2149
|
const wrapFarmDocsResponseWithLayouts = async (request, response) => {
|
|
2041
|
-
if (request.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access',
|
|
2150
|
+
if (request.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _145 => _145.headers, 'access', _146 => _146.get, 'call', _147 => _147("content-type"), 'optionalAccess', _148 => _148.toLowerCase, 'call', _149 => _149(), 'access', _150 => _150.includes, 'call', _151 => _151("text/html")])) {
|
|
2042
2151
|
return response;
|
|
2043
2152
|
}
|
|
2044
2153
|
const pathname = new URL(request.url).pathname;
|
|
2045
2154
|
const matchedRoute = routeManager.matchRoute(pathname);
|
|
2046
2155
|
const layoutEntries = matchedRoute.layouts.map((layout) => ({
|
|
2047
2156
|
...layout,
|
|
2048
|
-
metadata:
|
|
2157
|
+
metadata: _chunk7ONGIFYXcjs.getClientModuleMetadata.call(void 0, layout.modulePath, farmConfig.root)
|
|
2049
2158
|
}));
|
|
2050
2159
|
if (!layoutEntries.some((layout) => layout.metadata.shouldHydrate)) {
|
|
2051
2160
|
return response;
|
|
@@ -2059,7 +2168,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
2059
2168
|
headers: response.headers
|
|
2060
2169
|
});
|
|
2061
2170
|
}
|
|
2062
|
-
const docsRenderer = _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
2171
|
+
const docsRenderer = _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _152 => _152.getConfig, 'call', _153 => _153()]), () => ( options))).renderer);
|
|
2063
2172
|
const [rendererRuntime, layoutModules] = await Promise.all([
|
|
2064
2173
|
_chunkRD623KW4cjs.isReactRenderer.call(void 0, docsRenderer) ? import("./renderer/react/server.cjs") : _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, docsRenderer.server),
|
|
2065
2174
|
Promise.all(
|
|
@@ -2088,7 +2197,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
2088
2197
|
])
|
|
2089
2198
|
);
|
|
2090
2199
|
const inlineValue = (value) => JSON.stringify(value).replace(/</g, "\\u003c").replace(/>/g, "\\u003e");
|
|
2091
|
-
const pageModulePath = _optionalChain([matchedRoute, 'access',
|
|
2200
|
+
const pageModulePath = _optionalChain([matchedRoute, 'access', _154 => _154.route, 'optionalAccess', _155 => _155.modulePath]) ? toUrlPath(matchedRoute.route.modulePath) : "";
|
|
2092
2201
|
const bootstrapScript = `<script>
|
|
2093
2202
|
window.__FARM_PROPS__ = ${inlineValue({ params })};
|
|
2094
2203
|
window.__FARM_ROUTE_SLOTS__ = [];
|
|
@@ -2184,7 +2293,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2184
2293
|
}
|
|
2185
2294
|
},
|
|
2186
2295
|
(request) => {
|
|
2187
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
2296
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _156 => _156.getConfig, 'call', _157 => _157()]), () => ( options));
|
|
2188
2297
|
const currentServerConfig = _chunkCFG4QERRcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
|
|
2189
2298
|
return _chunkHNAISJFDcjs.resolveFarmRequestURL.call(void 0, request, {
|
|
2190
2299
|
trustProxy: currentServerConfig.trustProxy
|
|
@@ -2195,7 +2304,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2195
2304
|
withAPIRequestTracing(async (req, res, next) => {
|
|
2196
2305
|
const requestUrl = req.url || "/";
|
|
2197
2306
|
const requestMethod = req.method || "GET";
|
|
2198
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
2307
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _158 => _158.getConfig, 'call', _159 => _159()]), () => ( options));
|
|
2199
2308
|
const currentServerConfig = _chunkCFG4QERRcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
|
|
2200
2309
|
const parsedRequestUrl = _chunkHNAISJFDcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
2201
2310
|
trustProxy: currentServerConfig.trustProxy
|
|
@@ -2237,7 +2346,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2237
2346
|
if (referrerUrl.origin === parsedRequestUrl.origin && !referrerUrl.pathname.startsWith(_chunkSTF6VDYQcjs.FARM_DEVTOOLS_PATH)) {
|
|
2238
2347
|
launchUrl = referrerUrl;
|
|
2239
2348
|
}
|
|
2240
|
-
} catch (
|
|
2349
|
+
} catch (e17) {
|
|
2241
2350
|
}
|
|
2242
2351
|
}
|
|
2243
2352
|
launchUrl.searchParams.set(_chunkSTF6VDYQcjs.FARM_DEVTOOLS_LAUNCH_PARAM, "1");
|
|
@@ -2263,7 +2372,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2263
2372
|
openapi: options.openapi
|
|
2264
2373
|
},
|
|
2265
2374
|
workflows: discoveredWorkflows,
|
|
2266
|
-
plugins: _optionalChain([pm, 'optionalAccess',
|
|
2375
|
+
plugins: _optionalChain([pm, 'optionalAccess', _160 => _160.getSortedPlugins, 'call', _161 => _161()])
|
|
2267
2376
|
});
|
|
2268
2377
|
res.statusCode = 200;
|
|
2269
2378
|
res.setHeader(
|
|
@@ -2286,7 +2395,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2286
2395
|
return;
|
|
2287
2396
|
}
|
|
2288
2397
|
const runAppMiddlewareForContentRoute = async () => {
|
|
2289
|
-
if (!_optionalChain([middlewareManager, 'optionalAccess',
|
|
2398
|
+
if (!_optionalChain([middlewareManager, 'optionalAccess', _162 => _162.hasMiddleware, 'call', _163 => _163()])) return false;
|
|
2290
2399
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
2291
2400
|
return runFarmMiddlewareWithNavigation(
|
|
2292
2401
|
farmApp.getServerRenderer(),
|
|
@@ -2302,16 +2411,16 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2302
2411
|
label
|
|
2303
2412
|
} = {}) => {
|
|
2304
2413
|
const discard = async () => {
|
|
2305
|
-
await _optionalChain([computed, 'optionalAccess',
|
|
2414
|
+
await _optionalChain([computed, 'optionalAccess', _164 => _164.body, 'optionalAccess', _165 => _165.cancel, 'call', _166 => _166(), 'access', _167 => _167.catch, 'call', _168 => _168(() => {
|
|
2306
2415
|
})]);
|
|
2307
2416
|
};
|
|
2308
2417
|
let runtimeSession2;
|
|
2309
|
-
if (_optionalChain([pm, 'optionalAccess',
|
|
2418
|
+
if (_optionalChain([pm, 'optionalAccess', _169 => _169.hasRuntimeRequestHooks, 'call', _170 => _170()])) {
|
|
2310
2419
|
try {
|
|
2311
2420
|
const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath);
|
|
2312
|
-
const route =
|
|
2421
|
+
const route = _chunk752IHQTDcjs.setFarmRouteLabel.call(void 0,
|
|
2313
2422
|
{ pathname: requestPathname },
|
|
2314
|
-
label !== void 0 ? label : devBuiltInRoutePaths.has(routePathname) ? routePathname :
|
|
2423
|
+
label !== void 0 ? label : devBuiltInRoutePaths.has(routePathname) ? routePathname : _chunk752IHQTDcjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath)
|
|
2315
2424
|
);
|
|
2316
2425
|
runtimeSession2 = await pm.beginRuntimeRequest(
|
|
2317
2426
|
createRequestFromNodeRequest(req, new URL(fullUrl)),
|
|
@@ -2343,7 +2452,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2343
2452
|
let response;
|
|
2344
2453
|
try {
|
|
2345
2454
|
response = await respond(
|
|
2346
|
-
_nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess',
|
|
2455
|
+
_nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess', _171 => _171.request]), () => ( createRequestFromNodeRequest(req, new URL(fullUrl))))
|
|
2347
2456
|
);
|
|
2348
2457
|
} catch (error) {
|
|
2349
2458
|
if (runtimeSession2) await pm.failRuntimeRequest(runtimeSession2, error);
|
|
@@ -2356,7 +2465,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2356
2465
|
);
|
|
2357
2466
|
};
|
|
2358
2467
|
const openAPIRequestPathname = openAPIManager ? _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) : requestPathname;
|
|
2359
|
-
if (openAPIManager && _optionalChain([options, 'access',
|
|
2468
|
+
if (openAPIManager && _optionalChain([options, 'access', _172 => _172.openapi, 'optionalAccess', _173 => _173.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
|
|
2360
2469
|
const specManager = openAPIManager;
|
|
2361
2470
|
await serveBuiltInRoute(async () => {
|
|
2362
2471
|
if (requestMethod !== "GET" && requestMethod !== "HEAD") {
|
|
@@ -2376,7 +2485,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2376
2485
|
});
|
|
2377
2486
|
return;
|
|
2378
2487
|
}
|
|
2379
|
-
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access',
|
|
2488
|
+
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _174 => _174.openapi, 'optionalAccess', _175 => _175.route])) {
|
|
2380
2489
|
const docsManager = openAPIManager;
|
|
2381
2490
|
await serveBuiltInRoute(
|
|
2382
2491
|
async () => {
|
|
@@ -2387,20 +2496,20 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2387
2496
|
);
|
|
2388
2497
|
return;
|
|
2389
2498
|
}
|
|
2390
|
-
if (_optionalChain([options, 'access',
|
|
2499
|
+
if (_optionalChain([options, 'access', _176 => _176.agent, 'optionalAccess', _177 => _177.manifest]) !== false && _chunk752IHQTDcjs.isFarmAppManifestPath.call(void 0, _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath))) {
|
|
2391
2500
|
await serveBuiltInRoute(async () => {
|
|
2392
|
-
_nullishCoalesce(farmAppPackages, () => ( (farmAppPackages =
|
|
2393
|
-
const manifest = await
|
|
2501
|
+
_nullishCoalesce(farmAppPackages, () => ( (farmAppPackages = _chunkE4UDLFWRcjs.resolveFarmAppPackages.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd()))))));
|
|
2502
|
+
const manifest = await _chunk752IHQTDcjs.createFarmAppManifestResponse.call(void 0,
|
|
2394
2503
|
new Request(parsedRequestUrl, {
|
|
2395
2504
|
method: requestMethod,
|
|
2396
2505
|
headers: { "if-none-match": String(_nullishCoalesce(req.headers["if-none-match"], () => ( ""))) }
|
|
2397
2506
|
}),
|
|
2398
2507
|
{
|
|
2399
|
-
...
|
|
2508
|
+
..._chunk752IHQTDcjs.resolveFarmAppManifestInput.call(void 0, farmConfig, {
|
|
2400
2509
|
build: "development",
|
|
2401
2510
|
packages: farmAppPackages,
|
|
2402
2511
|
// Read again on each request; unchanged files come from a cache.
|
|
2403
|
-
webmcpTools: _optionalChain([farmConfig, 'access',
|
|
2512
|
+
webmcpTools: _optionalChain([farmConfig, 'access', _178 => _178.plugins, 'optionalAccess', _179 => _179.some, 'call', _180 => _180(({ name }) => name === "farm:webmcp")]) ? _chunkE4UDLFWRcjs.collectFarmWebMCPTools.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd())), farmConfig.srcDir) : []
|
|
2404
2513
|
}),
|
|
2405
2514
|
defaultMCP: () => farmApp.getServerRenderer().getDefaultMCPServer(),
|
|
2406
2515
|
// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
@@ -2418,11 +2527,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2418
2527
|
});
|
|
2419
2528
|
return;
|
|
2420
2529
|
}
|
|
2421
|
-
if (_optionalChain([options, 'access',
|
|
2530
|
+
if (_optionalChain([options, 'access', _181 => _181.agent, 'optionalAccess', _182 => _182.apiCatalog]) && _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunk752IHQTDcjs.FARM_API_CATALOG_PATH) {
|
|
2422
2531
|
await serveBuiltInRoute(
|
|
2423
|
-
() =>
|
|
2532
|
+
() => _chunk752IHQTDcjs.createFarmApiCatalogResponse.call(void 0,
|
|
2424
2533
|
requestMethod,
|
|
2425
|
-
|
|
2534
|
+
_chunk752IHQTDcjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
|
|
2426
2535
|
new Request(parsedRequestUrl, {
|
|
2427
2536
|
headers: { "user-agent": String(_nullishCoalesce(req.headers["user-agent"], () => ( ""))) }
|
|
2428
2537
|
})
|
|
@@ -2430,8 +2539,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2430
2539
|
);
|
|
2431
2540
|
return;
|
|
2432
2541
|
}
|
|
2433
|
-
if (_optionalChain([options, 'access',
|
|
2434
|
-
const aiCatalog =
|
|
2542
|
+
if (_optionalChain([options, 'access', _183 => _183.agent, 'optionalAccess', _184 => _184.aiCatalog]) !== false) {
|
|
2543
|
+
const aiCatalog = _chunk752IHQTDcjs.createFarmAiCatalogResponse.call(void 0,
|
|
2435
2544
|
new Request(parsedRequestUrl, {
|
|
2436
2545
|
method: requestMethod,
|
|
2437
2546
|
headers: {
|
|
@@ -2475,11 +2584,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2475
2584
|
{
|
|
2476
2585
|
kind: "docs",
|
|
2477
2586
|
computed: docsResponse,
|
|
2478
|
-
label:
|
|
2587
|
+
label: _chunk752IHQTDcjs.resolveFarmDocsEngineRouteLabel.call(void 0,
|
|
2479
2588
|
_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath),
|
|
2480
2589
|
{
|
|
2481
|
-
path: _optionalChain([farmConfig, 'access',
|
|
2482
|
-
roots: _optionalChain([farmConfig, 'access',
|
|
2590
|
+
path: _optionalChain([farmConfig, 'access', _185 => _185.docs, 'optionalAccess', _186 => _186.entry]) || "/docs",
|
|
2591
|
+
roots: _optionalChain([farmConfig, 'access', _187 => _187.docs, 'optionalAccess', _188 => _188.roots, 'optionalAccess', _189 => _189.map, 'call', _190 => _190((root) => root.entry)])
|
|
2483
2592
|
}
|
|
2484
2593
|
)
|
|
2485
2594
|
}
|
|
@@ -2487,8 +2596,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2487
2596
|
return;
|
|
2488
2597
|
}
|
|
2489
2598
|
}
|
|
2490
|
-
if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD" || requestMethod === "POST") && _optionalChain([req, 'access',
|
|
2491
|
-
const { createFarmNativeTreeResponse } = await import("./native-tree-
|
|
2599
|
+
if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD" || requestMethod === "POST") && _optionalChain([req, 'access', _191 => _191.headers, 'access', _192 => _192.accept, 'optionalAccess', _193 => _193.includes, 'call', _194 => _194(_chunk3HLQTOVUcjs.FARM_NATIVE_TREE_CONTENT_TYPE)])) {
|
|
2600
|
+
const { createFarmNativeTreeResponse } = await import("./native-tree-7LPH57Z4.cjs");
|
|
2492
2601
|
const treeBodyInit = requestMethod === "POST" ? { body: _chunkCFG4QERRcjs.createFarmNodeRequestBodyStream.call(void 0, req), duplex: "half" } : {};
|
|
2493
2602
|
const treeResponse = await createFarmNativeTreeResponse({
|
|
2494
2603
|
request: new Request(fullUrl, {
|
|
@@ -2505,13 +2614,13 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2505
2614
|
});
|
|
2506
2615
|
await serveBuiltInRoute(() => treeResponse, {
|
|
2507
2616
|
computed: treeResponse,
|
|
2508
|
-
label: _nullishCoalesce(_optionalChain([farmApp, 'access',
|
|
2617
|
+
label: _nullishCoalesce(_optionalChain([farmApp, 'access', _195 => _195.getRouteManager, 'call', _196 => _196(), 'access', _197 => _197.matchRoute, 'call', _198 => _198(_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath)), 'access', _199 => _199.route, 'optionalAccess', _200 => _200.pattern]), () => ( null))
|
|
2509
2618
|
});
|
|
2510
2619
|
return;
|
|
2511
2620
|
}
|
|
2512
|
-
const markdownRouteLabel = () =>
|
|
2621
|
+
const markdownRouteLabel = () => _chunk752IHQTDcjs.resolveFarmMarkdownRouteLabel.call(void 0,
|
|
2513
2622
|
_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath),
|
|
2514
|
-
(page) => _optionalChain([farmApp, 'access',
|
|
2623
|
+
(page) => _optionalChain([farmApp, 'access', _201 => _201.getRouteManager, 'call', _202 => _202(), 'access', _203 => _203.matchRoute, 'call', _204 => _204(page), 'access', _205 => _205.route, 'optionalAccess', _206 => _206.pattern])
|
|
2515
2624
|
);
|
|
2516
2625
|
const markdownSourceResponse = viteModuleRequest ? null : await _chunk7XGWBPQQcjs.createFarmMarkdownSourceResponse.call(void 0, {
|
|
2517
2626
|
request: new Request(fullUrl, {
|
|
@@ -2521,7 +2630,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2521
2630
|
config: farmApp.getConfig().mdx,
|
|
2522
2631
|
resolveSource: async (pathname2) => {
|
|
2523
2632
|
const match = farmApp.getRouteManager().matchRoute(pathname2);
|
|
2524
|
-
const sourcePath = _optionalChain([match, 'access',
|
|
2633
|
+
const sourcePath = _optionalChain([match, 'access', _207 => _207.route, 'optionalAccess', _208 => _208.markdownSourcePath]) || (match.route && _chunk7XGWBPQQcjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
|
|
2525
2634
|
if (!sourcePath) {
|
|
2526
2635
|
return null;
|
|
2527
2636
|
}
|
|
@@ -2661,7 +2770,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2661
2770
|
"beforeRequest",
|
|
2662
2771
|
(plugin) => {
|
|
2663
2772
|
const owner = _chunkI32V5CZLcjs.getFarmIntegrationPluginOwner.call(void 0, plugin);
|
|
2664
|
-
return plugin.name !== _chunkUYTAP4FQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess',
|
|
2773
|
+
return plugin.name !== _chunkUYTAP4FQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess', _209 => _209.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
|
|
2665
2774
|
},
|
|
2666
2775
|
req,
|
|
2667
2776
|
res
|
|
@@ -2697,7 +2806,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2697
2806
|
isProd: false
|
|
2698
2807
|
},
|
|
2699
2808
|
request,
|
|
2700
|
-
{ clientAddress: _optionalChain([req, 'access',
|
|
2809
|
+
{ clientAddress: _optionalChain([req, 'access', _210 => _210.socket, 'optionalAccess', _211 => _211.remoteAddress]) }
|
|
2701
2810
|
);
|
|
2702
2811
|
if (!result) {
|
|
2703
2812
|
throw new Error(`Matched integration route did not return a response`);
|
|
@@ -2761,7 +2870,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2761
2870
|
trustProxy: currentServerConfig.trustProxy
|
|
2762
2871
|
}).pathname;
|
|
2763
2872
|
const servesLocalApiRoute = hasMatchedApiRoute || Boolean(
|
|
2764
|
-
farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
2873
|
+
farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _212 => _212.isFarmDocsAPIRequest, 'call', _213 => _213(requestPathname)])
|
|
2765
2874
|
);
|
|
2766
2875
|
try {
|
|
2767
2876
|
if (pm) {
|
|
@@ -2805,7 +2914,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2805
2914
|
const routedApiRoute = rewritten ? apiRouteManager.matchRoute(routedPathname) : matchedApiRoute || apiRouteManager.matchRoute(pathname2);
|
|
2806
2915
|
const hasExplicitAPIRoute = Boolean(routedApiRoute);
|
|
2807
2916
|
if (apiHandler && hasExplicitAPIRoute) {
|
|
2808
|
-
const apiRoutePattern = _optionalChain([routedApiRoute, 'optionalAccess',
|
|
2917
|
+
const apiRoutePattern = _optionalChain([routedApiRoute, 'optionalAccess', _214 => _214.route, 'access', _215 => _215.path]) || urlPath2;
|
|
2809
2918
|
_chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
|
|
2810
2919
|
type: "route.matched",
|
|
2811
2920
|
pathname: pathname2,
|
|
@@ -2895,7 +3004,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2895
3004
|
return;
|
|
2896
3005
|
}
|
|
2897
3006
|
}
|
|
2898
|
-
if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
3007
|
+
if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _216 => _216.isFarmDocsAPIRequest, 'call', _217 => _217(pathname2)])) {
|
|
2899
3008
|
try {
|
|
2900
3009
|
const url = `http://${req.headers.host || "localhost:3000"}${req.url}`;
|
|
2901
3010
|
const headers = new Headers();
|
|
@@ -2933,11 +3042,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2933
3042
|
};
|
|
2934
3043
|
const docsResponse = pm ? await pm.runRuntimeRequest(request, invokeDocsAPIHandler, {
|
|
2935
3044
|
kind: "docs",
|
|
2936
|
-
route:
|
|
3045
|
+
route: _chunk752IHQTDcjs.setFarmRouteLabel.call(void 0,
|
|
2937
3046
|
{ pathname: pathname2, pattern: apiLifecyclePayload.routePath },
|
|
2938
|
-
|
|
2939
|
-
path: _optionalChain([farmConfig, 'access',
|
|
2940
|
-
roots: _optionalChain([farmConfig, 'access',
|
|
3047
|
+
_chunk752IHQTDcjs.resolveFarmDocsRouteLabel.call(void 0, pathname2, {
|
|
3048
|
+
path: _optionalChain([farmConfig, 'access', _218 => _218.docs, 'optionalAccess', _219 => _219.entry]) || "/docs",
|
|
3049
|
+
roots: _optionalChain([farmConfig, 'access', _220 => _220.docs, 'optionalAccess', _221 => _221.roots, 'optionalAccess', _222 => _222.map, 'call', _223 => _223((root) => root.entry)])
|
|
2941
3050
|
})
|
|
2942
3051
|
)
|
|
2943
3052
|
}) : await invokeDocsAPIHandler(request);
|
|
@@ -2971,18 +3080,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2971
3080
|
res.end(JSON.stringify({ error: "API route not found", pathname: pathname2 }));
|
|
2972
3081
|
return;
|
|
2973
3082
|
}
|
|
2974
|
-
if (_optionalChain([req, 'access',
|
|
3083
|
+
if (_optionalChain([req, 'access', _224 => _224.url, 'optionalAccess', _225 => _225.startsWith, 'call', _226 => _226("/@")]) || _optionalChain([req, 'access', _227 => _227.url, 'optionalAccess', _228 => _228.startsWith, 'call', _229 => _229("/node_modules")])) {
|
|
2975
3084
|
return next();
|
|
2976
3085
|
}
|
|
2977
3086
|
if (shouldBypassFarmRouterForDottedPath(
|
|
2978
3087
|
requestPathname,
|
|
2979
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
3088
|
+
_optionalChain([farmApp, 'optionalAccess', _230 => _230.getRouteManager, 'call', _231 => _231()]),
|
|
2980
3089
|
[server.config.publicDir, server.config.root],
|
|
2981
3090
|
farmAgentGeneratedPaths(farmConfig)
|
|
2982
3091
|
)) {
|
|
2983
3092
|
return next();
|
|
2984
3093
|
}
|
|
2985
|
-
if (_optionalChain([req, 'access',
|
|
3094
|
+
if (_optionalChain([req, 'access', _232 => _232.url, 'optionalAccess', _233 => _233.startsWith, 'call', _234 => _234("/__farm/page-data")])) {
|
|
2986
3095
|
const urlObj = parsedRequestUrl;
|
|
2987
3096
|
const targetPath = urlObj.searchParams.get("path") || "/";
|
|
2988
3097
|
try {
|
|
@@ -3010,7 +3119,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3010
3119
|
});
|
|
3011
3120
|
let middlewareMap = /* @__PURE__ */ new Map();
|
|
3012
3121
|
let middlewareContext = /* @__PURE__ */ new Map();
|
|
3013
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
3122
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _235 => _235.hasMiddleware, 'call', _236 => _236()])) {
|
|
3014
3123
|
const targetNodeRequest = createPageDataMiddlewareRequest(req, targetRequestUrl);
|
|
3015
3124
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
3016
3125
|
farmApp.getServerRenderer(),
|
|
@@ -3038,10 +3147,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3038
3147
|
if (pm) {
|
|
3039
3148
|
await pm.runHookParallel("afterRouteMatch", {
|
|
3040
3149
|
pathname: targetPath,
|
|
3041
|
-
matched: !!_optionalChain([match, 'optionalAccess',
|
|
3042
|
-
routePattern: _optionalChain([match, 'optionalAccess',
|
|
3043
|
-
params: _optionalChain([match, 'optionalAccess',
|
|
3044
|
-
layoutPatterns: (_optionalChain([match, 'optionalAccess',
|
|
3150
|
+
matched: !!_optionalChain([match, 'optionalAccess', _237 => _237.route]),
|
|
3151
|
+
routePattern: _optionalChain([match, 'optionalAccess', _238 => _238.route, 'optionalAccess', _239 => _239.pattern]) || null,
|
|
3152
|
+
params: _optionalChain([match, 'optionalAccess', _240 => _240.params]) || {},
|
|
3153
|
+
layoutPatterns: (_optionalChain([match, 'optionalAccess', _241 => _241.layouts]) || []).map((l) => l.pattern)
|
|
3045
3154
|
});
|
|
3046
3155
|
}
|
|
3047
3156
|
if (!match) {
|
|
@@ -3064,7 +3173,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3064
3173
|
);
|
|
3065
3174
|
const loadingModule = loadingBoundary ? await routeManager3.loadRouteModule(loadingBoundary.modulePath) : null;
|
|
3066
3175
|
const navigationManifest = routeManager3.generateClientManifest(server.config.root);
|
|
3067
|
-
const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => (
|
|
3176
|
+
const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => ( _chunk7ONGIFYXcjs.getClientModuleMetadata.call(void 0, route.modulePath, server.config.root)));
|
|
3068
3177
|
const isClientComponent = moduleMetadata.isClientComponent;
|
|
3069
3178
|
const shouldHydrate = moduleMetadata.shouldHydrate;
|
|
3070
3179
|
let mergedMetadata = {};
|
|
@@ -3072,7 +3181,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3072
3181
|
layouts.map((layout) => routeManager3.loadLayoutModule(layout.modulePath))
|
|
3073
3182
|
);
|
|
3074
3183
|
const layoutHydrationMetadata = layouts.map(
|
|
3075
|
-
(layout) => _nullishCoalesce(navigationManifest.layouts.find((entry) => entry.pattern === layout.pattern), () => (
|
|
3184
|
+
(layout) => _nullishCoalesce(navigationManifest.layouts.find((entry) => entry.pattern === layout.pattern), () => ( _chunk7ONGIFYXcjs.getClientModuleMetadata.call(void 0, layout.modulePath, server.config.root)))
|
|
3076
3185
|
);
|
|
3077
3186
|
const shouldHydrateLayout = layoutHydrationMetadata.some(
|
|
3078
3187
|
(metadata) => metadata.shouldHydrate
|
|
@@ -3083,18 +3192,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3083
3192
|
(metadata) => metadata.shouldHydrate && metadata.islandStrategy ? [metadata.islandStrategy] : []
|
|
3084
3193
|
)
|
|
3085
3194
|
];
|
|
3086
|
-
const hydrationIslandStrategy =
|
|
3087
|
-
_optionalChain([(_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3088
|
-
) === "islands" ?
|
|
3195
|
+
const hydrationIslandStrategy = _chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0,
|
|
3196
|
+
_optionalChain([(_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _242 => _242.getConfig, 'call', _243 => _243()]), () => ( options))), 'access', _244 => _244.experimental, 'optionalAccess', _245 => _245.serverComponents])
|
|
3197
|
+
) === "islands" ? _chunkE4UDLFWRcjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
3089
3198
|
route,
|
|
3090
3199
|
{ shouldHydrate, islandStrategy: _nullishCoalesce(moduleMetadata.islandStrategy, () => ( null)) },
|
|
3091
3200
|
layouts.map((layout, index) => ({
|
|
3092
3201
|
pattern: layout.pattern,
|
|
3093
3202
|
modulePath: layout.modulePath,
|
|
3094
|
-
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access',
|
|
3203
|
+
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _246 => _246[index], 'optionalAccess', _247 => _247.shouldHydrate]) === true,
|
|
3095
3204
|
// Manifest entries carry it; metadata read from source does not.
|
|
3096
|
-
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access',
|
|
3097
|
-
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access',
|
|
3205
|
+
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access', _248 => _248[index], 'optionalAccess', _249 => _249.hasIsolatedClientBoundaries]) === true,
|
|
3206
|
+
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _250 => _250[index], 'optionalAccess', _251 => _251.islandStrategy]), () => ( null))
|
|
3098
3207
|
})),
|
|
3099
3208
|
server.config.root,
|
|
3100
3209
|
true
|
|
@@ -3149,7 +3258,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3149
3258
|
const slotModule = await routeManager3.loadRouteModule(slot.route.modulePath);
|
|
3150
3259
|
const slotMetadata = _nullishCoalesce(navigationManifest.slots.find(
|
|
3151
3260
|
(entry) => entry.name === slot.name && entry.ownerPattern === slot.ownerPattern && entry.pattern === slot.route.pattern
|
|
3152
|
-
), () => (
|
|
3261
|
+
), () => ( _chunk7ONGIFYXcjs.getClientModuleMetadata.call(void 0, slot.route.modulePath, server.config.root)));
|
|
3153
3262
|
const slotContext = await _chunkX333W5KVcjs.resolveFarmRouteContext.call(void 0, farmApp.getConfig(), {
|
|
3154
3263
|
request: targetRequest,
|
|
3155
3264
|
params: slot.params,
|
|
@@ -3213,7 +3322,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3213
3322
|
middlewareContext,
|
|
3214
3323
|
() => renderer.renderNavigationFragment({
|
|
3215
3324
|
PageComponent: routeModule.default,
|
|
3216
|
-
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess',
|
|
3325
|
+
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _252 => _252.default]),
|
|
3217
3326
|
pageProps: routeProps,
|
|
3218
3327
|
params,
|
|
3219
3328
|
layouts: layouts.map((layout, index) => ({
|
|
@@ -3321,18 +3430,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3321
3430
|
trustProxy: currentServerConfig.trustProxy
|
|
3322
3431
|
}).pathname;
|
|
3323
3432
|
const routeManager2 = farmApp.getRouteManager();
|
|
3324
|
-
const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3325
|
-
const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3326
|
-
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3327
|
-
const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3328
|
-
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3329
|
-
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3330
|
-
const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3331
|
-
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3433
|
+
const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _253 => _253.hasHook, 'call', _254 => _254("beforeRouteMatch")]), () => ( false));
|
|
3434
|
+
const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _255 => _255.hasHook, 'call', _256 => _256("afterRouteMatch")]), () => ( false));
|
|
3435
|
+
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _257 => _257.hasHook, 'call', _258 => _258("beforeRequest")]), () => ( false));
|
|
3436
|
+
const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _259 => _259.hasHook, 'call', _260 => _260("beforeRender")]), () => ( false));
|
|
3437
|
+
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _261 => _261.hasHook, 'call', _262 => _262("afterResponse")]), () => ( false));
|
|
3438
|
+
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _263 => _263.hasHook, 'call', _264 => _264("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _265 => _265.hasHook, 'call', _266 => _266("afterRender")]), () => ( false)));
|
|
3439
|
+
const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _267 => _267.hasRuntimeRequestHooks, 'call', _268 => _268()]), () => ( false));
|
|
3440
|
+
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _269 => _269.hasRuntimeHook, 'call', _270 => _270("after")]), () => ( false));
|
|
3332
3441
|
const requestedMatch = routeManager2.matchRoute(requestedPathname);
|
|
3333
3442
|
const pageBuiltInRouteLabel = (pathname2) => {
|
|
3334
3443
|
const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, pathname2, farmConfig.basePath);
|
|
3335
|
-
const mcpLabel =
|
|
3444
|
+
const mcpLabel = _chunk752IHQTDcjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath);
|
|
3336
3445
|
if (mcpLabel) return mcpLabel;
|
|
3337
3446
|
if (farmAgentGeneratedPaths(farmConfig).includes(routePathname)) return routePathname;
|
|
3338
3447
|
return routePathname === _chunkY5TOT5F6cjs.FARM_DEFAULT_MCP_PATH && farmApp.getServerRenderer().getDefaultMCPServer() ? _chunkY5TOT5F6cjs.FARM_DEFAULT_MCP_PATH : null;
|
|
@@ -3344,13 +3453,13 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3344
3453
|
createRequestFromNodeRequest(req, new URL(fullUrl)),
|
|
3345
3454
|
{
|
|
3346
3455
|
kind: "page",
|
|
3347
|
-
route:
|
|
3456
|
+
route: _chunk752IHQTDcjs.setFarmRouteLabel.call(void 0,
|
|
3348
3457
|
{
|
|
3349
3458
|
pathname: requestedPathname,
|
|
3350
|
-
pattern: _optionalChain([requestedMatch, 'optionalAccess',
|
|
3351
|
-
params: _optionalChain([requestedMatch, 'optionalAccess',
|
|
3459
|
+
pattern: _optionalChain([requestedMatch, 'optionalAccess', _271 => _271.route, 'optionalAccess', _272 => _272.pattern]) || null,
|
|
3460
|
+
params: _optionalChain([requestedMatch, 'optionalAccess', _273 => _273.params]) || {}
|
|
3352
3461
|
},
|
|
3353
|
-
_optionalChain([requestedMatch, 'optionalAccess',
|
|
3462
|
+
_optionalChain([requestedMatch, 'optionalAccess', _274 => _274.route]) ? null : pageBuiltInRouteLabel(requestedPathname)
|
|
3354
3463
|
)
|
|
3355
3464
|
}
|
|
3356
3465
|
);
|
|
@@ -3383,17 +3492,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3383
3492
|
if (pm && hasAfterRouteMatchHook) {
|
|
3384
3493
|
await pm.runHookParallel("afterRouteMatch", {
|
|
3385
3494
|
pathname,
|
|
3386
|
-
matched: !!_optionalChain([routeMatch, 'optionalAccess',
|
|
3387
|
-
routePattern: _optionalChain([routeMatch, 'optionalAccess',
|
|
3388
|
-
params: _optionalChain([routeMatch, 'optionalAccess',
|
|
3389
|
-
layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess',
|
|
3495
|
+
matched: !!_optionalChain([routeMatch, 'optionalAccess', _275 => _275.route]),
|
|
3496
|
+
routePattern: _optionalChain([routeMatch, 'optionalAccess', _276 => _276.route, 'optionalAccess', _277 => _277.pattern]) || null,
|
|
3497
|
+
params: _optionalChain([routeMatch, 'optionalAccess', _278 => _278.params]) || {},
|
|
3498
|
+
layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess', _279 => _279.layouts]) || []).map((l) => l.pattern)
|
|
3390
3499
|
});
|
|
3391
3500
|
}
|
|
3392
3501
|
const renderPayload = {
|
|
3393
3502
|
pathname,
|
|
3394
3503
|
method,
|
|
3395
|
-
routePattern: _optionalChain([routeMatch, 'optionalAccess',
|
|
3396
|
-
params: _optionalChain([routeMatch, 'optionalAccess',
|
|
3504
|
+
routePattern: _optionalChain([routeMatch, 'optionalAccess', _280 => _280.route, 'optionalAccess', _281 => _281.pattern]) || null,
|
|
3505
|
+
params: _optionalChain([routeMatch, 'optionalAccess', _282 => _282.params]) || {}
|
|
3397
3506
|
};
|
|
3398
3507
|
const shouldInterceptResponse = Boolean(
|
|
3399
3508
|
pm && (hasAfterResponseHook || hasHTMLTransformHook || runtimeSession && hasRuntimeAfterHook)
|
|
@@ -3415,7 +3524,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3415
3524
|
emitError: (error) => emitPluginError("response-end", error, { pathname })
|
|
3416
3525
|
}) : void 0;
|
|
3417
3526
|
try {
|
|
3418
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
3527
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _283 => _283.hasMiddleware, 'call', _284 => _284()])) {
|
|
3419
3528
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
3420
3529
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
3421
3530
|
farmApp.getServerRenderer(),
|
|
@@ -3425,7 +3534,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3425
3534
|
() => middlewareManager.execute(req, res)
|
|
3426
3535
|
);
|
|
3427
3536
|
if (handled) {
|
|
3428
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
3537
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _285 => _285.isEnded, 'call', _286 => _286()])) {
|
|
3429
3538
|
const duration = Date.now() - startTime;
|
|
3430
3539
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
3431
3540
|
}
|
|
@@ -3438,14 +3547,14 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3438
3547
|
req.url || "/",
|
|
3439
3548
|
`http://${req.headers.host || "localhost:3000"}`
|
|
3440
3549
|
).pathname;
|
|
3441
|
-
const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access',
|
|
3550
|
+
const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access', _287 => _287.matchRoute, 'call', _288 => _288(currentPathname), 'optionalAccess', _289 => _289.route]));
|
|
3442
3551
|
await pm.runHookParallelFiltered(
|
|
3443
3552
|
"beforeRequest",
|
|
3444
3553
|
(plugin) => !hasLocalPageRoute || plugin.name !== _chunkUYTAP4FQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
|
|
3445
3554
|
req,
|
|
3446
3555
|
res
|
|
3447
3556
|
);
|
|
3448
|
-
if (runtimeSession && req.url !== urlBeforeRequestHooks && _optionalChain([req, 'access',
|
|
3557
|
+
if (runtimeSession && req.url !== urlBeforeRequestHooks && _optionalChain([req, 'access', _290 => _290.url, 'optionalAccess', _291 => _291.startsWith, 'call', _292 => _292("/")]) && !res.writableEnded) {
|
|
3449
3558
|
const destinationUrl = new URL(req.url, fullUrl);
|
|
3450
3559
|
const destinationMatch = routeManager2.matchRoute(destinationUrl.pathname);
|
|
3451
3560
|
const guarded = await pm.runRuntimeBeforeForRewrite(
|
|
@@ -3455,8 +3564,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3455
3564
|
kind: "page",
|
|
3456
3565
|
route: {
|
|
3457
3566
|
pathname: destinationUrl.pathname,
|
|
3458
|
-
pattern: _optionalChain([destinationMatch, 'optionalAccess',
|
|
3459
|
-
params: _optionalChain([destinationMatch, 'optionalAccess',
|
|
3567
|
+
pattern: _optionalChain([destinationMatch, 'optionalAccess', _293 => _293.route, 'optionalAccess', _294 => _294.pattern]) || null,
|
|
3568
|
+
params: _optionalChain([destinationMatch, 'optionalAccess', _295 => _295.params]) || {}
|
|
3460
3569
|
}
|
|
3461
3570
|
}
|
|
3462
3571
|
);
|
|
@@ -3468,8 +3577,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3468
3577
|
}
|
|
3469
3578
|
}
|
|
3470
3579
|
}
|
|
3471
|
-
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess',
|
|
3472
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
3580
|
+
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _296 => _296.isEnded, 'call', _297 => _297()]) || await proxyFarmExternalRewrite(req, res, currentServerConfig.bodySizeLimit)) {
|
|
3581
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _298 => _298.isEnded, 'call', _299 => _299()])) {
|
|
3473
3582
|
const duration = Date.now() - startTime;
|
|
3474
3583
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
3475
3584
|
}
|
|
@@ -3533,8 +3642,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3533
3642
|
if (imageModule) return imageModule;
|
|
3534
3643
|
}
|
|
3535
3644
|
if (_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
|
|
3536
|
-
const renderer = _optionalChain([farmApp, 'optionalAccess',
|
|
3537
|
-
const root = _optionalChain([server, 'optionalAccess',
|
|
3645
|
+
const renderer = _optionalChain([farmApp, 'optionalAccess', _300 => _300.getConfig, 'call', _301 => _301(), 'access', _302 => _302.renderer]) || _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
3646
|
+
const root = _optionalChain([server, 'optionalAccess', _303 => _303.config, 'access', _304 => _304.root]) || options.root;
|
|
3538
3647
|
if (isClientEnvironment(this, loadOptions)) {
|
|
3539
3648
|
return generateProgrammaticClientRouteModuleForId(
|
|
3540
3649
|
id,
|
|
@@ -3550,32 +3659,32 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3550
3659
|
return FARM_DEV_CLIENT_BOOT_MODULE;
|
|
3551
3660
|
}
|
|
3552
3661
|
if (isFarmClientVirtualId(id)) {
|
|
3553
|
-
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
3554
|
-
const renderer = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
3555
|
-
const integrations = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
3556
|
-
const root = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
3557
|
-
const docs = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
3662
|
+
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _305 => _305.getConfig, 'call', _306 => _306()]);
|
|
3663
|
+
const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _307 => _307.renderer]) || _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
3664
|
+
const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _308 => _308.integrations]) || options.integrations;
|
|
3665
|
+
const root = _optionalChain([resolvedConfig, 'optionalAccess', _309 => _309.root]) || _optionalChain([server, 'optionalAccess', _310 => _310.config, 'access', _311 => _311.root]) || process.cwd();
|
|
3666
|
+
const docs = _optionalChain([resolvedConfig, 'optionalAccess', _312 => _312.docs]);
|
|
3558
3667
|
const adapterOwnsDocsRuntime = Boolean(
|
|
3559
|
-
_chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess',
|
|
3668
|
+
_chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _313 => _313.adapter, 'optionalAccess', _314 => _314.server]) && docs.adapter.react
|
|
3560
3669
|
);
|
|
3561
|
-
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3670
|
+
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _315 => _315.devtools]), () => ( _chunkSTF6VDYQcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
|
|
3562
3671
|
const [docsRuntime, docsSearchRuntime, devtoolsClientRuntime] = await Promise.all([
|
|
3563
|
-
_optionalChain([docs, 'optionalAccess',
|
|
3564
|
-
_optionalChain([docs, 'optionalAccess',
|
|
3672
|
+
_optionalChain([docs, 'optionalAccess', _316 => _316.enabled]) ? loadFarmDocsDevRuntime() : null,
|
|
3673
|
+
_optionalChain([docs, 'optionalAccess', _317 => _317.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
|
|
3565
3674
|
devtools.enabled ? loadFarmDevtoolsClientRuntime() : null
|
|
3566
3675
|
]);
|
|
3567
|
-
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess',
|
|
3676
|
+
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _318 => _318.isFarmDocsSearchEnabled, 'call', _319 => _319(docs)]), () => ( false));
|
|
3568
3677
|
const generatedDocsSearchRuntime = docsSearchRuntime ? docsSearchRuntime.generateFarmDocsSearchClientRuntime(
|
|
3569
3678
|
docsSearchEnabled,
|
|
3570
3679
|
docsSearchEnabled ? docsSearchRuntime.resolveFarmDocsSearchClientModule(root) : void 0
|
|
3571
3680
|
) : EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME;
|
|
3572
3681
|
const generatedDevtoolsClientRuntime = devtoolsClientRuntime ? devtoolsClientRuntime.generateFarmDevtoolsClientRuntime(devtools) : "";
|
|
3573
|
-
const generatedDevIndicatorsClientRuntime = farmApp ?
|
|
3682
|
+
const generatedDevIndicatorsClientRuntime = farmApp ? _chunkUVV3I5QAcjs.generateFarmDevIndicatorsClientRuntime.call(void 0, farmApp.getConfig().devIndicators) : "";
|
|
3574
3683
|
const integrationProviders = _chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) ? _chunkI32V5CZLcjs.getIntegrationProviders.call(void 0, integrations) : [];
|
|
3575
|
-
const isolatedHydrationMode =
|
|
3576
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3684
|
+
const isolatedHydrationMode = _chunk7ONGIFYXcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
3685
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _320 => _320.experimental, 'optionalAccess', _321 => _321.isolatedClientHydration]),
|
|
3577
3686
|
{
|
|
3578
|
-
serverComponents:
|
|
3687
|
+
serverComponents: _chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _322 => _322.experimental, 'optionalAccess', _323 => _323.serverComponents])) === "rsc",
|
|
3579
3688
|
hasUnsupportedIntegrationProvider: integrationProviders.filter((provider) => provider.component || provider.type === "clerk").some((provider) => provider.supportsIsolatedHydration !== true)
|
|
3580
3689
|
}
|
|
3581
3690
|
);
|
|
@@ -3583,32 +3692,32 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3583
3692
|
integrationProviders,
|
|
3584
3693
|
[
|
|
3585
3694
|
..._chunkI32V5CZLcjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
|
|
3586
|
-
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess',
|
|
3695
|
+
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _324 => _324.getFarmDocsDocumentNavigationMatchers, 'call', _325 => _325(docs)]), () => ( []))
|
|
3587
3696
|
],
|
|
3588
3697
|
generatedDocsSearchRuntime,
|
|
3589
3698
|
`${generatedDevtoolsClientRuntime}
|
|
3590
3699
|
${generatedDevIndicatorsClientRuntime}`,
|
|
3591
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3700
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _326 => _326.plugins]) || [],
|
|
3592
3701
|
root,
|
|
3593
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3594
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3595
|
-
_chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess',
|
|
3702
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _327 => _327.srcDir]) || options.srcDir || "src",
|
|
3703
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _328 => _328.publicRuntimeConfig]) || options.publicRuntimeConfig,
|
|
3704
|
+
_chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _329 => _329.adapter, 'optionalAccess', _330 => _330.react]) : void 0,
|
|
3596
3705
|
renderer,
|
|
3597
|
-
isolatedHydrationMode === "enabled" || _chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
3598
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3599
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3600
|
-
|
|
3601
|
-
|
|
3706
|
+
isolatedHydrationMode === "enabled" || _chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _331 => _331.getRouteManager, 'call', _332 => _332(), 'access', _333 => _333.getIsolatedClientBoundaryModules, 'call', _334 => _334(root)])))), 'optionalAccess', _335 => _335.size]) > 0,
|
|
3707
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _336 => _336.trailingSlash]), () => ( false)),
|
|
3708
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _337 => _337.basePath]), () => ( "/")),
|
|
3709
|
+
_chunkE4UDLFWRcjs.generateClientCachePersistenceCode.call(void 0,
|
|
3710
|
+
_chunkE4UDLFWRcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, _optionalChain([resolvedConfig, 'optionalAccess', _338 => _338.cache]))
|
|
3602
3711
|
),
|
|
3603
3712
|
_chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0,
|
|
3604
|
-
|
|
3713
|
+
_chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _339 => _339.experimental, 'optionalAccess', _340 => _340.serverComponents])) === "islands"
|
|
3605
3714
|
);
|
|
3606
3715
|
}
|
|
3607
3716
|
if (id === "/@farm/server") {
|
|
3608
3717
|
return generateServerCode();
|
|
3609
3718
|
}
|
|
3610
3719
|
if (id === "/@farm/manifest") {
|
|
3611
|
-
const routeManager = _optionalChain([farmApp, 'optionalAccess',
|
|
3720
|
+
const routeManager = _optionalChain([farmApp, 'optionalAccess', _341 => _341.getRouteManager, 'call', _342 => _342()]);
|
|
3612
3721
|
if (!routeManager) {
|
|
3613
3722
|
return `
|
|
3614
3723
|
export const getManifest = () => ({
|
|
@@ -3621,9 +3730,9 @@ export const getManifest = () => ({
|
|
|
3621
3730
|
`;
|
|
3622
3731
|
}
|
|
3623
3732
|
const manifest = routeManager.generateClientManifest(server.config.root);
|
|
3624
|
-
const globalStylesheetHref =
|
|
3733
|
+
const globalStylesheetHref = _chunkE4UDLFWRcjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
3625
3734
|
server.config.root,
|
|
3626
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
3735
|
+
_optionalChain([farmApp, 'optionalAccess', _343 => _343.getConfig, 'call', _344 => _344(), 'access', _345 => _345.srcDir])
|
|
3627
3736
|
);
|
|
3628
3737
|
const fullManifest = {
|
|
3629
3738
|
clientEntry: "/@farm/client.js",
|
|
@@ -3679,24 +3788,24 @@ export const manifest = getManifest();
|
|
|
3679
3788
|
}
|
|
3680
3789
|
},
|
|
3681
3790
|
async transform(code, id, transformOptions) {
|
|
3682
|
-
const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3791
|
+
const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _346 => _346.getConfig, 'call', _347 => _347()]), () => ( options));
|
|
3683
3792
|
let rewrotePackageImports = false;
|
|
3684
|
-
if (
|
|
3793
|
+
if (_chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access', _348 => _348.experimental, 'optionalAccess', _349 => _349.serverComponents])) === "islands" && (!id.includes("/node_modules/") || _optionalChain([transformOptions, 'optionalAccess', _350 => _350.ssr]) === true && farmReactServerFiles.has(id.split("?", 1)[0])) && !id.startsWith("\0") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id) && !_chunk7ONGIFYXcjs.hasUseClientDirective.call(void 0, code)) {
|
|
3685
3794
|
const file = id.split("?", 1)[0];
|
|
3686
|
-
const projectRoot = actionConfig.root || _optionalChain([server, 'optionalAccess',
|
|
3687
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
3795
|
+
const projectRoot = actionConfig.root || _optionalChain([server, 'optionalAccess', _351 => _351.config, 'access', _352 => _352.root]) || process.cwd();
|
|
3796
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _353 => _353.ssr]) === true) {
|
|
3688
3797
|
if (farmReactServerFiles.has(file)) {
|
|
3689
|
-
for (const child of
|
|
3798
|
+
for (const child of _chunk7ONGIFYXcjs.farmRelativeImportFiles.call(void 0, code, file))
|
|
3690
3799
|
farmReactServerFiles.add(child);
|
|
3691
3800
|
}
|
|
3692
|
-
const serverModule = farmReactServerFiles.has(file) || !
|
|
3801
|
+
const serverModule = farmReactServerFiles.has(file) || !_chunk7ONGIFYXcjs.getFarmClientReachableModules.call(void 0,
|
|
3693
3802
|
path6.resolve(projectRoot, actionConfig.srcDir || "src"),
|
|
3694
3803
|
projectRoot
|
|
3695
3804
|
).has(path6.resolve(file));
|
|
3696
|
-
const reactServer = !serverModule ? null :
|
|
3805
|
+
const reactServer = !serverModule ? null : _chunk7ONGIFYXcjs.rewriteFarmReactServerImports.call(void 0, {
|
|
3697
3806
|
code,
|
|
3698
3807
|
file,
|
|
3699
|
-
reference: (specifier, exportName) =>
|
|
3808
|
+
reference: (specifier, exportName) => _chunk7ONGIFYXcjs.ensureFarmPackageClientReference.call(void 0, projectRoot, specifier, exportName),
|
|
3700
3809
|
onServerFile: (serverFile) => farmReactServerFiles.add(serverFile)
|
|
3701
3810
|
});
|
|
3702
3811
|
if (reactServer !== null) {
|
|
@@ -3704,17 +3813,17 @@ export const manifest = getManifest();
|
|
|
3704
3813
|
rewrotePackageImports = true;
|
|
3705
3814
|
}
|
|
3706
3815
|
}
|
|
3707
|
-
const referenced =
|
|
3816
|
+
const referenced = _chunk7ONGIFYXcjs.rewriteFarmPackageClientImports.call(void 0, {
|
|
3708
3817
|
code,
|
|
3709
3818
|
file,
|
|
3710
3819
|
root: projectRoot,
|
|
3711
|
-
isClientPackage: (specifier) =>
|
|
3820
|
+
isClientPackage: (specifier) => _chunk7ONGIFYXcjs.isFarmPackageClientBoundary.call(void 0, file, specifier, projectRoot)
|
|
3712
3821
|
});
|
|
3713
3822
|
if (referenced !== null) {
|
|
3714
3823
|
code = referenced;
|
|
3715
3824
|
rewrotePackageImports = true;
|
|
3716
3825
|
}
|
|
3717
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
3826
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _354 => _354.ssr]) === true) {
|
|
3718
3827
|
const cached = rewriteFarmReactCacheImport(code, file);
|
|
3719
3828
|
if (cached !== null) {
|
|
3720
3829
|
code = cached;
|
|
@@ -3724,43 +3833,43 @@ export const manifest = getManifest();
|
|
|
3724
3833
|
}
|
|
3725
3834
|
if (islandsServerFns() && !_chunkPIUTGRDIcjs.isFarmServerFnBoundaryId.call(void 0, id) && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
|
|
3726
3835
|
const serverFns = _chunkPIUTGRDIcjs.transformFarmServerFns.call(void 0, code, id, {
|
|
3727
|
-
environment: _optionalChain([transformOptions, 'optionalAccess',
|
|
3836
|
+
environment: _optionalChain([transformOptions, 'optionalAccess', _355 => _355.ssr]) === true ? "rsc" : "client"
|
|
3728
3837
|
});
|
|
3729
3838
|
if (serverFns) {
|
|
3730
3839
|
if (!serverFns.code.includes("use server")) return { code: serverFns.code, map: null };
|
|
3731
3840
|
code = serverFns.code;
|
|
3732
3841
|
}
|
|
3733
3842
|
}
|
|
3734
|
-
if (
|
|
3843
|
+
if (_chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access', _356 => _356.experimental, 'optionalAccess', _357 => _357.serverComponents])) === "islands" && code.includes("use server") && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
|
|
3735
3844
|
const file = id.split("?", 1)[0];
|
|
3736
3845
|
const actionModule = transformFarmFormActionModule({
|
|
3737
3846
|
code,
|
|
3738
3847
|
id,
|
|
3739
|
-
root: actionConfig.root || _optionalChain([server, 'optionalAccess',
|
|
3740
|
-
ssr: _optionalChain([transformOptions, 'optionalAccess',
|
|
3848
|
+
root: actionConfig.root || _optionalChain([server, 'optionalAccess', _358 => _358.config, 'access', _359 => _359.root]) || process.cwd(),
|
|
3849
|
+
ssr: _optionalChain([transformOptions, 'optionalAccess', _360 => _360.ssr]) === true,
|
|
3741
3850
|
// Parsed by file type: page components are TSX.
|
|
3742
3851
|
parse: (source) => _vite.parseSync.call(void 0, file, source).program
|
|
3743
3852
|
});
|
|
3744
3853
|
if (actionModule) return { code: actionModule, map: null };
|
|
3745
3854
|
}
|
|
3746
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
3747
|
-
const docsConfigModule = _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess',
|
|
3748
|
-
if (
|
|
3749
|
-
const redacted =
|
|
3855
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _361 => _361.ssr])) {
|
|
3856
|
+
const docsConfigModule = _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess', _362 => _362.getConfig, 'call', _363 => _363(), 'optionalAccess', _364 => _364.docs]));
|
|
3857
|
+
if (_chunkE4UDLFWRcjs.isFarmDocsClientConfigModule.call(void 0, id, docsConfigModule)) {
|
|
3858
|
+
const redacted = _chunkE4UDLFWRcjs.redactFarmDocsClientConfig.call(void 0, code, id.split("?")[0]);
|
|
3750
3859
|
if (redacted !== null) return { code: redacted, map: null };
|
|
3751
3860
|
}
|
|
3752
3861
|
}
|
|
3753
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
3754
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3755
|
-
if ((_optionalChain([currentConfig, 'access',
|
|
3862
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _365 => _365.ssr])) {
|
|
3863
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _366 => _366.getConfig, 'call', _367 => _367()]), () => ( options));
|
|
3864
|
+
if ((_optionalChain([currentConfig, 'access', _368 => _368.experimental, 'optionalAccess', _369 => _369.serverActions]) !== true || !serverFnTransformActive) && !islandsServerFns()) {
|
|
3756
3865
|
const violation = findClientServerFnViolation(code, id);
|
|
3757
3866
|
if (violation) {
|
|
3758
3867
|
this.error(formatServerFnBoundaryError(violation, id));
|
|
3759
3868
|
}
|
|
3760
3869
|
}
|
|
3761
3870
|
}
|
|
3762
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
3763
|
-
warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3871
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _370 => _370.ssr]) && shouldInspectClientBoundary(id, code)) {
|
|
3872
|
+
warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _371 => _371.getConfig, 'call', _372 => _372()]), () => ( options)));
|
|
3764
3873
|
}
|
|
3765
3874
|
if (typeof imageImports.transform === "function") {
|
|
3766
3875
|
const imageModule = await imageImports.transform.call(this, code, id, transformOptions);
|
|
@@ -3775,13 +3884,13 @@ export const manifest = getManifest();
|
|
|
3775
3884
|
id,
|
|
3776
3885
|
transformOptions
|
|
3777
3886
|
);
|
|
3778
|
-
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess',
|
|
3887
|
+
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _373 => _373.code, 'optionalAccess', _374 => _374.toString, 'call', _375 => _375()]);
|
|
3779
3888
|
if (fontCode) {
|
|
3780
3889
|
transformedCode = fontCode;
|
|
3781
3890
|
transformed = true;
|
|
3782
3891
|
}
|
|
3783
3892
|
}
|
|
3784
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
3893
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _376 => _376.ssr]) && server) {
|
|
3785
3894
|
const rewrittenImports = rewriteEarlySsrRelativeImports({
|
|
3786
3895
|
code: transformedCode,
|
|
3787
3896
|
id,
|
|
@@ -3793,25 +3902,26 @@ export const manifest = getManifest();
|
|
|
3793
3902
|
transformed = true;
|
|
3794
3903
|
}
|
|
3795
3904
|
}
|
|
3796
|
-
if (
|
|
3905
|
+
if (_chunk7ONGIFYXcjs.hasUseClientDirective.call(void 0, transformedCode)) {
|
|
3797
3906
|
const clientBoundarySource = transformedCode;
|
|
3798
3907
|
const moduleInfo = this.getModuleInfo(id);
|
|
3799
3908
|
if (moduleInfo) {
|
|
3800
3909
|
moduleInfo.isClientComponent = true;
|
|
3801
3910
|
}
|
|
3802
|
-
transformedCode =
|
|
3911
|
+
transformedCode = _chunk7ONGIFYXcjs.stripUseClientDirective.call(void 0, transformedCode);
|
|
3803
3912
|
transformed = true;
|
|
3804
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3913
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _377 => _377.getConfig, 'call', _378 => _378()]), () => ( options));
|
|
3805
3914
|
let isolatedModuleReference = null;
|
|
3806
|
-
const root = currentConfig.root || _optionalChain([server, 'optionalAccess',
|
|
3915
|
+
const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _379 => _379.config, 'access', _380 => _380.root]) || process.cwd();
|
|
3807
3916
|
const cleanId = id.split("?", 1)[0];
|
|
3808
|
-
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
3809
|
-
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess',
|
|
3810
|
-
if (_chunkRD623KW4cjs.isReactRenderer.call(void 0, _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration &&
|
|
3917
|
+
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _381 => _381.getRouteManager, 'call', _382 => _382(), 'access', _383 => _383.getIsolatedClientBoundaryModules, 'call', _384 => _384(root)])));
|
|
3918
|
+
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _385 => _385.has, 'call', _386 => _386(path6.resolve(cleanId))]) === true;
|
|
3919
|
+
if (_chunkRD623KW4cjs.isReactRenderer.call(void 0, _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && (_chunk7ONGIFYXcjs.isIsolatableClientBoundarySource.call(void 0, clientBoundarySource) || // A generated client reference, whose marker comment compiled TSX no longer has.
|
|
3920
|
+
cleanId.replace(/\\/g, "/").includes(_chunk7ONGIFYXcjs.FARM_CLIENT_REFERENCE_DIRECTORY))) {
|
|
3811
3921
|
isolatedModuleReference = _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, cleanId, root);
|
|
3812
|
-
const islandsMode =
|
|
3813
|
-
const explicitStrategy =
|
|
3814
|
-
const inference = islandsMode && explicitStrategy === null ?
|
|
3922
|
+
const islandsMode = _chunkZIHWAN55cjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([currentConfig, 'access', _387 => _387.experimental, 'optionalAccess', _388 => _388.serverComponents])) === "islands";
|
|
3923
|
+
const explicitStrategy = _chunk7ONGIFYXcjs.getIslandStrategyExport.call(void 0, clientBoundarySource);
|
|
3924
|
+
const inference = islandsMode && explicitStrategy === null ? _chunkE4UDLFWRcjs.inferFarmIslandStrategy.call(void 0, cleanId, root) : null;
|
|
3815
3925
|
if (inference) {
|
|
3816
3926
|
for (const file of inference.files) {
|
|
3817
3927
|
if (file !== path6.resolve(cleanId)) this.addWatchFile(file);
|
|
@@ -3824,7 +3934,7 @@ export const manifest = getManifest();
|
|
|
3824
3934
|
islandStrategy: _nullishCoalesce(explicitStrategy, () => ( "load")),
|
|
3825
3935
|
parse: (source) => this.parse(source),
|
|
3826
3936
|
slots: islandsMode,
|
|
3827
|
-
inferredInteraction: _optionalChain([inference, 'optionalAccess',
|
|
3937
|
+
inferredInteraction: _optionalChain([inference, 'optionalAccess', _389 => _389.strategy]) === "interaction"
|
|
3828
3938
|
});
|
|
3829
3939
|
if (!transformedBoundary) {
|
|
3830
3940
|
this.error(
|
|
@@ -3854,7 +3964,7 @@ export const manifest = getManifest();
|
|
|
3854
3964
|
);
|
|
3855
3965
|
return;
|
|
3856
3966
|
}` : "";
|
|
3857
|
-
const hmrCode = _optionalChain([transformOptions, 'optionalAccess',
|
|
3967
|
+
const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _390 => _390.ssr]) || reactRefreshActive || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
|
|
3858
3968
|
if (import.meta.hot) {
|
|
3859
3969
|
import.meta.hot.accept((newModule) => {
|
|
3860
3970
|
${isolatedHmrUpdate}
|
|
@@ -3909,14 +4019,14 @@ if (import.meta.hot) {
|
|
|
3909
4019
|
}
|
|
3910
4020
|
_chunkQMNWKQL4cjs.logger.info(`Found ${ssgPages.length} SSG pages, ${ssrRoutes.length} SSR routes`);
|
|
3911
4021
|
_chunkQMNWKQL4cjs.logger.info("Pre-rendering SSG pages...");
|
|
3912
|
-
const outDir = path6.join(_optionalChain([server, 'optionalAccess',
|
|
4022
|
+
const outDir = path6.join(_optionalChain([server, 'optionalAccess', _391 => _391.config, 'access', _392 => _392.root]) || process.cwd(), options.outDir || "dist");
|
|
3913
4023
|
const clientDir = path6.join(outDir, "client");
|
|
3914
4024
|
for (const page of ssgPages) {
|
|
3915
4025
|
try {
|
|
3916
4026
|
const staticRequest = new Request(new URL(page.urlPath, "http://farm.static"));
|
|
3917
4027
|
await farmApp.getServerRenderer().runWithRequestContext(staticRequest, async () => {
|
|
3918
4028
|
const mod = await routeManager.loadRouteModule(page.filePath);
|
|
3919
|
-
if (!_optionalChain([mod, 'optionalAccess',
|
|
4029
|
+
if (!_optionalChain([mod, 'optionalAccess', _393 => _393.default])) return;
|
|
3920
4030
|
const { layouts } = routeManager.matchRoute(page.urlPath);
|
|
3921
4031
|
const layoutModules = await Promise.all(
|
|
3922
4032
|
layouts.map((l) => routeManager.loadLayoutModule(l.modulePath))
|
|
@@ -3948,7 +4058,7 @@ if (import.meta.hot) {
|
|
|
3948
4058
|
const i18nSnapshot = _chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
3949
4059
|
const i18nHead = renderFarmI18nStaticHead(page.urlPath, i18nSnapshot);
|
|
3950
4060
|
const fullHtml = `<!DOCTYPE html>
|
|
3951
|
-
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
4061
|
+
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _394 => _394.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
|
|
3952
4062
|
<head>
|
|
3953
4063
|
<meta charset="utf-8">
|
|
3954
4064
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
@@ -3991,7 +4101,8 @@ if (import.meta.hot) {
|
|
|
3991
4101
|
}
|
|
3992
4102
|
},
|
|
3993
4103
|
watchChange() {
|
|
3994
|
-
|
|
4104
|
+
_chunk7ONGIFYXcjs.invalidateFarmClientReachableModules.call(void 0, );
|
|
4105
|
+
_chunk7ONGIFYXcjs.invalidateFarmClientOnlyScan.call(void 0, );
|
|
3995
4106
|
},
|
|
3996
4107
|
async handleHotUpdate(ctx) {
|
|
3997
4108
|
const { file, server: server2, modules } = ctx;
|
|
@@ -4015,13 +4126,13 @@ if (import.meta.hot) {
|
|
|
4015
4126
|
server2.moduleGraph.invalidateModule(mod);
|
|
4016
4127
|
}
|
|
4017
4128
|
}
|
|
4018
|
-
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
4129
|
+
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _395 => _395.getConfig, 'call', _396 => _396()]);
|
|
4019
4130
|
const normalizedFile = file.replace(/\\/g, "/");
|
|
4020
4131
|
if (currentFarmConfig && /\/route\.(?:ts|tsx|js|jsx)$/.test(normalizedFile) && _chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, currentFarmConfig).some(
|
|
4021
4132
|
(appDir) => normalizedFile.startsWith(`${_chunkQMNWKQL4cjs.toPosixPath.call(void 0, appDir)}/api/`)
|
|
4022
4133
|
)) {
|
|
4023
4134
|
for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
|
|
4024
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
4135
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _397 => _397(`updated ${file}`)]);
|
|
4025
4136
|
server2.ws.send({ type: "full-reload", path: "*" });
|
|
4026
4137
|
return [];
|
|
4027
4138
|
}
|
|
@@ -4031,7 +4142,7 @@ if (import.meta.hot) {
|
|
|
4031
4142
|
for (const mod of modules) {
|
|
4032
4143
|
server2.moduleGraph.invalidateModule(mod);
|
|
4033
4144
|
}
|
|
4034
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
4145
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _398 => _398(`updated ${file}`)]);
|
|
4035
4146
|
server2.ws.send({
|
|
4036
4147
|
type: "full-reload",
|
|
4037
4148
|
path: "*"
|
|
@@ -4044,7 +4155,7 @@ if (import.meta.hot) {
|
|
|
4044
4155
|
for (const mod of modules) {
|
|
4045
4156
|
server2.moduleGraph.invalidateModule(mod);
|
|
4046
4157
|
}
|
|
4047
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
4158
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _399 => _399(`updated ${file}`)]);
|
|
4048
4159
|
server2.ws.send({
|
|
4049
4160
|
type: "full-reload",
|
|
4050
4161
|
path: "*"
|
|
@@ -4052,12 +4163,12 @@ if (import.meta.hot) {
|
|
|
4052
4163
|
return [];
|
|
4053
4164
|
}
|
|
4054
4165
|
if (apiRouteManager && _chunkJYNNIGQOcjs.invalidateFarmDevDependents.call(void 0, server2, file, apiRouteManager.getSourceFiles()).length > 0) {
|
|
4055
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
4166
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _400 => _400(`updated ${file}`)]);
|
|
4056
4167
|
}
|
|
4057
|
-
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
4058
|
-
const planRouteManager = _optionalChain([farmApp, 'optionalAccess',
|
|
4168
|
+
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _401 => _401.experimental, 'optionalAccess', _402 => _402.isolatedClientHydration]);
|
|
4169
|
+
const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _403 => _403.getRouteManager, 'call', _404 => _404()]);
|
|
4059
4170
|
const isHydrationPlanSource = currentSrcRoot !== null && normalizedFile.startsWith(`${currentSrcRoot}/`) && /\.[cm]?[jt]sx?$/.test(normalizedFile);
|
|
4060
|
-
const tracksAsyncOwnerIslands = _chunkRD623KW4cjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
4171
|
+
const tracksAsyncOwnerIslands = _chunkRD623KW4cjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _405 => _405.renderer])) && planRouteManager !== void 0;
|
|
4061
4172
|
if (isHydrationPlanSource && (isolatedHydrationMode === "enabled" || isolatedHydrationMode === "analyze" || tracksAsyncOwnerIslands)) {
|
|
4062
4173
|
const routeManager = planRouteManager;
|
|
4063
4174
|
if (routeManager) {
|
|
@@ -4117,7 +4228,7 @@ if (import.meta.hot) {
|
|
|
4117
4228
|
}
|
|
4118
4229
|
return [];
|
|
4119
4230
|
}
|
|
4120
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
4231
|
+
_optionalChain([farmApp, 'optionalAccess', _406 => _406.getRouteManager, 'call', _407 => _407(), 'access', _408 => _408.invalidateClientManifest, 'call', _409 => _409()]);
|
|
4121
4232
|
const manifestModule = server2.moduleGraph.getModuleById("/@farm/manifest");
|
|
4122
4233
|
if (manifestModule) {
|
|
4123
4234
|
server2.moduleGraph.invalidateModule(manifestModule);
|
|
@@ -4163,7 +4274,7 @@ function resolveDevelopmentRoot(farmRoot, viteRoot) {
|
|
|
4163
4274
|
if (fs2.realpathSync(farmRoot) === fs2.realpathSync(viteRoot)) {
|
|
4164
4275
|
return path6.resolve(viteRoot);
|
|
4165
4276
|
}
|
|
4166
|
-
} catch (
|
|
4277
|
+
} catch (e18) {
|
|
4167
4278
|
}
|
|
4168
4279
|
return farmRoot;
|
|
4169
4280
|
}
|
|
@@ -4182,12 +4293,12 @@ function isFarmClientVirtualId(id) {
|
|
|
4182
4293
|
}
|
|
4183
4294
|
function isClientEnvironment(context, loadOptions) {
|
|
4184
4295
|
const environment = context.environment;
|
|
4185
|
-
if (_optionalChain([environment, 'optionalAccess',
|
|
4186
|
-
if (_optionalChain([environment, 'optionalAccess',
|
|
4187
|
-
return _optionalChain([loadOptions, 'optionalAccess',
|
|
4296
|
+
if (_optionalChain([environment, 'optionalAccess', _410 => _410.config, 'optionalAccess', _411 => _411.consumer])) return environment.config.consumer === "client";
|
|
4297
|
+
if (_optionalChain([environment, 'optionalAccess', _412 => _412.name])) return environment.name === "client";
|
|
4298
|
+
return _optionalChain([loadOptions, 'optionalAccess', _413 => _413.ssr]) !== true;
|
|
4188
4299
|
}
|
|
4189
4300
|
function invalidateProgrammaticClientRouteModules(server) {
|
|
4190
|
-
const graph = _optionalChain([server, 'access',
|
|
4301
|
+
const graph = _optionalChain([server, 'access', _414 => _414.environments, 'optionalAccess', _415 => _415.client, 'optionalAccess', _416 => _416.moduleGraph]);
|
|
4191
4302
|
if (!graph) return;
|
|
4192
4303
|
for (const [id, module] of graph.idToModuleMap) {
|
|
4193
4304
|
if (_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id)) graph.invalidateModule(module);
|
|
@@ -4197,22 +4308,22 @@ function generateProgrammaticClientRouteModuleForId(moduleId, root, renderer, cl
|
|
|
4197
4308
|
const parsed = _chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, moduleId);
|
|
4198
4309
|
const routesFile = resolveRealModuleFile(parsed.filePath, root);
|
|
4199
4310
|
watchFile(routesFile);
|
|
4200
|
-
return
|
|
4311
|
+
return _chunk7ONGIFYXcjs.generateProgrammaticClientRouteModule.call(void 0, {
|
|
4201
4312
|
kind: parsed.kind,
|
|
4202
4313
|
routePath: parsed.routePath,
|
|
4203
4314
|
routesFile,
|
|
4204
|
-
route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess',
|
|
4205
|
-
|
|
4315
|
+
route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess', _417 => _417.routes, 'access', _418 => _418.get, 'call', _419 => _419(
|
|
4316
|
+
_chunk7ONGIFYXcjs.programmaticClientRouteKey.call(void 0, routesFile, parsed.kind, parsed.routePath)
|
|
4206
4317
|
)]),
|
|
4207
4318
|
rendererServer: renderer.server,
|
|
4208
4319
|
toImportSpecifier: (file) => toProgrammaticRouteImportSpecifier(file, root)
|
|
4209
4320
|
});
|
|
4210
4321
|
}
|
|
4211
4322
|
function resolveRealModuleFile(filePath, root) {
|
|
4212
|
-
const resolved = _nullishCoalesce(
|
|
4323
|
+
const resolved = _nullishCoalesce(_chunk7ONGIFYXcjs.resolveModuleSourcePath.call(void 0, filePath, root), () => ( filePath));
|
|
4213
4324
|
try {
|
|
4214
4325
|
return _chunkQMNWKQL4cjs.toPosixPath.call(void 0, fs2.realpathSync(resolved));
|
|
4215
|
-
} catch (
|
|
4326
|
+
} catch (e19) {
|
|
4216
4327
|
return _chunkQMNWKQL4cjs.toPosixPath.call(void 0, resolved);
|
|
4217
4328
|
}
|
|
4218
4329
|
}
|
|
@@ -4523,12 +4634,12 @@ async function parseRouteModuleProps(routeModule, input) {
|
|
|
4523
4634
|
}
|
|
4524
4635
|
const schemas = routeModule.__farmRouteSchemas;
|
|
4525
4636
|
const params = parseRouteModuleSchema(
|
|
4526
|
-
_optionalChain([schemas, 'optionalAccess',
|
|
4637
|
+
_optionalChain([schemas, 'optionalAccess', _420 => _420.params]),
|
|
4527
4638
|
input.props.params,
|
|
4528
4639
|
"params",
|
|
4529
4640
|
input.routePath
|
|
4530
4641
|
);
|
|
4531
|
-
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess',
|
|
4642
|
+
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _421 => _421.search]), input.search, "search", input.routePath);
|
|
4532
4643
|
return {
|
|
4533
4644
|
...input.props,
|
|
4534
4645
|
params,
|
|
@@ -4548,12 +4659,12 @@ function parseRouteModuleSchema(schema, value, label, routePath) {
|
|
|
4548
4659
|
}
|
|
4549
4660
|
}
|
|
4550
4661
|
function generateClientCode(integrationProviders = [], documentNavigationMatchers = [], docsSearchClientRuntime = EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME, devtoolsClientRuntime = "", plugins = [], root = process.cwd(), srcDir = "src", publicRuntimeConfig = void 0, docsAdapterReact, renderer = _chunkRD623KW4cjs.REACT_RENDERER, isolatedHydrationEnabled = false, trailingSlash = false, basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false) {
|
|
4551
|
-
const providerClientCode =
|
|
4662
|
+
const providerClientCode = _chunkE4UDLFWRcjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
4552
4663
|
integrationProviders,
|
|
4553
4664
|
root,
|
|
4554
4665
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
4555
4666
|
);
|
|
4556
|
-
const clientPluginEntry =
|
|
4667
|
+
const clientPluginEntry = _chunkE4UDLFWRcjs.generateFarmClientPluginEntryCode.call(void 0,
|
|
4557
4668
|
plugins,
|
|
4558
4669
|
root,
|
|
4559
4670
|
srcDir,
|
|
@@ -4601,7 +4712,7 @@ async function createFarmServerTreePageElement(source, pathname) {
|
|
|
4601
4712
|
return null;
|
|
4602
4713
|
}
|
|
4603
4714
|
}
|
|
4604
|
-
${islandValues ? `${
|
|
4715
|
+
${islandValues ? `${_chunkE4UDLFWRcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
|
|
4605
4716
|
let farmLastRouteState = null;
|
|
4606
4717
|
|
|
4607
4718
|
// A hot update to a layout tree's client module renders the route again.
|
|
@@ -5412,7 +5523,7 @@ async function loadLayoutComponents(layouts = [], params = {}, source) {
|
|
|
5412
5523
|
return loadedLayouts;
|
|
5413
5524
|
}
|
|
5414
5525
|
|
|
5415
|
-
${
|
|
5526
|
+
${_chunkE4UDLFWRcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
5416
5527
|
function wrapWithLoadedLayouts(element, loadedLayouts, params) {
|
|
5417
5528
|
let wrapped = element;
|
|
5418
5529
|
for (let index = loadedLayouts.length - 1; index >= 0; index--) {
|
|
@@ -5769,7 +5880,7 @@ function replaceNavigationBoundary(
|
|
|
5769
5880
|
return nextTarget;
|
|
5770
5881
|
}
|
|
5771
5882
|
|
|
5772
|
-
${islandValues ? `${
|
|
5883
|
+
${islandValues ? `${_chunkE4UDLFWRcjs.FARM_NAVIGATION_STREAM_READER_SOURCE}
|
|
5773
5884
|
|
|
5774
5885
|
// Islands mode navigates as the production client does: it fetches the page itself, names the
|
|
5775
5886
|
// layouts it shows by key (F-Layouts), and asks for flush markers (F-Stream), so the shell arrives
|
|
@@ -6453,7 +6564,7 @@ function generateClientManifest(bundle) {
|
|
|
6453
6564
|
async function defineConfig(config = {}) {
|
|
6454
6565
|
const tailwindVitePlugin = await _chunkR53QDV6Tcjs.loadTailwindVitePlugin.call(void 0, );
|
|
6455
6566
|
const appRoot = path6.resolve(config.root || process.cwd());
|
|
6456
|
-
if (_optionalChain([config, 'access',
|
|
6567
|
+
if (_optionalChain([config, 'access', _422 => _422.extends, 'optionalAccess', _423 => _423.length])) {
|
|
6457
6568
|
const { config: layeredConfig } = await import("./layers-DMRXRL7F.cjs").then(
|
|
6458
6569
|
({ resolveFarmLayers }) => resolveFarmLayers(config, {
|
|
6459
6570
|
root: appRoot,
|
|
@@ -6463,7 +6574,7 @@ async function defineConfig(config = {}) {
|
|
|
6463
6574
|
config = layeredConfig;
|
|
6464
6575
|
}
|
|
6465
6576
|
config.renderer = _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, config.renderer);
|
|
6466
|
-
config.images =
|
|
6577
|
+
config.images = _chunkE4UDLFWRcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, { root: appRoot, dev: true });
|
|
6467
6578
|
const rendererVitePlugins = await _chunkRD623KW4cjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, appRoot, {
|
|
6468
6579
|
ssr: true
|
|
6469
6580
|
});
|
|
@@ -6555,13 +6666,13 @@ async function defineConfig(config = {}) {
|
|
|
6555
6666
|
if (!serverStarted) {
|
|
6556
6667
|
serverStarted = true;
|
|
6557
6668
|
const elapsed = Date.now() - startTime;
|
|
6558
|
-
const address = _optionalChain([server, 'access',
|
|
6669
|
+
const address = _optionalChain([server, 'access', _424 => _424.httpServer, 'optionalAccess', _425 => _425.address, 'call', _426 => _426()]);
|
|
6559
6670
|
const resolvedPort = typeof address === "object" && address ? address.port : server.config.server.port || port || 3e3;
|
|
6560
6671
|
const hostConfig = server.config.server.host;
|
|
6561
6672
|
const isExposed = hostConfig === true || hostConfig === "0.0.0.0";
|
|
6562
6673
|
console.log("");
|
|
6563
6674
|
console.log(
|
|
6564
|
-
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${
|
|
6675
|
+
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkBIF5MLTHcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
|
|
6565
6676
|
);
|
|
6566
6677
|
console.log("");
|
|
6567
6678
|
console.log(
|
|
@@ -6595,7 +6706,7 @@ async function defineConfig(config = {}) {
|
|
|
6595
6706
|
plugins: [
|
|
6596
6707
|
// `farm dev --desktop`: only the desktop window gets an answer, as in the packaged app.
|
|
6597
6708
|
_chunk65Y5SIBHcjs.farmDesktopDevGuardPlugin.call(void 0, config.basePath),
|
|
6598
|
-
|
|
6709
|
+
_chunkE4UDLFWRcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
6599
6710
|
tailwindVitePlugin,
|
|
6600
6711
|
...rendererVitePlugins,
|
|
6601
6712
|
...reactRefreshPlugins,
|
|
@@ -6603,14 +6714,14 @@ async function defineConfig(config = {}) {
|
|
|
6603
6714
|
farmI18nClientBridgePlugin(),
|
|
6604
6715
|
farmServerOnlyEntriesPlugin(),
|
|
6605
6716
|
farmPlugin(config),
|
|
6606
|
-
|
|
6717
|
+
_chunk7ONGIFYXcjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
|
|
6607
6718
|
farmBrandingPlugin
|
|
6608
6719
|
],
|
|
6609
6720
|
customLogger: farmLogger,
|
|
6610
6721
|
clearScreen: false,
|
|
6611
6722
|
optimizeDeps: {
|
|
6612
|
-
...
|
|
6613
|
-
|
|
6723
|
+
..._chunkE4UDLFWRcjs.createFarmClientOptimizeDepsConfig.call(void 0,
|
|
6724
|
+
_chunkE4UDLFWRcjs.createFarmClientOptimizeDepsEntries.call(void 0,
|
|
6614
6725
|
appRoot,
|
|
6615
6726
|
_chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, { ...config, root: appRoot })
|
|
6616
6727
|
),
|
|
@@ -6653,7 +6764,7 @@ async function defineConfig(config = {}) {
|
|
|
6653
6764
|
// Stub out problematic server-only modules during dev mode
|
|
6654
6765
|
alias: {
|
|
6655
6766
|
..._chunk5Y2P454Ocjs.getFarmLayerAliases.call(void 0, config.layers),
|
|
6656
|
-
...
|
|
6767
|
+
..._chunkE4UDLFWRcjs.createFarmSourceAlias.call(void 0, appRoot, config.srcDir),
|
|
6657
6768
|
// Nitro internals that should not be resolved in browser
|
|
6658
6769
|
"supports-color": "data:text/javascript,export default false; export const supportsColor = false; export const stdout = false; export const stderr = false;",
|
|
6659
6770
|
"@poppinss/dumper": "data:text/javascript,export default {};",
|