@farm.js/core 0.1.62 → 0.1.64
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-OV4WRFBL.cjs → agent-mcp-handler-OXT73ZBY.cjs} +5 -5
- package/dist/{agent-mcp-handler-7QMX2LUY.mjs → agent-mcp-handler-QLFDDTYN.mjs} +4 -4
- package/dist/{agent-mcp.d-BKZ3UNbt.d.mts → agent-mcp.d-CO_ABmNK.d.mts} +1 -1
- package/dist/{agent-mcp.d-C1zr_nGS.d.ts → agent-mcp.d-QD2WZ9BS.d.ts} +1 -1
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/analyzer-ODLF2Z6O.cjs +16 -0
- package/dist/{analyzer-YESYU3GK.mjs → analyzer-Q3QXC6PD.mjs} +3 -2
- 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 +3 -3
- package/dist/api.d.ts +3 -3
- package/dist/{app-manifest.d-ntch_bvA.d.ts → app-manifest.d-BpKxiU_E.d.mts} +9 -1
- package/dist/{app-manifest.d-BpvhfKRH.d.mts → app-manifest.d-DDmNkYQQ.d.ts} +9 -1
- package/dist/app-markdown.cjs +4 -4
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/app-markdown.mjs +3 -3
- package/dist/{app.d-CysWA_8v.d.mts → app.d-kuoVWhWM.d.mts} +4 -4
- package/dist/{app.d-AE8_v3Db.d.ts → app.d-x68Cwr0_.d.ts} +4 -4
- package/dist/{chunk-LT4VAF5Z.cjs → chunk-2C5L5RPM.cjs} +7 -6
- package/dist/{chunk-RMUD75WT.cjs → chunk-3EBHJET2.cjs} +355 -270
- package/dist/{chunk-RZNCMRD3.mjs → chunk-6NHSGVVA.mjs} +1 -1
- package/dist/{chunk-LVWGURLD.mjs → chunk-6NNYPY5W.mjs} +327 -13
- package/dist/{chunk-PRFNLQSP.cjs → chunk-7XGWBPQQ.cjs} +4 -4
- package/dist/{chunk-SG57PX7K.cjs → chunk-BTVDYS4B.cjs} +7 -2
- package/dist/{chunk-545WJ5UG.cjs → chunk-DUSHDZQL.cjs} +11 -11
- package/dist/{chunk-GVOMPU3Y.cjs → chunk-EL4364S2.cjs} +209 -32
- package/dist/{chunk-GGNJAGGE.cjs → chunk-FAP7CX7C.cjs} +1056 -529
- package/dist/{chunk-T46NNU4D.mjs → chunk-FH45OB37.mjs} +2 -2
- package/dist/{chunk-55U5QIXQ.mjs → chunk-FIR62CR3.mjs} +1 -1
- package/dist/{chunk-MEQN6DDA.cjs → chunk-FJWN7RV4.cjs} +5 -5
- package/dist/chunk-IOEXXZK3.mjs +88 -0
- package/dist/{chunk-EXXFSZOC.cjs → chunk-JCPSA4X5.cjs} +135 -134
- package/dist/{chunk-YSXTNSXS.mjs → chunk-K7OZAVOI.mjs} +7 -6
- package/dist/{chunk-KVW2M6PI.mjs → chunk-KL7SHLQB.mjs} +1 -1
- package/dist/{chunk-NT3QDN2E.mjs → chunk-LQDLEWPO.mjs} +1 -1
- package/dist/{chunk-UZZ6IEQP.mjs → chunk-MESQF2JC.mjs} +2 -2
- package/dist/{chunk-WKJQ2FJA.cjs → chunk-MG356ROI.cjs} +5 -5
- package/dist/{chunk-AJB3DHN6.cjs → chunk-N3Z3PLHC.cjs} +2 -2
- package/dist/{chunk-2CNKQC3G.mjs → chunk-NNLFW3P4.mjs} +2 -2
- package/dist/{chunk-XX32BOMM.cjs → chunk-NXFA7G3Y.cjs} +52 -26
- package/dist/{chunk-SM25ZC4S.cjs → chunk-O2XFIPNL.cjs} +1 -1
- package/dist/{chunk-VWW4Q3BJ.mjs → chunk-O4FWNLQK.mjs} +4 -4
- package/dist/{chunk-DZPR2W6U.cjs → chunk-O6L3YYPM.cjs} +5 -5
- package/dist/{chunk-UWI3SJAK.cjs → chunk-O7IEMY55.cjs} +3 -3
- package/dist/{chunk-6BJJYOFL.cjs → chunk-OLIGNTWU.cjs} +7 -7
- package/dist/{chunk-OUWRNHTV.mjs → chunk-OYF23QLG.mjs} +17 -16
- package/dist/{chunk-IQIKPKFP.mjs → chunk-RAH5MT53.mjs} +110 -25
- package/dist/{chunk-E72UD6ME.mjs → chunk-RVGSVQWT.mjs} +1 -1
- package/dist/{chunk-ZVIEFTUA.cjs → chunk-S25BQIFW.cjs} +16 -16
- package/dist/chunk-S7ZW72JH.cjs +254 -0
- package/dist/{chunk-VM7X5CKC.mjs → chunk-SLYDIHLW.mjs} +31 -5
- package/dist/chunk-SNFTMSHX.mjs +254 -0
- package/dist/{chunk-2WZTGPK6.mjs → chunk-SQ5O7I3L.mjs} +7 -2
- package/dist/{chunk-PCXIJKPM.mjs → chunk-TNBJ4LZG.mjs} +2 -2
- package/dist/{chunk-O27PLNQZ.cjs → chunk-UJ3R2AH2.cjs} +4 -4
- package/dist/{chunk-T4TBK5NY.mjs → chunk-VQ4NWOWO.mjs} +2 -2
- package/dist/{chunk-ZZ2QKCKW.mjs → chunk-WAY6LOQH.mjs} +1 -1
- package/dist/chunk-WBTHHTBO.cjs +88 -0
- package/dist/{chunk-ZBUAOGMY.mjs → chunk-WFNAOWH4.mjs} +1 -1
- package/dist/{chunk-IWRLV46X.cjs → chunk-WMTBBQHY.cjs} +4 -4
- package/dist/{chunk-2JYBLE63.mjs → chunk-WNYRYI4D.mjs} +770 -243
- package/dist/{chunk-CI4UNQHO.cjs → chunk-XBSKPLHF.cjs} +2 -2
- package/dist/{chunk-IOF4KXMP.mjs → chunk-XVWSDSUM.mjs} +201 -24
- package/dist/{chunk-JEJQGZI7.cjs → chunk-XZLZ6YPP.cjs} +346 -32
- package/dist/{chunk-QAS7KE7J.cjs → chunk-Y5TOT5F6.cjs} +5 -5
- package/dist/{chunk-DPE53XWL.mjs → chunk-ZEXE4TGY.mjs} +1 -1
- package/dist/{client-component.d-BoqC2MLC.d.mts → client-component.d-D74pqdea.d.mts} +14 -3
- package/dist/{client-component.d-Bgt3x5Fu.d.ts → client-component.d-D8VcypQA.d.ts} +14 -3
- package/dist/{client-plugins.d-BcqIy4au.d.ts → client-plugins.d-CXElzotB.d.ts} +18 -2
- package/dist/{client-plugins.d-CWyYBxXf.d.mts → client-plugins.d-D4-6hNx7.d.mts} +18 -2
- 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-NUVXYG7I.mjs → devtools-MX3FE733.mjs} +5 -5
- package/dist/{devtools-SVRSGPNC.cjs → devtools-WET5NAKO.cjs} +6 -6
- package/dist/docs.cjs +8 -8
- package/dist/docs.d.mts +2 -2
- package/dist/docs.d.ts +2 -2
- package/dist/docs.mjs +7 -7
- package/dist/index.cjs +21 -20
- package/dist/{index.d-nAncqTXz.d.ts → index.d-A_x10zGS.d.ts} +1 -1
- package/dist/{index.d-BDaiu2i5.d.mts → index.d-SSgYDv4D.d.mts} +1 -1
- package/dist/index.d.mts +16 -16
- package/dist/index.d.ts +16 -16
- package/dist/index.mjs +20 -19
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/internal/app-markdown-runtime.cjs +3 -3
- package/dist/internal/app-markdown-runtime.d.mts +2 -2
- package/dist/internal/app-markdown-runtime.d.ts +2 -2
- package/dist/internal/app-markdown-runtime.mjs +2 -2
- package/dist/internal/build-runtime.cjs +22 -21
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +21 -20
- package/dist/internal/cli-runtime.cjs +7 -7
- package/dist/internal/cli-runtime.mjs +6 -6
- 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 +7 -7
- package/dist/internal/config-runtime.d.mts +4 -4
- package/dist/internal/config-runtime.d.ts +4 -4
- package/dist/internal/config-runtime.mjs +6 -6
- package/dist/internal/infra-analytics-runtime.cjs +11 -9
- package/dist/internal/infra-analytics-runtime.mjs +9 -7
- package/dist/internal/native-server-fns.cjs +5 -4
- package/dist/internal/native-server-fns.mjs +4 -3
- package/dist/internal/product-telemetry-runtime.cjs +17 -211
- package/dist/internal/product-telemetry-runtime.mjs +10 -204
- package/dist/internal/production-runtime.cjs +13 -12
- package/dist/internal/production-runtime.d.mts +13 -12
- package/dist/internal/production-runtime.d.ts +13 -12
- package/dist/internal/production-runtime.mjs +14 -13
- package/dist/internal/react-cache.cjs +21 -1
- package/dist/internal/react-cache.d.mts +8 -1
- package/dist/internal/react-cache.d.ts +8 -1
- package/dist/internal/react-cache.mjs +21 -1
- package/dist/markdown.cjs +2 -2
- package/dist/markdown.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/markdown.mjs +1 -1
- package/dist/middleware.d.mts +3 -3
- package/dist/middleware.d.ts +3 -3
- package/dist/mobile.d.mts +2 -2
- package/dist/mobile.d.ts +2 -2
- package/dist/{native-tree-AS5L3ID3.mjs → native-tree-BPEE2LAL.mjs} +2 -2
- package/dist/{native-tree-Z2WYUJEV.cjs → native-tree-WOX3JMBG.cjs} +3 -3
- package/dist/{navigation-delegate.d-CSCm8ZxL.d.mts → navigation-delegate.d-DQVYKoaZ.d.mts} +1 -1
- package/dist/{navigation-delegate.d-BbUHRXxG.d.ts → navigation-delegate.d-GghbHJuK.d.ts} +1 -1
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/plugin.cjs +14 -14
- package/dist/plugin.d.mts +3 -3
- package/dist/plugin.d.ts +3 -3
- package/dist/plugin.mjs +13 -13
- package/dist/{production-runtime.d-DgT24A0f.d.ts → production-runtime.d-Bzns3NW9.d.ts} +1 -1
- package/dist/{production-runtime.d-CcQiDko5.d.mts → production-runtime.d-DiFa5vHW.d.mts} +1 -1
- package/dist/{render-plan.d-CyrX6MDs.d.ts → render-plan.d-CL_Ikfg_.d.ts} +1 -1
- package/dist/{render-plan.d-BH9WF-JZ.d.mts → render-plan.d-CcF0MeCf.d.mts} +1 -1
- package/dist/renderer-client.d.mts +4 -4
- package/dist/renderer-client.d.ts +4 -4
- package/dist/{request.d-BB8M8bcD.d.ts → request.d-B1RnTLri.d.ts} +1 -1
- package/dist/{request.d-CUrPnCW7.d.mts → request.d-DarDOCk9.d.mts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering.d-DYqZMIf4.d.ts → route-rendering.d-BTUYCIj4.d.ts} +1 -1
- package/dist/{route-rendering.d-CYxlzaFm.d.mts → route-rendering.d-D_2Ual0-.d.mts} +1 -1
- package/dist/{router.d-DaKo507j.d.ts → router.d-CMANF6da.d.ts} +1 -1
- package/dist/{router.d-7o24CD8u.d.mts → router.d-Cuv1jntg.d.mts} +1 -1
- package/dist/{routes.d-BknKQcTu.d.ts → routes.d-B6yFe6jm.d.ts} +1 -1
- package/dist/{routes.d-D1IrO9KK.d.mts → routes.d-c2HKfrfL.d.mts} +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/{rsc-pipeline-RFLHDAKD.mjs → rsc-pipeline-3LNVP2OO.mjs} +6 -6
- package/dist/{rsc-pipeline-OF2I7PCX.cjs → rsc-pipeline-G5WELVW3.cjs} +7 -7
- package/dist/{runtime-LBTK62AD.cjs → runtime-DMEULPE7.cjs} +22 -11
- package/dist/{runtime-M6UJCSLA.mjs → runtime-HQJ2LLQL.mjs} +20 -9
- package/dist/{runtime.d-CN73a-IL.d.ts → runtime.d-C3RQUj6_.d.ts} +1 -1
- package/dist/{runtime.d-CcNuzhX6.d.mts → runtime.d-wvh4ngU0.d.mts} +1 -1
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server.cjs +31 -31
- package/dist/server.d.mts +9 -9
- package/dist/server.d.ts +9 -9
- package/dist/server.mjs +16 -16
- package/dist/{spa-router.d-CNi77LZm.d.mts → spa-router.d-WU_qS5gJ.d.mts} +2 -2
- package/dist/{spa-router.d-Cvgf5QP4.d.ts → spa-router.d-m8H_Kl_B.d.ts} +2 -2
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{utils.d-C3H-14_Y.d.ts → utils.d-C9dQD5Zg.d.ts} +1 -1
- package/dist/{utils.d-D8VfzZYn.d.mts → utils.d-W9IiEqmW.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +18 -14
- package/dist/vite.d.mts +23 -5
- package/dist/vite.d.ts +23 -5
- package/dist/vite.mjs +17 -13
- package/package.json +1 -1
- package/dist/analyzer-2AHWJJR7.cjs +0 -15
- package/dist/chunk-CSLUBKGG.mjs +0 -44
- package/dist/chunk-SGBNF56S.cjs +0 -44
|
@@ -37,7 +37,12 @@ var _chunk5IQ2ERQAcjs = require('./chunk-5IQ2ERQA.cjs');
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
var _chunkFAP7CX7Ccjs = require('./chunk-FAP7CX7C.cjs');
|
|
41
46
|
|
|
42
47
|
|
|
43
48
|
var _chunkR53QDV6Tcjs = require('./chunk-R53QDV6T.cjs');
|
|
@@ -61,13 +66,12 @@ var _chunkX4K7TYN6cjs = require('./chunk-X4K7TYN6.cjs');
|
|
|
61
66
|
|
|
62
67
|
|
|
63
68
|
|
|
64
|
-
var
|
|
69
|
+
var _chunkUJ3R2AH2cjs = require('./chunk-UJ3R2AH2.cjs');
|
|
65
70
|
|
|
66
71
|
|
|
67
72
|
var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
|
|
68
73
|
|
|
69
74
|
|
|
70
|
-
var _chunkSGBNF56Scjs = require('./chunk-SGBNF56S.cjs');
|
|
71
75
|
|
|
72
76
|
|
|
73
77
|
|
|
@@ -80,12 +84,13 @@ var _chunkSGBNF56Scjs = require('./chunk-SGBNF56S.cjs');
|
|
|
80
84
|
|
|
81
85
|
|
|
82
86
|
|
|
87
|
+
var _chunkNXFA7G3Ycjs = require('./chunk-NXFA7G3Y.cjs');
|
|
83
88
|
|
|
84
89
|
|
|
85
|
-
var
|
|
90
|
+
var _chunkY5TOT5F6cjs = require('./chunk-Y5TOT5F6.cjs');
|
|
86
91
|
|
|
87
92
|
|
|
88
|
-
var
|
|
93
|
+
var _chunkS7ZW72JHcjs = require('./chunk-S7ZW72JH.cjs');
|
|
89
94
|
|
|
90
95
|
|
|
91
96
|
|
|
@@ -132,10 +137,10 @@ var _chunkRD623KW4cjs = require('./chunk-RD623KW4.cjs');
|
|
|
132
137
|
|
|
133
138
|
|
|
134
139
|
|
|
135
|
-
var
|
|
140
|
+
var _chunkO6L3YYPMcjs = require('./chunk-O6L3YYPM.cjs');
|
|
136
141
|
|
|
137
142
|
|
|
138
|
-
var
|
|
143
|
+
var _chunkFJWN7RV4cjs = require('./chunk-FJWN7RV4.cjs');
|
|
139
144
|
|
|
140
145
|
|
|
141
146
|
|
|
@@ -152,7 +157,7 @@ var _chunk3EIPOTZVcjs = require('./chunk-3EIPOTZV.cjs');
|
|
|
152
157
|
|
|
153
158
|
|
|
154
159
|
|
|
155
|
-
var
|
|
160
|
+
var _chunk7XGWBPQQcjs = require('./chunk-7XGWBPQQ.cjs');
|
|
156
161
|
|
|
157
162
|
|
|
158
163
|
|
|
@@ -161,7 +166,7 @@ var _chunkPRFNLQSPcjs = require('./chunk-PRFNLQSP.cjs');
|
|
|
161
166
|
|
|
162
167
|
|
|
163
168
|
|
|
164
|
-
var
|
|
169
|
+
var _chunk2C5L5RPMcjs = require('./chunk-2C5L5RPM.cjs');
|
|
165
170
|
|
|
166
171
|
|
|
167
172
|
|
|
@@ -252,7 +257,7 @@ var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
|
|
|
252
257
|
var _chunkCFG4QERRcjs = require('./chunk-CFG4QERR.cjs');
|
|
253
258
|
|
|
254
259
|
|
|
255
|
-
var
|
|
260
|
+
var _chunkO2XFIPNLcjs = require('./chunk-O2XFIPNL.cjs');
|
|
256
261
|
|
|
257
262
|
|
|
258
263
|
var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
|
|
@@ -692,6 +697,11 @@ async function createBlurDataURL(bytes) {
|
|
|
692
697
|
|
|
693
698
|
var _parseAst = require('rolldown/parseAst');
|
|
694
699
|
var FARM_REACT_CACHE_MODULE = "@farm.js/core/internal/react-cache";
|
|
700
|
+
var REACT_CACHE_LOCAL = "__farm_react_cache__";
|
|
701
|
+
var REACT_CACHE_APIS = {
|
|
702
|
+
cache: REACT_CACHE_LOCAL,
|
|
703
|
+
cacheSignal: "__farm_react_cache_signal__"
|
|
704
|
+
};
|
|
695
705
|
function rewriteFarmReactCacheImport(code, file) {
|
|
696
706
|
if (!code.includes("cache") || !code.includes("react")) return null;
|
|
697
707
|
const extension = path2.default.extname(file).slice(1);
|
|
@@ -702,15 +712,25 @@ function rewriteFarmReactCacheImport(code, file) {
|
|
|
702
712
|
} catch (e8) {
|
|
703
713
|
return null;
|
|
704
714
|
}
|
|
705
|
-
|
|
715
|
+
const edits = [];
|
|
706
716
|
const declarations = (_nullishCoalesce(program.body, () => ( []))).filter(
|
|
707
717
|
(node) => node.type === "ImportDeclaration" && _optionalChain([node, 'access', _39 => _39.source, 'optionalAccess', _40 => _40.value]) === "react" && node.importKind !== "type"
|
|
708
718
|
);
|
|
709
|
-
|
|
710
|
-
|
|
719
|
+
const namespaces = /* @__PURE__ */ new Set();
|
|
720
|
+
let memberImportAt = null;
|
|
721
|
+
for (const node of declarations) {
|
|
711
722
|
const specifiers = _nullishCoalesce(node.specifiers, () => ( []));
|
|
723
|
+
for (const specifier of specifiers) {
|
|
724
|
+
if (specifier.type === "ImportDefaultSpecifier" || specifier.type === "ImportNamespaceSpecifier") {
|
|
725
|
+
namespaces.add(specifier.local.name);
|
|
726
|
+
_nullishCoalesce(memberImportAt, () => ( (memberImportAt = node.end)));
|
|
727
|
+
}
|
|
728
|
+
}
|
|
712
729
|
const caches = specifiers.filter(
|
|
713
|
-
(specifier) => specifier.type === "ImportSpecifier" && specifier.importKind !== "type" &&
|
|
730
|
+
(specifier) => specifier.type === "ImportSpecifier" && specifier.importKind !== "type" && Object.prototype.hasOwnProperty.call(
|
|
731
|
+
REACT_CACHE_APIS,
|
|
732
|
+
_nullishCoalesce(_nullishCoalesce(_optionalChain([specifier, 'access', _41 => _41.imported, 'optionalAccess', _42 => _42.name]), () => ( _optionalChain([specifier, 'access', _43 => _43.imported, 'optionalAccess', _44 => _44.value]))), () => ( ""))
|
|
733
|
+
)
|
|
714
734
|
);
|
|
715
735
|
if (caches.length === 0) continue;
|
|
716
736
|
const others = specifiers.filter((specifier) => !caches.includes(specifier));
|
|
@@ -723,12 +743,48 @@ function rewriteFarmReactCacheImport(code, file) {
|
|
|
723
743
|
].join(", ");
|
|
724
744
|
const lines = [
|
|
725
745
|
...clause ? [`import ${clause} from "react";`] : [],
|
|
726
|
-
`import { ${caches.map((specifier) =>
|
|
746
|
+
`import { ${caches.map((specifier) => `${_nullishCoalesce(_optionalChain([specifier, 'access', _45 => _45.imported, 'optionalAccess', _46 => _46.name]), () => ( _optionalChain([specifier, 'access', _47 => _47.imported, 'optionalAccess', _48 => _48.value])))} as ${specifier.local.name}`).join(", ")} } from ${JSON.stringify(FARM_REACT_CACHE_MODULE)};`
|
|
727
747
|
];
|
|
728
|
-
|
|
729
|
-
|
|
748
|
+
edits.push({ start: node.start, end: node.end, text: lines.join("\n") });
|
|
749
|
+
}
|
|
750
|
+
if (namespaces.size > 0 && memberImportAt !== null) {
|
|
751
|
+
const used = /* @__PURE__ */ new Set();
|
|
752
|
+
const visit = (node) => {
|
|
753
|
+
if (!node || typeof node !== "object") return;
|
|
754
|
+
if (Array.isArray(node)) {
|
|
755
|
+
for (const child of node) visit(child);
|
|
756
|
+
return;
|
|
757
|
+
}
|
|
758
|
+
const current = node;
|
|
759
|
+
if (typeof current.type !== "string") return;
|
|
760
|
+
if (current.type === "ImportDeclaration") return;
|
|
761
|
+
if (current.type === "MemberExpression" && !current.computed && _optionalChain([current, 'access', _49 => _49.object, 'optionalAccess', _50 => _50.type]) === "Identifier" && namespaces.has(current.object.name) && Object.prototype.hasOwnProperty.call(REACT_CACHE_APIS, _nullishCoalesce(_optionalChain([current, 'access', _51 => _51.property, 'optionalAccess', _52 => _52.name]), () => ( "")))) {
|
|
762
|
+
const name = current.property.name;
|
|
763
|
+
edits.push({ start: current.start, end: current.end, text: REACT_CACHE_APIS[name] });
|
|
764
|
+
used.add(name);
|
|
765
|
+
return;
|
|
766
|
+
}
|
|
767
|
+
for (const [key, value] of Object.entries(current)) {
|
|
768
|
+
if (key === "start" || key === "end" || key === "loc" || key === "range") continue;
|
|
769
|
+
if (value && typeof value === "object") visit(value);
|
|
770
|
+
}
|
|
771
|
+
};
|
|
772
|
+
visit(program);
|
|
773
|
+
if (used.size > 0) {
|
|
774
|
+
edits.push({
|
|
775
|
+
start: memberImportAt,
|
|
776
|
+
end: memberImportAt,
|
|
777
|
+
text: `
|
|
778
|
+
import { ${[...used].map((name) => `${name} as ${REACT_CACHE_APIS[name]}`).join(", ")} } from ${JSON.stringify(FARM_REACT_CACHE_MODULE)};`
|
|
779
|
+
});
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
if (edits.length === 0) return null;
|
|
783
|
+
let output = code;
|
|
784
|
+
for (const edit of edits.sort((left, right) => right.start - left.start)) {
|
|
785
|
+
output = output.slice(0, edit.start) + edit.text + output.slice(edit.end);
|
|
730
786
|
}
|
|
731
|
-
return
|
|
787
|
+
return output;
|
|
732
788
|
}
|
|
733
789
|
|
|
734
790
|
// src/navigation/page-data-error.ts
|
|
@@ -773,13 +829,13 @@ function reportOpenAPIDevGenerationResult(spec, output = _chunkQMNWKQL4cjs.logge
|
|
|
773
829
|
// src/vite.ts
|
|
774
830
|
var SERVER_FN_TRANSFORM_PLUGIN = "@farm.js/plugin/rsc:server-fn-actions";
|
|
775
831
|
function farmLlmsTxtGeneratedPaths(config) {
|
|
776
|
-
const llms =
|
|
832
|
+
const llms = _chunkFJWN7RV4cjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([config, 'access', _53 => _53.agent, 'optionalAccess', _54 => _54.llmsTxt]));
|
|
777
833
|
if (!llms.enabled) return [];
|
|
778
834
|
return llms.full ? ["/llms.txt", "/llms-full.txt"] : ["/llms.txt"];
|
|
779
835
|
}
|
|
780
836
|
function farmAgentGeneratedPaths(config) {
|
|
781
|
-
const crawlers =
|
|
782
|
-
const sitemap =
|
|
837
|
+
const crawlers = _chunkO6L3YYPMcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access', _55 => _55.agent, 'optionalAccess', _56 => _56.crawlers]));
|
|
838
|
+
const sitemap = _chunkO6L3YYPMcjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([config, 'access', _57 => _57.agent, 'optionalAccess', _58 => _58.sitemap]));
|
|
783
839
|
return [
|
|
784
840
|
...farmLlmsTxtGeneratedPaths(config),
|
|
785
841
|
...sitemap.enabled ? ["/sitemap.xml"] : [],
|
|
@@ -824,7 +880,7 @@ function loadFarmWorkflowsDevRuntime() {
|
|
|
824
880
|
return import("./workflows.cjs");
|
|
825
881
|
}
|
|
826
882
|
function loadFarmDevtoolsSnapshotRuntime() {
|
|
827
|
-
return import("./devtools-
|
|
883
|
+
return import("./devtools-WET5NAKO.cjs");
|
|
828
884
|
}
|
|
829
885
|
function loadFarmDevtoolsUIRuntime() {
|
|
830
886
|
return import("./devtools-ui-SYRUXUA7.cjs");
|
|
@@ -837,7 +893,7 @@ function farmI18nClientBridgePlugin() {
|
|
|
837
893
|
name: "farm:i18n-client-bridge",
|
|
838
894
|
enforce: "pre",
|
|
839
895
|
resolveId(id, _importer, options) {
|
|
840
|
-
if (id === "@farm.js/core/i18n/server" && !_optionalChain([options, 'optionalAccess',
|
|
896
|
+
if (id === "@farm.js/core/i18n/server" && !_optionalChain([options, 'optionalAccess', _59 => _59.ssr])) {
|
|
841
897
|
return FARM_I18N_CLIENT_BRIDGE_ID;
|
|
842
898
|
}
|
|
843
899
|
return null;
|
|
@@ -850,6 +906,7 @@ function farmI18nClientBridgePlugin() {
|
|
|
850
906
|
}
|
|
851
907
|
var FARM_SERVER_ONLY_ENTRIES = /* @__PURE__ */ new Set(["@farm.js/core/og"]);
|
|
852
908
|
var SERVER_ONLY_PACKAGE = "server-only";
|
|
909
|
+
var farmReactServerFiles = /* @__PURE__ */ new Set();
|
|
853
910
|
var FARM_SERVER_ONLY_PACKAGE_ID = "\0farm:server-only";
|
|
854
911
|
var FARM_PLATFORM_ENTRY = "@farm.js/core/platform";
|
|
855
912
|
var FARM_PLATFORM_CLIENT_ID = "\0farm:platform-client";
|
|
@@ -877,21 +934,21 @@ function farmServerOnlyEntriesPlugin(options = {}) {
|
|
|
877
934
|
root = config.root;
|
|
878
935
|
},
|
|
879
936
|
resolveId(id, importer, options2) {
|
|
880
|
-
if (id === FARM_PLATFORM_ENTRY) return _optionalChain([options2, 'optionalAccess',
|
|
937
|
+
if (id === FARM_PLATFORM_ENTRY) return _optionalChain([options2, 'optionalAccess', _60 => _60.ssr]) ? null : FARM_PLATFORM_CLIENT_ID;
|
|
881
938
|
if (id === SERVER_ONLY_PACKAGE) {
|
|
882
|
-
if (_optionalChain([options2, 'optionalAccess',
|
|
939
|
+
if (_optionalChain([options2, 'optionalAccess', _61 => _61.ssr]) || _optionalChain([options2, 'optionalAccess', _62 => _62.scan])) {
|
|
883
940
|
return FARM_SERVER_ONLY_PACKAGE_ID;
|
|
884
941
|
}
|
|
885
942
|
this.error(
|
|
886
943
|
`${_nullishCoalesce(importer, () => ( "A module"))} imports "server-only", so it must not reach the browser, but client code imports it. Move what the client needs out of that module, or call it from a server component, server function or API route.`
|
|
887
944
|
);
|
|
888
945
|
}
|
|
889
|
-
if (!_optionalChain([options2, 'optionalAccess',
|
|
946
|
+
if (!_optionalChain([options2, 'optionalAccess', _63 => _63.ssr]) && _module.isBuiltin.call(void 0, id)) {
|
|
890
947
|
return _chunkNK2VWS7Pcjs.resolveFarmBrowserBuiltin.call(void 0, this, id, importer, options2);
|
|
891
948
|
}
|
|
892
949
|
if (!FARM_SERVER_ONLY_ENTRIES.has(id)) return null;
|
|
893
950
|
const importedBy = importer ? ` (imported by ${importer})` : "";
|
|
894
|
-
if (!_optionalChain([options2, 'optionalAccess',
|
|
951
|
+
if (!_optionalChain([options2, 'optionalAccess', _64 => _64.ssr])) {
|
|
895
952
|
this.error(
|
|
896
953
|
`${id} is server-only and cannot be imported into client code${importedBy}. Use it from an API route or another server module.`
|
|
897
954
|
);
|
|
@@ -941,10 +998,10 @@ function renderFarmI18nStaticHead(requestPath, snapshot) {
|
|
|
941
998
|
if (!snapshot) return "";
|
|
942
999
|
const runtime = `<script>window.__FARM_I18N__ = ${serializeFarmInlineValue(snapshot)};</script>`;
|
|
943
1000
|
if (snapshot.routing === "none") return runtime;
|
|
944
|
-
return `${
|
|
1001
|
+
return `${_chunkUJ3R2AH2cjs.renderFarmLocaleAlternateLinks.call(void 0, requestPath, snapshot)}${runtime}`;
|
|
945
1002
|
}
|
|
946
1003
|
function getPublicEnvDefine(config) {
|
|
947
|
-
const publicEnv = _optionalChain([config, 'access',
|
|
1004
|
+
const publicEnv = _optionalChain([config, 'access', _65 => _65.env, 'optionalAccess', _66 => _66.public]);
|
|
948
1005
|
if (!isResolvedEnvScope(publicEnv)) {
|
|
949
1006
|
return {};
|
|
950
1007
|
}
|
|
@@ -983,7 +1040,7 @@ function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request)
|
|
|
983
1040
|
return;
|
|
984
1041
|
}
|
|
985
1042
|
if (res.headersSent) {
|
|
986
|
-
_optionalChain([res, 'access',
|
|
1043
|
+
_optionalChain([res, 'access', _67 => _67.destroy, 'optionalCall', _68 => _68(error instanceof Error ? error : new Error(String(error)))]);
|
|
987
1044
|
return;
|
|
988
1045
|
}
|
|
989
1046
|
res.statusCode = 500;
|
|
@@ -1086,7 +1143,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1086
1143
|
const originalWrite = res.write.bind(res);
|
|
1087
1144
|
const originalEnd = res.end.bind(res);
|
|
1088
1145
|
const originalWriteHead = res.writeHead.bind(res);
|
|
1089
|
-
const originalFlushHeaders = _optionalChain([res, 'access',
|
|
1146
|
+
const originalFlushHeaders = _optionalChain([res, 'access', _69 => _69.flushHeaders, 'optionalAccess', _70 => _70.bind, 'call', _71 => _71(res)]);
|
|
1090
1147
|
let afterResponseCalled = false;
|
|
1091
1148
|
let interceptedEnd = false;
|
|
1092
1149
|
const htmlChunks = [];
|
|
@@ -1126,7 +1183,7 @@ function interceptFarmDevPageResponse(options) {
|
|
|
1126
1183
|
const shouldBufferResponse = isHtmlResponse ? bufferPluginResponse : Boolean(runtimeSession && hasRuntimeAfterHook);
|
|
1127
1184
|
if (shouldBufferResponse) {
|
|
1128
1185
|
const callback = args.find((arg) => typeof arg === "function");
|
|
1129
|
-
_optionalChain([callback, 'optionalCall',
|
|
1186
|
+
_optionalChain([callback, 'optionalCall', _72 => _72()]);
|
|
1130
1187
|
return true;
|
|
1131
1188
|
}
|
|
1132
1189
|
const writeResult = originalWrite(chunk, ...args);
|
|
@@ -1239,13 +1296,13 @@ function getEnvDefines(config, configEnv) {
|
|
|
1239
1296
|
_chunkHEPJIKKQcjs.getPublicFarmImageConfig.call(void 0, _chunkHEPJIKKQcjs.resolveFarmImageConfig.call(void 0, config.images))
|
|
1240
1297
|
)
|
|
1241
1298
|
};
|
|
1242
|
-
if (_optionalChain([configEnv, 'optionalAccess',
|
|
1299
|
+
if (_optionalChain([configEnv, 'optionalAccess', _73 => _73.isSsrBuild])) {
|
|
1243
1300
|
defines.__FARM_ENV__ = JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, getFullEnvDefine(config)));
|
|
1244
1301
|
}
|
|
1245
1302
|
return defines;
|
|
1246
1303
|
}
|
|
1247
1304
|
function getFarmAPIBaseURLDefine(config) {
|
|
1248
|
-
const baseURL = _optionalChain([config, 'access',
|
|
1305
|
+
const baseURL = _optionalChain([config, 'access', _74 => _74.api, 'optionalAccess', _75 => _75.baseURL]);
|
|
1249
1306
|
return typeof baseURL === "string" && baseURL ? baseURL : _chunkPMJSG4JScjs.DEFAULT_FARM_API_BASE_PATH;
|
|
1250
1307
|
}
|
|
1251
1308
|
function isResolvedEnvScope(value) {
|
|
@@ -1346,9 +1403,9 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
1346
1403
|
transformedExports++;
|
|
1347
1404
|
};
|
|
1348
1405
|
for (const node of body) {
|
|
1349
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
1406
|
+
if (_optionalChain([node, 'optionalAccess', _76 => _76.type]) === "ExportDefaultDeclaration" && node.declaration) {
|
|
1350
1407
|
const declaration2 = node.declaration;
|
|
1351
|
-
if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access',
|
|
1408
|
+
if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access', _77 => _77.id, 'optionalAccess', _78 => _78.name])) {
|
|
1352
1409
|
replacements.push({
|
|
1353
1410
|
start: node.start,
|
|
1354
1411
|
end: node.end,
|
|
@@ -1366,11 +1423,11 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
1366
1423
|
}
|
|
1367
1424
|
continue;
|
|
1368
1425
|
}
|
|
1369
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
1426
|
+
if (_optionalChain([node, 'optionalAccess', _79 => _79.type]) === "ExportNamedDeclaration" && !node.declaration && node.exportKind !== "type") {
|
|
1370
1427
|
const specifiers = (node.specifiers || []).filter(
|
|
1371
1428
|
(specifier) => specifier.type === "ExportSpecifier" && specifier.exportKind !== "type"
|
|
1372
1429
|
);
|
|
1373
|
-
const specifierName = (name) => _nullishCoalesce(_optionalChain([name, 'optionalAccess',
|
|
1430
|
+
const specifierName = (name) => _nullishCoalesce(_optionalChain([name, 'optionalAccess', _80 => _80.name]), () => ( String(_nullishCoalesce(_optionalChain([name, 'optionalAccess', _81 => _81.value]), () => ( "")))));
|
|
1374
1431
|
const isComponentExport = (specifier) => {
|
|
1375
1432
|
const exported = specifierName(specifier.exported);
|
|
1376
1433
|
return exported === "default" || /^[A-Z]/.test(exported);
|
|
@@ -1397,14 +1454,14 @@ function transformIsolatedClientBoundaryModule(options) {
|
|
|
1397
1454
|
if (kept.length > 0) wrapperStatements.push(`export { ${kept.join(", ")} };`);
|
|
1398
1455
|
continue;
|
|
1399
1456
|
}
|
|
1400
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
1457
|
+
if (_optionalChain([node, 'optionalAccess', _82 => _82.type]) !== "ExportNamedDeclaration" || !node.declaration) continue;
|
|
1401
1458
|
const declaration = node.declaration;
|
|
1402
1459
|
const declaredNames = [];
|
|
1403
|
-
if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access',
|
|
1460
|
+
if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access', _83 => _83.id, 'optionalAccess', _84 => _84.name])) {
|
|
1404
1461
|
declaredNames.push(declaration.id.name);
|
|
1405
1462
|
} else if (declaration.type === "VariableDeclaration") {
|
|
1406
1463
|
for (const declarator of declaration.declarations || []) {
|
|
1407
|
-
if (_optionalChain([declarator, 'access',
|
|
1464
|
+
if (_optionalChain([declarator, 'access', _85 => _85.id, 'optionalAccess', _86 => _86.type]) === "Identifier") declaredNames.push(declarator.id.name);
|
|
1408
1465
|
}
|
|
1409
1466
|
}
|
|
1410
1467
|
const componentNames = declaredNames.filter((name) => /^[A-Z]/.test(name));
|
|
@@ -1468,7 +1525,7 @@ function warnClientBoundaryOnce(context, id, code, config) {
|
|
|
1468
1525
|
} catch (e13) {
|
|
1469
1526
|
return;
|
|
1470
1527
|
}
|
|
1471
|
-
const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access',
|
|
1528
|
+
const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access', _87 => _87.env, 'optionalAccess', _88 => _88.public]), () => ( {}))));
|
|
1472
1529
|
const findings = analyzeClientBoundary(program, publicKeys);
|
|
1473
1530
|
if (findings.envKeys.length === 0 && findings.publicEnvKeys.length === 0 && findings.builtinImports.length === 0) {
|
|
1474
1531
|
return;
|
|
@@ -1488,7 +1545,7 @@ function hasViteAlias(alias, find) {
|
|
|
1488
1545
|
}
|
|
1489
1546
|
function farmPlugin(options = {}, initialPluginManager) {
|
|
1490
1547
|
const imageImports = farmImageImportsPlugin();
|
|
1491
|
-
const fontImports =
|
|
1548
|
+
const fontImports = _chunkFAP7CX7Ccjs.farmFontImportsPlugin.call(void 0, {
|
|
1492
1549
|
root: options.root,
|
|
1493
1550
|
basePath: options.basePath,
|
|
1494
1551
|
publicDir: options.publicDir
|
|
@@ -1496,8 +1553,8 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1496
1553
|
let farmApp;
|
|
1497
1554
|
let serverFnTransformActive = false;
|
|
1498
1555
|
const islandsServerFns = () => {
|
|
1499
|
-
const config = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
1500
|
-
return _optionalChain([config, 'access',
|
|
1556
|
+
const config = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _89 => _89.getConfig, 'call', _90 => _90()]), () => ( options));
|
|
1557
|
+
return _optionalChain([config, 'access', _91 => _91.experimental, 'optionalAccess', _92 => _92.serverActions]) === true && _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _93 => _93.experimental, 'optionalAccess', _94 => _94.serverComponents])) === "islands";
|
|
1501
1558
|
};
|
|
1502
1559
|
let reactRefreshActive = false;
|
|
1503
1560
|
let server;
|
|
@@ -1522,14 +1579,14 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1522
1579
|
].join(" ");
|
|
1523
1580
|
console.log(log);
|
|
1524
1581
|
};
|
|
1525
|
-
const getProgrammaticClientRoutes = () => _nullishCoalesce(options.programmaticClientRoutes, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
1582
|
+
const getProgrammaticClientRoutes = () => _nullishCoalesce(options.programmaticClientRoutes, () => ( _optionalChain([farmApp, 'optionalAccess', _95 => _95.getRouteManager, 'call', _96 => _96(), 'access', _97 => _97.getProgrammaticClientRoutes, 'call', _98 => _98()])));
|
|
1526
1583
|
return {
|
|
1527
1584
|
name: "farm",
|
|
1528
1585
|
api: { getProgrammaticClientRoutes },
|
|
1529
1586
|
config(userConfig, configEnv) {
|
|
1530
1587
|
isBuild = configEnv.command === "build";
|
|
1531
1588
|
const layerAliases = _chunk5Y2P454Ocjs.getFarmLayerAliases.call(void 0, options.layers);
|
|
1532
|
-
const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access',
|
|
1589
|
+
const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access', _99 => _99.resolve, 'optionalAccess', _100 => _100.alias]), "@") ? {} : _chunkFAP7CX7Ccjs.createFarmSourceAlias.call(void 0, options.root || process.cwd(), options.srcDir);
|
|
1533
1590
|
const layerRoots = (_nullishCoalesce(options.layers, () => ( []))).map((layer) => layer.root);
|
|
1534
1591
|
return {
|
|
1535
1592
|
// Honor Farm's publicDir so the dev server serves the same static
|
|
@@ -1545,7 +1602,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1545
1602
|
server: {
|
|
1546
1603
|
fs: {
|
|
1547
1604
|
...layerRoots.length ? { allow: [path6.resolve(options.root || process.cwd()), ...layerRoots] } : {},
|
|
1548
|
-
deny: getFarmDevFsDeny(_optionalChain([userConfig, 'access',
|
|
1605
|
+
deny: getFarmDevFsDeny(_optionalChain([userConfig, 'access', _101 => _101.server, 'optionalAccess', _102 => _102.fs, 'optionalAccess', _103 => _103.deny]), options)
|
|
1549
1606
|
}
|
|
1550
1607
|
}
|
|
1551
1608
|
};
|
|
@@ -1558,7 +1615,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1558
1615
|
(plugin) => plugin.name === SERVER_FN_TRANSFORM_PLUGIN
|
|
1559
1616
|
);
|
|
1560
1617
|
reactRefreshActive = _chunk65Y5SIBHcjs.isFarmReactRefreshActive.call(void 0, config);
|
|
1561
|
-
if (_optionalChain([options, 'access',
|
|
1618
|
+
if (_optionalChain([options, 'access', _104 => _104.experimental, 'optionalAccess', _105 => _105.serverActions]) === true && !serverFnTransformActive && !islandsServerFns()) {
|
|
1562
1619
|
_chunkQMNWKQL4cjs.logger.warn(
|
|
1563
1620
|
"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."
|
|
1564
1621
|
);
|
|
@@ -1567,7 +1624,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1567
1624
|
async configureServer(viteServer) {
|
|
1568
1625
|
viteServer.middlewares.use(
|
|
1569
1626
|
createFarmDevPreviewGuard(viteServer, {
|
|
1570
|
-
getSourceRoots: () => _chunk5Y2P454Ocjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
1627
|
+
getSourceRoots: () => _chunk5Y2P454Ocjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _106 => _106.getConfig, 'call', _107 => _107()]), () => ( options)))
|
|
1571
1628
|
})
|
|
1572
1629
|
);
|
|
1573
1630
|
if (typeof fontImports.configureServer === "function") {
|
|
@@ -1582,7 +1639,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1582
1639
|
} catch (e14) {
|
|
1583
1640
|
}
|
|
1584
1641
|
};
|
|
1585
|
-
farmApp = new (0,
|
|
1642
|
+
farmApp = new (0, _chunkFAP7CX7Ccjs.FarmApp)(
|
|
1586
1643
|
{
|
|
1587
1644
|
...options,
|
|
1588
1645
|
root: resolveDevelopmentRoot(options.root, server.config.root)
|
|
@@ -1592,17 +1649,17 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1592
1649
|
await farmApp.initialize();
|
|
1593
1650
|
const farmConfig = farmApp.getConfig();
|
|
1594
1651
|
let farmAppPackages;
|
|
1595
|
-
if (_optionalChain([farmConfig, 'access',
|
|
1652
|
+
if (_optionalChain([farmConfig, 'access', _108 => _108.agent, 'optionalAccess', _109 => _109.noindexPreviews])) {
|
|
1596
1653
|
server.middlewares.use((_req, res, next) => {
|
|
1597
|
-
if (
|
|
1598
|
-
res.setHeader("X-Robots-Tag",
|
|
1654
|
+
if (_chunkS7ZW72JHcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
|
|
1655
|
+
res.setHeader("X-Robots-Tag", _chunkO6L3YYPMcjs.FARM_PREVIEW_ROBOTS_TAG);
|
|
1599
1656
|
}
|
|
1600
1657
|
next();
|
|
1601
1658
|
});
|
|
1602
1659
|
}
|
|
1603
1660
|
const apiServerBasePath = _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, farmConfig.api);
|
|
1604
1661
|
const devBuiltInRoutePaths = new Set(
|
|
1605
|
-
|
|
1662
|
+
_chunkNXFA7G3Ycjs.listFarmBuiltInRoutePaths.call(void 0, {
|
|
1606
1663
|
agent: {
|
|
1607
1664
|
apiCatalog: true,
|
|
1608
1665
|
mcp: true,
|
|
@@ -1624,7 +1681,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1624
1681
|
validateRemoteUrl: createNodeImageUrlValidator(farmConfig.images),
|
|
1625
1682
|
// Vite owns this address. Unlike request.url, it cannot be replaced by
|
|
1626
1683
|
// a caller-controlled Host header.
|
|
1627
|
-
trustedLocalOrigin: () => _optionalChain([server, 'access',
|
|
1684
|
+
trustedLocalOrigin: () => _optionalChain([server, 'access', _110 => _110.resolvedUrls, 'optionalAccess', _111 => _111.local, 'access', _112 => _112[0]]),
|
|
1628
1685
|
onError(error) {
|
|
1629
1686
|
_chunkQMNWKQL4cjs.logger.error(
|
|
1630
1687
|
`Image optimization failed: ${error instanceof Error ? error.message : String(error)}`
|
|
@@ -1644,8 +1701,8 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1644
1701
|
const workflowConfig = farmConfig.workflows;
|
|
1645
1702
|
const farmDocsDevRuntime = farmConfig.docs.enabled ? await loadFarmDocsDevRuntime() : null;
|
|
1646
1703
|
const getExtraRouteTypes = () => [
|
|
1647
|
-
..._optionalChain([options, 'access',
|
|
1648
|
-
..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
1704
|
+
..._optionalChain([options, 'access', _113 => _113.openapi, 'optionalAccess', _114 => _114.enabled]) && options.openapi.route ? [options.openapi.route] : [],
|
|
1705
|
+
..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess', _115 => _115.getFarmDocsRouteTypeEntries, 'call', _116 => _116(farmConfig.docs)]), () => ( []))
|
|
1649
1706
|
];
|
|
1650
1707
|
const appDirSlugs = sourceRoots.map(
|
|
1651
1708
|
(source) => path6.join(source.root, source.srcDir, "app").replace(/\\/g, "/")
|
|
@@ -1692,7 +1749,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1692
1749
|
(source) => path6.join(source.root, source.srcDir).replace(/\\/g, "/")
|
|
1693
1750
|
);
|
|
1694
1751
|
const layerConfigFiles = new Set(
|
|
1695
|
-
farmConfig.layers.map((layer) => _optionalChain([layer, 'access',
|
|
1752
|
+
farmConfig.layers.map((layer) => _optionalChain([layer, 'access', _117 => _117.configFile, 'optionalAccess', _118 => _118.replace, 'call', _119 => _119(/\\/g, "/")])).filter((file) => Boolean(file))
|
|
1696
1753
|
);
|
|
1697
1754
|
const routeModuleExtensions = /* @__PURE__ */ new Set([
|
|
1698
1755
|
..._chunkRD623KW4cjs.resolveFarmComponentExtensions.call(void 0, farmConfig.renderer.componentExtensions),
|
|
@@ -1771,7 +1828,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1771
1828
|
scheduleTypeArtifactGen(file, ev, typeArtifacts);
|
|
1772
1829
|
}
|
|
1773
1830
|
if (isI18nCatalogFile(file)) {
|
|
1774
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
1831
|
+
_optionalChain([farmApp, 'optionalAccess', _120 => _120.getI18nRuntime, 'call', _121 => _121(), 'access', _122 => _122.reload, 'call', _123 => _123(), 'access', _124 => _124.then, 'call', _125 => _125(() => server.ws.send({ type: "full-reload", path: "*" })), 'access', _126 => _126.catch, 'call', _127 => _127((error) => _chunkQMNWKQL4cjs.logger.warn(`i18n catalog reload failed: ${error.message}`))]);
|
|
1775
1832
|
}
|
|
1776
1833
|
const isRouteRefreshEvent = (ev !== "change" || isStaticMetadataImageFile(file)) && (isAppRuntimeFile(file) || isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file)));
|
|
1777
1834
|
if (isRouteRefreshEvent) {
|
|
@@ -1784,8 +1841,8 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1784
1841
|
const reloadsMiddleware = pendingRouteRefreshIncludesMiddleware;
|
|
1785
1842
|
pendingRouteRefreshIncludesMiddleware = false;
|
|
1786
1843
|
Promise.all([
|
|
1787
|
-
_optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
1788
|
-
reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess',
|
|
1844
|
+
_optionalChain([refreshRouteDiscovery, 'optionalCall', _128 => _128(`${ev} ${file}`)]),
|
|
1845
|
+
reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess', _129 => _129.reload, 'call', _130 => _130()]) : void 0
|
|
1789
1846
|
]).then(() => server.ws.send({ type: "full-reload", path: "*" })).catch((error) => _chunkQMNWKQL4cjs.logger.warn(`Route refresh failed: ${error.message}`));
|
|
1790
1847
|
}, 50);
|
|
1791
1848
|
}
|
|
@@ -1824,7 +1881,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1824
1881
|
const { FARM_DEV_SERVER_MODULE_LOADER } = await import("./internal/native-server-fns.cjs");
|
|
1825
1882
|
const load = (file) => _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, file);
|
|
1826
1883
|
globalThis[FARM_DEV_SERVER_MODULE_LOADER] = load;
|
|
1827
|
-
_optionalChain([server, 'access',
|
|
1884
|
+
_optionalChain([server, 'access', _131 => _131.httpServer, 'optionalAccess', _132 => _132.once, 'call', _133 => _133("close", () => {
|
|
1828
1885
|
const globals = globalThis;
|
|
1829
1886
|
if (globals[FARM_DEV_SERVER_MODULE_LOADER] === load) {
|
|
1830
1887
|
delete globals[FARM_DEV_SERVER_MODULE_LOADER];
|
|
@@ -1898,11 +1955,11 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1898
1955
|
});
|
|
1899
1956
|
}
|
|
1900
1957
|
}
|
|
1901
|
-
if (_optionalChain([options, 'access',
|
|
1958
|
+
if (_optionalChain([options, 'access', _134 => _134.openapi, 'optionalAccess', _135 => _135.enabled])) {
|
|
1902
1959
|
const { OpenAPIManager } = await loadFarmOpenAPIDevRuntime();
|
|
1903
1960
|
openAPIManager = new OpenAPIManager(appDirs, options.openapi, {
|
|
1904
1961
|
mode: "development",
|
|
1905
|
-
apiBaseURL: typeof _optionalChain([options, 'access',
|
|
1962
|
+
apiBaseURL: typeof _optionalChain([options, 'access', _136 => _136.api, 'optionalAccess', _137 => _137.baseURL]) === "string" ? options.api.baseURL : void 0
|
|
1906
1963
|
});
|
|
1907
1964
|
const spec = await openAPIManager.generateSpec();
|
|
1908
1965
|
reportOpenAPIDevGenerationResult(spec);
|
|
@@ -1931,7 +1988,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1931
1988
|
return _chunk7EPYN7GWcjs.resolveFarmLayoutFonts.call(void 0, layoutModules);
|
|
1932
1989
|
};
|
|
1933
1990
|
releaseDocsMCPServers();
|
|
1934
|
-
const isFarmDocsPathGuarded = (href) =>
|
|
1991
|
+
const isFarmDocsPathGuarded = (href) => _chunkUJ3R2AH2cjs.farmPathGuardCoversPage.call(void 0,
|
|
1935
1992
|
{
|
|
1936
1993
|
config: farmConfig,
|
|
1937
1994
|
middlewareRoutes: middlewareManager.getMiddlewares().filter((entry) => entry.source !== "config")
|
|
@@ -1944,19 +2001,19 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1944
2001
|
clientEntry: "/@farm/client.js",
|
|
1945
2002
|
resolveLayoutFonts: resolveDocsLayoutFonts,
|
|
1946
2003
|
fontStylesheetHref: "/@farm/fonts.css",
|
|
1947
|
-
globalStylesheetHref:
|
|
2004
|
+
globalStylesheetHref: _chunkFAP7CX7Ccjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
1948
2005
|
farmConfig.root,
|
|
1949
2006
|
farmConfig.srcDir
|
|
1950
2007
|
),
|
|
1951
2008
|
loadModule: async (specifier) => {
|
|
1952
2009
|
const resolved = await server.environments.ssr.pluginContainer.resolveId(specifier);
|
|
1953
|
-
if (specifier === _optionalChain([farmConfig, 'access',
|
|
2010
|
+
if (specifier === _optionalChain([farmConfig, 'access', _138 => _138.docs, 'access', _139 => _139.adapter, 'optionalAccess', _140 => _140.server]) && _optionalChain([resolved, 'optionalAccess', _141 => _141.id])) {
|
|
1954
2011
|
return import(
|
|
1955
2012
|
/* @vite-ignore */
|
|
1956
2013
|
_url.pathToFileURL.call(void 0, resolved.id).href
|
|
1957
2014
|
);
|
|
1958
2015
|
}
|
|
1959
|
-
return _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess',
|
|
2016
|
+
return _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess', _142 => _142.id]), () => ( specifier)));
|
|
1960
2017
|
},
|
|
1961
2018
|
registerMCPServer: (mcpServer) => {
|
|
1962
2019
|
const dispose = _chunkLRB5OVRTcjs.registerFarmMCPServer.call(void 0, mcpServer);
|
|
@@ -1974,21 +2031,21 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1974
2031
|
fontAssets: _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, farmDocsFontAssetList),
|
|
1975
2032
|
resolveLayoutFonts: resolveDocsLayoutFonts,
|
|
1976
2033
|
fontStylesheetHref: "/@farm/fonts.css",
|
|
1977
|
-
globalStylesheetHref:
|
|
2034
|
+
globalStylesheetHref: _chunkFAP7CX7Ccjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
1978
2035
|
farmConfig.root,
|
|
1979
2036
|
farmConfig.srcDir
|
|
1980
2037
|
),
|
|
1981
2038
|
isPathGuarded: isFarmDocsPathGuarded
|
|
1982
2039
|
}) : null;
|
|
1983
2040
|
const wrapFarmDocsResponseWithLayouts = async (request, response) => {
|
|
1984
|
-
if (request.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access',
|
|
2041
|
+
if (request.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _143 => _143.headers, 'access', _144 => _144.get, 'call', _145 => _145("content-type"), 'optionalAccess', _146 => _146.toLowerCase, 'call', _147 => _147(), 'access', _148 => _148.includes, 'call', _149 => _149("text/html")])) {
|
|
1985
2042
|
return response;
|
|
1986
2043
|
}
|
|
1987
2044
|
const pathname = new URL(request.url).pathname;
|
|
1988
2045
|
const matchedRoute = routeManager.matchRoute(pathname);
|
|
1989
2046
|
const layoutEntries = matchedRoute.layouts.map((layout) => ({
|
|
1990
2047
|
...layout,
|
|
1991
|
-
metadata:
|
|
2048
|
+
metadata: _chunkFAP7CX7Ccjs.getClientModuleMetadata.call(void 0, layout.modulePath, farmConfig.root)
|
|
1992
2049
|
}));
|
|
1993
2050
|
if (!layoutEntries.some((layout) => layout.metadata.shouldHydrate)) {
|
|
1994
2051
|
return response;
|
|
@@ -2002,7 +2059,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
2002
2059
|
headers: response.headers
|
|
2003
2060
|
});
|
|
2004
2061
|
}
|
|
2005
|
-
const docsRenderer = _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
2062
|
+
const docsRenderer = _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _150 => _150.getConfig, 'call', _151 => _151()]), () => ( options))).renderer);
|
|
2006
2063
|
const [rendererRuntime, layoutModules] = await Promise.all([
|
|
2007
2064
|
_chunkRD623KW4cjs.isReactRenderer.call(void 0, docsRenderer) ? import("./renderer/react/server.cjs") : _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, docsRenderer.server),
|
|
2008
2065
|
Promise.all(
|
|
@@ -2031,7 +2088,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
2031
2088
|
])
|
|
2032
2089
|
);
|
|
2033
2090
|
const inlineValue = (value) => JSON.stringify(value).replace(/</g, "\\u003c").replace(/>/g, "\\u003e");
|
|
2034
|
-
const pageModulePath = _optionalChain([matchedRoute, 'access',
|
|
2091
|
+
const pageModulePath = _optionalChain([matchedRoute, 'access', _152 => _152.route, 'optionalAccess', _153 => _153.modulePath]) ? toUrlPath(matchedRoute.route.modulePath) : "";
|
|
2035
2092
|
const bootstrapScript = `<script>
|
|
2036
2093
|
window.__FARM_PROPS__ = ${inlineValue({ params })};
|
|
2037
2094
|
window.__FARM_ROUTE_SLOTS__ = [];
|
|
@@ -2127,7 +2184,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2127
2184
|
}
|
|
2128
2185
|
},
|
|
2129
2186
|
(request) => {
|
|
2130
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
2187
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _154 => _154.getConfig, 'call', _155 => _155()]), () => ( options));
|
|
2131
2188
|
const currentServerConfig = _chunkCFG4QERRcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
|
|
2132
2189
|
return _chunkHNAISJFDcjs.resolveFarmRequestURL.call(void 0, request, {
|
|
2133
2190
|
trustProxy: currentServerConfig.trustProxy
|
|
@@ -2138,7 +2195,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2138
2195
|
withAPIRequestTracing(async (req, res, next) => {
|
|
2139
2196
|
const requestUrl = req.url || "/";
|
|
2140
2197
|
const requestMethod = req.method || "GET";
|
|
2141
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
2198
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _156 => _156.getConfig, 'call', _157 => _157()]), () => ( options));
|
|
2142
2199
|
const currentServerConfig = _chunkCFG4QERRcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
|
|
2143
2200
|
const parsedRequestUrl = _chunkHNAISJFDcjs.resolveFarmRequestURL.call(void 0, req, {
|
|
2144
2201
|
trustProxy: currentServerConfig.trustProxy
|
|
@@ -2206,7 +2263,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2206
2263
|
openapi: options.openapi
|
|
2207
2264
|
},
|
|
2208
2265
|
workflows: discoveredWorkflows,
|
|
2209
|
-
plugins: _optionalChain([pm, 'optionalAccess',
|
|
2266
|
+
plugins: _optionalChain([pm, 'optionalAccess', _158 => _158.getSortedPlugins, 'call', _159 => _159()])
|
|
2210
2267
|
});
|
|
2211
2268
|
res.statusCode = 200;
|
|
2212
2269
|
res.setHeader(
|
|
@@ -2229,7 +2286,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2229
2286
|
return;
|
|
2230
2287
|
}
|
|
2231
2288
|
const runAppMiddlewareForContentRoute = async () => {
|
|
2232
|
-
if (!_optionalChain([middlewareManager, 'optionalAccess',
|
|
2289
|
+
if (!_optionalChain([middlewareManager, 'optionalAccess', _160 => _160.hasMiddleware, 'call', _161 => _161()])) return false;
|
|
2233
2290
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
2234
2291
|
return runFarmMiddlewareWithNavigation(
|
|
2235
2292
|
farmApp.getServerRenderer(),
|
|
@@ -2245,16 +2302,16 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2245
2302
|
label
|
|
2246
2303
|
} = {}) => {
|
|
2247
2304
|
const discard = async () => {
|
|
2248
|
-
await _optionalChain([computed, 'optionalAccess',
|
|
2305
|
+
await _optionalChain([computed, 'optionalAccess', _162 => _162.body, 'optionalAccess', _163 => _163.cancel, 'call', _164 => _164(), 'access', _165 => _165.catch, 'call', _166 => _166(() => {
|
|
2249
2306
|
})]);
|
|
2250
2307
|
};
|
|
2251
2308
|
let runtimeSession2;
|
|
2252
|
-
if (_optionalChain([pm, 'optionalAccess',
|
|
2309
|
+
if (_optionalChain([pm, 'optionalAccess', _167 => _167.hasRuntimeRequestHooks, 'call', _168 => _168()])) {
|
|
2253
2310
|
try {
|
|
2254
2311
|
const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath);
|
|
2255
|
-
const route =
|
|
2312
|
+
const route = _chunkNXFA7G3Ycjs.setFarmRouteLabel.call(void 0,
|
|
2256
2313
|
{ pathname: requestPathname },
|
|
2257
|
-
label !== void 0 ? label : devBuiltInRoutePaths.has(routePathname) ? routePathname :
|
|
2314
|
+
label !== void 0 ? label : devBuiltInRoutePaths.has(routePathname) ? routePathname : _chunkNXFA7G3Ycjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath)
|
|
2258
2315
|
);
|
|
2259
2316
|
runtimeSession2 = await pm.beginRuntimeRequest(
|
|
2260
2317
|
createRequestFromNodeRequest(req, new URL(fullUrl)),
|
|
@@ -2286,7 +2343,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2286
2343
|
let response;
|
|
2287
2344
|
try {
|
|
2288
2345
|
response = await respond(
|
|
2289
|
-
_nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess',
|
|
2346
|
+
_nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess', _169 => _169.request]), () => ( createRequestFromNodeRequest(req, new URL(fullUrl))))
|
|
2290
2347
|
);
|
|
2291
2348
|
} catch (error) {
|
|
2292
2349
|
if (runtimeSession2) await pm.failRuntimeRequest(runtimeSession2, error);
|
|
@@ -2299,7 +2356,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2299
2356
|
);
|
|
2300
2357
|
};
|
|
2301
2358
|
const openAPIRequestPathname = openAPIManager ? _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) : requestPathname;
|
|
2302
|
-
if (openAPIManager && _optionalChain([options, 'access',
|
|
2359
|
+
if (openAPIManager && _optionalChain([options, 'access', _170 => _170.openapi, 'optionalAccess', _171 => _171.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
|
|
2303
2360
|
const specManager = openAPIManager;
|
|
2304
2361
|
await serveBuiltInRoute(async () => {
|
|
2305
2362
|
if (requestMethod !== "GET" && requestMethod !== "HEAD") {
|
|
@@ -2319,7 +2376,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2319
2376
|
});
|
|
2320
2377
|
return;
|
|
2321
2378
|
}
|
|
2322
|
-
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access',
|
|
2379
|
+
if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _172 => _172.openapi, 'optionalAccess', _173 => _173.route])) {
|
|
2323
2380
|
const docsManager = openAPIManager;
|
|
2324
2381
|
await serveBuiltInRoute(
|
|
2325
2382
|
async () => {
|
|
@@ -2330,24 +2387,24 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2330
2387
|
);
|
|
2331
2388
|
return;
|
|
2332
2389
|
}
|
|
2333
|
-
if (_optionalChain([options, 'access',
|
|
2390
|
+
if (_optionalChain([options, 'access', _174 => _174.agent, 'optionalAccess', _175 => _175.manifest]) !== false && _chunkNXFA7G3Ycjs.isFarmAppManifestPath.call(void 0, _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath))) {
|
|
2334
2391
|
await serveBuiltInRoute(async () => {
|
|
2335
|
-
_nullishCoalesce(farmAppPackages, () => ( (farmAppPackages =
|
|
2336
|
-
const manifest = await
|
|
2392
|
+
_nullishCoalesce(farmAppPackages, () => ( (farmAppPackages = _chunkFAP7CX7Ccjs.resolveFarmAppPackages.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd()))))));
|
|
2393
|
+
const manifest = await _chunkNXFA7G3Ycjs.createFarmAppManifestResponse.call(void 0,
|
|
2337
2394
|
new Request(parsedRequestUrl, {
|
|
2338
2395
|
method: requestMethod,
|
|
2339
2396
|
headers: { "if-none-match": String(_nullishCoalesce(req.headers["if-none-match"], () => ( ""))) }
|
|
2340
2397
|
}),
|
|
2341
2398
|
{
|
|
2342
|
-
...
|
|
2399
|
+
..._chunkNXFA7G3Ycjs.resolveFarmAppManifestInput.call(void 0, farmConfig, {
|
|
2343
2400
|
build: "development",
|
|
2344
2401
|
packages: farmAppPackages,
|
|
2345
2402
|
// Read again on each request; unchanged files come from a cache.
|
|
2346
|
-
webmcpTools: _optionalChain([farmConfig, 'access',
|
|
2403
|
+
webmcpTools: _optionalChain([farmConfig, 'access', _176 => _176.plugins, 'optionalAccess', _177 => _177.some, 'call', _178 => _178(({ name }) => name === "farm:webmcp")]) ? _chunkFAP7CX7Ccjs.collectFarmWebMCPTools.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd())), farmConfig.srcDir) : []
|
|
2347
2404
|
}),
|
|
2348
2405
|
defaultMCP: () => farmApp.getServerRenderer().getDefaultMCPServer(),
|
|
2349
2406
|
// A guard written for an MCP server's path keeps its tools out of the public view.
|
|
2350
|
-
guardCoversPath: (path7) =>
|
|
2407
|
+
guardCoversPath: (path7) => _chunkUJ3R2AH2cjs.farmPathGuardCoversEndpoint.call(void 0,
|
|
2351
2408
|
{
|
|
2352
2409
|
config: farmConfig,
|
|
2353
2410
|
middlewareRoutes: middlewareManager.getMiddlewares().filter((entry) => entry.source !== "config")
|
|
@@ -2361,11 +2418,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2361
2418
|
});
|
|
2362
2419
|
return;
|
|
2363
2420
|
}
|
|
2364
|
-
if (_optionalChain([options, 'access',
|
|
2421
|
+
if (_optionalChain([options, 'access', _179 => _179.agent, 'optionalAccess', _180 => _180.apiCatalog]) && _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunkNXFA7G3Ycjs.FARM_API_CATALOG_PATH) {
|
|
2365
2422
|
await serveBuiltInRoute(
|
|
2366
|
-
() =>
|
|
2423
|
+
() => _chunkNXFA7G3Ycjs.createFarmApiCatalogResponse.call(void 0,
|
|
2367
2424
|
requestMethod,
|
|
2368
|
-
|
|
2425
|
+
_chunkNXFA7G3Ycjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
|
|
2369
2426
|
new Request(parsedRequestUrl, {
|
|
2370
2427
|
headers: { "user-agent": String(_nullishCoalesce(req.headers["user-agent"], () => ( ""))) }
|
|
2371
2428
|
})
|
|
@@ -2373,8 +2430,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2373
2430
|
);
|
|
2374
2431
|
return;
|
|
2375
2432
|
}
|
|
2376
|
-
if (_optionalChain([options, 'access',
|
|
2377
|
-
const aiCatalog =
|
|
2433
|
+
if (_optionalChain([options, 'access', _181 => _181.agent, 'optionalAccess', _182 => _182.aiCatalog]) !== false) {
|
|
2434
|
+
const aiCatalog = _chunkNXFA7G3Ycjs.createFarmAiCatalogResponse.call(void 0,
|
|
2378
2435
|
new Request(parsedRequestUrl, {
|
|
2379
2436
|
method: requestMethod,
|
|
2380
2437
|
headers: {
|
|
@@ -2418,11 +2475,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2418
2475
|
{
|
|
2419
2476
|
kind: "docs",
|
|
2420
2477
|
computed: docsResponse,
|
|
2421
|
-
label:
|
|
2478
|
+
label: _chunkNXFA7G3Ycjs.resolveFarmDocsEngineRouteLabel.call(void 0,
|
|
2422
2479
|
_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath),
|
|
2423
2480
|
{
|
|
2424
|
-
path: _optionalChain([farmConfig, 'access',
|
|
2425
|
-
roots: _optionalChain([farmConfig, 'access',
|
|
2481
|
+
path: _optionalChain([farmConfig, 'access', _183 => _183.docs, 'optionalAccess', _184 => _184.entry]) || "/docs",
|
|
2482
|
+
roots: _optionalChain([farmConfig, 'access', _185 => _185.docs, 'optionalAccess', _186 => _186.roots, 'optionalAccess', _187 => _187.map, 'call', _188 => _188((root) => root.entry)])
|
|
2426
2483
|
}
|
|
2427
2484
|
)
|
|
2428
2485
|
}
|
|
@@ -2430,10 +2487,15 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2430
2487
|
return;
|
|
2431
2488
|
}
|
|
2432
2489
|
}
|
|
2433
|
-
if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD") && _optionalChain([req, 'access',
|
|
2434
|
-
const { createFarmNativeTreeResponse } = await import("./native-tree-
|
|
2490
|
+
if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD" || requestMethod === "POST") && _optionalChain([req, 'access', _189 => _189.headers, 'access', _190 => _190.accept, 'optionalAccess', _191 => _191.includes, 'call', _192 => _192(_chunk3HLQTOVUcjs.FARM_NATIVE_TREE_CONTENT_TYPE)])) {
|
|
2491
|
+
const { createFarmNativeTreeResponse } = await import("./native-tree-WOX3JMBG.cjs");
|
|
2492
|
+
const treeBodyInit = requestMethod === "POST" ? { body: _chunkCFG4QERRcjs.createFarmNodeRequestBodyStream.call(void 0, req), duplex: "half" } : {};
|
|
2435
2493
|
const treeResponse = await createFarmNativeTreeResponse({
|
|
2436
|
-
request: new Request(fullUrl, {
|
|
2494
|
+
request: new Request(fullUrl, {
|
|
2495
|
+
method: requestMethod,
|
|
2496
|
+
headers: docsHeaders,
|
|
2497
|
+
...treeBodyInit
|
|
2498
|
+
}),
|
|
2437
2499
|
// As for the Markdown mirror: this server's own listener, redirects not followed.
|
|
2438
2500
|
renderPage: (request) => _chunkBNH53KOTcjs.createFarmDevServerDispatch.call(void 0, server)(
|
|
2439
2501
|
new Request(request, {
|
|
@@ -2443,15 +2505,15 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2443
2505
|
});
|
|
2444
2506
|
await serveBuiltInRoute(() => treeResponse, {
|
|
2445
2507
|
computed: treeResponse,
|
|
2446
|
-
label: _nullishCoalesce(_optionalChain([farmApp, 'access',
|
|
2508
|
+
label: _nullishCoalesce(_optionalChain([farmApp, 'access', _193 => _193.getRouteManager, 'call', _194 => _194(), 'access', _195 => _195.matchRoute, 'call', _196 => _196(_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath)), 'access', _197 => _197.route, 'optionalAccess', _198 => _198.pattern]), () => ( null))
|
|
2447
2509
|
});
|
|
2448
2510
|
return;
|
|
2449
2511
|
}
|
|
2450
|
-
const markdownRouteLabel = () =>
|
|
2512
|
+
const markdownRouteLabel = () => _chunkNXFA7G3Ycjs.resolveFarmMarkdownRouteLabel.call(void 0,
|
|
2451
2513
|
_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath),
|
|
2452
|
-
(page) => _optionalChain([farmApp, 'access',
|
|
2514
|
+
(page) => _optionalChain([farmApp, 'access', _199 => _199.getRouteManager, 'call', _200 => _200(), 'access', _201 => _201.matchRoute, 'call', _202 => _202(page), 'access', _203 => _203.route, 'optionalAccess', _204 => _204.pattern])
|
|
2453
2515
|
);
|
|
2454
|
-
const markdownSourceResponse = viteModuleRequest ? null : await
|
|
2516
|
+
const markdownSourceResponse = viteModuleRequest ? null : await _chunk7XGWBPQQcjs.createFarmMarkdownSourceResponse.call(void 0, {
|
|
2455
2517
|
request: new Request(fullUrl, {
|
|
2456
2518
|
method: requestMethod,
|
|
2457
2519
|
headers: docsHeaders
|
|
@@ -2459,7 +2521,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2459
2521
|
config: farmApp.getConfig().mdx,
|
|
2460
2522
|
resolveSource: async (pathname2) => {
|
|
2461
2523
|
const match = farmApp.getRouteManager().matchRoute(pathname2);
|
|
2462
|
-
const sourcePath = _optionalChain([match, 'access',
|
|
2524
|
+
const sourcePath = _optionalChain([match, 'access', _205 => _205.route, 'optionalAccess', _206 => _206.markdownSourcePath]) || (match.route && _chunk7XGWBPQQcjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
|
|
2463
2525
|
if (!sourcePath) {
|
|
2464
2526
|
return null;
|
|
2465
2527
|
}
|
|
@@ -2484,7 +2546,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2484
2546
|
});
|
|
2485
2547
|
return;
|
|
2486
2548
|
}
|
|
2487
|
-
const markdownResponse = viteModuleRequest ? null : await
|
|
2549
|
+
const markdownResponse = viteModuleRequest ? null : await _chunk2C5L5RPMcjs.createMarkdownMirrorResponse.call(void 0, {
|
|
2488
2550
|
request: new Request(fullUrl, {
|
|
2489
2551
|
method: requestMethod,
|
|
2490
2552
|
headers: docsHeaders
|
|
@@ -2515,16 +2577,16 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2515
2577
|
});
|
|
2516
2578
|
return;
|
|
2517
2579
|
}
|
|
2518
|
-
if (!viteModuleRequest &&
|
|
2519
|
-
const markdownRoute = farmApp.getRouteManager().matchRoute(
|
|
2580
|
+
if (!viteModuleRequest && _chunk2C5L5RPMcjs.farmRequestWantsMarkdown.call(void 0, requestPathname, req.headers.accept)) {
|
|
2581
|
+
const markdownRoute = farmApp.getRouteManager().matchRoute(_chunk7XGWBPQQcjs.normalizeFarmMarkdownRoutePath.call(void 0, requestPathname));
|
|
2520
2582
|
if (!markdownRoute.route) {
|
|
2521
2583
|
await serveBuiltInRoute(
|
|
2522
2584
|
() => new Response(
|
|
2523
|
-
|
|
2585
|
+
_chunk2C5L5RPMcjs.createFarmMarkdownErrorBody.call(void 0, 404, requestPathname, farmConfig.basePath || "/"),
|
|
2524
2586
|
{
|
|
2525
2587
|
status: 404,
|
|
2526
2588
|
headers: {
|
|
2527
|
-
"Content-Type":
|
|
2589
|
+
"Content-Type": _chunk2C5L5RPMcjs.FARM_MARKDOWN_CONTENT_TYPE,
|
|
2528
2590
|
"X-Farm-Markdown-Error": "404",
|
|
2529
2591
|
"Cache-Control": "no-store"
|
|
2530
2592
|
}
|
|
@@ -2534,7 +2596,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2534
2596
|
return;
|
|
2535
2597
|
}
|
|
2536
2598
|
}
|
|
2537
|
-
const markdownPageTarget =
|
|
2599
|
+
const markdownPageTarget = _chunk2C5L5RPMcjs.resolveMarkdownMirrorTarget.call(void 0,
|
|
2538
2600
|
farmApp.getConfig().md,
|
|
2539
2601
|
requestPathname,
|
|
2540
2602
|
{
|
|
@@ -2547,7 +2609,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2547
2609
|
if (!varyValues.some((value) => value.toLowerCase() === "accept")) {
|
|
2548
2610
|
res.setHeader("Vary", [...varyValues, "Accept"].join(", "));
|
|
2549
2611
|
}
|
|
2550
|
-
const alternatePath =
|
|
2612
|
+
const alternatePath = _chunk2C5L5RPMcjs.getFarmMarkdownMirrorPath.call(void 0, markdownPageTarget.pathname);
|
|
2551
2613
|
const alternateLink = `<${alternatePath}>; rel="alternate"; type="text/markdown"`;
|
|
2552
2614
|
const currentLink = res.getHeader("Link");
|
|
2553
2615
|
res.setHeader(
|
|
@@ -2599,7 +2661,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2599
2661
|
"beforeRequest",
|
|
2600
2662
|
(plugin) => {
|
|
2601
2663
|
const owner = _chunkI32V5CZLcjs.getFarmIntegrationPluginOwner.call(void 0, plugin);
|
|
2602
|
-
return plugin.name !== _chunkUYTAP4FQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess',
|
|
2664
|
+
return plugin.name !== _chunkUYTAP4FQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess', _207 => _207.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
|
|
2603
2665
|
},
|
|
2604
2666
|
req,
|
|
2605
2667
|
res
|
|
@@ -2635,7 +2697,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2635
2697
|
isProd: false
|
|
2636
2698
|
},
|
|
2637
2699
|
request,
|
|
2638
|
-
{ clientAddress: _optionalChain([req, 'access',
|
|
2700
|
+
{ clientAddress: _optionalChain([req, 'access', _208 => _208.socket, 'optionalAccess', _209 => _209.remoteAddress]) }
|
|
2639
2701
|
);
|
|
2640
2702
|
if (!result) {
|
|
2641
2703
|
throw new Error(`Matched integration route did not return a response`);
|
|
@@ -2699,7 +2761,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2699
2761
|
trustProxy: currentServerConfig.trustProxy
|
|
2700
2762
|
}).pathname;
|
|
2701
2763
|
const servesLocalApiRoute = hasMatchedApiRoute || Boolean(
|
|
2702
|
-
farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
2764
|
+
farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _210 => _210.isFarmDocsAPIRequest, 'call', _211 => _211(requestPathname)])
|
|
2703
2765
|
);
|
|
2704
2766
|
try {
|
|
2705
2767
|
if (pm) {
|
|
@@ -2743,7 +2805,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2743
2805
|
const routedApiRoute = rewritten ? apiRouteManager.matchRoute(routedPathname) : matchedApiRoute || apiRouteManager.matchRoute(pathname2);
|
|
2744
2806
|
const hasExplicitAPIRoute = Boolean(routedApiRoute);
|
|
2745
2807
|
if (apiHandler && hasExplicitAPIRoute) {
|
|
2746
|
-
const apiRoutePattern = _optionalChain([routedApiRoute, 'optionalAccess',
|
|
2808
|
+
const apiRoutePattern = _optionalChain([routedApiRoute, 'optionalAccess', _212 => _212.route, 'access', _213 => _213.path]) || urlPath2;
|
|
2747
2809
|
_chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
|
|
2748
2810
|
type: "route.matched",
|
|
2749
2811
|
pathname: pathname2,
|
|
@@ -2833,7 +2895,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2833
2895
|
return;
|
|
2834
2896
|
}
|
|
2835
2897
|
}
|
|
2836
|
-
if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
2898
|
+
if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _214 => _214.isFarmDocsAPIRequest, 'call', _215 => _215(pathname2)])) {
|
|
2837
2899
|
try {
|
|
2838
2900
|
const url = `http://${req.headers.host || "localhost:3000"}${req.url}`;
|
|
2839
2901
|
const headers = new Headers();
|
|
@@ -2871,11 +2933,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2871
2933
|
};
|
|
2872
2934
|
const docsResponse = pm ? await pm.runRuntimeRequest(request, invokeDocsAPIHandler, {
|
|
2873
2935
|
kind: "docs",
|
|
2874
|
-
route:
|
|
2936
|
+
route: _chunkNXFA7G3Ycjs.setFarmRouteLabel.call(void 0,
|
|
2875
2937
|
{ pathname: pathname2, pattern: apiLifecyclePayload.routePath },
|
|
2876
|
-
|
|
2877
|
-
path: _optionalChain([farmConfig, 'access',
|
|
2878
|
-
roots: _optionalChain([farmConfig, 'access',
|
|
2938
|
+
_chunkNXFA7G3Ycjs.resolveFarmDocsRouteLabel.call(void 0, pathname2, {
|
|
2939
|
+
path: _optionalChain([farmConfig, 'access', _216 => _216.docs, 'optionalAccess', _217 => _217.entry]) || "/docs",
|
|
2940
|
+
roots: _optionalChain([farmConfig, 'access', _218 => _218.docs, 'optionalAccess', _219 => _219.roots, 'optionalAccess', _220 => _220.map, 'call', _221 => _221((root) => root.entry)])
|
|
2879
2941
|
})
|
|
2880
2942
|
)
|
|
2881
2943
|
}) : await invokeDocsAPIHandler(request);
|
|
@@ -2909,18 +2971,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2909
2971
|
res.end(JSON.stringify({ error: "API route not found", pathname: pathname2 }));
|
|
2910
2972
|
return;
|
|
2911
2973
|
}
|
|
2912
|
-
if (_optionalChain([req, 'access',
|
|
2974
|
+
if (_optionalChain([req, 'access', _222 => _222.url, 'optionalAccess', _223 => _223.startsWith, 'call', _224 => _224("/@")]) || _optionalChain([req, 'access', _225 => _225.url, 'optionalAccess', _226 => _226.startsWith, 'call', _227 => _227("/node_modules")])) {
|
|
2913
2975
|
return next();
|
|
2914
2976
|
}
|
|
2915
2977
|
if (shouldBypassFarmRouterForDottedPath(
|
|
2916
2978
|
requestPathname,
|
|
2917
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
2979
|
+
_optionalChain([farmApp, 'optionalAccess', _228 => _228.getRouteManager, 'call', _229 => _229()]),
|
|
2918
2980
|
[server.config.publicDir, server.config.root],
|
|
2919
2981
|
farmAgentGeneratedPaths(farmConfig)
|
|
2920
2982
|
)) {
|
|
2921
2983
|
return next();
|
|
2922
2984
|
}
|
|
2923
|
-
if (_optionalChain([req, 'access',
|
|
2985
|
+
if (_optionalChain([req, 'access', _230 => _230.url, 'optionalAccess', _231 => _231.startsWith, 'call', _232 => _232("/__farm/page-data")])) {
|
|
2924
2986
|
const urlObj = parsedRequestUrl;
|
|
2925
2987
|
const targetPath = urlObj.searchParams.get("path") || "/";
|
|
2926
2988
|
try {
|
|
@@ -2948,7 +3010,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2948
3010
|
});
|
|
2949
3011
|
let middlewareMap = /* @__PURE__ */ new Map();
|
|
2950
3012
|
let middlewareContext = /* @__PURE__ */ new Map();
|
|
2951
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
3013
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _233 => _233.hasMiddleware, 'call', _234 => _234()])) {
|
|
2952
3014
|
const targetNodeRequest = createPageDataMiddlewareRequest(req, targetRequestUrl);
|
|
2953
3015
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
2954
3016
|
farmApp.getServerRenderer(),
|
|
@@ -2976,10 +3038,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2976
3038
|
if (pm) {
|
|
2977
3039
|
await pm.runHookParallel("afterRouteMatch", {
|
|
2978
3040
|
pathname: targetPath,
|
|
2979
|
-
matched: !!_optionalChain([match, 'optionalAccess',
|
|
2980
|
-
routePattern: _optionalChain([match, 'optionalAccess',
|
|
2981
|
-
params: _optionalChain([match, 'optionalAccess',
|
|
2982
|
-
layoutPatterns: (_optionalChain([match, 'optionalAccess',
|
|
3041
|
+
matched: !!_optionalChain([match, 'optionalAccess', _235 => _235.route]),
|
|
3042
|
+
routePattern: _optionalChain([match, 'optionalAccess', _236 => _236.route, 'optionalAccess', _237 => _237.pattern]) || null,
|
|
3043
|
+
params: _optionalChain([match, 'optionalAccess', _238 => _238.params]) || {},
|
|
3044
|
+
layoutPatterns: (_optionalChain([match, 'optionalAccess', _239 => _239.layouts]) || []).map((l) => l.pattern)
|
|
2983
3045
|
});
|
|
2984
3046
|
}
|
|
2985
3047
|
if (!match) {
|
|
@@ -3002,7 +3064,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3002
3064
|
);
|
|
3003
3065
|
const loadingModule = loadingBoundary ? await routeManager3.loadRouteModule(loadingBoundary.modulePath) : null;
|
|
3004
3066
|
const navigationManifest = routeManager3.generateClientManifest(server.config.root);
|
|
3005
|
-
const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => (
|
|
3067
|
+
const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => ( _chunkFAP7CX7Ccjs.getClientModuleMetadata.call(void 0, route.modulePath, server.config.root)));
|
|
3006
3068
|
const isClientComponent = moduleMetadata.isClientComponent;
|
|
3007
3069
|
const shouldHydrate = moduleMetadata.shouldHydrate;
|
|
3008
3070
|
let mergedMetadata = {};
|
|
@@ -3010,7 +3072,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3010
3072
|
layouts.map((layout) => routeManager3.loadLayoutModule(layout.modulePath))
|
|
3011
3073
|
);
|
|
3012
3074
|
const layoutHydrationMetadata = layouts.map(
|
|
3013
|
-
(layout) => _nullishCoalesce(navigationManifest.layouts.find((entry) => entry.pattern === layout.pattern), () => (
|
|
3075
|
+
(layout) => _nullishCoalesce(navigationManifest.layouts.find((entry) => entry.pattern === layout.pattern), () => ( _chunkFAP7CX7Ccjs.getClientModuleMetadata.call(void 0, layout.modulePath, server.config.root)))
|
|
3014
3076
|
);
|
|
3015
3077
|
const shouldHydrateLayout = layoutHydrationMetadata.some(
|
|
3016
3078
|
(metadata) => metadata.shouldHydrate
|
|
@@ -3022,17 +3084,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3022
3084
|
)
|
|
3023
3085
|
];
|
|
3024
3086
|
const hydrationIslandStrategy = _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0,
|
|
3025
|
-
_optionalChain([(_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3026
|
-
) === "islands" ?
|
|
3087
|
+
_optionalChain([(_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _240 => _240.getConfig, 'call', _241 => _241()]), () => ( options))), 'access', _242 => _242.experimental, 'optionalAccess', _243 => _243.serverComponents])
|
|
3088
|
+
) === "islands" ? _chunkFAP7CX7Ccjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
3027
3089
|
route,
|
|
3028
3090
|
{ shouldHydrate, islandStrategy: _nullishCoalesce(moduleMetadata.islandStrategy, () => ( null)) },
|
|
3029
3091
|
layouts.map((layout, index) => ({
|
|
3030
3092
|
pattern: layout.pattern,
|
|
3031
3093
|
modulePath: layout.modulePath,
|
|
3032
|
-
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access',
|
|
3094
|
+
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _244 => _244[index], 'optionalAccess', _245 => _245.shouldHydrate]) === true,
|
|
3033
3095
|
// Manifest entries carry it; metadata read from source does not.
|
|
3034
|
-
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access',
|
|
3035
|
-
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access',
|
|
3096
|
+
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access', _246 => _246[index], 'optionalAccess', _247 => _247.hasIsolatedClientBoundaries]) === true,
|
|
3097
|
+
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _248 => _248[index], 'optionalAccess', _249 => _249.islandStrategy]), () => ( null))
|
|
3036
3098
|
})),
|
|
3037
3099
|
server.config.root,
|
|
3038
3100
|
true
|
|
@@ -3080,14 +3142,14 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3080
3142
|
mergedMetadata = await _chunk6IOZPJ3Icjs.mergeModuleViewport.call(void 0, mergedMetadata, routeModule, routeProps);
|
|
3081
3143
|
mergedMetadata = _chunk6IOZPJ3Icjs.addMetadataMarkdownAlternate.call(void 0,
|
|
3082
3144
|
mergedMetadata,
|
|
3083
|
-
|
|
3145
|
+
_chunk2C5L5RPMcjs.getFarmMarkdownAlternatePath.call(void 0, farmApp.getConfig().md, targetRequestUrl.pathname)
|
|
3084
3146
|
);
|
|
3085
3147
|
const routeSlots = await Promise.all(
|
|
3086
3148
|
slots.map(async (slot) => {
|
|
3087
3149
|
const slotModule = await routeManager3.loadRouteModule(slot.route.modulePath);
|
|
3088
3150
|
const slotMetadata = _nullishCoalesce(navigationManifest.slots.find(
|
|
3089
3151
|
(entry) => entry.name === slot.name && entry.ownerPattern === slot.ownerPattern && entry.pattern === slot.route.pattern
|
|
3090
|
-
), () => (
|
|
3152
|
+
), () => ( _chunkFAP7CX7Ccjs.getClientModuleMetadata.call(void 0, slot.route.modulePath, server.config.root)));
|
|
3091
3153
|
const slotContext = await _chunkX333W5KVcjs.resolveFarmRouteContext.call(void 0, farmApp.getConfig(), {
|
|
3092
3154
|
request: targetRequest,
|
|
3093
3155
|
params: slot.params,
|
|
@@ -3133,15 +3195,15 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3133
3195
|
);
|
|
3134
3196
|
const projectRoot = server.config.root;
|
|
3135
3197
|
const toUrlPath = (absolutePath) => _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, absolutePath, projectRoot);
|
|
3136
|
-
const renderPlan =
|
|
3198
|
+
const renderPlan = _chunkUJ3R2AH2cjs.createFarmRouteRenderPlan.call(void 0, {
|
|
3137
3199
|
pageShouldHydrate: shouldHydrate,
|
|
3138
3200
|
layoutShouldHydrate: shouldHydrateLayout,
|
|
3139
3201
|
islandStrategy: hydrationIslandStrategy,
|
|
3140
3202
|
rendering: _chunkX4K7TYN6cjs.resolveRouteRenderingConfig.call(void 0, routeModule)
|
|
3141
3203
|
});
|
|
3142
3204
|
const destinationLayoutPatterns = layouts.map((layout) => layout.pattern);
|
|
3143
|
-
const layoutStartIndex =
|
|
3144
|
-
|
|
3205
|
+
const layoutStartIndex = _chunkUJ3R2AH2cjs.getSharedLayoutPrefixLength.call(void 0,
|
|
3206
|
+
_chunkUJ3R2AH2cjs.parseFarmLayoutChainHeader.call(void 0, request.headers.get("x-farm-layout-chain")),
|
|
3145
3207
|
destinationLayoutPatterns
|
|
3146
3208
|
);
|
|
3147
3209
|
const renderer = farmApp.getServerRenderer();
|
|
@@ -3151,7 +3213,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3151
3213
|
middlewareContext,
|
|
3152
3214
|
() => renderer.renderNavigationFragment({
|
|
3153
3215
|
PageComponent: routeModule.default,
|
|
3154
|
-
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess',
|
|
3216
|
+
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _250 => _250.default]),
|
|
3155
3217
|
pageProps: routeProps,
|
|
3156
3218
|
params,
|
|
3157
3219
|
layouts: layouts.map((layout, index) => ({
|
|
@@ -3222,7 +3284,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3222
3284
|
{
|
|
3223
3285
|
status: 200,
|
|
3224
3286
|
headers: {
|
|
3225
|
-
"Cache-Control":
|
|
3287
|
+
"Cache-Control": _chunkUJ3R2AH2cjs.getFarmFragmentCacheControl.call(void 0, renderPlan),
|
|
3226
3288
|
"X-Farm-Navigation": "html-fragment",
|
|
3227
3289
|
Vary: "X-Farm-Layout-Chain",
|
|
3228
3290
|
[_chunkE552H232cjs.FARM_DEPLOYMENT_ID_HEADER]: farmConfig.deploymentId
|
|
@@ -3259,21 +3321,21 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3259
3321
|
trustProxy: currentServerConfig.trustProxy
|
|
3260
3322
|
}).pathname;
|
|
3261
3323
|
const routeManager2 = farmApp.getRouteManager();
|
|
3262
|
-
const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3263
|
-
const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3264
|
-
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3265
|
-
const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3266
|
-
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3267
|
-
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3268
|
-
const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3269
|
-
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess',
|
|
3324
|
+
const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _251 => _251.hasHook, 'call', _252 => _252("beforeRouteMatch")]), () => ( false));
|
|
3325
|
+
const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _253 => _253.hasHook, 'call', _254 => _254("afterRouteMatch")]), () => ( false));
|
|
3326
|
+
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _255 => _255.hasHook, 'call', _256 => _256("beforeRequest")]), () => ( false));
|
|
3327
|
+
const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _257 => _257.hasHook, 'call', _258 => _258("beforeRender")]), () => ( false));
|
|
3328
|
+
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _259 => _259.hasHook, 'call', _260 => _260("afterResponse")]), () => ( false));
|
|
3329
|
+
const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _261 => _261.hasHook, 'call', _262 => _262("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _263 => _263.hasHook, 'call', _264 => _264("afterRender")]), () => ( false)));
|
|
3330
|
+
const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _265 => _265.hasRuntimeRequestHooks, 'call', _266 => _266()]), () => ( false));
|
|
3331
|
+
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _267 => _267.hasRuntimeHook, 'call', _268 => _268("after")]), () => ( false));
|
|
3270
3332
|
const requestedMatch = routeManager2.matchRoute(requestedPathname);
|
|
3271
3333
|
const pageBuiltInRouteLabel = (pathname2) => {
|
|
3272
3334
|
const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, pathname2, farmConfig.basePath);
|
|
3273
|
-
const mcpLabel =
|
|
3335
|
+
const mcpLabel = _chunkNXFA7G3Ycjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath);
|
|
3274
3336
|
if (mcpLabel) return mcpLabel;
|
|
3275
3337
|
if (farmAgentGeneratedPaths(farmConfig).includes(routePathname)) return routePathname;
|
|
3276
|
-
return routePathname ===
|
|
3338
|
+
return routePathname === _chunkY5TOT5F6cjs.FARM_DEFAULT_MCP_PATH && farmApp.getServerRenderer().getDefaultMCPServer() ? _chunkY5TOT5F6cjs.FARM_DEFAULT_MCP_PATH : null;
|
|
3277
3339
|
};
|
|
3278
3340
|
let runtimeSession;
|
|
3279
3341
|
if (pm && hasRuntimeRequestHooks) {
|
|
@@ -3282,13 +3344,13 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3282
3344
|
createRequestFromNodeRequest(req, new URL(fullUrl)),
|
|
3283
3345
|
{
|
|
3284
3346
|
kind: "page",
|
|
3285
|
-
route:
|
|
3347
|
+
route: _chunkNXFA7G3Ycjs.setFarmRouteLabel.call(void 0,
|
|
3286
3348
|
{
|
|
3287
3349
|
pathname: requestedPathname,
|
|
3288
|
-
pattern: _optionalChain([requestedMatch, 'optionalAccess',
|
|
3289
|
-
params: _optionalChain([requestedMatch, 'optionalAccess',
|
|
3350
|
+
pattern: _optionalChain([requestedMatch, 'optionalAccess', _269 => _269.route, 'optionalAccess', _270 => _270.pattern]) || null,
|
|
3351
|
+
params: _optionalChain([requestedMatch, 'optionalAccess', _271 => _271.params]) || {}
|
|
3290
3352
|
},
|
|
3291
|
-
_optionalChain([requestedMatch, 'optionalAccess',
|
|
3353
|
+
_optionalChain([requestedMatch, 'optionalAccess', _272 => _272.route]) ? null : pageBuiltInRouteLabel(requestedPathname)
|
|
3292
3354
|
)
|
|
3293
3355
|
}
|
|
3294
3356
|
);
|
|
@@ -3321,17 +3383,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3321
3383
|
if (pm && hasAfterRouteMatchHook) {
|
|
3322
3384
|
await pm.runHookParallel("afterRouteMatch", {
|
|
3323
3385
|
pathname,
|
|
3324
|
-
matched: !!_optionalChain([routeMatch, 'optionalAccess',
|
|
3325
|
-
routePattern: _optionalChain([routeMatch, 'optionalAccess',
|
|
3326
|
-
params: _optionalChain([routeMatch, 'optionalAccess',
|
|
3327
|
-
layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess',
|
|
3386
|
+
matched: !!_optionalChain([routeMatch, 'optionalAccess', _273 => _273.route]),
|
|
3387
|
+
routePattern: _optionalChain([routeMatch, 'optionalAccess', _274 => _274.route, 'optionalAccess', _275 => _275.pattern]) || null,
|
|
3388
|
+
params: _optionalChain([routeMatch, 'optionalAccess', _276 => _276.params]) || {},
|
|
3389
|
+
layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess', _277 => _277.layouts]) || []).map((l) => l.pattern)
|
|
3328
3390
|
});
|
|
3329
3391
|
}
|
|
3330
3392
|
const renderPayload = {
|
|
3331
3393
|
pathname,
|
|
3332
3394
|
method,
|
|
3333
|
-
routePattern: _optionalChain([routeMatch, 'optionalAccess',
|
|
3334
|
-
params: _optionalChain([routeMatch, 'optionalAccess',
|
|
3395
|
+
routePattern: _optionalChain([routeMatch, 'optionalAccess', _278 => _278.route, 'optionalAccess', _279 => _279.pattern]) || null,
|
|
3396
|
+
params: _optionalChain([routeMatch, 'optionalAccess', _280 => _280.params]) || {}
|
|
3335
3397
|
};
|
|
3336
3398
|
const shouldInterceptResponse = Boolean(
|
|
3337
3399
|
pm && (hasAfterResponseHook || hasHTMLTransformHook || runtimeSession && hasRuntimeAfterHook)
|
|
@@ -3353,7 +3415,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3353
3415
|
emitError: (error) => emitPluginError("response-end", error, { pathname })
|
|
3354
3416
|
}) : void 0;
|
|
3355
3417
|
try {
|
|
3356
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
3418
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _281 => _281.hasMiddleware, 'call', _282 => _282()])) {
|
|
3357
3419
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
3358
3420
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
3359
3421
|
farmApp.getServerRenderer(),
|
|
@@ -3363,7 +3425,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3363
3425
|
() => middlewareManager.execute(req, res)
|
|
3364
3426
|
);
|
|
3365
3427
|
if (handled) {
|
|
3366
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
3428
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _283 => _283.isEnded, 'call', _284 => _284()])) {
|
|
3367
3429
|
const duration = Date.now() - startTime;
|
|
3368
3430
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
3369
3431
|
}
|
|
@@ -3376,14 +3438,14 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3376
3438
|
req.url || "/",
|
|
3377
3439
|
`http://${req.headers.host || "localhost:3000"}`
|
|
3378
3440
|
).pathname;
|
|
3379
|
-
const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access',
|
|
3441
|
+
const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access', _285 => _285.matchRoute, 'call', _286 => _286(currentPathname), 'optionalAccess', _287 => _287.route]));
|
|
3380
3442
|
await pm.runHookParallelFiltered(
|
|
3381
3443
|
"beforeRequest",
|
|
3382
3444
|
(plugin) => !hasLocalPageRoute || plugin.name !== _chunkUYTAP4FQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
|
|
3383
3445
|
req,
|
|
3384
3446
|
res
|
|
3385
3447
|
);
|
|
3386
|
-
if (runtimeSession && req.url !== urlBeforeRequestHooks && _optionalChain([req, 'access',
|
|
3448
|
+
if (runtimeSession && req.url !== urlBeforeRequestHooks && _optionalChain([req, 'access', _288 => _288.url, 'optionalAccess', _289 => _289.startsWith, 'call', _290 => _290("/")]) && !res.writableEnded) {
|
|
3387
3449
|
const destinationUrl = new URL(req.url, fullUrl);
|
|
3388
3450
|
const destinationMatch = routeManager2.matchRoute(destinationUrl.pathname);
|
|
3389
3451
|
const guarded = await pm.runRuntimeBeforeForRewrite(
|
|
@@ -3393,8 +3455,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3393
3455
|
kind: "page",
|
|
3394
3456
|
route: {
|
|
3395
3457
|
pathname: destinationUrl.pathname,
|
|
3396
|
-
pattern: _optionalChain([destinationMatch, 'optionalAccess',
|
|
3397
|
-
params: _optionalChain([destinationMatch, 'optionalAccess',
|
|
3458
|
+
pattern: _optionalChain([destinationMatch, 'optionalAccess', _291 => _291.route, 'optionalAccess', _292 => _292.pattern]) || null,
|
|
3459
|
+
params: _optionalChain([destinationMatch, 'optionalAccess', _293 => _293.params]) || {}
|
|
3398
3460
|
}
|
|
3399
3461
|
}
|
|
3400
3462
|
);
|
|
@@ -3406,8 +3468,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3406
3468
|
}
|
|
3407
3469
|
}
|
|
3408
3470
|
}
|
|
3409
|
-
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess',
|
|
3410
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
3471
|
+
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _294 => _294.isEnded, 'call', _295 => _295()]) || await proxyFarmExternalRewrite(req, res, currentServerConfig.bodySizeLimit)) {
|
|
3472
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _296 => _296.isEnded, 'call', _297 => _297()])) {
|
|
3411
3473
|
const duration = Date.now() - startTime;
|
|
3412
3474
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
3413
3475
|
}
|
|
@@ -3471,8 +3533,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3471
3533
|
if (imageModule) return imageModule;
|
|
3472
3534
|
}
|
|
3473
3535
|
if (_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
|
|
3474
|
-
const renderer = _optionalChain([farmApp, 'optionalAccess',
|
|
3475
|
-
const root = _optionalChain([server, 'optionalAccess',
|
|
3536
|
+
const renderer = _optionalChain([farmApp, 'optionalAccess', _298 => _298.getConfig, 'call', _299 => _299(), 'access', _300 => _300.renderer]) || _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
3537
|
+
const root = _optionalChain([server, 'optionalAccess', _301 => _301.config, 'access', _302 => _302.root]) || options.root;
|
|
3476
3538
|
if (isClientEnvironment(this, loadOptions)) {
|
|
3477
3539
|
return generateProgrammaticClientRouteModuleForId(
|
|
3478
3540
|
id,
|
|
@@ -3488,21 +3550,21 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3488
3550
|
return FARM_DEV_CLIENT_BOOT_MODULE;
|
|
3489
3551
|
}
|
|
3490
3552
|
if (isFarmClientVirtualId(id)) {
|
|
3491
|
-
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
3492
|
-
const renderer = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
3493
|
-
const integrations = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
3494
|
-
const root = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
3495
|
-
const docs = _optionalChain([resolvedConfig, 'optionalAccess',
|
|
3553
|
+
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _303 => _303.getConfig, 'call', _304 => _304()]);
|
|
3554
|
+
const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _305 => _305.renderer]) || _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
3555
|
+
const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _306 => _306.integrations]) || options.integrations;
|
|
3556
|
+
const root = _optionalChain([resolvedConfig, 'optionalAccess', _307 => _307.root]) || _optionalChain([server, 'optionalAccess', _308 => _308.config, 'access', _309 => _309.root]) || process.cwd();
|
|
3557
|
+
const docs = _optionalChain([resolvedConfig, 'optionalAccess', _310 => _310.docs]);
|
|
3496
3558
|
const adapterOwnsDocsRuntime = Boolean(
|
|
3497
|
-
_chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess',
|
|
3559
|
+
_chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _311 => _311.adapter, 'optionalAccess', _312 => _312.server]) && docs.adapter.react
|
|
3498
3560
|
);
|
|
3499
|
-
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3561
|
+
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _313 => _313.devtools]), () => ( _chunkSTF6VDYQcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
|
|
3500
3562
|
const [docsRuntime, docsSearchRuntime, devtoolsClientRuntime] = await Promise.all([
|
|
3501
|
-
_optionalChain([docs, 'optionalAccess',
|
|
3502
|
-
_optionalChain([docs, 'optionalAccess',
|
|
3563
|
+
_optionalChain([docs, 'optionalAccess', _314 => _314.enabled]) ? loadFarmDocsDevRuntime() : null,
|
|
3564
|
+
_optionalChain([docs, 'optionalAccess', _315 => _315.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
|
|
3503
3565
|
devtools.enabled ? loadFarmDevtoolsClientRuntime() : null
|
|
3504
3566
|
]);
|
|
3505
|
-
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess',
|
|
3567
|
+
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _316 => _316.isFarmDocsSearchEnabled, 'call', _317 => _317(docs)]), () => ( false));
|
|
3506
3568
|
const generatedDocsSearchRuntime = docsSearchRuntime ? docsSearchRuntime.generateFarmDocsSearchClientRuntime(
|
|
3507
3569
|
docsSearchEnabled,
|
|
3508
3570
|
docsSearchEnabled ? docsSearchRuntime.resolveFarmDocsSearchClientModule(root) : void 0
|
|
@@ -3510,10 +3572,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3510
3572
|
const generatedDevtoolsClientRuntime = devtoolsClientRuntime ? devtoolsClientRuntime.generateFarmDevtoolsClientRuntime(devtools) : "";
|
|
3511
3573
|
const generatedDevIndicatorsClientRuntime = farmApp ? _chunkBPNOYILCcjs.generateFarmDevIndicatorsClientRuntime.call(void 0, farmApp.getConfig().devIndicators) : "";
|
|
3512
3574
|
const integrationProviders = _chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) ? _chunkI32V5CZLcjs.getIntegrationProviders.call(void 0, integrations) : [];
|
|
3513
|
-
const isolatedHydrationMode =
|
|
3514
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3575
|
+
const isolatedHydrationMode = _chunkFAP7CX7Ccjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
3576
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _318 => _318.experimental, 'optionalAccess', _319 => _319.isolatedClientHydration]),
|
|
3515
3577
|
{
|
|
3516
|
-
serverComponents: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess',
|
|
3578
|
+
serverComponents: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _320 => _320.experimental, 'optionalAccess', _321 => _321.serverComponents])) === "rsc",
|
|
3517
3579
|
hasUnsupportedIntegrationProvider: integrationProviders.filter((provider) => provider.component || provider.type === "clerk").some((provider) => provider.supportsIsolatedHydration !== true)
|
|
3518
3580
|
}
|
|
3519
3581
|
);
|
|
@@ -3521,32 +3583,32 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3521
3583
|
integrationProviders,
|
|
3522
3584
|
[
|
|
3523
3585
|
..._chunkI32V5CZLcjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
|
|
3524
|
-
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess',
|
|
3586
|
+
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _322 => _322.getFarmDocsDocumentNavigationMatchers, 'call', _323 => _323(docs)]), () => ( []))
|
|
3525
3587
|
],
|
|
3526
3588
|
generatedDocsSearchRuntime,
|
|
3527
3589
|
`${generatedDevtoolsClientRuntime}
|
|
3528
3590
|
${generatedDevIndicatorsClientRuntime}`,
|
|
3529
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3591
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _324 => _324.plugins]) || [],
|
|
3530
3592
|
root,
|
|
3531
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3532
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3533
|
-
_chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess',
|
|
3593
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _325 => _325.srcDir]) || options.srcDir || "src",
|
|
3594
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _326 => _326.publicRuntimeConfig]) || options.publicRuntimeConfig,
|
|
3595
|
+
_chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _327 => _327.adapter, 'optionalAccess', _328 => _328.react]) : void 0,
|
|
3534
3596
|
renderer,
|
|
3535
|
-
isolatedHydrationMode === "enabled" || _chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
3536
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3537
|
-
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3538
|
-
|
|
3539
|
-
|
|
3597
|
+
isolatedHydrationMode === "enabled" || _chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _329 => _329.getRouteManager, 'call', _330 => _330(), 'access', _331 => _331.getIsolatedClientBoundaryModules, 'call', _332 => _332(root)])))), 'optionalAccess', _333 => _333.size]) > 0,
|
|
3598
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _334 => _334.trailingSlash]), () => ( false)),
|
|
3599
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _335 => _335.basePath]), () => ( "/")),
|
|
3600
|
+
_chunkFAP7CX7Ccjs.generateClientCachePersistenceCode.call(void 0,
|
|
3601
|
+
_chunkFAP7CX7Ccjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, _optionalChain([resolvedConfig, 'optionalAccess', _336 => _336.cache]))
|
|
3540
3602
|
),
|
|
3541
3603
|
_chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0,
|
|
3542
|
-
_chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess',
|
|
3604
|
+
_chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _337 => _337.experimental, 'optionalAccess', _338 => _338.serverComponents])) === "islands"
|
|
3543
3605
|
);
|
|
3544
3606
|
}
|
|
3545
3607
|
if (id === "/@farm/server") {
|
|
3546
3608
|
return generateServerCode();
|
|
3547
3609
|
}
|
|
3548
3610
|
if (id === "/@farm/manifest") {
|
|
3549
|
-
const routeManager = _optionalChain([farmApp, 'optionalAccess',
|
|
3611
|
+
const routeManager = _optionalChain([farmApp, 'optionalAccess', _339 => _339.getRouteManager, 'call', _340 => _340()]);
|
|
3550
3612
|
if (!routeManager) {
|
|
3551
3613
|
return `
|
|
3552
3614
|
export const getManifest = () => ({
|
|
@@ -3559,9 +3621,9 @@ export const getManifest = () => ({
|
|
|
3559
3621
|
`;
|
|
3560
3622
|
}
|
|
3561
3623
|
const manifest = routeManager.generateClientManifest(server.config.root);
|
|
3562
|
-
const globalStylesheetHref =
|
|
3624
|
+
const globalStylesheetHref = _chunkFAP7CX7Ccjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
3563
3625
|
server.config.root,
|
|
3564
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
3626
|
+
_optionalChain([farmApp, 'optionalAccess', _341 => _341.getConfig, 'call', _342 => _342(), 'access', _343 => _343.srcDir])
|
|
3565
3627
|
);
|
|
3566
3628
|
const fullManifest = {
|
|
3567
3629
|
clientEntry: "/@farm/client.js",
|
|
@@ -3587,11 +3649,11 @@ export const getManifest = () => ({
|
|
|
3587
3649
|
};
|
|
3588
3650
|
}
|
|
3589
3651
|
for (const layout of manifest.layouts) {
|
|
3590
|
-
const groupScope =
|
|
3652
|
+
const groupScope = _chunkUJ3R2AH2cjs.getRouteGroupScope.call(void 0, layout.pattern);
|
|
3591
3653
|
fullManifest.layouts[layout.pattern] = {
|
|
3592
3654
|
modulePath: layout.modulePath,
|
|
3593
3655
|
pattern: layout.pattern,
|
|
3594
|
-
...groupScope ? { urlPattern:
|
|
3656
|
+
...groupScope ? { urlPattern: _chunkUJ3R2AH2cjs.stripRouteGroups.call(void 0, layout.pattern), groupScope } : {},
|
|
3595
3657
|
shouldHydrate: layout.shouldHydrate,
|
|
3596
3658
|
islandStrategy: layout.islandStrategy,
|
|
3597
3659
|
// Islands mode: rebuilt from its server tree, so its module is never preloaded.
|
|
@@ -3617,22 +3679,42 @@ export const manifest = getManifest();
|
|
|
3617
3679
|
}
|
|
3618
3680
|
},
|
|
3619
3681
|
async transform(code, id, transformOptions) {
|
|
3620
|
-
const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3682
|
+
const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _344 => _344.getConfig, 'call', _345 => _345()]), () => ( options));
|
|
3621
3683
|
let rewrotePackageImports = false;
|
|
3622
|
-
if (_chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access',
|
|
3684
|
+
if (_chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access', _346 => _346.experimental, 'optionalAccess', _347 => _347.serverComponents])) === "islands" && (!id.includes("/node_modules/") || _optionalChain([transformOptions, 'optionalAccess', _348 => _348.ssr]) === true && farmReactServerFiles.has(id.split("?", 1)[0])) && !id.startsWith("\0") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id) && !_chunkFAP7CX7Ccjs.hasUseClientDirective.call(void 0, code)) {
|
|
3623
3685
|
const file = id.split("?", 1)[0];
|
|
3624
|
-
const projectRoot = actionConfig.root || _optionalChain([server, 'optionalAccess',
|
|
3625
|
-
|
|
3686
|
+
const projectRoot = actionConfig.root || _optionalChain([server, 'optionalAccess', _349 => _349.config, 'access', _350 => _350.root]) || process.cwd();
|
|
3687
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _351 => _351.ssr]) === true) {
|
|
3688
|
+
if (farmReactServerFiles.has(file)) {
|
|
3689
|
+
for (const child of _chunkFAP7CX7Ccjs.farmRelativeImportFiles.call(void 0, code, file))
|
|
3690
|
+
farmReactServerFiles.add(child);
|
|
3691
|
+
}
|
|
3692
|
+
const serverModule = farmReactServerFiles.has(file) || !_chunkFAP7CX7Ccjs.getFarmClientReachableModules.call(void 0,
|
|
3693
|
+
path6.resolve(projectRoot, actionConfig.srcDir || "src"),
|
|
3694
|
+
projectRoot
|
|
3695
|
+
).has(path6.resolve(file));
|
|
3696
|
+
const reactServer = !serverModule ? null : _chunkFAP7CX7Ccjs.rewriteFarmReactServerImports.call(void 0, {
|
|
3697
|
+
code,
|
|
3698
|
+
file,
|
|
3699
|
+
reference: (specifier, exportName) => _chunkFAP7CX7Ccjs.ensureFarmPackageClientReference.call(void 0, projectRoot, specifier, exportName),
|
|
3700
|
+
onServerFile: (serverFile) => farmReactServerFiles.add(serverFile)
|
|
3701
|
+
});
|
|
3702
|
+
if (reactServer !== null) {
|
|
3703
|
+
code = reactServer;
|
|
3704
|
+
rewrotePackageImports = true;
|
|
3705
|
+
}
|
|
3706
|
+
}
|
|
3707
|
+
const referenced = _chunkFAP7CX7Ccjs.rewriteFarmPackageClientImports.call(void 0, {
|
|
3626
3708
|
code,
|
|
3627
3709
|
file,
|
|
3628
3710
|
root: projectRoot,
|
|
3629
|
-
isClientPackage: (specifier) =>
|
|
3711
|
+
isClientPackage: (specifier) => _chunkFAP7CX7Ccjs.isFarmPackageClientBoundary.call(void 0, file, specifier, projectRoot)
|
|
3630
3712
|
});
|
|
3631
3713
|
if (referenced !== null) {
|
|
3632
3714
|
code = referenced;
|
|
3633
3715
|
rewrotePackageImports = true;
|
|
3634
3716
|
}
|
|
3635
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
3717
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _352 => _352.ssr]) === true) {
|
|
3636
3718
|
const cached = rewriteFarmReactCacheImport(code, file);
|
|
3637
3719
|
if (cached !== null) {
|
|
3638
3720
|
code = cached;
|
|
@@ -3642,43 +3724,43 @@ export const manifest = getManifest();
|
|
|
3642
3724
|
}
|
|
3643
3725
|
if (islandsServerFns() && !_chunkPIUTGRDIcjs.isFarmServerFnBoundaryId.call(void 0, id) && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
|
|
3644
3726
|
const serverFns = _chunkPIUTGRDIcjs.transformFarmServerFns.call(void 0, code, id, {
|
|
3645
|
-
environment: _optionalChain([transformOptions, 'optionalAccess',
|
|
3727
|
+
environment: _optionalChain([transformOptions, 'optionalAccess', _353 => _353.ssr]) === true ? "rsc" : "client"
|
|
3646
3728
|
});
|
|
3647
3729
|
if (serverFns) {
|
|
3648
3730
|
if (!serverFns.code.includes("use server")) return { code: serverFns.code, map: null };
|
|
3649
3731
|
code = serverFns.code;
|
|
3650
3732
|
}
|
|
3651
3733
|
}
|
|
3652
|
-
if (_chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access',
|
|
3734
|
+
if (_chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access', _354 => _354.experimental, 'optionalAccess', _355 => _355.serverComponents])) === "islands" && code.includes("use server") && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
|
|
3653
3735
|
const file = id.split("?", 1)[0];
|
|
3654
3736
|
const actionModule = transformFarmFormActionModule({
|
|
3655
3737
|
code,
|
|
3656
3738
|
id,
|
|
3657
|
-
root: actionConfig.root || _optionalChain([server, 'optionalAccess',
|
|
3658
|
-
ssr: _optionalChain([transformOptions, 'optionalAccess',
|
|
3739
|
+
root: actionConfig.root || _optionalChain([server, 'optionalAccess', _356 => _356.config, 'access', _357 => _357.root]) || process.cwd(),
|
|
3740
|
+
ssr: _optionalChain([transformOptions, 'optionalAccess', _358 => _358.ssr]) === true,
|
|
3659
3741
|
// Parsed by file type: page components are TSX.
|
|
3660
3742
|
parse: (source) => _vite.parseSync.call(void 0, file, source).program
|
|
3661
3743
|
});
|
|
3662
3744
|
if (actionModule) return { code: actionModule, map: null };
|
|
3663
3745
|
}
|
|
3664
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
3665
|
-
const docsConfigModule = _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess',
|
|
3666
|
-
if (
|
|
3667
|
-
const redacted =
|
|
3746
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _359 => _359.ssr])) {
|
|
3747
|
+
const docsConfigModule = _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess', _360 => _360.getConfig, 'call', _361 => _361(), 'optionalAccess', _362 => _362.docs]));
|
|
3748
|
+
if (_chunkFAP7CX7Ccjs.isFarmDocsClientConfigModule.call(void 0, id, docsConfigModule)) {
|
|
3749
|
+
const redacted = _chunkFAP7CX7Ccjs.redactFarmDocsClientConfig.call(void 0, code, id.split("?")[0]);
|
|
3668
3750
|
if (redacted !== null) return { code: redacted, map: null };
|
|
3669
3751
|
}
|
|
3670
3752
|
}
|
|
3671
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
3672
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3673
|
-
if ((_optionalChain([currentConfig, 'access',
|
|
3753
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _363 => _363.ssr])) {
|
|
3754
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _364 => _364.getConfig, 'call', _365 => _365()]), () => ( options));
|
|
3755
|
+
if ((_optionalChain([currentConfig, 'access', _366 => _366.experimental, 'optionalAccess', _367 => _367.serverActions]) !== true || !serverFnTransformActive) && !islandsServerFns()) {
|
|
3674
3756
|
const violation = findClientServerFnViolation(code, id);
|
|
3675
3757
|
if (violation) {
|
|
3676
3758
|
this.error(formatServerFnBoundaryError(violation, id));
|
|
3677
3759
|
}
|
|
3678
3760
|
}
|
|
3679
3761
|
}
|
|
3680
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
3681
|
-
warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3762
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _368 => _368.ssr]) && shouldInspectClientBoundary(id, code)) {
|
|
3763
|
+
warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _369 => _369.getConfig, 'call', _370 => _370()]), () => ( options)));
|
|
3682
3764
|
}
|
|
3683
3765
|
if (typeof imageImports.transform === "function") {
|
|
3684
3766
|
const imageModule = await imageImports.transform.call(this, code, id, transformOptions);
|
|
@@ -3693,13 +3775,13 @@ export const manifest = getManifest();
|
|
|
3693
3775
|
id,
|
|
3694
3776
|
transformOptions
|
|
3695
3777
|
);
|
|
3696
|
-
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess',
|
|
3778
|
+
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _371 => _371.code, 'optionalAccess', _372 => _372.toString, 'call', _373 => _373()]);
|
|
3697
3779
|
if (fontCode) {
|
|
3698
3780
|
transformedCode = fontCode;
|
|
3699
3781
|
transformed = true;
|
|
3700
3782
|
}
|
|
3701
3783
|
}
|
|
3702
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
3784
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _374 => _374.ssr]) && server) {
|
|
3703
3785
|
const rewrittenImports = rewriteEarlySsrRelativeImports({
|
|
3704
3786
|
code: transformedCode,
|
|
3705
3787
|
id,
|
|
@@ -3711,25 +3793,25 @@ export const manifest = getManifest();
|
|
|
3711
3793
|
transformed = true;
|
|
3712
3794
|
}
|
|
3713
3795
|
}
|
|
3714
|
-
if (
|
|
3796
|
+
if (_chunkFAP7CX7Ccjs.hasUseClientDirective.call(void 0, transformedCode)) {
|
|
3715
3797
|
const clientBoundarySource = transformedCode;
|
|
3716
3798
|
const moduleInfo = this.getModuleInfo(id);
|
|
3717
3799
|
if (moduleInfo) {
|
|
3718
3800
|
moduleInfo.isClientComponent = true;
|
|
3719
3801
|
}
|
|
3720
|
-
transformedCode =
|
|
3802
|
+
transformedCode = _chunkFAP7CX7Ccjs.stripUseClientDirective.call(void 0, transformedCode);
|
|
3721
3803
|
transformed = true;
|
|
3722
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3804
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _375 => _375.getConfig, 'call', _376 => _376()]), () => ( options));
|
|
3723
3805
|
let isolatedModuleReference = null;
|
|
3724
|
-
const root = currentConfig.root || _optionalChain([server, 'optionalAccess',
|
|
3806
|
+
const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _377 => _377.config, 'access', _378 => _378.root]) || process.cwd();
|
|
3725
3807
|
const cleanId = id.split("?", 1)[0];
|
|
3726
|
-
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess',
|
|
3727
|
-
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess',
|
|
3728
|
-
if (_chunkRD623KW4cjs.isReactRenderer.call(void 0, _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration &&
|
|
3808
|
+
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _379 => _379.getRouteManager, 'call', _380 => _380(), 'access', _381 => _381.getIsolatedClientBoundaryModules, 'call', _382 => _382(root)])));
|
|
3809
|
+
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _383 => _383.has, 'call', _384 => _384(path6.resolve(cleanId))]) === true;
|
|
3810
|
+
if (_chunkRD623KW4cjs.isReactRenderer.call(void 0, _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && _chunkFAP7CX7Ccjs.isIsolatableClientBoundarySource.call(void 0, clientBoundarySource)) {
|
|
3729
3811
|
isolatedModuleReference = _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, cleanId, root);
|
|
3730
|
-
const islandsMode = _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([currentConfig, 'access',
|
|
3731
|
-
const explicitStrategy =
|
|
3732
|
-
const inference = islandsMode && explicitStrategy === null ?
|
|
3812
|
+
const islandsMode = _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([currentConfig, 'access', _385 => _385.experimental, 'optionalAccess', _386 => _386.serverComponents])) === "islands";
|
|
3813
|
+
const explicitStrategy = _chunkFAP7CX7Ccjs.getIslandStrategyExport.call(void 0, clientBoundarySource);
|
|
3814
|
+
const inference = islandsMode && explicitStrategy === null ? _chunkFAP7CX7Ccjs.inferFarmIslandStrategy.call(void 0, cleanId, root) : null;
|
|
3733
3815
|
if (inference) {
|
|
3734
3816
|
for (const file of inference.files) {
|
|
3735
3817
|
if (file !== path6.resolve(cleanId)) this.addWatchFile(file);
|
|
@@ -3742,7 +3824,7 @@ export const manifest = getManifest();
|
|
|
3742
3824
|
islandStrategy: _nullishCoalesce(explicitStrategy, () => ( "load")),
|
|
3743
3825
|
parse: (source) => this.parse(source),
|
|
3744
3826
|
slots: islandsMode,
|
|
3745
|
-
inferredInteraction: _optionalChain([inference, 'optionalAccess',
|
|
3827
|
+
inferredInteraction: _optionalChain([inference, 'optionalAccess', _387 => _387.strategy]) === "interaction"
|
|
3746
3828
|
});
|
|
3747
3829
|
if (!transformedBoundary) {
|
|
3748
3830
|
this.error(
|
|
@@ -3772,7 +3854,7 @@ export const manifest = getManifest();
|
|
|
3772
3854
|
);
|
|
3773
3855
|
return;
|
|
3774
3856
|
}` : "";
|
|
3775
|
-
const hmrCode = _optionalChain([transformOptions, 'optionalAccess',
|
|
3857
|
+
const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _388 => _388.ssr]) || reactRefreshActive || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
|
|
3776
3858
|
if (import.meta.hot) {
|
|
3777
3859
|
import.meta.hot.accept((newModule) => {
|
|
3778
3860
|
${isolatedHmrUpdate}
|
|
@@ -3827,14 +3909,14 @@ if (import.meta.hot) {
|
|
|
3827
3909
|
}
|
|
3828
3910
|
_chunkQMNWKQL4cjs.logger.info(`Found ${ssgPages.length} SSG pages, ${ssrRoutes.length} SSR routes`);
|
|
3829
3911
|
_chunkQMNWKQL4cjs.logger.info("Pre-rendering SSG pages...");
|
|
3830
|
-
const outDir = path6.join(_optionalChain([server, 'optionalAccess',
|
|
3912
|
+
const outDir = path6.join(_optionalChain([server, 'optionalAccess', _389 => _389.config, 'access', _390 => _390.root]) || process.cwd(), options.outDir || "dist");
|
|
3831
3913
|
const clientDir = path6.join(outDir, "client");
|
|
3832
3914
|
for (const page of ssgPages) {
|
|
3833
3915
|
try {
|
|
3834
3916
|
const staticRequest = new Request(new URL(page.urlPath, "http://farm.static"));
|
|
3835
3917
|
await farmApp.getServerRenderer().runWithRequestContext(staticRequest, async () => {
|
|
3836
3918
|
const mod = await routeManager.loadRouteModule(page.filePath);
|
|
3837
|
-
if (!_optionalChain([mod, 'optionalAccess',
|
|
3919
|
+
if (!_optionalChain([mod, 'optionalAccess', _391 => _391.default])) return;
|
|
3838
3920
|
const { layouts } = routeManager.matchRoute(page.urlPath);
|
|
3839
3921
|
const layoutModules = await Promise.all(
|
|
3840
3922
|
layouts.map((l) => routeManager.loadLayoutModule(l.modulePath))
|
|
@@ -3866,7 +3948,7 @@ if (import.meta.hot) {
|
|
|
3866
3948
|
const i18nSnapshot = _chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
3867
3949
|
const i18nHead = renderFarmI18nStaticHead(page.urlPath, i18nSnapshot);
|
|
3868
3950
|
const fullHtml = `<!DOCTYPE html>
|
|
3869
|
-
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
3951
|
+
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _392 => _392.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
|
|
3870
3952
|
<head>
|
|
3871
3953
|
<meta charset="utf-8">
|
|
3872
3954
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
@@ -3908,6 +3990,9 @@ if (import.meta.hot) {
|
|
|
3908
3990
|
_chunkQMNWKQL4cjs.logger.error(`SSG build failed: ${error}`);
|
|
3909
3991
|
}
|
|
3910
3992
|
},
|
|
3993
|
+
watchChange() {
|
|
3994
|
+
_chunkFAP7CX7Ccjs.invalidateFarmClientReachableModules.call(void 0, );
|
|
3995
|
+
},
|
|
3911
3996
|
async handleHotUpdate(ctx) {
|
|
3912
3997
|
const { file, server: server2, modules } = ctx;
|
|
3913
3998
|
if (initialPluginManager) {
|
|
@@ -3930,13 +4015,13 @@ if (import.meta.hot) {
|
|
|
3930
4015
|
server2.moduleGraph.invalidateModule(mod);
|
|
3931
4016
|
}
|
|
3932
4017
|
}
|
|
3933
|
-
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
4018
|
+
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _393 => _393.getConfig, 'call', _394 => _394()]);
|
|
3934
4019
|
const normalizedFile = file.replace(/\\/g, "/");
|
|
3935
4020
|
if (currentFarmConfig && /\/route\.(?:ts|tsx|js|jsx)$/.test(normalizedFile) && _chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, currentFarmConfig).some(
|
|
3936
4021
|
(appDir) => normalizedFile.startsWith(`${_chunkQMNWKQL4cjs.toPosixPath.call(void 0, appDir)}/api/`)
|
|
3937
4022
|
)) {
|
|
3938
4023
|
for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
|
|
3939
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
4024
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _395 => _395(`updated ${file}`)]);
|
|
3940
4025
|
server2.ws.send({ type: "full-reload", path: "*" });
|
|
3941
4026
|
return [];
|
|
3942
4027
|
}
|
|
@@ -3946,7 +4031,7 @@ if (import.meta.hot) {
|
|
|
3946
4031
|
for (const mod of modules) {
|
|
3947
4032
|
server2.moduleGraph.invalidateModule(mod);
|
|
3948
4033
|
}
|
|
3949
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
4034
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _396 => _396(`updated ${file}`)]);
|
|
3950
4035
|
server2.ws.send({
|
|
3951
4036
|
type: "full-reload",
|
|
3952
4037
|
path: "*"
|
|
@@ -3959,7 +4044,7 @@ if (import.meta.hot) {
|
|
|
3959
4044
|
for (const mod of modules) {
|
|
3960
4045
|
server2.moduleGraph.invalidateModule(mod);
|
|
3961
4046
|
}
|
|
3962
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
4047
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _397 => _397(`updated ${file}`)]);
|
|
3963
4048
|
server2.ws.send({
|
|
3964
4049
|
type: "full-reload",
|
|
3965
4050
|
path: "*"
|
|
@@ -3967,12 +4052,12 @@ if (import.meta.hot) {
|
|
|
3967
4052
|
return [];
|
|
3968
4053
|
}
|
|
3969
4054
|
if (apiRouteManager && _chunkJYNNIGQOcjs.invalidateFarmDevDependents.call(void 0, server2, file, apiRouteManager.getSourceFiles()).length > 0) {
|
|
3970
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
4055
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _398 => _398(`updated ${file}`)]);
|
|
3971
4056
|
}
|
|
3972
|
-
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
3973
|
-
const planRouteManager = _optionalChain([farmApp, 'optionalAccess',
|
|
4057
|
+
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _399 => _399.experimental, 'optionalAccess', _400 => _400.isolatedClientHydration]);
|
|
4058
|
+
const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _401 => _401.getRouteManager, 'call', _402 => _402()]);
|
|
3974
4059
|
const isHydrationPlanSource = currentSrcRoot !== null && normalizedFile.startsWith(`${currentSrcRoot}/`) && /\.[cm]?[jt]sx?$/.test(normalizedFile);
|
|
3975
|
-
const tracksAsyncOwnerIslands = _chunkRD623KW4cjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
4060
|
+
const tracksAsyncOwnerIslands = _chunkRD623KW4cjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _403 => _403.renderer])) && planRouteManager !== void 0;
|
|
3976
4061
|
if (isHydrationPlanSource && (isolatedHydrationMode === "enabled" || isolatedHydrationMode === "analyze" || tracksAsyncOwnerIslands)) {
|
|
3977
4062
|
const routeManager = planRouteManager;
|
|
3978
4063
|
if (routeManager) {
|
|
@@ -4032,7 +4117,7 @@ if (import.meta.hot) {
|
|
|
4032
4117
|
}
|
|
4033
4118
|
return [];
|
|
4034
4119
|
}
|
|
4035
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
4120
|
+
_optionalChain([farmApp, 'optionalAccess', _404 => _404.getRouteManager, 'call', _405 => _405(), 'access', _406 => _406.invalidateClientManifest, 'call', _407 => _407()]);
|
|
4036
4121
|
const manifestModule = server2.moduleGraph.getModuleById("/@farm/manifest");
|
|
4037
4122
|
if (manifestModule) {
|
|
4038
4123
|
server2.moduleGraph.invalidateModule(manifestModule);
|
|
@@ -4097,12 +4182,12 @@ function isFarmClientVirtualId(id) {
|
|
|
4097
4182
|
}
|
|
4098
4183
|
function isClientEnvironment(context, loadOptions) {
|
|
4099
4184
|
const environment = context.environment;
|
|
4100
|
-
if (_optionalChain([environment, 'optionalAccess',
|
|
4101
|
-
if (_optionalChain([environment, 'optionalAccess',
|
|
4102
|
-
return _optionalChain([loadOptions, 'optionalAccess',
|
|
4185
|
+
if (_optionalChain([environment, 'optionalAccess', _408 => _408.config, 'optionalAccess', _409 => _409.consumer])) return environment.config.consumer === "client";
|
|
4186
|
+
if (_optionalChain([environment, 'optionalAccess', _410 => _410.name])) return environment.name === "client";
|
|
4187
|
+
return _optionalChain([loadOptions, 'optionalAccess', _411 => _411.ssr]) !== true;
|
|
4103
4188
|
}
|
|
4104
4189
|
function invalidateProgrammaticClientRouteModules(server) {
|
|
4105
|
-
const graph = _optionalChain([server, 'access',
|
|
4190
|
+
const graph = _optionalChain([server, 'access', _412 => _412.environments, 'optionalAccess', _413 => _413.client, 'optionalAccess', _414 => _414.moduleGraph]);
|
|
4106
4191
|
if (!graph) return;
|
|
4107
4192
|
for (const [id, module] of graph.idToModuleMap) {
|
|
4108
4193
|
if (_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id)) graph.invalidateModule(module);
|
|
@@ -4116,7 +4201,7 @@ function generateProgrammaticClientRouteModuleForId(moduleId, root, renderer, cl
|
|
|
4116
4201
|
kind: parsed.kind,
|
|
4117
4202
|
routePath: parsed.routePath,
|
|
4118
4203
|
routesFile,
|
|
4119
|
-
route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess',
|
|
4204
|
+
route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess', _415 => _415.routes, 'access', _416 => _416.get, 'call', _417 => _417(
|
|
4120
4205
|
_chunkNK2VWS7Pcjs.programmaticClientRouteKey.call(void 0, routesFile, parsed.kind, parsed.routePath)
|
|
4121
4206
|
)]),
|
|
4122
4207
|
rendererServer: renderer.server,
|
|
@@ -4124,7 +4209,7 @@ function generateProgrammaticClientRouteModuleForId(moduleId, root, renderer, cl
|
|
|
4124
4209
|
});
|
|
4125
4210
|
}
|
|
4126
4211
|
function resolveRealModuleFile(filePath, root) {
|
|
4127
|
-
const resolved = _nullishCoalesce(
|
|
4212
|
+
const resolved = _nullishCoalesce(_chunkFAP7CX7Ccjs.resolveModuleSourcePath.call(void 0, filePath, root), () => ( filePath));
|
|
4128
4213
|
try {
|
|
4129
4214
|
return _chunkQMNWKQL4cjs.toPosixPath.call(void 0, fs2.realpathSync(resolved));
|
|
4130
4215
|
} catch (e17) {
|
|
@@ -4438,12 +4523,12 @@ async function parseRouteModuleProps(routeModule, input) {
|
|
|
4438
4523
|
}
|
|
4439
4524
|
const schemas = routeModule.__farmRouteSchemas;
|
|
4440
4525
|
const params = parseRouteModuleSchema(
|
|
4441
|
-
_optionalChain([schemas, 'optionalAccess',
|
|
4526
|
+
_optionalChain([schemas, 'optionalAccess', _418 => _418.params]),
|
|
4442
4527
|
input.props.params,
|
|
4443
4528
|
"params",
|
|
4444
4529
|
input.routePath
|
|
4445
4530
|
);
|
|
4446
|
-
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess',
|
|
4531
|
+
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _419 => _419.search]), input.search, "search", input.routePath);
|
|
4447
4532
|
return {
|
|
4448
4533
|
...input.props,
|
|
4449
4534
|
params,
|
|
@@ -4463,12 +4548,12 @@ function parseRouteModuleSchema(schema, value, label, routePath) {
|
|
|
4463
4548
|
}
|
|
4464
4549
|
}
|
|
4465
4550
|
function generateClientCode(integrationProviders = [], documentNavigationMatchers = [], docsSearchClientRuntime = EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME, devtoolsClientRuntime = "", plugins = [], root = process.cwd(), srcDir = "src", publicRuntimeConfig = void 0, docsAdapterReact, renderer = _chunkRD623KW4cjs.REACT_RENDERER, isolatedHydrationEnabled = false, trailingSlash = false, basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false) {
|
|
4466
|
-
const providerClientCode =
|
|
4551
|
+
const providerClientCode = _chunkFAP7CX7Ccjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
4467
4552
|
integrationProviders,
|
|
4468
4553
|
root,
|
|
4469
4554
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
4470
4555
|
);
|
|
4471
|
-
const clientPluginEntry =
|
|
4556
|
+
const clientPluginEntry = _chunkFAP7CX7Ccjs.generateFarmClientPluginEntryCode.call(void 0,
|
|
4472
4557
|
plugins,
|
|
4473
4558
|
root,
|
|
4474
4559
|
srcDir,
|
|
@@ -4516,7 +4601,7 @@ async function createFarmServerTreePageElement(source, pathname) {
|
|
|
4516
4601
|
return null;
|
|
4517
4602
|
}
|
|
4518
4603
|
}
|
|
4519
|
-
${islandValues ? `${
|
|
4604
|
+
${islandValues ? `${_chunkFAP7CX7Ccjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
|
|
4520
4605
|
let farmLastRouteState = null;
|
|
4521
4606
|
|
|
4522
4607
|
// A hot update to a layout tree's client module renders the route again.
|
|
@@ -5327,7 +5412,7 @@ async function loadLayoutComponents(layouts = [], params = {}, source) {
|
|
|
5327
5412
|
return loadedLayouts;
|
|
5328
5413
|
}
|
|
5329
5414
|
|
|
5330
|
-
${
|
|
5415
|
+
${_chunkFAP7CX7Ccjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
5331
5416
|
function wrapWithLoadedLayouts(element, loadedLayouts, params) {
|
|
5332
5417
|
let wrapped = element;
|
|
5333
5418
|
for (let index = loadedLayouts.length - 1; index >= 0; index--) {
|
|
@@ -5684,7 +5769,7 @@ function replaceNavigationBoundary(
|
|
|
5684
5769
|
return nextTarget;
|
|
5685
5770
|
}
|
|
5686
5771
|
|
|
5687
|
-
${islandValues ? `${
|
|
5772
|
+
${islandValues ? `${_chunkFAP7CX7Ccjs.FARM_NAVIGATION_STREAM_READER_SOURCE}
|
|
5688
5773
|
|
|
5689
5774
|
// Islands mode navigates as the production client does: it fetches the page itself, names the
|
|
5690
5775
|
// layouts it shows by key (F-Layouts), and asks for flush markers (F-Stream), so the shell arrives
|
|
@@ -6368,7 +6453,7 @@ function generateClientManifest(bundle) {
|
|
|
6368
6453
|
async function defineConfig(config = {}) {
|
|
6369
6454
|
const tailwindVitePlugin = await _chunkR53QDV6Tcjs.loadTailwindVitePlugin.call(void 0, );
|
|
6370
6455
|
const appRoot = path6.resolve(config.root || process.cwd());
|
|
6371
|
-
if (_optionalChain([config, 'access',
|
|
6456
|
+
if (_optionalChain([config, 'access', _420 => _420.extends, 'optionalAccess', _421 => _421.length])) {
|
|
6372
6457
|
const { config: layeredConfig } = await import("./layers-DMRXRL7F.cjs").then(
|
|
6373
6458
|
({ resolveFarmLayers }) => resolveFarmLayers(config, {
|
|
6374
6459
|
root: appRoot,
|
|
@@ -6378,7 +6463,7 @@ async function defineConfig(config = {}) {
|
|
|
6378
6463
|
config = layeredConfig;
|
|
6379
6464
|
}
|
|
6380
6465
|
config.renderer = _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, config.renderer);
|
|
6381
|
-
config.images =
|
|
6466
|
+
config.images = _chunkFAP7CX7Ccjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, { root: appRoot, dev: true });
|
|
6382
6467
|
const rendererVitePlugins = await _chunkRD623KW4cjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, appRoot, {
|
|
6383
6468
|
ssr: true
|
|
6384
6469
|
});
|
|
@@ -6470,13 +6555,13 @@ async function defineConfig(config = {}) {
|
|
|
6470
6555
|
if (!serverStarted) {
|
|
6471
6556
|
serverStarted = true;
|
|
6472
6557
|
const elapsed = Date.now() - startTime;
|
|
6473
|
-
const address = _optionalChain([server, 'access',
|
|
6558
|
+
const address = _optionalChain([server, 'access', _422 => _422.httpServer, 'optionalAccess', _423 => _423.address, 'call', _424 => _424()]);
|
|
6474
6559
|
const resolvedPort = typeof address === "object" && address ? address.port : server.config.server.port || port || 3e3;
|
|
6475
6560
|
const hostConfig = server.config.server.host;
|
|
6476
6561
|
const isExposed = hostConfig === true || hostConfig === "0.0.0.0";
|
|
6477
6562
|
console.log("");
|
|
6478
6563
|
console.log(
|
|
6479
|
-
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${
|
|
6564
|
+
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkO2XFIPNLcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
|
|
6480
6565
|
);
|
|
6481
6566
|
console.log("");
|
|
6482
6567
|
console.log(
|
|
@@ -6510,7 +6595,7 @@ async function defineConfig(config = {}) {
|
|
|
6510
6595
|
plugins: [
|
|
6511
6596
|
// `farm dev --desktop`: only the desktop window gets an answer, as in the packaged app.
|
|
6512
6597
|
_chunk65Y5SIBHcjs.farmDesktopDevGuardPlugin.call(void 0, config.basePath),
|
|
6513
|
-
|
|
6598
|
+
_chunkFAP7CX7Ccjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
6514
6599
|
tailwindVitePlugin,
|
|
6515
6600
|
...rendererVitePlugins,
|
|
6516
6601
|
...reactRefreshPlugins,
|
|
@@ -6524,8 +6609,8 @@ async function defineConfig(config = {}) {
|
|
|
6524
6609
|
customLogger: farmLogger,
|
|
6525
6610
|
clearScreen: false,
|
|
6526
6611
|
optimizeDeps: {
|
|
6527
|
-
...
|
|
6528
|
-
|
|
6612
|
+
..._chunkFAP7CX7Ccjs.createFarmClientOptimizeDepsConfig.call(void 0,
|
|
6613
|
+
_chunkFAP7CX7Ccjs.createFarmClientOptimizeDepsEntries.call(void 0,
|
|
6529
6614
|
appRoot,
|
|
6530
6615
|
_chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, { ...config, root: appRoot })
|
|
6531
6616
|
),
|
|
@@ -6568,7 +6653,7 @@ async function defineConfig(config = {}) {
|
|
|
6568
6653
|
// Stub out problematic server-only modules during dev mode
|
|
6569
6654
|
alias: {
|
|
6570
6655
|
..._chunk5Y2P454Ocjs.getFarmLayerAliases.call(void 0, config.layers),
|
|
6571
|
-
...
|
|
6656
|
+
..._chunkFAP7CX7Ccjs.createFarmSourceAlias.call(void 0, appRoot, config.srcDir),
|
|
6572
6657
|
// Nitro internals that should not be resolved in browser
|
|
6573
6658
|
"supports-color": "data:text/javascript,export default false; export const supportsColor = false; export const stdout = false; export const stderr = false;",
|
|
6574
6659
|
"@poppinss/dumper": "data:text/javascript,export default {};",
|