@farm.js/core 0.1.62 → 0.1.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-mcp.d-BKZ3UNbt.d.mts → agent-mcp.d-CCQ-wKwg.d.mts} +1 -1
- package/dist/{agent-mcp.d-C1zr_nGS.d.ts → agent-mcp.d-DOJCBSh9.d.ts} +1 -1
- package/dist/agent-runtime.d.mts +1 -1
- package/dist/agent-runtime.d.ts +1 -1
- package/dist/analyzer-KEA5JVDR.cjs +15 -0
- package/dist/{analyzer-YESYU3GK.mjs → analyzer-WNPQPWFR.mjs} +2 -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-BaA0omsv.d.mts} +9 -1
- package/dist/{app-manifest.d-BpvhfKRH.d.mts → app-manifest.d-poayV4lq.d.ts} +9 -1
- package/dist/app-markdown.d.mts +2 -2
- package/dist/app-markdown.d.ts +2 -2
- package/dist/{app.d-AE8_v3Db.d.ts → app.d-D4Dn03E3.d.ts} +4 -4
- package/dist/{app.d-CysWA_8v.d.mts → app.d-DdWxeIGU.d.mts} +4 -4
- package/dist/{chunk-RZNCMRD3.mjs → chunk-4DIKLG56.mjs} +1 -1
- package/dist/{chunk-ZVIEFTUA.cjs → chunk-5IKQ7BIR.cjs} +2 -2
- package/dist/{chunk-WKJQ2FJA.cjs → chunk-5L7I6AMY.cjs} +3 -3
- package/dist/{chunk-VM7X5CKC.mjs → chunk-7FFW7DC4.mjs} +29 -3
- package/dist/{chunk-JEJQGZI7.cjs → chunk-ANXU3D32.cjs} +2 -2
- package/dist/{chunk-VWW4Q3BJ.mjs → chunk-BA2IA32Q.mjs} +1 -1
- package/dist/{chunk-SG57PX7K.cjs → chunk-BTVDYS4B.cjs} +7 -2
- package/dist/{chunk-IQIKPKFP.mjs → chunk-CBDRR3J3.mjs} +96 -16
- package/dist/{chunk-OUWRNHTV.mjs → chunk-EENTT56C.mjs} +10 -10
- package/dist/{chunk-XX32BOMM.cjs → chunk-EYLC6GD6.cjs} +44 -18
- package/dist/{chunk-SM25ZC4S.cjs → chunk-FNHN3RBD.cjs} +1 -1
- package/dist/{chunk-T46NNU4D.mjs → chunk-GPKBUME5.mjs} +1 -1
- package/dist/{chunk-2JYBLE63.mjs → chunk-LA45FN37.mjs} +762 -235
- package/dist/chunk-LA6O5EL2.mjs +254 -0
- package/dist/{chunk-UWI3SJAK.cjs → chunk-LFFSDZ4Y.cjs} +3 -3
- package/dist/chunk-LWWDTBGL.cjs +254 -0
- package/dist/{chunk-ZBUAOGMY.mjs → chunk-O5FCWI6O.mjs} +1 -1
- package/dist/{chunk-RMUD75WT.cjs → chunk-PVJX4UPA.cjs} +323 -243
- package/dist/{chunk-GGNJAGGE.cjs → chunk-QN5WRQSQ.cjs} +971 -444
- package/dist/{chunk-NT3QDN2E.mjs → chunk-RFYL5OLP.mjs} +1 -1
- package/dist/{chunk-LVWGURLD.mjs → chunk-S2NUYHRY.mjs} +1 -1
- package/dist/{chunk-2WZTGPK6.mjs → chunk-SQ5O7I3L.mjs} +7 -2
- package/dist/{chunk-545WJ5UG.cjs → chunk-U6WCUVSV.cjs} +2 -2
- package/dist/{chunk-2CNKQC3G.mjs → chunk-XICXQXYE.mjs} +1 -1
- package/dist/{chunk-AJB3DHN6.cjs → chunk-Y2YBNQ3D.cjs} +2 -2
- package/dist/{chunk-EXXFSZOC.cjs → chunk-Z74NNER4.cjs} +86 -86
- package/dist/{client-component.d-Bgt3x5Fu.d.ts → client-component.d-CQLvqLAJ.d.ts} +14 -3
- package/dist/{client-component.d-BoqC2MLC.d.mts → client-component.d-CSEFlHfG.d.mts} +14 -3
- package/dist/{client-plugins.d-CWyYBxXf.d.mts → client-plugins.d-BTF0gZm4.d.mts} +10 -1
- package/dist/{client-plugins.d-BcqIy4au.d.ts → client-plugins.d-BgPUYPc9.d.ts} +10 -1
- 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-HDKTYIZF.mjs} +2 -2
- package/dist/{devtools-SVRSGPNC.cjs → devtools-ZHN5JLVI.cjs} +3 -3
- package/dist/docs.cjs +4 -4
- package/dist/docs.d.mts +2 -2
- package/dist/docs.d.ts +2 -2
- package/dist/docs.mjs +3 -3
- package/dist/index.cjs +12 -12
- package/dist/{index.d-nAncqTXz.d.ts → index.d-Coow7bD4.d.ts} +1 -1
- package/dist/{index.d-BDaiu2i5.d.mts → index.d-Dbjx0ku7.d.mts} +1 -1
- package/dist/index.d.mts +16 -16
- package/dist/index.d.ts +16 -16
- package/dist/index.mjs +11 -11
- package/dist/integrations.d.mts +1 -1
- package/dist/integrations.d.ts +1 -1
- package/dist/internal/app-markdown-runtime.d.mts +2 -2
- package/dist/internal/app-markdown-runtime.d.ts +2 -2
- package/dist/internal/build-runtime.cjs +13 -13
- package/dist/internal/build-runtime.d.mts +3 -3
- package/dist/internal/build-runtime.d.ts +3 -3
- package/dist/internal/build-runtime.mjs +12 -12
- package/dist/internal/cli-runtime.cjs +3 -3
- package/dist/internal/cli-runtime.mjs +2 -2
- package/dist/internal/client-error-overlay.cjs +4 -4
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.d.mts +4 -4
- package/dist/internal/client-runtime.d.ts +4 -4
- package/dist/internal/compression-runtime.d.mts +1 -1
- package/dist/internal/compression-runtime.d.ts +1 -1
- package/dist/internal/config-runtime.cjs +4 -4
- package/dist/internal/config-runtime.d.mts +3 -3
- package/dist/internal/config-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.mjs +3 -3
- package/dist/internal/infra-analytics-runtime.cjs +8 -6
- package/dist/internal/infra-analytics-runtime.mjs +6 -4
- package/dist/internal/native-server-fns.cjs +4 -4
- package/dist/internal/native-server-fns.mjs +3 -3
- package/dist/internal/product-telemetry-runtime.cjs +17 -211
- package/dist/internal/product-telemetry-runtime.mjs +10 -204
- package/dist/internal/production-runtime.cjs +7 -6
- package/dist/internal/production-runtime.d.mts +10 -10
- package/dist/internal/production-runtime.d.ts +10 -10
- package/dist/internal/production-runtime.mjs +7 -6
- 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.d.mts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/middleware.d.mts +3 -3
- package/dist/middleware.d.ts +3 -3
- package/dist/{navigation-delegate.d-CSCm8ZxL.d.mts → navigation-delegate.d-Ca_BV0Wu.d.mts} +1 -1
- package/dist/{navigation-delegate.d-BbUHRXxG.d.ts → navigation-delegate.d-aHiPI6GL.d.ts} +1 -1
- package/dist/navigation.d.mts +4 -4
- package/dist/navigation.d.ts +4 -4
- package/dist/plugin.cjs +7 -7
- package/dist/plugin.d.mts +3 -3
- package/dist/plugin.d.ts +3 -3
- package/dist/plugin.mjs +6 -6
- package/dist/{production-runtime.d-DgT24A0f.d.ts → production-runtime.d-C0rF7a10.d.ts} +1 -1
- package/dist/{production-runtime.d-CcQiDko5.d.mts → production-runtime.d-CnAsSWgF.d.mts} +1 -1
- package/dist/{render-plan.d-CyrX6MDs.d.ts → render-plan.d-BxeITFT1.d.ts} +1 -1
- package/dist/{render-plan.d-BH9WF-JZ.d.mts → render-plan.d-Z-93m5GZ.d.mts} +1 -1
- package/dist/renderer-client.d.mts +4 -4
- package/dist/renderer-client.d.ts +4 -4
- package/dist/{request.d-CUrPnCW7.d.mts → request.d-8_fMFNEb.d.mts} +1 -1
- package/dist/{request.d-BB8M8bcD.d.ts → request.d-X7Q1vmGF.d.ts} +1 -1
- package/dist/request.d.mts +2 -2
- package/dist/request.d.ts +2 -2
- package/dist/{route-rendering.d-CYxlzaFm.d.mts → route-rendering.d-BInmBmul.d.mts} +1 -1
- package/dist/{route-rendering.d-DYqZMIf4.d.ts → route-rendering.d-BUr3Jp8S.d.ts} +1 -1
- package/dist/{router.d-7o24CD8u.d.mts → router.d-CZQmbpHx.d.mts} +1 -1
- package/dist/{router.d-DaKo507j.d.ts → router.d-crorSRiW.d.ts} +1 -1
- package/dist/routes.d.mts +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/{rsc-pipeline-RFLHDAKD.mjs → rsc-pipeline-3MPRULGA.mjs} +3 -3
- package/dist/{rsc-pipeline-OF2I7PCX.cjs → rsc-pipeline-RHEZNBFQ.cjs} +4 -4
- package/dist/{runtime-LBTK62AD.cjs → runtime-OZKFZQCU.cjs} +5 -5
- package/dist/{runtime-M6UJCSLA.mjs → runtime-X5UR7VHP.mjs} +3 -3
- package/dist/{runtime.d-CN73a-IL.d.ts → runtime.d-CCsjTZJW.d.ts} +1 -1
- package/dist/{runtime.d-CcNuzhX6.d.mts → runtime.d-CETtpLb-.d.mts} +1 -1
- package/dist/server-plugins.d.mts +2 -2
- package/dist/server-plugins.d.ts +2 -2
- package/dist/server.cjs +24 -24
- package/dist/server.d.mts +9 -9
- package/dist/server.d.ts +9 -9
- package/dist/server.mjs +9 -9
- package/dist/{spa-router.d-Cvgf5QP4.d.ts → spa-router.d-CCADbSqJ.d.ts} +2 -2
- package/dist/{spa-router.d-CNi77LZm.d.mts → spa-router.d-CtSHzXlC.d.mts} +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-CjyE-npA.d.ts} +1 -1
- package/dist/{utils.d-D8VfzZYn.d.mts → utils.d-zFPHKFFJ.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +11 -7
- package/dist/vite.d.mts +23 -5
- package/dist/vite.d.ts +23 -5
- package/dist/vite.mjs +10 -6
- 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 _chunkQN5WRQSQcjs = require('./chunk-QN5WRQSQ.cjs');
|
|
41
46
|
|
|
42
47
|
|
|
43
48
|
var _chunkR53QDV6Tcjs = require('./chunk-R53QDV6T.cjs');
|
|
@@ -67,7 +72,6 @@ var _chunkO27PLNQZcjs = require('./chunk-O27PLNQZ.cjs');
|
|
|
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 _chunkEYLC6GD6cjs = require('./chunk-EYLC6GD6.cjs');
|
|
83
88
|
|
|
84
89
|
|
|
85
|
-
var
|
|
90
|
+
var _chunkQAS7KE7Jcjs = require('./chunk-QAS7KE7J.cjs');
|
|
86
91
|
|
|
87
92
|
|
|
88
|
-
var
|
|
93
|
+
var _chunkLWWDTBGLcjs = require('./chunk-LWWDTBGL.cjs');
|
|
89
94
|
|
|
90
95
|
|
|
91
96
|
|
|
@@ -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 _chunkFNHN3RBDcjs = require('./chunk-FNHN3RBD.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
|
+
}
|
|
730
781
|
}
|
|
731
|
-
|
|
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);
|
|
786
|
+
}
|
|
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 = _chunkMEQN6DDAcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([config, 'access',
|
|
832
|
+
const llms = _chunkMEQN6DDAcjs.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 = _chunkDZPR2W6Ucjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access',
|
|
782
|
-
const sitemap = _chunkDZPR2W6Ucjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([config, 'access',
|
|
837
|
+
const crawlers = _chunkDZPR2W6Ucjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access', _55 => _55.agent, 'optionalAccess', _56 => _56.crawlers]));
|
|
838
|
+
const sitemap = _chunkDZPR2W6Ucjs.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-ZHN5JLVI.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
|
);
|
|
@@ -944,7 +1001,7 @@ function renderFarmI18nStaticHead(requestPath, snapshot) {
|
|
|
944
1001
|
return `${_chunkO27PLNQZcjs.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 = _chunkQN5WRQSQcjs.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]), "@") ? {} : _chunkQN5WRQSQcjs.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, _chunkQN5WRQSQcjs.FarmApp)(
|
|
1586
1643
|
{
|
|
1587
1644
|
...options,
|
|
1588
1645
|
root: resolveDevelopmentRoot(options.root, server.config.root)
|
|
@@ -1592,9 +1649,9 @@ 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 (
|
|
1654
|
+
if (_chunkLWWDTBGLcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
|
|
1598
1655
|
res.setHeader("X-Robots-Tag", _chunkDZPR2W6Ucjs.FARM_PREVIEW_ROBOTS_TAG);
|
|
1599
1656
|
}
|
|
1600
1657
|
next();
|
|
@@ -1602,7 +1659,7 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
1602
1659
|
}
|
|
1603
1660
|
const apiServerBasePath = _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, farmConfig.api);
|
|
1604
1661
|
const devBuiltInRoutePaths = new Set(
|
|
1605
|
-
|
|
1662
|
+
_chunkEYLC6GD6cjs.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);
|
|
@@ -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: _chunkQN5WRQSQcjs.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: _chunkQN5WRQSQcjs.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: _chunkQN5WRQSQcjs.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 = _chunkEYLC6GD6cjs.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 : _chunkEYLC6GD6cjs.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,20 +2387,20 @@ 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 && _chunkEYLC6GD6cjs.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 = _chunkQN5WRQSQcjs.resolveFarmAppPackages.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd()))))));
|
|
2393
|
+
const manifest = await _chunkEYLC6GD6cjs.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
|
+
..._chunkEYLC6GD6cjs.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")]) ? _chunkQN5WRQSQcjs.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.
|
|
@@ -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) === _chunkEYLC6GD6cjs.FARM_API_CATALOG_PATH) {
|
|
2365
2422
|
await serveBuiltInRoute(
|
|
2366
|
-
() =>
|
|
2423
|
+
() => _chunkEYLC6GD6cjs.createFarmApiCatalogResponse.call(void 0,
|
|
2367
2424
|
requestMethod,
|
|
2368
|
-
|
|
2425
|
+
_chunkEYLC6GD6cjs.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 = _chunkEYLC6GD6cjs.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: _chunkEYLC6GD6cjs.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,7 +2487,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2430
2487
|
return;
|
|
2431
2488
|
}
|
|
2432
2489
|
}
|
|
2433
|
-
if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD") && _optionalChain([req, 'access',
|
|
2490
|
+
if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD") && _optionalChain([req, 'access', _189 => _189.headers, 'access', _190 => _190.accept, 'optionalAccess', _191 => _191.includes, 'call', _192 => _192(_chunk3HLQTOVUcjs.FARM_NATIVE_TREE_CONTENT_TYPE)])) {
|
|
2434
2491
|
const { createFarmNativeTreeResponse } = await import("./native-tree-Z2WYUJEV.cjs");
|
|
2435
2492
|
const treeResponse = await createFarmNativeTreeResponse({
|
|
2436
2493
|
request: new Request(fullUrl, { method: requestMethod, headers: docsHeaders }),
|
|
@@ -2443,13 +2500,13 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2443
2500
|
});
|
|
2444
2501
|
await serveBuiltInRoute(() => treeResponse, {
|
|
2445
2502
|
computed: treeResponse,
|
|
2446
|
-
label: _nullishCoalesce(_optionalChain([farmApp, 'access',
|
|
2503
|
+
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
2504
|
});
|
|
2448
2505
|
return;
|
|
2449
2506
|
}
|
|
2450
|
-
const markdownRouteLabel = () =>
|
|
2507
|
+
const markdownRouteLabel = () => _chunkEYLC6GD6cjs.resolveFarmMarkdownRouteLabel.call(void 0,
|
|
2451
2508
|
_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath),
|
|
2452
|
-
(page) => _optionalChain([farmApp, 'access',
|
|
2509
|
+
(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
2510
|
);
|
|
2454
2511
|
const markdownSourceResponse = viteModuleRequest ? null : await _chunkPRFNLQSPcjs.createFarmMarkdownSourceResponse.call(void 0, {
|
|
2455
2512
|
request: new Request(fullUrl, {
|
|
@@ -2459,7 +2516,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2459
2516
|
config: farmApp.getConfig().mdx,
|
|
2460
2517
|
resolveSource: async (pathname2) => {
|
|
2461
2518
|
const match = farmApp.getRouteManager().matchRoute(pathname2);
|
|
2462
|
-
const sourcePath = _optionalChain([match, 'access',
|
|
2519
|
+
const sourcePath = _optionalChain([match, 'access', _205 => _205.route, 'optionalAccess', _206 => _206.markdownSourcePath]) || (match.route && _chunkPRFNLQSPcjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
|
|
2463
2520
|
if (!sourcePath) {
|
|
2464
2521
|
return null;
|
|
2465
2522
|
}
|
|
@@ -2599,7 +2656,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2599
2656
|
"beforeRequest",
|
|
2600
2657
|
(plugin) => {
|
|
2601
2658
|
const owner = _chunkI32V5CZLcjs.getFarmIntegrationPluginOwner.call(void 0, plugin);
|
|
2602
|
-
return plugin.name !== _chunkUYTAP4FQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess',
|
|
2659
|
+
return plugin.name !== _chunkUYTAP4FQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess', _207 => _207.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
|
|
2603
2660
|
},
|
|
2604
2661
|
req,
|
|
2605
2662
|
res
|
|
@@ -2635,7 +2692,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2635
2692
|
isProd: false
|
|
2636
2693
|
},
|
|
2637
2694
|
request,
|
|
2638
|
-
{ clientAddress: _optionalChain([req, 'access',
|
|
2695
|
+
{ clientAddress: _optionalChain([req, 'access', _208 => _208.socket, 'optionalAccess', _209 => _209.remoteAddress]) }
|
|
2639
2696
|
);
|
|
2640
2697
|
if (!result) {
|
|
2641
2698
|
throw new Error(`Matched integration route did not return a response`);
|
|
@@ -2699,7 +2756,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2699
2756
|
trustProxy: currentServerConfig.trustProxy
|
|
2700
2757
|
}).pathname;
|
|
2701
2758
|
const servesLocalApiRoute = hasMatchedApiRoute || Boolean(
|
|
2702
|
-
farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
2759
|
+
farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _210 => _210.isFarmDocsAPIRequest, 'call', _211 => _211(requestPathname)])
|
|
2703
2760
|
);
|
|
2704
2761
|
try {
|
|
2705
2762
|
if (pm) {
|
|
@@ -2743,7 +2800,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2743
2800
|
const routedApiRoute = rewritten ? apiRouteManager.matchRoute(routedPathname) : matchedApiRoute || apiRouteManager.matchRoute(pathname2);
|
|
2744
2801
|
const hasExplicitAPIRoute = Boolean(routedApiRoute);
|
|
2745
2802
|
if (apiHandler && hasExplicitAPIRoute) {
|
|
2746
|
-
const apiRoutePattern = _optionalChain([routedApiRoute, 'optionalAccess',
|
|
2803
|
+
const apiRoutePattern = _optionalChain([routedApiRoute, 'optionalAccess', _212 => _212.route, 'access', _213 => _213.path]) || urlPath2;
|
|
2747
2804
|
_chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
|
|
2748
2805
|
type: "route.matched",
|
|
2749
2806
|
pathname: pathname2,
|
|
@@ -2833,7 +2890,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2833
2890
|
return;
|
|
2834
2891
|
}
|
|
2835
2892
|
}
|
|
2836
|
-
if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess',
|
|
2893
|
+
if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _214 => _214.isFarmDocsAPIRequest, 'call', _215 => _215(pathname2)])) {
|
|
2837
2894
|
try {
|
|
2838
2895
|
const url = `http://${req.headers.host || "localhost:3000"}${req.url}`;
|
|
2839
2896
|
const headers = new Headers();
|
|
@@ -2871,11 +2928,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2871
2928
|
};
|
|
2872
2929
|
const docsResponse = pm ? await pm.runRuntimeRequest(request, invokeDocsAPIHandler, {
|
|
2873
2930
|
kind: "docs",
|
|
2874
|
-
route:
|
|
2931
|
+
route: _chunkEYLC6GD6cjs.setFarmRouteLabel.call(void 0,
|
|
2875
2932
|
{ pathname: pathname2, pattern: apiLifecyclePayload.routePath },
|
|
2876
|
-
|
|
2877
|
-
path: _optionalChain([farmConfig, 'access',
|
|
2878
|
-
roots: _optionalChain([farmConfig, 'access',
|
|
2933
|
+
_chunkEYLC6GD6cjs.resolveFarmDocsRouteLabel.call(void 0, pathname2, {
|
|
2934
|
+
path: _optionalChain([farmConfig, 'access', _216 => _216.docs, 'optionalAccess', _217 => _217.entry]) || "/docs",
|
|
2935
|
+
roots: _optionalChain([farmConfig, 'access', _218 => _218.docs, 'optionalAccess', _219 => _219.roots, 'optionalAccess', _220 => _220.map, 'call', _221 => _221((root) => root.entry)])
|
|
2879
2936
|
})
|
|
2880
2937
|
)
|
|
2881
2938
|
}) : await invokeDocsAPIHandler(request);
|
|
@@ -2909,18 +2966,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2909
2966
|
res.end(JSON.stringify({ error: "API route not found", pathname: pathname2 }));
|
|
2910
2967
|
return;
|
|
2911
2968
|
}
|
|
2912
|
-
if (_optionalChain([req, 'access',
|
|
2969
|
+
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
2970
|
return next();
|
|
2914
2971
|
}
|
|
2915
2972
|
if (shouldBypassFarmRouterForDottedPath(
|
|
2916
2973
|
requestPathname,
|
|
2917
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
2974
|
+
_optionalChain([farmApp, 'optionalAccess', _228 => _228.getRouteManager, 'call', _229 => _229()]),
|
|
2918
2975
|
[server.config.publicDir, server.config.root],
|
|
2919
2976
|
farmAgentGeneratedPaths(farmConfig)
|
|
2920
2977
|
)) {
|
|
2921
2978
|
return next();
|
|
2922
2979
|
}
|
|
2923
|
-
if (_optionalChain([req, 'access',
|
|
2980
|
+
if (_optionalChain([req, 'access', _230 => _230.url, 'optionalAccess', _231 => _231.startsWith, 'call', _232 => _232("/__farm/page-data")])) {
|
|
2924
2981
|
const urlObj = parsedRequestUrl;
|
|
2925
2982
|
const targetPath = urlObj.searchParams.get("path") || "/";
|
|
2926
2983
|
try {
|
|
@@ -2948,7 +3005,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2948
3005
|
});
|
|
2949
3006
|
let middlewareMap = /* @__PURE__ */ new Map();
|
|
2950
3007
|
let middlewareContext = /* @__PURE__ */ new Map();
|
|
2951
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
3008
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _233 => _233.hasMiddleware, 'call', _234 => _234()])) {
|
|
2952
3009
|
const targetNodeRequest = createPageDataMiddlewareRequest(req, targetRequestUrl);
|
|
2953
3010
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
2954
3011
|
farmApp.getServerRenderer(),
|
|
@@ -2976,10 +3033,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
2976
3033
|
if (pm) {
|
|
2977
3034
|
await pm.runHookParallel("afterRouteMatch", {
|
|
2978
3035
|
pathname: targetPath,
|
|
2979
|
-
matched: !!_optionalChain([match, 'optionalAccess',
|
|
2980
|
-
routePattern: _optionalChain([match, 'optionalAccess',
|
|
2981
|
-
params: _optionalChain([match, 'optionalAccess',
|
|
2982
|
-
layoutPatterns: (_optionalChain([match, 'optionalAccess',
|
|
3036
|
+
matched: !!_optionalChain([match, 'optionalAccess', _235 => _235.route]),
|
|
3037
|
+
routePattern: _optionalChain([match, 'optionalAccess', _236 => _236.route, 'optionalAccess', _237 => _237.pattern]) || null,
|
|
3038
|
+
params: _optionalChain([match, 'optionalAccess', _238 => _238.params]) || {},
|
|
3039
|
+
layoutPatterns: (_optionalChain([match, 'optionalAccess', _239 => _239.layouts]) || []).map((l) => l.pattern)
|
|
2983
3040
|
});
|
|
2984
3041
|
}
|
|
2985
3042
|
if (!match) {
|
|
@@ -3002,7 +3059,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3002
3059
|
);
|
|
3003
3060
|
const loadingModule = loadingBoundary ? await routeManager3.loadRouteModule(loadingBoundary.modulePath) : null;
|
|
3004
3061
|
const navigationManifest = routeManager3.generateClientManifest(server.config.root);
|
|
3005
|
-
const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => (
|
|
3062
|
+
const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => ( _chunkQN5WRQSQcjs.getClientModuleMetadata.call(void 0, route.modulePath, server.config.root)));
|
|
3006
3063
|
const isClientComponent = moduleMetadata.isClientComponent;
|
|
3007
3064
|
const shouldHydrate = moduleMetadata.shouldHydrate;
|
|
3008
3065
|
let mergedMetadata = {};
|
|
@@ -3010,7 +3067,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3010
3067
|
layouts.map((layout) => routeManager3.loadLayoutModule(layout.modulePath))
|
|
3011
3068
|
);
|
|
3012
3069
|
const layoutHydrationMetadata = layouts.map(
|
|
3013
|
-
(layout) => _nullishCoalesce(navigationManifest.layouts.find((entry) => entry.pattern === layout.pattern), () => (
|
|
3070
|
+
(layout) => _nullishCoalesce(navigationManifest.layouts.find((entry) => entry.pattern === layout.pattern), () => ( _chunkQN5WRQSQcjs.getClientModuleMetadata.call(void 0, layout.modulePath, server.config.root)))
|
|
3014
3071
|
);
|
|
3015
3072
|
const shouldHydrateLayout = layoutHydrationMetadata.some(
|
|
3016
3073
|
(metadata) => metadata.shouldHydrate
|
|
@@ -3022,17 +3079,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3022
3079
|
)
|
|
3023
3080
|
];
|
|
3024
3081
|
const hydrationIslandStrategy = _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0,
|
|
3025
|
-
_optionalChain([(_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3026
|
-
) === "islands" ?
|
|
3082
|
+
_optionalChain([(_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _240 => _240.getConfig, 'call', _241 => _241()]), () => ( options))), 'access', _242 => _242.experimental, 'optionalAccess', _243 => _243.serverComponents])
|
|
3083
|
+
) === "islands" ? _chunkQN5WRQSQcjs.resolveFarmRouteRootStrategy.call(void 0,
|
|
3027
3084
|
route,
|
|
3028
3085
|
{ shouldHydrate, islandStrategy: _nullishCoalesce(moduleMetadata.islandStrategy, () => ( null)) },
|
|
3029
3086
|
layouts.map((layout, index) => ({
|
|
3030
3087
|
pattern: layout.pattern,
|
|
3031
3088
|
modulePath: layout.modulePath,
|
|
3032
|
-
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access',
|
|
3089
|
+
shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _244 => _244[index], 'optionalAccess', _245 => _245.shouldHydrate]) === true,
|
|
3033
3090
|
// Manifest entries carry it; metadata read from source does not.
|
|
3034
|
-
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access',
|
|
3035
|
-
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access',
|
|
3091
|
+
hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access', _246 => _246[index], 'optionalAccess', _247 => _247.hasIsolatedClientBoundaries]) === true,
|
|
3092
|
+
islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _248 => _248[index], 'optionalAccess', _249 => _249.islandStrategy]), () => ( null))
|
|
3036
3093
|
})),
|
|
3037
3094
|
server.config.root,
|
|
3038
3095
|
true
|
|
@@ -3087,7 +3144,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3087
3144
|
const slotModule = await routeManager3.loadRouteModule(slot.route.modulePath);
|
|
3088
3145
|
const slotMetadata = _nullishCoalesce(navigationManifest.slots.find(
|
|
3089
3146
|
(entry) => entry.name === slot.name && entry.ownerPattern === slot.ownerPattern && entry.pattern === slot.route.pattern
|
|
3090
|
-
), () => (
|
|
3147
|
+
), () => ( _chunkQN5WRQSQcjs.getClientModuleMetadata.call(void 0, slot.route.modulePath, server.config.root)));
|
|
3091
3148
|
const slotContext = await _chunkX333W5KVcjs.resolveFarmRouteContext.call(void 0, farmApp.getConfig(), {
|
|
3092
3149
|
request: targetRequest,
|
|
3093
3150
|
params: slot.params,
|
|
@@ -3151,7 +3208,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3151
3208
|
middlewareContext,
|
|
3152
3209
|
() => renderer.renderNavigationFragment({
|
|
3153
3210
|
PageComponent: routeModule.default,
|
|
3154
|
-
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess',
|
|
3211
|
+
LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _250 => _250.default]),
|
|
3155
3212
|
pageProps: routeProps,
|
|
3156
3213
|
params,
|
|
3157
3214
|
layouts: layouts.map((layout, index) => ({
|
|
@@ -3259,18 +3316,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3259
3316
|
trustProxy: currentServerConfig.trustProxy
|
|
3260
3317
|
}).pathname;
|
|
3261
3318
|
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',
|
|
3319
|
+
const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _251 => _251.hasHook, 'call', _252 => _252("beforeRouteMatch")]), () => ( false));
|
|
3320
|
+
const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _253 => _253.hasHook, 'call', _254 => _254("afterRouteMatch")]), () => ( false));
|
|
3321
|
+
const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _255 => _255.hasHook, 'call', _256 => _256("beforeRequest")]), () => ( false));
|
|
3322
|
+
const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _257 => _257.hasHook, 'call', _258 => _258("beforeRender")]), () => ( false));
|
|
3323
|
+
const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _259 => _259.hasHook, 'call', _260 => _260("afterResponse")]), () => ( false));
|
|
3324
|
+
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)));
|
|
3325
|
+
const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _265 => _265.hasRuntimeRequestHooks, 'call', _266 => _266()]), () => ( false));
|
|
3326
|
+
const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _267 => _267.hasRuntimeHook, 'call', _268 => _268("after")]), () => ( false));
|
|
3270
3327
|
const requestedMatch = routeManager2.matchRoute(requestedPathname);
|
|
3271
3328
|
const pageBuiltInRouteLabel = (pathname2) => {
|
|
3272
3329
|
const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, pathname2, farmConfig.basePath);
|
|
3273
|
-
const mcpLabel =
|
|
3330
|
+
const mcpLabel = _chunkEYLC6GD6cjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath);
|
|
3274
3331
|
if (mcpLabel) return mcpLabel;
|
|
3275
3332
|
if (farmAgentGeneratedPaths(farmConfig).includes(routePathname)) return routePathname;
|
|
3276
3333
|
return routePathname === _chunkQAS7KE7Jcjs.FARM_DEFAULT_MCP_PATH && farmApp.getServerRenderer().getDefaultMCPServer() ? _chunkQAS7KE7Jcjs.FARM_DEFAULT_MCP_PATH : null;
|
|
@@ -3282,13 +3339,13 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3282
3339
|
createRequestFromNodeRequest(req, new URL(fullUrl)),
|
|
3283
3340
|
{
|
|
3284
3341
|
kind: "page",
|
|
3285
|
-
route:
|
|
3342
|
+
route: _chunkEYLC6GD6cjs.setFarmRouteLabel.call(void 0,
|
|
3286
3343
|
{
|
|
3287
3344
|
pathname: requestedPathname,
|
|
3288
|
-
pattern: _optionalChain([requestedMatch, 'optionalAccess',
|
|
3289
|
-
params: _optionalChain([requestedMatch, 'optionalAccess',
|
|
3345
|
+
pattern: _optionalChain([requestedMatch, 'optionalAccess', _269 => _269.route, 'optionalAccess', _270 => _270.pattern]) || null,
|
|
3346
|
+
params: _optionalChain([requestedMatch, 'optionalAccess', _271 => _271.params]) || {}
|
|
3290
3347
|
},
|
|
3291
|
-
_optionalChain([requestedMatch, 'optionalAccess',
|
|
3348
|
+
_optionalChain([requestedMatch, 'optionalAccess', _272 => _272.route]) ? null : pageBuiltInRouteLabel(requestedPathname)
|
|
3292
3349
|
)
|
|
3293
3350
|
}
|
|
3294
3351
|
);
|
|
@@ -3321,17 +3378,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3321
3378
|
if (pm && hasAfterRouteMatchHook) {
|
|
3322
3379
|
await pm.runHookParallel("afterRouteMatch", {
|
|
3323
3380
|
pathname,
|
|
3324
|
-
matched: !!_optionalChain([routeMatch, 'optionalAccess',
|
|
3325
|
-
routePattern: _optionalChain([routeMatch, 'optionalAccess',
|
|
3326
|
-
params: _optionalChain([routeMatch, 'optionalAccess',
|
|
3327
|
-
layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess',
|
|
3381
|
+
matched: !!_optionalChain([routeMatch, 'optionalAccess', _273 => _273.route]),
|
|
3382
|
+
routePattern: _optionalChain([routeMatch, 'optionalAccess', _274 => _274.route, 'optionalAccess', _275 => _275.pattern]) || null,
|
|
3383
|
+
params: _optionalChain([routeMatch, 'optionalAccess', _276 => _276.params]) || {},
|
|
3384
|
+
layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess', _277 => _277.layouts]) || []).map((l) => l.pattern)
|
|
3328
3385
|
});
|
|
3329
3386
|
}
|
|
3330
3387
|
const renderPayload = {
|
|
3331
3388
|
pathname,
|
|
3332
3389
|
method,
|
|
3333
|
-
routePattern: _optionalChain([routeMatch, 'optionalAccess',
|
|
3334
|
-
params: _optionalChain([routeMatch, 'optionalAccess',
|
|
3390
|
+
routePattern: _optionalChain([routeMatch, 'optionalAccess', _278 => _278.route, 'optionalAccess', _279 => _279.pattern]) || null,
|
|
3391
|
+
params: _optionalChain([routeMatch, 'optionalAccess', _280 => _280.params]) || {}
|
|
3335
3392
|
};
|
|
3336
3393
|
const shouldInterceptResponse = Boolean(
|
|
3337
3394
|
pm && (hasAfterResponseHook || hasHTMLTransformHook || runtimeSession && hasRuntimeAfterHook)
|
|
@@ -3353,7 +3410,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3353
3410
|
emitError: (error) => emitPluginError("response-end", error, { pathname })
|
|
3354
3411
|
}) : void 0;
|
|
3355
3412
|
try {
|
|
3356
|
-
if (_optionalChain([middlewareManager, 'optionalAccess',
|
|
3413
|
+
if (_optionalChain([middlewareManager, 'optionalAccess', _281 => _281.hasMiddleware, 'call', _282 => _282()])) {
|
|
3357
3414
|
const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
|
|
3358
3415
|
const handled = await runFarmMiddlewareWithNavigation(
|
|
3359
3416
|
farmApp.getServerRenderer(),
|
|
@@ -3363,7 +3420,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3363
3420
|
() => middlewareManager.execute(req, res)
|
|
3364
3421
|
);
|
|
3365
3422
|
if (handled) {
|
|
3366
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
3423
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _283 => _283.isEnded, 'call', _284 => _284()])) {
|
|
3367
3424
|
const duration = Date.now() - startTime;
|
|
3368
3425
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
3369
3426
|
}
|
|
@@ -3376,14 +3433,14 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3376
3433
|
req.url || "/",
|
|
3377
3434
|
`http://${req.headers.host || "localhost:3000"}`
|
|
3378
3435
|
).pathname;
|
|
3379
|
-
const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access',
|
|
3436
|
+
const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access', _285 => _285.matchRoute, 'call', _286 => _286(currentPathname), 'optionalAccess', _287 => _287.route]));
|
|
3380
3437
|
await pm.runHookParallelFiltered(
|
|
3381
3438
|
"beforeRequest",
|
|
3382
3439
|
(plugin) => !hasLocalPageRoute || plugin.name !== _chunkUYTAP4FQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
|
|
3383
3440
|
req,
|
|
3384
3441
|
res
|
|
3385
3442
|
);
|
|
3386
|
-
if (runtimeSession && req.url !== urlBeforeRequestHooks && _optionalChain([req, 'access',
|
|
3443
|
+
if (runtimeSession && req.url !== urlBeforeRequestHooks && _optionalChain([req, 'access', _288 => _288.url, 'optionalAccess', _289 => _289.startsWith, 'call', _290 => _290("/")]) && !res.writableEnded) {
|
|
3387
3444
|
const destinationUrl = new URL(req.url, fullUrl);
|
|
3388
3445
|
const destinationMatch = routeManager2.matchRoute(destinationUrl.pathname);
|
|
3389
3446
|
const guarded = await pm.runRuntimeBeforeForRewrite(
|
|
@@ -3393,8 +3450,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3393
3450
|
kind: "page",
|
|
3394
3451
|
route: {
|
|
3395
3452
|
pathname: destinationUrl.pathname,
|
|
3396
|
-
pattern: _optionalChain([destinationMatch, 'optionalAccess',
|
|
3397
|
-
params: _optionalChain([destinationMatch, 'optionalAccess',
|
|
3453
|
+
pattern: _optionalChain([destinationMatch, 'optionalAccess', _291 => _291.route, 'optionalAccess', _292 => _292.pattern]) || null,
|
|
3454
|
+
params: _optionalChain([destinationMatch, 'optionalAccess', _293 => _293.params]) || {}
|
|
3398
3455
|
}
|
|
3399
3456
|
}
|
|
3400
3457
|
);
|
|
@@ -3406,8 +3463,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3406
3463
|
}
|
|
3407
3464
|
}
|
|
3408
3465
|
}
|
|
3409
|
-
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess',
|
|
3410
|
-
if (!_optionalChain([responseInterceptor, 'optionalAccess',
|
|
3466
|
+
if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _294 => _294.isEnded, 'call', _295 => _295()]) || await proxyFarmExternalRewrite(req, res, currentServerConfig.bodySizeLimit)) {
|
|
3467
|
+
if (!_optionalChain([responseInterceptor, 'optionalAccess', _296 => _296.isEnded, 'call', _297 => _297()])) {
|
|
3411
3468
|
const duration = Date.now() - startTime;
|
|
3412
3469
|
logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
|
|
3413
3470
|
}
|
|
@@ -3471,8 +3528,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3471
3528
|
if (imageModule) return imageModule;
|
|
3472
3529
|
}
|
|
3473
3530
|
if (_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
|
|
3474
|
-
const renderer = _optionalChain([farmApp, 'optionalAccess',
|
|
3475
|
-
const root = _optionalChain([server, 'optionalAccess',
|
|
3531
|
+
const renderer = _optionalChain([farmApp, 'optionalAccess', _298 => _298.getConfig, 'call', _299 => _299(), 'access', _300 => _300.renderer]) || _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
3532
|
+
const root = _optionalChain([server, 'optionalAccess', _301 => _301.config, 'access', _302 => _302.root]) || options.root;
|
|
3476
3533
|
if (isClientEnvironment(this, loadOptions)) {
|
|
3477
3534
|
return generateProgrammaticClientRouteModuleForId(
|
|
3478
3535
|
id,
|
|
@@ -3488,21 +3545,21 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3488
3545
|
return FARM_DEV_CLIENT_BOOT_MODULE;
|
|
3489
3546
|
}
|
|
3490
3547
|
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',
|
|
3548
|
+
const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _303 => _303.getConfig, 'call', _304 => _304()]);
|
|
3549
|
+
const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _305 => _305.renderer]) || _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, options.renderer);
|
|
3550
|
+
const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _306 => _306.integrations]) || options.integrations;
|
|
3551
|
+
const root = _optionalChain([resolvedConfig, 'optionalAccess', _307 => _307.root]) || _optionalChain([server, 'optionalAccess', _308 => _308.config, 'access', _309 => _309.root]) || process.cwd();
|
|
3552
|
+
const docs = _optionalChain([resolvedConfig, 'optionalAccess', _310 => _310.docs]);
|
|
3496
3553
|
const adapterOwnsDocsRuntime = Boolean(
|
|
3497
|
-
_chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess',
|
|
3554
|
+
_chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _311 => _311.adapter, 'optionalAccess', _312 => _312.server]) && docs.adapter.react
|
|
3498
3555
|
);
|
|
3499
|
-
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3556
|
+
const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _313 => _313.devtools]), () => ( _chunkSTF6VDYQcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
|
|
3500
3557
|
const [docsRuntime, docsSearchRuntime, devtoolsClientRuntime] = await Promise.all([
|
|
3501
|
-
_optionalChain([docs, 'optionalAccess',
|
|
3502
|
-
_optionalChain([docs, 'optionalAccess',
|
|
3558
|
+
_optionalChain([docs, 'optionalAccess', _314 => _314.enabled]) ? loadFarmDocsDevRuntime() : null,
|
|
3559
|
+
_optionalChain([docs, 'optionalAccess', _315 => _315.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
|
|
3503
3560
|
devtools.enabled ? loadFarmDevtoolsClientRuntime() : null
|
|
3504
3561
|
]);
|
|
3505
|
-
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess',
|
|
3562
|
+
const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _316 => _316.isFarmDocsSearchEnabled, 'call', _317 => _317(docs)]), () => ( false));
|
|
3506
3563
|
const generatedDocsSearchRuntime = docsSearchRuntime ? docsSearchRuntime.generateFarmDocsSearchClientRuntime(
|
|
3507
3564
|
docsSearchEnabled,
|
|
3508
3565
|
docsSearchEnabled ? docsSearchRuntime.resolveFarmDocsSearchClientModule(root) : void 0
|
|
@@ -3510,10 +3567,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3510
3567
|
const generatedDevtoolsClientRuntime = devtoolsClientRuntime ? devtoolsClientRuntime.generateFarmDevtoolsClientRuntime(devtools) : "";
|
|
3511
3568
|
const generatedDevIndicatorsClientRuntime = farmApp ? _chunkBPNOYILCcjs.generateFarmDevIndicatorsClientRuntime.call(void 0, farmApp.getConfig().devIndicators) : "";
|
|
3512
3569
|
const integrationProviders = _chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) ? _chunkI32V5CZLcjs.getIntegrationProviders.call(void 0, integrations) : [];
|
|
3513
|
-
const isolatedHydrationMode =
|
|
3514
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3570
|
+
const isolatedHydrationMode = _chunkQN5WRQSQcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
|
|
3571
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _318 => _318.experimental, 'optionalAccess', _319 => _319.isolatedClientHydration]),
|
|
3515
3572
|
{
|
|
3516
|
-
serverComponents: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess',
|
|
3573
|
+
serverComponents: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _320 => _320.experimental, 'optionalAccess', _321 => _321.serverComponents])) === "rsc",
|
|
3517
3574
|
hasUnsupportedIntegrationProvider: integrationProviders.filter((provider) => provider.component || provider.type === "clerk").some((provider) => provider.supportsIsolatedHydration !== true)
|
|
3518
3575
|
}
|
|
3519
3576
|
);
|
|
@@ -3521,32 +3578,32 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
3521
3578
|
integrationProviders,
|
|
3522
3579
|
[
|
|
3523
3580
|
..._chunkI32V5CZLcjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
|
|
3524
|
-
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess',
|
|
3581
|
+
..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _322 => _322.getFarmDocsDocumentNavigationMatchers, 'call', _323 => _323(docs)]), () => ( []))
|
|
3525
3582
|
],
|
|
3526
3583
|
generatedDocsSearchRuntime,
|
|
3527
3584
|
`${generatedDevtoolsClientRuntime}
|
|
3528
3585
|
${generatedDevIndicatorsClientRuntime}`,
|
|
3529
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3586
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _324 => _324.plugins]) || [],
|
|
3530
3587
|
root,
|
|
3531
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3532
|
-
_optionalChain([resolvedConfig, 'optionalAccess',
|
|
3533
|
-
_chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess',
|
|
3588
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _325 => _325.srcDir]) || options.srcDir || "src",
|
|
3589
|
+
_optionalChain([resolvedConfig, 'optionalAccess', _326 => _326.publicRuntimeConfig]) || options.publicRuntimeConfig,
|
|
3590
|
+
_chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _327 => _327.adapter, 'optionalAccess', _328 => _328.react]) : void 0,
|
|
3534
3591
|
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
|
-
|
|
3592
|
+
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,
|
|
3593
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _334 => _334.trailingSlash]), () => ( false)),
|
|
3594
|
+
_nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _335 => _335.basePath]), () => ( "/")),
|
|
3595
|
+
_chunkQN5WRQSQcjs.generateClientCachePersistenceCode.call(void 0,
|
|
3596
|
+
_chunkQN5WRQSQcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, _optionalChain([resolvedConfig, 'optionalAccess', _336 => _336.cache]))
|
|
3540
3597
|
),
|
|
3541
3598
|
_chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0,
|
|
3542
|
-
_chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess',
|
|
3599
|
+
_chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _337 => _337.experimental, 'optionalAccess', _338 => _338.serverComponents])) === "islands"
|
|
3543
3600
|
);
|
|
3544
3601
|
}
|
|
3545
3602
|
if (id === "/@farm/server") {
|
|
3546
3603
|
return generateServerCode();
|
|
3547
3604
|
}
|
|
3548
3605
|
if (id === "/@farm/manifest") {
|
|
3549
|
-
const routeManager = _optionalChain([farmApp, 'optionalAccess',
|
|
3606
|
+
const routeManager = _optionalChain([farmApp, 'optionalAccess', _339 => _339.getRouteManager, 'call', _340 => _340()]);
|
|
3550
3607
|
if (!routeManager) {
|
|
3551
3608
|
return `
|
|
3552
3609
|
export const getManifest = () => ({
|
|
@@ -3559,9 +3616,9 @@ export const getManifest = () => ({
|
|
|
3559
3616
|
`;
|
|
3560
3617
|
}
|
|
3561
3618
|
const manifest = routeManager.generateClientManifest(server.config.root);
|
|
3562
|
-
const globalStylesheetHref =
|
|
3619
|
+
const globalStylesheetHref = _chunkQN5WRQSQcjs.resolveDevGlobalStylesheetHref.call(void 0,
|
|
3563
3620
|
server.config.root,
|
|
3564
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
3621
|
+
_optionalChain([farmApp, 'optionalAccess', _341 => _341.getConfig, 'call', _342 => _342(), 'access', _343 => _343.srcDir])
|
|
3565
3622
|
);
|
|
3566
3623
|
const fullManifest = {
|
|
3567
3624
|
clientEntry: "/@farm/client.js",
|
|
@@ -3617,22 +3674,42 @@ export const manifest = getManifest();
|
|
|
3617
3674
|
}
|
|
3618
3675
|
},
|
|
3619
3676
|
async transform(code, id, transformOptions) {
|
|
3620
|
-
const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3677
|
+
const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _344 => _344.getConfig, 'call', _345 => _345()]), () => ( options));
|
|
3621
3678
|
let rewrotePackageImports = false;
|
|
3622
|
-
if (_chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access',
|
|
3679
|
+
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) && !_chunkQN5WRQSQcjs.hasUseClientDirective.call(void 0, code)) {
|
|
3623
3680
|
const file = id.split("?", 1)[0];
|
|
3624
|
-
const projectRoot = actionConfig.root || _optionalChain([server, 'optionalAccess',
|
|
3625
|
-
|
|
3681
|
+
const projectRoot = actionConfig.root || _optionalChain([server, 'optionalAccess', _349 => _349.config, 'access', _350 => _350.root]) || process.cwd();
|
|
3682
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _351 => _351.ssr]) === true) {
|
|
3683
|
+
if (farmReactServerFiles.has(file)) {
|
|
3684
|
+
for (const child of _chunkQN5WRQSQcjs.farmRelativeImportFiles.call(void 0, code, file))
|
|
3685
|
+
farmReactServerFiles.add(child);
|
|
3686
|
+
}
|
|
3687
|
+
const serverModule = farmReactServerFiles.has(file) || !_chunkQN5WRQSQcjs.getFarmClientReachableModules.call(void 0,
|
|
3688
|
+
path6.resolve(projectRoot, actionConfig.srcDir || "src"),
|
|
3689
|
+
projectRoot
|
|
3690
|
+
).has(path6.resolve(file));
|
|
3691
|
+
const reactServer = !serverModule ? null : _chunkQN5WRQSQcjs.rewriteFarmReactServerImports.call(void 0, {
|
|
3692
|
+
code,
|
|
3693
|
+
file,
|
|
3694
|
+
reference: (specifier, exportName) => _chunkQN5WRQSQcjs.ensureFarmPackageClientReference.call(void 0, projectRoot, specifier, exportName),
|
|
3695
|
+
onServerFile: (serverFile) => farmReactServerFiles.add(serverFile)
|
|
3696
|
+
});
|
|
3697
|
+
if (reactServer !== null) {
|
|
3698
|
+
code = reactServer;
|
|
3699
|
+
rewrotePackageImports = true;
|
|
3700
|
+
}
|
|
3701
|
+
}
|
|
3702
|
+
const referenced = _chunkQN5WRQSQcjs.rewriteFarmPackageClientImports.call(void 0, {
|
|
3626
3703
|
code,
|
|
3627
3704
|
file,
|
|
3628
3705
|
root: projectRoot,
|
|
3629
|
-
isClientPackage: (specifier) =>
|
|
3706
|
+
isClientPackage: (specifier) => _chunkQN5WRQSQcjs.isFarmPackageClientBoundary.call(void 0, file, specifier, projectRoot)
|
|
3630
3707
|
});
|
|
3631
3708
|
if (referenced !== null) {
|
|
3632
3709
|
code = referenced;
|
|
3633
3710
|
rewrotePackageImports = true;
|
|
3634
3711
|
}
|
|
3635
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
3712
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _352 => _352.ssr]) === true) {
|
|
3636
3713
|
const cached = rewriteFarmReactCacheImport(code, file);
|
|
3637
3714
|
if (cached !== null) {
|
|
3638
3715
|
code = cached;
|
|
@@ -3642,43 +3719,43 @@ export const manifest = getManifest();
|
|
|
3642
3719
|
}
|
|
3643
3720
|
if (islandsServerFns() && !_chunkPIUTGRDIcjs.isFarmServerFnBoundaryId.call(void 0, id) && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
|
|
3644
3721
|
const serverFns = _chunkPIUTGRDIcjs.transformFarmServerFns.call(void 0, code, id, {
|
|
3645
|
-
environment: _optionalChain([transformOptions, 'optionalAccess',
|
|
3722
|
+
environment: _optionalChain([transformOptions, 'optionalAccess', _353 => _353.ssr]) === true ? "rsc" : "client"
|
|
3646
3723
|
});
|
|
3647
3724
|
if (serverFns) {
|
|
3648
3725
|
if (!serverFns.code.includes("use server")) return { code: serverFns.code, map: null };
|
|
3649
3726
|
code = serverFns.code;
|
|
3650
3727
|
}
|
|
3651
3728
|
}
|
|
3652
|
-
if (_chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access',
|
|
3729
|
+
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
3730
|
const file = id.split("?", 1)[0];
|
|
3654
3731
|
const actionModule = transformFarmFormActionModule({
|
|
3655
3732
|
code,
|
|
3656
3733
|
id,
|
|
3657
|
-
root: actionConfig.root || _optionalChain([server, 'optionalAccess',
|
|
3658
|
-
ssr: _optionalChain([transformOptions, 'optionalAccess',
|
|
3734
|
+
root: actionConfig.root || _optionalChain([server, 'optionalAccess', _356 => _356.config, 'access', _357 => _357.root]) || process.cwd(),
|
|
3735
|
+
ssr: _optionalChain([transformOptions, 'optionalAccess', _358 => _358.ssr]) === true,
|
|
3659
3736
|
// Parsed by file type: page components are TSX.
|
|
3660
3737
|
parse: (source) => _vite.parseSync.call(void 0, file, source).program
|
|
3661
3738
|
});
|
|
3662
3739
|
if (actionModule) return { code: actionModule, map: null };
|
|
3663
3740
|
}
|
|
3664
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
3665
|
-
const docsConfigModule = _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess',
|
|
3666
|
-
if (
|
|
3667
|
-
const redacted =
|
|
3741
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _359 => _359.ssr])) {
|
|
3742
|
+
const docsConfigModule = _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess', _360 => _360.getConfig, 'call', _361 => _361(), 'optionalAccess', _362 => _362.docs]));
|
|
3743
|
+
if (_chunkQN5WRQSQcjs.isFarmDocsClientConfigModule.call(void 0, id, docsConfigModule)) {
|
|
3744
|
+
const redacted = _chunkQN5WRQSQcjs.redactFarmDocsClientConfig.call(void 0, code, id.split("?")[0]);
|
|
3668
3745
|
if (redacted !== null) return { code: redacted, map: null };
|
|
3669
3746
|
}
|
|
3670
3747
|
}
|
|
3671
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
3672
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3673
|
-
if ((_optionalChain([currentConfig, 'access',
|
|
3748
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _363 => _363.ssr])) {
|
|
3749
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _364 => _364.getConfig, 'call', _365 => _365()]), () => ( options));
|
|
3750
|
+
if ((_optionalChain([currentConfig, 'access', _366 => _366.experimental, 'optionalAccess', _367 => _367.serverActions]) !== true || !serverFnTransformActive) && !islandsServerFns()) {
|
|
3674
3751
|
const violation = findClientServerFnViolation(code, id);
|
|
3675
3752
|
if (violation) {
|
|
3676
3753
|
this.error(formatServerFnBoundaryError(violation, id));
|
|
3677
3754
|
}
|
|
3678
3755
|
}
|
|
3679
3756
|
}
|
|
3680
|
-
if (!_optionalChain([transformOptions, 'optionalAccess',
|
|
3681
|
-
warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3757
|
+
if (!_optionalChain([transformOptions, 'optionalAccess', _368 => _368.ssr]) && shouldInspectClientBoundary(id, code)) {
|
|
3758
|
+
warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _369 => _369.getConfig, 'call', _370 => _370()]), () => ( options)));
|
|
3682
3759
|
}
|
|
3683
3760
|
if (typeof imageImports.transform === "function") {
|
|
3684
3761
|
const imageModule = await imageImports.transform.call(this, code, id, transformOptions);
|
|
@@ -3693,13 +3770,13 @@ export const manifest = getManifest();
|
|
|
3693
3770
|
id,
|
|
3694
3771
|
transformOptions
|
|
3695
3772
|
);
|
|
3696
|
-
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess',
|
|
3773
|
+
const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _371 => _371.code, 'optionalAccess', _372 => _372.toString, 'call', _373 => _373()]);
|
|
3697
3774
|
if (fontCode) {
|
|
3698
3775
|
transformedCode = fontCode;
|
|
3699
3776
|
transformed = true;
|
|
3700
3777
|
}
|
|
3701
3778
|
}
|
|
3702
|
-
if (_optionalChain([transformOptions, 'optionalAccess',
|
|
3779
|
+
if (_optionalChain([transformOptions, 'optionalAccess', _374 => _374.ssr]) && server) {
|
|
3703
3780
|
const rewrittenImports = rewriteEarlySsrRelativeImports({
|
|
3704
3781
|
code: transformedCode,
|
|
3705
3782
|
id,
|
|
@@ -3711,25 +3788,25 @@ export const manifest = getManifest();
|
|
|
3711
3788
|
transformed = true;
|
|
3712
3789
|
}
|
|
3713
3790
|
}
|
|
3714
|
-
if (
|
|
3791
|
+
if (_chunkQN5WRQSQcjs.hasUseClientDirective.call(void 0, transformedCode)) {
|
|
3715
3792
|
const clientBoundarySource = transformedCode;
|
|
3716
3793
|
const moduleInfo = this.getModuleInfo(id);
|
|
3717
3794
|
if (moduleInfo) {
|
|
3718
3795
|
moduleInfo.isClientComponent = true;
|
|
3719
3796
|
}
|
|
3720
|
-
transformedCode =
|
|
3797
|
+
transformedCode = _chunkQN5WRQSQcjs.stripUseClientDirective.call(void 0, transformedCode);
|
|
3721
3798
|
transformed = true;
|
|
3722
|
-
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess',
|
|
3799
|
+
const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _375 => _375.getConfig, 'call', _376 => _376()]), () => ( options));
|
|
3723
3800
|
let isolatedModuleReference = null;
|
|
3724
|
-
const root = currentConfig.root || _optionalChain([server, 'optionalAccess',
|
|
3801
|
+
const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _377 => _377.config, 'access', _378 => _378.root]) || process.cwd();
|
|
3725
3802
|
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 &&
|
|
3803
|
+
const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _379 => _379.getRouteManager, 'call', _380 => _380(), 'access', _381 => _381.getIsolatedClientBoundaryModules, 'call', _382 => _382(root)])));
|
|
3804
|
+
const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _383 => _383.has, 'call', _384 => _384(path6.resolve(cleanId))]) === true;
|
|
3805
|
+
if (_chunkRD623KW4cjs.isReactRenderer.call(void 0, _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && _chunkQN5WRQSQcjs.isIsolatableClientBoundarySource.call(void 0, clientBoundarySource)) {
|
|
3729
3806
|
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 ?
|
|
3807
|
+
const islandsMode = _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([currentConfig, 'access', _385 => _385.experimental, 'optionalAccess', _386 => _386.serverComponents])) === "islands";
|
|
3808
|
+
const explicitStrategy = _chunkQN5WRQSQcjs.getIslandStrategyExport.call(void 0, clientBoundarySource);
|
|
3809
|
+
const inference = islandsMode && explicitStrategy === null ? _chunkQN5WRQSQcjs.inferFarmIslandStrategy.call(void 0, cleanId, root) : null;
|
|
3733
3810
|
if (inference) {
|
|
3734
3811
|
for (const file of inference.files) {
|
|
3735
3812
|
if (file !== path6.resolve(cleanId)) this.addWatchFile(file);
|
|
@@ -3742,7 +3819,7 @@ export const manifest = getManifest();
|
|
|
3742
3819
|
islandStrategy: _nullishCoalesce(explicitStrategy, () => ( "load")),
|
|
3743
3820
|
parse: (source) => this.parse(source),
|
|
3744
3821
|
slots: islandsMode,
|
|
3745
|
-
inferredInteraction: _optionalChain([inference, 'optionalAccess',
|
|
3822
|
+
inferredInteraction: _optionalChain([inference, 'optionalAccess', _387 => _387.strategy]) === "interaction"
|
|
3746
3823
|
});
|
|
3747
3824
|
if (!transformedBoundary) {
|
|
3748
3825
|
this.error(
|
|
@@ -3772,7 +3849,7 @@ export const manifest = getManifest();
|
|
|
3772
3849
|
);
|
|
3773
3850
|
return;
|
|
3774
3851
|
}` : "";
|
|
3775
|
-
const hmrCode = _optionalChain([transformOptions, 'optionalAccess',
|
|
3852
|
+
const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _388 => _388.ssr]) || reactRefreshActive || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
|
|
3776
3853
|
if (import.meta.hot) {
|
|
3777
3854
|
import.meta.hot.accept((newModule) => {
|
|
3778
3855
|
${isolatedHmrUpdate}
|
|
@@ -3827,14 +3904,14 @@ if (import.meta.hot) {
|
|
|
3827
3904
|
}
|
|
3828
3905
|
_chunkQMNWKQL4cjs.logger.info(`Found ${ssgPages.length} SSG pages, ${ssrRoutes.length} SSR routes`);
|
|
3829
3906
|
_chunkQMNWKQL4cjs.logger.info("Pre-rendering SSG pages...");
|
|
3830
|
-
const outDir = path6.join(_optionalChain([server, 'optionalAccess',
|
|
3907
|
+
const outDir = path6.join(_optionalChain([server, 'optionalAccess', _389 => _389.config, 'access', _390 => _390.root]) || process.cwd(), options.outDir || "dist");
|
|
3831
3908
|
const clientDir = path6.join(outDir, "client");
|
|
3832
3909
|
for (const page of ssgPages) {
|
|
3833
3910
|
try {
|
|
3834
3911
|
const staticRequest = new Request(new URL(page.urlPath, "http://farm.static"));
|
|
3835
3912
|
await farmApp.getServerRenderer().runWithRequestContext(staticRequest, async () => {
|
|
3836
3913
|
const mod = await routeManager.loadRouteModule(page.filePath);
|
|
3837
|
-
if (!_optionalChain([mod, 'optionalAccess',
|
|
3914
|
+
if (!_optionalChain([mod, 'optionalAccess', _391 => _391.default])) return;
|
|
3838
3915
|
const { layouts } = routeManager.matchRoute(page.urlPath);
|
|
3839
3916
|
const layoutModules = await Promise.all(
|
|
3840
3917
|
layouts.map((l) => routeManager.loadLayoutModule(l.modulePath))
|
|
@@ -3866,7 +3943,7 @@ if (import.meta.hot) {
|
|
|
3866
3943
|
const i18nSnapshot = _chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0, );
|
|
3867
3944
|
const i18nHead = renderFarmI18nStaticHead(page.urlPath, i18nSnapshot);
|
|
3868
3945
|
const fullHtml = `<!DOCTYPE html>
|
|
3869
|
-
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess',
|
|
3946
|
+
<html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _392 => _392.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
|
|
3870
3947
|
<head>
|
|
3871
3948
|
<meta charset="utf-8">
|
|
3872
3949
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
@@ -3908,6 +3985,9 @@ if (import.meta.hot) {
|
|
|
3908
3985
|
_chunkQMNWKQL4cjs.logger.error(`SSG build failed: ${error}`);
|
|
3909
3986
|
}
|
|
3910
3987
|
},
|
|
3988
|
+
watchChange() {
|
|
3989
|
+
_chunkQN5WRQSQcjs.invalidateFarmClientReachableModules.call(void 0, );
|
|
3990
|
+
},
|
|
3911
3991
|
async handleHotUpdate(ctx) {
|
|
3912
3992
|
const { file, server: server2, modules } = ctx;
|
|
3913
3993
|
if (initialPluginManager) {
|
|
@@ -3930,13 +4010,13 @@ if (import.meta.hot) {
|
|
|
3930
4010
|
server2.moduleGraph.invalidateModule(mod);
|
|
3931
4011
|
}
|
|
3932
4012
|
}
|
|
3933
|
-
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess',
|
|
4013
|
+
const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _393 => _393.getConfig, 'call', _394 => _394()]);
|
|
3934
4014
|
const normalizedFile = file.replace(/\\/g, "/");
|
|
3935
4015
|
if (currentFarmConfig && /\/route\.(?:ts|tsx|js|jsx)$/.test(normalizedFile) && _chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, currentFarmConfig).some(
|
|
3936
4016
|
(appDir) => normalizedFile.startsWith(`${_chunkQMNWKQL4cjs.toPosixPath.call(void 0, appDir)}/api/`)
|
|
3937
4017
|
)) {
|
|
3938
4018
|
for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
|
|
3939
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
4019
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _395 => _395(`updated ${file}`)]);
|
|
3940
4020
|
server2.ws.send({ type: "full-reload", path: "*" });
|
|
3941
4021
|
return [];
|
|
3942
4022
|
}
|
|
@@ -3946,7 +4026,7 @@ if (import.meta.hot) {
|
|
|
3946
4026
|
for (const mod of modules) {
|
|
3947
4027
|
server2.moduleGraph.invalidateModule(mod);
|
|
3948
4028
|
}
|
|
3949
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
4029
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _396 => _396(`updated ${file}`)]);
|
|
3950
4030
|
server2.ws.send({
|
|
3951
4031
|
type: "full-reload",
|
|
3952
4032
|
path: "*"
|
|
@@ -3959,7 +4039,7 @@ if (import.meta.hot) {
|
|
|
3959
4039
|
for (const mod of modules) {
|
|
3960
4040
|
server2.moduleGraph.invalidateModule(mod);
|
|
3961
4041
|
}
|
|
3962
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
4042
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _397 => _397(`updated ${file}`)]);
|
|
3963
4043
|
server2.ws.send({
|
|
3964
4044
|
type: "full-reload",
|
|
3965
4045
|
path: "*"
|
|
@@ -3967,12 +4047,12 @@ if (import.meta.hot) {
|
|
|
3967
4047
|
return [];
|
|
3968
4048
|
}
|
|
3969
4049
|
if (apiRouteManager && _chunkJYNNIGQOcjs.invalidateFarmDevDependents.call(void 0, server2, file, apiRouteManager.getSourceFiles()).length > 0) {
|
|
3970
|
-
await _optionalChain([refreshRouteDiscovery, 'optionalCall',
|
|
4050
|
+
await _optionalChain([refreshRouteDiscovery, 'optionalCall', _398 => _398(`updated ${file}`)]);
|
|
3971
4051
|
}
|
|
3972
|
-
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
3973
|
-
const planRouteManager = _optionalChain([farmApp, 'optionalAccess',
|
|
4052
|
+
const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _399 => _399.experimental, 'optionalAccess', _400 => _400.isolatedClientHydration]);
|
|
4053
|
+
const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _401 => _401.getRouteManager, 'call', _402 => _402()]);
|
|
3974
4054
|
const isHydrationPlanSource = currentSrcRoot !== null && normalizedFile.startsWith(`${currentSrcRoot}/`) && /\.[cm]?[jt]sx?$/.test(normalizedFile);
|
|
3975
|
-
const tracksAsyncOwnerIslands = _chunkRD623KW4cjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess',
|
|
4055
|
+
const tracksAsyncOwnerIslands = _chunkRD623KW4cjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _403 => _403.renderer])) && planRouteManager !== void 0;
|
|
3976
4056
|
if (isHydrationPlanSource && (isolatedHydrationMode === "enabled" || isolatedHydrationMode === "analyze" || tracksAsyncOwnerIslands)) {
|
|
3977
4057
|
const routeManager = planRouteManager;
|
|
3978
4058
|
if (routeManager) {
|
|
@@ -4032,7 +4112,7 @@ if (import.meta.hot) {
|
|
|
4032
4112
|
}
|
|
4033
4113
|
return [];
|
|
4034
4114
|
}
|
|
4035
|
-
_optionalChain([farmApp, 'optionalAccess',
|
|
4115
|
+
_optionalChain([farmApp, 'optionalAccess', _404 => _404.getRouteManager, 'call', _405 => _405(), 'access', _406 => _406.invalidateClientManifest, 'call', _407 => _407()]);
|
|
4036
4116
|
const manifestModule = server2.moduleGraph.getModuleById("/@farm/manifest");
|
|
4037
4117
|
if (manifestModule) {
|
|
4038
4118
|
server2.moduleGraph.invalidateModule(manifestModule);
|
|
@@ -4097,12 +4177,12 @@ function isFarmClientVirtualId(id) {
|
|
|
4097
4177
|
}
|
|
4098
4178
|
function isClientEnvironment(context, loadOptions) {
|
|
4099
4179
|
const environment = context.environment;
|
|
4100
|
-
if (_optionalChain([environment, 'optionalAccess',
|
|
4101
|
-
if (_optionalChain([environment, 'optionalAccess',
|
|
4102
|
-
return _optionalChain([loadOptions, 'optionalAccess',
|
|
4180
|
+
if (_optionalChain([environment, 'optionalAccess', _408 => _408.config, 'optionalAccess', _409 => _409.consumer])) return environment.config.consumer === "client";
|
|
4181
|
+
if (_optionalChain([environment, 'optionalAccess', _410 => _410.name])) return environment.name === "client";
|
|
4182
|
+
return _optionalChain([loadOptions, 'optionalAccess', _411 => _411.ssr]) !== true;
|
|
4103
4183
|
}
|
|
4104
4184
|
function invalidateProgrammaticClientRouteModules(server) {
|
|
4105
|
-
const graph = _optionalChain([server, 'access',
|
|
4185
|
+
const graph = _optionalChain([server, 'access', _412 => _412.environments, 'optionalAccess', _413 => _413.client, 'optionalAccess', _414 => _414.moduleGraph]);
|
|
4106
4186
|
if (!graph) return;
|
|
4107
4187
|
for (const [id, module] of graph.idToModuleMap) {
|
|
4108
4188
|
if (_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id)) graph.invalidateModule(module);
|
|
@@ -4116,7 +4196,7 @@ function generateProgrammaticClientRouteModuleForId(moduleId, root, renderer, cl
|
|
|
4116
4196
|
kind: parsed.kind,
|
|
4117
4197
|
routePath: parsed.routePath,
|
|
4118
4198
|
routesFile,
|
|
4119
|
-
route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess',
|
|
4199
|
+
route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess', _415 => _415.routes, 'access', _416 => _416.get, 'call', _417 => _417(
|
|
4120
4200
|
_chunkNK2VWS7Pcjs.programmaticClientRouteKey.call(void 0, routesFile, parsed.kind, parsed.routePath)
|
|
4121
4201
|
)]),
|
|
4122
4202
|
rendererServer: renderer.server,
|
|
@@ -4124,7 +4204,7 @@ function generateProgrammaticClientRouteModuleForId(moduleId, root, renderer, cl
|
|
|
4124
4204
|
});
|
|
4125
4205
|
}
|
|
4126
4206
|
function resolveRealModuleFile(filePath, root) {
|
|
4127
|
-
const resolved = _nullishCoalesce(
|
|
4207
|
+
const resolved = _nullishCoalesce(_chunkQN5WRQSQcjs.resolveModuleSourcePath.call(void 0, filePath, root), () => ( filePath));
|
|
4128
4208
|
try {
|
|
4129
4209
|
return _chunkQMNWKQL4cjs.toPosixPath.call(void 0, fs2.realpathSync(resolved));
|
|
4130
4210
|
} catch (e17) {
|
|
@@ -4438,12 +4518,12 @@ async function parseRouteModuleProps(routeModule, input) {
|
|
|
4438
4518
|
}
|
|
4439
4519
|
const schemas = routeModule.__farmRouteSchemas;
|
|
4440
4520
|
const params = parseRouteModuleSchema(
|
|
4441
|
-
_optionalChain([schemas, 'optionalAccess',
|
|
4521
|
+
_optionalChain([schemas, 'optionalAccess', _418 => _418.params]),
|
|
4442
4522
|
input.props.params,
|
|
4443
4523
|
"params",
|
|
4444
4524
|
input.routePath
|
|
4445
4525
|
);
|
|
4446
|
-
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess',
|
|
4526
|
+
const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _419 => _419.search]), input.search, "search", input.routePath);
|
|
4447
4527
|
return {
|
|
4448
4528
|
...input.props,
|
|
4449
4529
|
params,
|
|
@@ -4463,12 +4543,12 @@ function parseRouteModuleSchema(schema, value, label, routePath) {
|
|
|
4463
4543
|
}
|
|
4464
4544
|
}
|
|
4465
4545
|
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 =
|
|
4546
|
+
const providerClientCode = _chunkQN5WRQSQcjs.generateFarmIntegrationProviderClientCode.call(void 0,
|
|
4467
4547
|
integrationProviders,
|
|
4468
4548
|
root,
|
|
4469
4549
|
_nullishCoalesce(renderer.componentExtensions, () => ( []))
|
|
4470
4550
|
);
|
|
4471
|
-
const clientPluginEntry =
|
|
4551
|
+
const clientPluginEntry = _chunkQN5WRQSQcjs.generateFarmClientPluginEntryCode.call(void 0,
|
|
4472
4552
|
plugins,
|
|
4473
4553
|
root,
|
|
4474
4554
|
srcDir,
|
|
@@ -4516,7 +4596,7 @@ async function createFarmServerTreePageElement(source, pathname) {
|
|
|
4516
4596
|
return null;
|
|
4517
4597
|
}
|
|
4518
4598
|
}
|
|
4519
|
-
${islandValues ? `${
|
|
4599
|
+
${islandValues ? `${_chunkQN5WRQSQcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
|
|
4520
4600
|
let farmLastRouteState = null;
|
|
4521
4601
|
|
|
4522
4602
|
// A hot update to a layout tree's client module renders the route again.
|
|
@@ -5327,7 +5407,7 @@ async function loadLayoutComponents(layouts = [], params = {}, source) {
|
|
|
5327
5407
|
return loadedLayouts;
|
|
5328
5408
|
}
|
|
5329
5409
|
|
|
5330
|
-
${
|
|
5410
|
+
${_chunkQN5WRQSQcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
|
|
5331
5411
|
function wrapWithLoadedLayouts(element, loadedLayouts, params) {
|
|
5332
5412
|
let wrapped = element;
|
|
5333
5413
|
for (let index = loadedLayouts.length - 1; index >= 0; index--) {
|
|
@@ -5684,7 +5764,7 @@ function replaceNavigationBoundary(
|
|
|
5684
5764
|
return nextTarget;
|
|
5685
5765
|
}
|
|
5686
5766
|
|
|
5687
|
-
${islandValues ? `${
|
|
5767
|
+
${islandValues ? `${_chunkQN5WRQSQcjs.FARM_NAVIGATION_STREAM_READER_SOURCE}
|
|
5688
5768
|
|
|
5689
5769
|
// Islands mode navigates as the production client does: it fetches the page itself, names the
|
|
5690
5770
|
// layouts it shows by key (F-Layouts), and asks for flush markers (F-Stream), so the shell arrives
|
|
@@ -6368,7 +6448,7 @@ function generateClientManifest(bundle) {
|
|
|
6368
6448
|
async function defineConfig(config = {}) {
|
|
6369
6449
|
const tailwindVitePlugin = await _chunkR53QDV6Tcjs.loadTailwindVitePlugin.call(void 0, );
|
|
6370
6450
|
const appRoot = path6.resolve(config.root || process.cwd());
|
|
6371
|
-
if (_optionalChain([config, 'access',
|
|
6451
|
+
if (_optionalChain([config, 'access', _420 => _420.extends, 'optionalAccess', _421 => _421.length])) {
|
|
6372
6452
|
const { config: layeredConfig } = await import("./layers-DMRXRL7F.cjs").then(
|
|
6373
6453
|
({ resolveFarmLayers }) => resolveFarmLayers(config, {
|
|
6374
6454
|
root: appRoot,
|
|
@@ -6378,7 +6458,7 @@ async function defineConfig(config = {}) {
|
|
|
6378
6458
|
config = layeredConfig;
|
|
6379
6459
|
}
|
|
6380
6460
|
config.renderer = _chunkRD623KW4cjs.resolveFarmRenderer.call(void 0, config.renderer);
|
|
6381
|
-
config.images =
|
|
6461
|
+
config.images = _chunkQN5WRQSQcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, { root: appRoot, dev: true });
|
|
6382
6462
|
const rendererVitePlugins = await _chunkRD623KW4cjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, appRoot, {
|
|
6383
6463
|
ssr: true
|
|
6384
6464
|
});
|
|
@@ -6470,13 +6550,13 @@ async function defineConfig(config = {}) {
|
|
|
6470
6550
|
if (!serverStarted) {
|
|
6471
6551
|
serverStarted = true;
|
|
6472
6552
|
const elapsed = Date.now() - startTime;
|
|
6473
|
-
const address = _optionalChain([server, 'access',
|
|
6553
|
+
const address = _optionalChain([server, 'access', _422 => _422.httpServer, 'optionalAccess', _423 => _423.address, 'call', _424 => _424()]);
|
|
6474
6554
|
const resolvedPort = typeof address === "object" && address ? address.port : server.config.server.port || port || 3e3;
|
|
6475
6555
|
const hostConfig = server.config.server.host;
|
|
6476
6556
|
const isExposed = hostConfig === true || hostConfig === "0.0.0.0";
|
|
6477
6557
|
console.log("");
|
|
6478
6558
|
console.log(
|
|
6479
|
-
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${
|
|
6559
|
+
` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkFNHN3RBDcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
|
|
6480
6560
|
);
|
|
6481
6561
|
console.log("");
|
|
6482
6562
|
console.log(
|
|
@@ -6510,7 +6590,7 @@ async function defineConfig(config = {}) {
|
|
|
6510
6590
|
plugins: [
|
|
6511
6591
|
// `farm dev --desktop`: only the desktop window gets an answer, as in the packaged app.
|
|
6512
6592
|
_chunk65Y5SIBHcjs.farmDesktopDevGuardPlugin.call(void 0, config.basePath),
|
|
6513
|
-
|
|
6593
|
+
_chunkQN5WRQSQcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
|
|
6514
6594
|
tailwindVitePlugin,
|
|
6515
6595
|
...rendererVitePlugins,
|
|
6516
6596
|
...reactRefreshPlugins,
|
|
@@ -6524,8 +6604,8 @@ async function defineConfig(config = {}) {
|
|
|
6524
6604
|
customLogger: farmLogger,
|
|
6525
6605
|
clearScreen: false,
|
|
6526
6606
|
optimizeDeps: {
|
|
6527
|
-
...
|
|
6528
|
-
|
|
6607
|
+
..._chunkQN5WRQSQcjs.createFarmClientOptimizeDepsConfig.call(void 0,
|
|
6608
|
+
_chunkQN5WRQSQcjs.createFarmClientOptimizeDepsEntries.call(void 0,
|
|
6529
6609
|
appRoot,
|
|
6530
6610
|
_chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, { ...config, root: appRoot })
|
|
6531
6611
|
),
|
|
@@ -6568,7 +6648,7 @@ async function defineConfig(config = {}) {
|
|
|
6568
6648
|
// Stub out problematic server-only modules during dev mode
|
|
6569
6649
|
alias: {
|
|
6570
6650
|
..._chunk5Y2P454Ocjs.getFarmLayerAliases.call(void 0, config.layers),
|
|
6571
|
-
...
|
|
6651
|
+
..._chunkQN5WRQSQcjs.createFarmSourceAlias.call(void 0, appRoot, config.srcDir),
|
|
6572
6652
|
// Nitro internals that should not be resolved in browser
|
|
6573
6653
|
"supports-color": "data:text/javascript,export default false; export const supportsColor = false; export const stdout = false; export const stderr = false;",
|
|
6574
6654
|
"@poppinss/dumper": "data:text/javascript,export default {};",
|