@farm.js/core 0.1.70 → 0.1.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-mcp-handler-6T2Z7TB6.cjs → agent-mcp-handler-KE4J3W7S.cjs} +3 -3
- package/dist/{agent-mcp-handler-CPU354QQ.mjs → agent-mcp-handler-VIT4GOSR.mjs} +2 -2
- package/dist/{agent-mcp.d-DulgFLBt.d.ts → agent-mcp.d-BzNw6JI8.d.ts} +14 -4
- package/dist/{agent-mcp.d-TAs1ES2F.d.mts → agent-mcp.d-CgFen3EH.d.mts} +14 -4
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/analyzer-LPIVRSTJ.cjs +16 -0
- package/dist/{analyzer-QGRBLETM.mjs → analyzer-VK3BAOFI.mjs} +2 -2
- package/dist/api/node.d.mts +3 -3
- package/dist/api/node.d.ts +3 -3
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/runtime.d.mts +2 -2
- package/dist/api/runtime.d.ts +2 -2
- package/dist/api.d.mts +4 -4
- package/dist/api.d.ts +4 -4
- package/dist/{app-manifest.d-C-nf3Vmm.d.ts → app-manifest.d-DY4JfJxi.d.ts} +1 -1
- package/dist/{app-manifest.d-6zXb90o6.d.mts → app-manifest.d-DpDK_B1k.d.mts} +1 -1
- package/dist/app-markdown.cjs +5 -3
- package/dist/app-markdown.d.mts +3 -3
- package/dist/app-markdown.d.ts +3 -3
- package/dist/app-markdown.mjs +4 -2
- package/dist/{app.d-C2xeMIYT.d.ts → app.d-BeK6bb1c.d.ts} +8 -6
- package/dist/{app.d-DF0aundc.d.mts → app.d-D-5UNrFd.d.mts} +8 -6
- package/dist/{chunk-HAXFV2CD.mjs → chunk-2CQC5CMD.mjs} +1 -1
- package/dist/{chunk-IEN2EFE5.cjs → chunk-2IFT2CSA.cjs} +4 -4
- package/dist/{chunk-BPUVDCGG.cjs → chunk-3BQ7QHUH.cjs} +3 -3
- package/dist/{chunk-JFVT5ZZV.mjs → chunk-4OD2LXF2.mjs} +1 -1
- package/dist/{chunk-CCHJWJGP.mjs → chunk-7BUE2GM6.mjs} +141 -86
- package/dist/{chunk-FJ5YCERM.cjs → chunk-7OHJWFLB.cjs} +387 -331
- package/dist/{chunk-5R3JQPWD.mjs → chunk-AYVGD3PK.mjs} +1 -1
- package/dist/{chunk-K7JMTAFH.cjs → chunk-CSQPMV3Q.cjs} +16 -6
- package/dist/{chunk-N62IYXYD.mjs → chunk-DPIGYXSV.mjs} +1 -1
- package/dist/{chunk-LECZ5DPZ.cjs → chunk-DPYBVVL3.cjs} +2 -2
- package/dist/{chunk-RMOU3PR4.mjs → chunk-GUU3IZSM.mjs} +63 -23
- package/dist/{chunk-EDZU7YRK.mjs → chunk-IGXS54GC.mjs} +2 -2
- package/dist/{chunk-3WS5AZ3R.mjs → chunk-IYDJNCR7.mjs} +1 -1
- package/dist/{chunk-R7254L3R.mjs → chunk-J5ASGNKF.mjs} +23 -0
- package/dist/{chunk-75E5FDX2.mjs → chunk-JMFTKNBA.mjs} +10 -10
- package/dist/{chunk-DIHBWZDZ.cjs → chunk-JVA4PIYN.cjs} +408 -294
- package/dist/{chunk-XYVPTTUT.cjs → chunk-KEB7AGS6.cjs} +4 -4
- package/dist/{chunk-TLSSIYAL.mjs → chunk-KQAB5LML.mjs} +10 -3
- package/dist/{chunk-M6U6E4F7.cjs → chunk-KWST2O22.cjs} +108 -68
- package/dist/{chunk-NSZY3EWG.cjs → chunk-L6E4SHUB.cjs} +31 -8
- package/dist/{chunk-MZLJFNMH.cjs → chunk-MEJCP2LX.cjs} +1 -1
- package/dist/{chunk-A2TH5MKE.mjs → chunk-MITIAOUQ.mjs} +3 -3
- package/dist/{chunk-OCNV4CI2.cjs → chunk-MQ4DYVFS.cjs} +26 -0
- package/dist/{chunk-4AC4PXZO.cjs → chunk-N3XO5AL5.cjs} +2 -2
- package/dist/{chunk-R2ZHU37O.mjs → chunk-NLRAQXAA.mjs} +26 -0
- package/dist/{chunk-32SYRIQ7.cjs → chunk-PLXD2MJV.cjs} +3 -3
- package/dist/{chunk-JFPKARWM.cjs → chunk-PMU4U2W2.cjs} +1 -0
- package/dist/{chunk-3EXCZJEN.mjs → chunk-QUFENL7Q.mjs} +1 -1
- package/dist/{chunk-NYF7A4UW.mjs → chunk-RJUCNO7R.mjs} +1 -1
- package/dist/{chunk-K4UGCUXX.cjs → chunk-SXMWVP2L.cjs} +7 -7
- package/dist/{chunk-VG6HYT5K.cjs → chunk-TP4RAV7Y.cjs} +9 -9
- package/dist/{chunk-I7NUT24Z.cjs → chunk-UISZLYKY.cjs} +2 -2
- package/dist/{chunk-KPMLDT3B.mjs → chunk-UQUOSNRN.mjs} +378 -264
- package/dist/{chunk-QZHTDVH4.mjs → chunk-V25GSH43.mjs} +1 -1
- package/dist/{chunk-65FPDDT4.cjs → chunk-VXB5CMNC.cjs} +2 -2
- package/dist/{chunk-5IJRJWJS.mjs → chunk-W2T6NDNP.mjs} +10 -0
- package/dist/{chunk-JRF2SKCD.mjs → chunk-X7LGLF33.mjs} +1 -1
- package/dist/{chunk-QEWWKYDL.cjs → chunk-YCNHUIPR.cjs} +17 -10
- package/dist/{chunk-PJQ5W356.mjs → chunk-Z5ZZAGIH.mjs} +1 -0
- package/dist/{chunk-A7HCBHMC.cjs → chunk-ZPUAOKHV.cjs} +3 -3
- package/dist/{client-component.d-Bk5qKJM-.d.mts → client-component.d-DwpH251K.d.mts} +2 -2
- package/dist/{client-component.d-DNbC4oWI.d.ts → client-component.d-fYupugbZ.d.ts} +2 -2
- package/dist/{client-plugins.d-DwUqh4gp.d.ts → client-plugins.d-BxqFfHpM.d.ts} +8 -5
- package/dist/{client-plugins.d-Pi9nG0W0.d.mts → client-plugins.d-k3bOT5gz.d.mts} +8 -5
- package/dist/client-plugins.d.mts +1 -1
- package/dist/client-plugins.d.ts +1 -1
- package/dist/client.d.mts +6 -6
- package/dist/client.d.ts +6 -6
- package/dist/config.d.mts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/desktop.d.mts +2 -2
- package/dist/desktop.d.ts +2 -2
- package/dist/{devtools-CB43AHEP.mjs → devtools-6MXPFPNJ.mjs} +2 -2
- package/dist/{devtools-L5DUNDF3.cjs → devtools-O5625KCK.cjs} +3 -3
- package/dist/docs.cjs +4 -4
- package/dist/docs.d.mts +2 -2
- package/dist/docs.d.ts +2 -2
- package/dist/docs.mjs +3 -3
- package/dist/environment/vite.cjs +3 -3
- package/dist/environment/vite.mjs +2 -2
- package/dist/{headers.d-CE6OWB-n.d.ts → headers.d-DalIGbVO.d.ts} +1 -1
- package/dist/{headers.d-DED1hHh4.d.mts → headers.d-sNT7ZQiU.d.mts} +1 -1
- package/dist/index.cjs +20 -18
- package/dist/{index.d-c9UwIqDy.d.ts → index.d-BcA-secm.d.ts} +1 -1
- package/dist/{index.d-CbvOjJcp.d.mts → index.d-DDHHAv7j.d.mts} +1 -1
- package/dist/index.d.mts +18 -18
- package/dist/index.d.ts +18 -18
- package/dist/index.mjs +19 -17
- package/dist/integrations/orm.d.mts +1 -1
- package/dist/integrations/orm.d.ts +1 -1
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/internal/app-markdown-runtime.cjs +4 -2
- package/dist/internal/app-markdown-runtime.d.mts +11 -3
- package/dist/internal/app-markdown-runtime.d.ts +11 -3
- package/dist/internal/app-markdown-runtime.mjs +3 -1
- package/dist/internal/build-runtime.cjs +19 -19
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +18 -18
- package/dist/internal/cli-runtime.cjs +6 -4
- package/dist/internal/cli-runtime.mjs +5 -3
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.d.mts +4 -4
- package/dist/internal/client-runtime.d.ts +4 -4
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +4 -4
- package/dist/internal/config-runtime.d.mts +3 -3
- package/dist/internal/config-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.mjs +3 -3
- package/dist/internal/infra-analytics-runtime.cjs +7 -7
- package/dist/internal/infra-analytics-runtime.mjs +5 -5
- package/dist/internal/native-server-fns.cjs +4 -4
- package/dist/internal/native-server-fns.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +3 -3
- package/dist/internal/product-telemetry-runtime.mjs +2 -2
- package/dist/internal/production-runtime.cjs +6 -6
- package/dist/internal/production-runtime.d.mts +14 -9
- package/dist/internal/production-runtime.d.ts +14 -9
- package/dist/internal/production-runtime.mjs +5 -5
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/middleware.d.mts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/{mount.d-BvWxf8ZE.d.mts → mount.d-C1PONsEe.d.mts} +1 -1
- package/dist/{mount.d-DngLY7NL.d.ts → mount.d-D3JOux2V.d.ts} +1 -1
- package/dist/{navigation-delegate.d-CMyl1h2l.d.mts → navigation-delegate.d-CJQQHboA.d.mts} +1 -1
- package/dist/{navigation-delegate.d-zZogiDfa.d.ts → navigation-delegate.d-CQQPbdkE.d.ts} +1 -1
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/{nitro-Y3LGITW3.cjs → nitro-2LMOMIST.cjs} +2 -2
- package/dist/{nitro-NSTXT7LB.mjs → nitro-72TFIGGO.mjs} +1 -1
- package/dist/{plugin-F2O4BFTK.cjs → plugin-5PIQQVRP.cjs} +2 -2
- package/dist/{plugin-VEBRN7A3.mjs → plugin-QZT747YW.mjs} +1 -1
- package/dist/plugin.cjs +13 -13
- package/dist/plugin.d.mts +4 -4
- package/dist/plugin.d.ts +4 -4
- package/dist/plugin.mjs +12 -12
- package/dist/{render-plan.d-Di1znBDW.d.mts → render-plan.d-CiUj0rq5.d.mts} +1 -1
- package/dist/{render-plan.d-DQj2bzd2.d.ts → render-plan.d-DHuJMJRP.d.ts} +1 -1
- package/dist/renderer-client.d.mts +4 -4
- package/dist/renderer-client.d.ts +4 -4
- package/dist/{request.d-CJWzfDYJ.d.mts → request.d-D-F7o7tb.d.mts} +1 -1
- package/dist/{request.d-C5vyoYeL.d.ts → request.d-DRUbOmYD.d.ts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering.d-C-et2TZ1.d.mts → route-rendering.d-6smgwT2t.d.mts} +1 -1
- package/dist/{route-rendering.d-DhsY5M2I.d.ts → route-rendering.d-KwqM_mlK.d.ts} +1 -1
- package/dist/{router.d-CJB-Ntni.d.ts → router.d-B6sesMRD.d.ts} +1 -1
- package/dist/{router.d-BMDS5s5X.d.mts → router.d-BYmDeDlp.d.mts} +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/{rsc-pipeline-NJKLZ3YE.cjs → rsc-pipeline-P4PCWDO2.cjs} +4 -4
- package/dist/{rsc-pipeline-AXQJCCHI.mjs → rsc-pipeline-R2GOKIMU.mjs} +3 -3
- package/dist/{runtime-JXNEKOSE.mjs → runtime-DP5DYGW5.mjs} +3 -3
- package/dist/{runtime-DMW6DDOI.cjs → runtime-WA2Q4SLG.cjs} +5 -5
- package/dist/{runtime.d-BonodRI9.d.mts → runtime.d-BFSJf-ww.d.mts} +1 -1
- package/dist/{runtime.d-uw4123iI.d.ts → runtime.d-CbdMI0Oy.d.ts} +1 -1
- package/dist/server-plugins.d.mts +3 -3
- package/dist/server-plugins.d.ts +3 -3
- package/dist/server.cjs +33 -33
- package/dist/server.d.mts +10 -10
- package/dist/server.d.ts +10 -10
- package/dist/server.mjs +15 -15
- package/dist/{spa-router.d-rha3M95y.d.mts → spa-router.d-D4EDwR20.d.mts} +2 -2
- package/dist/{spa-router.d-l0d9pPZj.d.ts → spa-router.d-mC1D5cTN.d.ts} +2 -2
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{utils.d-BK-PTOF8.d.ts → utils.d-A2X3a6z_.d.ts} +1 -1
- package/dist/{utils.d-BzuTobEc.d.mts → utils.d-DxMzteqE.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +13 -13
- package/dist/vite.d.mts +7 -5
- package/dist/vite.d.ts +7 -5
- package/dist/vite.mjs +12 -12
- package/package.json +2 -2
- package/dist/analyzer-GUIRJWZH.cjs +0 -16
|
@@ -30,7 +30,8 @@ var _chunkO47W53D3cjs = require('./chunk-O47W53D3.cjs');
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
|
|
34
|
+
var _chunkKWST2O22cjs = require('./chunk-KWST2O22.cjs');
|
|
34
35
|
|
|
35
36
|
|
|
36
37
|
|
|
@@ -38,14 +39,14 @@ var _chunkM6U6E4F7cjs = require('./chunk-M6U6E4F7.cjs');
|
|
|
38
39
|
var _chunkDMXMIE2Ccjs = require('./chunk-DMXMIE2C.cjs');
|
|
39
40
|
|
|
40
41
|
|
|
41
|
-
var
|
|
42
|
+
var _chunkPMU4U2W2cjs = require('./chunk-PMU4U2W2.cjs');
|
|
42
43
|
|
|
43
44
|
|
|
44
45
|
var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
|
|
45
46
|
|
|
46
47
|
|
|
47
48
|
|
|
48
|
-
var
|
|
49
|
+
var _chunkCSQPMV3Qcjs = require('./chunk-CSQPMV3Q.cjs');
|
|
49
50
|
|
|
50
51
|
|
|
51
52
|
|
|
@@ -79,13 +80,13 @@ var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
|
|
|
79
80
|
|
|
80
81
|
|
|
81
82
|
|
|
82
|
-
var
|
|
83
|
+
var _chunkSXMWVP2Lcjs = require('./chunk-SXMWVP2L.cjs');
|
|
83
84
|
|
|
84
85
|
|
|
85
|
-
var
|
|
86
|
+
var _chunkTP4RAV7Ycjs = require('./chunk-TP4RAV7Y.cjs');
|
|
86
87
|
|
|
87
88
|
|
|
88
|
-
var
|
|
89
|
+
var _chunkDPYBVVL3cjs = require('./chunk-DPYBVVL3.cjs');
|
|
89
90
|
|
|
90
91
|
|
|
91
92
|
var _chunk7EPYN7GWcjs = require('./chunk-7EPYN7GW.cjs');
|
|
@@ -120,7 +121,7 @@ var _chunk7EPYN7GWcjs = require('./chunk-7EPYN7GW.cjs');
|
|
|
120
121
|
|
|
121
122
|
|
|
122
123
|
|
|
123
|
-
var
|
|
124
|
+
var _chunk2IFT2CSAcjs = require('./chunk-2IFT2CSA.cjs');
|
|
124
125
|
|
|
125
126
|
|
|
126
127
|
|
|
@@ -134,7 +135,7 @@ var _chunkERMUL73Lcjs = require('./chunk-ERMUL73L.cjs');
|
|
|
134
135
|
var _chunkUVV3I5QAcjs = require('./chunk-UVV3I5QA.cjs');
|
|
135
136
|
|
|
136
137
|
|
|
137
|
-
var
|
|
138
|
+
var _chunkMQ4DYVFScjs = require('./chunk-MQ4DYVFS.cjs');
|
|
138
139
|
|
|
139
140
|
|
|
140
141
|
|
|
@@ -177,7 +178,7 @@ var _chunk3EIPOTZVcjs = require('./chunk-3EIPOTZV.cjs');
|
|
|
177
178
|
|
|
178
179
|
|
|
179
180
|
|
|
180
|
-
var
|
|
181
|
+
var _chunkL6E4SHUBcjs = require('./chunk-L6E4SHUB.cjs');
|
|
181
182
|
|
|
182
183
|
|
|
183
184
|
|
|
@@ -278,7 +279,7 @@ var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
|
|
|
278
279
|
var _chunkEVIWKPJVcjs = require('./chunk-EVIWKPJV.cjs');
|
|
279
280
|
|
|
280
281
|
|
|
281
|
-
var
|
|
282
|
+
var _chunkMEJCP2LXcjs = require('./chunk-MEJCP2LX.cjs');
|
|
282
283
|
|
|
283
284
|
|
|
284
285
|
var _chunkDVJM55D2cjs = require('./chunk-DVJM55D2.cjs');
|
|
@@ -322,6 +323,7 @@ var _chunk7JUIK547cjs = require('./chunk-7JUIK547.cjs');
|
|
|
322
323
|
var _chunkD22BUQKWcjs = require('./chunk-D22BUQKW.cjs');
|
|
323
324
|
|
|
324
325
|
|
|
326
|
+
|
|
325
327
|
var _chunkBTZ5O6VMcjs = require('./chunk-BTZ5O6VM.cjs');
|
|
326
328
|
|
|
327
329
|
// src/form-actions-transform.ts
|
|
@@ -329,6 +331,7 @@ var _crypto = require('crypto');
|
|
|
329
331
|
var _compiler = require('@farm.js/islx/compiler');
|
|
330
332
|
var _path2 = require('path'); var path2 = _interopRequireWildcard(_path2); var path6 = _interopRequireWildcard(_path2); var path3 = _interopRequireWildcard(_path2);
|
|
331
333
|
function transformFarmFormActionModule(options) {
|
|
334
|
+
const runtimeModule = _nullishCoalesce(options.runtimeModule, () => ( ((specifier) => specifier)));
|
|
332
335
|
const result = _compiler.transformActions.call(void 0, {
|
|
333
336
|
code: options.code,
|
|
334
337
|
id: options.id,
|
|
@@ -336,8 +339,8 @@ function transformFarmFormActionModule(options) {
|
|
|
336
339
|
environment: options.ssr ? "server" : "client",
|
|
337
340
|
parse: options.parse,
|
|
338
341
|
runtime: {
|
|
339
|
-
server: "@farm.js/core/internal/islx-server",
|
|
340
|
-
client: "@farm.js/core/internal/islx-client"
|
|
342
|
+
server: runtimeModule("@farm.js/core/internal/islx-server"),
|
|
343
|
+
client: runtimeModule("@farm.js/core/internal/islx-client")
|
|
341
344
|
}
|
|
342
345
|
});
|
|
343
346
|
return result ? result.code : null;
|
|
@@ -893,7 +896,7 @@ var REACT_CACHE_APIS = {
|
|
|
893
896
|
cache: REACT_CACHE_LOCAL,
|
|
894
897
|
cacheSignal: "__farm_react_cache_signal__"
|
|
895
898
|
};
|
|
896
|
-
function rewriteFarmReactCacheImport(code, file) {
|
|
899
|
+
function rewriteFarmReactCacheImport(code, file, cacheModule = FARM_REACT_CACHE_MODULE) {
|
|
897
900
|
if (!code.includes("cache") || !code.includes("react")) return null;
|
|
898
901
|
const extension = path2.default.extname(file).slice(1);
|
|
899
902
|
const lang = extension === "ts" || extension === "mts" || extension === "cts" ? "ts" : "tsx";
|
|
@@ -934,7 +937,7 @@ function rewriteFarmReactCacheImport(code, file) {
|
|
|
934
937
|
].join(", ");
|
|
935
938
|
const lines = [
|
|
936
939
|
...clause ? [`import ${clause} from "react";`] : [],
|
|
937
|
-
`import { ${caches.map((specifier) => `${_nullishCoalesce(_optionalChain([specifier, 'access', _49 => _49.imported, 'optionalAccess', _50 => _50.name]), () => ( _optionalChain([specifier, 'access', _51 => _51.imported, 'optionalAccess', _52 => _52.value])))} as ${specifier.local.name}`).join(", ")} } from ${JSON.stringify(
|
|
940
|
+
`import { ${caches.map((specifier) => `${_nullishCoalesce(_optionalChain([specifier, 'access', _49 => _49.imported, 'optionalAccess', _50 => _50.name]), () => ( _optionalChain([specifier, 'access', _51 => _51.imported, 'optionalAccess', _52 => _52.value])))} as ${specifier.local.name}`).join(", ")} } from ${JSON.stringify(cacheModule)};`
|
|
938
941
|
];
|
|
939
942
|
edits.push({ start: node.start, end: node.end, text: lines.join("\n") });
|
|
940
943
|
}
|
|
@@ -966,7 +969,7 @@ function rewriteFarmReactCacheImport(code, file) {
|
|
|
966
969
|
start: memberImportAt,
|
|
967
970
|
end: memberImportAt,
|
|
968
971
|
text: `
|
|
969
|
-
import { ${[...used].map((name) => `${name} as ${REACT_CACHE_APIS[name]}`).join(", ")} } from ${JSON.stringify(
|
|
972
|
+
import { ${[...used].map((name) => `${name} as ${REACT_CACHE_APIS[name]}`).join(", ")} } from ${JSON.stringify(cacheModule)};`
|
|
970
973
|
});
|
|
971
974
|
}
|
|
972
975
|
}
|
|
@@ -1071,7 +1074,7 @@ function loadFarmWorkflowsDevRuntime() {
|
|
|
1071
1074
|
return import("./workflows.cjs");
|
|
1072
1075
|
}
|
|
1073
1076
|
function loadFarmDevtoolsSnapshotRuntime() {
|
|
1074
|
-
return import("./devtools-
|
|
1077
|
+
return import("./devtools-O5625KCK.cjs");
|
|
1075
1078
|
}
|
|
1076
1079
|
function loadFarmDevtoolsUIRuntime() {
|
|
1077
1080
|
return import("./devtools-ui-SYRUXUA7.cjs");
|
|
@@ -1102,16 +1105,16 @@ var FARM_SERVER_ONLY_PACKAGE_ID = "\0farm:server-only";
|
|
|
1102
1105
|
var FARM_PLATFORM_ENTRY = "@farm.js/core/platform";
|
|
1103
1106
|
var FARM_PLATFORM_CLIENT_ID = "\0farm:platform-client";
|
|
1104
1107
|
var FARM_SERVER_ONLY_ENTRIES_RESOLVE_FILTER = [
|
|
1105
|
-
|
|
1106
|
-
new RegExp(`^${
|
|
1108
|
+
_chunkKWST2O22cjs.exactIdPattern.call(void 0, [FARM_PLATFORM_ENTRY, SERVER_ONLY_PACKAGE, ...FARM_SERVER_ONLY_ENTRIES]),
|
|
1109
|
+
new RegExp(`^${_chunk2IFT2CSAcjs.FARM_RESOLVE_FROM_PREFIX}`),
|
|
1107
1110
|
// What isBuiltin() accepts: `node:` ids and the builtin names, subpaths such as fs/promises
|
|
1108
1111
|
// included.
|
|
1109
1112
|
/^node:/,
|
|
1110
|
-
|
|
1113
|
+
_chunkKWST2O22cjs.exactIdPattern.call(void 0, _module.builtinModules)
|
|
1111
1114
|
];
|
|
1112
1115
|
var FARM_SERVER_ONLY_ENTRIES_LOAD_FILTER = [
|
|
1113
|
-
|
|
1114
|
-
new RegExp(`^${
|
|
1116
|
+
_chunkKWST2O22cjs.exactIdPattern.call(void 0, [FARM_SERVER_ONLY_PACKAGE_ID, FARM_PLATFORM_CLIENT_ID]),
|
|
1117
|
+
new RegExp(`^${_chunk2IFT2CSAcjs.FARM_BROWSER_BUILTIN_PREFIX}`)
|
|
1115
1118
|
];
|
|
1116
1119
|
function createFarmPlatformClientModule(platform) {
|
|
1117
1120
|
return `export function platform() { return ${JSON.stringify(platform)}; }
|
|
@@ -1139,11 +1142,11 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1139
1142
|
name: "farm:server-only-entries",
|
|
1140
1143
|
enforce: "pre",
|
|
1141
1144
|
config(config) {
|
|
1142
|
-
const bundledPackages =
|
|
1145
|
+
const bundledPackages = _chunk2IFT2CSAcjs.collectFarmServerBundledPackageInfo.call(void 0,
|
|
1143
1146
|
path6.resolve(_nullishCoalesce(config.root, () => ( process.cwd())))
|
|
1144
1147
|
);
|
|
1145
1148
|
return {
|
|
1146
|
-
optimizeDeps: { rolldownOptions: { plugins: [
|
|
1149
|
+
optimizeDeps: { rolldownOptions: { plugins: [_chunk2IFT2CSAcjs.farmBrowserBuiltinsOptimizerPlugin.call(void 0, )] } },
|
|
1147
1150
|
ssr: {
|
|
1148
1151
|
noExternal: [
|
|
1149
1152
|
// Resolve `server-only` here rather than in Node, which would load its throwing build.
|
|
@@ -1171,9 +1174,9 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1171
1174
|
);
|
|
1172
1175
|
}
|
|
1173
1176
|
if (!_optionalChain([options2, 'optionalAccess', _67 => _67.ssr]) && _module.isBuiltin.call(void 0, id)) {
|
|
1174
|
-
return
|
|
1177
|
+
return _chunk2IFT2CSAcjs.resolveFarmBrowserBuiltin.call(void 0, this, id, importer, options2);
|
|
1175
1178
|
}
|
|
1176
|
-
const resolveFrom = importer ?
|
|
1179
|
+
const resolveFrom = importer ? _chunk2IFT2CSAcjs.parseFarmResolveFrom.call(void 0, id, importer.split("?", 1)[0]) : null;
|
|
1177
1180
|
if (resolveFrom) {
|
|
1178
1181
|
const directory = path6.dirname(resolveFrom.importer);
|
|
1179
1182
|
return this.resolve(resolveFrom.specifier, resolveFrom.importer, {
|
|
@@ -1209,7 +1212,7 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
1209
1212
|
if (id === FARM_PLATFORM_CLIENT_ID) {
|
|
1210
1213
|
return createFarmPlatformClientModule(_nullishCoalesce(options.platform, () => ( _chunkAQLHD6HZcjs.resolveFarmPlatform.call(void 0, ))));
|
|
1211
1214
|
}
|
|
1212
|
-
return _nullishCoalesce(
|
|
1215
|
+
return _nullishCoalesce(_chunk2IFT2CSAcjs.loadFarmBrowserBuiltin.call(void 0, id), () => ( null));
|
|
1213
1216
|
}
|
|
1214
1217
|
}
|
|
1215
1218
|
};
|
|
@@ -1332,7 +1335,7 @@ async function proxyFarmExternalRewrite(req, res, bodySizeLimit) {
|
|
|
1332
1335
|
let request = createRequestFromNodeRequest(req, new URL(destination));
|
|
1333
1336
|
if (request.method !== "GET" && request.method !== "HEAD") {
|
|
1334
1337
|
const body = await _chunkCFG4QERRcjs.readNodeRequestBody.call(void 0, req, bodySizeLimit);
|
|
1335
|
-
request = new Request(request, { body: toRequestBody(body) });
|
|
1338
|
+
request = new Request(request, { method: request.method, body: toRequestBody(body) });
|
|
1336
1339
|
}
|
|
1337
1340
|
await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, await _chunkJRGR5Z4Kcjs.fetchFarmExternalRewrite.call(void 0, request));
|
|
1338
1341
|
return true;
|
|
@@ -1428,7 +1431,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1428
1431
|
res.end = originalEnd;
|
|
1429
1432
|
res.writeHead = originalWriteHead;
|
|
1430
1433
|
if (originalFlushHeaders) res.flushHeaders = originalFlushHeaders;
|
|
1431
|
-
delete res[
|
|
1434
|
+
delete res[_chunkPMU4U2W2cjs.FARM_NODE_RESPONSE_END_PENDING];
|
|
1432
1435
|
};
|
|
1433
1436
|
let runtimeHookFailed = false;
|
|
1434
1437
|
const endRuntimeRequest = (response) => pm.endRuntimeRequest(runtimeSession, response).catch((error) => {
|
|
@@ -1552,7 +1555,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1552
1555
|
});
|
|
1553
1556
|
res.end = ((...args) => {
|
|
1554
1557
|
interceptedEnd = true;
|
|
1555
|
-
res[
|
|
1558
|
+
res[_chunkPMU4U2W2cjs.FARM_NODE_RESPONSE_END_PENDING] = true;
|
|
1556
1559
|
if (afterResponseCalled) return res;
|
|
1557
1560
|
afterResponseCalled = true;
|
|
1558
1561
|
options.logResponse(method, urlPath, res.statusCode || 200, Date.now() - startTime, "PAGE");
|
|
@@ -1635,7 +1638,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1635
1638
|
res.end = originalEnd;
|
|
1636
1639
|
res.writeHead = originalWriteHead;
|
|
1637
1640
|
if (originalFlushHeaders) res.flushHeaders = originalFlushHeaders;
|
|
1638
|
-
delete res[
|
|
1641
|
+
delete res[_chunkPMU4U2W2cjs.FARM_NODE_RESPONSE_END_PENDING];
|
|
1639
1642
|
originalEnd(...originalEndArgs);
|
|
1640
1643
|
}).catch((error) => {
|
|
1641
1644
|
reportFailure(error);
|
|
@@ -1652,14 +1655,14 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1652
1655
|
res.end = originalEnd;
|
|
1653
1656
|
res.writeHead = originalWriteHead;
|
|
1654
1657
|
if (originalFlushHeaders) res.flushHeaders = originalFlushHeaders;
|
|
1655
|
-
delete res[
|
|
1658
|
+
delete res[_chunkPMU4U2W2cjs.FARM_NODE_RESPONSE_END_PENDING];
|
|
1656
1659
|
originalEnd(body, callback);
|
|
1657
1660
|
} else {
|
|
1658
1661
|
res.write = originalWrite;
|
|
1659
1662
|
res.end = originalEnd;
|
|
1660
1663
|
res.writeHead = originalWriteHead;
|
|
1661
1664
|
if (originalFlushHeaders) res.flushHeaders = originalFlushHeaders;
|
|
1662
|
-
delete res[
|
|
1665
|
+
delete res[_chunkPMU4U2W2cjs.FARM_NODE_RESPONSE_END_PENDING];
|
|
1663
1666
|
originalEnd(...originalEndArgs);
|
|
1664
1667
|
}
|
|
1665
1668
|
});
|
|
@@ -1798,13 +1801,18 @@ function rewriteEarlySsrRelativeImports(options) {
|
|
|
1798
1801
|
return output + options.code.slice(copied);
|
|
1799
1802
|
}
|
|
1800
1803
|
function transformIsolatedClientBoundaryModule(options) {
|
|
1804
|
+
const runtimeModule = _nullishCoalesce(options.runtimeModule, () => ( ((specifier) => specifier)));
|
|
1805
|
+
const islxReact = JSON.stringify(runtimeModule("@farm.js/core/internal/islx-react"));
|
|
1806
|
+
const isolatedBoundary = JSON.stringify(
|
|
1807
|
+
runtimeModule("@farm.js/core/internal/isolated-boundary")
|
|
1808
|
+
);
|
|
1801
1809
|
if (options.slots) {
|
|
1802
1810
|
try {
|
|
1803
1811
|
const rewritten = _compiler.rewriteFormStatusImports.call(void 0, {
|
|
1804
1812
|
code: options.code,
|
|
1805
1813
|
id: options.moduleReference,
|
|
1806
1814
|
parse: options.parse,
|
|
1807
|
-
from: "@farm.js/core/internal/islx-react"
|
|
1815
|
+
from: runtimeModule("@farm.js/core/internal/islx-react")
|
|
1808
1816
|
});
|
|
1809
1817
|
if (rewritten) options = { ...options, code: rewritten.code };
|
|
1810
1818
|
} catch (e18) {
|
|
@@ -1818,7 +1826,7 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
1818
1826
|
return null;
|
|
1819
1827
|
}
|
|
1820
1828
|
const body = Array.isArray(ast.body) ? ast.body : [];
|
|
1821
|
-
const everyExportIsComponent = options.code.includes(
|
|
1829
|
+
const everyExportIsComponent = options.code.includes(_chunk2IFT2CSAcjs.FARM_CLIENT_REFERENCE_PRAGMA) || options.moduleReference.includes(_chunk2IFT2CSAcjs.FARM_CLIENT_REFERENCE_DIRECTORY);
|
|
1822
1830
|
const replacements = [];
|
|
1823
1831
|
const wrapperStatements = [];
|
|
1824
1832
|
const originalEntries = [];
|
|
@@ -1916,10 +1924,10 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
1916
1924
|
output = output.slice(0, replacement.start) + replacement.code + output.slice(replacement.end);
|
|
1917
1925
|
}
|
|
1918
1926
|
const isComponent = `(value) => typeof value === "function" || (typeof value === "object" && value !== null && [Symbol.for("react.memo"), Symbol.for("react.forward_ref"), Symbol.for("react.lazy")].includes(value.$$typeof))`;
|
|
1919
|
-
const runtimeImport = options.slots ? options.browser ? "const __farm_islx_island__ = (component) => component;" : `import { createIsland as __farm_islx_create_island__ } from
|
|
1927
|
+
const runtimeImport = options.slots ? options.browser ? "const __farm_islx_island__ = (component) => component;" : `import { createIsland as __farm_islx_create_island__ } from ${islxReact};
|
|
1920
1928
|
const __farm_is_component__ = ${isComponent};
|
|
1921
1929
|
const __farm_islx_island__ = (component, ...rest) => __farm_is_component__(component) ? __farm_islx_create_island__(component, ...rest) : component;` : `import * as __farm_isolated_react__ from "react";
|
|
1922
|
-
import { createFarmIsolatedClientBoundary as __farm_create_boundary__ } from
|
|
1930
|
+
import { createFarmIsolatedClientBoundary as __farm_create_boundary__ } from ${isolatedBoundary};
|
|
1923
1931
|
const __farm_is_component__ = ${isComponent};
|
|
1924
1932
|
const __farm_create_isolated_boundary__ = (react, component, ...rest) => __farm_is_component__(component) ? __farm_create_boundary__(react, component, ...rest) : component;`;
|
|
1925
1933
|
return `${runtimeImport}
|
|
@@ -1975,17 +1983,38 @@ function warnClientBoundaryOnce(context, id, code, config) {
|
|
|
1975
1983
|
function shouldEmitFarmClientRootHmr(renderer) {
|
|
1976
1984
|
return _chunk67MZTLTFcjs.getFarmRendererCapabilities.call(void 0, _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, renderer)).reconcilesRerenders;
|
|
1977
1985
|
}
|
|
1978
|
-
|
|
1986
|
+
var FARM_RUNTIME_MODULE_PREFIX = "/@farm/runtime/";
|
|
1987
|
+
function toFarmRuntimeModuleId(specifier) {
|
|
1988
|
+
return FARM_RUNTIME_MODULE_PREFIX + specifier;
|
|
1989
|
+
}
|
|
1990
|
+
function getFarmCoreFile() {
|
|
1991
|
+
return typeof __filename === "string" ? __filename : _url.fileURLToPath.call(void 0, _chunkBTZ5O6VMcjs.define_import_meta_default.url);
|
|
1992
|
+
}
|
|
1993
|
+
var FARM_SOURCE_ALIAS_PROBES = [
|
|
1994
|
+
"@/x",
|
|
1995
|
+
"@/index.ts",
|
|
1996
|
+
"@/components/button",
|
|
1997
|
+
"@/lib/utils/format.ts",
|
|
1998
|
+
"@/__farm__/probe"
|
|
1999
|
+
];
|
|
2000
|
+
function matchesViteAlias(find, specifier) {
|
|
2001
|
+
if (typeof find === "string") return specifier === find || specifier.startsWith(`${find}/`);
|
|
2002
|
+
find.lastIndex = 0;
|
|
2003
|
+
const matched = find.test(specifier);
|
|
2004
|
+
find.lastIndex = 0;
|
|
2005
|
+
return matched;
|
|
2006
|
+
}
|
|
2007
|
+
function hasFarmSourceAliasOverride(alias) {
|
|
1979
2008
|
if (!alias) return false;
|
|
1980
|
-
|
|
1981
|
-
return
|
|
1982
|
-
(
|
|
2009
|
+
const finds = Array.isArray(alias) ? alias.map((entry) => entry.find) : Object.keys(alias);
|
|
2010
|
+
return finds.some(
|
|
2011
|
+
(find) => FARM_SOURCE_ALIAS_PROBES.every((probe) => matchesViteAlias(find, probe))
|
|
1983
2012
|
);
|
|
1984
2013
|
}
|
|
1985
2014
|
function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
1986
2015
|
const rendererDisabled = _chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, options.renderer);
|
|
1987
2016
|
const imageImports = farmImageImportsPlugin();
|
|
1988
|
-
const fontImports =
|
|
2017
|
+
const fontImports = _chunkKWST2O22cjs.farmFontImportsPlugin.call(void 0, {
|
|
1989
2018
|
root: options.root,
|
|
1990
2019
|
basePath: options.basePath,
|
|
1991
2020
|
publicDir: options.publicDir
|
|
@@ -2024,15 +2053,27 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2024
2053
|
console.log(log);
|
|
2025
2054
|
};
|
|
2026
2055
|
const getProgrammaticClientRoutes = () => _nullishCoalesce(options.programmaticClientRoutes, () => ( _optionalChain([farmApp, 'optionalAccess', _101 => _101.getRouteManager, 'call', _102 => _102(), 'access', _103 => _103.getProgrammaticClientRoutes, 'call', _104 => _104()])));
|
|
2056
|
+
const isOutsideAppRoot = (file) => {
|
|
2057
|
+
const root = _optionalChain([farmApp, 'optionalAccess', _105 => _105.getConfig, 'call', _106 => _106(), 'access', _107 => _107.root]) || _optionalChain([server, 'optionalAccess', _108 => _108.config, 'access', _109 => _109.root]) || options.root;
|
|
2058
|
+
if (!root) return false;
|
|
2059
|
+
const relative4 = path6.relative(root, file.split("?", 1)[0]);
|
|
2060
|
+
return relative4.startsWith("..") || path6.isAbsolute(relative4);
|
|
2061
|
+
};
|
|
2027
2062
|
const plugin = {
|
|
2028
2063
|
name: "farm",
|
|
2029
2064
|
api: { getProgrammaticClientRoutes },
|
|
2030
2065
|
config(userConfig, configEnv) {
|
|
2031
2066
|
isBuild = configEnv.command === "build";
|
|
2032
|
-
const
|
|
2033
|
-
|
|
2067
|
+
const farmAliases = {
|
|
2068
|
+
..._chunkMTBDJ326cjs.getFarmLayerAliases.call(void 0, options.layers),
|
|
2069
|
+
...hasFarmSourceAliasOverride(_optionalChain([userConfig, 'access', _110 => _110.resolve, 'optionalAccess', _111 => _111.alias])) ? {} : _chunkKWST2O22cjs.createFarmSourceAlias.call(void 0, options.root || process.cwd(), options.srcDir)
|
|
2070
|
+
};
|
|
2071
|
+
if (Object.keys(farmAliases).length > 0) {
|
|
2072
|
+
_nullishCoalesce(userConfig.resolve, () => ( (userConfig.resolve = {})));
|
|
2073
|
+
userConfig.resolve.alias = _chunkKWST2O22cjs.mergeFarmViteAlias.call(void 0, farmAliases, userConfig.resolve.alias);
|
|
2074
|
+
}
|
|
2034
2075
|
const layerRoots = (_nullishCoalesce(options.layers, () => ( []))).map((layer) => layer.root);
|
|
2035
|
-
farmOwnsDevCors = !isBuild && _optionalChain([userConfig, 'access',
|
|
2076
|
+
farmOwnsDevCors = !isBuild && _optionalChain([userConfig, 'access', _112 => _112.server, 'optionalAccess', _113 => _113.cors]) === void 0;
|
|
2036
2077
|
return {
|
|
2037
2078
|
// Honor Farm's publicDir so the dev server serves the same static
|
|
2038
2079
|
// directory the production client build emits.
|
|
@@ -2041,14 +2082,11 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2041
2082
|
// Keep development module ownership explicit; the RSC plugin adds its
|
|
2042
2083
|
// environment only when enabled. Production environment setup is unchanged.
|
|
2043
2084
|
...!isBuild ? { environments: { client: {}, ssr: {} } } : {},
|
|
2044
|
-
resolve: {
|
|
2045
|
-
alias: { ...layerAliases, ...sourceAlias }
|
|
2046
|
-
},
|
|
2047
2085
|
server: {
|
|
2048
2086
|
...farmOwnsDevCors ? { cors: false } : {},
|
|
2049
2087
|
fs: {
|
|
2050
2088
|
...layerRoots.length ? { allow: [path6.resolve(options.root || process.cwd()), ...layerRoots] } : {},
|
|
2051
|
-
deny: getFarmDevFsDeny(_optionalChain([userConfig, 'access',
|
|
2089
|
+
deny: getFarmDevFsDeny(_optionalChain([userConfig, 'access', _114 => _114.server, 'optionalAccess', _115 => _115.fs, 'optionalAccess', _116 => _116.deny]), options)
|
|
2052
2090
|
}
|
|
2053
2091
|
}
|
|
2054
2092
|
};
|
|
@@ -2061,7 +2099,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2061
2099
|
(plugin2) => plugin2.name === SERVER_FN_TRANSFORM_PLUGIN
|
|
2062
2100
|
);
|
|
2063
2101
|
reactRefreshActive = _chunk3QM74STYcjs.isFarmReactRefreshActive.call(void 0, config);
|
|
2064
|
-
if (_optionalChain([options, 'access',
|
|
2102
|
+
if (_optionalChain([options, 'access', _117 => _117.experimental, 'optionalAccess', _118 => _118.serverActions]) === true && !serverFnTransformActive && !islandsServerFns()) {
|
|
2065
2103
|
_chunkQMNWKQL4cjs.logger.warn(
|
|
2066
2104
|
"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."
|
|
2067
2105
|
);
|
|
@@ -2070,20 +2108,20 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2070
2108
|
async configureServer(viteServer) {
|
|
2071
2109
|
viteServer.middlewares.use(
|
|
2072
2110
|
createFarmDevPreviewGuard(viteServer, {
|
|
2073
|
-
getSourceRoots: () => _chunkMTBDJ326cjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
2111
|
+
getSourceRoots: () => _chunkMTBDJ326cjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _119 => _119.getConfig, 'call', _120 => _120()]), () => ( options)))
|
|
2074
2112
|
})
|
|
2075
2113
|
);
|
|
2076
2114
|
if (typeof fontImports.configureServer === "function") {
|
|
2077
2115
|
await fontImports.configureServer.call(this, viteServer);
|
|
2078
2116
|
}
|
|
2079
2117
|
server = viteServer;
|
|
2080
|
-
const farmMiddlewares = _nullishCoalesce(_optionalChain([deferredGates, 'optionalAccess',
|
|
2081
|
-
const farmPostMiddlewares = _nullishCoalesce(_optionalChain([deferredGates, 'optionalAccess',
|
|
2118
|
+
const farmMiddlewares = _nullishCoalesce(_optionalChain([deferredGates, 'optionalAccess', _121 => _121.pre, 'access', _122 => _122.target]), () => ( viteServer.middlewares));
|
|
2119
|
+
const farmPostMiddlewares = _nullishCoalesce(_optionalChain([deferredGates, 'optionalAccess', _123 => _123.post, 'access', _124 => _124.target]), () => ( viteServer.middlewares));
|
|
2082
2120
|
const pm = initialPluginManager;
|
|
2083
2121
|
const configRoutePlugins = new Set(
|
|
2084
|
-
_optionalChain([pm, 'optionalAccess',
|
|
2122
|
+
_optionalChain([pm, 'optionalAccess', _125 => _125.getPlugins, 'call', _126 => _126(), 'access', _127 => _127.filter, 'call', _128 => _128(isFarmConfigRoutePlugin), 'access', _129 => _129.map, 'call', _130 => _130((plugin2) => plugin2.name)])
|
|
2085
2123
|
);
|
|
2086
|
-
const configRedirectMatchers = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
2124
|
+
const configRedirectMatchers = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _131 => _131.getPlugins, 'call', _132 => _132()]), () => ( []))).flatMap((plugin2) => {
|
|
2087
2125
|
const matcher = _chunkMBCRWU3Pcjs.getConfigRedirectMatcher.call(void 0, plugin2);
|
|
2088
2126
|
return matcher ? [matcher] : [];
|
|
2089
2127
|
});
|
|
@@ -2094,7 +2132,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2094
2132
|
} catch (e21) {
|
|
2095
2133
|
}
|
|
2096
2134
|
};
|
|
2097
|
-
farmApp = new (0,
|
|
2135
|
+
farmApp = new (0, _chunkKWST2O22cjs.FarmApp)(
|
|
2098
2136
|
{
|
|
2099
2137
|
...options,
|
|
2100
2138
|
root: resolveDevelopmentRoot(options.root, server.config.root)
|
|
@@ -2102,7 +2140,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2102
2140
|
server
|
|
2103
2141
|
);
|
|
2104
2142
|
farmApp.getRouteManager().usePackageClientBoundaryCacheFile(
|
|
2105
|
-
|
|
2143
|
+
_chunk2IFT2CSAcjs.resolvePackageClientBoundaryCacheFile.call(void 0,
|
|
2106
2144
|
farmApp.getConfig().root,
|
|
2107
2145
|
options.distDir || ".farm"
|
|
2108
2146
|
)
|
|
@@ -2110,9 +2148,9 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2110
2148
|
await farmApp.initialize();
|
|
2111
2149
|
const farmConfig = farmApp.getConfig();
|
|
2112
2150
|
let farmAppPackages;
|
|
2113
|
-
if (_optionalChain([farmConfig, 'access',
|
|
2151
|
+
if (_optionalChain([farmConfig, 'access', _133 => _133.agent, 'optionalAccess', _134 => _134.noindexPreviews])) {
|
|
2114
2152
|
farmMiddlewares.use((_req, res, next) => {
|
|
2115
|
-
if (
|
|
2153
|
+
if (_chunkDPYBVVL3cjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
|
|
2116
2154
|
res.setHeader("X-Robots-Tag", _chunkZUVAGMQ5cjs.FARM_PREVIEW_ROBOTS_TAG);
|
|
2117
2155
|
}
|
|
2118
2156
|
next();
|
|
@@ -2120,7 +2158,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2120
2158
|
}
|
|
2121
2159
|
const apiServerBasePath = _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, farmConfig.api);
|
|
2122
2160
|
const devBuiltInRoutePaths = new Set(
|
|
2123
|
-
|
|
2161
|
+
_chunkSXMWVP2Lcjs.listFarmBuiltInRoutePaths.call(void 0, {
|
|
2124
2162
|
agent: {
|
|
2125
2163
|
apiCatalog: true,
|
|
2126
2164
|
mcp: true,
|
|
@@ -2142,7 +2180,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2142
2180
|
validateRemoteUrl: createNodeImageUrlValidator(farmConfig.images),
|
|
2143
2181
|
// Vite owns this address. Unlike request.url, it cannot be replaced by
|
|
2144
2182
|
// a caller-controlled Host header.
|
|
2145
|
-
trustedLocalOrigin: () => _optionalChain([server, 'access',
|
|
2183
|
+
trustedLocalOrigin: () => _optionalChain([server, 'access', _135 => _135.resolvedUrls, 'optionalAccess', _136 => _136.local, 'access', _137 => _137[0]]),
|
|
2146
2184
|
onError(error) {
|
|
2147
2185
|
_chunkQMNWKQL4cjs.logger.error(
|
|
2148
2186
|
`Image optimization failed: ${error instanceof Error ? error.message : String(error)}`
|
|
@@ -2162,15 +2200,15 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2162
2200
|
const workflowConfig = farmConfig.workflows;
|
|
2163
2201
|
const farmDocsDevRuntime = farmConfig.docs.enabled ? await loadFarmDocsDevRuntime() : null;
|
|
2164
2202
|
const getExtraRouteTypes = () => [
|
|
2165
|
-
..._optionalChain([options, 'access',
|
|
2166
|
-
..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
2203
|
+
..._optionalChain([options, 'access', _138 => _138.openapi, 'optionalAccess', _139 => _139.enabled]) && options.openapi.route ? [options.openapi.route] : [],
|
|
2204
|
+
..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess', _140 => _140.getFarmDocsRouteTypeEntries, 'call', _141 => _141(farmConfig.docs)]), () => ( []))
|
|
2167
2205
|
];
|
|
2168
2206
|
const appDirSlugs = sourceRoots.map(
|
|
2169
2207
|
(source) => path6.join(source.root, source.srcDir, "app").replace(/\\/g, "/")
|
|
2170
2208
|
);
|
|
2171
2209
|
const generateTypeArtifacts = async (reason, selection = ALL_TYPE_ARTIFACTS, log = false) => {
|
|
2172
2210
|
try {
|
|
2173
|
-
const result = await
|
|
2211
|
+
const result = await _chunkCSQPMV3Qcjs.generateFarmTypeArtifacts.call(void 0, {
|
|
2174
2212
|
root: farmConfig.root,
|
|
2175
2213
|
srcDir: farmConfig.srcDir,
|
|
2176
2214
|
layers: farmConfig.layers,
|
|
@@ -2210,7 +2248,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2210
2248
|
(source) => path6.join(source.root, source.srcDir).replace(/\\/g, "/")
|
|
2211
2249
|
);
|
|
2212
2250
|
const layerConfigFiles = new Set(
|
|
2213
|
-
farmConfig.layers.map((layer) => _optionalChain([layer, 'access',
|
|
2251
|
+
farmConfig.layers.map((layer) => _optionalChain([layer, 'access', _142 => _142.configFile, 'optionalAccess', _143 => _143.replace, 'call', _144 => _144(/\\/g, "/")])).filter((file) => Boolean(file))
|
|
2214
2252
|
);
|
|
2215
2253
|
const routeModuleExtensions = /* @__PURE__ */ new Set([
|
|
2216
2254
|
..._chunk67MZTLTFcjs.resolveFarmComponentExtensions.call(void 0, farmConfig.renderer.componentExtensions),
|
|
@@ -2289,7 +2327,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2289
2327
|
scheduleTypeArtifactGen(file, ev, typeArtifacts);
|
|
2290
2328
|
}
|
|
2291
2329
|
if (isI18nCatalogFile(file)) {
|
|
2292
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
2330
|
+
_optionalChain([farmApp, 'optionalAccess', _145 => _145.getI18nRuntime, 'call', _146 => _146(), 'access', _147 => _147.reload, 'call', _148 => _148(), 'access', _149 => _149.then, 'call', _150 => _150(() => server.ws.send({ type: "full-reload", path: "*" })), 'access', _151 => _151.catch, 'call', _152 => _152((error) => _chunkQMNWKQL4cjs.logger.warn(`i18n catalog reload failed: ${error.message}`))]);
|
|
2293
2331
|
}
|
|
2294
2332
|
const isRouteRefreshEvent = (ev !== "change" || isStaticMetadataImageFile(file)) && (isAppRuntimeFile(file) || isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file)));
|
|
2295
2333
|
if (isRouteRefreshEvent) {
|
|
@@ -2302,8 +2340,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2302
2340
|
const reloadsMiddleware = pendingRouteRefreshIncludesMiddleware;
|
|
2303
2341
|
pendingRouteRefreshIncludesMiddleware = false;
|
|
2304
2342
|
Promise.all([
|
|
2305
|
-
_optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
2306
|
-
reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess',
|
|
2343
|
+
_optionalChain([refreshRouteDiscovery, 'optionalCall', _153 => _153(`${ev} ${file}`)]),
|
|
2344
|
+
reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess', _154 => _154.reload, 'call', _155 => _155()]) : void 0
|
|
2307
2345
|
]).then(() => server.ws.send({ type: "full-reload", path: "*" })).catch((error) => _chunkQMNWKQL4cjs.logger.warn(`Route refresh failed: ${error.message}`));
|
|
2308
2346
|
}, 50);
|
|
2309
2347
|
}
|
|
@@ -2342,7 +2380,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2342
2380
|
const { FARM_DEV_SERVER_MODULE_LOADER } = await import("./internal/native-server-fns.cjs");
|
|
2343
2381
|
const load = (file) => _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, file);
|
|
2344
2382
|
globalThis[FARM_DEV_SERVER_MODULE_LOADER] = load;
|
|
2345
|
-
_optionalChain([server, 'access',
|
|
2383
|
+
_optionalChain([server, 'access', _156 => _156.httpServer, 'optionalAccess', _157 => _157.once, 'call', _158 => _158("close", () => {
|
|
2346
2384
|
const globals = globalThis;
|
|
2347
2385
|
if (globals[FARM_DEV_SERVER_MODULE_LOADER] === load) {
|
|
2348
2386
|
delete globals[FARM_DEV_SERVER_MODULE_LOADER];
|
|
@@ -2416,11 +2454,11 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2416
2454
|
});
|
|
2417
2455
|
}
|
|
2418
2456
|
}
|
|
2419
|
-
if (_optionalChain([options, 'access',
|
|
2457
|
+
if (_optionalChain([options, 'access', _159 => _159.openapi, 'optionalAccess', _160 => _160.enabled])) {
|
|
2420
2458
|
const { OpenAPIManager } = await loadFarmOpenAPIDevRuntime();
|
|
2421
2459
|
openAPIManager = new OpenAPIManager(appDirs, options.openapi, {
|
|
2422
2460
|
mode: "development",
|
|
2423
|
-
apiBaseURL: typeof _optionalChain([options, 'access',
|
|
2461
|
+
apiBaseURL: typeof _optionalChain([options, 'access', _161 => _161.api, 'optionalAccess', _162 => _162.baseURL]) === "string" ? options.api.baseURL : void 0,
|
|
2424
2462
|
loadModule: (filePath) => apiRouteManager.loadModule(filePath)
|
|
2425
2463
|
});
|
|
2426
2464
|
const spec = await openAPIManager.generateSpec();
|
|
@@ -2463,20 +2501,20 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2463
2501
|
clientEntry: "/@farm/client.js",
|
|
2464
2502
|
resolveLayoutFonts: resolveDocsLayoutFonts,
|
|
2465
2503
|
fontStylesheetHref: "/@farm/fonts.css",
|
|
2466
|
-
globalStylesheetHref:
|
|
2504
|
+
globalStylesheetHref: _chunkKWST2O22cjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
2467
2505
|
farmConfig.root,
|
|
2468
2506
|
farmConfig.srcDir
|
|
2469
2507
|
),
|
|
2470
2508
|
loadModule: async (specifier) => {
|
|
2471
2509
|
const resolved = await server.environments.ssr.pluginContainer.resolveId(specifier);
|
|
2472
|
-
if (specifier === _optionalChain([farmConfig, 'access',
|
|
2510
|
+
if (specifier === _optionalChain([farmConfig, 'access', _163 => _163.docs, 'access', _164 => _164.adapter, 'optionalAccess', _165 => _165.server]) && _optionalChain([resolved, 'optionalAccess', _166 => _166.id])) {
|
|
2473
2511
|
const file = resolved.id.split("?", 1)[0];
|
|
2474
2512
|
return import(
|
|
2475
2513
|
/* @vite-ignore */
|
|
2476
2514
|
_url.pathToFileURL.call(void 0, file).href
|
|
2477
2515
|
);
|
|
2478
2516
|
}
|
|
2479
|
-
return _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess',
|
|
2517
|
+
return _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess', _167 => _167.id]), () => ( specifier)));
|
|
2480
2518
|
},
|
|
2481
2519
|
registerMCPServer: (mcpServer) => {
|
|
2482
2520
|
const dispose = _chunkLRB5OVRTcjs.registerFarmMCPServer.call(void 0, mcpServer);
|
|
@@ -2494,7 +2532,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2494
2532
|
fontAssets: _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, farmDocsFontAssetList),
|
|
2495
2533
|
resolveLayoutFonts: resolveDocsLayoutFonts,
|
|
2496
2534
|
fontStylesheetHref: "/@farm/fonts.css",
|
|
2497
|
-
globalStylesheetHref:
|
|
2535
|
+
globalStylesheetHref: _chunkKWST2O22cjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
2498
2536
|
farmConfig.root,
|
|
2499
2537
|
farmConfig.srcDir
|
|
2500
2538
|
),
|
|
@@ -2502,7 +2540,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2502
2540
|
basePath: farmConfig.basePath
|
|
2503
2541
|
}) : null;
|
|
2504
2542
|
const farmDocsListsPages = Boolean(
|
|
2505
|
-
farmDocsDevRuntime && _optionalChain([pm, 'optionalAccess',
|
|
2543
|
+
farmDocsDevRuntime && _optionalChain([pm, 'optionalAccess', _168 => _168.getPlugins, 'call', _169 => _169(), 'access', _170 => _170.some, 'call', _171 => _171((plugin2) => plugin2.name === "farm:infra-analytics")])
|
|
2506
2544
|
);
|
|
2507
2545
|
let farmDocsPagePaths;
|
|
2508
2546
|
const getFarmDocsPagePaths = () => {
|
|
@@ -2530,14 +2568,14 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2530
2568
|
}
|
|
2531
2569
|
}
|
|
2532
2570
|
const wrapFarmDocsResponseWithLayouts = async (request, response) => {
|
|
2533
|
-
if (request.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access',
|
|
2571
|
+
if (request.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _172 => _172.headers, 'access', _173 => _173.get, 'call', _174 => _174("content-type"), 'optionalAccess', _175 => _175.toLowerCase, 'call', _176 => _176(), 'access', _177 => _177.includes, 'call', _178 => _178("text/html")])) {
|
|
2534
2572
|
return response;
|
|
2535
2573
|
}
|
|
2536
2574
|
const pathname = new URL(request.url).pathname;
|
|
2537
2575
|
const matchedRoute = routeManager.matchRoute(pathname);
|
|
2538
2576
|
const layoutEntries = matchedRoute.layouts.map((layout) => ({
|
|
2539
2577
|
...layout,
|
|
2540
|
-
metadata:
|
|
2578
|
+
metadata: _chunk2IFT2CSAcjs.getClientModuleMetadata.call(void 0, layout.modulePath, farmConfig.root)
|
|
2541
2579
|
}));
|
|
2542
2580
|
if (!layoutEntries.some((layout) => layout.metadata.shouldHydrate)) {
|
|
2543
2581
|
return response;
|
|
@@ -2551,7 +2589,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2551
2589
|
headers: response.headers
|
|
2552
2590
|
});
|
|
2553
2591
|
}
|
|
2554
|
-
const docsRenderer = _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
2592
|
+
const docsRenderer = _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _179 => _179.getConfig, 'call', _180 => _180()]), () => ( options))).renderer);
|
|
2555
2593
|
const [rendererRuntime, layoutModules] = await Promise.all([
|
|
2556
2594
|
_chunk67MZTLTFcjs.isReactRenderer.call(void 0, docsRenderer) ? import("./renderer/react/server.cjs") : _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, docsRenderer.server),
|
|
2557
2595
|
Promise.all(
|
|
@@ -2580,7 +2618,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
|
|
|
2580
2618
|
])
|
|
2581
2619
|
);
|
|
2582
2620
|
const inlineValue = (value) => JSON.stringify(value).replace(/</g, "\\u003c").replace(/>/g, "\\u003e");
|
|
2583
|
-
const pageModulePath = _optionalChain([matchedRoute, 'access',
|
|
2621
|
+
const pageModulePath = _optionalChain([matchedRoute, 'access', _181 => _181.route, 'optionalAccess', _182 => _182.modulePath]) ? toUrlPath(matchedRoute.route.modulePath) : "";
|
|
2584
2622
|
const bootstrapScript = `<script>
|
|
2585
2623
|
window.__FARM_PROPS__ = ${inlineValue({ params })};
|
|
2586
2624
|
window.__FARM_ROUTE_SLOTS__ = [];
|
|
@@ -2677,7 +2715,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2677
2715
|
}
|
|
2678
2716
|
},
|
|
2679
2717
|
(request) => {
|
|
2680
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
2718
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _183 => _183.getConfig, 'call', _184 => _184()]), () => ( options));
|
|
2681
2719
|
const currentServerConfig = _chunkCFG4QERRcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
|
|
2682
2720
|
return _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, request, {
|
|
2683
2721
|
trustProxy: currentServerConfig.trustProxy
|
|
@@ -2693,7 +2731,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2693
2731
|
withAPIRequestTracing(async function handleFarmDevRequest(req, res, next) {
|
|
2694
2732
|
const requestUrl = req.url || "/";
|
|
2695
2733
|
const requestMethod = req.method || "GET";
|
|
2696
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
2734
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _185 => _185.getConfig, 'call', _186 => _186()]), () => ( options));
|
|
2697
2735
|
const currentServerConfig = _chunkCFG4QERRcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
|
|
2698
2736
|
const parsedRequestUrl = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
2699
2737
|
trustProxy: currentServerConfig.trustProxy
|
|
@@ -2716,7 +2754,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2716
2754
|
}
|
|
2717
2755
|
}
|
|
2718
2756
|
if (requestMethod === "OPTIONS" && req.headers.origin && req.headers["access-control-request-method"]) {
|
|
2719
|
-
const preflightHeaders =
|
|
2757
|
+
const preflightHeaders = _chunkMQ4DYVFScjs.resolveRouteRuleCorsPreflightHeaders.call(void 0,
|
|
2720
2758
|
currentConfig.routeRules,
|
|
2721
2759
|
requestPathname
|
|
2722
2760
|
);
|
|
@@ -2787,7 +2825,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2787
2825
|
openapi: options.openapi
|
|
2788
2826
|
},
|
|
2789
2827
|
workflows: discoveredWorkflows,
|
|
2790
|
-
plugins: _optionalChain([pm, 'optionalAccess',
|
|
2828
|
+
plugins: _optionalChain([pm, 'optionalAccess', _187 => _187.getSortedPlugins, 'call', _188 => _188()])
|
|
2791
2829
|
});
|
|
2792
2830
|
res.statusCode = 200;
|
|
2793
2831
|
res.setHeader(
|
|
@@ -2814,27 +2852,34 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2814
2852
|
const runtimeHookErrorAnswersJSON = rendererDisabled || _chunkXGTFLG73cjs.isFarmAPIPathname.call(void 0, requestPathname, apiServerBasePath);
|
|
2815
2853
|
const requestedPagePathname = configRewriteSource === void 0 ? requestPathname : new URL(configRewriteSource).pathname;
|
|
2816
2854
|
let pageHookRouteMatch;
|
|
2817
|
-
const pageHookRoute = (
|
|
2818
|
-
if (
|
|
2855
|
+
const pageHookRoute = () => {
|
|
2856
|
+
if (pageHookRouteMatch) return pageHookRouteMatch;
|
|
2857
|
+
const pathname2 = requestedPagePathname;
|
|
2819
2858
|
const match = farmApp.getRouteManager().matchRoute(pathname2);
|
|
2820
2859
|
pageHookRouteMatch = {
|
|
2821
2860
|
render: {
|
|
2822
2861
|
pathname: pathname2,
|
|
2823
2862
|
method: requestMethod,
|
|
2824
|
-
routePattern: _optionalChain([match, 'optionalAccess',
|
|
2825
|
-
params: _optionalChain([match, 'optionalAccess',
|
|
2863
|
+
routePattern: _optionalChain([match, 'optionalAccess', _189 => _189.route, 'optionalAccess', _190 => _190.pattern]) || null,
|
|
2864
|
+
params: _optionalChain([match, 'optionalAccess', _191 => _191.params]) || {}
|
|
2826
2865
|
},
|
|
2827
|
-
layoutPatterns: (_optionalChain([match, 'optionalAccess',
|
|
2866
|
+
layoutPatterns: (_optionalChain([match, 'optionalAccess', _192 => _192.layouts]) || []).map((layout) => layout.pattern)
|
|
2828
2867
|
};
|
|
2829
2868
|
return pageHookRouteMatch;
|
|
2830
2869
|
};
|
|
2831
|
-
const
|
|
2870
|
+
const matchAppMetadataRoute = (pathname2) => {
|
|
2871
|
+
const routeManager3 = farmApp.getRouteManager();
|
|
2872
|
+
const image = routeManager3.matchMetadataImage(pathname2);
|
|
2873
|
+
if (image) return { pattern: image.image.pattern, params: image.params };
|
|
2874
|
+
const metadata = routeManager3.matchMetadataRoute(pathname2);
|
|
2875
|
+
return metadata ? { pattern: metadata.metadata.pattern, params: metadata.params } : null;
|
|
2876
|
+
};
|
|
2877
|
+
const runFarmDevPageHooks = async () => {
|
|
2832
2878
|
if (!pm || !pm.hasHook("beforeRouteMatch") && !pm.hasHook("afterRouteMatch") && !pm.hasHook("beforeRender")) {
|
|
2833
2879
|
return;
|
|
2834
2880
|
}
|
|
2835
|
-
const { render, layoutPatterns } = pageHookRoute(
|
|
2836
|
-
|
|
2837
|
-
if (routeManager3.matchMetadataRoute(render.pathname) || routeManager3.matchMetadataImage(render.pathname) || // A path no page route matches is a page only for a GET or HEAD request.
|
|
2881
|
+
const { render, layoutPatterns } = pageHookRoute();
|
|
2882
|
+
if (matchAppMetadataRoute(render.pathname) || // A path no page route matches is a page only for a GET or HEAD request.
|
|
2838
2883
|
!render.routePattern && requestMethod !== "GET" && requestMethod !== "HEAD") {
|
|
2839
2884
|
return;
|
|
2840
2885
|
}
|
|
@@ -2851,15 +2896,19 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2851
2896
|
});
|
|
2852
2897
|
await pm.runHookParallel("beforeRender", render);
|
|
2853
2898
|
};
|
|
2854
|
-
|
|
2855
|
-
|
|
2899
|
+
const meetsRequestedURLRoutes = configRewriteSource === void 0 && !deferredDottedRequests.has(req);
|
|
2900
|
+
const routeRedirect = meetsRequestedURLRoutes ? farmApp.getRouteManager().matchRedirect(requestPathname, parsedRequestUrl.search) : null;
|
|
2901
|
+
if (meetsRequestedURLRoutes && (routeRedirect || pm && (configRoutePlugins.has(_chunkMBCRWU3Pcjs.FARM_CONFIG_HEADERS_PLUGIN_NAME) || configRedirectMatchers.length > 0)) && !isViteOwnedRequest()) {
|
|
2902
|
+
let redirect = routeRedirect;
|
|
2856
2903
|
try {
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2904
|
+
if (pm) {
|
|
2905
|
+
await pm.runHookParallelFiltered(
|
|
2906
|
+
"beforeRequest",
|
|
2907
|
+
(plugin2) => plugin2.name === _chunkMBCRWU3Pcjs.FARM_CONFIG_HEADERS_PLUGIN_NAME,
|
|
2908
|
+
req,
|
|
2909
|
+
res
|
|
2910
|
+
);
|
|
2911
|
+
}
|
|
2863
2912
|
for (const matchRedirect of configRedirectMatchers) {
|
|
2864
2913
|
_nullishCoalesce(redirect, () => ( (redirect = matchRedirect(parsedRequestUrl))));
|
|
2865
2914
|
}
|
|
@@ -2877,17 +2926,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2877
2926
|
status: redirect.statusCode,
|
|
2878
2927
|
headers: { Location: redirect.destination }
|
|
2879
2928
|
});
|
|
2880
|
-
if (opensFarmDevRuntimeSession(pm)) {
|
|
2929
|
+
if (pm && opensFarmDevRuntimeSession(pm)) {
|
|
2881
2930
|
const redirectResponse = response;
|
|
2882
2931
|
try {
|
|
2883
|
-
const
|
|
2932
|
+
const metadataRoute = matchAppMetadataRoute(requestPathname);
|
|
2933
|
+
const kind = metadataRoute ? "asset" : _chunkXGTFLG73cjs.isFarmAPIPathname.call(void 0, requestPathname, apiServerBasePath) ? "api" : requestMethod === "GET" || requestMethod === "HEAD" ? "page" : "request";
|
|
2884
2934
|
response = await pm.runRuntimeRequest(
|
|
2885
2935
|
createRequestFromNodeRequest(req, parsedRequestUrl),
|
|
2886
2936
|
async () => {
|
|
2887
2937
|
if (kind === "page") await runFarmDevPageHooks();
|
|
2888
2938
|
return redirectResponse;
|
|
2889
2939
|
},
|
|
2890
|
-
{ kind, route: { pathname: requestPathname } }
|
|
2940
|
+
{ kind, route: { pathname: requestPathname, ...metadataRoute } }
|
|
2891
2941
|
);
|
|
2892
2942
|
} catch (e23) {
|
|
2893
2943
|
sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
|
|
@@ -2901,7 +2951,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2901
2951
|
}
|
|
2902
2952
|
}
|
|
2903
2953
|
const runAppMiddlewareForContentRoute = async () => {
|
|
2904
|
-
if (!_optionalChain([middlewareManager, 'optionalAccess',
|
|
2954
|
+
if (!_optionalChain([middlewareManager, 'optionalAccess', _193 => _193.hasMiddleware, 'call', _194 => _194()])) return false;
|
|
2905
2955
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
2906
2956
|
return runFarmMiddlewareWithNavigation(
|
|
2907
2957
|
farmApp.getServerRenderer(),
|
|
@@ -2939,7 +2989,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2939
2989
|
return response.status;
|
|
2940
2990
|
};
|
|
2941
2991
|
const runAppMiddlewareInRuntimeSession = async (runtimeSession2, logResponse2) => {
|
|
2942
|
-
const interceptor = runtimeSession2 && _optionalChain([pm, 'optionalAccess',
|
|
2992
|
+
const interceptor = runtimeSession2 && _optionalChain([pm, 'optionalAccess', _195 => _195.hasRuntimeHook, 'call', _196 => _196("after")]) && _optionalChain([middlewareManager, 'optionalAccess', _197 => _197.hasMiddleware, 'call', _198 => _198()]) ? interceptFarmDevPageResponse({
|
|
2943
2993
|
req,
|
|
2944
2994
|
res,
|
|
2945
2995
|
pm,
|
|
@@ -2952,7 +3002,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2952
3002
|
urlPath: requestUrl,
|
|
2953
3003
|
pathname: requestPathname,
|
|
2954
3004
|
startTime: Date.now(),
|
|
2955
|
-
logResponse: (_method, _path, status) => _optionalChain([logResponse2, 'optionalCall',
|
|
3005
|
+
logResponse: (_method, _path, status) => _optionalChain([logResponse2, 'optionalCall', _199 => _199(status)]),
|
|
2956
3006
|
// The runtime reports a runtime.after failure itself.
|
|
2957
3007
|
emitError: async () => {
|
|
2958
3008
|
},
|
|
@@ -2963,7 +3013,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2963
3013
|
handled = await runAppMiddlewareForContentRoute();
|
|
2964
3014
|
} catch (error) {
|
|
2965
3015
|
if (runtimeHookErrorAnswersJSON || res.headersSent) {
|
|
2966
|
-
_optionalChain([interceptor, 'optionalAccess',
|
|
3016
|
+
_optionalChain([interceptor, 'optionalAccess', _200 => _200.release, 'call', _201 => _201()]);
|
|
2967
3017
|
throw error;
|
|
2968
3018
|
}
|
|
2969
3019
|
if (runtimeSession2) await pm.reportRuntimeRequestError(runtimeSession2, error);
|
|
@@ -2971,10 +3021,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2971
3021
|
return true;
|
|
2972
3022
|
}
|
|
2973
3023
|
if (!handled) {
|
|
2974
|
-
_optionalChain([interceptor, 'optionalAccess',
|
|
3024
|
+
_optionalChain([interceptor, 'optionalAccess', _202 => _202.release, 'call', _203 => _203()]);
|
|
2975
3025
|
return false;
|
|
2976
3026
|
}
|
|
2977
|
-
if (!_optionalChain([interceptor, 'optionalAccess',
|
|
3027
|
+
if (!_optionalChain([interceptor, 'optionalAccess', _204 => _204.isEnded, 'call', _205 => _205()])) _optionalChain([logResponse2, 'optionalCall', _206 => _206(res.statusCode || 200)]);
|
|
2978
3028
|
return true;
|
|
2979
3029
|
};
|
|
2980
3030
|
const serveBuiltInRoute = async (respond, {
|
|
@@ -2983,7 +3033,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2983
3033
|
label
|
|
2984
3034
|
} = {}) => {
|
|
2985
3035
|
const discard = async () => {
|
|
2986
|
-
await _optionalChain([computed, 'optionalAccess',
|
|
3036
|
+
await _optionalChain([computed, 'optionalAccess', _207 => _207.body, 'optionalAccess', _208 => _208.cancel, 'call', _209 => _209(), 'access', _210 => _210.catch, 'call', _211 => _211(() => {
|
|
2987
3037
|
})]);
|
|
2988
3038
|
};
|
|
2989
3039
|
const sendRuntimeResponse = async (runtimeSession3, response2) => {
|
|
@@ -3000,9 +3050,9 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3000
3050
|
if (pm && opensFarmDevRuntimeSession(pm)) {
|
|
3001
3051
|
try {
|
|
3002
3052
|
const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath);
|
|
3003
|
-
const route =
|
|
3053
|
+
const route = _chunkSXMWVP2Lcjs.setFarmRouteLabel.call(void 0,
|
|
3004
3054
|
{ pathname: requestPathname },
|
|
3005
|
-
label !== void 0 ? label : devBuiltInRoutePaths.has(routePathname) ? routePathname :
|
|
3055
|
+
label !== void 0 ? label : devBuiltInRoutePaths.has(routePathname) ? routePathname : _chunkSXMWVP2Lcjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath)
|
|
3006
3056
|
);
|
|
3007
3057
|
runtimeSession2 = await pm.beginRuntimeRequest(
|
|
3008
3058
|
createRequestFromNodeRequest(req, new URL(fullUrl)),
|
|
@@ -3040,7 +3090,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3040
3090
|
}
|
|
3041
3091
|
responding = true;
|
|
3042
3092
|
response = await respond(
|
|
3043
|
-
_nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess',
|
|
3093
|
+
_nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess', _212 => _212.request]), () => ( createRequestFromNodeRequest(req, new URL(fullUrl))))
|
|
3044
3094
|
);
|
|
3045
3095
|
} catch (error) {
|
|
3046
3096
|
if (!responding && !res.headersSent) {
|
|
@@ -3060,7 +3110,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3060
3110
|
else await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, response);
|
|
3061
3111
|
};
|
|
3062
3112
|
const openAPIRequestPathname = openAPIManager ? _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) : requestPathname;
|
|
3063
|
-
if (openAPIManager && _optionalChain([options, 'access',
|
|
3113
|
+
if (openAPIManager && _optionalChain([options, 'access', _213 => _213.openapi, 'optionalAccess', _214 => _214.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
|
|
3064
3114
|
const specManager = openAPIManager;
|
|
3065
3115
|
await serveBuiltInRoute(async () => {
|
|
3066
3116
|
if (requestMethod !== "GET" && requestMethod !== "HEAD") {
|
|
@@ -3080,7 +3130,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3080
3130
|
});
|
|
3081
3131
|
return;
|
|
3082
3132
|
}
|
|
3083
|
-
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access',
|
|
3133
|
+
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _215 => _215.openapi, 'optionalAccess', _216 => _216.route])) {
|
|
3084
3134
|
const docsManager = openAPIManager;
|
|
3085
3135
|
await serveBuiltInRoute(
|
|
3086
3136
|
async () => {
|
|
@@ -3091,20 +3141,20 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3091
3141
|
);
|
|
3092
3142
|
return;
|
|
3093
3143
|
}
|
|
3094
|
-
if (_optionalChain([options, 'access',
|
|
3144
|
+
if (_optionalChain([options, 'access', _217 => _217.agent, 'optionalAccess', _218 => _218.manifest]) !== false && _chunkSXMWVP2Lcjs.isFarmAppManifestPath.call(void 0, _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath))) {
|
|
3095
3145
|
await serveBuiltInRoute(async () => {
|
|
3096
|
-
_nullishCoalesce(farmAppPackages, () => ( (farmAppPackages =
|
|
3097
|
-
const manifest = await
|
|
3146
|
+
_nullishCoalesce(farmAppPackages, () => ( (farmAppPackages = _chunkKWST2O22cjs.resolveFarmAppPackages.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd()))))));
|
|
3147
|
+
const manifest = await _chunkSXMWVP2Lcjs.createFarmAppManifestResponse.call(void 0,
|
|
3098
3148
|
new Request(parsedRequestUrl, {
|
|
3099
3149
|
method: requestMethod,
|
|
3100
3150
|
headers: { "if-none-match": String(_nullishCoalesce(req.headers["if-none-match"], () => ( ""))) }
|
|
3101
3151
|
}),
|
|
3102
3152
|
{
|
|
3103
|
-
...
|
|
3153
|
+
..._chunkSXMWVP2Lcjs.resolveFarmAppManifestInput.call(void 0, farmConfig, {
|
|
3104
3154
|
build: "development",
|
|
3105
3155
|
packages: farmAppPackages,
|
|
3106
3156
|
// Read again on each request; unchanged files come from a cache.
|
|
3107
|
-
webmcpTools: _optionalChain([farmConfig, 'access',
|
|
3157
|
+
webmcpTools: _optionalChain([farmConfig, 'access', _219 => _219.plugins, 'optionalAccess', _220 => _220.some, 'call', _221 => _221(({ name }) => name === "farm:webmcp")]) ? _chunkKWST2O22cjs.collectFarmWebMCPTools.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd())), farmConfig.srcDir) : []
|
|
3108
3158
|
}),
|
|
3109
3159
|
defaultMCP: () => farmApp.getServerRenderer().getDefaultMCPServer(),
|
|
3110
3160
|
// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
@@ -3122,11 +3172,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3122
3172
|
});
|
|
3123
3173
|
return;
|
|
3124
3174
|
}
|
|
3125
|
-
if (_optionalChain([options, 'access',
|
|
3175
|
+
if (_optionalChain([options, 'access', _222 => _222.agent, 'optionalAccess', _223 => _223.apiCatalog]) && _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunkSXMWVP2Lcjs.FARM_API_CATALOG_PATH) {
|
|
3126
3176
|
await serveBuiltInRoute(
|
|
3127
|
-
() =>
|
|
3177
|
+
() => _chunkSXMWVP2Lcjs.createFarmApiCatalogResponse.call(void 0,
|
|
3128
3178
|
requestMethod,
|
|
3129
|
-
|
|
3179
|
+
_chunkSXMWVP2Lcjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
|
|
3130
3180
|
new Request(parsedRequestUrl, {
|
|
3131
3181
|
headers: { "user-agent": String(_nullishCoalesce(req.headers["user-agent"], () => ( ""))) }
|
|
3132
3182
|
})
|
|
@@ -3134,8 +3184,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3134
3184
|
);
|
|
3135
3185
|
return;
|
|
3136
3186
|
}
|
|
3137
|
-
if (_optionalChain([options, 'access',
|
|
3138
|
-
const aiCatalog =
|
|
3187
|
+
if (_optionalChain([options, 'access', _224 => _224.agent, 'optionalAccess', _225 => _225.aiCatalog]) !== false) {
|
|
3188
|
+
const aiCatalog = _chunkSXMWVP2Lcjs.createFarmAiCatalogResponse.call(void 0,
|
|
3139
3189
|
new Request(parsedRequestUrl, {
|
|
3140
3190
|
method: requestMethod,
|
|
3141
3191
|
headers: {
|
|
@@ -3178,7 +3228,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3178
3228
|
const docsBodyInit = requestMethod === "GET" || requestMethod === "HEAD" ? {} : { body: _chunkCFG4QERRcjs.createFarmNodeRequestBodyStream.call(void 0, req), duplex: "half" };
|
|
3179
3229
|
const docsResponse = await farmDocsHandler(new Request(docsRequest, docsBodyInit));
|
|
3180
3230
|
if (docsResponse) {
|
|
3181
|
-
const docsPage = _optionalChain([docsResponse, 'access',
|
|
3231
|
+
const docsPage = _optionalChain([docsResponse, 'access', _226 => _226.headers, 'access', _227 => _227.get, 'call', _228 => _228("content-type"), 'optionalAccess', _229 => _229.toLowerCase, 'call', _230 => _230(), 'access', _231 => _231.includes, 'call', _232 => _232("text/html")]);
|
|
3182
3232
|
await serveBuiltInRoute(
|
|
3183
3233
|
async (request) => {
|
|
3184
3234
|
if (!docsPage) return wrapFarmDocsResponseWithLayouts(docsRequest, docsResponse);
|
|
@@ -3187,7 +3237,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3187
3237
|
farmConfig.deploymentId
|
|
3188
3238
|
);
|
|
3189
3239
|
if (deploymentMismatch) {
|
|
3190
|
-
await _optionalChain([docsResponse, 'access',
|
|
3240
|
+
await _optionalChain([docsResponse, 'access', _233 => _233.body, 'optionalAccess', _234 => _234.cancel, 'call', _235 => _235()]);
|
|
3191
3241
|
return _chunkNLBHLPEOcjs.createFarmDeploymentMismatchResponse.call(void 0, deploymentMismatch);
|
|
3192
3242
|
}
|
|
3193
3243
|
return _chunkNLBHLPEOcjs.withFarmDeploymentResponse.call(void 0,
|
|
@@ -3203,11 +3253,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3203
3253
|
{
|
|
3204
3254
|
kind: "docs",
|
|
3205
3255
|
computed: docsResponse,
|
|
3206
|
-
label:
|
|
3256
|
+
label: _chunkSXMWVP2Lcjs.resolveFarmDocsEngineRouteLabel.call(void 0,
|
|
3207
3257
|
_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath),
|
|
3208
3258
|
{
|
|
3209
|
-
path: _optionalChain([farmConfig, 'access',
|
|
3210
|
-
roots: _optionalChain([farmConfig, 'access',
|
|
3259
|
+
path: _optionalChain([farmConfig, 'access', _236 => _236.docs, 'optionalAccess', _237 => _237.entry]) || "/docs",
|
|
3260
|
+
roots: _optionalChain([farmConfig, 'access', _238 => _238.docs, 'optionalAccess', _239 => _239.roots, 'optionalAccess', _240 => _240.map, 'call', _241 => _241((root) => root.entry)]),
|
|
3211
3261
|
pages: await getFarmDocsPagePaths()
|
|
3212
3262
|
}
|
|
3213
3263
|
)
|
|
@@ -3216,7 +3266,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3216
3266
|
return;
|
|
3217
3267
|
}
|
|
3218
3268
|
}
|
|
3219
|
-
if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD" || requestMethod === "POST") && _optionalChain([req, 'access',
|
|
3269
|
+
if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD" || requestMethod === "POST") && _optionalChain([req, 'access', _242 => _242.headers, 'access', _243 => _243.accept, 'optionalAccess', _244 => _244.includes, 'call', _245 => _245(_chunk3HLQTOVUcjs.FARM_NATIVE_TREE_CONTENT_TYPE)])) {
|
|
3220
3270
|
const { createFarmNativeTreeResponse } = await import("./native-tree-GF4BH33L.cjs");
|
|
3221
3271
|
const treeBodyInit = requestMethod === "POST" ? { body: _chunkCFG4QERRcjs.createFarmNodeRequestBodyStream.call(void 0, req), duplex: "half" } : {};
|
|
3222
3272
|
const treeResponse = await createFarmNativeTreeResponse({
|
|
@@ -3234,18 +3284,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3234
3284
|
});
|
|
3235
3285
|
await serveBuiltInRoute(() => treeResponse, {
|
|
3236
3286
|
computed: treeResponse,
|
|
3237
|
-
label: _nullishCoalesce(_optionalChain([farmApp, 'access',
|
|
3287
|
+
label: _nullishCoalesce(_optionalChain([farmApp, 'access', _246 => _246.getRouteManager, 'call', _247 => _247(), 'access', _248 => _248.matchRoute, 'call', _249 => _249(_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath)), 'access', _250 => _250.route, 'optionalAccess', _251 => _251.pattern]), () => ( null))
|
|
3238
3288
|
});
|
|
3239
3289
|
return;
|
|
3240
3290
|
}
|
|
3241
3291
|
const markdownRouteLabel = () => (
|
|
3242
3292
|
// On the route path, as production labels it: /fr/index.md is /index.md.
|
|
3243
|
-
|
|
3293
|
+
_chunkSXMWVP2Lcjs.resolveFarmMarkdownRouteLabel.call(void 0,
|
|
3244
3294
|
toRoutePathname(requestPathname),
|
|
3245
|
-
(page) => _optionalChain([farmApp, 'access',
|
|
3295
|
+
(page) => _optionalChain([farmApp, 'access', _252 => _252.getRouteManager, 'call', _253 => _253(), 'access', _254 => _254.matchRoute, 'call', _255 => _255(page), 'access', _256 => _256.route, 'optionalAccess', _257 => _257.pattern])
|
|
3246
3296
|
)
|
|
3247
3297
|
);
|
|
3248
|
-
const markdownSourceResponse = viteModuleRequest ? null : await
|
|
3298
|
+
const markdownSourceResponse = viteModuleRequest ? null : await _chunkL6E4SHUBcjs.createFarmMarkdownSourceResponse.call(void 0, {
|
|
3249
3299
|
request: new Request(fullUrl, {
|
|
3250
3300
|
method: requestMethod,
|
|
3251
3301
|
headers: docsHeaders
|
|
@@ -3254,7 +3304,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3254
3304
|
routePathname: toRoutePathname,
|
|
3255
3305
|
resolveSource: async (pathname2) => {
|
|
3256
3306
|
const match = farmApp.getRouteManager().matchRoute(pathname2);
|
|
3257
|
-
const sourcePath = _optionalChain([match, 'access',
|
|
3307
|
+
const sourcePath = _optionalChain([match, 'access', _258 => _258.route, 'optionalAccess', _259 => _259.markdownSourcePath]) || (match.route && _chunkL6E4SHUBcjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
|
|
3258
3308
|
if (!sourcePath) {
|
|
3259
3309
|
return null;
|
|
3260
3310
|
}
|
|
@@ -3326,7 +3376,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3326
3376
|
return;
|
|
3327
3377
|
}
|
|
3328
3378
|
if (!viteModuleRequest && _chunkC2JOS77Zcjs.farmRequestWantsMarkdown.call(void 0, requestPathname, req.headers.accept)) {
|
|
3329
|
-
const markdownRoute = farmApp.getRouteManager().matchRoute(
|
|
3379
|
+
const markdownRoute = farmApp.getRouteManager().matchRoute(_chunkL6E4SHUBcjs.normalizeFarmMarkdownRoutePath.call(void 0, requestPathname, toRoutePathname));
|
|
3330
3380
|
if (!markdownRoute.route) {
|
|
3331
3381
|
await serveBuiltInRoute(
|
|
3332
3382
|
() => new Response(
|
|
@@ -3410,7 +3460,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3410
3460
|
"beforeRequest",
|
|
3411
3461
|
(plugin2) => {
|
|
3412
3462
|
const owner = _chunkJX5VOLAVcjs.getFarmIntegrationPluginOwner.call(void 0, plugin2);
|
|
3413
|
-
return !isFarmConfigRoutePlugin(plugin2) && (_optionalChain([owner, 'optionalAccess',
|
|
3463
|
+
return !isFarmConfigRoutePlugin(plugin2) && (_optionalChain([owner, 'optionalAccess', _260 => _260.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
|
|
3414
3464
|
},
|
|
3415
3465
|
req,
|
|
3416
3466
|
res
|
|
@@ -3447,7 +3497,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3447
3497
|
isProd: false
|
|
3448
3498
|
},
|
|
3449
3499
|
request,
|
|
3450
|
-
{ clientAddress: _optionalChain([req, 'access',
|
|
3500
|
+
{ clientAddress: _optionalChain([req, 'access', _261 => _261.socket, 'optionalAccess', _262 => _262.remoteAddress]) }
|
|
3451
3501
|
);
|
|
3452
3502
|
if (!result) {
|
|
3453
3503
|
throw new Error(`Matched integration route did not return a response`);
|
|
@@ -3455,7 +3505,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3455
3505
|
return result;
|
|
3456
3506
|
} catch (error) {
|
|
3457
3507
|
_chunkQMNWKQL4cjs.logger.error(`Integration route error: ${error}`);
|
|
3458
|
-
await _optionalChain([runtime, 'optionalAccess',
|
|
3508
|
+
await _optionalChain([runtime, 'optionalAccess', _263 => _263.reportError, 'call', _264 => _264(error)]);
|
|
3459
3509
|
return _chunkXGTFLG73cjs.createFarmInternalServerErrorResponse.call(void 0, );
|
|
3460
3510
|
}
|
|
3461
3511
|
};
|
|
@@ -3509,7 +3559,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3509
3559
|
_chunkJX5VOLAVcjs.matchIntegrationRoute.call(void 0, configuredIntegrations, {
|
|
3510
3560
|
pathname: requestPathname,
|
|
3511
3561
|
method: requestMethod
|
|
3512
|
-
}) || routeManager3.matchRedirect(requestPathname) || apiRouteManager.matchRoute(requestPathname) || farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
3562
|
+
}) || routeManager3.matchRedirect(requestPathname) || apiRouteManager.matchRoute(requestPathname) || farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _265 => _265.isFarmDocsAPIRequest, 'call', _266 => _266(requestPathname)]) || routeManager3.matchRoute(requestPathname).route || routeManager3.matchMetadataRoute(requestPathname) || routeManager3.matchMetadataImage(requestPathname)
|
|
3513
3563
|
);
|
|
3514
3564
|
};
|
|
3515
3565
|
try {
|
|
@@ -3541,13 +3591,6 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3541
3591
|
if (await tryConfiguredIntegrationRoute()) {
|
|
3542
3592
|
return;
|
|
3543
3593
|
}
|
|
3544
|
-
const redirectMatch = farmApp.getRouteManager().matchRedirect(requestPathname, parsedRequestUrl.search);
|
|
3545
|
-
if (redirectMatch) {
|
|
3546
|
-
res.statusCode = redirectMatch.statusCode;
|
|
3547
|
-
res.setHeader("Location", redirectMatch.destination);
|
|
3548
|
-
res.end(`Redirecting to ${redirectMatch.destination}`);
|
|
3549
|
-
return;
|
|
3550
|
-
}
|
|
3551
3594
|
const matchedApiRoute = apiRouteManager.matchRoute(requestPathname);
|
|
3552
3595
|
const hasMatchedApiRoute = Boolean(matchedApiRoute);
|
|
3553
3596
|
if (hasMatchedApiRoute || _chunkXGTFLG73cjs.isFarmAPIPathname.call(void 0, requestPathname, apiServerBasePath)) {
|
|
@@ -3601,15 +3644,15 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3601
3644
|
});
|
|
3602
3645
|
};
|
|
3603
3646
|
const isDocsAPIRequest = Boolean(
|
|
3604
|
-
farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
3647
|
+
farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _267 => _267.isFarmDocsAPIRequest, 'call', _268 => _268(pathname2)])
|
|
3605
3648
|
);
|
|
3606
3649
|
const docsRuntimeOptions = () => ({
|
|
3607
3650
|
kind: "docs",
|
|
3608
|
-
route:
|
|
3651
|
+
route: _chunkSXMWVP2Lcjs.setFarmRouteLabel.call(void 0,
|
|
3609
3652
|
{ pathname: pathname2, pattern: urlPath2 },
|
|
3610
|
-
|
|
3611
|
-
path: _optionalChain([farmConfig, 'access',
|
|
3612
|
-
roots: _optionalChain([farmConfig, 'access',
|
|
3653
|
+
_chunkSXMWVP2Lcjs.resolveFarmDocsRouteLabel.call(void 0, pathname2, {
|
|
3654
|
+
path: _optionalChain([farmConfig, 'access', _269 => _269.docs, 'optionalAccess', _270 => _270.entry]) || "/docs",
|
|
3655
|
+
roots: _optionalChain([farmConfig, 'access', _271 => _271.docs, 'optionalAccess', _272 => _272.roots, 'optionalAccess', _273 => _273.map, 'call', _274 => _274((root) => root.entry)])
|
|
3613
3656
|
})
|
|
3614
3657
|
)
|
|
3615
3658
|
});
|
|
@@ -3691,7 +3734,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3691
3734
|
const routedApiRoute = rewritten ? apiRouteManager.matchRoute(routedPathname) : matchedApiRoute || apiRouteManager.matchRoute(pathname2);
|
|
3692
3735
|
const hasExplicitAPIRoute = Boolean(routedApiRoute);
|
|
3693
3736
|
if (apiHandler && hasExplicitAPIRoute) {
|
|
3694
|
-
const apiRoutePattern = _optionalChain([routedApiRoute, 'optionalAccess',
|
|
3737
|
+
const apiRoutePattern = _optionalChain([routedApiRoute, 'optionalAccess', _275 => _275.route, 'access', _276 => _276.path]) || urlPath2;
|
|
3695
3738
|
_chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
|
|
3696
3739
|
type: "route.matched",
|
|
3697
3740
|
pathname: pathname2,
|
|
@@ -3741,7 +3784,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3741
3784
|
error
|
|
3742
3785
|
});
|
|
3743
3786
|
_chunkQMNWKQL4cjs.logger.error(`API route error: ${error}`);
|
|
3744
|
-
await _optionalChain([runtime, 'optionalAccess',
|
|
3787
|
+
await _optionalChain([runtime, 'optionalAccess', _277 => _277.reportError, 'call', _278 => _278(error)]);
|
|
3745
3788
|
response = _chunkXGTFLG73cjs.createFarmInternalServerErrorResponse.call(void 0, );
|
|
3746
3789
|
}
|
|
3747
3790
|
return pm ? await pm.runHookSerial("afterApiHandler", response, apiLifecyclePayload) : response;
|
|
@@ -3846,12 +3889,12 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3846
3889
|
}
|
|
3847
3890
|
return;
|
|
3848
3891
|
}
|
|
3849
|
-
if (_optionalChain([req, 'access',
|
|
3892
|
+
if (_optionalChain([req, 'access', _279 => _279.url, 'optionalAccess', _280 => _280.startsWith, 'call', _281 => _281("/@")]) || _optionalChain([req, 'access', _282 => _282.url, 'optionalAccess', _283 => _283.startsWith, 'call', _284 => _284("/node_modules")])) {
|
|
3850
3893
|
return next();
|
|
3851
3894
|
}
|
|
3852
3895
|
if (!deferredDottedRequests.has(req) && shouldBypassFarmRouterForDottedPath(
|
|
3853
3896
|
requestPathname,
|
|
3854
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
3897
|
+
_optionalChain([farmApp, 'optionalAccess', _285 => _285.getRouteManager, 'call', _286 => _286()]),
|
|
3855
3898
|
[server.config.publicDir, server.config.root],
|
|
3856
3899
|
farmAgentGeneratedPaths(farmConfig),
|
|
3857
3900
|
requestMethod
|
|
@@ -3859,7 +3902,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3859
3902
|
if (!viteModuleRequest) deferredDottedRequests.set(req, requestUrl);
|
|
3860
3903
|
return next();
|
|
3861
3904
|
}
|
|
3862
|
-
if (_optionalChain([req, 'access',
|
|
3905
|
+
if (_optionalChain([req, 'access', _287 => _287.url, 'optionalAccess', _288 => _288.startsWith, 'call', _289 => _289("/__farm/page-data")])) {
|
|
3863
3906
|
const urlObj = parsedRequestUrl;
|
|
3864
3907
|
const targetPath = urlObj.searchParams.get("path") || "/";
|
|
3865
3908
|
let renderedRequest;
|
|
@@ -3889,7 +3932,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3889
3932
|
renderedRequest = targetRequest;
|
|
3890
3933
|
let middlewareMap = /* @__PURE__ */ new Map();
|
|
3891
3934
|
let middlewareContext = /* @__PURE__ */ new Map();
|
|
3892
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
3935
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _290 => _290.hasMiddleware, 'call', _291 => _291()])) {
|
|
3893
3936
|
const targetNodeRequest = createPageDataMiddlewareRequest(req, targetRequestUrl);
|
|
3894
3937
|
const targetNodeResponse = createPageDataMiddlewareResponse(res);
|
|
3895
3938
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
@@ -3923,10 +3966,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3923
3966
|
if (pm) {
|
|
3924
3967
|
await pm.runHookParallel("afterRouteMatch", {
|
|
3925
3968
|
pathname: targetPath,
|
|
3926
|
-
matched: !!_optionalChain([match, 'optionalAccess',
|
|
3927
|
-
routePattern: _optionalChain([match, 'optionalAccess',
|
|
3928
|
-
params: _optionalChain([match, 'optionalAccess',
|
|
3929
|
-
layoutPatterns: (_optionalChain([match, 'optionalAccess',
|
|
3969
|
+
matched: !!_optionalChain([match, 'optionalAccess', _292 => _292.route]),
|
|
3970
|
+
routePattern: _optionalChain([match, 'optionalAccess', _293 => _293.route, 'optionalAccess', _294 => _294.pattern]) || null,
|
|
3971
|
+
params: _optionalChain([match, 'optionalAccess', _295 => _295.params]) || {},
|
|
3972
|
+
layoutPatterns: (_optionalChain([match, 'optionalAccess', _296 => _296.layouts]) || []).map((l) => l.pattern)
|
|
3930
3973
|
});
|
|
3931
3974
|
}
|
|
3932
3975
|
if (!match) {
|
|
@@ -3949,7 +3992,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3949
3992
|
);
|
|
3950
3993
|
const loadingModule = loadingBoundary ? await routeManager3.loadRouteModule(loadingBoundary.modulePath) : null;
|
|
3951
3994
|
const navigationManifest = routeManager3.generateClientManifest(server.config.root);
|
|
3952
|
-
const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => (
|
|
3995
|
+
const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => ( _chunk2IFT2CSAcjs.getClientModuleMetadata.call(void 0, route.modulePath, server.config.root)));
|
|
3953
3996
|
const isClientComponent = moduleMetadata.isClientComponent;
|
|
3954
3997
|
const shouldHydrate = moduleMetadata.shouldHydrate;
|
|
3955
3998
|
let mergedMetadata = {};
|
|
@@ -3957,7 +4000,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3957
4000
|
layouts.map((layout) => routeManager3.loadLayoutModule(layout.modulePath))
|
|
3958
4001
|
);
|
|
3959
4002
|
const layoutHydrationMetadata = layouts.map(
|
|
3960
|
-
(layout) => _nullishCoalesce(navigationManifest.layouts.find((entry) => entry.pattern === layout.pattern), () => (
|
|
4003
|
+
(layout) => _nullishCoalesce(navigationManifest.layouts.find((entry) => entry.pattern === layout.pattern), () => ( _chunk2IFT2CSAcjs.getClientModuleMetadata.call(void 0, layout.modulePath, server.config.root)))
|
|
3961
4004
|
);
|
|
3962
4005
|
const shouldHydrateLayout = layoutHydrationMetadata.some(
|
|
3963
4006
|
(metadata) => metadata.shouldHydrate
|
|
@@ -3969,17 +4012,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3969
4012
|
)
|
|
3970
4013
|
];
|
|
3971
4014
|
const hydrationIslandStrategy = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0,
|
|
3972
|
-
_optionalChain([(_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3973
|
-
) === "islands" ?
|
|
4015
|
+
_optionalChain([(_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _297 => _297.getConfig, 'call', _298 => _298()]), () => ( options))), 'access', _299 => _299.experimental, 'optionalAccess', _300 => _300.serverComponents])
|
|
4016
|
+
) === "islands" ? _chunkKWST2O22cjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
3974
4017
|
route,
|
|
3975
4018
|
{ shouldHydrate, islandStrategy: _nullishCoalesce(moduleMetadata.islandStrategy, () => ( null)) },
|
|
3976
4019
|
layouts.map((layout, index) => ({
|
|
3977
4020
|
pattern: layout.pattern,
|
|
3978
4021
|
modulePath: layout.modulePath,
|
|
3979
|
-
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access',
|
|
4022
|
+
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _301 => _301[index], 'optionalAccess', _302 => _302.shouldHydrate]) === true,
|
|
3980
4023
|
// Manifest entries carry it; metadata read from source does not.
|
|
3981
|
-
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access',
|
|
3982
|
-
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access',
|
|
4024
|
+
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access', _303 => _303[index], 'optionalAccess', _304 => _304.hasIsolatedClientBoundaries]) === true,
|
|
4025
|
+
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _305 => _305[index], 'optionalAccess', _306 => _306.islandStrategy]), () => ( null))
|
|
3983
4026
|
})),
|
|
3984
4027
|
server.config.root,
|
|
3985
4028
|
true
|
|
@@ -4036,7 +4079,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4036
4079
|
const slotModule = await routeManager3.loadRouteModule(slot.route.modulePath);
|
|
4037
4080
|
const slotMetadata = _nullishCoalesce(navigationManifest.slots.find(
|
|
4038
4081
|
(entry) => entry.name === slot.name && entry.ownerPattern === slot.ownerPattern && entry.pattern === slot.route.pattern
|
|
4039
|
-
), () => (
|
|
4082
|
+
), () => ( _chunk2IFT2CSAcjs.getClientModuleMetadata.call(void 0, slot.route.modulePath, server.config.root)));
|
|
4040
4083
|
const slotContext = await _chunkX333W5KVcjs.resolveFarmRouteContext.call(void 0, farmApp.getConfig(), {
|
|
4041
4084
|
request: targetRequest,
|
|
4042
4085
|
params: slot.params,
|
|
@@ -4086,7 +4129,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4086
4129
|
pageShouldHydrate: shouldHydrate,
|
|
4087
4130
|
layoutShouldHydrate: shouldHydrateLayout,
|
|
4088
4131
|
islandStrategy: hydrationIslandStrategy,
|
|
4089
|
-
rendering:
|
|
4132
|
+
rendering: _chunkCSQPMV3Qcjs.resolveRouteRenderingConfig.call(void 0, routeModule)
|
|
4090
4133
|
});
|
|
4091
4134
|
const destinationLayoutPatterns = layouts.map((layout) => layout.pattern);
|
|
4092
4135
|
const layoutStartIndex = _chunk2MR4MABGcjs.getSharedLayoutPrefixLength.call(void 0,
|
|
@@ -4100,7 +4143,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4100
4143
|
middlewareContext,
|
|
4101
4144
|
() => renderer.renderNavigationFragment({
|
|
4102
4145
|
PageComponent: routeModule.default,
|
|
4103
|
-
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess',
|
|
4146
|
+
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _307 => _307.default]),
|
|
4104
4147
|
pageProps: routeProps,
|
|
4105
4148
|
params,
|
|
4106
4149
|
layouts: layouts.map((layout, index) => ({
|
|
@@ -4213,47 +4256,49 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4213
4256
|
trustProxy: currentServerConfig.trustProxy
|
|
4214
4257
|
}).pathname;
|
|
4215
4258
|
const routeManager2 = farmApp.getRouteManager();
|
|
4216
|
-
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
4217
|
-
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
4218
|
-
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
4259
|
+
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _308 => _308.hasHook, 'call', _309 => _309("beforeRequest")]), () => ( false));
|
|
4260
|
+
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _310 => _310.hasHook, 'call', _311 => _311("afterResponse")]), () => ( false));
|
|
4261
|
+
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _312 => _312.hasHook, 'call', _313 => _313("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _314 => _314.hasHook, 'call', _315 => _315("afterRender")]), () => ( false)));
|
|
4219
4262
|
const opensRuntimeSession = pm ? opensFarmDevRuntimeSession(pm) : false;
|
|
4220
|
-
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
4221
|
-
const requestedMatch = routeManager2.matchRoute(requestedPathname);
|
|
4263
|
+
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _316 => _316.hasRuntimeHook, 'call', _317 => _317("after")]), () => ( false));
|
|
4222
4264
|
const pageBuiltInRouteLabel = (pathname2) => {
|
|
4223
4265
|
const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, pathname2, farmConfig.basePath);
|
|
4224
|
-
const mcpLabel =
|
|
4266
|
+
const mcpLabel = _chunkSXMWVP2Lcjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath);
|
|
4225
4267
|
if (mcpLabel) return mcpLabel;
|
|
4226
4268
|
if (farmAgentGeneratedPaths(farmConfig).includes(routePathname)) return routePathname;
|
|
4227
|
-
return routePathname ===
|
|
4269
|
+
return routePathname === _chunkTP4RAV7Ycjs.FARM_DEFAULT_MCP_PATH && farmApp.getServerRenderer().getDefaultMCPServer() ? _chunkTP4RAV7Ycjs.FARM_DEFAULT_MCP_PATH : null;
|
|
4270
|
+
};
|
|
4271
|
+
const pageRuntimeOptions = (pathname2) => {
|
|
4272
|
+
const match = routeManager2.matchRoute(pathname2);
|
|
4273
|
+
return {
|
|
4274
|
+
kind: "page",
|
|
4275
|
+
route: _chunkSXMWVP2Lcjs.setFarmRouteLabel.call(void 0,
|
|
4276
|
+
{
|
|
4277
|
+
pathname: pathname2,
|
|
4278
|
+
pattern: _optionalChain([match, 'optionalAccess', _318 => _318.route, 'optionalAccess', _319 => _319.pattern]) || null,
|
|
4279
|
+
params: _optionalChain([match, 'optionalAccess', _320 => _320.params]) || {}
|
|
4280
|
+
},
|
|
4281
|
+
_optionalChain([match, 'optionalAccess', _321 => _321.route]) ? null : pageBuiltInRouteLabel(pathname2)
|
|
4282
|
+
)
|
|
4283
|
+
};
|
|
4228
4284
|
};
|
|
4229
4285
|
let runtimeSession;
|
|
4230
4286
|
let pathname = requestedPathname;
|
|
4231
|
-
let pageHookPathname = requestedPagePathname;
|
|
4232
4287
|
if (pm && opensRuntimeSession) {
|
|
4233
4288
|
try {
|
|
4234
|
-
const
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
pathname: requestedPathname,
|
|
4239
|
-
pattern: _optionalChain([requestedMatch, 'optionalAccess', _315 => _315.route, 'optionalAccess', _316 => _316.pattern]) || null,
|
|
4240
|
-
params: _optionalChain([requestedMatch, 'optionalAccess', _317 => _317.params]) || {}
|
|
4241
|
-
},
|
|
4242
|
-
_optionalChain([requestedMatch, 'optionalAccess', _318 => _318.route]) ? null : pageBuiltInRouteLabel(requestedPathname)
|
|
4243
|
-
)
|
|
4244
|
-
};
|
|
4289
|
+
const metadataRoute = configRewriteSource === void 0 ? matchAppMetadataRoute(requestedPathname) : null;
|
|
4290
|
+
const sessionOptions = metadataRoute ? { kind: "asset", route: { pathname: requestedPathname, ...metadataRoute } } : pageRuntimeOptions(
|
|
4291
|
+
configRewriteSource === void 0 ? requestedPathname : requestedPagePathname
|
|
4292
|
+
);
|
|
4245
4293
|
runtimeSession = await pm.beginRuntimeRequest(
|
|
4246
4294
|
createRequestFromNodeRequest(req, new URL(_nullishCoalesce(configRewriteSource, () => ( fullUrl)))),
|
|
4247
4295
|
sessionOptions
|
|
4248
4296
|
);
|
|
4249
|
-
if (!runtimeSession.response)
|
|
4250
|
-
pageHookPathname = configRewriteSource === void 0 ? new URL(runtimeSession.request.url).pathname : requestedPagePathname;
|
|
4251
|
-
await runFarmDevPageHooks(pageHookPathname);
|
|
4252
|
-
}
|
|
4297
|
+
if (!runtimeSession.response) await runFarmDevPageHooks();
|
|
4253
4298
|
const routedRequest = await _asyncNullishCoalesce(runtimeSession.response, async () => ( (configRewriteSource === void 0 ? runtimeSession.request : await pm.runRuntimeBeforeForRewrite(
|
|
4254
4299
|
runtimeSession.request,
|
|
4255
4300
|
createRequestFromNodeRequest(req, new URL(fullUrl)),
|
|
4256
|
-
|
|
4301
|
+
pageRuntimeOptions(requestedPathname)
|
|
4257
4302
|
))));
|
|
4258
4303
|
if (routedRequest instanceof Response) {
|
|
4259
4304
|
const response = await pm.endRuntimeRequest(runtimeSession, routedRequest);
|
|
@@ -4284,7 +4329,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4284
4329
|
};
|
|
4285
4330
|
if (!runtimeSession) {
|
|
4286
4331
|
try {
|
|
4287
|
-
await runFarmDevPageHooks(
|
|
4332
|
+
await runFarmDevPageHooks();
|
|
4288
4333
|
} catch (error) {
|
|
4289
4334
|
await failPageHook(error);
|
|
4290
4335
|
return;
|
|
@@ -4302,7 +4347,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4302
4347
|
hasAfterResponseHook,
|
|
4303
4348
|
hasHTMLTransformHook,
|
|
4304
4349
|
// render.html gets the render info render.before got.
|
|
4305
|
-
renderPayload: pageHookRoute(
|
|
4350
|
+
renderPayload: pageHookRoute().render,
|
|
4306
4351
|
method,
|
|
4307
4352
|
urlPath,
|
|
4308
4353
|
pathname,
|
|
@@ -4313,7 +4358,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4313
4358
|
}) : void 0;
|
|
4314
4359
|
let middlewareFailed = false;
|
|
4315
4360
|
try {
|
|
4316
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
4361
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _322 => _322.hasMiddleware, 'call', _323 => _323()])) {
|
|
4317
4362
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
4318
4363
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
4319
4364
|
farmApp.getServerRenderer(),
|
|
@@ -4326,7 +4371,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4326
4371
|
throw error;
|
|
4327
4372
|
});
|
|
4328
4373
|
if (handled) {
|
|
4329
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
4374
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _324 => _324.isEnded, 'call', _325 => _325()])) {
|
|
4330
4375
|
const duration = Date.now() - startTime;
|
|
4331
4376
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
4332
4377
|
}
|
|
@@ -4341,8 +4386,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4341
4386
|
res
|
|
4342
4387
|
);
|
|
4343
4388
|
}
|
|
4344
|
-
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess',
|
|
4345
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
4389
|
+
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _326 => _326.isEnded, 'call', _327 => _327()])) {
|
|
4390
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _328 => _328.isEnded, 'call', _329 => _329()])) {
|
|
4346
4391
|
const duration = Date.now() - startTime;
|
|
4347
4392
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
4348
4393
|
}
|
|
@@ -4361,8 +4406,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4361
4406
|
await pm.reportRuntimeRequestError(runtimeSession, error);
|
|
4362
4407
|
} else {
|
|
4363
4408
|
await pm.failRuntimeRequest(runtimeSession, error);
|
|
4364
|
-
if (!res.headersSent && !_optionalChain([responseInterceptor, 'optionalAccess',
|
|
4365
|
-
_optionalChain([responseInterceptor, 'optionalAccess',
|
|
4409
|
+
if (!res.headersSent && !_optionalChain([responseInterceptor, 'optionalAccess', _330 => _330.isEnded, 'call', _331 => _331()])) {
|
|
4410
|
+
_optionalChain([responseInterceptor, 'optionalAccess', _332 => _332.release, 'call', _333 => _333()]);
|
|
4366
4411
|
console.error("[FARM] Page error:", error);
|
|
4367
4412
|
sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
|
|
4368
4413
|
return;
|
|
@@ -4379,7 +4424,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4379
4424
|
}
|
|
4380
4425
|
})
|
|
4381
4426
|
);
|
|
4382
|
-
const farmRequestMiddleware = _optionalChain([farmMiddlewares, 'access',
|
|
4427
|
+
const farmRequestMiddleware = _optionalChain([farmMiddlewares, 'access', _334 => _334.stack, 'access', _335 => _335.at, 'call', _336 => _336(-1), 'optionalAccess', _337 => _337.handle]);
|
|
4383
4428
|
if (farmOwnsDevCors && viteServer.config.server.cors === false) {
|
|
4384
4429
|
farmMiddlewares.use(createFarmDevViteCorsMiddleware());
|
|
4385
4430
|
}
|
|
@@ -4401,15 +4446,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4401
4446
|
};
|
|
4402
4447
|
},
|
|
4403
4448
|
async resolveId(id, importer, resolveOptions) {
|
|
4404
|
-
if (id.startsWith(
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4449
|
+
if (id.startsWith(FARM_RUNTIME_MODULE_PREFIX)) {
|
|
4450
|
+
return this.resolve(id.slice(FARM_RUNTIME_MODULE_PREFIX.length), getFarmCoreFile(), {
|
|
4451
|
+
...resolveOptions,
|
|
4452
|
+
skipSelf: true
|
|
4453
|
+
});
|
|
4454
|
+
}
|
|
4455
|
+
if (id.startsWith("@farm.js/core/internal/") && importer && isOutsideAppRoot(importer)) {
|
|
4456
|
+
const root = _optionalChain([farmApp, 'optionalAccess', _338 => _338.getConfig, 'call', _339 => _339(), 'access', _340 => _340.root]) || _optionalChain([server, 'optionalAccess', _341 => _341.config, 'access', _342 => _342.root]) || options.root;
|
|
4457
|
+
return this.resolve(id, path6.join(root, "package.json"), {
|
|
4458
|
+
...resolveOptions,
|
|
4459
|
+
skipSelf: true
|
|
4460
|
+
});
|
|
4413
4461
|
}
|
|
4414
4462
|
if (typeof fontImports.resolveId === "function") {
|
|
4415
4463
|
const fontId = await fontImports.resolveId.call(this, id, importer, resolveOptions);
|
|
@@ -4433,7 +4481,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4433
4481
|
}
|
|
4434
4482
|
},
|
|
4435
4483
|
async load(id, loadOptions) {
|
|
4436
|
-
if (pendingClientSetup && !_optionalChain([loadOptions, 'optionalAccess',
|
|
4484
|
+
if (pendingClientSetup && !_optionalChain([loadOptions, 'optionalAccess', _343 => _343.ssr]) && !farmSetupContext.getStore()) {
|
|
4437
4485
|
await pendingClientSetup;
|
|
4438
4486
|
}
|
|
4439
4487
|
if (_chunkPIUTGRDIcjs.isFarmServerFnBoundaryId.call(void 0, id) && islandsServerFns()) {
|
|
@@ -4451,8 +4499,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4451
4499
|
if (imageModule) return imageModule;
|
|
4452
4500
|
}
|
|
4453
4501
|
if (_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
|
|
4454
|
-
const renderer = _optionalChain([farmApp, 'optionalAccess',
|
|
4455
|
-
const root = _optionalChain([server, 'optionalAccess',
|
|
4502
|
+
const renderer = _optionalChain([farmApp, 'optionalAccess', _344 => _344.getConfig, 'call', _345 => _345(), 'access', _346 => _346.renderer]) || _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
4503
|
+
const root = _optionalChain([server, 'optionalAccess', _347 => _347.config, 'access', _348 => _348.root]) || options.root;
|
|
4456
4504
|
if (isClientEnvironment(this, loadOptions)) {
|
|
4457
4505
|
return generateProgrammaticClientRouteModuleForId(
|
|
4458
4506
|
id,
|
|
@@ -4468,21 +4516,21 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4468
4516
|
return FARM_DEV_CLIENT_BOOT_MODULE;
|
|
4469
4517
|
}
|
|
4470
4518
|
if (isFarmClientVirtualId(id)) {
|
|
4471
|
-
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
4472
|
-
const renderer = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4473
|
-
const integrations = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4474
|
-
const root = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4475
|
-
const docs = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4519
|
+
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _349 => _349.getConfig, 'call', _350 => _350()]);
|
|
4520
|
+
const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _351 => _351.renderer]) || _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
4521
|
+
const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _352 => _352.integrations]) || options.integrations;
|
|
4522
|
+
const root = _optionalChain([resolvedConfig, 'optionalAccess', _353 => _353.root]) || _optionalChain([server, 'optionalAccess', _354 => _354.config, 'access', _355 => _355.root]) || process.cwd();
|
|
4523
|
+
const docs = _optionalChain([resolvedConfig, 'optionalAccess', _356 => _356.docs]);
|
|
4476
4524
|
const adapterOwnsDocsRuntime = Boolean(
|
|
4477
|
-
_chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess',
|
|
4525
|
+
_chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _357 => _357.adapter, 'optionalAccess', _358 => _358.server]) && docs.adapter.react
|
|
4478
4526
|
);
|
|
4479
|
-
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4527
|
+
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _359 => _359.devtools]), () => ( _chunkSTF6VDYQcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
|
|
4480
4528
|
const [docsRuntime, docsSearchRuntime, devtoolsClientRuntime] = await Promise.all([
|
|
4481
|
-
_optionalChain([docs, 'optionalAccess',
|
|
4482
|
-
_optionalChain([docs, 'optionalAccess',
|
|
4529
|
+
_optionalChain([docs, 'optionalAccess', _360 => _360.enabled]) ? loadFarmDocsDevRuntime() : null,
|
|
4530
|
+
_optionalChain([docs, 'optionalAccess', _361 => _361.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
|
|
4483
4531
|
devtools.enabled ? loadFarmDevtoolsClientRuntime() : null
|
|
4484
4532
|
]);
|
|
4485
|
-
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess',
|
|
4533
|
+
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _362 => _362.isFarmDocsSearchEnabled, 'call', _363 => _363(docs)]), () => ( false));
|
|
4486
4534
|
const generatedDocsSearchRuntime = docsSearchRuntime ? docsSearchRuntime.generateFarmDocsSearchClientRuntime(
|
|
4487
4535
|
docsSearchEnabled,
|
|
4488
4536
|
docsSearchEnabled ? docsSearchRuntime.resolveFarmDocsSearchClientModule(root) : void 0
|
|
@@ -4490,10 +4538,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4490
4538
|
const generatedDevtoolsClientRuntime = devtoolsClientRuntime ? devtoolsClientRuntime.generateFarmDevtoolsClientRuntime(devtools) : "";
|
|
4491
4539
|
const generatedDevIndicatorsClientRuntime = farmApp ? _chunkUVV3I5QAcjs.generateFarmDevIndicatorsClientRuntime.call(void 0, farmApp.getConfig().devIndicators) : "";
|
|
4492
4540
|
const integrationProviders = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? _chunkJX5VOLAVcjs.getIntegrationProviders.call(void 0, integrations) : [];
|
|
4493
|
-
const isolatedHydrationMode =
|
|
4494
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4541
|
+
const isolatedHydrationMode = _chunk2IFT2CSAcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
4542
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _364 => _364.experimental, 'optionalAccess', _365 => _365.isolatedClientHydration]),
|
|
4495
4543
|
{
|
|
4496
|
-
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4544
|
+
serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _366 => _366.experimental, 'optionalAccess', _367 => _367.serverComponents])) === "rsc",
|
|
4497
4545
|
hasUnsupportedIntegrationProvider: integrationProviders.filter((provider) => provider.component || provider.type === "clerk").some((provider) => provider.supportsIsolatedHydration !== true)
|
|
4498
4546
|
}
|
|
4499
4547
|
);
|
|
@@ -4501,32 +4549,32 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
4501
4549
|
integrationProviders,
|
|
4502
4550
|
[
|
|
4503
4551
|
..._chunkJX5VOLAVcjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
|
|
4504
|
-
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess',
|
|
4552
|
+
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _368 => _368.getFarmDocsDocumentNavigationMatchers, 'call', _369 => _369(docs)]), () => ( []))
|
|
4505
4553
|
],
|
|
4506
4554
|
generatedDocsSearchRuntime,
|
|
4507
4555
|
`${generatedDevtoolsClientRuntime}
|
|
4508
4556
|
${generatedDevIndicatorsClientRuntime}`,
|
|
4509
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4557
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _370 => _370.plugins]) || [],
|
|
4510
4558
|
root,
|
|
4511
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4512
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4513
|
-
_chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess',
|
|
4559
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _371 => _371.srcDir]) || options.srcDir || "src",
|
|
4560
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _372 => _372.publicRuntimeConfig]) || options.publicRuntimeConfig,
|
|
4561
|
+
_chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _373 => _373.adapter, 'optionalAccess', _374 => _374.react]) : void 0,
|
|
4514
4562
|
renderer,
|
|
4515
|
-
isolatedHydrationMode === "enabled" || _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
4516
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4517
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
4518
|
-
|
|
4519
|
-
|
|
4563
|
+
isolatedHydrationMode === "enabled" || _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _375 => _375.getRouteManager, 'call', _376 => _376(), 'access', _377 => _377.getIsolatedClientBoundaryModules, 'call', _378 => _378(root)])))), 'optionalAccess', _379 => _379.size]) > 0,
|
|
4564
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _380 => _380.trailingSlash]), () => ( false)),
|
|
4565
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _381 => _381.basePath]), () => ( "/")),
|
|
4566
|
+
_chunkKWST2O22cjs.generateClientCachePersistenceCode.call(void 0,
|
|
4567
|
+
_chunkKWST2O22cjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, _optionalChain([resolvedConfig, 'optionalAccess', _382 => _382.cache]))
|
|
4520
4568
|
),
|
|
4521
4569
|
_chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0,
|
|
4522
|
-
_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess',
|
|
4570
|
+
_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _383 => _383.experimental, 'optionalAccess', _384 => _384.serverComponents])) === "islands"
|
|
4523
4571
|
);
|
|
4524
4572
|
}
|
|
4525
4573
|
if (id === "/@farm/server") {
|
|
4526
4574
|
return generateServerCode();
|
|
4527
4575
|
}
|
|
4528
4576
|
if (id === "/@farm/manifest") {
|
|
4529
|
-
const routeManager = _optionalChain([farmApp, 'optionalAccess',
|
|
4577
|
+
const routeManager = _optionalChain([farmApp, 'optionalAccess', _385 => _385.getRouteManager, 'call', _386 => _386()]);
|
|
4530
4578
|
if (!routeManager) {
|
|
4531
4579
|
return `
|
|
4532
4580
|
export const getManifest = () => ({
|
|
@@ -4539,9 +4587,9 @@ export const getManifest = () => ({
|
|
|
4539
4587
|
`;
|
|
4540
4588
|
}
|
|
4541
4589
|
const manifest = routeManager.generateClientManifest(server.config.root);
|
|
4542
|
-
const globalStylesheetHref =
|
|
4590
|
+
const globalStylesheetHref = _chunkKWST2O22cjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
4543
4591
|
server.config.root,
|
|
4544
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
4592
|
+
_optionalChain([farmApp, 'optionalAccess', _387 => _387.getConfig, 'call', _388 => _388(), 'access', _389 => _389.srcDir])
|
|
4545
4593
|
);
|
|
4546
4594
|
const fullManifest = {
|
|
4547
4595
|
clientEntry: "/@farm/client.js",
|
|
@@ -4597,55 +4645,60 @@ export const manifest = getManifest();
|
|
|
4597
4645
|
}
|
|
4598
4646
|
},
|
|
4599
4647
|
async transform(code, id, transformOptions) {
|
|
4600
|
-
if (pendingClientSetup && !_optionalChain([transformOptions, 'optionalAccess',
|
|
4648
|
+
if (pendingClientSetup && !_optionalChain([transformOptions, 'optionalAccess', _390 => _390.ssr]) && !farmSetupContext.getStore()) {
|
|
4601
4649
|
await pendingClientSetup;
|
|
4602
4650
|
}
|
|
4603
|
-
const
|
|
4651
|
+
const runtimeModule = !isBuild && _optionalChain([transformOptions, 'optionalAccess', _391 => _391.ssr]) === true && isOutsideAppRoot(id) ? toFarmRuntimeModuleId : void 0;
|
|
4652
|
+
const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _392 => _392.getConfig, 'call', _393 => _393()]), () => ( options));
|
|
4604
4653
|
let rewrotePackageImports = false;
|
|
4605
|
-
if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access',
|
|
4654
|
+
if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access', _394 => _394.experimental, 'optionalAccess', _395 => _395.serverComponents])) === "islands" && (!id.includes("/node_modules/") || _optionalChain([transformOptions, 'optionalAccess', _396 => _396.ssr]) === true && farmReactServerFiles.has(id.split("?", 1)[0])) && !id.startsWith("\0") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id) && !_chunk2IFT2CSAcjs.hasUseClientDirective.call(void 0, code)) {
|
|
4606
4655
|
const file = id.split("?", 1)[0];
|
|
4607
|
-
const projectRoot = actionConfig.root || _optionalChain([server, 'optionalAccess',
|
|
4608
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
4656
|
+
const projectRoot = actionConfig.root || _optionalChain([server, 'optionalAccess', _397 => _397.config, 'access', _398 => _398.root]) || process.cwd();
|
|
4657
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _399 => _399.ssr]) === true) {
|
|
4609
4658
|
if (farmReactServerFiles.has(file)) {
|
|
4610
|
-
for (const child of
|
|
4659
|
+
for (const child of _chunk2IFT2CSAcjs.farmRelativeImportFiles.call(void 0, code, file))
|
|
4611
4660
|
farmReactServerFiles.add(child);
|
|
4612
4661
|
}
|
|
4613
|
-
const serverModule = farmReactServerFiles.has(file) || !
|
|
4662
|
+
const serverModule = farmReactServerFiles.has(file) || !_chunk2IFT2CSAcjs.getFarmClientReachableModules.call(void 0,
|
|
4614
4663
|
path6.resolve(projectRoot, actionConfig.srcDir || "src"),
|
|
4615
4664
|
projectRoot
|
|
4616
4665
|
).has(path6.resolve(file));
|
|
4617
|
-
const reactServer = !serverModule ? null :
|
|
4666
|
+
const reactServer = !serverModule ? null : _chunk2IFT2CSAcjs.rewriteFarmReactServerImports.call(void 0, {
|
|
4618
4667
|
code,
|
|
4619
4668
|
file,
|
|
4620
|
-
reference: (specifier, exportName) =>
|
|
4669
|
+
reference: (specifier, exportName) => _chunk2IFT2CSAcjs.ensureFarmPackageClientReference.call(void 0, projectRoot, specifier, exportName, file),
|
|
4621
4670
|
onServerFile: (serverFile) => farmReactServerFiles.add(serverFile)
|
|
4622
4671
|
});
|
|
4623
4672
|
if (reactServer !== null) {
|
|
4624
4673
|
code = reactServer;
|
|
4625
4674
|
rewrotePackageImports = true;
|
|
4626
4675
|
}
|
|
4627
|
-
const internal = farmReactServerFiles.has(file) ?
|
|
4676
|
+
const internal = farmReactServerFiles.has(file) ? _chunk2IFT2CSAcjs.rewriteFarmReactServerClientModuleImports.call(void 0, {
|
|
4628
4677
|
code,
|
|
4629
4678
|
file,
|
|
4630
|
-
reference: (clientFile) =>
|
|
4679
|
+
reference: (clientFile) => _chunk2IFT2CSAcjs.ensureFarmInternalClientReference.call(void 0, projectRoot, clientFile)
|
|
4631
4680
|
}) : null;
|
|
4632
4681
|
if (internal !== null) {
|
|
4633
4682
|
code = internal;
|
|
4634
4683
|
rewrotePackageImports = true;
|
|
4635
4684
|
}
|
|
4636
4685
|
}
|
|
4637
|
-
const referenced =
|
|
4686
|
+
const referenced = _chunk2IFT2CSAcjs.rewriteFarmPackageClientImports.call(void 0, {
|
|
4638
4687
|
code,
|
|
4639
4688
|
file,
|
|
4640
4689
|
root: projectRoot,
|
|
4641
|
-
isClientPackage: (specifier) =>
|
|
4690
|
+
isClientPackage: (specifier) => _chunk2IFT2CSAcjs.isFarmPackageClientBoundary.call(void 0, file, specifier, projectRoot)
|
|
4642
4691
|
});
|
|
4643
4692
|
if (referenced !== null) {
|
|
4644
4693
|
code = referenced;
|
|
4645
4694
|
rewrotePackageImports = true;
|
|
4646
4695
|
}
|
|
4647
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
4648
|
-
const cached = rewriteFarmReactCacheImport(
|
|
4696
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _400 => _400.ssr]) === true) {
|
|
4697
|
+
const cached = rewriteFarmReactCacheImport(
|
|
4698
|
+
code,
|
|
4699
|
+
file,
|
|
4700
|
+
_optionalChain([runtimeModule, 'optionalCall', _401 => _401(FARM_REACT_CACHE_MODULE)])
|
|
4701
|
+
);
|
|
4649
4702
|
if (cached !== null) {
|
|
4650
4703
|
code = cached;
|
|
4651
4704
|
rewrotePackageImports = true;
|
|
@@ -4654,43 +4707,44 @@ export const manifest = getManifest();
|
|
|
4654
4707
|
}
|
|
4655
4708
|
if (islandsServerFns() && !_chunkPIUTGRDIcjs.isFarmServerFnBoundaryId.call(void 0, id) && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
|
|
4656
4709
|
const serverFns = _chunkPIUTGRDIcjs.transformFarmServerFns.call(void 0, code, id, {
|
|
4657
|
-
environment: _optionalChain([transformOptions, 'optionalAccess',
|
|
4710
|
+
environment: _optionalChain([transformOptions, 'optionalAccess', _402 => _402.ssr]) === true ? "rsc" : "client"
|
|
4658
4711
|
});
|
|
4659
4712
|
if (serverFns) {
|
|
4660
4713
|
if (!serverFns.code.includes("use server")) return { code: serverFns.code, map: null };
|
|
4661
4714
|
code = serverFns.code;
|
|
4662
4715
|
}
|
|
4663
4716
|
}
|
|
4664
|
-
if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access',
|
|
4717
|
+
if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access', _403 => _403.experimental, 'optionalAccess', _404 => _404.serverComponents])) === "islands" && code.includes("use server") && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
|
|
4665
4718
|
const file = id.split("?", 1)[0];
|
|
4666
4719
|
const actionModule = transformFarmFormActionModule({
|
|
4667
4720
|
code,
|
|
4668
4721
|
id,
|
|
4669
|
-
root: actionConfig.root || _optionalChain([server, 'optionalAccess',
|
|
4670
|
-
ssr: _optionalChain([transformOptions, 'optionalAccess',
|
|
4722
|
+
root: actionConfig.root || _optionalChain([server, 'optionalAccess', _405 => _405.config, 'access', _406 => _406.root]) || process.cwd(),
|
|
4723
|
+
ssr: _optionalChain([transformOptions, 'optionalAccess', _407 => _407.ssr]) === true,
|
|
4671
4724
|
// Parsed by file type: page components are TSX.
|
|
4672
|
-
parse: (source) => _vite.parseSync.call(void 0, file, source).program
|
|
4725
|
+
parse: (source) => _vite.parseSync.call(void 0, file, source).program,
|
|
4726
|
+
runtimeModule
|
|
4673
4727
|
});
|
|
4674
4728
|
if (actionModule) return { code: actionModule, map: null };
|
|
4675
4729
|
}
|
|
4676
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
4677
|
-
const docsConfigModule = _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess',
|
|
4678
|
-
if (
|
|
4679
|
-
const redacted =
|
|
4730
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _408 => _408.ssr])) {
|
|
4731
|
+
const docsConfigModule = _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess', _409 => _409.getConfig, 'call', _410 => _410(), 'optionalAccess', _411 => _411.docs]));
|
|
4732
|
+
if (_chunkKWST2O22cjs.isFarmDocsClientConfigModule.call(void 0, id, docsConfigModule)) {
|
|
4733
|
+
const redacted = _chunkKWST2O22cjs.redactFarmDocsClientConfig.call(void 0, code, id.split("?")[0]);
|
|
4680
4734
|
if (redacted !== null) return { code: redacted, map: null };
|
|
4681
4735
|
}
|
|
4682
4736
|
}
|
|
4683
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
4684
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
4685
|
-
if ((_optionalChain([currentConfig, 'access',
|
|
4737
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _412 => _412.ssr])) {
|
|
4738
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _413 => _413.getConfig, 'call', _414 => _414()]), () => ( options));
|
|
4739
|
+
if ((_optionalChain([currentConfig, 'access', _415 => _415.experimental, 'optionalAccess', _416 => _416.serverActions]) !== true || !serverFnTransformActive) && !islandsServerFns()) {
|
|
4686
4740
|
const violation = findClientServerFnViolation(code, id);
|
|
4687
4741
|
if (violation) {
|
|
4688
4742
|
this.error(formatServerFnBoundaryError(violation, id));
|
|
4689
4743
|
}
|
|
4690
4744
|
}
|
|
4691
4745
|
}
|
|
4692
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
4693
|
-
warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
4746
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _417 => _417.ssr]) && shouldInspectClientBoundary(id, code)) {
|
|
4747
|
+
warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _418 => _418.getConfig, 'call', _419 => _419()]), () => ( options)));
|
|
4694
4748
|
}
|
|
4695
4749
|
if (typeof imageImports.transform === "function") {
|
|
4696
4750
|
const imageModule = await imageImports.transform.call(this, code, id, transformOptions);
|
|
@@ -4705,13 +4759,13 @@ export const manifest = getManifest();
|
|
|
4705
4759
|
id,
|
|
4706
4760
|
transformOptions
|
|
4707
4761
|
);
|
|
4708
|
-
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess',
|
|
4762
|
+
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _420 => _420.code, 'optionalAccess', _421 => _421.toString, 'call', _422 => _422()]);
|
|
4709
4763
|
if (fontCode) {
|
|
4710
4764
|
transformedCode = fontCode;
|
|
4711
4765
|
transformed = true;
|
|
4712
4766
|
}
|
|
4713
4767
|
}
|
|
4714
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
4768
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _423 => _423.ssr]) && server) {
|
|
4715
4769
|
const rewrittenImports = rewriteEarlySsrRelativeImports({
|
|
4716
4770
|
code: transformedCode,
|
|
4717
4771
|
id,
|
|
@@ -4723,26 +4777,26 @@ export const manifest = getManifest();
|
|
|
4723
4777
|
transformed = true;
|
|
4724
4778
|
}
|
|
4725
4779
|
}
|
|
4726
|
-
if (
|
|
4780
|
+
if (_chunk2IFT2CSAcjs.hasUseClientDirective.call(void 0, transformedCode)) {
|
|
4727
4781
|
const clientBoundarySource = transformedCode;
|
|
4728
4782
|
const moduleInfo = this.getModuleInfo(id);
|
|
4729
4783
|
if (moduleInfo) {
|
|
4730
4784
|
moduleInfo.isClientComponent = true;
|
|
4731
4785
|
}
|
|
4732
|
-
transformedCode =
|
|
4786
|
+
transformedCode = _chunk2IFT2CSAcjs.stripUseClientDirective.call(void 0, transformedCode);
|
|
4733
4787
|
transformed = true;
|
|
4734
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
4788
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _424 => _424.getConfig, 'call', _425 => _425()]), () => ( options));
|
|
4735
4789
|
let isolatedModuleReference = null;
|
|
4736
|
-
const root = currentConfig.root || _optionalChain([server, 'optionalAccess',
|
|
4790
|
+
const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _426 => _426.config, 'access', _427 => _427.root]) || process.cwd();
|
|
4737
4791
|
const cleanId = id.split("?", 1)[0];
|
|
4738
|
-
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
4739
|
-
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess',
|
|
4740
|
-
if (_chunk67MZTLTFcjs.isReactRenderer.call(void 0, _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && (
|
|
4741
|
-
cleanId.replace(/\\/g, "/").includes(
|
|
4792
|
+
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _428 => _428.getRouteManager, 'call', _429 => _429(), 'access', _430 => _430.getIsolatedClientBoundaryModules, 'call', _431 => _431(root)])));
|
|
4793
|
+
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _432 => _432.has, 'call', _433 => _433(path6.resolve(cleanId))]) === true;
|
|
4794
|
+
if (_chunk67MZTLTFcjs.isReactRenderer.call(void 0, _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && (_chunk2IFT2CSAcjs.isIsolatableClientBoundarySource.call(void 0, clientBoundarySource) || // A generated client reference, whose marker comment compiled TSX no longer has.
|
|
4795
|
+
cleanId.replace(/\\/g, "/").includes(_chunk2IFT2CSAcjs.FARM_CLIENT_REFERENCE_DIRECTORY))) {
|
|
4742
4796
|
isolatedModuleReference = _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, cleanId, root);
|
|
4743
|
-
const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([currentConfig, 'access',
|
|
4744
|
-
const explicitStrategy =
|
|
4745
|
-
const inference = islandsMode && explicitStrategy === null ?
|
|
4797
|
+
const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([currentConfig, 'access', _434 => _434.experimental, 'optionalAccess', _435 => _435.serverComponents])) === "islands";
|
|
4798
|
+
const explicitStrategy = _chunk2IFT2CSAcjs.getIslandStrategyExport.call(void 0, clientBoundarySource);
|
|
4799
|
+
const inference = islandsMode && explicitStrategy === null ? _chunkKWST2O22cjs.inferFarmIslandStrategy.call(void 0, cleanId, root) : null;
|
|
4746
4800
|
if (inference) {
|
|
4747
4801
|
for (const file of inference.files) {
|
|
4748
4802
|
if (file !== path6.resolve(cleanId)) this.addWatchFile(file);
|
|
@@ -4755,8 +4809,9 @@ export const manifest = getManifest();
|
|
|
4755
4809
|
islandStrategy: _nullishCoalesce(explicitStrategy, () => ( "load")),
|
|
4756
4810
|
parse: (source) => this.parse(source),
|
|
4757
4811
|
slots: islandsMode,
|
|
4758
|
-
browser: _optionalChain([transformOptions, 'optionalAccess',
|
|
4759
|
-
inferredInteraction: _optionalChain([inference, 'optionalAccess',
|
|
4812
|
+
browser: _optionalChain([transformOptions, 'optionalAccess', _436 => _436.ssr]) !== true,
|
|
4813
|
+
inferredInteraction: _optionalChain([inference, 'optionalAccess', _437 => _437.strategy]) === "interaction",
|
|
4814
|
+
runtimeModule
|
|
4760
4815
|
});
|
|
4761
4816
|
if (!transformedBoundary) {
|
|
4762
4817
|
this.error(
|
|
@@ -4786,7 +4841,7 @@ export const manifest = getManifest();
|
|
|
4786
4841
|
);
|
|
4787
4842
|
return;
|
|
4788
4843
|
}` : "";
|
|
4789
|
-
const hmrCode = _optionalChain([transformOptions, 'optionalAccess',
|
|
4844
|
+
const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _438 => _438.ssr]) || reactRefreshActive || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
|
|
4790
4845
|
if (import.meta.hot) {
|
|
4791
4846
|
import.meta.hot.accept((newModule) => {
|
|
4792
4847
|
${isolatedHmrUpdate}
|
|
@@ -4842,14 +4897,14 @@ if (import.meta.hot) {
|
|
|
4842
4897
|
}
|
|
4843
4898
|
_chunkQMNWKQL4cjs.logger.info(`Found ${ssgPages.length} SSG pages, ${ssrRoutes.length} SSR routes`);
|
|
4844
4899
|
_chunkQMNWKQL4cjs.logger.info("Pre-rendering SSG pages...");
|
|
4845
|
-
const outDir = path6.join(_optionalChain([server, 'optionalAccess',
|
|
4900
|
+
const outDir = path6.join(_optionalChain([server, 'optionalAccess', _439 => _439.config, 'access', _440 => _440.root]) || process.cwd(), options.outDir || "dist");
|
|
4846
4901
|
const clientDir = path6.join(outDir, "client");
|
|
4847
4902
|
for (const page of ssgPages) {
|
|
4848
4903
|
try {
|
|
4849
4904
|
const staticRequest = new Request(new URL(page.urlPath, "http://farm.static"));
|
|
4850
4905
|
await farmApp.getServerRenderer().runWithRequestContext(staticRequest, async () => {
|
|
4851
4906
|
const mod = await routeManager.loadRouteModule(page.filePath);
|
|
4852
|
-
if (!_optionalChain([mod, 'optionalAccess',
|
|
4907
|
+
if (!_optionalChain([mod, 'optionalAccess', _441 => _441.default])) return;
|
|
4853
4908
|
const { layouts } = routeManager.matchRoute(page.urlPath);
|
|
4854
4909
|
const layoutModules = await Promise.all(
|
|
4855
4910
|
layouts.map((l) => routeManager.loadLayoutModule(l.modulePath))
|
|
@@ -4881,7 +4936,7 @@ if (import.meta.hot) {
|
|
|
4881
4936
|
const i18nSnapshot = _chunk2AM26UGIcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
4882
4937
|
const i18nHead = renderFarmI18nStaticHead(page.urlPath, i18nSnapshot);
|
|
4883
4938
|
const fullHtml = `<!DOCTYPE html>
|
|
4884
|
-
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
4939
|
+
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _442 => _442.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
|
|
4885
4940
|
<head>
|
|
4886
4941
|
<meta charset="utf-8">
|
|
4887
4942
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
@@ -4924,8 +4979,8 @@ if (import.meta.hot) {
|
|
|
4924
4979
|
}
|
|
4925
4980
|
},
|
|
4926
4981
|
watchChange() {
|
|
4927
|
-
|
|
4928
|
-
|
|
4982
|
+
_chunk2IFT2CSAcjs.invalidateFarmClientReachableModules.call(void 0, );
|
|
4983
|
+
_chunk2IFT2CSAcjs.invalidateFarmClientOnlyScan.call(void 0, );
|
|
4929
4984
|
},
|
|
4930
4985
|
async handleHotUpdate(ctx) {
|
|
4931
4986
|
if (pendingClientSetup && !farmSetupContext.getStore()) await pendingClientSetup;
|
|
@@ -4950,13 +5005,13 @@ if (import.meta.hot) {
|
|
|
4950
5005
|
server2.moduleGraph.invalidateModule(mod);
|
|
4951
5006
|
}
|
|
4952
5007
|
}
|
|
4953
|
-
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
5008
|
+
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _443 => _443.getConfig, 'call', _444 => _444()]);
|
|
4954
5009
|
const normalizedFile = file.replace(/\\/g, "/");
|
|
4955
5010
|
if (currentFarmConfig && /\/route\.(?:ts|tsx|js|jsx)$/.test(normalizedFile) && _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, currentFarmConfig).some(
|
|
4956
5011
|
(appDir) => normalizedFile.startsWith(`${_chunkQMNWKQL4cjs.toPosixPath.call(void 0, appDir)}/api/`)
|
|
4957
5012
|
)) {
|
|
4958
5013
|
for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
|
|
4959
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
5014
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _445 => _445(`updated ${file}`)]);
|
|
4960
5015
|
server2.ws.send({ type: "full-reload", path: "*" });
|
|
4961
5016
|
return [];
|
|
4962
5017
|
}
|
|
@@ -4966,7 +5021,7 @@ if (import.meta.hot) {
|
|
|
4966
5021
|
for (const mod of modules) {
|
|
4967
5022
|
server2.moduleGraph.invalidateModule(mod);
|
|
4968
5023
|
}
|
|
4969
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
5024
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _446 => _446(`updated ${file}`)]);
|
|
4970
5025
|
server2.ws.send({
|
|
4971
5026
|
type: "full-reload",
|
|
4972
5027
|
path: "*"
|
|
@@ -4979,7 +5034,7 @@ if (import.meta.hot) {
|
|
|
4979
5034
|
for (const mod of modules) {
|
|
4980
5035
|
server2.moduleGraph.invalidateModule(mod);
|
|
4981
5036
|
}
|
|
4982
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
5037
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _447 => _447(`updated ${file}`)]);
|
|
4983
5038
|
server2.ws.send({
|
|
4984
5039
|
type: "full-reload",
|
|
4985
5040
|
path: "*"
|
|
@@ -4987,12 +5042,12 @@ if (import.meta.hot) {
|
|
|
4987
5042
|
return [];
|
|
4988
5043
|
}
|
|
4989
5044
|
if (apiRouteManager && _chunkJYNNIGQOcjs.invalidateFarmDevDependents.call(void 0, server2, file, apiRouteManager.getSourceFiles()).length > 0) {
|
|
4990
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
5045
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _448 => _448(`updated ${file}`)]);
|
|
4991
5046
|
}
|
|
4992
|
-
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
4993
|
-
const planRouteManager = _optionalChain([farmApp, 'optionalAccess',
|
|
5047
|
+
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _449 => _449.experimental, 'optionalAccess', _450 => _450.isolatedClientHydration]);
|
|
5048
|
+
const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _451 => _451.getRouteManager, 'call', _452 => _452()]);
|
|
4994
5049
|
const isHydrationPlanSource = currentSrcRoot !== null && normalizedFile.startsWith(`${currentSrcRoot}/`) && /\.[cm]?[jt]sx?$/.test(normalizedFile);
|
|
4995
|
-
const tracksAsyncOwnerIslands = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
5050
|
+
const tracksAsyncOwnerIslands = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _453 => _453.renderer])) && planRouteManager !== void 0;
|
|
4996
5051
|
let clientPlanCurrent = false;
|
|
4997
5052
|
if (isHydrationPlanSource && (isolatedHydrationMode === "enabled" || isolatedHydrationMode === "analyze" || tracksAsyncOwnerIslands)) {
|
|
4998
5053
|
const routeManager = planRouteManager;
|
|
@@ -5054,7 +5109,7 @@ if (import.meta.hot) {
|
|
|
5054
5109
|
}
|
|
5055
5110
|
return [];
|
|
5056
5111
|
}
|
|
5057
|
-
if (!clientPlanCurrent) _optionalChain([farmApp, 'optionalAccess',
|
|
5112
|
+
if (!clientPlanCurrent) _optionalChain([farmApp, 'optionalAccess', _454 => _454.getRouteManager, 'call', _455 => _455(), 'access', _456 => _456.invalidateClientManifest, 'call', _457 => _457()]);
|
|
5058
5113
|
const manifestModule = server2.moduleGraph.getModuleById("/@farm/manifest");
|
|
5059
5114
|
if (manifestModule) {
|
|
5060
5115
|
server2.moduleGraph.invalidateModule(manifestModule);
|
|
@@ -5165,7 +5220,7 @@ function createPageDataMiddlewareResponse(res) {
|
|
|
5165
5220
|
return (...args) => {
|
|
5166
5221
|
if (captures(target.statusCode, target.getHeader("location"))) {
|
|
5167
5222
|
const callback = args.find((arg) => typeof arg === "function");
|
|
5168
|
-
_optionalChain([callback, 'optionalCall',
|
|
5223
|
+
_optionalChain([callback, 'optionalCall', _458 => _458()]);
|
|
5169
5224
|
return property === "write" ? true : response;
|
|
5170
5225
|
}
|
|
5171
5226
|
return target[property](...args);
|
|
@@ -5229,12 +5284,12 @@ function isFarmClientVirtualId(id) {
|
|
|
5229
5284
|
}
|
|
5230
5285
|
function isClientEnvironment(context, loadOptions) {
|
|
5231
5286
|
const environment = context.environment;
|
|
5232
|
-
if (_optionalChain([environment, 'optionalAccess',
|
|
5233
|
-
if (_optionalChain([environment, 'optionalAccess',
|
|
5234
|
-
return _optionalChain([loadOptions, 'optionalAccess',
|
|
5287
|
+
if (_optionalChain([environment, 'optionalAccess', _459 => _459.config, 'optionalAccess', _460 => _460.consumer])) return environment.config.consumer === "client";
|
|
5288
|
+
if (_optionalChain([environment, 'optionalAccess', _461 => _461.name])) return environment.name === "client";
|
|
5289
|
+
return _optionalChain([loadOptions, 'optionalAccess', _462 => _462.ssr]) !== true;
|
|
5235
5290
|
}
|
|
5236
5291
|
function invalidateProgrammaticClientRouteModules(server) {
|
|
5237
|
-
const graph = _optionalChain([server, 'access',
|
|
5292
|
+
const graph = _optionalChain([server, 'access', _463 => _463.environments, 'optionalAccess', _464 => _464.client, 'optionalAccess', _465 => _465.moduleGraph]);
|
|
5238
5293
|
if (!graph) return;
|
|
5239
5294
|
for (const [id, module] of graph.idToModuleMap) {
|
|
5240
5295
|
if (_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id)) graph.invalidateModule(module);
|
|
@@ -5244,19 +5299,19 @@ function generateProgrammaticClientRouteModuleForId(moduleId, root, renderer, cl
|
|
|
5244
5299
|
const parsed = _chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, moduleId);
|
|
5245
5300
|
const routesFile = resolveRealModuleFile(parsed.filePath, root);
|
|
5246
5301
|
watchFile(routesFile);
|
|
5247
|
-
return
|
|
5302
|
+
return _chunk2IFT2CSAcjs.generateProgrammaticClientRouteModule.call(void 0, {
|
|
5248
5303
|
kind: parsed.kind,
|
|
5249
5304
|
routePath: parsed.routePath,
|
|
5250
5305
|
routesFile,
|
|
5251
|
-
route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess',
|
|
5252
|
-
|
|
5306
|
+
route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess', _466 => _466.routes, 'access', _467 => _467.get, 'call', _468 => _468(
|
|
5307
|
+
_chunk2IFT2CSAcjs.programmaticClientRouteKey.call(void 0, routesFile, parsed.kind, parsed.routePath)
|
|
5253
5308
|
)]),
|
|
5254
5309
|
rendererServer: renderer.server,
|
|
5255
5310
|
toImportSpecifier: (file) => toProgrammaticRouteImportSpecifier(file, root)
|
|
5256
5311
|
});
|
|
5257
5312
|
}
|
|
5258
5313
|
function resolveRealModuleFile(filePath, root) {
|
|
5259
|
-
const resolved = _nullishCoalesce(
|
|
5314
|
+
const resolved = _nullishCoalesce(_chunk2IFT2CSAcjs.resolveModuleSourcePath.call(void 0, filePath, root), () => ( filePath));
|
|
5260
5315
|
try {
|
|
5261
5316
|
return _chunkQMNWKQL4cjs.toPosixPath.call(void 0, fs2.realpathSync(resolved));
|
|
5262
5317
|
} catch (e28) {
|
|
@@ -5570,12 +5625,12 @@ async function parseRouteModuleProps(routeModule, input) {
|
|
|
5570
5625
|
}
|
|
5571
5626
|
const schemas = routeModule.__farmRouteSchemas;
|
|
5572
5627
|
const params = parseRouteModuleSchema(
|
|
5573
|
-
_optionalChain([schemas, 'optionalAccess',
|
|
5628
|
+
_optionalChain([schemas, 'optionalAccess', _469 => _469.params]),
|
|
5574
5629
|
input.props.params,
|
|
5575
5630
|
"params",
|
|
5576
5631
|
input.routePath
|
|
5577
5632
|
);
|
|
5578
|
-
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess',
|
|
5633
|
+
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _470 => _470.search]), input.search, "search", input.routePath);
|
|
5579
5634
|
return {
|
|
5580
5635
|
...input.props,
|
|
5581
5636
|
params,
|
|
@@ -5595,7 +5650,7 @@ function parseRouteModuleSchema(schema, value, label, routePath) {
|
|
|
5595
5650
|
}
|
|
5596
5651
|
}
|
|
5597
5652
|
function generateClientCode(integrationProviders = [], documentNavigationMatchers = [], docsSearchClientRuntime = EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME, devtoolsClientRuntime = "", plugins = [], root = process.cwd(), srcDir = "src", publicRuntimeConfig = void 0, docsAdapterReact, renderer = _chunk67MZTLTFcjs.REACT_RENDERER, isolatedHydrationEnabled = false, trailingSlash = false, basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false) {
|
|
5598
|
-
const providerClientCode =
|
|
5653
|
+
const providerClientCode = _chunkKWST2O22cjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
5599
5654
|
integrationProviders,
|
|
5600
5655
|
root,
|
|
5601
5656
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
@@ -5641,14 +5696,15 @@ async function createFarmServerTreePageElement(source, pathname) {
|
|
|
5641
5696
|
return await createFarmServerTreeElement(React, source, {
|
|
5642
5697
|
load: (reference) => import(/* @vite-ignore */ farmModuleUrl(reference)),
|
|
5643
5698
|
ServerHtml: FarmServerPage,
|
|
5644
|
-
key:
|
|
5699
|
+
// No key: the next page of the same layout updates this one in place, as React Server
|
|
5700
|
+
// Components do, instead of unmounting it and building every node again.
|
|
5645
5701
|
});
|
|
5646
5702
|
} catch (error) {
|
|
5647
5703
|
console.warn('[Farm.js] Could not rebuild the server tree of ' + pathname + '; its server HTML was kept.', error);
|
|
5648
5704
|
return null;
|
|
5649
5705
|
}
|
|
5650
5706
|
}
|
|
5651
|
-
${islandValues ? `${
|
|
5707
|
+
${islandValues ? `${_chunkKWST2O22cjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
|
|
5652
5708
|
let farmLastRouteState = null;
|
|
5653
5709
|
|
|
5654
5710
|
// A hot update to a layout tree's client module renders the route again.
|
|
@@ -6459,7 +6515,7 @@ async function loadLayoutComponents(layouts = [], params = {}, source) {
|
|
|
6459
6515
|
return loadedLayouts;
|
|
6460
6516
|
}
|
|
6461
6517
|
|
|
6462
|
-
${
|
|
6518
|
+
${_chunkKWST2O22cjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
6463
6519
|
function wrapWithLoadedLayouts(element, loadedLayouts, params) {
|
|
6464
6520
|
let wrapped = element;
|
|
6465
6521
|
for (let index = loadedLayouts.length - 1; index >= 0; index--) {
|
|
@@ -6744,7 +6800,7 @@ function readActiveLayoutPatterns() {
|
|
|
6744
6800
|
.filter(Boolean);
|
|
6745
6801
|
}
|
|
6746
6802
|
|
|
6747
|
-
${
|
|
6803
|
+
${_chunkKWST2O22cjs.FARM_NAVIGATION_SCRIPT_SOURCE}
|
|
6748
6804
|
|
|
6749
6805
|
function activateFragmentScripts(root) {
|
|
6750
6806
|
for (const script of Array.from(root.querySelectorAll?.('script') || [])) {
|
|
@@ -6803,7 +6859,7 @@ function getLayoutShell(root, patterns, index, find) {
|
|
|
6803
6859
|
return shell.innerHTML;
|
|
6804
6860
|
}
|
|
6805
6861
|
|
|
6806
|
-
${islandValues ?
|
|
6862
|
+
${islandValues ? _chunkKWST2O22cjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceNavigationBoundary(
|
|
6807
6863
|
container,
|
|
6808
6864
|
fragment,
|
|
6809
6865
|
currentPatterns,
|
|
@@ -6876,7 +6932,7 @@ ${islandValues ? `
|
|
|
6876
6932
|
return nextTarget;
|
|
6877
6933
|
}
|
|
6878
6934
|
|
|
6879
|
-
${islandValues ? `${
|
|
6935
|
+
${islandValues ? `${_chunkKWST2O22cjs.FARM_NAVIGATION_STREAM_READER_SOURCE}
|
|
6880
6936
|
|
|
6881
6937
|
// Islands mode navigates as the production client does: it fetches the page itself, names the
|
|
6882
6938
|
// layouts it shows by key (F-Layouts), and asks for flush markers (F-Stream), so the shell arrives
|
|
@@ -7573,7 +7629,7 @@ function generateClientManifest(bundle) {
|
|
|
7573
7629
|
async function defineConfig(config = {}) {
|
|
7574
7630
|
const tailwindVitePlugin = await _chunkDMXMIE2Ccjs.loadTailwindVitePlugin.call(void 0, );
|
|
7575
7631
|
const appRoot = path6.resolve(config.root || process.cwd());
|
|
7576
|
-
if (_optionalChain([config, 'access',
|
|
7632
|
+
if (_optionalChain([config, 'access', _471 => _471.extends, 'optionalAccess', _472 => _472.length])) {
|
|
7577
7633
|
const { config: layeredConfig } = await import("./layers-7P4RLKVX.cjs").then(
|
|
7578
7634
|
({ resolveFarmLayers }) => resolveFarmLayers(config, {
|
|
7579
7635
|
root: appRoot,
|
|
@@ -7583,7 +7639,7 @@ async function defineConfig(config = {}) {
|
|
|
7583
7639
|
config = layeredConfig;
|
|
7584
7640
|
}
|
|
7585
7641
|
config.renderer = _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, config.renderer);
|
|
7586
|
-
config.images =
|
|
7642
|
+
config.images = _chunkKWST2O22cjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, { root: appRoot, dev: true });
|
|
7587
7643
|
const rendererVitePlugins = await _chunk67MZTLTFcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, appRoot, {
|
|
7588
7644
|
ssr: true
|
|
7589
7645
|
});
|
|
@@ -7675,13 +7731,13 @@ async function defineConfig(config = {}) {
|
|
|
7675
7731
|
if (!serverStarted) {
|
|
7676
7732
|
serverStarted = true;
|
|
7677
7733
|
const elapsed = Date.now() - startTime;
|
|
7678
|
-
const address = _optionalChain([server, 'access',
|
|
7734
|
+
const address = _optionalChain([server, 'access', _473 => _473.httpServer, 'optionalAccess', _474 => _474.address, 'call', _475 => _475()]);
|
|
7679
7735
|
const resolvedPort = typeof address === "object" && address ? address.port : server.config.server.port || port || 3e3;
|
|
7680
7736
|
const hostConfig = server.config.server.host;
|
|
7681
7737
|
const isExposed = hostConfig === true || hostConfig === "0.0.0.0";
|
|
7682
7738
|
console.log("");
|
|
7683
7739
|
console.log(
|
|
7684
|
-
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${
|
|
7740
|
+
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkMEJCP2LXcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
|
|
7685
7741
|
);
|
|
7686
7742
|
console.log("");
|
|
7687
7743
|
console.log(
|
|
@@ -7715,7 +7771,7 @@ async function defineConfig(config = {}) {
|
|
|
7715
7771
|
plugins: [
|
|
7716
7772
|
// `farm dev --desktop`: only the desktop window gets an answer, as in the packaged app.
|
|
7717
7773
|
_chunk3QM74STYcjs.farmDesktopDevGuardPlugin.call(void 0, config.basePath),
|
|
7718
|
-
|
|
7774
|
+
_chunkKWST2O22cjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
7719
7775
|
tailwindVitePlugin,
|
|
7720
7776
|
...rendererVitePlugins,
|
|
7721
7777
|
...reactRefreshPlugins,
|
|
@@ -7723,14 +7779,14 @@ async function defineConfig(config = {}) {
|
|
|
7723
7779
|
farmI18nClientBridgePlugin(),
|
|
7724
7780
|
farmServerOnlyEntriesPlugin(),
|
|
7725
7781
|
farmPlugin(config),
|
|
7726
|
-
|
|
7782
|
+
_chunk2IFT2CSAcjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
|
|
7727
7783
|
farmBrandingPlugin
|
|
7728
7784
|
],
|
|
7729
7785
|
customLogger: farmLogger,
|
|
7730
7786
|
clearScreen: false,
|
|
7731
7787
|
optimizeDeps: {
|
|
7732
|
-
...
|
|
7733
|
-
|
|
7788
|
+
..._chunkKWST2O22cjs.createFarmClientOptimizeDepsConfig.call(void 0,
|
|
7789
|
+
_chunkKWST2O22cjs.createFarmClientOptimizeDepsEntries.call(void 0,
|
|
7734
7790
|
appRoot,
|
|
7735
7791
|
_chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, { ...config, root: appRoot })
|
|
7736
7792
|
),
|
|
@@ -7773,7 +7829,7 @@ async function defineConfig(config = {}) {
|
|
|
7773
7829
|
// Stub out problematic server-only modules during dev mode
|
|
7774
7830
|
alias: {
|
|
7775
7831
|
..._chunkMTBDJ326cjs.getFarmLayerAliases.call(void 0, config.layers),
|
|
7776
|
-
...
|
|
7832
|
+
..._chunkKWST2O22cjs.createFarmSourceAlias.call(void 0, appRoot, config.srcDir),
|
|
7777
7833
|
// Nitro internals that should not be resolved in browser
|
|
7778
7834
|
"supports-color": "data:text/javascript,export default false; export const supportsColor = false; export const stdout = false; export const stderr = false;",
|
|
7779
7835
|
"@poppinss/dumper": "data:text/javascript,export default {};",
|